@angular/material 17.0.0-next.1 → 17.0.0-next.3

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.
Files changed (119) hide show
  1. package/_index.scss +1 -2
  2. package/autocomplete/_autocomplete-theme.scss +12 -18
  3. package/autocomplete/index.d.ts +19 -26
  4. package/badge/_badge-theme.scss +15 -27
  5. package/badge/index.d.ts +9 -17
  6. package/bottom-sheet/_bottom-sheet-theme.scss +13 -22
  7. package/button-toggle/_button-toggle-theme.scss +17 -28
  8. package/button-toggle/index.d.ts +15 -18
  9. package/checkbox/index.d.ts +21 -27
  10. package/chips/_chips-theme.scss +18 -56
  11. package/core/color/_all-color.scss +7 -15
  12. package/core/density/private/_all-density.scss +34 -39
  13. package/core/focus-indicators/_focus-indicators-theme.scss +6 -8
  14. package/core/focus-indicators/_private.scss +22 -26
  15. package/core/index.d.ts +7 -11
  16. package/core/style/_form-common.scss +7 -7
  17. package/core/style/_private.scss +2 -4
  18. package/core/testing/index.d.ts +2 -1
  19. package/core/theming/_all-theme.scss +41 -41
  20. package/core/theming/_inspection.scss +47 -0
  21. package/core/theming/_m2-inspection.scss +57 -0
  22. package/core/theming/_theming.scss +0 -14
  23. package/core/tokens/m2/mat/_autocomplete.scss +5 -8
  24. package/core/tokens/m2/mat/_badge.scss +12 -15
  25. package/core/tokens/m2/mat/_bottom-sheet.scss +11 -17
  26. package/core/tokens/m2/mat/_datepicker.scss +28 -38
  27. package/core/tokens/m2/mat/_divider.scss +5 -8
  28. package/core/tokens/m2/mat/_expansion.scss +24 -28
  29. package/core/tokens/m2/mat/_grid-list.scss +8 -8
  30. package/core/tokens/m2/mat/_icon.scss +3 -3
  31. package/core/tokens/m2/mat/_legacy-button-toggle.scss +15 -19
  32. package/core/tokens/m2/mat/_menu.scss +12 -17
  33. package/core/tokens/m2/mat/_select.scss +15 -29
  34. package/core/tokens/m2/mat/_sidenav.scss +12 -14
  35. package/core/tokens/m2/mat/_snack-bar.scss +7 -8
  36. package/core/tokens/m2/mat/_standard-button-toggle.scss +23 -22
  37. package/core/tokens/m2/mat/_stepper.scss +30 -33
  38. package/core/tokens/m2/mat/_tab-header-with-background.scss +6 -8
  39. package/core/tokens/m2/mat/_tab-header.scss +13 -18
  40. package/core/tokens/m2/mat/_table.scss +19 -23
  41. package/core/tokens/m2/mat/_toolbar.scss +12 -16
  42. package/core/tokens/m2/mdc/_chip.scss +38 -24
  43. package/core/tokens/m2/mdc/_circular-progress.scss +5 -6
  44. package/core/tokens/m2/mdc/_dialog.scss +16 -30
  45. package/core/tokens/m2/mdc/_icon-button.scss +2 -2
  46. package/core/tokens/m2/mdc/_plain-tooltip.scss +9 -22
  47. package/core/tokens/m2/mdc/_snack-bar.scss +10 -23
  48. package/core/tokens/m2/mdc/_tab-indicator.scss +5 -8
  49. package/core/tokens/m2/mdc/_tab.scss +5 -4
  50. package/core/typography/_all-typography.scss +44 -47
  51. package/core/typography/_typography.scss +32 -155
  52. package/core/typography/_versioning.scss +7 -2
  53. package/datepicker/_datepicker-theme.scss +20 -34
  54. package/dialog/_dialog-theme.scss +14 -25
  55. package/dialog/_mdc-dialog-structure-overrides.scss +12 -10
  56. package/dialog/index.d.ts +2 -0
  57. package/divider/_divider-theme.scss +12 -18
  58. package/esm2022/autocomplete/autocomplete-trigger.mjs +13 -19
  59. package/esm2022/autocomplete/autocomplete.mjs +23 -50
  60. package/esm2022/badge/badge.mjs +11 -29
  61. package/esm2022/button-toggle/button-toggle.mjs +25 -33
  62. package/esm2022/checkbox/checkbox.mjs +32 -39
  63. package/esm2022/core/option/optgroup.mjs +10 -11
  64. package/esm2022/core/option/option.mjs +6 -6
  65. package/esm2022/core/testing/option-harness.mjs +3 -3
  66. package/esm2022/core/version.mjs +1 -1
  67. package/esm2022/dialog/dialog-container.mjs +16 -3
  68. package/esm2022/menu/menu-item.mjs +15 -11
  69. package/esm2022/menu/menu.mjs +9 -22
  70. package/esm2022/slide-toggle/slide-toggle.mjs +33 -37
  71. package/esm2022/tabs/tab-group.mjs +3 -3
  72. package/expansion/_expansion-theme.scss +16 -24
  73. package/fesm2022/autocomplete.mjs +33 -65
  74. package/fesm2022/autocomplete.mjs.map +1 -1
  75. package/fesm2022/badge.mjs +11 -28
  76. package/fesm2022/badge.mjs.map +1 -1
  77. package/fesm2022/button-toggle.mjs +25 -32
  78. package/fesm2022/button-toggle.mjs.map +1 -1
  79. package/fesm2022/checkbox.mjs +31 -38
  80. package/fesm2022/checkbox.mjs.map +1 -1
  81. package/fesm2022/core/testing.mjs +2 -2
  82. package/fesm2022/core/testing.mjs.map +1 -1
  83. package/fesm2022/core.mjs +14 -13
  84. package/fesm2022/core.mjs.map +1 -1
  85. package/fesm2022/dialog.mjs +15 -2
  86. package/fesm2022/dialog.mjs.map +1 -1
  87. package/fesm2022/menu.mjs +23 -31
  88. package/fesm2022/menu.mjs.map +1 -1
  89. package/fesm2022/slide-toggle.mjs +33 -36
  90. package/fesm2022/slide-toggle.mjs.map +1 -1
  91. package/fesm2022/tabs.mjs +2 -2
  92. package/fesm2022/tabs.mjs.map +1 -1
  93. package/form-field/_form-field-sizing.scss +1 -1
  94. package/grid-list/_grid-list-theme.scss +12 -19
  95. package/icon/_icon-theme.scss +17 -25
  96. package/list/_list-theme.scss +1 -1
  97. package/menu/_menu-theme.scss +13 -22
  98. package/menu/index.d.ts +12 -18
  99. package/package.json +2 -2
  100. package/prebuilt-themes/deeppurple-amber.css +1 -1
  101. package/prebuilt-themes/indigo-pink.css +1 -1
  102. package/prebuilt-themes/pink-bluegrey.css +1 -1
  103. package/prebuilt-themes/purple-green.css +1 -1
  104. package/progress-spinner/_progress-spinner-theme.scss +16 -22
  105. package/schematics/ng-add/index.js +1 -1
  106. package/schematics/ng-add/index.mjs +1 -1
  107. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +1 -1
  108. package/select/_select-theme.scss +17 -31
  109. package/sidenav/_sidenav-theme.scss +12 -18
  110. package/slide-toggle/index.d.ts +20 -23
  111. package/snack-bar/_snack-bar-theme.scss +15 -24
  112. package/sort/_sort-theme.scss +13 -22
  113. package/stepper/_stepper-theme.scss +16 -34
  114. package/table/_table-theme.scss +14 -25
  115. package/tabs/_tabs-theme.scss +31 -45
  116. package/toolbar/_toolbar-theme.scss +22 -31
  117. package/tooltip/_tooltip-theme.scss +15 -23
  118. package/tree/_tree-theme.scss +20 -29
  119. package/core/typography/_typography-deprecated.scss +0 -39
