@angular/material 21.0.0-next.9 → 21.0.0-rc.1

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 (202) hide show
  1. package/core/tokens/_classes.scss +1 -1
  2. package/core/tokens/m2/_md-sys-color.scss +17 -17
  3. package/fesm2022/_animation-chunk.mjs +10 -16
  4. package/fesm2022/_animation-chunk.mjs.map +1 -1
  5. package/fesm2022/_date-formats-chunk.mjs +68 -164
  6. package/fesm2022/_date-formats-chunk.mjs.map +1 -1
  7. package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
  8. package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
  9. package/fesm2022/_error-options-chunk.mjs +56 -19
  10. package/fesm2022/_error-options-chunk.mjs.map +1 -1
  11. package/fesm2022/_error-state-chunk.mjs +24 -31
  12. package/fesm2022/_error-state-chunk.mjs.map +1 -1
  13. package/fesm2022/_form-field-chunk.mjs +1224 -1017
  14. package/fesm2022/_form-field-chunk.mjs.map +1 -1
  15. package/fesm2022/_icon-button-chunk.mjs +243 -187
  16. package/fesm2022/_icon-button-chunk.mjs.map +1 -1
  17. package/fesm2022/_icon-registry-chunk.mjs +350 -575
  18. package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
  19. package/fesm2022/_input-harness-chunk.mjs +56 -107
  20. package/fesm2022/_input-harness-chunk.mjs.map +1 -1
  21. package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
  22. package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
  23. package/fesm2022/_internal-form-field-chunk.mjs +59 -19
  24. package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
  25. package/fesm2022/_line-chunk.mjs +83 -43
  26. package/fesm2022/_line-chunk.mjs.map +1 -1
  27. package/fesm2022/_option-chunk.mjs +348 -311
  28. package/fesm2022/_option-chunk.mjs.map +1 -1
  29. package/fesm2022/_option-harness-chunk.mjs +23 -39
  30. package/fesm2022/_option-harness-chunk.mjs.map +1 -1
  31. package/fesm2022/_option-module-chunk.mjs +36 -10
  32. package/fesm2022/_option-module-chunk.mjs.map +1 -1
  33. package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
  34. package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
  35. package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
  36. package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
  37. package/fesm2022/_public-api-chunk.mjs +71 -134
  38. package/fesm2022/_public-api-chunk.mjs.map +1 -1
  39. package/fesm2022/_ripple-chunk.mjs +504 -600
  40. package/fesm2022/_ripple-chunk.mjs.map +1 -1
  41. package/fesm2022/_ripple-loader-chunk.mjs +120 -138
  42. package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
  43. package/fesm2022/_ripple-module-chunk.mjs +36 -10
  44. package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
  45. package/fesm2022/_structural-styles-chunk.mjs +37 -10
  46. package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
  47. package/fesm2022/_tooltip-chunk.mjs +811 -888
  48. package/fesm2022/_tooltip-chunk.mjs.map +1 -1
  49. package/fesm2022/autocomplete-testing.mjs +62 -86
  50. package/fesm2022/autocomplete-testing.mjs.map +1 -1
  51. package/fesm2022/autocomplete.mjs +965 -1126
  52. package/fesm2022/autocomplete.mjs.map +1 -1
  53. package/fesm2022/badge-testing.mjs +38 -54
  54. package/fesm2022/badge-testing.mjs.map +1 -1
  55. package/fesm2022/badge.mjs +321 -272
  56. package/fesm2022/badge.mjs.map +1 -1
  57. package/fesm2022/bottom-sheet-testing.mjs +10 -24
  58. package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
  59. package/fesm2022/bottom-sheet.mjs +349 -344
  60. package/fesm2022/bottom-sheet.mjs.map +1 -1
  61. package/fesm2022/button-testing.mjs +60 -94
  62. package/fesm2022/button-testing.mjs.map +1 -1
  63. package/fesm2022/button-toggle-testing.mjs +76 -125
  64. package/fesm2022/button-toggle-testing.mjs.map +1 -1
  65. package/fesm2022/button-toggle.mjs +752 -662
  66. package/fesm2022/button-toggle.mjs.map +1 -1
  67. package/fesm2022/button.mjs +263 -158
  68. package/fesm2022/button.mjs.map +1 -1
  69. package/fesm2022/card-testing.mjs +19 -33
  70. package/fesm2022/card-testing.mjs.map +1 -1
  71. package/fesm2022/card.mjs +576 -272
  72. package/fesm2022/card.mjs.map +1 -1
  73. package/fesm2022/checkbox-testing.mjs +71 -123
  74. package/fesm2022/checkbox-testing.mjs.map +1 -1
  75. package/fesm2022/checkbox.mjs +515 -477
  76. package/fesm2022/checkbox.mjs.map +1 -1
  77. package/fesm2022/chips-testing.mjs +201 -344
  78. package/fesm2022/chips-testing.mjs.map +1 -1
  79. package/fesm2022/chips.mjs +2552 -2289
  80. package/fesm2022/chips.mjs.map +1 -1
  81. package/fesm2022/core-testing.mjs +14 -28
  82. package/fesm2022/core-testing.mjs.map +1 -1
  83. package/fesm2022/core.mjs +357 -328
  84. package/fesm2022/core.mjs.map +1 -1
  85. package/fesm2022/datepicker-testing.mjs +15 -25
  86. package/fesm2022/datepicker-testing.mjs.map +1 -1
  87. package/fesm2022/datepicker.mjs +4826 -4563
  88. package/fesm2022/datepicker.mjs.map +1 -1
  89. package/fesm2022/dialog-testing.mjs +93 -129
  90. package/fesm2022/dialog-testing.mjs.map +1 -1
  91. package/fesm2022/dialog.mjs +810 -829
  92. package/fesm2022/dialog.mjs.map +1 -1
  93. package/fesm2022/divider-testing.mjs +10 -11
  94. package/fesm2022/divider-testing.mjs.map +1 -1
  95. package/fesm2022/divider.mjs +119 -43
  96. package/fesm2022/divider.mjs.map +1 -1
  97. package/fesm2022/expansion-testing.mjs +74 -130
  98. package/fesm2022/expansion-testing.mjs.map +1 -1
  99. package/fesm2022/expansion.mjs +703 -515
  100. package/fesm2022/expansion.mjs.map +1 -1
  101. package/fesm2022/form-field-testing-control.mjs +16 -33
  102. package/fesm2022/form-field-testing-control.mjs.map +1 -1
  103. package/fesm2022/form-field-testing.mjs +118 -179
  104. package/fesm2022/form-field-testing.mjs.map +1 -1
  105. package/fesm2022/form-field.mjs +36 -10
  106. package/fesm2022/form-field.mjs.map +1 -1
  107. package/fesm2022/grid-list-testing.mjs +65 -113
  108. package/fesm2022/grid-list-testing.mjs.map +1 -1
  109. package/fesm2022/grid-list.mjs +559 -494
  110. package/fesm2022/grid-list.mjs.map +1 -1
  111. package/fesm2022/icon-testing.mjs +148 -127
  112. package/fesm2022/icon-testing.mjs.map +1 -1
  113. package/fesm2022/icon.mjs +325 -351
  114. package/fesm2022/icon.mjs.map +1 -1
  115. package/fesm2022/input-testing.mjs +59 -99
  116. package/fesm2022/input-testing.mjs.map +1 -1
  117. package/fesm2022/input.mjs +457 -520
  118. package/fesm2022/input.mjs.map +1 -1
  119. package/fesm2022/list-testing.mjs +251 -434
  120. package/fesm2022/list-testing.mjs.map +1 -1
  121. package/fesm2022/list.mjs +1522 -1204
  122. package/fesm2022/list.mjs.map +1 -1
  123. package/fesm2022/material.mjs +0 -5
  124. package/fesm2022/material.mjs.map +1 -1
  125. package/fesm2022/menu-testing.mjs +159 -228
  126. package/fesm2022/menu-testing.mjs.map +1 -1
  127. package/fesm2022/menu.mjs +1338 -1343
  128. package/fesm2022/menu.mjs.map +1 -1
  129. package/fesm2022/paginator-testing.mjs +55 -79
  130. package/fesm2022/paginator-testing.mjs.map +1 -1
  131. package/fesm2022/paginator.mjs +381 -309
  132. package/fesm2022/paginator.mjs.map +1 -1
  133. package/fesm2022/progress-bar-testing.mjs +12 -21
  134. package/fesm2022/progress-bar-testing.mjs.map +1 -1
  135. package/fesm2022/progress-bar.mjs +224 -169
  136. package/fesm2022/progress-bar.mjs.map +1 -1
  137. package/fesm2022/progress-spinner-testing.mjs +13 -23
  138. package/fesm2022/progress-spinner-testing.mjs.map +1 -1
  139. package/fesm2022/progress-spinner.mjs +235 -160
  140. package/fesm2022/progress-spinner.mjs.map +1 -1
  141. package/fesm2022/radio-testing.mjs +133 -208
  142. package/fesm2022/radio-testing.mjs.map +1 -1
  143. package/fesm2022/radio.mjs +712 -679
  144. package/fesm2022/radio.mjs.map +1 -1
  145. package/fesm2022/select-testing.mjs +83 -117
  146. package/fesm2022/select-testing.mjs.map +1 -1
  147. package/fesm2022/select.mjs +1116 -1246
  148. package/fesm2022/select.mjs.map +1 -1
  149. package/fesm2022/sidenav-testing.mjs +54 -120
  150. package/fesm2022/sidenav-testing.mjs.map +1 -1
  151. package/fesm2022/sidenav.mjs +1078 -995
  152. package/fesm2022/sidenav.mjs.map +1 -1
  153. package/fesm2022/slide-toggle-testing.mjs +57 -92
  154. package/fesm2022/slide-toggle-testing.mjs.map +1 -1
  155. package/fesm2022/slide-toggle.mjs +369 -279
  156. package/fesm2022/slide-toggle.mjs.map +1 -1
  157. package/fesm2022/slider-testing.mjs +90 -138
  158. package/fesm2022/slider-testing.mjs.map +1 -1
  159. package/fesm2022/slider.mjs +1651 -1716
  160. package/fesm2022/slider.mjs.map +1 -1
  161. package/fesm2022/snack-bar-testing.mjs +40 -87
  162. package/fesm2022/snack-bar-testing.mjs.map +1 -1
  163. package/fesm2022/snack-bar.mjs +763 -714
  164. package/fesm2022/snack-bar.mjs.map +1 -1
  165. package/fesm2022/sort-testing.mjs +45 -66
  166. package/fesm2022/sort-testing.mjs.map +1 -1
  167. package/fesm2022/sort.mjs +419 -344
  168. package/fesm2022/sort.mjs.map +1 -1
  169. package/fesm2022/stepper-testing.mjs +78 -154
  170. package/fesm2022/stepper-testing.mjs.map +1 -1
  171. package/fesm2022/stepper.mjs +790 -498
  172. package/fesm2022/stepper.mjs.map +1 -1
  173. package/fesm2022/table-testing.mjs +120 -213
  174. package/fesm2022/table-testing.mjs.map +1 -1
  175. package/fesm2022/table.mjs +1026 -684
  176. package/fesm2022/table.mjs.map +1 -1
  177. package/fesm2022/tabs-testing.mjs +125 -197
  178. package/fesm2022/tabs-testing.mjs.map +1 -1
  179. package/fesm2022/tabs.mjs +2351 -2028
  180. package/fesm2022/tabs.mjs.map +1 -1
  181. package/fesm2022/timepicker-testing.mjs +113 -172
  182. package/fesm2022/timepicker-testing.mjs.map +1 -1
  183. package/fesm2022/timepicker.mjs +1019 -826
  184. package/fesm2022/timepicker.mjs.map +1 -1
  185. package/fesm2022/toolbar-testing.mjs +16 -27
  186. package/fesm2022/toolbar-testing.mjs.map +1 -1
  187. package/fesm2022/toolbar.mjs +163 -78
  188. package/fesm2022/toolbar.mjs.map +1 -1
  189. package/fesm2022/tooltip-testing.mjs +41 -52
  190. package/fesm2022/tooltip-testing.mjs.map +1 -1
  191. package/fesm2022/tooltip.mjs +36 -10
  192. package/fesm2022/tooltip.mjs.map +1 -1
  193. package/fesm2022/tree-testing.mjs +86 -162
  194. package/fesm2022/tree-testing.mjs.map +1 -1
  195. package/fesm2022/tree.mjs +638 -466
  196. package/fesm2022/tree.mjs.map +1 -1
  197. package/package.json +2 -2
  198. package/schematics/ng-add/index.js +1 -1
  199. package/types/expansion.d.ts +4 -2
  200. package/types/menu-testing.d.ts +2 -0
  201. package/types/select.d.ts +1 -1
  202. package/types/timepicker.d.ts +1 -0
