@angular/material 15.2.1 → 15.2.2

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 (43) hide show
  1. package/chips/index.d.ts +2 -2
  2. package/core/index.d.ts +0 -7
  3. package/datepicker/index.d.ts +1 -0
  4. package/esm2020/chips/chip-set.mjs +7 -8
  5. package/esm2020/core/option/option.mjs +12 -12
  6. package/esm2020/core/version.mjs +1 -1
  7. package/esm2020/datepicker/calendar-body.mjs +12 -6
  8. package/esm2020/legacy-core/option/option.mjs +3 -3
  9. package/esm2020/legacy-snack-bar/snack-bar-container.mjs +3 -3
  10. package/esm2020/paginator/paginator.mjs +3 -3
  11. package/esm2020/snack-bar/snack-bar-container.mjs +52 -4
  12. package/fesm2015/chips.mjs +6 -7
  13. package/fesm2015/chips.mjs.map +1 -1
  14. package/fesm2015/core.mjs +12 -12
  15. package/fesm2015/core.mjs.map +1 -1
  16. package/fesm2015/datepicker.mjs +11 -6
  17. package/fesm2015/datepicker.mjs.map +1 -1
  18. package/fesm2015/legacy-core.mjs +2 -2
  19. package/fesm2015/legacy-core.mjs.map +1 -1
  20. package/fesm2015/legacy-snack-bar.mjs +2 -2
  21. package/fesm2015/legacy-snack-bar.mjs.map +1 -1
  22. package/fesm2015/paginator.mjs +2 -2
  23. package/fesm2015/paginator.mjs.map +1 -1
  24. package/fesm2015/snack-bar.mjs +51 -4
  25. package/fesm2015/snack-bar.mjs.map +1 -1
  26. package/fesm2020/chips.mjs +6 -7
  27. package/fesm2020/chips.mjs.map +1 -1
  28. package/fesm2020/core.mjs +12 -12
  29. package/fesm2020/core.mjs.map +1 -1
  30. package/fesm2020/datepicker.mjs +11 -6
  31. package/fesm2020/datepicker.mjs.map +1 -1
  32. package/fesm2020/legacy-core.mjs +2 -2
  33. package/fesm2020/legacy-core.mjs.map +1 -1
  34. package/fesm2020/legacy-snack-bar.mjs +2 -2
  35. package/fesm2020/legacy-snack-bar.mjs.map +1 -1
  36. package/fesm2020/paginator.mjs +2 -2
  37. package/fesm2020/paginator.mjs.map +1 -1
  38. package/fesm2020/snack-bar.mjs +51 -4
  39. package/fesm2020/snack-bar.mjs.map +1 -1
  40. package/package.json +2 -2
  41. package/schematics/ng-add/index.js +1 -1
  42. package/schematics/ng-add/index.mjs +1 -1
  43. package/snack-bar/index.d.ts +12 -0
package/fesm2020/core.mjs CHANGED
@@ -22,7 +22,7 @@ import { ENTER, SPACE, hasModifierKey } from '@angular/cdk/keycodes';
22
22
  * found in the LICENSE file at https://angular.io/license
23
23
  */
24
24
  /** Current version of Angular Material. */
25
- const VERSION = new Version('15.2.1');
25
+ const VERSION = new Version('15.2.2');
26
26
 
27
27
  /**
28
28
  * @license
@@ -1745,15 +1745,6 @@ class _MatOptionBase {
1745
1745
  this._emitSelectionChangeEvent(true);
1746
1746
  }
1747
1747
  }
1748
- /**
1749
- * Gets the `aria-selected` value for the option. We explicitly omit the `aria-selected`
1750
- * attribute from single-selection, unselected options. Including the `aria-selected="false"`
1751
- * attributes adds a significant amount of noise to screen-reader users without providing useful
1752
- * information.
1753
- */
1754
- _getAriaSelected() {
1755
- return this.selected || (this.multiple ? false : null);
1756
- }
1757
1748
  /** Returns the correct tabindex for the option depending on disabled state. */
1758
1749
  _getTabIndex() {
1759
1750
  return this.disabled ? '-1' : '0';
@@ -1811,7 +1802,7 @@ class MatOption extends _MatOptionBase {
1811
1802
  }
1812
1803
  }
