@angular/material 20.0.3 → 20.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 (120) hide show
  1. package/_index.scss +0 -1
  2. package/autocomplete/_m2-autocomplete.scss +1 -14
  3. package/badge/_badge-theme.scss +2 -2
  4. package/badge/_m2-badge.scss +13 -34
  5. package/bottom-sheet/_m2-bottom-sheet.scss +2 -15
  6. package/button/_button-theme.scss +2 -2
  7. package/button/_fab-theme.scss +2 -2
  8. package/button/_icon-button-theme.scss +2 -2
  9. package/button/_m2-button.scss +59 -108
  10. package/button/_m2-fab.scss +28 -60
  11. package/button/_m2-icon-button.scss +12 -26
  12. package/button-toggle/_button-toggle-theme.scss +2 -1
  13. package/button-toggle/_m2-button-toggle.scss +24 -49
  14. package/card/_m2-card.scss +9 -18
  15. package/checkbox/_checkbox-theme.scss +4 -3
  16. package/checkbox/_m2-checkbox.scss +31 -59
  17. package/chips/_chips-theme.scss +7 -4
  18. package/chips/_m2-chip.scss +19 -27
  19. package/chips/index.d.ts +56 -4
  20. package/chips/testing/index.d.ts +23 -2
  21. package/core/_m2-app.scss +6 -19
  22. package/core/m2/_theming.scss +55 -9
  23. package/core/option/_m2-optgroup.scss +1 -14
  24. package/core/option/_m2-option.scss +8 -16
  25. package/core/option/_option-theme.scss +3 -3
  26. package/core/ripple/_m2-ripple.scss +0 -13
  27. package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +10 -20
  28. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +3 -3
  29. package/core/style/_private.scss +6 -9
  30. package/core/style/_sass-utils.scss +0 -29
  31. package/core/tokens/_m2-utils.scss +20 -42
  32. package/core/tokens/_m3-system.scss +9 -11
  33. package/{date-range-input-harness.d-CaEyN8dT.d.ts → date-range-input-harness.d-CJ4r85Uf.d.ts} +7 -4
  34. package/datepicker/_datepicker-theme.scss +10 -6
  35. package/datepicker/_m2-datepicker.scss +32 -41
  36. package/datepicker/index.d.ts +1 -1
  37. package/datepicker/testing/index.d.ts +3 -3
  38. package/dialog/_m2-dialog.scss +3 -24
  39. package/divider/_m2-divider.scss +1 -14
  40. package/expansion/_m2-expansion.scss +15 -25
  41. package/fesm2022/chips/testing.mjs +26 -1
  42. package/fesm2022/chips/testing.mjs.map +1 -1
  43. package/fesm2022/chips.mjs +131 -13
  44. package/fesm2022/chips.mjs.map +1 -1
  45. package/fesm2022/core.mjs +1 -1
  46. package/fesm2022/core.mjs.map +1 -1
  47. package/fesm2022/{date-range-input-harness-Bp1T4oUe.mjs → date-range-input-harness-DEyfkeOs.mjs} +32 -4
  48. package/fesm2022/date-range-input-harness-DEyfkeOs.mjs.map +1 -0
  49. package/fesm2022/datepicker/testing.mjs +3 -3
  50. package/fesm2022/datepicker.mjs.map +1 -1
  51. package/fesm2022/form-field/testing/control.mjs +26 -1
  52. package/fesm2022/form-field/testing/control.mjs.map +1 -1
  53. package/fesm2022/form-field/testing.mjs +4 -4
  54. package/fesm2022/input/testing.mjs +7 -4
  55. package/fesm2022/input/testing.mjs.map +1 -1
  56. package/fesm2022/{input-harness-oQzj5EsQ.mjs → input-harness-C5Msdc4-.mjs} +6 -3
  57. package/fesm2022/input-harness-C5Msdc4-.mjs.map +1 -0
  58. package/fesm2022/menu.mjs +11 -2
  59. package/fesm2022/menu.mjs.map +1 -1
  60. package/fesm2022/paginator/testing.mjs +2 -3
  61. package/fesm2022/paginator/testing.mjs.map +1 -1
  62. package/fesm2022/select/testing.mjs +8 -5
  63. package/fesm2022/select/testing.mjs.map +1 -1
  64. package/fesm2022/slider.mjs +2 -2
  65. package/fesm2022/slider.mjs.map +1 -1
  66. package/fesm2022/stepper.mjs +2 -2
  67. package/fesm2022/stepper.mjs.map +1 -1
  68. package/form-field/_form-field-theme.scss +2 -2
  69. package/form-field/_m2-form-field.scss +58 -92
  70. package/form-field/testing/control/index.d.ts +8 -5
  71. package/form-field/testing/index.d.ts +5 -5
  72. package/form-field-control-harness.d-BLvFBy6v.d.ts +18 -0
  73. package/grid-list/_m2-grid-list.scss +0 -13
  74. package/icon/_m2-icon.scss +0 -13
  75. package/input/testing/index.d.ts +5 -4
  76. package/{input-harness.d-8fkAAbu2.d.ts → input-harness.d-DVI6ttzl.d.ts} +4 -4
  77. package/list/_list-theme.scss +10 -5
  78. package/list/_m2-list.scss +17 -31
  79. package/menu/_m2-menu.scss +4 -18
  80. package/menu/index.d.ts +2 -0
  81. package/package.json +6 -6
  82. package/paginator/_m2-paginator.scss +6 -18
  83. package/paginator/testing/index.d.ts +2 -3
  84. package/prebuilt-themes/azure-blue.css +1 -1
  85. package/prebuilt-themes/cyan-orange.css +1 -1
  86. package/prebuilt-themes/deeppurple-amber.css +1 -1
  87. package/prebuilt-themes/indigo-pink.css +1 -1
  88. package/prebuilt-themes/magenta-violet.css +1 -1
  89. package/prebuilt-themes/pink-bluegrey.css +1 -1
  90. package/prebuilt-themes/purple-green.css +1 -1
  91. package/prebuilt-themes/rose-red.css +1 -1
  92. package/progress-bar/_m2-progress-bar.scss +11 -20
  93. package/progress-bar/_progress-bar-theme.scss +2 -2
  94. package/progress-spinner/_m2-progress-spinner.scss +7 -15
  95. package/progress-spinner/_progress-spinner-theme.scss +2 -2
  96. package/radio/_m2-radio.scss +21 -32
  97. package/radio/_m3-radio.scss +1 -1
  98. package/radio/_radio-theme.scss +6 -3
  99. package/schematics/ng-add/index.js +2 -2
  100. package/select/_m2-select.scss +12 -35
  101. package/select/testing/index.d.ts +5 -6
  102. package/sidenav/_m2-sidenav.scss +10 -20
  103. package/slide-toggle/_m2-slide-toggle.scss +13 -20
  104. package/slide-toggle/_slide-toggle-theme.scss +3 -2
  105. package/slider/_m2-slider.scss +5 -18
  106. package/snack-bar/_m2-snack-bar.scss +6 -22
  107. package/sort/_m2-sort.scss +1 -34
  108. package/stepper/_m2-stepper.scss +23 -34
  109. package/stepper/_m3-stepper.scss +2 -2
  110. package/stepper/_stepper-theme.scss +2 -2
  111. package/table/_m2-table.scss +4 -17
  112. package/tabs/_m2-tabs.scss +16 -27
  113. package/tabs/_tabs-theme.scss +4 -4
  114. package/timepicker/_m2-timepicker.scss +1 -14
  115. package/toolbar/_m2-toolbar.scss +2 -15
  116. package/tooltip/_m2-tooltip.scss +4 -14
  117. package/tree/_m2-tree.scss +2 -17
  118. package/core/tokens/_m2-tokens.scss +0 -131
  119. package/fesm2022/date-range-input-harness-Bp1T4oUe.mjs.map +0 -1
  120. package/fesm2022/input-harness-oQzj5EsQ.mjs.map +0 -1
