@angular/material 15.0.1 → 15.1.0-next.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.
Files changed (74) hide show
  1. package/autocomplete/index.d.ts +8 -1
  2. package/chips/index.d.ts +3 -1
  3. package/datepicker/index.d.ts +60 -5
  4. package/esm2020/autocomplete/autocomplete-trigger.mjs +7 -5
  5. package/esm2020/autocomplete/autocomplete.mjs +13 -1
  6. package/esm2020/chips/chip-option.mjs +5 -4
  7. package/esm2020/chips/chip-row.mjs +5 -4
  8. package/esm2020/chips/chip.mjs +7 -2
  9. package/esm2020/core/version.mjs +1 -1
  10. package/esm2020/datepicker/calendar-body.mjs +124 -11
  11. package/esm2020/datepicker/calendar.mjs +25 -3
  12. package/esm2020/datepicker/date-range-selection-strategy.mjs +28 -1
  13. package/esm2020/datepicker/datepicker-base.mjs +11 -4
  14. package/esm2020/datepicker/datepicker-input-base.mjs +6 -3
  15. package/esm2020/datepicker/month-view.mjs +59 -7
  16. package/esm2020/datepicker/multi-year-view.mjs +1 -1
  17. package/esm2020/datepicker/year-view.mjs +1 -1
  18. package/esm2020/legacy-list/selection-list.mjs +1 -1
  19. package/esm2020/legacy-tabs/testing/tab-harness-filters.mjs +1 -1
  20. package/esm2020/legacy-tabs/testing/tab-harness.mjs +4 -2
  21. package/esm2020/list/list-item-sections.mjs +10 -10
  22. package/esm2020/list/list-option-types.mjs +1 -1
  23. package/esm2020/list/list-option.mjs +36 -16
  24. package/esm2020/list/public-api.mjs +1 -1
  25. package/esm2020/list/testing/selection-list-harness.mjs +6 -1
  26. package/esm2020/tabs/testing/tab-harness-filters.mjs +1 -1
  27. package/esm2020/tabs/testing/tab-harness.mjs +4 -2
  28. package/fesm2015/autocomplete.mjs +20 -5
  29. package/fesm2015/autocomplete.mjs.map +1 -1
  30. package/fesm2015/chips.mjs +14 -7
  31. package/fesm2015/chips.mjs.map +1 -1
  32. package/fesm2015/core.mjs +1 -1
  33. package/fesm2015/core.mjs.map +1 -1
  34. package/fesm2015/datepicker.mjs +252 -24
  35. package/fesm2015/datepicker.mjs.map +1 -1
  36. package/fesm2015/legacy-list.mjs.map +1 -1
  37. package/fesm2015/legacy-tabs/testing.mjs +3 -1
  38. package/fesm2015/legacy-tabs/testing.mjs.map +1 -1
  39. package/fesm2015/list/testing.mjs +7 -0
  40. package/fesm2015/list/testing.mjs.map +1 -1
  41. package/fesm2015/list.mjs +44 -24
  42. package/fesm2015/list.mjs.map +1 -1
  43. package/fesm2015/tabs/testing.mjs +3 -1
  44. package/fesm2015/tabs/testing.mjs.map +1 -1
  45. package/fesm2020/autocomplete.mjs +18 -3
  46. package/fesm2020/autocomplete.mjs.map +1 -1
  47. package/fesm2020/chips.mjs +14 -7
  48. package/fesm2020/chips.mjs.map +1 -1
  49. package/fesm2020/core.mjs +1 -1
  50. package/fesm2020/core.mjs.map +1 -1
  51. package/fesm2020/datepicker.mjs +248 -24
  52. package/fesm2020/datepicker.mjs.map +1 -1
  53. package/fesm2020/legacy-list.mjs.map +1 -1
  54. package/fesm2020/legacy-tabs/testing.mjs +3 -1
  55. package/fesm2020/legacy-tabs/testing.mjs.map +1 -1
  56. package/fesm2020/list/testing.mjs +5 -0
  57. package/fesm2020/list/testing.mjs.map +1 -1
  58. package/fesm2020/list.mjs +44 -24
  59. package/fesm2020/list.mjs.map +1 -1
  60. package/fesm2020/tabs/testing.mjs +3 -1
  61. package/fesm2020/tabs/testing.mjs.map +1 -1
  62. package/legacy-list/index.d.ts +1 -1
  63. package/legacy-tabs/testing/index.d.ts +2 -0
  64. package/list/_list-option-theme.scss +6 -3
  65. package/list/index.d.ts +25 -13
  66. package/list/testing/index.d.ts +5 -2
  67. package/package.json +2 -2
  68. package/prebuilt-themes/deeppurple-amber.css +1 -1
  69. package/prebuilt-themes/indigo-pink.css +1 -1
  70. package/prebuilt-themes/pink-bluegrey.css +1 -1
  71. package/prebuilt-themes/purple-green.css +1 -1
  72. package/radio/_radio-private.scss +60 -0
  73. package/radio/_radio-theme.scss +7 -45
  74. package/tabs/testing/index.d.ts +5 -3