@@ -8,340 +8,377 @@ import { MatPseudoCheckbox } from './_pseudo-checkbox-chunk.mjs';
8
8
  import { _StructuralStylesLoader } from './_structural-styles-chunk.mjs';
9
9
  import { _CdkPrivateStyleLoader, _VisuallyHiddenLoader } from '@angular/cdk/private';
10
10
 
11
- /**
12
- * Injection token used to provide the parent component to options.
13
- */
14
11
  const MAT_OPTION_PARENT_COMPONENT = new InjectionToken('MAT_OPTION_PARENT_COMPONENT');
15
12
 
16
- // Notes on the accessibility pattern used for `mat-optgroup`.
17
- // The option group has two different "modes": regular and inert. The regular mode uses the
18
- // recommended a11y pattern which has `role="group"` on the group element with `aria-labelledby`
19
- // pointing to the label. This works for `mat-select`, but it seems to hit a bug for autocomplete
20
- // under VoiceOver where the group doesn't get read out at all. The bug appears to be that if
21
- // there's __any__ a11y-related attribute on the group (e.g. `role` or `aria-labelledby`),
22
- // VoiceOver on Safari won't read it out.
23
- // We've introduced the `inert` mode as a workaround. Under this mode, all a11y attributes are
24
- // removed from the group, and we get the screen reader to read out the group label by mirroring it
25
- // inside an invisible element in the option. This is sub-optimal, because the screen reader will
26
- // repeat the group label on each navigation, whereas the default pattern only reads the group when
27
- // the user enters a new group. The following alternate approaches were considered:
28
- // 1. Reading out the group label using the `LiveAnnouncer` solves the problem, but we can't control
29
- // when the text will be read out so sometimes it comes in too late or never if the user
30
- // navigates quickly.
31
- // 2. `<mat-option aria-describedby="groupLabel"` - This works on Safari, but VoiceOver in Chrome
32
- // won't read out the description at all.
33
- // 3. `<mat-option aria-labelledby="optionLabel groupLabel"` - This works on Chrome, but Safari
34
- // doesn't read out the text at all. Furthermore, on
35
- /**
36
- * Injection token that can be used to reference instances of `MatOptgroup`. It serves as
37
- * alternative token to the actual `MatOptgroup` class which could cause unnecessary
38
- * retention of the class and its component metadata.
39
- */
40
13
  const MAT_OPTGROUP = new InjectionToken('MatOptgroup');