1813
1804
  MatOption.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: MatOption, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: MAT_OPTION_PARENT_COMPONENT, optional: true }, { token: MAT_OPTGROUP, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1814
- MatOption.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.0-rc.0", type: MatOption, selector: "mat-option", host: { attributes: { "role": "option" }, listeners: { "click": "_selectViaInteraction()", "keydown": "_handleKeydown($event)" }, properties: { "attr.tabindex": "_getTabIndex()", "class.mdc-list-item--selected": "selected", "class.mat-mdc-option-multiple": "multiple", "class.mat-mdc-option-active": "active", "class.mdc-list-item--disabled": "disabled", "id": "id", "attr.aria-selected": "_getAriaSelected()", "attr.aria-disabled": "disabled.toString()" }, classAttribute: "mat-mdc-option mat-mdc-focus-indicator mdc-list-item" }, exportAs: ["matOption"], usesInheritance: true, ngImport: i0, template: "<mat-pseudo-checkbox *ngIf=\"multiple\" class=\"mat-mdc-option-pseudo-checkbox\"\n [state]=\"selected ? 'checked' : 'unchecked'\" [disabled]=\"disabled\"></mat-pseudo-checkbox>\n\n<ng-content select=\"mat-icon\"></ng-content>\n\n<span class=\"mdc-list-item__primary-text\" #text><ng-content></ng-content></span>\n\n<!-- Render checkmark at the end for single-selection. -->\n<mat-pseudo-checkbox *ngIf=\"!multiple && selected && !hideSingleSelectionIndicator\"\n class=\"mat-mdc-option-pseudo-checkbox\" state=\"checked\" [disabled]=\"disabled\"\n appearance=\"minimal\"></mat-pseudo-checkbox>\n\n<!-- See a11y notes inside optgroup.ts for context behind this element. -->\n<span class=\"cdk-visually-hidden\" *ngIf=\"group && group._inert\">({{ group.label }})</span>\n\n<div class=\"mat-mdc-option-ripple\" mat-ripple\n [matRippleTrigger]=\"_getHostElement()\"\n [matRippleDisabled]=\"disabled || disableRipple\">\n</div>\n", styles: [".mat-mdc-option{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:16px;padding-right:16px;-webkit-user-select:none;user-select:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);min-height:48px}.mat-mdc-option:focus{outline:none}[dir=rtl] .mat-mdc-option,.mat-mdc-option[dir=rtl]{padding-left:16px;padding-right:16px}.mat-mdc-option.mdc-list-item{align-items:center}.mat-mdc-option.mdc-list-item--disabled{opacity:.38;cursor:default}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}.cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{content:\"\";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{right:auto;left:16px}.mat-mdc-option-active::before{content:\"\"}"], dependencies: [{ kind: "directive", type: MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatPseudoCheckbox, selector: "mat-pseudo-checkbox", inputs: ["state", "disabled", "appearance"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1805
+ MatOption.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.0-rc.0", type: MatOption, selector: "mat-option", host: { attributes: { "role": "option" }, listeners: { "click": "_selectViaInteraction()", "keydown": "_handleKeydown($event)" }, properties: { "attr.tabindex": "_getTabIndex()", "class.mdc-list-item--selected": "selected", "class.mat-mdc-option-multiple": "multiple", "class.mat-mdc-option-active": "active", "class.mdc-list-item--disabled": "disabled", "id": "id", "attr.aria-selected": "selected", "attr.aria-disabled": "disabled.toString()" }, classAttribute: "mat-mdc-option mat-mdc-focus-indicator mdc-list-item" }, exportAs: ["matOption"], usesInheritance: true, ngImport: i0, template: "<mat-pseudo-checkbox *ngIf=\"multiple\" class=\"mat-mdc-option-pseudo-checkbox\"\n [state]=\"selected ? 'checked' : 'unchecked'\" [disabled]=\"disabled\"></mat-pseudo-checkbox>\n\n<ng-content select=\"mat-icon\"></ng-content>\n\n<span class=\"mdc-list-item__primary-text\" #text><ng-content></ng-content></span>\n\n<!-- Render checkmark at the end for single-selection. -->\n<mat-pseudo-checkbox *ngIf=\"!multiple && selected && !hideSingleSelectionIndicator\"\n class=\"mat-mdc-option-pseudo-checkbox\" state=\"checked\" [disabled]=\"disabled\"\n appearance=\"minimal\"></mat-pseudo-checkbox>\n\n<!-- See a11y notes inside optgroup.ts for context behind this element. -->\n<span class=\"cdk-visually-hidden\" *ngIf=\"group && group._inert\">({{ group.label }})</span>\n\n<div class=\"mat-mdc-option-ripple\" mat-ripple\n [matRippleTrigger]=\"_getHostElement()\"\n [matRippleDisabled]=\"disabled || disableRipple\">\n</div>\n", styles: [".mat-mdc-option{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:16px;padding-right:16px;-webkit-user-select:none;user-select:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);min-height:48px}.mat-mdc-option:focus{outline:none}[dir=rtl] .mat-mdc-option,.mat-mdc-option[dir=rtl]{padding-left:16px;padding-right:16px}.mat-mdc-option.mdc-list-item{align-items:center}.mat-mdc-option.mdc-list-item--disabled{opacity:.38;cursor:default}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}.cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{content:\"\";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{right:auto;left:16px}.mat-mdc-option-active::before{content:\"\"}"], dependencies: [{ kind: "directive", type: MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatPseudoCheckbox, selector: "mat-pseudo-checkbox", inputs: ["state", "disabled", "appearance"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1815
1806
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: MatOption, decorators: [{
1816
1807
  type: Component,
1817
1808
  args: [{ selector: 'mat-option', exportAs: 'matOption', host: {
@@ -1822,7 +1813,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ng
1822
1813
  '[class.mat-mdc-option-active]': 'active',
1823
1814
  '[class.mdc-list-item--disabled]': 'disabled',
1824
1815
  '[id]': 'id',
1825
- '[attr.aria-selected]': '_getAriaSelected()',
1816
+ // Set aria-selected to false for non-selected items and true for selected items. Conform to
1817
+ // [WAI ARIA Listbox authoring practices guide](
1818
+ // https://www.w3.org/WAI/ARIA/apg/patterns/listbox/), "If any options are selected, each
1819
+ // selected option has either aria-selected or aria-checked set to true. All options that are
1820
+ // selectable but not selected have either aria-selected or aria-checked set to false." Align
1821
+ // aria-selected implementation of Chips and List components.
1822
+ //
1823
+ // Set `aria-selected="false"` on not-selected listbox options to fix VoiceOver announcing
1824
+ // every option as "selected" (#21491).
1825
+ '[attr.aria-selected]': 'selected',
1826
1826
  '[attr.aria-disabled]': 'disabled.toString()',
1827
1827
  '(click)': '_selectViaInteraction()',
1828
1828
  '(keydown)': '_handleKeydown($event)',