@@ -1,17 +1,10 @@
1
- import { _AbstractConstructor } from '@angular/material/core';
2
1
  import { AfterViewInit } from '@angular/core';
3
- import { BooleanInput } from '@angular/cdk/coercion';
4
- import { CanColor } from '@angular/material/core';
5
- import { CanDisable } from '@angular/material/core';
6
- import { CanDisableRipple } from '@angular/material/core';
7
2
  import { ChangeDetectorRef } from '@angular/core';
8
3
  import { CheckboxRequiredValidator } from '@angular/forms';
9
- import { _Constructor } from '@angular/material/core';
10
4
  import { ControlValueAccessor } from '@angular/forms';
11
5
  import { ElementRef } from '@angular/core';
12
6
  import { EventEmitter } from '@angular/core';
13
7
  import { FocusableOption } from '@angular/cdk/a11y';
14
- import { HasTabIndex } from '@angular/material/core';
15
8
  import * as i0 from '@angular/core';
16
9
  import * as i3 from '@angular/material/core';
17
10
  import { InjectionToken } from '@angular/core';
@@ -46,7 +39,8 @@ export declare function MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY(): MatCheckboxDefau
46
39
 
47
40
  export declare const MAT_CHECKBOX_REQUIRED_VALIDATOR: Provider;
48
41
 