@@ -6,6 +6,31 @@ import { ComponentHarness } from '@angular/cdk/testing';
6
6
  */
7
7
  class MatFormFieldControlHarness extends ComponentHarness {
8
8
  }
9
+ /**
10
+ * Shared behavior for `MatFormFieldControlHarness` implementations
11
+ */
12
+ class MatFormFieldControlHarnessBase extends MatFormFieldControlHarness {
13
+ _floatingLabelSelector = '.mdc-floating-label';
14
+ /** Gets the text content of the floating label, if it exists. */
15
+ async getLabel() {
16
+ const documentRootLocator = this.documentRootLocatorFactory();
17
+ const labelId = await (await this.host()).getAttribute('aria-labelledby');
18
+ const hostId = await (await this.host()).getAttribute('id');
19
+ if (labelId) {
20
+ // First option, try to fetch the label using the `aria-labelledby`
21
+ // attribute.
22
+ const labelEl = await documentRootLocator.locatorForOptional(`${this._floatingLabelSelector}[id="${labelId}"]`)();
23
+ return labelEl ? labelEl.text() : null;
24
+ }
25
+ else if (hostId) {
26
+ // Fallback option, try to match the id of the input with the `for`
27
+ // attribute of the label.
28
+ const labelEl = await documentRootLocator.locatorForOptional(`${this._floatingLabelSelector}[for="${hostId}"]`)();
29
+ return labelEl ? labelEl.text() : null;
30
+ }
31
+ return null;
32
+ }
33
+ }
9
34
 
