@angular/material 18.2.0-next.3 → 18.2.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,6 +95,10 @@ export declare class MatButtonToggle implements OnInit, AfterViewInit, OnDestroy
95
95
  get disabled(): boolean;
96
96
  set disabled(value: boolean);
97
97
  private _disabled;
98
+ /** Whether the button should remain interactive when it is disabled. */
99
+ get disabledInteractive(): boolean;
100
+ set disabledInteractive(value: boolean);
101
+ private _disabledInteractive;
98
102
  /** Event emitted when the group value changes. */
99
103
  readonly change: EventEmitter<MatButtonToggleChange>;
100
104
  constructor(toggleGroup: MatButtonToggleGroup, _changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, _focusMonitor: FocusMonitor, defaultTabIndex: string, defaultOptions?: MatButtonToggleDefaultOptions);
@@ -116,10 +120,11 @@ export declare class MatButtonToggle implements OnInit, AfterViewInit, OnDestroy
116
120
  /** Whether the toggle is in single selection mode. */
117
121
  isSingleSelector(): boolean;
118
122
  static ɵfac: i0.ɵɵFactoryDeclaration<MatButtonToggle, [{ optional: true; }, null, null, null, { attribute: "tabindex"; }, { optional: true; }]>;
119
- static ɵcmp: i0.ɵɵComponentDeclaration<MatButtonToggle, "mat-button-toggle", ["matButtonToggle"], { "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "value": { "alias": "value"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "change": "change"; }, never, ["*"], true, never>;
123
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatButtonToggle, "mat-button-toggle", ["matButtonToggle"], { "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "value": { "alias": "value"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disabledInteractive": { "alias": "disabledInteractive"; "required": false; }; }, { "change": "change"; }, never, ["*"], true, never>;
120
124
  static ngAcceptInputType_disableRipple: unknown;
121
125
  static ngAcceptInputType_checked: unknown;
122
126
  static ngAcceptInputType_disabled: unknown;
127
+ static ngAcceptInputType_disabledInteractive: unknown;
123
128
  }
124
129
 
125
130
  /** Possible appearance styles for the button toggle. */
@@ -152,6 +157,8 @@ export declare interface MatButtonToggleDefaultOptions {
152
157
  hideSingleSelectionIndicator?: boolean;
153
158
  /** Whether icon indicators should be hidden for multiple-selection button toggle groups. */
154
159
  hideMultipleSelectionIndicator?: boolean;
160
+ /** Whether disabled toggle buttons should be interactive. */
161
+ disabledInteractive?: boolean;
155
162
  }
156
163
 
157
164
  /** Exclusive selection button toggle group that behaves like a radio-button group. */
@@ -160,6 +167,7 @@ export declare class MatButtonToggleGroup implements ControlValueAccessor, OnIni
160
167
  private _dir?;
161
168
  private _multiple;
162
169
  private _disabled;
170
+ private _disabledInteractive;
163
171
  private _selectionModel;
164
172
  /**
165
173
  * Reference to the raw value that the consumer tried to assign. The real
@@ -202,6 +210,9 @@ export declare class MatButtonToggleGroup implements ControlValueAccessor, OnIni
202
210
  /** Whether multiple button toggle group is disabled. */
203
211
  get disabled(): boolean;
204
212
  set disabled(value: boolean);
213
+ /** Whether buttons in the group should be interactive while they're disabled. */
214
+ get disabledInteractive(): boolean;
215
+ set disabledInteractive(value: boolean);
205
216
  /** The layout direction of the toggle button group. */
206
217
  get dir(): Direction;
207
218
  /** Event emitted when the group's value changes. */
@@ -256,10 +267,11 @@ export declare class MatButtonToggleGroup implements ControlValueAccessor, OnIni
256
267
  /** Marks all of the child button toggles to be checked. */
257
268
  private _markButtonsForCheck;
258
269
  static ɵfac: i0.ɵɵFactoryDeclaration<MatButtonToggleGroup, [null, { optional: true; }, { optional: true; }]>;