41
- /**
42
- * Component that is used to group instances of `mat-option`.
43
- */
44
14
  class MatOptgroup {
45
- /** Label for the option group. */
46
- label;
47
- /** whether the option group is disabled. */
48
- disabled = false;
49
- /** Unique id for the underlying label. */
50
- _labelId = inject(_IdGenerator).getId('mat-optgroup-label-');
51
- /** Whether the group is in inert a11y mode. */
52
- _inert;
53
- constructor() {
54
- const parent = inject(MAT_OPTION_PARENT_COMPONENT, { optional: true });
55
- this._inert = parent?.inertGroups ?? false;
56
- }
57
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatOptgroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
58
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.2.0-next.2", type: MatOptgroup, isStandalone: true, selector: "mat-optgroup", inputs: { label: "label", disabled: ["disabled", "disabled", booleanAttribute] }, host: { properties: { "attr.role": "_inert ? null : \"group\"", "attr.aria-disabled": "_inert ? null : disabled.toString()", "attr.aria-labelledby": "_inert ? null : _labelId" }, classAttribute: "mat-mdc-optgroup" }, providers: [{ provide: MAT_OPTGROUP, useExisting: MatOptgroup }], exportAs: ["matOptgroup"], ngImport: i0, template: "<span\n class=\"mat-mdc-optgroup-label\"\n role=\"presentation\"\n [class.mdc-list-item--disabled]=\"disabled\"\n [id]=\"_labelId\">\n <span class=\"mdc-list-item__primary-text\">{{ label }} <ng-content></ng-content></span>\n</span>\n\n<ng-content select=\"mat-option, ng-container\"></ng-content>\n", styles: [".mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
15
+ label;
16
+ disabled = false;
17
+ _labelId = inject(_IdGenerator).getId('mat-optgroup-label-');
18
+ _inert;
19
+ constructor() {
20
+ const parent = inject(MAT_OPTION_PARENT_COMPONENT, {
21
+ optional: true
22
+ });
23
+ this._inert = parent?.inertGroups ?? false;
24
+ }
25
+ static ɵfac = i0.ɵɵngDeclareFactory({
26
+ minVersion: "12.0.0",
27
+ version: "20.2.0-next.2",
28
+ ngImport: i0,
29
+ type: MatOptgroup,
30
+ deps: [],
31
+ target: i0.ɵɵFactoryTarget.Component
32
+ });
33
+ static ɵcmp = i0.ɵɵngDeclareComponent({
34
+ minVersion: "16.1.0",
35
+ version: "20.2.0-next.2",
36
+ type: MatOptgroup,
37
+ isStandalone: true,
38
+ selector: "mat-optgroup",
39
+ inputs: {
40
+ label: "label",
41
+ disabled: ["disabled", "disabled", booleanAttribute]
42
+ },
43
+ host: {
44
+ properties: {
45
+ "attr.role": "_inert ? null : \"group\"",
46
+ "attr.aria-disabled": "_inert ? null : disabled.toString()",
47
+ "attr.aria-labelledby": "_inert ? null : _labelId"
48
+ },
49
+ classAttribute: "mat-mdc-optgroup"
50
+ },
51
+ providers: [{
52
+ provide: MAT_OPTGROUP,
53
+ useExisting: MatOptgroup
54
+ }],
55
+ exportAs: ["matOptgroup"],
56
+ ngImport: i0,
57
+ template: "<span\n class=\"mat-mdc-optgroup-label\"\n role=\"presentation\"\n [class.mdc-list-item--disabled]=\"disabled\"\n [id]=\"_labelId\">\n <span class=\"mdc-list-item__primary-text\">{{ label }} <ng-content></ng-content></span>\n</span>\n\n<ng-content select=\"mat-option, ng-container\"></ng-content>\n",
58
+ styles: [".mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}\n"],
59
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
60
+ encapsulation: i0.ViewEncapsulation.None
61
+ });
59
62
  }