@@ -22,6 +22,8 @@ export declare interface LegacyTabGroupHarnessFilters extends BaseHarnessFilters
22
22
  export declare interface LegacyTabHarnessFilters extends BaseHarnessFilters {
23
23
  /** Only find instances whose label matches the given value. */
24
24
  label?: string | RegExp;
25
+ /** Only find instances whose selected state matches the given value. */
26
+ selected?: boolean;
25
27
  }
26
28
 
27
29
  /**
@@ -2,13 +2,16 @@
2
2
  @use '../core/mdc-helpers/mdc-helpers';
3
3
  @use '../checkbox/checkbox-private';
4
4
  @use './list-option-trailing-avatar-compat';
5
+ @use '../radio/radio-private';
5
6
 
6
- // Mixin that overrides the selected item and checkbox colors for list options. By
7
- // default, the MDC list uses the `primary` color for list items. The MDC checkbox
8
- // inside list options by default uses the `primary` color too.
7
+ // Mixin that overrides the selected item and toggle indicator colors for list
8
+ // options. By default, the MDC list uses the `primary` color for list items.
9
+ // The MDC radio/checkbox inside list options by default uses the `primary`
10
+ // color too.
9
11
  @mixin private-list-option-color-override($color-config, $color, $mdc-color) {
10
12
  & .mdc-list-item__start, & .mdc-list-item__end {
11
13
  @include checkbox-private.private-checkbox-styles-with-color($color-config, $color, $mdc-color);
14
+ @include radio-private.private-radio-color($color-config, $color);
12
15
  }
13
16
  }
14
17
 
package/list/index.d.ts CHANGED
@@ -83,7 +83,7 @@ declare namespace i7 {
83
83
  * @docs-private
84
84
  */
85
85
  declare interface ListOption {
86
- _getCheckboxPosition(): MatListOptionCheckboxPosition;
86
+ _getTogglePosition(): MatListOptionTogglePosition;
87
87
  }
88
88
 
89
89
  /**
@@ -256,9 +256,9 @@ declare abstract class MatListItemBase implements AfterViewInit, OnDestroy, Ripp
256
256
  /**
257
257
  * @docs-private
258
258
  *
259
- * MDC uses the very intuitively named classes `.mdc-list-item__start` and `.mat-list-item__end`
260
- * to position content such as icons or checkboxes that comes either before or after the text
261
- * content respectively. This directive detects the placement of the checkbox and applies the
259
+ * MDC uses the very intuitively named classes `.mdc-list-item__start` and `.mat-list-item__end` to
260
+ * position content such as icons or checkboxes/radios that comes either before or after the text
261
+ * content respectively. This directive detects the placement of the checkbox/radio and applies the
262
262
  * correct MDC class to position the icon/avatar on the opposite side.
263
263
  */