49
- export declare class MatCheckbox extends _MatCheckboxMixinBase implements AfterViewInit, ControlValueAccessor, CanColor, CanDisable, HasTabIndex, CanDisableRipple, FocusableOption {
42
+ export declare class MatCheckbox implements AfterViewInit, ControlValueAccessor, FocusableOption {
43
+ _elementRef: ElementRef<HTMLElement>;
50
44
  private _changeDetectorRef;
51
45
  private _ngZone;
52
46
  _animationMode?: string | undefined;
@@ -83,9 +77,7 @@ export declare class MatCheckbox extends _MatCheckboxMixinBase implements AfterV
83
77
  /** Returns the unique id for the visual hidden input. */
84
78
  get inputId(): string;
85
79
  /** Whether the checkbox is required. */
86
- get required(): boolean;
87
- set required(value: BooleanInput);
88
- private _required;
80
+ required: boolean;
89
81
  /** Whether the label should appear after or before the checkbox. Defaults to 'after' */
90
82
  labelPosition: 'before' | 'after';
91
83
  /** Name value will be applied to the input element if present */
@@ -96,10 +88,16 @@ export declare class MatCheckbox extends _MatCheckboxMixinBase implements AfterV
96
88
  readonly indeterminateChange: EventEmitter<boolean>;
97
89
  /** The value attribute of the native input element */
98
90
  value: string;
91
+ /** Whether the checkbox has a ripple. */
92
+ disableRipple: boolean;
99
93
  /** The native `<input type="checkbox">` element */
100
94
  _inputElement: ElementRef<HTMLInputElement>;
101
95
  /** The native `<label>` element */
102
96
  _labelElement: ElementRef<HTMLInputElement>;
97
+ /** Tabindex for the checkbox. */
98
+ tabIndex: number;
99
+ /** Palette color of the checkbox. */
100
+ color: string | undefined;
103
101
  /**
104
102
  * Reference to the MatRipple instance of the checkbox.
105
103
  * @deprecated Considered an implementation detail. To be removed.
@@ -114,18 +112,15 @@ export declare class MatCheckbox extends _MatCheckboxMixinBase implements AfterV
114
112
  private _currentAnimationClass;
115
113
  private _currentCheckState;
116
114
  private _controlValueAccessorChangeFn;
117
- constructor(elementRef: ElementRef<HTMLElement>, _changeDetectorRef: ChangeDetectorRef, _ngZone: NgZone, tabIndex: string, _animationMode?: string | undefined, _options?: MatCheckboxDefaultOptions | undefined);
115
+ constructor(_elementRef: ElementRef<HTMLElement>, _changeDetectorRef: ChangeDetectorRef, _ngZone: NgZone, tabIndex: string, _animationMode?: string | undefined, _options?: MatCheckboxDefaultOptions | undefined);
118
116
  ngAfterViewInit(): void;
119
117
  /** Whether the checkbox is checked. */
120
118
  get checked(): boolean;
121
- set checked(value: BooleanInput);
119
+ set checked(value: boolean);
122
120
  private _checked;
123
- /**
124
- * Whether the checkbox is disabled. This fully overrides the implementation provided by
125
- * mixinDisabled, but the mixin is still required because mixinTabIndex requires it.
126
- */
121
+ /** Whether the checkbox is disabled. */
127
122
  get disabled(): boolean;
128
- set disabled(value: BooleanInput);
123
+ set disabled(value: boolean);
129
124
  private _disabled;
130
125
  /**
131
126
  * Whether the checkbox is indeterminate. This is also known as "mixed" mode and can be used to
@@ -134,7 +129,7 @@ export declare class MatCheckbox extends _MatCheckboxMixinBase implements AfterV
134
129
  * set to false.
135
130
  */
136
131
  get indeterminate(): boolean;
137
- set indeterminate(value: BooleanInput);
132
+ set indeterminate(value: boolean);
138
133
  private _indeterminate;
139
134
  _isRippleDisabled(): boolean;
140
135
  /** Method being called whenever the label text changes. */
@@ -171,7 +166,13 @@ export declare class MatCheckbox extends _MatCheckboxMixinBase implements AfterV
171
166
  */
172
167
  _preventBubblingFromLabel(event: MouseEvent): void;
173
168
  static ɵfac: i0.ɵɵFactoryDeclaration<MatCheckbox, [null, null, null, { attribute: "tabindex"; }, { optional: true; }, { optional: true; }]>;
174
- static ɵcmp: i0.ɵɵComponentDeclaration<MatCheckbox, "mat-checkbox", ["matCheckbox"], { "disableRipple": { "alias": "disableRipple"; "required": false; }; "color": { "alias": "color"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; }; "id": { "alias": "id"; "required": false; }; "required": { "alias": "required"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "name": { "alias": "name"; "required": false; }; "value": { "alias": "value"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; }, { "change": "change"; "indeterminateChange": "indeterminateChange"; }, never, ["*"], false, never>;
169
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatCheckbox, "mat-checkbox", ["matCheckbox"], { "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; }; "id": { "alias": "id"; "required": false; }; "required": { "alias": "required"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "name": { "alias": "name"; "required": false; }; "value": { "alias": "value"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "color": { "alias": "color"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; }, { "change": "change"; "indeterminateChange": "indeterminateChange"; }, never, ["*"], false, never>;
170
+ static ngAcceptInputType_required: unknown;
171
+ static ngAcceptInputType_disableRipple: unknown;
172
+ static ngAcceptInputType_tabIndex: unknown;
173
+ static ngAcceptInputType_checked: unknown;
174
+ static ngAcceptInputType_disabled: unknown;
175
+ static ngAcceptInputType_indeterminate: unknown;
175
176
  }
176
177
 
177
178
  /** Change event object emitted by checkbox. */
@@ -199,13 +200,6 @@ export declare interface MatCheckboxDefaultOptions {
199
200
  clickAction?: MatCheckboxClickAction;
200
201
  }
201
202
 
202
- /** @docs-private */
203
- declare const _MatCheckboxMixinBase: _Constructor<HasTabIndex> & _AbstractConstructor<HasTabIndex> & _Constructor<CanColor> & _AbstractConstructor<CanColor> & _Constructor<CanDisableRipple> & _AbstractConstructor<CanDisableRipple> & _Constructor<CanDisable> & _AbstractConstructor<CanDisable> & {
204
- new (_elementRef: ElementRef): {
205
- _elementRef: ElementRef;
206
- };
207
- };
208
-
209
203
  export declare class MatCheckboxModule {
210
204
  static ɵfac: i0.ɵɵFactoryDeclaration<MatCheckboxModule, never>;
211
205
  static ɵmod: i0.ɵɵNgModuleDeclaration<MatCheckboxModule, [typeof i2.MatCheckbox], [typeof i3.MatCommonModule, typeof i3.MatRippleModule, typeof _MatCheckboxRequiredValidatorModule], [typeof i2.MatCheckbox, typeof i3.MatCommonModule, typeof _MatCheckboxRequiredValidatorModule]>;
@@ -1,99 +1,61 @@
1
1
  @use 'sass:color';
2
- @use 'sass:map';
3
- @use 'sass:meta';
4
2
  @use '@material/chips/chip-theme' as mdc-chip-theme;
5
3
  @use '../core/tokens/m2/mdc/chip' as tokens-mdc-chip;
6
- @use '../core/theming/palette';
7
4
  @use '../core/theming/theming';
5
+ @use '../core/theming/inspection';
8
6
  @use '../core/typography/typography';
9
- @use '../core/mdc-helpers/mdc-helpers';
10
-
11
- @function _get-default-palette($config) {
12
- $is-dark: map.get($config, is-dark);
13
- $grey-50: map.get(palette.$grey-palette, 50);
14
- $grey-900: map.get(palette.$grey-palette, 900);
15
- $default-foreground: if($is-dark, $grey-50, $grey-900);
16
-
17
- $surface: map.get(map.get($config, background), card);
18
- $on-surface: if(
19
- mdc-helpers.variable-safe-contrast-tone($surface, $is-dark) == 'dark',
20
- #000,
21
- #fff
22
- );
23
- $default-background: if(
24
- meta.type-of($on-surface) == color and meta.type-of($surface) == color,
25
- color.mix($on-surface, $surface, 12%),
26
- $on-surface
27
- );
28
-
29
- @return (default: $default-background, default-contrast: $default-foreground);
30
- }
31
-
32
- @mixin color($config-or-theme) {
33
- $config: theming.get-color-config($config-or-theme);
34
7
 
8
+ @mixin color($theme) {
35
9
  .mat-mdc-standard-chip {
36
- $default-palette: _get-default-palette($config);
37
- $default-config: map.merge($config, (primary: $default-palette));
38
- $default-color-tokens: tokens-mdc-chip.get-color-tokens($default-config);
10
+ $default-color-tokens: tokens-mdc-chip.get-color-tokens($theme);
39
11
  @include mdc-chip-theme.theme($default-color-tokens);
40
12
 
41
13
  &.mat-mdc-chip-selected,
42
14
  &.mat-mdc-chip-highlighted {
43
15
  &.mat-primary {
44
- $primary-color-tokens: tokens-mdc-chip.get-color-tokens($config);
16
+ $primary-color-tokens: tokens-mdc-chip.get-color-tokens($theme, primary);
45
17
  @include mdc-chip-theme.theme($primary-color-tokens);
46
18
  }
47
19
 
48
20
  &.mat-accent {
49
- $accent-config: map.merge($config, (primary: map.get($config, accent)));
50
- $accent-color-tokens: tokens-mdc-chip.get-color-tokens($accent-config);
21
+ $accent-color-tokens: tokens-mdc-chip.get-color-tokens($theme, accent);
51
22
  @include mdc-chip-theme.theme($accent-color-tokens);
52
23
  }
53
24
 
54
25
  &.mat-warn {
55
- $warn-config: map.merge($config, (primary: map.get($config, warn)));
56
- $warn-color-tokens: tokens-mdc-chip.get-color-tokens($warn-config);
26
+ $warn-color-tokens: tokens-mdc-chip.get-color-tokens($theme, warn);
57
27
  @include mdc-chip-theme.theme($warn-color-tokens);
58
28
  }
59
29
  }
60
30
  }
61
31
  }
62
32
 
63
- @mixin typography($config-or-theme) {
64
- $config: typography.private-typography-to-2018-config(
65
- theming.get-typography-config($config-or-theme)
66
- );
67
- $typography-tokens: tokens-mdc-chip.get-typography-tokens($config);
33
+ @mixin typography($theme) {
34
+ $typography-tokens: tokens-mdc-chip.get-typography-tokens($theme);
68
35
 
69
36
  .mat-mdc-standard-chip {
70
37
  @include mdc-chip-theme.theme($typography-tokens);
71
38
  }
72
39
  }
73
40
 
74
- @mixin density($config-or-theme) {
75
- $density-scale: theming.get-density-config($config-or-theme);
76
- $density-tokens: tokens-mdc-chip.get-density-tokens($density-scale);
41
+ @mixin density($theme) {
42
+ $density-tokens: tokens-mdc-chip.get-density-tokens($theme);
43
+
77
44
  .mat-mdc-chip.mat-mdc-standard-chip {
78
45
  @include mdc-chip-theme.theme($density-tokens);
79
46
  }
80
47
  }
81
48
 
82
- @mixin theme($theme-or-color-config) {
83
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
49
+ @mixin theme($theme) {
84
50
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-chips') {
85
- $color: theming.get-color-config($theme);
86
- $density: theming.get-density-config($theme);
87
- $typography: theming.get-typography-config($theme);
88
-
89
- @if $color != null {
90
- @include color($color);
51
+ @if inspection.theme-has($theme, color) {
52
+ @include color($theme);
91
53
  }
92
- @if $density != null {
93
- @include density($density);
54
+ @if inspection.theme-has($theme, density) {
55
+ @include density($theme);
94
56
  }
95
- @if $typography != null {
96
- @include typography($typography);
57
+ @if inspection.theme-has($theme, typography) {
58
+ @include typography($theme);
97
59
  }
98
60
  }
99
61
  }
@@ -1,25 +1,17 @@
1
1
  @use '../theming/all-theme';
2
- @use '../theming/theming';
2
+ @use '../theming/inspection';
3
3
 
4
4
  // Includes all of the color styles.
5
- @mixin all-component-colors($config-or-theme) {
6
- // In case a theme object has been passed instead of a configuration for
7
- // the color system, extract the color config from the theme object.
8
- $config: if(theming.private-is-theme-object($config-or-theme),
9
- theming.get-color-config($config-or-theme), $config-or-theme);
10
-
11
- @if $config == null {
5
+ @mixin all-component-colors($theme) {
6
+ @if not inspection.theme-has($theme, color) {
12
7
  @error 'No color configuration specified.';
13
8
  }
14
9
 
15
- @include all-theme.all-component-themes((
16
- color: $config,
17
- typography: null,
18
- density: null,
19
- ));
10
+ @include all-theme.all-component-themes(
11
+ inspection.theme-remove($theme, base, typography, density));
20
12
  }
21
13
 
22
14
  // @deprecated Use `all-component-colors`.
23
- @mixin angular-material-color($config-or-theme) {
24
- @include all-component-colors($config-or-theme);
15
+ @mixin angular-material-color($theme) {
16
+ @include all-component-colors($theme);
25
17
  }
@@ -1,4 +1,4 @@
1
- @use '../../theming/theming';
1
+ @use '../../theming/inspection';
2
2
  @use '../../../button/button-theme';
3
3
  @use '../../../button/icon-button-theme';
4
4
  @use '../../../button/fab-theme';
@@ -30,13 +30,8 @@
30
30
  @use '../../../table/table-theme';
31
31
 
32
32
  // Includes all of the density styles.
33
- @mixin all-component-densities($config-or-theme) {
34
- // In case a theme object has been passed instead of a configuration for
35
- // the density system, extract the density config from the theme object.
36
- $config: if(theming.private-is-theme-object($config-or-theme),
37
- theming.get-density-config($config-or-theme), $config-or-theme);
38
-
39
- @if $config == null {
33
+ @mixin all-component-densities($theme) {
34
+ @if not inspection.theme-has($theme, density) {
40
35
  @error 'No density configuration specified.';
41
36
  }
42
37
 
@@ -45,39 +40,39 @@
45
40
  // not possible as it would introduce a circular dependency for density because the `mat-core`
46
41
  // mixin that is transitively loaded by the `all-theme` file, imports `all-density` which
47
42
  // would then load `all-theme` again. This ultimately results a circular dependency.
48
- @include form-field-theme.density($config);
49
- @include card-theme.density($config);
50
- @include progress-bar-theme.density($config);
51
- @include progress-spinner-theme.density($config);
52
- @include tooltip-theme.density($config);
53
- @include input-theme.density($config);
54
- @include core-theme.density($config);
55
- @include select-theme.density($config);
56
- @include checkbox-theme.density($config);
57
- @include autocomplete-theme.density($config);
58
- @include dialog-theme.density($config);
59
- @include chips-theme.density($config);
60
- @include slide-toggle-theme.density($config);
61
- @include radio-theme.density($config);
62
- @include slider-theme.density($config);
63
- @include menu-theme.density($config);
64
- @include list-theme.density($config);
65
- @include paginator-theme.density($config);
66
- @include tabs-theme.density($config);
67
- @include snack-bar-theme.density($config);
68
- @include button-theme.density($config);
69
- @include icon-button-theme.density($config);
70
- @include fab-theme.density($config);
71
- @include table-theme.density($config);
72
- @include expansion-theme.density($config);
73
- @include stepper-theme.density($config);
74
- @include toolbar-theme.density($config);
75
- @include tree-theme.density($config);
76
- @include button-toggle-theme.density($config);
43
+ @include form-field-theme.density($theme);
44
+ @include card-theme.density($theme);
45
+ @include progress-bar-theme.density($theme);
46
+ @include progress-spinner-theme.density($theme);
47
+ @include tooltip-theme.density($theme);
48
+ @include input-theme.density($theme);
49
+ @include core-theme.density($theme);
50
+ @include select-theme.density($theme);
51
+ @include checkbox-theme.density($theme);
52
+ @include autocomplete-theme.density($theme);
53
+ @include dialog-theme.density($theme);
54
+ @include chips-theme.density($theme);
55
+ @include slide-toggle-theme.density($theme);
56
+ @include radio-theme.density($theme);
57
+ @include slider-theme.density($theme);
58
+ @include menu-theme.density($theme);
59
+ @include list-theme.density($theme);
60
+ @include paginator-theme.density($theme);
61
+ @include tabs-theme.density($theme);
62
+ @include snack-bar-theme.density($theme);
63
+ @include button-theme.density($theme);
64
+ @include icon-button-theme.density($theme);
65
+ @include fab-theme.density($theme);
66
+ @include table-theme.density($theme);
67
+ @include expansion-theme.density($theme);
68
+ @include stepper-theme.density($theme);
69
+ @include toolbar-theme.density($theme);
70
+ @include tree-theme.density($theme);
71
+ @include button-toggle-theme.density($theme);
77
72
  }
78
73
 
79
74
 
80
75
  // @deprecated Use `all-component-densities`.
81
- @mixin angular-material-density($config-or-theme) {
82
- @include all-component-densities($config-or-theme);
76
+ @mixin angular-material-density($theme) {
77
+ @include all-component-densities($theme);
83
78
  }
@@ -1,13 +1,11 @@
1
1
  @use './private';
2
2
 
3
- // stylelint-disable-next-line material/theme-mixin-api
4
- @mixin color($config-or-theme-or-color) {
5
- @include private.strong-focus-indicators-color($config-or-theme-or-color);
6
- @include private.mdc-strong-focus-indicators-color($config-or-theme-or-color);
3
+ @mixin color($theme) {
4
+ @include private.strong-focus-indicators-color($theme);
5
+ @include private.mdc-strong-focus-indicators-color($theme);
7
6
  }
8
7
 
9
- // stylelint-disable-next-line material/theme-mixin-api
10
- @mixin theme($theme-or-color-config-or-color) {
11
- @include private.strong-focus-indicators-theme($theme-or-color-config-or-color);
12
- @include private.mdc-strong-focus-indicators-theme($theme-or-color-config-or-color);
8
+ @mixin theme($theme) {
9
+ @include private.strong-focus-indicators-theme($theme);
10
+ @include private.mdc-strong-focus-indicators-theme($theme);
13
11
  }
@@ -3,6 +3,7 @@
3
3
  @use '@angular/cdk';
4
4
  @use '../style/layout-common';
5
5
  @use '../theming/theming';
6
+ @use '../theming/inspection';
6
7
 
7
8
  // Private sass variables that will be used as reference throughout component stylesheets.
8
9
  $default-border-width: 3px;
@@ -113,65 +114,60 @@ $default-border-radius: 4px;
113
114
  @include customize-focus-indicators($config, 'mat-mdc');
114
115
  }
115
116
 
116
- @mixin strong-focus-indicators-color($config-or-theme-or-color) {
117
- @if meta.type-of($config-or-theme-or-color) == 'color' {
117
+ @mixin strong-focus-indicators-color($theme-or-color) {
118
+ @if meta.type-of($theme-or-color) == 'color' {
118
119
  @include customize-focus-indicators((
119
- border-color: $config-or-theme-or-color
120
+ border-color: $theme-or-color
120
121
  ), 'mat');
121
122
  }
122
123
  @else {
123
- $config: theming.get-color-config($config-or-theme-or-color);
124
- $border-color: theming.get-color-from-palette(map.get($config, primary));
124
+ $border-color: inspection.get-theme-color($theme-or-color, primary);
125
125
  @include customize-focus-indicators((
126
126
  border-color: $border-color
127
127
  ), 'mat');
128
128
  }
129
129
  }
130
130
 
131
- @mixin strong-focus-indicators-theme($theme-or-color-config-or-color) {
132
- @if meta.type-of($theme-or-color-config-or-color) == 'color' {
131
+ @mixin strong-focus-indicators-theme($theme-or-color) {
132
+ @if meta.type-of($theme-or-color) == 'color' {
133
133
  @include customize-focus-indicators((
134
- border-color: $theme-or-color-config-or-color
134
+ border-color: $theme-or-color
135
135
  ), 'mat');
136
136
  }
137
137
  @else {
138
- $theme: theming.private-legacy-get-theme($theme-or-color-config-or-color);
139
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-focus-indicators') {
140
- $color: theming.get-color-config($theme);
141
- @if $color != null {
142
- @include strong-focus-indicators-color($color);
138
+ @include theming.private-check-duplicate-theme-styles($theme-or-color, 'mat-focus-indicators') {
139
+ @if inspection.theme-has($theme-or-color, color) {
140
+ @include strong-focus-indicators-color($theme-or-color);
143
141
  }
144
142
  }
145
143
  }
146
144
  }
147
145
 
148
- @mixin mdc-strong-focus-indicators-color($config-or-theme-or-color) {
149
- @if meta.type-of($config-or-theme-or-color) == 'color' {
146
+ @mixin mdc-strong-focus-indicators-color($theme-or-color) {
147
+ @if meta.type-of($theme-or-color) == 'color' {
150
148
  @include customize-focus-indicators((
151
- border-color: $config-or-theme-or-color
149
+ border-color: $theme-or-color
152
150
  ), 'mat-mdc');
153
151
  }
154
152
  @else {
155
- $config: theming.get-color-config($config-or-theme-or-color);
156
- $border-color: theming.get-color-from-palette(map.get($config, primary));
153
+ $border-color: inspection.get-theme-color($theme-or-color, primary);
157
154
  @include customize-focus-indicators((
158
155
  border-color: $border-color
159
156
  ), 'mat-mdc');
160
157
  }
161
158
  }
162
159
 
163
- @mixin mdc-strong-focus-indicators-theme($theme-or-color-config-or-color) {
164
- @if meta.type-of($theme-or-color-config-or-color) == 'color' {
160
+ @mixin mdc-strong-focus-indicators-theme($theme-or-color) {
161
+ @if meta.type-of($theme-or-color) == 'color' {
165
162
  @include customize-focus-indicators((
166
- border-color: $theme-or-color-config-or-color
163
+ border-color: $theme-or-color
167
164
  ), 'mat-mdc');
168
165
  }
169
166
  @else {
170
- $theme: theming.private-legacy-get-theme($theme-or-color-config-or-color);
171
- @include theming.private-check-duplicate-theme-styles($theme, 'mat-mdc-focus-indicators') {
172
- $color: theming.get-color-config($theme);
173
- @if $color != null {
174
- @include mdc-strong-focus-indicators-color($color);
167
+ @include theming.private-check-duplicate-theme-styles(
168
+ $theme-or-color, 'mat-mdc-focus-indicators') {
169
+ @if inspection.theme-has($theme-or-color, color) {
170
+ @include mdc-strong-focus-indicators-color($theme-or-color);
175
171
  }
176
172
  }
177
173
  }
package/core/index.d.ts CHANGED
@@ -1,9 +1,6 @@
1
- import { _AbstractConstructor as _AbstractConstructor_2 } from '@angular/material/core';
2
1
  import { AbstractControl } from '@angular/forms';
3
2
  import { AfterViewChecked } from '@angular/core';
4
- import { BooleanInput } from '@angular/cdk/coercion';
5
3
  import { ChangeDetectorRef } from '@angular/core';
6
- import { _Constructor as _Constructor_2 } from '@angular/material/core';
7
4
  import { ElementRef } from '@angular/core';
8
5
  import { EventEmitter } from '@angular/core';
9
6
  import { FocusableOption } from '@angular/cdk/a11y';
@@ -529,23 +526,21 @@ export declare class MatNativeDateModule {
529
526
  /**
530
527
  * Component that is used to group instances of `mat-option`.
531
528
  */
532
- export declare class MatOptgroup extends _MatOptgroupMixinBase implements CanDisable {
529
+ export declare class MatOptgroup {
533
530
  /** Label for the option group. */
534
531
  label: string;
532
+ /** whether the option group is disabled. */
533
+ disabled: boolean;
535
534
  /** Unique id for the underlying label. */
536
535
  _labelId: string;
537
536
  /** Whether the group is in inert a11y mode. */
538
537
  _inert: boolean;
539
538
  constructor(parent?: MatOptionParentComponent);
540
539
  static ɵfac: i0.ɵɵFactoryDeclaration<MatOptgroup, [{ optional: true; }]>;
541
- static ɵcmp: i0.ɵɵComponentDeclaration<MatOptgroup, "mat-optgroup", ["matOptgroup"], { "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; }, {}, never, ["*", "mat-option, ng-container"], false, never>;
540
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatOptgroup, "mat-optgroup", ["matOptgroup"], { "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, ["*", "mat-option, ng-container"], false, never>;
541
+ static ngAcceptInputType_disabled: unknown;
542
542
  }
543
543
 
544
- /** @docs-private */
545
- declare const _MatOptgroupMixinBase: _Constructor_2<CanDisable> & _AbstractConstructor_2<CanDisable> & {
546
- new (): {};
547
- };
548
-
549
544
  /**
550
545
  * Single option inside of a `<mat-select>` element.
551
546
  */
@@ -568,7 +563,7 @@ export declare class MatOption<T = any> implements FocusableOption, AfterViewChe
568
563
  id: string;
569
564
  /** Whether the option is disabled. */
570
565
  get disabled(): boolean;
571
- set disabled(value: BooleanInput);
566
+ set disabled(value: boolean);
572
567
  /** Whether ripples for the option are disabled. */
573
568
  get disableRipple(): boolean;
574
569
  /** Whether to display checkmark for single-selection. */
@@ -629,6 +624,7 @@ export declare class MatOption<T = any> implements FocusableOption, AfterViewChe
629
624
  private _emitSelectionChangeEvent;
630
625
  static ɵfac: i0.ɵɵFactoryDeclaration<MatOption<any>, [null, null, { optional: true; }, { optional: true; }]>;
631
626
  static ɵcmp: i0.ɵɵComponentDeclaration<MatOption<any>, "mat-option", ["matOption"], { "value": { "alias": "value"; "required": false; }; "id": { "alias": "id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "onSelectionChange": "onSelectionChange"; }, never, ["mat-icon", "*"], false, never>;
627
+ static ngAcceptInputType_disabled: unknown;
632
628
  }
633
629
 
634
630
  export declare class MatOptionModule {
@@ -1,5 +1,5 @@
1
- @use 'sass:map';
2
- @use '../theming/theming';
1
+ @use '../theming/inspection';
2
+ @use './sass-utils';
3
3
 
4
4
  // Renders a gradient for showing the dashed line when the input is disabled.
5
5
  // Unlike using a border, a gradient allows us to adjust the spacing of the dotted line
@@ -13,9 +13,9 @@
13
13
  // Figures out the color of the placeholder for a form control.
14
14
  // Used primarily to prevent the various form controls from
15
15
  // becoming out of sync since these colors aren't in a palette.
16
- @function private-control-placeholder-color($config) {
17
- $foreground: map.get($config, foreground);
18
- $is-dark-theme: map.get($config, is-dark);
19
- @return theming.get-color-from-palette($foreground, secondary-text,
20
- if($is-dark-theme, 0.5, 0.42));
16
+ @function private-control-placeholder-color($theme) {
17
+ $is-dark-theme: inspection.get-theme-type($theme) == dark;
18
+ @return sass-utils.safe-color-change(
19
+ inspection.get-theme-color($theme, foreground, secondary-text),
20
+ $alpha: if($is-dark-theme, 0.5, 0.42));
21
21
  }
@@ -1,4 +1,3 @@
1
- @use 'sass:map';
2
1
  @use './elevation';
3
2
  @use '../theming/inspection';
4
3
 
@@ -9,9 +8,8 @@
9
8
  @include elevation.elevation($zValue, $elevation-color-or-default);
10
9
  }
11
10
 
12
- @mixin private-theme-overridable-elevation($zValue, $config) {
13
- $foreground: map.get($config, foreground);
14
- $elevation-color: map.get($foreground, elevation);
11
+ @mixin private-theme-overridable-elevation($zValue, $theme) {
12
+ $elevation-color: inspection.get-theme-color($theme, foreground, elevation);
15
13
  $elevation-color-or-default: if($elevation-color == null, elevation.$color, $elevation-color);
16
14
 
17
15
  @include elevation.overridable-elevation($zValue, $elevation-color-or-default);
@@ -1,6 +1,7 @@
1
1
  import { BaseHarnessFilters } from '@angular/cdk/testing';
2
2
  import { ComponentHarness } from '@angular/cdk/testing';
3
3
  import { ComponentHarnessConstructor } from '@angular/cdk/testing';
4
+ import { ContentContainerComponentHarness } from '@angular/cdk/testing';
4
5
  import { HarnessPredicate } from '@angular/cdk/testing';
5
6
 
6
7
  /** Harness for interacting with an MDC-based `mat-optgroup` in tests. */
@@ -27,7 +28,7 @@ export declare class MatOptgroupHarness extends ComponentHarness {
27
28
  }
28
29
 
29
30
  /** Harness for interacting with an MDC-based `mat-option` in tests. */
30
- export declare class MatOptionHarness extends ComponentHarness {
31
+ export declare class MatOptionHarness extends ContentContainerComponentHarness {
31
32
  /** Selector used to locate option instances. */
32
33
  static hostSelector: string;
33
34
  /** Element containing the option's text. */