60
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatOptgroup, decorators: [{
61
- type: Component,
62
- args: [{ selector: 'mat-optgroup', exportAs: 'matOptgroup', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
63
- 'class': 'mat-mdc-optgroup',
64
- '[attr.role]': '_inert ? null : "group"',
65
- '[attr.aria-disabled]': '_inert ? null : disabled.toString()',
66
- '[attr.aria-labelledby]': '_inert ? null : _labelId',
67
- }, providers: [{ provide: MAT_OPTGROUP, useExisting: MatOptgroup }], template: "<span\n class=\"mat-mdc-optgroup-label\"\n role=\"presentation\"\n [class.mdc-list-item--disabled]=\"disabled\"\n [id]=\"_labelId\">\n <span class=\"mdc-list-item__primary-text\">{{ label }} <ng-content></ng-content></span>\n</span>\n\n<ng-content select=\"mat-option, ng-container\"></ng-content>\n", styles: [".mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}\n"] }]
68
- }], ctorParameters: () => [], propDecorators: { label: [{
69
- type: Input
70
- }], disabled: [{
71
- type: Input,
72
- args: [{ transform: booleanAttribute }]
73
- }] } });
63
+ i0.ɵɵngDeclareClassMetadata({
64
+ minVersion: "12.0.0",
65
+ version: "20.2.0-next.2",
66
+ ngImport: i0,
67
+ type: MatOptgroup,
68
+ decorators: [{
69
+ type: Component,
70
+ args: [{
71
+ selector: 'mat-optgroup',
72
+ exportAs: 'matOptgroup',
73
+ encapsulation: ViewEncapsulation.None,
74
+ changeDetection: ChangeDetectionStrategy.OnPush,
75
+ host: {
76
+ 'class': 'mat-mdc-optgroup',
77
+ '[attr.role]': '_inert ? null : "group"',
78
+ '[attr.aria-disabled]': '_inert ? null : disabled.toString()',
79
+ '[attr.aria-labelledby]': '_inert ? null : _labelId'
80
+ },
81
+ providers: [{
82
+ provide: MAT_OPTGROUP,
83
+ useExisting: MatOptgroup
84
+ }],
85
+ template: "<span\n class=\"mat-mdc-optgroup-label\"\n role=\"presentation\"\n [class.mdc-list-item--disabled]=\"disabled\"\n [id]=\"_labelId\">\n <span class=\"mdc-list-item__primary-text\">{{ label }} <ng-content></ng-content></span>\n</span>\n\n<ng-content select=\"mat-option, ng-container\"></ng-content>\n",
86
+ styles: [".mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}\n"]
87
+ }]
88
+ }],
89
+ ctorParameters: () => [],
90
+ propDecorators: {
91
+ label: [{
92
+ type: Input
93
+ }],
94
+ disabled: [{
95
+ type: Input,
96
+ args: [{
97
+ transform: booleanAttribute
98
+ }]
99
+ }]
100
+ }
101
+ });
74
102
 
75
- /** Event object emitted by MatOption when selected or deselected. */
76
103
  class MatOptionSelectionChange {
77
- source;
78
- isUserInput;
79
- constructor(
80
- /** Reference to the option that emitted the event. */
81
- source,
82
- /** Whether the change in the option's value was a result of a user action. */
83
- isUserInput = false) {
84
- this.source = source;
85
- this.isUserInput = isUserInput;
86
- }
104
+ source;
105
+ isUserInput;
106
+ constructor(source, isUserInput = false) {
107
+ this.source = source;
108
+ this.isUserInput = isUserInput;
109
+ }
87
110
  }