264
264
  export declare class _MatListItemGraphicBase {
@@ -334,9 +334,17 @@ export declare class MatListOption extends MatListItemBase implements ListOption
334
334
  * @docs-private
335
335
  */
336
336
  readonly selectedChange: EventEmitter<boolean>;
337
- /** Whether the label should appear before or after the checkbox. Defaults to 'after' */
338
- checkboxPosition: MatListOptionCheckboxPosition;
339
- /** Theme color of the list option. This sets the color of the checkbox. */
337
+ /** Whether the label should appear before or after the checkbox/radio. Defaults to 'after' */
338
+ togglePosition: MatListOptionTogglePosition;
339
+ /**
340
+ * Whether the label should appear before or after the checkbox/radio. Defaults to 'after'
341
+ *
342
+ * @deprecated Use `togglePosition` instead.
343
+ * @breaking-change 17.0.0
344
+ */
345
+ get checkboxPosition(): MatListOptionTogglePosition;
346
+ set checkboxPosition(value: MatListOptionTogglePosition);
347
+ /** Theme color of the list option. This sets the color of the checkbox/radio. */
340
348
  get color(): ThemePalette;
341
349
  set color(newValue: ThemePalette);
342
350
  private _color;
@@ -363,14 +371,16 @@ export declare class MatListOption extends MatListItemBase implements ListOption
363
371
  /** Gets the text label of the list option. Used for the typeahead functionality in the list. */
364
372
  getLabel(): string;
365
373
  /** Whether a checkbox is shown at the given position. */
366
- _hasCheckboxAt(position: MatListOptionCheckboxPosition): boolean;
374
+ _hasCheckboxAt(position: MatListOptionTogglePosition): boolean;
375
+ /** Where a radio indicator is shown at the given position. */
376
+ _hasRadioAt(position: MatListOptionTogglePosition): boolean;
367
377
  /** Whether icons or avatars are shown at the given position. */
368
378
  _hasIconsOrAvatarsAt(position: 'before' | 'after'): boolean;
369
379
  /** Gets whether the given type of element is projected at the specified position. */
370
380
  _hasProjected(type: 'icons' | 'avatars', position: 'before' | 'after'): boolean;
371
381
  _handleBlur(): void;
372
- /** Gets the current position of the checkbox. */
373
- _getCheckboxPosition(): MatListOptionCheckboxPosition;
382
+ /** Gets the current position of the checkbox/radio. */
383
+ _getTogglePosition(): MatListOptionTogglePosition;
374
384
  /**
375
385
  * Sets the selected state of the option.
376
386
  * @returns Whether the value has changed.
@@ -387,14 +397,16 @@ export declare class MatListOption extends MatListItemBase implements ListOption
387
397
  /** Sets the tabindex of the list option. */
388
398
  _setTabindex(value: number): void;
389
399
  static ɵfac: i0.ɵɵFactoryDeclaration<MatListOption, [null, null, null, null, null, { optional: true; }, { optional: true; }]>;
390
- static ɵcmp: i0.ɵɵComponentDeclaration<MatListOption, "mat-list-option", ["matListOption"], { "checkboxPosition": "checkboxPosition"; "color": "color"; "value": "value"; "selected": "selected"; }, { "selectedChange": "selectedChange"; }, ["_lines", "_titles"], ["[matListItemAvatar],[matListItemIcon]", "[matListItemTitle]", "[matListItemLine]", "*", "mat-divider"], false, never>;
400
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatListOption, "mat-list-option", ["matListOption"], { "togglePosition": "togglePosition"; "checkboxPosition": "checkboxPosition"; "color": "color"; "value": "value"; "selected": "selected"; }, { "selectedChange": "selectedChange"; }, ["_lines", "_titles"], ["[matListItemAvatar],[matListItemIcon]", "[matListItemTitle]", "[matListItemLine]", "*", "mat-divider"], false, never>;
391
401
  }
392
402
 
393
403
  /**
394
- * Type describing possible positions of a checkbox in a list option
404
+ * Type describing possible positions of a checkbox or radio in a list option
395
405
  * with respect to the list item's text.
396
406
  */
397
- export declare type MatListOptionCheckboxPosition = 'before' | 'after';
407
+ declare type MatListOptionTogglePosition = 'before' | 'after';
408
+ export { MatListOptionTogglePosition as MatListOptionCheckboxPosition }
409
+ export { MatListOptionTogglePosition }
398
410
 
399
411
  /**
400
412
  * Directive whose purpose is to add the mat- CSS styling to this selector.
@@ -5,7 +5,7 @@ import { ContentContainerComponentHarness } from '@angular/cdk/testing';
5
5
  import { DividerHarnessFilters } from '@angular/material/divider/testing';
6
6
  import { HarnessPredicate } from '@angular/cdk/testing';
7
7
  import { MatDividerHarness } from '@angular/material/divider/testing';
8
- import { MatListOptionCheckboxPosition } from '@angular/material/list';
8
+ import { MatListOptionTogglePosition } from '@angular/material/list';
9
9
 
10
10
  export declare interface ActionListHarnessFilters extends BaseHarnessFilters {
11
11
  }
@@ -255,8 +255,11 @@ export declare class MatListOptionHarness extends MatListItemHarnessBase {
255
255
  */
256
256
  static with<T extends MatListOptionHarness>(this: ComponentHarnessConstructor<T>, options?: ListOptionHarnessFilters): HarnessPredicate<T>;
257
257
  private _beforeCheckbox;
258
+ private _beforeRadio;
258
259
  /** Gets the position of the checkbox relative to the list option content. */
259
- getCheckboxPosition(): Promise<MatListOptionCheckboxPosition>;
260
+ getCheckboxPosition(): Promise<MatListOptionTogglePosition>;
261
+ /** Gets the position of the radio relative to the list option content. */
262
+ getRadioPosition(): Promise<MatListOptionTogglePosition>;
260
263
  /** Whether the list option is selected. */
261
264
  isSelected(): Promise<boolean>;
262
265
  /** Focuses the list option. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/material",
3
- "version": "15.0.1",
3
+ "version": "15.1.0-next.0",
4
4
  "description": "Angular Material",
5
5
  "repository": {
6
6
  "type": "git",
@@ -989,7 +989,7 @@
989
989
  },
990
990
  "peerDependencies": {
991
991
  "@angular/animations": "^15.0.0 || ^16.0.0",
992
- "@angular/cdk": "15.0.1",
992
+ "@angular/cdk": "15.1.0-next.0",
993
993
  "@angular/core": "^15.0.0 || ^16.0.0",
994
994
  "@angular/common": "^15.0.0 || ^16.0.0",
995
995
  "@angular/forms": "^15.0.0 || ^16.0.0",