@angular/material 20.0.4 → 20.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_index.scss +0 -1
- package/autocomplete/_m2-autocomplete.scss +5 -15
- package/badge/_badge-theme.scss +2 -2
- package/badge/_m2-badge.scss +13 -34
- package/bottom-sheet/_m2-bottom-sheet.scss +6 -15
- package/button/_button-theme.scss +2 -2
- package/button/_fab-theme.scss +2 -2
- package/button/_icon-button-theme.scss +2 -2
- package/button/_m2-button.scss +83 -127
- package/button/_m2-fab.scss +40 -68
- package/button/_m2-icon-button.scss +18 -30
- package/button/testing/index.d.ts +0 -1
- package/button-toggle/_button-toggle-theme.scss +2 -1
- package/button-toggle/_m2-button-toggle.scss +24 -49
- package/card/_m2-card.scss +9 -18
- package/checkbox/_checkbox-theme.scss +4 -3
- package/checkbox/_m2-checkbox.scss +33 -62
- package/chips/_chips-theme.scss +7 -4
- package/chips/_m2-chip.scss +22 -47
- package/chips/index.d.ts +56 -4
- package/chips/testing/index.d.ts +23 -2
- package/core/_m2-app.scss +6 -19
- package/core/m2/_theming.scss +89 -79
- package/core/option/_m2-optgroup.scss +3 -13
- package/core/option/_m2-option.scss +14 -21
- package/core/option/_option-theme.scss +3 -3
- package/core/ripple/_m2-ripple.scss +5 -22
- package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +11 -22
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +3 -3
- package/core/style/_private.scss +6 -9
- package/core/style/_sass-utils.scss +0 -29
- package/core/tokens/_m2-utils.scss +10 -42
- package/{date-range-input-harness.d-CaEyN8dT.d.ts → date-range-input-harness.d-CJ4r85Uf.d.ts} +7 -4
- package/datepicker/_datepicker-theme.scss +16 -50
- package/datepicker/_m2-datepicker.scss +45 -137
- package/datepicker/testing/index.d.ts +3 -3
- package/dialog/_m2-dialog.scss +6 -25
- package/divider/_m2-divider.scss +3 -14
- package/expansion/_m2-expansion.scss +15 -25
- package/fesm2022/animation-DfMFjxHu.mjs.map +1 -1
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +1 -1
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge/testing.mjs.map +1 -1
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button/testing.mjs +4 -7
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button-toggle/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +2 -2
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card/testing.mjs.map +1 -1
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox/testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips/testing.mjs +26 -1
- package/fesm2022/chips/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +132 -14
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/common-module-cKSwHniA.mjs.map +1 -1
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/date-formats-K6TQue-Y.mjs.map +1 -1
- package/fesm2022/{date-range-input-harness-Bp1T4oUe.mjs → date-range-input-harness-DEyfkeOs.mjs} +32 -4
- package/fesm2022/date-range-input-harness-DEyfkeOs.mjs.map +1 -0
- package/fesm2022/datepicker/testing.mjs +3 -3
- package/fesm2022/datepicker/testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +1 -1
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider/testing.mjs.map +1 -1
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/error-options-DCNQlTOA.mjs.map +1 -1
- package/fesm2022/error-state-Dtb1IHM-.mjs.map +1 -1
- package/fesm2022/expansion/testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field/testing/control.mjs +26 -1
- package/fesm2022/form-field/testing/control.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs +4 -4
- package/fesm2022/form-field/testing.mjs.map +1 -1
- package/fesm2022/{form-field-CFbrnFED.mjs → form-field-C9DZXojn.mjs} +3 -3
- package/fesm2022/form-field-C9DZXojn.mjs.map +1 -0
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list/testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon-button-DxiIc1ex.mjs.map +1 -1
- package/fesm2022/icon-registry-CwOTJ7YM.mjs.map +1 -1
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/index-BFRo2fUq.mjs.map +1 -1
- package/fesm2022/index-DwiL-HGk.mjs.map +1 -1
- package/fesm2022/input/testing.mjs +7 -4
- package/fesm2022/input/testing.mjs.map +1 -1
- package/fesm2022/{input-harness-oQzj5EsQ.mjs → input-harness-C5Msdc4-.mjs} +6 -3
- package/fesm2022/input-harness-C5Msdc4-.mjs.map +1 -0
- package/fesm2022/input-value-accessor-D1GvPuqO.mjs.map +1 -1
- package/fesm2022/input.mjs +27 -3
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/internal-form-field-D5iFxU6d.mjs.map +1 -1
- package/fesm2022/line-Bz5f9Cyx.mjs.map +1 -1
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +11 -2
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/{module-B0CLRw5e.mjs → module-BDiw_nWS.mjs} +3 -3
- package/fesm2022/module-BDiw_nWS.mjs.map +1 -0
- package/fesm2022/module-CWxMD37a.mjs.map +1 -1
- package/fesm2022/module-Ce6F7TNm.mjs.map +1 -1
- package/fesm2022/{module-B62K-792.mjs → module-DzZHEh7B.mjs} +2 -2
- package/fesm2022/module-DzZHEh7B.mjs.map +1 -0
- package/fesm2022/option-BzhYL_xC.mjs.map +1 -1
- package/fesm2022/option-harness-BFcc-M_4.mjs.map +1 -1
- package/fesm2022/paginator/testing.mjs +2 -3
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +3 -3
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar/testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner/testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/pseudo-checkbox-DDmgx3P4.mjs.map +1 -1
- package/fesm2022/pseudo-checkbox-module-4F8Up4PL.mjs.map +1 -1
- package/fesm2022/public-api-BoO5eSq-.mjs.map +1 -1
- package/fesm2022/radio/testing.mjs.map +1 -1
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/ripple-BYgV4oZC.mjs.map +1 -1
- package/fesm2022/ripple-loader-BnMiRtmT.mjs.map +1 -1
- package/fesm2022/select/testing.mjs +8 -5
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/select.mjs +3 -3
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav/testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider/testing.mjs.map +1 -1
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar/testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort/testing.mjs.map +1 -1
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper/testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +2 -2
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/structural-styles-CObeNzjn.mjs.map +1 -1
- package/fesm2022/table/testing.mjs.map +1 -1
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker/testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1 -1
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar/testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip/testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree/testing.mjs.map +1 -1
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +2 -2
- package/form-field/_m2-form-field.scss +59 -93
- package/form-field/testing/control/index.d.ts +8 -5
- package/form-field/testing/index.d.ts +5 -5
- package/form-field-control-harness.d-BLvFBy6v.d.ts +18 -0
- package/grid-list/_m2-grid-list.scss +0 -13
- package/icon/_m2-icon.scss +0 -13
- package/input/index.d.ts +11 -0
- package/input/testing/index.d.ts +5 -4
- package/{input-harness.d-8fkAAbu2.d.ts → input-harness.d-DVI6ttzl.d.ts} +4 -4
- package/list/_list-theme.scss +10 -5
- package/list/_m2-list.scss +19 -37
- package/menu/_m2-menu.scss +12 -23
- package/menu/index.d.ts +2 -0
- package/package.json +6 -6
- package/paginator/_m2-paginator.scss +7 -18
- package/paginator/testing/index.d.ts +2 -3
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/progress-bar/_m2-progress-bar.scss +11 -20
- package/progress-bar/_progress-bar-theme.scss +2 -2
- package/progress-spinner/_m2-progress-spinner.scss +7 -15
- package/progress-spinner/_progress-spinner-theme.scss +2 -2
- package/radio/_m2-radio.scss +21 -32
- package/radio/_radio-theme.scss +6 -3
- package/schematics/ng-add/index.js +2 -2
- package/select/_m2-select.scss +14 -36
- package/select/_select-theme.scss +6 -3
- package/select/testing/index.d.ts +5 -6
- package/sidenav/_m2-sidenav.scss +10 -20
- package/slide-toggle/_m2-slide-toggle.scss +13 -20
- package/slide-toggle/_slide-toggle-theme.scss +3 -2
- package/slider/_m2-slider.scss +27 -39
- package/slider/_slider-theme.scss +2 -2
- package/snack-bar/_m2-snack-bar.scss +5 -22
- package/sort/_m2-sort.scss +3 -33
- package/stepper/_m2-stepper.scss +23 -34
- package/stepper/_m3-stepper.scss +2 -2
- package/stepper/_stepper-theme.scss +2 -2
- package/table/_m2-table.scss +6 -17
- package/tabs/_m2-tabs.scss +19 -36
- package/tabs/_tabs-theme.scss +4 -4
- package/timepicker/_m2-timepicker.scss +5 -15
- package/toolbar/_m2-toolbar.scss +4 -15
- package/tooltip/_m2-tooltip.scss +4 -14
- package/tree/_m2-tree.scss +4 -16
- package/core/tokens/_m2-tokens.scss +0 -131
- package/fesm2022/date-range-input-harness-Bp1T4oUe.mjs.map +0 -1
- package/fesm2022/form-field-CFbrnFED.mjs.map +0 -1
- package/fesm2022/input-harness-oQzj5EsQ.mjs.map +0 -1
- package/fesm2022/module-B0CLRw5e.mjs.map +0 -1
- package/fesm2022/module-B62K-792.mjs.map +0 -1
package/chips/index.d.ts
CHANGED
|
@@ -21,12 +21,15 @@ declare class MatChipAction {
|
|
|
21
21
|
_handlePrimaryActionInteraction(): void;
|
|
22
22
|
remove(): void;
|
|
23
23
|
disabled: boolean;
|
|
24
|
+
_edit(): void;
|
|
24
25
|
_isEditing?: boolean;
|
|
25
26
|
};
|
|
26
27
|
/** Whether the action is interactive. */
|
|
27
28
|
isInteractive: boolean;
|
|
28
29
|
/** Whether this is the primary action in the chip. */
|
|
29
30
|
_isPrimary: boolean;
|
|
31
|
+
/** Whether this is the leading action in the chip. */
|
|
32
|
+
_isLeading: boolean;
|
|
30
33
|
/** Whether the action is disabled. */
|
|
31
34
|
get disabled(): boolean;
|
|
32
35
|
set disabled(value: boolean);
|
|
@@ -71,6 +74,31 @@ declare class MatChipTrailingIcon extends MatChipAction {
|
|
|
71
74
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatChipTrailingIcon, never>;
|
|
72
75
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MatChipTrailingIcon, "mat-chip-trailing-icon, [matChipTrailingIcon]", never, {}, {}, never, never, true, never>;
|
|
73
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Directive to edit the parent chip when the leading action icon is clicked or
|
|
79
|
+
* when the ENTER key is pressed on it.
|
|
80
|
+
*
|
|
81
|
+
* Recommended for use with the Material Design "edit" icon
|
|
82
|
+
* available at https://material.io/icons/#ic_edit.
|
|
83
|
+
*
|
|
84
|
+
* Example:
|
|
85
|
+
*
|
|
86
|
+
* ```
|
|
87
|
+
* <mat-chip>
|
|
88
|
+
* <button matChipEdit aria-label="Edit">
|
|
89
|
+
* <mat-icon>edit</mat-icon>
|
|
90
|
+
* </button>
|
|
91
|
+
* </mat-chip>
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
declare class MatChipEdit extends MatChipAction {
|
|
95
|
+
_isPrimary: boolean;
|
|
96
|
+
_isLeading: boolean;
|
|
97
|
+
_handleClick(event: MouseEvent): void;
|
|
98
|
+
_handleKeydown(event: KeyboardEvent): void;
|
|
99
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatChipEdit, never>;
|
|
100
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MatChipEdit, "[matChipEdit]", never, {}, {}, never, never, true, never>;
|
|
101
|
+
}
|
|
74
102
|
/**
|
|
75
103
|
* Directive to remove the parent chip when the trailing icon is clicked or
|
|
76
104
|
* when the ENTER key is pressed on it.
|
|
@@ -132,6 +160,8 @@ declare class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoChec
|
|
|
132
160
|
protected _allLeadingIcons: QueryList<MatChipAvatar>;
|
|
133
161
|
/** All trailing icons present in the chip. */
|
|
134
162
|
protected _allTrailingIcons: QueryList<MatChipTrailingIcon>;
|
|
163
|
+
/** All edit icons present in the chip. */
|
|
164
|
+
protected _allEditIcons: QueryList<MatChipEdit>;
|
|
135
165
|
/** All remove icons present in the chip. */
|
|
136
166
|
protected _allRemoveIcons: QueryList<MatChipRemove>;
|
|
137
167
|
_hasFocus(): boolean;
|
|
@@ -183,6 +213,8 @@ declare class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoChec
|
|
|
183
213
|
protected basicChipAttrName: string;
|
|
184
214
|
/** The chip's leading icon. */
|
|
185
215
|
leadingIcon: MatChipAvatar;
|
|
216
|
+
/** The chip's leading edit icon. */
|
|
217
|
+
editIcon: MatChipEdit;
|
|
186
218
|
/** The chip's trailing icon. */
|
|
187
219
|
trailingIcon: MatChipTrailingIcon;
|
|
188
220
|
/** The chip's trailing remove icon. */
|
|
@@ -221,10 +253,12 @@ declare class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoChec
|
|
|
221
253
|
_getActions(): MatChipAction[];
|
|
222
254
|
/** Handles interactions with the primary action of the chip. */
|
|
223
255
|
_handlePrimaryActionInteraction(): void;
|
|
256
|
+
/** Handles interactions with the edit action of the chip. */
|
|
257
|
+
_edit(event: Event): void;
|
|
224
258
|
/** Starts the focus monitoring process on the chip. */
|
|
225
259
|
private _monitorFocus;
|
|
226
260
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatChip, never>;
|
|
227
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MatChip, "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", ["matChip"], { "role": { "alias": "role"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaDescription": { "alias": "aria-description"; "required": false; }; "value": { "alias": "value"; "required": false; }; "color": { "alias": "color"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "highlighted": { "alias": "highlighted"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "removed": "removed"; "destroyed": "destroyed"; }, ["leadingIcon", "trailingIcon", "removeIcon", "_allLeadingIcons", "_allTrailingIcons", "_allRemoveIcons"], ["mat-chip-avatar, [matChipAvatar]", "*", "mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"], true, never>;
|
|
261
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatChip, "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", ["matChip"], { "role": { "alias": "role"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaDescription": { "alias": "aria-description"; "required": false; }; "value": { "alias": "value"; "required": false; }; "color": { "alias": "color"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "highlighted": { "alias": "highlighted"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "removed": "removed"; "destroyed": "destroyed"; }, ["leadingIcon", "editIcon", "trailingIcon", "removeIcon", "_allLeadingIcons", "_allTrailingIcons", "_allEditIcons", "_allRemoveIcons"], ["mat-chip-avatar, [matChipAvatar]", "*", "mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"], true, never>;
|
|
228
262
|
static ngAcceptInputType_removable: unknown;
|
|
229
263
|
static ngAcceptInputType_highlighted: unknown;
|
|
230
264
|
static ngAcceptInputType_disableRipple: unknown;
|
|
@@ -353,13 +387,25 @@ declare class MatChipRow extends MatChip implements AfterViewInit {
|
|
|
353
387
|
defaultEditInput?: MatChipEditInput;
|
|
354
388
|
/** The projected chip edit input. */
|
|
355
389
|
contentEditInput?: MatChipEditInput;
|
|
390
|
+
/**
|
|
391
|
+
* Set on a mousedown when the chip is already focused via mouse or keyboard.
|
|
392
|
+
*
|
|
393
|
+
* This allows us to ensure chip is already focused when deciding whether to enter the
|
|
394
|
+
* edit mode on a subsequent click. Otherwise, the chip appears focused when handling the
|
|
395
|
+
* first click event.
|
|
396
|
+
*/
|
|
397
|
+
private _alreadyFocused;
|
|
356
398
|
_isEditing: boolean;
|
|
357
399
|
constructor(...args: unknown[]);
|
|
400
|
+
ngAfterViewInit(): void;
|
|
401
|
+
protected _hasLeadingActionIcon(): boolean;
|
|
358
402
|
_hasTrailingIcon(): boolean;
|
|
359
403
|
/** Sends focus to the first gridcell when the user clicks anywhere inside the chip. */
|
|
360
404
|
_handleFocus(): void;
|
|
361
405
|
_handleKeydown(event: KeyboardEvent): void;
|
|
406
|
+
_handleClick(event: MouseEvent): void;
|
|
362
407
|
_handleDoubleclick(event: MouseEvent): void;
|
|
408
|
+
_edit(): void;
|
|
363
409
|
private _startEditing;
|
|
364
410
|
private _onEditFinish;
|
|
365
411
|
_isRippleDisabled(): boolean;
|
|
@@ -369,7 +415,7 @@ declare class MatChipRow extends MatChip implements AfterViewInit {
|
|
|
369
415
|
*/
|
|
370
416
|
private _getEditInput;
|
|
371
417
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatChipRow, never>;
|
|
372
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MatChipRow, "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", never, { "editable": { "alias": "editable"; "required": false; }; }, { "edited": "edited"; }, ["contentEditInput"], ["mat-chip-avatar, [matChipAvatar]", "[matChipEditInput]", "*", "mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"], true, never>;
|
|
418
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatChipRow, "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", never, { "editable": { "alias": "editable"; "required": false; }; }, { "edited": "edited"; }, ["contentEditInput"], ["[matChipEdit]", "mat-chip-avatar, [matChipAvatar]", "[matChipEditInput]", "*", "mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"], true, never>;
|
|
373
419
|
}
|
|
374
420
|
|
|
375
421
|
/**
|
|
@@ -888,7 +934,7 @@ declare class MatChipInput implements MatChipTextControl, OnChanges, OnDestroy {
|
|
|
888
934
|
|
|
889
935
|
declare class MatChipsModule {
|
|
890
936
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatChipsModule, never>;
|
|
891
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatChipsModule, never, [typeof MatCommonModule, typeof MatRippleModule, typeof MatChipAction, typeof MatChip, typeof MatChipAvatar, typeof MatChipEditInput, typeof MatChipGrid, typeof MatChipInput, typeof MatChipListbox, typeof MatChipOption, typeof MatChipRemove, typeof MatChipRow, typeof MatChipSet, typeof MatChipTrailingIcon], [typeof MatCommonModule, typeof MatChip, typeof MatChipAvatar, typeof MatChipEditInput, typeof MatChipGrid, typeof MatChipInput, typeof MatChipListbox, typeof MatChipOption, typeof MatChipRemove, typeof MatChipRow, typeof MatChipSet, typeof MatChipTrailingIcon]>;
|
|
937
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatChipsModule, never, [typeof MatCommonModule, typeof MatRippleModule, typeof MatChipAction, typeof MatChip, typeof MatChipAvatar, typeof MatChipEdit, typeof MatChipEditInput, typeof MatChipGrid, typeof MatChipInput, typeof MatChipListbox, typeof MatChipOption, typeof MatChipRemove, typeof MatChipRow, typeof MatChipSet, typeof MatChipTrailingIcon], [typeof MatCommonModule, typeof MatChip, typeof MatChipAvatar, typeof MatChipEdit, typeof MatChipEditInput, typeof MatChipGrid, typeof MatChipInput, typeof MatChipListbox, typeof MatChipOption, typeof MatChipRemove, typeof MatChipRow, typeof MatChipSet, typeof MatChipTrailingIcon]>;
|
|
892
938
|
static ɵinj: i0.ɵɵInjectorDeclaration<MatChipsModule>;
|
|
893
939
|
}
|
|
894
940
|
|
|
@@ -915,6 +961,12 @@ declare const MAT_CHIP_AVATAR: InjectionToken<unknown>;
|
|
|
915
961
|
* retention of the class and its directive metadata.
|
|
916
962
|
*/
|
|
917
963
|
declare const MAT_CHIP_TRAILING_ICON: InjectionToken<unknown>;
|
|
964
|
+
/**
|
|
965
|
+
* Injection token that can be used to reference instances of `MatChipEdit`. It serves as
|
|
966
|
+
* alternative token to the actual `MatChipEdit` class which could cause unnecessary
|
|
967
|
+
* retention of the class and its directive metadata.
|
|
968
|
+
*/
|
|
969
|
+
declare const MAT_CHIP_EDIT: InjectionToken<unknown>;
|
|
918
970
|
/**
|
|
919
971
|
* Injection token that can be used to reference instances of `MatChipRemove`. It serves as
|
|
920
972
|
* alternative token to the actual `MatChipRemove` class which could cause unnecessary
|
|
@@ -926,5 +978,5 @@ declare const MAT_CHIP_REMOVE: InjectionToken<unknown>;
|
|
|
926
978
|
*/
|
|
927
979
|
declare const MAT_CHIP: InjectionToken<unknown>;
|
|
928
980
|
|
|
929
|
-
export { MAT_CHIP, MAT_CHIPS_DEFAULT_OPTIONS, MAT_CHIP_AVATAR, MAT_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR, MAT_CHIP_REMOVE, MAT_CHIP_TRAILING_ICON, MatChip, MatChipAvatar, MatChipEditInput, MatChipGrid, MatChipGridChange, MatChipInput, MatChipListbox, MatChipListboxChange, MatChipOption, MatChipRemove, MatChipRow, MatChipSelectionChange, MatChipSet, MatChipTrailingIcon, MatChipsModule };
|
|
981
|
+
export { MAT_CHIP, MAT_CHIPS_DEFAULT_OPTIONS, MAT_CHIP_AVATAR, MAT_CHIP_EDIT, MAT_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR, MAT_CHIP_REMOVE, MAT_CHIP_TRAILING_ICON, MatChip, MatChipAvatar, MatChipEdit, MatChipEditInput, MatChipGrid, MatChipGridChange, MatChipInput, MatChipListbox, MatChipListboxChange, MatChipOption, MatChipRemove, MatChipRow, MatChipSelectionChange, MatChipSet, MatChipTrailingIcon, MatChipsModule };
|
|
930
982
|
export type { MatChipEditedEvent, MatChipEvent, MatChipInputEvent, MatChipTextControl, MatChipsDefaultOptions };
|
package/chips/testing/index.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ interface ChipRowHarnessFilters extends ChipHarnessFilters {
|
|
|
31
31
|
}
|
|
32
32
|
interface ChipSetHarnessFilters extends BaseHarnessFilters {
|
|
33
33
|
}
|
|
34
|
+
interface ChipEditHarnessFilters extends BaseHarnessFilters {
|
|
35
|
+
}
|
|
34
36
|
interface ChipRemoveHarnessFilters extends BaseHarnessFilters {
|
|
35
37
|
}
|
|
36
38
|
interface ChipAvatarHarnessFilters extends BaseHarnessFilters {
|
|
@@ -50,6 +52,20 @@ declare class MatChipAvatarHarness extends ComponentHarness {
|
|
|
50
52
|
static with<T extends MatChipAvatarHarness>(this: ComponentHarnessConstructor<T>, options?: ChipAvatarHarnessFilters): HarnessPredicate<T>;
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
/** Harness for interacting with a standard Material chip edit button in tests. */
|
|
56
|
+
declare class MatChipEditHarness extends ComponentHarness {
|
|
57
|
+
static hostSelector: string;
|
|
58
|
+
/**
|
|
59
|
+
* Gets a `HarnessPredicate` that can be used to search for a chip edit with specific
|
|
60
|
+
* attributes.
|
|
61
|
+
* @param options Options for filtering which input instances are considered a match.
|
|
62
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
63
|
+
*/
|
|
64
|
+
static with<T extends MatChipEditHarness>(this: ComponentHarnessConstructor<T>, options?: ChipEditHarnessFilters): HarnessPredicate<T>;
|
|
65
|
+
/** Clicks the edit button. */
|
|
66
|
+
click(): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
|
|
53
69
|
/** Harness for interacting with a standard Material chip remove button in tests. */
|
|
54
70
|
declare class MatChipRemoveHarness extends ComponentHarness {
|
|
55
71
|
static hostSelector: string;
|
|
@@ -80,6 +96,11 @@ declare class MatChipHarness extends ContentContainerComponentHarness {
|
|
|
80
96
|
isDisabled(): Promise<boolean>;
|
|
81
97
|
/** Delete a chip from the set. */
|
|
82
98
|
remove(): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Gets the edit button inside of a chip.
|
|
101
|
+
* @param filter Optionally filters which chips are included.
|
|
102
|
+
*/
|
|
103
|
+
geEditButton(filter?: ChipEditHarnessFilters): Promise<MatChipEditHarness>;
|
|
83
104
|
/**
|
|
84
105
|
* Gets the remove button inside of a chip.
|
|
85
106
|
* @param filter Optionally filters which chips are included.
|
|
@@ -245,5 +266,5 @@ declare class MatChipSetHarness extends ComponentHarness {
|
|
|
245
266
|
getChips(filter?: ChipHarnessFilters): Promise<MatChipHarness[]>;
|
|
246
267
|
}
|
|
247
268
|
|
|
248
|
-
export { MatChipAvatarHarness, MatChipEditInputHarness, MatChipGridHarness, MatChipHarness, MatChipInputHarness, MatChipListboxHarness, MatChipOptionHarness, MatChipRemoveHarness, MatChipRowHarness, MatChipSetHarness };
|
|
249
|
-
export type { ChipAvatarHarnessFilters, ChipEditInputHarnessFilters, ChipGridHarnessFilters, ChipHarnessFilters, ChipInputHarnessFilters, ChipListboxHarnessFilters, ChipOptionHarnessFilters, ChipRemoveHarnessFilters, ChipRowHarnessFilters, ChipSetHarnessFilters };
|
|
269
|
+
export { MatChipAvatarHarness, MatChipEditHarness, MatChipEditInputHarness, MatChipGridHarness, MatChipHarness, MatChipInputHarness, MatChipListboxHarness, MatChipOptionHarness, MatChipRemoveHarness, MatChipRowHarness, MatChipSetHarness };
|
|
270
|
+
export type { ChipAvatarHarnessFilters, ChipEditHarnessFilters, ChipEditInputHarnessFilters, ChipGridHarnessFilters, ChipHarnessFilters, ChipInputHarnessFilters, ChipListboxHarnessFilters, ChipOptionHarnessFilters, ChipRemoveHarnessFilters, ChipRowHarnessFilters, ChipSetHarnessFilters };
|
package/core/_m2-app.scss
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use './tokens/m2-utils';
|
|
3
|
-
@use './theming/inspection';
|
|
4
|
-
@use './style/sass-utils';
|
|
5
2
|
@use './style/elevation';
|
|
3
|
+
@use '../core/tokens/m2-utils';
|
|
6
4
|
|
|
7
5
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
8
6
|
// but may be in a future version of the theming API.
|
|
@@ -12,15 +10,15 @@
|
|
|
12
10
|
|
|
13
11
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
14
12
|
@function get-color-tokens($theme) {
|
|
13
|
+
$system: m2-utils.get-system($theme);
|
|
14
|
+
|
|
15
15
|
$tokens: (
|
|
16
|
-
app-background-color:
|
|
17
|
-
app-text-color:
|
|
16
|
+
app-background-color: map.get($system, background),
|
|
17
|
+
app-text-color: map.get($system, on-surface),
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
@for $zValue from 0 through 24 {
|
|
21
|
-
$
|
|
22
|
-
$shadow: elevation.get-box-shadow($zValue,
|
|
23
|
-
if($elevation-color == null, elevation.$color, $elevation-color));
|
|
21
|
+
$shadow: elevation.get-box-shadow($zValue, map.get($system, shadow));
|
|
24
22
|
$tokens: map.set($tokens, 'app-elevation-shadow-level-#{$zValue}', $shadow);
|
|
25
23
|
}
|
|
26
24
|
|
|
@@ -36,14 +34,3 @@
|
|
|
36
34
|
@function get-density-tokens($theme) {
|
|
37
35
|
@return ();
|
|
38
36
|
}
|
|
39
|
-
|
|
40
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
41
|
-
// This is used to create token slots.
|
|
42
|
-
@function get-token-slots() {
|
|
43
|
-
@return sass-utils.deep-merge-all(
|
|
44
|
-
get-unthemable-tokens(),
|
|
45
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
46
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
47
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
48
|
-
);
|
|
49
|
-
}
|
package/core/m2/_theming.scss
CHANGED
|
@@ -85,14 +85,16 @@
|
|
|
85
85
|
// might be inferred as numbers by Sass. Casting them to string fixes the map lookup.
|
|
86
86
|
$color: if(map.has-key($palette, $hue), map.get($palette, $hue), map.get($palette, $hue + ''));
|
|
87
87
|
|
|
88
|
-
@if (
|
|
89
|
-
// If the $color resolved to something different from a color (e.g. a CSS variable),
|
|
90
|
-
// we can't apply the opacity anyway so we return the value as is, otherwise Sass can
|
|
91
|
-
// throw an error or output something invalid.
|
|
88
|
+
@if ($opacity == null) {
|
|
92
89
|
@return $color;
|
|
93
90
|
}
|
|
94
91
|
|
|
95
|
-
@
|
|
92
|
+
@if (meta.type-of($color) != color) {
|
|
93
|
+
$opacity: ($opacity * 100) + '%';
|
|
94
|
+
@return #{color-mix(in srgb, #{$color} #{$opacity}, transparent)};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@return rgba($color, $opacity);
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
// Validates the specified theme by ensuring that the optional color config defines
|
|
@@ -111,39 +113,71 @@
|
|
|
111
113
|
@return $theme;
|
|
112
114
|
}
|
|
113
115
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
@function _define-system($primary, $accent, $warn, $is-dark) {
|
|
117
|
+
$system: (
|
|
118
|
+
primary: map.get($primary, default),
|
|
119
|
+
on-primary: map.get($primary, default-contrast),
|
|
120
|
+
secondary: map.get($accent, default),
|
|
121
|
+
on-secondary: map.get($accent, default-contrast),
|
|
122
|
+
error: map.get($warn, default),
|
|
123
|
+
on-error: map.get($warn, default-contrast),
|
|
124
|
+
shadow: black,
|
|
125
|
+
hover-state-layer-opacity: 0.04,
|
|
126
|
+
focus-state-layer-opacity: 0.12,
|
|
127
|
+
pressed-state-layer-opacity: 0.12,
|
|
124
128
|
);
|
|
129
|
+
|
|
130
|
+
@if $is-dark {
|
|
131
|
+
@return map.merge($system, (
|
|
132
|
+
surface: map.get(palette.$grey-palette, 800),
|
|
133
|
+
surface-variant: #4a4a4a,
|
|
134
|
+
on-surface: white,
|
|
135
|
+
on-surface-variant: rgba(white, 0.7),
|
|
136
|
+
background: #303030,
|
|
137
|
+
inverse-surface: white,
|
|
138
|
+
inverse-on-surface: rgba(black, 0.87),
|
|
139
|
+
outline: rgba(white, 0.12),
|
|
140
|
+
outline-variant: rgba(white, 0.38),
|
|
141
|
+
));
|
|
142
|
+
} @else {
|
|
143
|
+
@return map.merge($system, (
|
|
144
|
+
surface: white,
|
|
145
|
+
surface-variant: #f6f6f6,
|
|
146
|
+
on-surface: rgba(black, 0.87),
|
|
147
|
+
on-surface-variant: rgba(black, 0.54),
|
|
148
|
+
background: map.get(palette.$grey-palette, 50),
|
|
149
|
+
inverse-surface: map.get(palette.$grey-palette, 800),
|
|
150
|
+
inverse-on-surface: white,
|
|
151
|
+
outline: rgba(black, 0.12),
|
|
152
|
+
outline-variant: rgba(black, 0.38),
|
|
153
|
+
));
|
|
154
|
+
}
|
|
125
155
|
}
|
|
126
156
|
|
|
127
|
-
// Creates a
|
|
157
|
+
// Creates a color configuration from the specified
|
|
128
158
|
// primary, accent and warn palettes.
|
|
129
|
-
@function _mat-create-
|
|
159
|
+
@function _mat-create-color-config($primary, $accent, $warn: null, $is-dark) {
|
|
160
|
+
$warn: if($warn != null, $warn, define-palette(palette.$red-palette));
|
|
161
|
+
$foreground:
|
|
162
|
+
if($is-dark, palette.$dark-theme-foreground-palette, palette.$light-theme-foreground-palette);
|
|
163
|
+
$background:
|
|
164
|
+
if($is-dark, palette.$dark-theme-background-palette, palette.$light-theme-background-palette);
|
|
165
|
+
|
|
130
166
|
@return (
|
|
131
167
|
primary: $primary,
|
|
132
168
|
accent: $accent,
|
|
133
|
-
warn:
|
|
134
|
-
is-dark:
|
|
135
|
-
foreground:
|
|
136
|
-
background:
|
|
169
|
+
warn: $warn,
|
|
170
|
+
is-dark: $is-dark,
|
|
171
|
+
foreground: $foreground,
|
|
172
|
+
background: $background,
|
|
137
173
|
);
|
|
138
174
|
}
|
|
139
175
|
|
|
140
|
-
|
|
141
|
-
// as it would break existing apps that set the parameter by name.
|
|
142
|
-
|
|
143
|
-
/// Creates a container object for a light theme to be given to individual component theme mixins.
|
|
176
|
+
/// Creates a container object for a theme to be given to individual component theme mixins.
|
|
144
177
|
/// @param {Map} $primary The theme configuration object.
|
|
145
178
|
/// @returns {Map} A complete Angular Material theme map.
|
|
146
|
-
@function
|
|
179
|
+
@function _define-theme(
|
|
180
|
+
$primary, $accent: null, $warn: define-palette(palette.$red-palette), $is-dark) {
|
|
147
181
|
// This function creates a container object for the individual component theme mixins. Consumers
|
|
148
182
|
// can construct such an object by calling this function, or by building the object manually.
|
|
149
183
|
// There are two possible ways to invoke this function in order to create such an object:
|
|
@@ -160,13 +194,15 @@
|
|
|
160
194
|
@if $accent != null {
|
|
161
195
|
@warn theming.$private-legacy-theme-warning;
|
|
162
196
|
$theme: _mat-validate-theme(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
197
|
+
(
|
|
198
|
+
_is-legacy-theme: true,
|
|
199
|
+
color: _mat-create-color-config($primary, $accent, $warn, $is-dark),
|
|
200
|
+
)
|
|
167
201
|
);
|
|
168
202
|
|
|
169
|
-
|
|
203
|
+
$theme: _internalize-theme(theming.private-create-backwards-compatibility-theme($theme));
|
|
204
|
+
$theme: map.set($theme, _mat-system, _define-system($primary, $accent, $warn, $is-dark));
|
|
205
|
+
@return $theme;
|
|
170
206
|
}
|
|
171
207
|
// If the map pattern is used (1), we just pass-through the configurations for individual
|
|
172
208
|
// parts of the theming system, but update the `color` configuration if set. As explained
|
|
@@ -178,15 +214,30 @@
|
|
|
178
214
|
$accent: map.get($color-settings, accent);
|
|
179
215
|
$warn: map.get($color-settings, warn);
|
|
180
216
|
$result: map.merge(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
217
|
+
$result,
|
|
218
|
+
(
|
|
219
|
+
color: _mat-create-color-config($primary, $accent, $warn, $is-dark),
|
|
220
|
+
)
|
|
185
221
|
);
|
|
186
222
|
}
|
|
187
|
-
|
|
188
|
-
|
|
223
|
+
$theme: _internalize-theme(
|
|
224
|
+
theming.private-create-backwards-compatibility-theme(_mat-validate-theme($result))
|
|
189
225
|
);
|
|
226
|
+
$primary: map.get($result, primary) or map.get($result, color, primary) or ();
|
|
227
|
+
$accent: map.get($result, accent) or map.get($result, color, accent) or ();
|
|
228
|
+
$warn: map.get($result, warn) or map.get($result, color, warn) or ();
|
|
229
|
+
$theme: map.set($theme, _mat-system, _define-system($primary, $accent, $warn, $is-dark));
|
|
230
|
+
@return $theme;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// TODO: Remove legacy API and rename `$primary` below to `$config`. Currently it cannot be renamed
|
|
234
|
+
// as it would break existing apps that set the parameter by name.
|
|
235
|
+
|
|
236
|
+
/// Creates a container object for a light theme to be given to individual component theme mixins.
|
|
237
|
+
/// @param {Map} $primary The theme configuration object.
|
|
238
|
+
/// @returns {Map} A complete Angular Material theme map.
|
|
239
|
+
@function define-light-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
|
|
240
|
+
@return _define-theme($primary, $accent, $warn, false);
|
|
190
241
|
}
|
|
191
242
|
|
|
192
243
|
// TODO: Remove legacy API and rename below `$primary` to `$config`. Currently it cannot be renamed
|
|
@@ -196,48 +247,7 @@
|
|
|
196
247
|
/// @param {Map} $primary The theme configuration object.
|
|
197
248
|
/// @returns {Map} A complete Angular Material theme map.
|
|
198
249
|
@function define-dark-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
|
|
199
|
-
|
|
200
|
-
// can construct such an object by calling this function, or by building the object manually.
|
|
201
|
-
// There are two possible ways to invoke this function in order to create such an object:
|
|
202
|
-
//
|
|
203
|
-
// (1) Passing in a map that holds optional configurations for individual parts of the
|
|
204
|
-
// theming system. For `color` configurations, the function only expects the palettes
|
|
205
|
-
// for `primary` and `accent` (and optionally `warn`). The function will expand the
|
|
206
|
-
// shorthand into an actual configuration that can be consumed in `-color` mixins.
|
|
207
|
-
// (2) Legacy pattern: Passing in the palettes as parameters. This is not as flexible
|
|
208
|
-
// as passing in a configuration map because only the `color` system can be configured.
|
|
209
|
-
//
|
|
210
|
-
// If the legacy pattern is used, we generate a container object only with a dark-themed
|
|
211
|
-
// configuration for the `color` theming part.
|
|
212
|
-
@if $accent != null {
|
|
213
|
-
@warn theming.$private-legacy-theme-warning;
|
|
214
|
-
$theme: _mat-validate-theme(
|
|
215
|
-
(
|
|
216
|
-
_is-legacy-theme: true,
|
|
217
|
-
color: _mat-create-dark-color-config($primary, $accent, $warn),
|
|
218
|
-
)
|
|
219
|
-
);
|
|
220
|
-
@return _internalize-theme(theming.private-create-backwards-compatibility-theme($theme));
|
|
221
|
-
}
|
|
222
|
-
// If the map pattern is used (1), we just pass-through the configurations for individual
|
|
223
|
-
// parts of the theming system, but update the `color` configuration if set. As explained
|
|
224
|
-
// above, the color shorthand will be expanded to an actual dark-themed color configuration.
|
|
225
|
-
$result: $primary;
|
|
226
|
-
@if map.get($primary, color) {
|
|
227
|
-
$color-settings: map.get($primary, color);
|
|
228
|
-
$primary: map.get($color-settings, primary);
|
|
229
|
-
$accent: map.get($color-settings, accent);
|
|
230
|
-
$warn: map.get($color-settings, warn);
|
|
231
|
-
$result: map.merge(
|
|
232
|
-
$result,
|
|
233
|
-
(
|
|
234
|
-
color: _mat-create-dark-color-config($primary, $accent, $warn),
|
|
235
|
-
)
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
@return _internalize-theme(
|
|
239
|
-
theming.private-create-backwards-compatibility-theme(_mat-validate-theme($result))
|
|
240
|
-
);
|
|
250
|
+
@return _define-theme($primary, $accent, $warn, true);
|
|
241
251
|
}
|
|
242
252
|
|
|
243
253
|
/// Gets the color configuration from the given theme or configuration.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@use '../style/sass-utils';
|
|
2
1
|
@use '../theming/inspection';
|
|
3
2
|
@use '../tokens/m2-utils';
|
|
3
|
+
@use 'sass:map';
|
|
4
4
|
|
|
5
5
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
6
6
|
// but may be in a future version of the theming API.
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
12
12
|
@function get-color-tokens($theme) {
|
|
13
|
+
$system: m2-utils.get-system($theme);
|
|
13
14
|
@return (
|
|
14
|
-
optgroup-label-text-color:
|
|
15
|
+
optgroup-label-text-color: map.get($system, on-surface),
|
|
15
16
|
);
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -30,14 +31,3 @@
|
|
|
30
31
|
@function get-density-tokens($theme) {
|
|
31
32
|
@return ();
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
35
|
-
// This is used to create token slots.
|
|
36
|
-
@function get-token-slots() {
|
|
37
|
-
@return sass-utils.deep-merge-all(
|
|
38
|
-
get-unthemable-tokens(),
|
|
39
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
40
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
41
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
42
|
-
);
|
|
43
|
-
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
@use '../tokens/m2-utils';
|
|
2
1
|
@use '../theming/inspection';
|
|
3
|
-
@use '
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use '../tokens/m2-utils';
|
|
4
|
+
@use '../tokens/m3-utils';
|
|
4
5
|
|
|
5
6
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
6
7
|
// but may be in a future version of the theming API.
|
|
@@ -9,17 +10,20 @@
|
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
12
|
-
@function get-color-tokens($theme, $
|
|
13
|
+
@function get-color-tokens($theme, $color-variant) {
|
|
13
14
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
14
|
-
$
|
|
15
|
-
|
|
15
|
+
$system: m2-utils.get-system($theme);
|
|
16
|
+
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
|
|
16
17
|
|
|
17
18
|
@return (
|
|
18
|
-
option-selected-state-label-text-color:
|
|
19
|
-
option-label-text-color:
|
|
20
|
-
option-hover-state-layer-color:
|
|
21
|
-
|
|
22
|
-
option-
|
|
19
|
+
option-selected-state-label-text-color: map.get($system, primary),
|
|
20
|
+
option-label-text-color: map.get($system, on-surface),
|
|
21
|
+
option-hover-state-layer-color: m3-utils.color-with-opacity(
|
|
22
|
+
map.get($system, on-surface), map.get($system, hover-state-layer-opacity)),
|
|
23
|
+
option-focus-state-layer-color: m3-utils.color-with-opacity(
|
|
24
|
+
map.get($system, on-surface), map.get($system, focus-state-layer-opacity)),
|
|
25
|
+
option-selected-state-layer-color: m3-utils.color-with-opacity(
|
|
26
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
23
27
|
);
|
|
24
28
|
}
|
|
25
29
|
|
|
@@ -38,14 +42,3 @@
|
|
|
38
42
|
@function get-density-tokens($theme) {
|
|
39
43
|
@return ();
|
|
40
44
|
}
|
|
41
|
-
|
|
42
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
43
|
-
// This is used to create token slots.
|
|
44
|
-
@function get-token-slots() {
|
|
45
|
-
@return sass-utils.deep-merge-all(
|
|
46
|
-
get-unthemable-tokens(),
|
|
47
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
48
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
49
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
50
|
-
);
|
|
51
|
-
}
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
map.get(m3-option.get-tokens($theme, $color-variant), color));
|
|
27
27
|
} @else {
|
|
28
28
|
@include sass-utils.current-selector-or-root() {
|
|
29
|
-
@include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme));
|
|
29
|
+
@include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme, primary));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.mat-accent {
|
|
33
|
-
@include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme,
|
|
33
|
+
@include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme, secondary));
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.mat-warn {
|
|
37
|
-
@include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme,
|
|
37
|
+
@include token-utils.create-token-values-mixed(m2-option.get-color-tokens($theme, error));
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
@use 'sass:
|
|
1
|
+
@use 'sass:map';
|
|
2
2
|
@use '../tokens/m2-utils';
|
|
3
|
-
@use '../
|
|
4
|
-
@use '../style/sass-utils';
|
|
3
|
+
@use '../tokens/m3-utils';
|
|
5
4
|
|
|
6
5
|
// Tokens that can't be configured through Angular Material's current theming API,
|
|
7
6
|
// but may be in a future version of the theming API.
|
|
@@ -11,16 +10,11 @@
|
|
|
11
10
|
|
|
12
11
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
13
12
|
@function get-color-tokens($theme) {
|
|
14
|
-
$
|
|
15
|
-
$base: inspection.get-theme-color($theme, foreground, base);
|
|
16
|
-
|
|
17
|
-
// If the base is a color *type* we can use it directly in the `rgba` call below.
|
|
18
|
-
// If it's anything else (e.g. a CSS variable) we fall back to using static colors
|
|
19
|
-
// since we don't have a way of adjusting the opacity.
|
|
20
|
-
$color: if(meta.type-of($base) == color, $base, if($is-dark, #fff, #000));
|
|
13
|
+
$system: m2-utils.get-system($theme);
|
|
21
14
|
|
|
22
15
|
@return (
|
|
23
|
-
ripple-color:
|
|
16
|
+
ripple-color: m3-utils.color-with-opacity(
|
|
17
|
+
map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)),
|
|
24
18
|
);
|
|
25
19
|
}
|
|
26
20
|
|
|
@@ -33,14 +27,3 @@
|
|
|
33
27
|
@function get-density-tokens($theme) {
|
|
34
28
|
@return ();
|
|
35
29
|
}
|
|
36
|
-
|
|
37
|
-
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
38
|
-
// This is used to create token slots.
|
|
39
|
-
@function get-token-slots() {
|
|
40
|
-
@return sass-utils.deep-merge-all(
|
|
41
|
-
get-unthemable-tokens(),
|
|
42
|
-
get-color-tokens(m2-utils.$placeholder-color-config),
|
|
43
|
-
get-typography-tokens(m2-utils.$placeholder-typography-config),
|
|
44
|
-
get-density-tokens(m2-utils.$placeholder-density-config)
|
|
45
|
-
);
|
|
46
|
-
}
|