10
- export { MatFormFieldControlHarness };
35
+ export { MatFormFieldControlHarness, MatFormFieldControlHarnessBase };
11
36
  //# sourceMappingURL=control.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"control.mjs","sources":["../../../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/material/form-field/testing/control/form-field-control-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ComponentHarness} from '@angular/cdk/testing';\n\n/**\n * Base class for custom form-field control harnesses. Harnesses for\n * custom controls with form-fields need to implement this interface.\n */\nexport abstract class MatFormFieldControlHarness extends ComponentHarness {}\n"],"names":[],"mappings":";;AAUA;;;AAGG;AACG,MAAgB,0BAA2B,SAAQ,gBAAgB,CAAA;AAAG;;;;"}
1
+ {"version":3,"file":"control.mjs","sources":["../../../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/material/form-field/testing/control/form-field-control-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ComponentHarness} from '@angular/cdk/testing';\n\n/**\n * Base class for custom form-field control harnesses. Harnesses for\n * custom controls with form-fields need to implement this interface.\n */\nexport abstract class MatFormFieldControlHarness extends ComponentHarness {}\n\n/**\n * Shared behavior for `MatFormFieldControlHarness` implementations\n */\nexport abstract class MatFormFieldControlHarnessBase extends MatFormFieldControlHarness {\n private readonly _floatingLabelSelector = '.mdc-floating-label';\n\n /** Gets the text content of the floating label, if it exists. */\n async getLabel(): Promise<string | null> {\n const documentRootLocator = this.documentRootLocatorFactory();\n const labelId = await (await this.host()).getAttribute('aria-labelledby');\n const hostId = await (await this.host()).getAttribute('id');\n\n if (labelId) {\n // First option, try to fetch the label using the `aria-labelledby`\n // attribute.\n const labelEl = await documentRootLocator.locatorForOptional(\n `${this._floatingLabelSelector}[id=\"${labelId}\"]`,\n )();\n return labelEl ? labelEl.text() : null;\n } else if (hostId) {\n // Fallback option, try to match the id of the input with the `for`\n // attribute of the label.\n const labelEl = await documentRootLocator.locatorForOptional(\n `${this._floatingLabelSelector}[for=\"${hostId}\"]`,\n )();\n return labelEl ? labelEl.text() : null;\n }\n return null;\n }\n}\n"],"names":[],"mappings":";;AAUA;;;AAGG;AACG,MAAgB,0BAA2B,SAAQ,gBAAgB,CAAA;AAAG;AAE5E;;AAEG;AACG,MAAgB,8BAA+B,SAAQ,0BAA0B,CAAA;IACpE,sBAAsB,GAAG,qBAAqB;;AAG/D,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,MAAM,mBAAmB,GAAG,IAAI,CAAC,0BAA0B,EAAE;AAC7D,QAAA,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,iBAAiB,CAAC;AACzE,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC;QAE3D,IAAI,OAAO,EAAE;;;AAGX,YAAA,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,kBAAkB,CAC1D,CAAA,EAAG,IAAI,CAAC,sBAAsB,CAAQ,KAAA,EAAA,OAAO,CAAI,EAAA,CAAA,CAClD,EAAE;AACH,YAAA,OAAO,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,GAAG,IAAI;;aACjC,IAAI,MAAM,EAAE;;;AAGjB,YAAA,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,kBAAkB,CAC1D,CAAA,EAAG,IAAI,CAAC,sBAAsB,CAAS,MAAA,EAAA,MAAM,CAAI,EAAA,CAAA,CAClD,EAAE;AACH,YAAA,OAAO,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,GAAG,IAAI;;AAExC,QAAA,OAAO,IAAI;;AAEd;;;;"}
@@ -1,11 +1,11 @@
1
1
  export { MatFormFieldControlHarness } from './testing/control.mjs';