259
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatButtonToggleGroup, "mat-button-toggle-group", ["matButtonToggleGroup"], { "appearance": { "alias": "appearance"; "required": false; }; "name": { "alias": "name"; "required": false; }; "vertical": { "alias": "vertical"; "required": false; }; "value": { "alias": "value"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hideSingleSelectionIndicator": { "alias": "hideSingleSelectionIndicator"; "required": false; }; "hideMultipleSelectionIndicator": { "alias": "hideMultipleSelectionIndicator"; "required": false; }; }, { "valueChange": "valueChange"; "change": "change"; }, ["_buttonToggles"], never, true, never>;
270
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatButtonToggleGroup, "mat-button-toggle-group", ["matButtonToggleGroup"], { "appearance": { "alias": "appearance"; "required": false; }; "name": { "alias": "name"; "required": false; }; "vertical": { "alias": "vertical"; "required": false; }; "value": { "alias": "value"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disabledInteractive": { "alias": "disabledInteractive"; "required": false; }; "hideSingleSelectionIndicator": { "alias": "hideSingleSelectionIndicator"; "required": false; }; "hideMultipleSelectionIndicator": { "alias": "hideMultipleSelectionIndicator"; "required": false; }; }, { "valueChange": "valueChange"; "change": "change"; }, ["_buttonToggles"], never, true, never>;
260
271
  static ngAcceptInputType_vertical: unknown;
261
272
  static ngAcceptInputType_multiple: unknown;
262
273
  static ngAcceptInputType_disabled: unknown;
274
+ static ngAcceptInputType_disabledInteractive: unknown;
263
275
  static ngAcceptInputType_hideSingleSelectionIndicator: unknown;
264
276
  static ngAcceptInputType_hideMultipleSelectionIndicator: unknown;
265
277
  }
@@ -2,6 +2,7 @@
2
2
  @use '@angular/cdk';
3
3
  @use '../core/tokens/m2/mdc/checkbox' as tokens-mdc-checkbox;
4
4
  @use '../core/tokens/token-utils';
5
+ @use '../core/style/vendor-prefixes';
5
6
 
6
7
  $_path-length: 29.7833385;
7
8
  $_transition-duration: 90ms;
@@ -64,6 +65,10 @@ $_fallback-size: 40px;
64
65
  .mdc-checkbox--disabled {
65
66
  cursor: default;
66
67
  pointer-events: none;
68
+
69
+ @include cdk.high-contrast(active, off) {
70
+ opacity: 0.5;
71
+ }
67
72
  }
68
73
 
69
74
  .mdc-checkbox__background {
@@ -82,6 +87,9 @@ $_fallback-size: 40px;
82
87
  transition: background-color $_transition-duration $_exit-curve,
83
88
  border-color $_transition-duration $_exit-curve;
84
89
 
90
+ // Force browser to show background-color when using the print function
91
+ @include vendor-prefixes.color-adjust(exact);
92
+
85
93
  @include token-utils.use-tokens($prefix, $slots) {
86
94
  $layer-size: token-utils.get-token-variable(state-layer-size, $fallback: $_fallback-size);
87
95
  $offset: calc((#{$layer-size} - #{$_icon-size}) / 2);
@@ -167,6 +175,10 @@ $_fallback-size: 40px;
167
175
  // Always apply the color since the element becomes `opacity: 0`
168
176
  // when unchecked. This makes the animation look better.
169
177
  @include token-utils.create-token-slot(color, selected-checkmark-color);
178
+
179
+ @include cdk.high-contrast(active, off) {
180
+ color: CanvasText;
181
+ }
170
182
  }
171
183
  }
172
184
 
@@ -175,6 +187,10 @@ $_fallback-size: 40px;
175
187
  &, &.mat-mdc-checkbox-disabled-interactive {
176
188
  .mdc-checkbox__checkmark {
177
189
  @include token-utils.create-token-slot(color, disabled-selected-checkmark-color);
190
+
191
+ @include cdk.high-contrast(active, off) {
192
+ color: CanvasText;
193
+ }
178
194
  }
179
195
  }
180
196
  }
@@ -18,6 +18,7 @@ $prefix: (mdc, chip);
18
18
  (
19
19
  container-shape-radius: token-definition.hardcode(8px, $exclude-hardcoded),
20
20
  with-avatar-avatar-size: token-definition.hardcode(24px, $exclude-hardcoded),
21
+ with-avatar-avatar-shape-radius: token-definition.hardcode(24px, $exclude-hardcoded),
21
22
  label-text-color: map.get($systems, md-sys-color, on-surface-variant),
22
23
  disabled-label-text-color: sass-utils.safe-color-change(
23
24
  map.get($systems, md-sys-color, on-surface),
@@ -43,6 +44,9 @@ $prefix: (mdc, chip);
43
44
  with-avatar-disabled-avatar-opacity:
44
45
  token-definition.hardcode(0.38, $exclude-hardcoded),
45
46
  elevated-selected-container-color: map.get($systems, md-sys-color, secondary-container),
47
+ // In the M3 tokens this is a `surface` color, but in the MDC implementation it's
48
+ // never being emitted. We emit `transparent` so consumers override the color.
49
+ elevated-container-color: token-definition.hardcode(transparent, $exclude-hardcoded),
46
50
  flat-selected-outline-width: token-definition.hardcode(0, $exclude-hardcoded),
47
51
  selected-label-text-color: map.get($systems, md-sys-color, on-secondary-container),
48
52
  flat-disabled-selected-container-color: sass-utils.safe-color-change(