88
- /**
89
- * Single option inside of a `<mat-select>` element.
90
- */
91
111
  class MatOption {
92
- _element = inject(ElementRef);
93
- _changeDetectorRef = inject(ChangeDetectorRef);
94
- _parent = inject(MAT_OPTION_PARENT_COMPONENT, { optional: true });
95
- group = inject(MAT_OPTGROUP, { optional: true });
96
- _signalDisableRipple = false;
97
- _selected = false;
98
- _active = false;
99
- _mostRecentViewValue = '';
100
- /** Whether the wrapping component is in multiple selection mode. */
101
- get multiple() {
102
- return this._parent && this._parent.multiple;
103
- }
104
- /** Whether or not the option is currently selected. */
105
- get selected() {
106
- return this._selected;
107
- }
108
- /** The form value of the option. */
109
- value;
110
- /** The unique ID of the option. */
111
- id = inject(_IdGenerator).getId('mat-option-');
112
- /** Whether the option is disabled. */
113
- get disabled() {
114
- return (this.group && this.group.disabled) || this._disabled();
115
- }
116
- set disabled(value) {
117
- this._disabled.set(value);
118
- }
119
- _disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
120
- /** Whether ripples for the option are disabled. */
121
- get disableRipple() {
122
- return this._signalDisableRipple
123
- ? this._parent.disableRipple()
124
- : !!this._parent?.disableRipple;
125
- }
126
- /** Whether to display checkmark for single-selection. */
127
- get hideSingleSelectionIndicator() {
128
- return !!(this._parent && this._parent.hideSingleSelectionIndicator);
129
- }
130
- /** Event emitted when the option is selected or deselected. */
131
- // tslint:disable-next-line:no-output-on-prefix
132
- onSelectionChange = new EventEmitter();
133
- /** Element containing the option's text. */
134
- _text;
135
- /** Emits when the state of the option changes and any parents have to be notified. */
136
- _stateChanges = new Subject();
137
- constructor() {
138
- const styleLoader = inject(_CdkPrivateStyleLoader);
139
- styleLoader.load(_StructuralStylesLoader);
140
- styleLoader.load(_VisuallyHiddenLoader);
141
- this._signalDisableRipple = !!this._parent && isSignal(this._parent.disableRipple);
142
- }
143
- /**
144
- * Whether or not the option is currently active and ready to be selected.
145
- * An active option displays styles as if it is focused, but the
146
- * focus is actually retained somewhere else. This comes in handy
147
- * for components like autocomplete where focus must remain on the input.
148
- */
149
- get active() {
150
- return this._active;
151
- }
152
- /**
153
- * The displayed value of the option. It is necessary to show the selected option in the
154
- * select's trigger.
155
- */
156
- get viewValue() {
157
- // TODO(kara): Add input property alternative for node envs.
158
- return (this._text?.nativeElement.textContent || '').trim();
159
- }
160
- /** Selects the option. */
161
- select(emitEvent = true) {
162
- if (!this._selected) {
163
- this._selected = true;
164
- this._changeDetectorRef.markForCheck();
165
- if (emitEvent) {
166
- this._emitSelectionChangeEvent();
167
- }
168
- }
169
- }
170
- /** Deselects the option. */
171
- deselect(emitEvent = true) {
172
- if (this._selected) {
173
- this._selected = false;
174
- this._changeDetectorRef.markForCheck();
175
- if (emitEvent) {
176
- this._emitSelectionChangeEvent();
177
- }
178
- }
112
+ _element = inject(ElementRef);
113
+ _changeDetectorRef = inject(ChangeDetectorRef);
114
+ _parent = inject(MAT_OPTION_PARENT_COMPONENT, {
115
+ optional: true
116
+ });
117
+ group = inject(MAT_OPTGROUP, {
118
+ optional: true
119
+ });
120
+ _signalDisableRipple = false;
121
+ _selected = false;
122
+ _active = false;
123
+ _mostRecentViewValue = '';
124
+ get multiple() {
125
+ return this._parent && this._parent.multiple;
126
+ }
127
+ get selected() {
128
+ return this._selected;
129
+ }
130
+ value;
131
+ id = inject(_IdGenerator).getId('mat-option-');
132
+ get disabled() {
133
+ return this.group && this.group.disabled || this._disabled();
134
+ }
135
+ set disabled(value) {
136
+ this._disabled.set(value);
137
+ }
138
+ _disabled = signal(false, ...(ngDevMode ? [{
139
+ debugName: "_disabled"
140
+ }] : []));
141
+ get disableRipple() {
142
+ return this._signalDisableRipple ? this._parent.disableRipple() : !!this._parent?.disableRipple;
143
+ }
144
+ get hideSingleSelectionIndicator() {
145
+ return !!(this._parent && this._parent.hideSingleSelectionIndicator);
146
+ }
147
+ onSelectionChange = new EventEmitter();
148
+ _text;
149
+ _stateChanges = new Subject();
150
+ constructor() {
151
+ const styleLoader = inject(_CdkPrivateStyleLoader);
152
+ styleLoader.load(_StructuralStylesLoader);
153
+ styleLoader.load(_VisuallyHiddenLoader);
154
+ this._signalDisableRipple = !!this._parent && isSignal(this._parent.disableRipple);
155
+ }
156
+ get active() {
157
+ return this._active;
158
+ }
159
+ get viewValue() {
160
+ return (this._text?.nativeElement.textContent || '').trim();
161
+ }
162
+ select(emitEvent = true) {
163
+ if (!this._selected) {
164
+ this._selected = true;
165
+ this._changeDetectorRef.markForCheck();
166
+ if (emitEvent) {
167
+ this._emitSelectionChangeEvent();
168
+ }
179
169
  }
180
- /** Sets focus onto this option. */
181
- focus(_origin, options) {
182
- // Note that we aren't using `_origin`, but we need to keep it because some internal consumers
183
- // use `MatOption` in a `FocusKeyManager` and we need it to match `FocusableOption`.
184
- const element = this._getHostElement();
185
- if (typeof element.focus === 'function') {
186
- element.focus(options);
187
- }
170
+ }
171
+ deselect(emitEvent = true) {
172
+ if (this._selected) {
173
+ this._selected = false;
174
+ this._changeDetectorRef.markForCheck();
175
+ if (emitEvent) {
176
+ this._emitSelectionChangeEvent();
177
+ }
188
178
  }
189
- /**
190
- * This method sets display styles on the option to make it appear
191
- * active. This is used by the ActiveDescendantKeyManager so key
192
- * events will display the proper options as active on arrow key events.
193
- */
194
- setActiveStyles() {
195
- if (!this._active) {
196
- this._active = true;
197
- this._changeDetectorRef.markForCheck();
198
- }
179
+ }
180
+ focus(_origin, options) {
181
+ const element = this._getHostElement();
182
+ if (typeof element.focus === 'function') {
183
+ element.focus(options);
199
184
  }
200
- /**
201
- * This method removes display styles on the option that made it appear
202
- * active. This is used by the ActiveDescendantKeyManager so key
203
- * events will display the proper options as active on arrow key events.
204
- */
205
- setInactiveStyles() {
206
- if (this._active) {
207
- this._active = false;
208
- this._changeDetectorRef.markForCheck();
209
- }
185
+ }
186
+ setActiveStyles() {
187
+ if (!this._active) {
188
+ this._active = true;
189
+ this._changeDetectorRef.markForCheck();
210
190
  }
211
- /** Gets the label to be used when determining whether the option should be focused. */
212
- getLabel() {
213
- return this.viewValue;
191
+ }
192
+ setInactiveStyles() {
193
+ if (this._active) {
194
+ this._active = false;
195
+ this._changeDetectorRef.markForCheck();
214
196
  }
215
- /** Ensures the option is selected when activated from the keyboard. */
216
- _handleKeydown(event) {
217
- if ((event.keyCode === ENTER || event.keyCode === SPACE) && !hasModifierKey(event)) {
218
- this._selectViaInteraction();
219
- // Prevent the page from scrolling down and form submits.
220
- event.preventDefault();
221
- }
222
- }
223
- /**
224
- * `Selects the option while indicating the selection came from the user. Used to
225
- * determine if the select's view -> model callback should be invoked.`
226
- */
227
- _selectViaInteraction() {
228
- if (!this.disabled) {
229
- this._selected = this.multiple ? !this._selected : true;
230
- this._changeDetectorRef.markForCheck();
231
- this._emitSelectionChangeEvent(true);
232
- }
197
+ }
198
+ getLabel() {
199
+ return this.viewValue;
200
+ }
201
+ _handleKeydown(event) {
202
+ if ((event.keyCode === ENTER || event.keyCode === SPACE) && !hasModifierKey(event)) {
203
+ this._selectViaInteraction();
204
+ event.preventDefault();
233
205
  }
234
- /** Returns the correct tabindex for the option depending on disabled state. */
235
- // This method is only used by `MatLegacyOption`. Keeping it here to avoid breaking the types.
236
- // That's because `MatLegacyOption` use `MatOption` type in a few places such as
237
- // `MatOptionSelectionChange`. It is safe to delete this when `MatLegacyOption` is deleted.
238
- _getTabIndex() {
239
- return this.disabled ? '-1' : '0';
206
+ }
207
+ _selectViaInteraction() {
208
+ if (!this.disabled) {
209
+ this._selected = this.multiple ? !this._selected : true;
210
+ this._changeDetectorRef.markForCheck();
211
+ this._emitSelectionChangeEvent(true);
240
212
  }
241
- /** Gets the host DOM element. */
242
- _getHostElement() {
243
- return this._element.nativeElement;
244
- }
245
- ngAfterViewChecked() {
246
- // Since parent components could be using the option's label to display the selected values
247
- // (e.g. `mat-select`) and they don't have a way of knowing if the option's label has changed
248
- // we have to check for changes in the DOM ourselves and dispatch an event. These checks are
249
- // relatively cheap, however we still limit them only to selected options in order to avoid
250
- // hitting the DOM too often.
251
- if (this._selected) {
252
- const viewValue = this.viewValue;
253
- if (viewValue !== this._mostRecentViewValue) {
254
- if (this._mostRecentViewValue) {
255
- this._stateChanges.next();
256
- }
257
- this._mostRecentViewValue = viewValue;
258
- }
213
+ }
214
+ _getTabIndex() {
215
+ return this.disabled ? '-1' : '0';
216
+ }
217
+ _getHostElement() {
218
+ return this._element.nativeElement;
219
+ }
220
+ ngAfterViewChecked() {
221
+ if (this._selected) {
222
+ const viewValue = this.viewValue;
223
+ if (viewValue !== this._mostRecentViewValue) {
224
+ if (this._mostRecentViewValue) {
225
+ this._stateChanges.next();
259
226
  }
227
+ this._mostRecentViewValue = viewValue;
228
+ }
260
229
  }
261
- ngOnDestroy() {
262
- this._stateChanges.complete();
263
- }
264
- /** Emits the selection change event. */
265
- _emitSelectionChangeEvent(isUserInput = false) {
266
- this.onSelectionChange.emit(new MatOptionSelectionChange(this, isUserInput));
267
- }
268
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatOption, deps: [], target: i0.ɵɵFactoryTarget.Component });
269
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.0-next.2", type: MatOption, isStandalone: true, selector: "mat-option", inputs: { value: "value", id: "id", disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { onSelectionChange: "onSelectionChange" }, host: { attributes: { "role": "option" }, listeners: { "click": "_selectViaInteraction()", "keydown": "_handleKeydown($event)" }, properties: { "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 mdc-list-item" }, viewQueries: [{ propertyName: "_text", first: true, predicate: ["text"], descendants: true, static: true }], exportAs: ["matOption"], ngImport: i0, template: "<!-- Set aria-hidden=\"true\" to this DOM node and other decorative nodes in this file. This might\n be contributing to issue where sometimes VoiceOver focuses on a TextNode in the a11y tree instead\n of the Option node (#23202). Most assistive technology will generally ignore non-role,\n non-text-content elements. Adding aria-hidden seems to make VoiceOver behave more consistently. -->\n@if (multiple) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n [state]=\"selected ? 'checked' : 'unchecked'\"\n aria-hidden=\"true\"></mat-pseudo-checkbox>\n}\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@if (!multiple && selected && !hideSingleSelectionIndicator) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n state=\"checked\"\n aria-hidden=\"true\"\n appearance=\"minimal\"></mat-pseudo-checkbox>\n}\n\n<!-- See a11y notes inside optgroup.ts for context behind this element. -->\n@if (group && group._inert) {\n <span class=\"cdk-visually-hidden\">({{ group.label }})</span>\n}\n\n<div class=\"mat-mdc-option-ripple mat-focus-indicator\" aria-hidden=\"true\" mat-ripple\n [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"disabled || disableRipple\">\n</div>\n", styles: [".mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active,.mat-mdc-option-multiple,:focus,:hover){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active,.mat-mdc-option-multiple,:focus,:hover) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.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}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:\"\";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:\"\"}\n"], dependencies: [{ kind: "component", type: MatPseudoCheckbox, selector: "mat-pseudo-checkbox", inputs: ["state", "disabled", "appearance"] }, { kind: "directive", type: MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
230
+ }
231
+ ngOnDestroy() {
232
+ this._stateChanges.complete();
233
+ }
234
+ _emitSelectionChangeEvent(isUserInput = false) {
235
+ this.onSelectionChange.emit(new MatOptionSelectionChange(this, isUserInput));
236
+ }
237
+ static ɵfac = i0.ɵɵngDeclareFactory({
238
+ minVersion: "12.0.0",
239
+ version: "20.2.0-next.2",
240
+ ngImport: i0,
241
+ type: MatOption,
242
+ deps: [],
243
+ target: i0.ɵɵFactoryTarget.Component
244
+ });
245
+ static ɵcmp = i0.ɵɵngDeclareComponent({
246
+ minVersion: "17.0.0",
247
+ version: "20.2.0-next.2",
248
+ type: MatOption,
249
+ isStandalone: true,
250
+ selector: "mat-option",
251
+ inputs: {
252
+ value: "value",
253
+ id: "id",
254
+ disabled: ["disabled", "disabled", booleanAttribute]
255
+ },
256
+ outputs: {
257
+ onSelectionChange: "onSelectionChange"
258
+ },
259
+ host: {
260
+ attributes: {
261
+ "role": "option"
262
+ },
263
+ listeners: {
264
+ "click": "_selectViaInteraction()",
265
+ "keydown": "_handleKeydown($event)"
266
+ },
267
+ properties: {
268
+ "class.mdc-list-item--selected": "selected",
269
+ "class.mat-mdc-option-multiple": "multiple",
270
+ "class.mat-mdc-option-active": "active",
271
+ "class.mdc-list-item--disabled": "disabled",
272
+ "id": "id",
273
+ "attr.aria-selected": "selected",
274
+ "attr.aria-disabled": "disabled.toString()"
275
+ },
276
+ classAttribute: "mat-mdc-option mdc-list-item"
277
+ },
278
+ viewQueries: [{
279
+ propertyName: "_text",
280
+ first: true,
281
+ predicate: ["text"],
282
+ descendants: true,
283
+ static: true
284
+ }],
285
+ exportAs: ["matOption"],
286
+ ngImport: i0,
287
+ template: "<!-- Set aria-hidden=\"true\" to this DOM node and other decorative nodes in this file. This might\n be contributing to issue where sometimes VoiceOver focuses on a TextNode in the a11y tree instead\n of the Option node (#23202). Most assistive technology will generally ignore non-role,\n non-text-content elements. Adding aria-hidden seems to make VoiceOver behave more consistently. -->\n@if (multiple) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n [state]=\"selected ? 'checked' : 'unchecked'\"\n aria-hidden=\"true\"></mat-pseudo-checkbox>\n}\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@if (!multiple && selected && !hideSingleSelectionIndicator) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n state=\"checked\"\n aria-hidden=\"true\"\n appearance=\"minimal\"></mat-pseudo-checkbox>\n}\n\n<!-- See a11y notes inside optgroup.ts for context behind this element. -->\n@if (group && group._inert) {\n <span class=\"cdk-visually-hidden\">({{ group.label }})</span>\n}\n\n<div class=\"mat-mdc-option-ripple mat-focus-indicator\" aria-hidden=\"true\" mat-ripple\n [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"disabled || disableRipple\">\n</div>\n",
288
+ styles: [".mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active,.mat-mdc-option-multiple,:focus,:hover){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active,.mat-mdc-option-multiple,:focus,:hover) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.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}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:\"\";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:\"\"}\n"],
289
+ dependencies: [{
290
+ kind: "component",
291
+ type: MatPseudoCheckbox,
292
+ selector: "mat-pseudo-checkbox",
293
+ inputs: ["state", "disabled", "appearance"]
294
+ }, {
295
+ kind: "directive",
296
+ type: MatRipple,
297
+ selector: "[mat-ripple], [matRipple]",
298
+ inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"],
299
+ exportAs: ["matRipple"]
300
+ }],
301
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
302
+ encapsulation: i0.ViewEncapsulation.None
303
+ });
270
304
  }
271
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatOption, decorators: [{
272
- type: Component,
273
- args: [{ selector: 'mat-option', exportAs: 'matOption', host: {
274
- 'role': 'option',
275
- '[class.mdc-list-item--selected]': 'selected',
276
- '[class.mat-mdc-option-multiple]': 'multiple',
277
- '[class.mat-mdc-option-active]': 'active',
278
- '[class.mdc-list-item--disabled]': 'disabled',
279
- '[id]': 'id',
280
- // Set aria-selected to false for non-selected items and true for selected items. Conform to
281
- // [WAI ARIA Listbox authoring practices guide](
282
- // https://www.w3.org/WAI/ARIA/apg/patterns/listbox/), "If any options are selected, each
283
- // selected option has either aria-selected or aria-checked set to true. All options that are
284
- // selectable but not selected have either aria-selected or aria-checked set to false." Align
285
- // aria-selected implementation of Chips and List components.
286
- //
287
- // Set `aria-selected="false"` on not-selected listbox options to fix VoiceOver announcing
288
- // every option as "selected" (#21491).
289
- '[attr.aria-selected]': 'selected',
290
- '[attr.aria-disabled]': 'disabled.toString()',
291
- '(click)': '_selectViaInteraction()',
292
- '(keydown)': '_handleKeydown($event)',
293
- 'class': 'mat-mdc-option mdc-list-item',
294
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatPseudoCheckbox, MatRipple], template: "<!-- Set aria-hidden=\"true\" to this DOM node and other decorative nodes in this file. This might\n be contributing to issue where sometimes VoiceOver focuses on a TextNode in the a11y tree instead\n of the Option node (#23202). Most assistive technology will generally ignore non-role,\n non-text-content elements. Adding aria-hidden seems to make VoiceOver behave more consistently. -->\n@if (multiple) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n [state]=\"selected ? 'checked' : 'unchecked'\"\n aria-hidden=\"true\"></mat-pseudo-checkbox>\n}\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@if (!multiple && selected && !hideSingleSelectionIndicator) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n state=\"checked\"\n aria-hidden=\"true\"\n appearance=\"minimal\"></mat-pseudo-checkbox>\n}\n\n<!-- See a11y notes inside optgroup.ts for context behind this element. -->\n@if (group && group._inert) {\n <span class=\"cdk-visually-hidden\">({{ group.label }})</span>\n}\n\n<div class=\"mat-mdc-option-ripple mat-focus-indicator\" aria-hidden=\"true\" mat-ripple\n [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"disabled || disableRipple\">\n</div>\n", styles: [".mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active,.mat-mdc-option-multiple,:focus,:hover){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active,.mat-mdc-option-multiple,:focus,:hover) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.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}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:\"\";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:\"\"}\n"] }]
295
- }], ctorParameters: () => [], propDecorators: { value: [{
296
- type: Input
297
- }], id: [{
298
- type: Input
299
- }], disabled: [{
300
- type: Input,
301
- args: [{ transform: booleanAttribute }]
302
- }], onSelectionChange: [{
303
- type: Output
304
- }], _text: [{
305
- type: ViewChild,
306
- args: ['text', { static: true }]
307
- }] } });
308
- /**
309
- * Counts the amount of option group labels that precede the specified option.
310
- * @param optionIndex Index of the option at which to start counting.
311
- * @param options Flat list of all of the options.
312
- * @param optionGroups Flat list of all of the option groups.
313
- * @docs-private
314
- */
305
+ i0.ɵɵngDeclareClassMetadata({
306
+ minVersion: "12.0.0",
307
+ version: "20.2.0-next.2",
308
+ ngImport: i0,
309
+ type: MatOption,
310
+ decorators: [{
311
+ type: Component,
312
+ args: [{
313
+ selector: 'mat-option',
314
+ exportAs: 'matOption',
315
+ host: {
316
+ 'role': 'option',
317
+ '[class.mdc-list-item--selected]': 'selected',
318
+ '[class.mat-mdc-option-multiple]': 'multiple',
319
+ '[class.mat-mdc-option-active]': 'active',
320
+ '[class.mdc-list-item--disabled]': 'disabled',
321
+ '[id]': 'id',
322
+ '[attr.aria-selected]': 'selected',
323
+ '[attr.aria-disabled]': 'disabled.toString()',
324
+ '(click)': '_selectViaInteraction()',
325
+ '(keydown)': '_handleKeydown($event)',
326
+ 'class': 'mat-mdc-option mdc-list-item'
327
+ },
328
+ encapsulation: ViewEncapsulation.None,
329
+ changeDetection: ChangeDetectionStrategy.OnPush,
330
+ imports: [MatPseudoCheckbox, MatRipple],
331
+ template: "<!-- Set aria-hidden=\"true\" to this DOM node and other decorative nodes in this file. This might\n be contributing to issue where sometimes VoiceOver focuses on a TextNode in the a11y tree instead\n of the Option node (#23202). Most assistive technology will generally ignore non-role,\n non-text-content elements. Adding aria-hidden seems to make VoiceOver behave more consistently. -->\n@if (multiple) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n [state]=\"selected ? 'checked' : 'unchecked'\"\n aria-hidden=\"true\"></mat-pseudo-checkbox>\n}\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@if (!multiple && selected && !hideSingleSelectionIndicator) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n state=\"checked\"\n aria-hidden=\"true\"\n appearance=\"minimal\"></mat-pseudo-checkbox>\n}\n\n<!-- See a11y notes inside optgroup.ts for context behind this element. -->\n@if (group && group._inert) {\n <span class=\"cdk-visually-hidden\">({{ group.label }})</span>\n}\n\n<div class=\"mat-mdc-option-ripple mat-focus-indicator\" aria-hidden=\"true\" mat-ripple\n [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"disabled || disableRipple\">\n</div>\n",
332
+ styles: [".mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active,.mat-mdc-option-multiple,:focus,:hover){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active,.mat-mdc-option-multiple,:focus,:hover) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.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}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:\"\";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:\"\"}\n"]
333
+ }]
334
+ }],
335
+ ctorParameters: () => [],
336
+ propDecorators: {
337
+ value: [{
338
+ type: Input
339
+ }],
340
+ id: [{
341
+ type: Input
342
+ }],
343
+ disabled: [{
344
+ type: Input,
345
+ args: [{
346
+ transform: booleanAttribute
347
+ }]
348
+ }],
349
+ onSelectionChange: [{
350
+ type: Output
351
+ }],
352
+ _text: [{
353
+ type: ViewChild,
354
+ args: ['text', {
355
+ static: true
356
+ }]
357
+ }]
358
+ }
359
+ });
315
360
  function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {
316
- if (optionGroups.length) {
317
- let optionsArray = options.toArray();
318
- let groups = optionGroups.toArray();
319
- let groupCounter = 0;
320
- for (let i = 0; i < optionIndex + 1; i++) {
321
- if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {
322
- groupCounter++;
323
- }
324
- }
325
- return groupCounter;
361
+ if (optionGroups.length) {
362
+ let optionsArray = options.toArray();
363
+ let groups = optionGroups.toArray();
364
+ let groupCounter = 0;
365
+ for (let i = 0; i < optionIndex + 1; i++) {
366
+ if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {
367
+ groupCounter++;
368
+ }
326
369
  }
327
- return 0;
370
+ return groupCounter;
371
+ }
372
+ return 0;
328
373
  }
329
- /**
330
- * Determines the position to which to scroll a panel in order for an option to be into view.
331
- * @param optionOffset Offset of the option from the top of the panel.
332
- * @param optionHeight Height of the options.
333
- * @param currentScrollPosition Current scroll position of the panel.
334
- * @param panelHeight Height of the panel.
335
- * @docs-private
336
- */
337
374
  function _getOptionScrollPosition(optionOffset, optionHeight, currentScrollPosition, panelHeight) {
338
- if (optionOffset < currentScrollPosition) {
339
- return optionOffset;
340
- }
341
- if (optionOffset + optionHeight > currentScrollPosition + panelHeight) {
342
- return Math.max(0, optionOffset - panelHeight + optionHeight);
343
- }
344
- return currentScrollPosition;
375
+ if (optionOffset < currentScrollPosition) {
376
+ return optionOffset;
377
+ }
378
+ if (optionOffset + optionHeight > currentScrollPosition + panelHeight) {
379
+ return Math.max(0, optionOffset - panelHeight + optionHeight);
380
+ }
381
+ return currentScrollPosition;
345
382
  }
346
383
 
347
384
  export { MAT_OPTGROUP, MAT_OPTION_PARENT_COMPONENT, MatOptgroup, MatOption, MatOptionSelectionChange, _countGroupLabelsBeforeOption, _getOptionScrollPosition };