2
2
  import { ComponentHarness, HarnessPredicate, parallel } from '@angular/cdk/testing';
3
- import { M as MatInputHarness } from '../input-harness-oQzj5EsQ.mjs';
3
+ import { M as MatInputHarness } from '../input-harness-C5Msdc4-.mjs';
4
4
  import { MatSelectHarness } from '../select/testing.mjs';
5
- import { M as MatDatepickerInputHarness, c as MatDateRangeInputHarness } from '../date-range-input-harness-Bp1T4oUe.mjs';
5
+ import { M as MatDatepickerInputHarness, c as MatDateRangeInputHarness } from '../date-range-input-harness-DEyfkeOs.mjs';
6
+ import '@angular/material/form-field/testing/control';
6
7
  import '@angular/cdk/coercion';
7
- import '../option-harness-BFcc-M_4.mjs';
8
- import '../core/testing.mjs';
8
+ import '@angular/material/core/testing';
9
9
 
10
10
  /** Harness for interacting with a `mat-error` in tests. */
11
11
  class MatErrorHarness extends ComponentHarness {
@@ -1,6 +1,7 @@
1
- export { M as MatInputHarness } from '../input-harness-oQzj5EsQ.mjs';
1
+ export { M as MatInputHarness } from '../input-harness-C5Msdc4-.mjs';
2
2
  import { ComponentHarness, HarnessPredicate, parallel } from '@angular/cdk/testing';
3
- import { MatFormFieldControlHarness } from '../form-field/testing/control.mjs';
3
+ import { MatFormFieldControlHarnessBase } from '../form-field/testing/control.mjs';
4
+ import '@angular/material/form-field/testing/control';
4
5
  import '@angular/cdk/coercion';
5
6
 
6
7
  /** Harness for interacting with a native `option` in tests. */
@@ -38,7 +39,7 @@ class MatNativeOptionHarness extends ComponentHarness {
38
39
  }
39
40
 
40
41
  /** Harness for interacting with a native `select` in tests. */
41
- class MatNativeSelectHarness extends MatFormFieldControlHarness {
42
+ class MatNativeSelectHarness extends MatFormFieldControlHarnessBase {
42
43
  static hostSelector = 'select[matNativeControl]';
43
44
  /**
44
45
  * Gets a `HarnessPredicate` that can be used to search for a `MatNativeSelectHarness` that meets
@@ -47,7 +48,9 @@ class MatNativeSelectHarness extends MatFormFieldControlHarness {
47
48
  * @return a `HarnessPredicate` configured with the given options.
48
49
  */
49
50
  static with(options = {}) {
50
- return new HarnessPredicate(MatNativeSelectHarness, options);
51
+ return new HarnessPredicate(MatNativeSelectHarness, options).addOption('label', options.label, (harness, label) => {
52
+ return HarnessPredicate.stringMatches(harness.getLabel(), label);
53
+ });
51
54
  }
52
55
  /** Gets a boolean promise indicating if the select is disabled. */
53
56
  async isDisabled() {
@@ -1 +1 @@
1
- {"version":3,"file":"testing.mjs","sources":["../../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/material/input/testing/native-option-harness.ts","../../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/material/input/testing/native-select-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {NativeOptionHarnessFilters} from './native-select-harness-filters';\n\n/** Harness for interacting with a native `option` in tests. */\nexport class MatNativeOptionHarness extends ComponentHarness {\n /** Selector used to locate option instances. */\n static hostSelector = 'select[matNativeControl] option';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatNativeOptionHarness` that meets\n * certain criteria.\n * @param options Options for filtering which option instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: NativeOptionHarnessFilters = {}) {\n return new HarnessPredicate(MatNativeOptionHarness, options)\n .addOption('text', options.text, async (harness, title) =>\n HarnessPredicate.stringMatches(await harness.getText(), title),\n )\n .addOption(\n 'index',\n options.index,\n async (harness, index) => (await harness.getIndex()) === index,\n )\n .addOption(\n 'isSelected',\n options.isSelected,\n async (harness, isSelected) => (await harness.isSelected()) === isSelected,\n );\n }\n\n /** Gets the option's label text. */\n async getText(): Promise<string> {\n return (await this.host()).getProperty<string>('label');\n }\n\n /** Index of the option within the native `select` element. */\n async getIndex(): Promise<number> {\n return (await this.host()).getProperty<number>('index');\n }\n\n /** Gets whether the option is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('disabled');\n }\n\n /** Gets whether the option is selected. */\n async isSelected(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('selected');\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {MatFormFieldControlHarness} from '../../form-field/testing/control';\nimport {MatNativeOptionHarness} from './native-option-harness';\nimport {\n NativeOptionHarnessFilters,\n NativeSelectHarnessFilters,\n} from './native-select-harness-filters';\n\n/** Harness for interacting with a native `select` in tests. */\nexport class MatNativeSelectHarness extends MatFormFieldControlHarness {\n static hostSelector = 'select[matNativeControl]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatNativeSelectHarness` that meets\n * certain criteria.\n * @param options Options for filtering which select instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: NativeSelectHarnessFilters = {}): HarnessPredicate<MatNativeSelectHarness> {\n return new HarnessPredicate(MatNativeSelectHarness, options);\n }\n\n /** Gets a boolean promise indicating if the select is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('disabled');\n }\n\n /** Gets a boolean promise indicating if the select is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('required');\n }\n\n /** Gets a boolean promise indicating if the select is in multi-selection mode. */\n async isMultiple(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('multiple');\n }\n\n /** Gets the name of the select. */\n async getName(): Promise<string> {\n // The \"name\" property of the native select is never undefined.\n return await (await this.host()).getProperty<string>('name');\n }\n\n /** Gets the id of the select. */\n async getId(): Promise<string> {\n // We're guaranteed to have an id, because the `matNativeControl` always assigns one.\n return await (await this.host()).getProperty<string>('id');\n }\n\n /** Focuses the select and returns a void promise that indicates when the action is complete. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the select and returns a void promise that indicates when the action is complete. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the select is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Gets the options inside the select panel. */\n async getOptions(filter: NativeOptionHarnessFilters = {}): Promise<MatNativeOptionHarness[]> {\n return this.locatorForAll(MatNativeOptionHarness.with(filter))();\n }\n\n /**\n * Selects the options that match the passed-in filter. If the select is in multi-selection\n * mode all options will be clicked, otherwise the harness will pick the first matching option.\n */\n async selectOptions(filter: NativeOptionHarnessFilters = {}): Promise<void> {\n const [isMultiple, options] = await parallel(() => {\n return [this.isMultiple(), this.getOptions(filter)];\n });\n\n if (options.length === 0) {\n throw Error('Select does not have options matching the specified filter');\n }\n\n const [host, optionIndexes] = await parallel(() => [\n this.host(),\n parallel(() => options.slice(0, isMultiple ? undefined : 1).map(option => option.getIndex())),\n ]);\n\n await host.selectOptions(...optionIndexes);\n }\n}\n"],"names":[],"mappings":";;;;;AAWA;AACM,MAAO,sBAAuB,SAAQ,gBAAgB,CAAA;;AAE1D,IAAA,OAAO,YAAY,GAAG,iCAAiC;AAEvD;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAsC,EAAE,EAAA;AAClD,QAAA,OAAO,IAAI,gBAAgB,CAAC,sBAAsB,EAAE,OAAO;aACxD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,OAAO,EAAE,KAAK,KACpD,gBAAgB,CAAC,aAAa,CAAC,MAAM,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC;aAE/D,SAAS,CACR,OAAO,EACP,OAAO,CAAC,KAAK,EACb,OAAO,OAAO,EAAE,KAAK,KAAK,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,MAAM,KAAK;aAE/D,SAAS,CACR,YAAY,EACZ,OAAO,CAAC,UAAU,EAClB,OAAO,OAAO,EAAE,UAAU,KAAK,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,MAAM,UAAU,CAC3E;;;AAIL,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,WAAW,CAAS,OAAO,C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AC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE;;;AAIpC,IAAA,MAAM,IAAI,GAAA;QACR,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE;;;AAInC,IAAA,MAAM,SAAS,GAAA;QACb,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE;;;AAIxC,IAAA,MAAM,UAAU,CAAC,MAAA,GAAqC,EAAE,EAAA;AACtD,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;;AAGlE;;;AAGG;AACH,IAAA,MAAM,aAAa,CAAC,MAAA,GAAqC,EAAE,EAAA;QACzD,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,MAAM,QAAQ,CAAC,MAAK;AAChD,YAAA,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACrD,SAAC,CAAC;AAEF,QAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AACxB,YAAA,MAAM,KAAK,CAAC,4DAA4D,CAAC;;QAG3E,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,MAAM,QAAQ,CAAC,MAAM;YACjD,IAAI,CAAC,IAAI,EAAE;AACX,YAAA,QAAQ,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC9F,SAAA,CAAC;AAEF,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC;;;;;;"}
1
+ {"version":3,"file":"testing.mjs","sources":["../../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/material/input/testing/native-option-harness.ts","../../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/material/input/testing/native-select-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {NativeOptionHarnessFilters} from './native-select-harness-filters';\n\n/** Harness for interacting with a native `option` in tests. */\nexport class MatNativeOptionHarness extends ComponentHarness {\n /** Selector used to locate option instances. */\n static hostSelector = 'select[matNativeControl] option';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatNativeOptionHarness` that meets\n * certain criteria.\n * @param options Options for filtering which option instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: NativeOptionHarnessFilters = {}) {\n return new HarnessPredicate(MatNativeOptionHarness, options)\n .addOption('text', options.text, async (harness, title) =>\n HarnessPredicate.stringMatches(await harness.getText(), title),\n )\n .addOption(\n 'index',\n options.index,\n async (harness, index) => (await harness.getIndex()) === index,\n )\n .addOption(\n 'isSelected',\n options.isSelected,\n async (harness, isSelected) => (await harness.isSelected()) === isSelected,\n );\n }\n\n /** Gets the option's label text. */\n async getText(): Promise<string> {\n return (await this.host()).getProperty<string>('label');\n }\n\n /** Index of the option within the native `select` element. */\n async getIndex(): Promise<number> {\n return (await this.host()).getProperty<number>('index');\n }\n\n /** Gets whether the option is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('disabled');\n }\n\n /** Gets whether the option is selected. */\n async isSelected(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('selected');\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {MatFormFieldControlHarnessBase} from '../../form-field/testing/control';\nimport {MatNativeOptionHarness} from './native-option-harness';\nimport {\n NativeOptionHarnessFilters,\n NativeSelectHarnessFilters,\n} from './native-select-harness-filters';\n\n/** Harness for interacting with a native `select` in tests. */\nexport class MatNativeSelectHarness extends MatFormFieldControlHarnessBase {\n static hostSelector = 'select[matNativeControl]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatNativeSelectHarness` that meets\n * certain criteria.\n * @param options Options for filtering which select instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: NativeSelectHarnessFilters = {}): HarnessPredicate<MatNativeSelectHarness> {\n return new HarnessPredicate(MatNativeSelectHarness, options).addOption(\n 'label',\n options.label,\n (harness, label) => {\n return HarnessPredicate.stringMatches(harness.getLabel(), label);\n },\n );\n }\n\n /** Gets a boolean promise indicating if the select is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('disabled');\n }\n\n /** Gets a boolean promise indicating if the select is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('required');\n }\n\n /** Gets a boolean promise indicating if the select is in multi-selection mode. */\n async isMultiple(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('multiple');\n }\n\n /** Gets the name of the select. */\n async getName(): Promise<string> {\n // The \"name\" property of the native select is never undefined.\n return await (await this.host()).getProperty<string>('name');\n }\n\n /** Gets the id of the select. */\n async getId(): Promise<string> {\n // We're guaranteed to have an id, because the `matNativeControl` always assigns one.\n return await (await this.host()).getProperty<string>('id');\n }\n\n /** Focuses the select and returns a void promise that indicates when the action is complete. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the select and returns a void promise that indicates when the action is complete. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the select is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Gets the options inside the select panel. */\n async getOptions(filter: NativeOptionHarnessFilters = {}): Promise<MatNativeOptionHarness[]> {\n return this.locatorForAll(MatNativeOptionHarness.with(filter))();\n }\n\n /**\n * Selects the options that match the passed-in filter. If the select is in multi-selection\n * mode all options will be clicked, otherwise the harness will pick the first matching option.\n */\n async selectOptions(filter: NativeOptionHarnessFilters = {}): Promise<void> {\n const [isMultiple, options] = await parallel(() => {\n return [this.isMultiple(), this.getOptions(filter)];\n });\n\n if (options.length === 0) {\n throw Error('Select does not have options matching the specified filter');\n }\n\n const [host, optionIndexes] = await parallel(() => [\n this.host(),\n parallel(() => options.slice(0, isMultiple ? undefined : 1).map(option => option.getIndex())),\n ]);\n\n await host.selectOptions(...optionIndexes);\n }\n}\n"],"names":[],"mappings":";;;;;;AAWA;AACM,MAAO,sBAAuB,SAAQ,gBAAgB,CAAA;;AAE1D,IAAA,OAAO,YAAY,GAAG,iCAAiC;AAEvD;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAsC,EAAE,EAAA;AAClD,QAAA,OAAO,IAAI,gBAAgB,CAAC,sBAAsB,EAAE,OAAO;aACxD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,OAAO,EAAE,KAAK,KACpD,gBAAgB,CAAC,aAAa,CAAC,MAAM,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC;aAE/D,SAAS,CACR,OAAO,EACP,OAAO,CAAC,KAAK,EACb,OAAO,OAAO,EAAE,KAAK,KAAK,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,MAAM,KAAK;aAE/D,SAAS,CACR,YAAY,EACZ,OAAO,CAAC,UAAU,EAClB,OAAO,OAAO,EAAE,UAAU,KAAK,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,MAAM,UAAU,CAC3E;;;AAIL,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,WAAW,CAAS,OAAO,CAAC;;;AAIzD,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,WAAW,CAAS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ular/cdk/testing';
2
+ import { MatFormFieldControlHarnessBase } from '@angular/material/form-field/testing/control';
2
3
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
3
- import { MatFormFieldControlHarness } from './form-field/testing/control.mjs';
4
4
 
5
5
  /** Harness for interacting with a standard Material inputs in tests. */
6
- class MatInputHarness extends MatFormFieldControlHarness {
6
+ class MatInputHarness extends MatFormFieldControlHarnessBase {
7
7
  // TODO: We do not want to handle `select` elements with `matNativeControl` because
8
8
  // not all methods of this harness work reasonably for native select elements.
9
9
  // For more details. See: https://github.com/angular/components/pull/18221.
@@ -21,6 +21,9 @@ class MatInputHarness extends MatFormFieldControlHarness {
21
21
  })
22
22
  .addOption('placeholder', options.placeholder, (harness, placeholder) => {
23
23
  return HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder);
24
+ })
25
+ .addOption('label', options.label, (harness, label) => {
26
+ return HarnessPredicate.stringMatches(harness.getLabel(), label);
24
27
  });
25
28
  }
26
29
  /** Whether the input is disabled. */
@@ -112,4 +115,4 @@ class MatInputHarness extends MatFormFieldControlHarness {
112
115
  }
113
116
 
114
117
  export { MatInputHarness as M };
115
- //# sourceMappingURL=input-harness-oQzj5EsQ.mjs.map
118
+ //# sourceMappingURL=input-harness-C5Msdc4-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-harness-C5Msdc4-.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/material/input/testing/input-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {MatFormFieldControlHarnessBase} from '@angular/material/form-field/testing/control';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {InputHarnessFilters} from './input-harness-filters';\n\n/** Harness for interacting with a standard Material inputs in tests. */\nexport class MatInputHarness extends MatFormFieldControlHarnessBase {\n // TODO: We do not want to handle `select` elements with `matNativeControl` because\n // not all methods of this harness work reasonably for native select elements.\n // For more details. See: https://github.com/angular/components/pull/18221.\n static hostSelector = '[matInput], input[matNativeControl], textarea[matNativeControl]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatInputHarness` that meets\n * certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: InputHarnessFilters = {}): HarnessPredicate<MatInputHarness> {\n return new HarnessPredicate(MatInputHarness, options)\n .addOption('value', options.value, (harness, value) => {\n return HarnessPredicate.stringMatches(harness.getValue(), value);\n })\n .addOption('placeholder', options.placeholder, (harness, placeholder) => {\n return HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder);\n })\n .addOption('label', options.label, (harness, label) => {\n return HarnessPredicate.stringMatches(harness.getLabel(), label);\n });\n }\n\n /** Whether the input is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n const disabled = await host.getAttribute('disabled');\n\n if (disabled !== null) {\n return coerceBooleanProperty(disabled);\n }\n\n return (await host.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the input is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('required');\n }\n\n /** Whether the input is readonly. */\n async isReadonly(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('readOnly');\n }\n\n /** Gets the value of the input. */\n async getValue(): Promise<string> {\n // The \"value\" property of the native input is never undefined.\n return await (await this.host()).getProperty<string>('value');\n }\n\n /** Gets the name of the input. */\n async getName(): Promise<string> {\n // The \"name\" property of the native input is never undefined.\n return await (await this.host()).getProperty<string>('name');\n }\n\n /**\n * Gets the type of the input. Returns \"textarea\" if the input is\n * a textarea.\n */\n async getType(): Promise<string> {\n // The \"type\" property of the native input is never undefined.\n return await (await this.host()).getProperty<string>('type');\n }\n\n /** Gets the placeholder of the input. */\n async getPlaceholder(): Promise<string> {\n const host = await this.host();\n const [nativePlaceholder, fallback] = await parallel(() => [\n host.getProperty('placeholder'),\n host.getAttribute('data-placeholder'),\n ]);\n return nativePlaceholder || fallback || '';\n }\n\n /** Gets the id of the input. */\n async getId(): Promise<string> {\n // The input directive always assigns a unique id to the input in\n // case no id has been explicitly specified.\n return await (await this.host()).getProperty<string>('id');\n }\n\n /**\n * Focuses the input and returns a promise that indicates when the\n * action is complete.\n */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /**\n * Blurs the input and returns a promise that indicates when the\n * action is complete.\n */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the input is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * Sets the value of the input. The value will be set by simulating\n * keypresses that correspond to the given value.\n */\n async setValue(newValue: string): Promise<void> {\n const inputEl = await this.host();\n await inputEl.clear();\n // We don't want to send keys for the value if the value is an empty\n // string in order to clear the value. Sending keys with an empty string\n // still results in unnecessary focus events.\n if (newValue) {\n await inputEl.sendKeys(newValue);\n }\n\n // Some input types won't respond to key presses (e.g. `color`) so to be sure that the\n // value is set, we also set the property after the keyboard sequence. Note that we don't\n // want to do it before, because it can cause the value to be entered twice.\n await inputEl.setInputValue(newValue);\n }\n}\n"],"names":[],"mappings":";;;;AAaA;AACM,MAAO,eAAgB,SAAQ,8BAA8B,CAAA;;;;AAIjE,IAAA,OAAO,YAAY,GAAG,iEAAiE;AAEvF;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAA+B,EAAE,EAAA;AAC3C,QAAA,OAAO,IAAI,gBAAgB,CAAC,eAAe,EAAE,OAAO;AACjD,aAAA,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,KAAI;YACpD,OAAO,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC;AAClE,SAAC;AACA,aAAA,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,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() {
844
+ // Auto focus by default
845
+ this._openMenu(true);
846
+ }
847
+ /** Internal method to open menu providing option to auto focus on first item. */
848
+ _openMenu(autoFocus) {
844
849
  const menu = this.menu;
845
850
  if (this._menuOpen || !menu) {
846
851
  return;
@@ -868,7 +873,8 @@ class MatMenuTrigger {
868
873
  this._closingActionsSubscription = this._menuClosingActions().subscribe(() => this.closeMenu());
869
874
  menu.parentMenu = this.triggersSubmenu() ? this._parentMaterialMenu : undefined;
870
875
  menu.direction = this.dir;
871
- menu.focusFirstItem(this._openedBy || 'program');
876
+ if (autoFocus)
877
+ menu.focusFirstItem(this._openedBy || 'program');
872
878
  this._setIsMenuOpen(true);
873
879
  if (menu instanceof MatMenu) {
874
880
  menu._setIsOpen(true);
@@ -1103,7 +1109,10 @@ class MatMenuTrigger {
1103
1109
  this._hoverSubscription = this._parentMaterialMenu._hovered().subscribe(active => {
1104
1110
  if (active === this._menuItemInstance && !active.disabled) {
1105
1111
  this._openedBy = 'mouse';
1106
- this.openMenu();
1112
+ // Open the menu, but do NOT auto-focus on first item when just hovering.
1113
+ // When VoiceOver is enabled, this is particularly confusing as the focus will
1114
+ // cause another hover event, and continue opening sub-menus without interaction.
1115
+ this._openMenu(false);
1107
1116
  }
1108
1117
  });
1109
1118
  }