@angular/material 16.2.0-next.2 → 16.2.0-next.4
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/autocomplete/index.d.ts +34 -4
- package/button/_fab-theme.scss +70 -43
- package/card/_card-theme.scss +20 -4
- package/checkbox/_checkbox-theme.scss +5 -3
- package/core/index.d.ts +2 -2
- package/core/tokens/_token-utils.scss +14 -0
- package/core/tokens/m2/mat/_expansion.scss +90 -0
- package/core/tokens/m2/mat/_menu.scss +62 -0
- package/core/tokens/m2/mat/_stepper.scss +118 -0
- package/core/tokens/m2/mdc/_extended-fab.scss +88 -0
- package/core/tokens/m2/mdc/_fab.scss +89 -0
- package/core/typography/_typography-utils.scss +13 -0
- package/esm2022/autocomplete/autocomplete-trigger.mjs +85 -38
- package/esm2022/autocomplete/autocomplete.mjs +25 -4
- package/esm2022/button/fab.mjs +8 -8
- package/esm2022/button-toggle/button-toggle.mjs +2 -1
- package/esm2022/chips/chip-set.mjs +2 -2
- package/esm2022/core/option/option.mjs +9 -5
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/expansion/expansion-animations.mjs +5 -2
- package/esm2022/expansion/expansion-panel-header.mjs +3 -3
- package/esm2022/expansion/expansion-panel.mjs +3 -3
- package/esm2022/legacy-autocomplete/autocomplete.mjs +2 -1
- package/esm2022/legacy-dialog/testing/dialog-opener.mjs +6 -1
- package/esm2022/legacy-menu/menu.mjs +4 -2
- package/esm2022/legacy-table/text-column.mjs +6 -2
- package/esm2022/legacy-tabs/tab.mjs +6 -3
- package/esm2022/legacy-tooltip/tooltip.mjs +5 -2
- package/esm2022/menu/menu-item.mjs +4 -4
- package/esm2022/menu/menu.mjs +3 -3
- package/esm2022/sidenav/drawer.mjs +15 -13
- package/esm2022/stepper/step-header.mjs +2 -2
- package/esm2022/stepper/stepper.mjs +3 -3
- package/expansion/_expansion-legacy-index.scss +0 -1
- package/expansion/_expansion-theme.import.scss +0 -2
- package/expansion/_expansion-theme.scss +12 -68
- package/fesm2022/autocomplete.mjs +109 -41
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +1 -0
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +8 -8
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/chips.mjs +1 -1
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +9 -5
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/expansion.mjs +8 -5
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/legacy-autocomplete.mjs +1 -0
- package/fesm2022/legacy-autocomplete.mjs.map +1 -1
- package/fesm2022/legacy-dialog/testing.mjs +5 -0
- package/fesm2022/legacy-dialog/testing.mjs.map +1 -1
- package/fesm2022/legacy-menu.mjs +3 -1
- package/fesm2022/legacy-menu.mjs.map +1 -1
- package/fesm2022/legacy-table.mjs +5 -1
- package/fesm2022/legacy-table.mjs.map +1 -1
- package/fesm2022/legacy-tabs.mjs +5 -2
- package/fesm2022/legacy-tabs.mjs.map +1 -1
- package/fesm2022/legacy-tooltip.mjs +4 -1
- package/fesm2022/legacy-tooltip.mjs.map +1 -1
- package/fesm2022/menu.mjs +5 -5
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +14 -12
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/stepper.mjs +4 -4
- package/fesm2022/stepper.mjs.map +1 -1
- package/legacy-autocomplete/index.d.ts +1 -0
- package/legacy-prebuilt-themes/legacy-deeppurple-amber.css +1 -1
- package/legacy-prebuilt-themes/legacy-indigo-pink.css +1 -1
- package/legacy-prebuilt-themes/legacy-pink-bluegrey.css +1 -1
- package/legacy-prebuilt-themes/legacy-purple-green.css +1 -1
- package/menu/_menu-theme.scss +9 -52
- package/menu/index.d.ts +1 -1
- package/package.json +2 -2
- 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/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/mdc-migration/index_bundled.js.map +1 -1
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +1 -5
- package/sidenav/index.d.ts +1 -1
- package/stepper/_stepper-theme.scss +18 -147
- package/expansion/_expansion-mixins.import.scss +0 -1
- package/expansion/_expansion-mixins.scss +0 -11
package/autocomplete/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { _AbstractConstructor } from '@angular/material/core';
|
|
|
2
2
|
import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
|
|
3
3
|
import { AfterContentInit } from '@angular/core';
|
|
4
4
|
import { AfterViewInit } from '@angular/core';
|
|
5
|
+
import { AnimationEvent as AnimationEvent_2 } from '@angular/animations';
|
|
5
6
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
6
7
|
import { CanDisableRipple } from '@angular/material/core';
|
|
7
8
|
import { ChangeDetectorRef } from '@angular/core';
|
|
@@ -98,19 +99,21 @@ export declare const MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER: {
|
|
|
98
99
|
*/
|
|
99
100
|
export declare const MAT_AUTOCOMPLETE_VALUE_ACCESSOR: any;
|
|
100
101
|
|
|
101
|
-
export declare class MatAutocomplete extends _MatAutocompleteBase {
|
|
102
|
+
export declare class MatAutocomplete extends _MatAutocompleteBase implements OnDestroy {
|
|
102
103
|
/** Reference to all option groups within the autocomplete. */
|
|
103
104
|
optionGroups: QueryList<MatOptgroup>;
|
|
104
105
|
/** Reference to all options within the autocomplete. */
|
|
105
106
|
options: QueryList<MatOption>;
|
|
106
107
|
protected _visibleClass: string;
|
|
107
108
|
protected _hiddenClass: string;
|
|
109
|
+
_animationDone: EventEmitter<AnimationEvent_2>;
|
|
108
110
|
/** Whether checkmark indicator for single-selection options is hidden. */
|
|
109
111
|
get hideSingleSelectionIndicator(): boolean;
|
|
110
112
|
set hideSingleSelectionIndicator(value: BooleanInput);
|
|
111
113
|
private _hideSingleSelectionIndicator;
|
|
112
114
|
/** Syncs the parent state with the individual options. */
|
|
113
115
|
_syncParentProperties(): void;
|
|
116
|
+
ngOnDestroy(): void;
|
|
114
117
|
protected _skipPredicate(_option: _MatOptionBase): boolean;
|
|
115
118
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatAutocomplete, never>;
|
|
116
119
|
static ɵcmp: i0.ɵɵComponentDeclaration<MatAutocomplete, "mat-autocomplete", ["matAutocomplete"], { "disableRipple": { "alias": "disableRipple"; "required": false; }; "hideSingleSelectionIndicator": { "alias": "hideSingleSelectionIndicator"; "required": false; }; }, {}, ["optionGroups", "options"], ["*"], false, never>;
|
|
@@ -134,6 +137,8 @@ export declare abstract class _MatAutocompleteBase extends _MatAutocompleteMixin
|
|
|
134
137
|
protected abstract _visibleClass: string;
|
|
135
138
|
/** Class to apply to the panel when it's hidden. */
|
|
136
139
|
protected abstract _hiddenClass: string;
|
|
140
|
+
/** Emits when the panel animation is done. Null if the panel doesn't animate. */
|
|
141
|
+
abstract _animationDone: EventEmitter<AnimationEvent_2> | null;
|
|
137
142
|
/** Manages active item in option list based on key events. */
|
|
138
143
|
_keyManager: ActiveDescendantKeyManager<_MatOptionBase>;
|
|
139
144
|
/** Whether the autocomplete panel should be visible, depending on option length. */
|
|
@@ -170,6 +175,15 @@ export declare abstract class _MatAutocompleteBase extends _MatAutocompleteMixin
|
|
|
170
175
|
get autoSelectActiveOption(): boolean;
|
|
171
176
|
set autoSelectActiveOption(value: BooleanInput);
|
|
172
177
|
private _autoSelectActiveOption;
|
|
178
|
+
/**
|
|
179
|
+
* Whether the user is required to make a selection when they're interacting with the
|
|
180
|
+
* autocomplete. If the user moves away from the autcomplete without selecting an option from
|
|
181
|
+
* the list, the value will be reset. If the user opens the panel and closes it without
|
|
182
|
+
* interacting or selecting a value, the initial value will be kept.
|
|
183
|
+
*/
|
|
184
|
+
get requireSelection(): boolean;
|
|
185
|
+
set requireSelection(value: BooleanInput);
|
|
186
|
+
private _requireSelection;
|
|
173
187
|
/**
|
|
174
188
|
* Specify the width of the autocomplete panel. Can be any CSS sizing value, otherwise it will
|
|
175
189
|
* match the width of its host.
|
|
@@ -220,7 +234,7 @@ export declare abstract class _MatAutocompleteBase extends _MatAutocompleteMixin
|
|
|
220
234
|
private _setThemeClasses;
|
|
221
235
|
protected _skipPredicate(option: _MatOptionBase): boolean;
|
|
222
236
|
static ɵfac: i0.ɵɵFactoryDeclaration<_MatAutocompleteBase, never>;
|
|
223
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<_MatAutocompleteBase, never, never, { "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "displayWith": { "alias": "displayWith"; "required": false; }; "autoActiveFirstOption": { "alias": "autoActiveFirstOption"; "required": false; }; "autoSelectActiveOption": { "alias": "autoSelectActiveOption"; "required": false; }; "panelWidth": { "alias": "panelWidth"; "required": false; }; "classList": { "alias": "class"; "required": false; }; }, { "optionSelected": "optionSelected"; "opened": "opened"; "closed": "closed"; "optionActivated": "optionActivated"; }, never, never, false, never>;
|
|
237
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<_MatAutocompleteBase, never, never, { "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "displayWith": { "alias": "displayWith"; "required": false; }; "autoActiveFirstOption": { "alias": "autoActiveFirstOption"; "required": false; }; "autoSelectActiveOption": { "alias": "autoSelectActiveOption"; "required": false; }; "requireSelection": { "alias": "requireSelection"; "required": false; }; "panelWidth": { "alias": "panelWidth"; "required": false; }; "classList": { "alias": "class"; "required": false; }; }, { "optionSelected": "optionSelected"; "opened": "opened"; "closed": "closed"; "optionActivated": "optionActivated"; }, never, never, false, never>;
|
|
224
238
|
}
|
|
225
239
|
|
|
226
240
|
/** Default `mat-autocomplete` options that can be overridden. */
|
|
@@ -229,6 +243,11 @@ export declare interface MatAutocompleteDefaultOptions {
|
|
|
229
243
|
autoActiveFirstOption?: boolean;
|
|
230
244
|
/** Whether the active option should be selected as the user is navigating. */
|
|
231
245
|
autoSelectActiveOption?: boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Whether the user is required to make a selection when
|
|
248
|
+
* they're interacting with the autocomplete.
|
|
249
|
+
*/
|
|
250
|
+
requireSelection?: boolean;
|
|
232
251
|
/** Class or list of classes to be applied to the autocomplete's overlay panel. */
|
|
233
252
|
overlayPanelClass?: string | string[];
|
|
234
253
|
/** Wheter icon indicators should be hidden for single-selection. */
|
|
@@ -302,8 +321,12 @@ export declare abstract class _MatAutocompleteTriggerBase implements ControlValu
|
|
|
302
321
|
private _componentDestroyed;
|
|
303
322
|
private _autocompleteDisabled;
|
|
304
323
|
private _scrollStrategy;
|
|
324
|
+
private _keydownSubscription;
|
|
325
|
+
private _outsideClickSubscription;
|
|
305
326
|
/** Old value of the native input. Used to work around issues with the `input` event on IE. */
|
|
306
327
|
private _previousValue;
|
|
328
|
+
/** Value of the input element when the panel was opened. */
|
|
329
|
+
private _valueOnOpen;
|
|
307
330
|
/** Strategy that is used to position the panel. */
|
|
308
331
|
private _positionStrategy;
|
|
309
332
|
/** Whether or not the label state is being overridden. */
|
|
@@ -413,6 +436,11 @@ export declare abstract class _MatAutocompleteTriggerBase implements ControlValu
|
|
|
413
436
|
* stream every time the option list changes.
|
|
414
437
|
*/
|
|
415
438
|
private _subscribeToClosingActions;
|
|
439
|
+
/**
|
|
440
|
+
* Emits the opened event once it's known that the panel will be shown and stores
|
|
441
|
+
* the state of the trigger right before the opening sequence was finished.
|
|
442
|
+
*/
|
|
443
|
+
private _emitOpened;
|
|
416
444
|
/** Destroys the autocomplete suggestion panel. */
|
|
417
445
|
private _destroyPanel;
|
|
418
446
|
private _assignOptionValue;
|
|
@@ -428,6 +456,10 @@ export declare abstract class _MatAutocompleteTriggerBase implements ControlValu
|
|
|
428
456
|
*/
|
|
429
457
|
private _clearPreviousSelectedOption;
|
|
430
458
|
private _attachOverlay;
|
|
459
|
+
/** Handles keyboard events coming from the overlay panel. */
|
|
460
|
+
private _handlePanelKeydown;
|
|
461
|
+
/** Updates the panel's visibility state and any trigger state tied to id. */
|
|
462
|
+
private _updatePanelState;
|
|
431
463
|
private _getOverlayConfig;
|
|
432
464
|
private _getOverlayPosition;
|
|
433
465
|
/** Sets the positions on a position strategy based on the directive's input state. */
|
|
@@ -450,8 +482,6 @@ export declare abstract class _MatAutocompleteTriggerBase implements ControlValu
|
|
|
450
482
|
private _getWindow;
|
|
451
483
|
/** Scrolls to a particular option in the list. */
|
|
452
484
|
private _scrollToOption;
|
|
453
|
-
/** Handles keyboard events coming from the overlay panel. */
|
|
454
|
-
private _handleOverlayEvents;
|
|
455
485
|
/**
|
|
456
486
|
* Track which modal we have modified the `aria-owns` attribute of. When the combobox trigger is
|
|
457
487
|
* inside an aria-modal, we apply aria-owns to the parent modal with the `id` of the options
|
package/button/_fab-theme.scss
CHANGED
|
@@ -1,75 +1,102 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '@material/fab/fab' as mdc-fab;
|
|
3
3
|
@use '@material/fab/fab-theme' as mdc-fab-theme;
|
|
4
|
-
@use '@material/
|
|
4
|
+
@use '@material/fab/extended-fab-theme' as mdc-extended-fab-theme;
|
|
5
5
|
|
|
6
6
|
@use './button-theme-private';
|
|
7
7
|
@use '../core/mdc-helpers/mdc-helpers';
|
|
8
8
|
@use '../core/theming/theming';
|
|
9
|
+
@use '../core/tokens/m2/mdc/fab' as tokens-mdc-fab;
|
|
10
|
+
@use '../core/tokens/m2/mdc/extended-fab' as tokens-mdc-extended-fab;
|
|
9
11
|
@use '../core/typography/typography';
|
|
10
12
|
|
|
11
|
-
@mixin _fab-variant($foreground, $background) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
@mixin _fab-variant($config, $foreground, $background) {
|
|
14
|
+
$color-config: map.merge(
|
|
15
|
+
$config,
|
|
16
|
+
(
|
|
17
|
+
primary: (
|
|
18
|
+
default: $background,
|
|
19
|
+
default-contrast: $foreground,
|
|
20
|
+
),
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
$color-tokens: tokens-mdc-fab.get-color-tokens($color-config);
|
|
24
|
+
@include mdc-fab-theme.theme($color-tokens);
|
|
16
25
|
|
|
17
26
|
--mat-mdc-fab-color: #{$foreground};
|
|
18
27
|
}
|
|
19
28
|
|
|
29
|
+
@function white-or-black($color, $is-dark) {
|
|
30
|
+
@return if(mdc-helpers.variable-safe-contrast-tone($color, $is-dark) == 'dark', #000, #fff);
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
@mixin color($config-or-theme) {
|
|
21
34
|
$config: theming.get-color-config($config-or-theme);
|
|
22
|
-
@include mdc-helpers.using-mdc-theme($config) {
|
|
23
|
-
$on-surface: mdc-theme-color.prop-value(on-surface);
|
|
24
|
-
$is-dark: map.get($config, is-dark);
|
|
25
35
|
|
|
26
|
-
|
|
36
|
+
$is-dark: map.get($config, is-dark);
|
|
37
|
+
$background: map.get($config, background);
|
|
38
|
+
|
|
39
|
+
$surface: theming.get-color-from-palette($background, card);
|
|
40
|
+
$primary: theming.get-color-from-palette(map.get($config, primary));
|
|
41
|
+
$accent: theming.get-color-from-palette(map.get($config, accent));
|
|
42
|
+
$warn: theming.get-color-from-palette(map.get($config, warn));
|
|
43
|
+
|
|
44
|
+
$on-surface: white-or-black($surface, $is-dark);
|
|
45
|
+
$on-primary: white-or-black($primary, $is-dark);
|
|
46
|
+
$on-accent: white-or-black($accent, $is-dark);
|
|
47
|
+
$on-warn: white-or-black($warn, $is-dark);
|
|
48
|
+
|
|
49
|
+
$disabled: rgba($on-surface, 0.12);
|
|
50
|
+
$on-disabled: rgba($on-surface, if(map.get($config, is-dark), 0.5, 0.38));
|
|
51
|
+
|
|
52
|
+
.mat-mdc-fab,
|
|
53
|
+
.mat-mdc-mini-fab {
|
|
54
|
+
// TODO(wagnermaciel): The ripple-theme-styles mixin depends heavily on
|
|
55
|
+
// being wrapped by using-mdc-theme. This workaround needs to be
|
|
56
|
+
// revisited w/ a more holistic solution.
|
|
57
|
+
@include mdc-helpers.using-mdc-theme($config) {
|
|
27
58
|
@include button-theme-private.ripple-theme-styles($config, true);
|
|
59
|
+
}
|
|
28
60
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
&.mat-warn {
|
|
48
|
-
@include _fab-variant(
|
|
49
|
-
mdc-theme-color.prop-value(on-error),
|
|
50
|
-
mdc-theme-color.prop-value(error)
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@include button-theme-private.apply-disabled-style() {
|
|
55
|
-
@include _fab-variant(
|
|
56
|
-
rgba($on-surface, if(map.get($config, is-dark), 0.5, 0.38)),
|
|
57
|
-
rgba($on-surface, 0.12)
|
|
58
|
-
);
|
|
59
|
-
}
|
|
61
|
+
@include button-theme-private.apply-disabled-style() {
|
|
62
|
+
@include _fab-variant($config, $on-disabled, $disabled);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.mat-unthemed {
|
|
66
|
+
@include _fab-variant($config, $on-surface, $surface);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.mat-primary {
|
|
70
|
+
@include _fab-variant($config, $on-primary, $primary);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.mat-accent {
|
|
74
|
+
@include _fab-variant($config, $on-accent, $accent);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.mat-warn {
|
|
78
|
+
@include _fab-variant($config, $on-warn, $warn);
|
|
60
79
|
}
|
|
61
80
|
}
|
|
62
81
|
}
|
|
63
82
|
|
|
64
83
|
@mixin typography($config-or-theme) {
|
|
65
84
|
$config: typography.private-typography-to-2018-config(
|
|
66
|
-
theming.get-typography-config($config-or-theme)
|
|
85
|
+
theming.get-typography-config($config-or-theme)
|
|
86
|
+
);
|
|
87
|
+
|
|
67
88
|
@include mdc-helpers.using-mdc-typography($config) {
|
|
68
89
|
@include mdc-fab.without-ripple($query: mdc-helpers.$mdc-typography-styles-query);
|
|
69
90
|
}
|
|
91
|
+
|
|
92
|
+
$typography-tokens: tokens-mdc-extended-fab.get-typography-tokens($config);
|
|
93
|
+
.mat-mdc-extended-fab {
|
|
94
|
+
@include mdc-extended-fab-theme.theme($typography-tokens);
|
|
95
|
+
}
|
|
70
96
|
}
|
|
71
97
|
|
|
72
|
-
@mixin density($config-or-theme) {
|
|
98
|
+
@mixin density($config-or-theme) {
|
|
99
|
+
}
|
|
73
100
|
|
|
74
101
|
@mixin theme($theme-or-color-config) {
|
|
75
102
|
$theme: theming.private-legacy-get-theme($theme-or-color-config);
|
package/card/_card-theme.scss
CHANGED
|
@@ -79,8 +79,24 @@
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
@mixin theme-from-tokens($tokens) {
|
|
82
|
-
@
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
@if ($tokens != ()) {
|
|
83
|
+
$elevated-card-tokens: map.get($tokens, tokens-mdc-elevated-card.$prefix);
|
|
84
|
+
// Work around a bug in MDC where the elevation is not resolved to an actual shadow value.
|
|
85
|
+
$elevated-card-tokens: token-utils.resolve-elevation(
|
|
86
|
+
$elevated-card-tokens,
|
|
87
|
+
container-elevation,
|
|
88
|
+
container-shadow-color
|
|
89
|
+
);
|
|
90
|
+
$outlined-card-tokens: map.get($tokens, tokens-mdc-outlined-card.$prefix);
|
|
91
|
+
// Work around a bug in MDC where the elevation is not resolved to an actual shadow value.
|
|
92
|
+
$outlined-card-tokens: token-utils.resolve-elevation(
|
|
93
|
+
$outlined-card-tokens,
|
|
94
|
+
container-elevation,
|
|
95
|
+
container-shadow-color
|
|
96
|
+
);
|
|
97
|
+
@include mdc-elevated-card-theme.theme($elevated-card-tokens);
|
|
98
|
+
@include mdc-outlined-card-theme.theme($outlined-card-tokens);
|
|
99
|
+
@include token-utils.create-token-values(
|
|
100
|
+
tokens-mat-card.$prefix, map.get($tokens, tokens-mat-card.$prefix));
|
|
101
|
+
}
|
|
86
102
|
}
|
|
@@ -90,7 +90,9 @@
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
@mixin theme-from-tokens($tokens) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
@if ($tokens != ()) {
|
|
94
|
+
// TODO(mmalerba): Some of the theme styles above are not represented in terms of tokens,
|
|
95
|
+
// so this mixin is currently incomplete.
|
|
96
|
+
@include mdc-checkbox-theme.theme(map.get($tokens, tokens-mdc-checkbox.$prefix));
|
|
97
|
+
}
|
|
96
98
|
}
|
package/core/index.d.ts
CHANGED
|
@@ -606,9 +606,9 @@ export declare class _MatOptionBase<T = any> implements FocusableOption, AfterVi
|
|
|
606
606
|
*/
|
|
607
607
|
get viewValue(): string;
|
|
608
608
|
/** Selects the option. */
|
|
609
|
-
select(): void;
|
|
609
|
+
select(emitEvent?: boolean): void;
|
|
610
610
|
/** Deselects the option. */
|
|
611
|
-
deselect(): void;
|
|
611
|
+
deselect(emitEvent?: boolean): void;
|
|
612
612
|
/** Sets focus onto this option. */
|
|
613
613
|
focus(_origin?: FocusOrigin, options?: FocusOptions): void;
|
|
614
614
|
/**
|
|
@@ -39,6 +39,7 @@ $placeholder-typography-config: (
|
|
|
39
39
|
caption: $_placeholder-typography-level-config,
|
|
40
40
|
button: $_placeholder-typography-level-config,
|
|
41
41
|
overline: $_placeholder-typography-level-config,
|
|
42
|
+
subheading-1: $_placeholder-typography-level-config,
|
|
42
43
|
);
|
|
43
44
|
|
|
44
45
|
// Placeholder density config that can be passed to token getter functions when generating token
|
|
@@ -93,6 +94,19 @@ $_component-prefix: null;
|
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
|
|
97
|
+
// Returns the name of a token including the current prefix. Intended to be used in calculations
|
|
98
|
+
// involving tokens. `create-token-slot` should be used when outputting tokens.
|
|
99
|
+
@function get-token-variable($token) {
|
|
100
|
+
@if $_component-prefix == null or $_tokens == null {
|
|
101
|
+
@error '`get-token-variable` must be used within `use-tokens`';
|
|
102
|
+
}
|
|
103
|
+
@if not map.has-key($_tokens, $token) {
|
|
104
|
+
@error 'Token #{$token} does not exist. Configured tokens are: #{map.keys($_tokens)}';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@return mdc-custom-properties.create-varname('#{$_component-prefix}-#{$token}');
|
|
108
|
+
}
|
|
109
|
+
|
|
96
110
|
@mixin create-token-values($prefix, $tokens) {
|
|
97
111
|
@include _configure-token-prefix($prefix...) {
|
|
98
112
|
@include mdc-keys.declare-custom-properties($tokens, $_component-prefix);
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
@use '../../../theming/theming';
|
|
4
|
+
@use '../../../style/sass-utils';
|
|
5
|
+
@use '../../../typography/typography-utils';
|
|
6
|
+
|
|
7
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
8
|
+
$prefix: (mat, expansion);
|
|
9
|
+
|
|
10
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
11
|
+
// but may be in a future version of the theming API.
|
|
12
|
+
@function get-unthemable-tokens() {
|
|
13
|
+
@return (
|
|
14
|
+
container-shape: 4px,
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
19
|
+
@function get-color-tokens($config) {
|
|
20
|
+
$foreground: map.get($config, foreground);
|
|
21
|
+
$background: map.get($config, background);
|
|
22
|
+
|
|
23
|
+
@return (
|
|
24
|
+
container-background-color: theming.get-color-from-palette($background, card),
|
|
25
|
+
container-text-color: theming.get-color-from-palette($foreground, text),
|
|
26
|
+
actions-divider-color: theming.get-color-from-palette($foreground, divider),
|
|
27
|
+
header-hover-state-layer-color: theming.get-color-from-palette($background, hover),
|
|
28
|
+
header-focus-state-layer-color: theming.get-color-from-palette($background, hover),
|
|
29
|
+
header-disabled-state-text-color: theming.get-color-from-palette($foreground, disabled-button),
|
|
30
|
+
header-text-color: theming.get-color-from-palette($foreground, text),
|
|
31
|
+
header-description-color: theming.get-color-from-palette($foreground, secondary-text),
|
|
32
|
+
header-indicator-color: theming.get-color-from-palette($foreground, secondary-text),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
37
|
+
@function get-typography-tokens($config) {
|
|
38
|
+
$fallback-font-family: typography-utils.font-family($config);
|
|
39
|
+
|
|
40
|
+
@return (
|
|
41
|
+
header-text-font: typography-utils.font-family($config, subheading-1) or $fallback-font-family,
|
|
42
|
+
header-text-size: typography-utils.font-size($config, subheading-1),
|
|
43
|
+
header-text-weight: typography-utils.font-weight($config, subheading-1),
|
|
44
|
+
|
|
45
|
+
// TODO(crisbeto): these two properties weren't set at all before the introduction of tokens,
|
|
46
|
+
// but it's inconsistent not to provide them since the container sets all of them. Eventually
|
|
47
|
+
// we should change the values to use come from `subheading-1`.
|
|
48
|
+
header-text-line-height: inherit,
|
|
49
|
+
header-text-tracking: inherit,
|
|
50
|
+
|
|
51
|
+
container-text-font: typography-utils.font-family($config, body-1) or $fallback-font-family,
|
|
52
|
+
container-text-line-height: typography-utils.line-height($config, body-1),
|
|
53
|
+
container-text-size: typography-utils.font-size($config, body-1),
|
|
54
|
+
container-text-tracking: typography-utils.letter-spacing($config, body-1),
|
|
55
|
+
container-text-weight: typography-utils.font-weight($config, body-1),
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
60
|
+
@function get-density-tokens($config) {
|
|
61
|
+
$scale: theming.clamp-density($config, -3);
|
|
62
|
+
$collapsed-scale: (
|
|
63
|
+
0: 48px,
|
|
64
|
+
-1: 44px,
|
|
65
|
+
-2: 40px,
|
|
66
|
+
-3: 36px,
|
|
67
|
+
);
|
|
68
|
+
$expanded-scale: (
|
|
69
|
+
0: 64px,
|
|
70
|
+
-1: 60px,
|
|
71
|
+
-2: 56px,
|
|
72
|
+
-3: 48px,
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
@return (
|
|
76
|
+
header-collapsed-state-height: map.get($collapsed-scale, $scale),
|
|
77
|
+
header-expanded-state-height: map.get($expanded-scale, $scale),
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
82
|
+
// This is used to create token slots.
|
|
83
|
+
@function get-token-slots() {
|
|
84
|
+
@return sass-utils.deep-merge-all(
|
|
85
|
+
get-unthemable-tokens(),
|
|
86
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
87
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
88
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
89
|
+
);
|
|
90
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
@use '../../../theming/theming';
|
|
4
|
+
@use '../../../style/sass-utils';
|
|
5
|
+
@use '../../../typography/typography-utils';
|
|
6
|
+
|
|
7
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
8
|
+
$prefix: (mat, menu);
|
|
9
|
+
|
|
10
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
11
|
+
// but may be in a future version of the theming API.
|
|
12
|
+
@function get-unthemable-tokens() {
|
|
13
|
+
@return (
|
|
14
|
+
container-shape: 4px,
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
19
|
+
@function get-color-tokens($config) {
|
|
20
|
+
$is-dark: map.get($config, is-dark);
|
|
21
|
+
$foreground: map.get($config, foreground);
|
|
22
|
+
$background: map.get($config, background);
|
|
23
|
+
$on-surface: if($is-dark, #fff, #000);
|
|
24
|
+
$active-state-layer-color: rgba($on-surface, if($is-dark, 0.08, 0.04));
|
|
25
|
+
$text-color: theming.get-color-from-palette($foreground, text);
|
|
26
|
+
|
|
27
|
+
@return (
|
|
28
|
+
item-label-text-color: $text-color,
|
|
29
|
+
item-icon-color: $text-color,
|
|
30
|
+
item-hover-state-layer-color: $active-state-layer-color,
|
|
31
|
+
item-focus-state-layer-color: $active-state-layer-color,
|
|
32
|
+
container-color: theming.get-color-from-palette($background, card),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
37
|
+
@function get-typography-tokens($config) {
|
|
38
|
+
@return (
|
|
39
|
+
item-label-text-font:
|
|
40
|
+
typography-utils.font-family($config, body-1) or typography-utils.font-family($config),
|
|
41
|
+
item-label-text-size: typography-utils.font-size($config, body-1),
|
|
42
|
+
item-label-text-tracking: typography-utils.letter-spacing($config, body-1),
|
|
43
|
+
item-label-text-line-height: typography-utils.line-height($config, body-1),
|
|
44
|
+
item-label-text-weight: typography-utils.font-weight($config, body-1),
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
49
|
+
@function get-density-tokens($config) {
|
|
50
|
+
@return ();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
54
|
+
// This is used to create token slots.
|
|
55
|
+
@function get-token-slots() {
|
|
56
|
+
@return sass-utils.deep-merge-all(
|
|
57
|
+
get-unthemable-tokens(),
|
|
58
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
59
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
60
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
@use '../../../theming/theming';
|
|
4
|
+
@use '../../../typography/typography-utils';
|
|
5
|
+
@use '../../../style/sass-utils';
|
|
6
|
+
|
|
7
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
8
|
+
$prefix: (mat, stepper);
|
|
9
|
+
|
|
10
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
11
|
+
// but may be in a future version of the theming API.
|
|
12
|
+
@function get-unthemable-tokens() {
|
|
13
|
+
@return ();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
17
|
+
@function get-color-tokens($config) {
|
|
18
|
+
$foreground: map.get($config, foreground);
|
|
19
|
+
$background: map.get($config, background);
|
|
20
|
+
$primary: map.get($config, primary);
|
|
21
|
+
$warn: map.get($config, warn);
|
|
22
|
+
|
|
23
|
+
@return map.merge(private-get-color-palette-color-tokens($primary), (
|
|
24
|
+
// Background for stepper container.
|
|
25
|
+
container-color: theming.get-color-from-palette($background, card),
|
|
26
|
+
// Color of the line indicator connecting the steps.
|
|
27
|
+
line-color: theming.get-color-from-palette($foreground, divider),
|
|
28
|
+
// Background color of the header while hovered.
|
|
29
|
+
header-hover-state-layer-color: theming.get-color-from-palette($background, hover),
|
|
30
|
+
// Background color of the header while focused.
|
|
31
|
+
header-focus-state-layer-color: theming.get-color-from-palette($background, hover),
|
|
32
|
+
// Color of the text inside the step header.
|
|
33
|
+
header-label-text-color: theming.get-color-from-palette($foreground, secondary-text),
|
|
34
|
+
// Color for the "optional" label in the step header.
|
|
35
|
+
header-optional-label-text-color: theming.get-color-from-palette($foreground, secondary-text),
|
|
36
|
+
// Color of the header text when a step is selected.
|
|
37
|
+
header-selected-state-label-text-color: theming.get-color-from-palette($foreground, text),
|
|
38
|
+
// Color of the header text when a step is in an error state.
|
|
39
|
+
header-error-state-label-text-color: theming.get-color-from-palette($warn, text),
|
|
40
|
+
// Background color of the header icon.
|
|
41
|
+
header-icon-background-color: theming.get-color-from-palette($foreground, secondary-text),
|
|
42
|
+
// Foreground color of the header icon in the error state.
|
|
43
|
+
header-error-state-icon-foreground-color: theming.get-color-from-palette($warn, text),
|
|
44
|
+
// Background color of the header icon in the error state.
|
|
45
|
+
header-error-state-icon-background-color: transparent,
|
|
46
|
+
));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
50
|
+
@function get-typography-tokens($config) {
|
|
51
|
+
@return (
|
|
52
|
+
// Font family of the entire stepper.
|
|
53
|
+
container-text-font: typography-utils.font-family($config),
|
|
54
|
+
// Font family of the text inside the step header.
|
|
55
|
+
header-label-text-font: typography-utils.font-family($config, body-1) or
|
|
56
|
+
typography-utils.font-family($config),
|
|
57
|
+
// Size of the text inside the step header.
|
|
58
|
+
header-label-text-size: typography-utils.font-size($config, body-1),
|
|
59
|
+
// Weight of the text inside the step header.
|
|
60
|
+
header-label-text-weight: typography-utils.font-weight($config, body-1),
|
|
61
|
+
// Color of the header text when a step is in an error state.
|
|
62
|
+
header-error-state-label-text-size: typography-utils.font-size($config, body-2),
|
|
63
|
+
// Size of the header text in the selected state.
|
|
64
|
+
header-selected-state-label-text-size: typography-utils.font-size($config, body-2),
|
|
65
|
+
// Weight of the header text in the selected state.
|
|
66
|
+
header-selected-state-label-text-weight: typography-utils.font-weight($config, body-2),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
71
|
+
@function get-density-tokens($config) {
|
|
72
|
+
$scale: theming.clamp-density($config, -4);
|
|
73
|
+
$height-config: (
|
|
74
|
+
0: 72px,
|
|
75
|
+
-1: 68px,
|
|
76
|
+
-2: 64px,
|
|
77
|
+
-3: 60px,
|
|
78
|
+
-4: 42px,
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
@return (
|
|
82
|
+
header-height: map.get($height-config, $scale),
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Generates the tokens used to theme the stepper based on a palette.
|
|
87
|
+
@function private-get-color-palette-color-tokens($palette) {
|
|
88
|
+
$active-state-foreground: theming.get-color-from-palette($palette, default-contrast);
|
|
89
|
+
$active-state-background: theming.get-color-from-palette($palette);
|
|
90
|
+
|
|
91
|
+
@return (
|
|
92
|
+
// Foreground color of the header icon.
|
|
93
|
+
header-icon-foreground-color: theming.get-color-from-palette($palette, default-contrast),
|
|
94
|
+
// Background color of the header icon in the selected state.
|
|
95
|
+
header-selected-state-icon-background-color: $active-state-background,
|
|
96
|
+
// Foreground color of the header icon in the selected state.
|
|
97
|
+
header-selected-state-icon-foreground-color: $active-state-foreground,
|
|
98
|
+
// Background color of the header icon in the selected state.
|
|
99
|
+
header-done-state-icon-background-color: $active-state-background,
|
|
100
|
+
// Foreground color of the header icon in the selected state.
|
|
101
|
+
header-done-state-icon-foreground-color: $active-state-foreground,
|
|
102
|
+
// Background color of the header icon in the editing state.
|
|
103
|
+
header-edit-state-icon-background-color: $active-state-background,
|
|
104
|
+
// Foreground color of the header icon in the editing state.
|
|
105
|
+
header-edit-state-icon-foreground-color: $active-state-foreground,
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
110
|
+
// This is used to create token slots.
|
|
111
|
+
@function get-token-slots() {
|
|
112
|
+
@return sass-utils.deep-merge-all(
|
|
113
|
+
get-unthemable-tokens(),
|
|
114
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
115
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
116
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
117
|
+
);
|
|
118
|
+
}
|