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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +810 -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
@@ -1 +1 @@
1
- {"version":3,"file":"sort.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort-errors.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort-header-intl.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort-header.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort-header.html","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort-module.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\n/** @docs-private */\nexport function getSortDuplicateSortableIdError(id: string): Error {\n return Error(`Cannot have two MatSortables with the same id (${id}).`);\n}\n\n/** @docs-private */\nexport function getSortHeaderNotContainedWithinSortError(): Error {\n return Error(`MatSortHeader must be placed within a parent element with the MatSort directive.`);\n}\n\n/** @docs-private */\nexport function getSortHeaderMissingIdError(): Error {\n return Error(`MatSortHeader must be provided with a unique id.`);\n}\n\n/** @docs-private */\nexport function getSortInvalidDirectionError(direction: string): Error {\n return Error(`${direction} is not a valid sort direction ('asc' or 'desc').`);\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 {\n Directive,\n EventEmitter,\n Inject,\n InjectionToken,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n booleanAttribute,\n} from '@angular/core';\nimport {Observable, ReplaySubject, Subject} from 'rxjs';\nimport {SortDirection} from './sort-direction';\nimport {\n getSortDuplicateSortableIdError,\n getSortHeaderMissingIdError,\n getSortInvalidDirectionError,\n} from './sort-errors';\n\n/** Position of the arrow that displays when sorted. */\nexport type SortHeaderArrowPosition = 'before' | 'after';\n\n/** Interface for a directive that holds sorting state consumed by `MatSortHeader`. */\nexport interface MatSortable {\n /** The id of the column being sorted. */\n id: string;\n\n /** Starting sort direction. */\n start: SortDirection;\n\n /** Whether to disable clearing the sorting state. */\n disableClear: boolean;\n}\n\n/** The current sort state. */\nexport interface Sort {\n /** The id of the column being sorted. */\n active: string;\n\n /** The sort direction. */\n direction: SortDirection;\n}\n\n/** Default options for `mat-sort`. */\nexport interface MatSortDefaultOptions {\n /** Whether to disable clearing the sorting state. */\n disableClear?: boolean;\n /** Position of the arrow that displays when sorted. */\n arrowPosition?: SortHeaderArrowPosition;\n}\n\n/** Injection token to be used to override the default options for `mat-sort`. */\nexport const MAT_SORT_DEFAULT_OPTIONS = new InjectionToken<MatSortDefaultOptions>(\n 'MAT_SORT_DEFAULT_OPTIONS',\n);\n\n/** Container for MatSortables to manage the sort state and provide default sort parameters. */\n@Directive({\n selector: '[matSort]',\n exportAs: 'matSort',\n host: {\n 'class': 'mat-sort',\n },\n})\nexport class MatSort implements OnChanges, OnDestroy, OnInit {\n private _initializedStream = new ReplaySubject<void>(1);\n\n /** Collection of all registered sortables that this directive manages. */\n sortables = new Map<string, MatSortable>();\n\n /** Used to notify any child components listening to state changes. */\n readonly _stateChanges = new Subject<void>();\n\n /** The id of the most recently sorted MatSortable. */\n @Input('matSortActive') active: string;\n\n /**\n * The direction to set when an MatSortable is initially sorted.\n * May be overridden by the MatSortable's sort start.\n */\n @Input('matSortStart') start: SortDirection = 'asc';\n\n /** The sort direction of the currently active MatSortable. */\n @Input('matSortDirection')\n get direction(): SortDirection {\n return this._direction;\n }\n set direction(direction: SortDirection) {\n if (\n direction &&\n direction !== 'asc' &&\n direction !== 'desc' &&\n (typeof ngDevMode === 'undefined' || ngDevMode)\n ) {\n throw getSortInvalidDirectionError(direction);\n }\n this._direction = direction;\n }\n private _direction: SortDirection = '';\n\n /**\n * Whether to disable the user from clearing the sort by finishing the sort direction cycle.\n * May be overridden by the MatSortable's disable clear input.\n */\n @Input({alias: 'matSortDisableClear', transform: booleanAttribute})\n disableClear: boolean;\n\n /** Whether the sortable is disabled. */\n @Input({alias: 'matSortDisabled', transform: booleanAttribute})\n disabled: boolean = false;\n\n /** Event emitted when the user changes either the active sort or sort direction. */\n @Output('matSortChange') readonly sortChange: EventEmitter<Sort> = new EventEmitter<Sort>();\n\n /** Emits when the paginator is initialized. */\n initialized: Observable<void> = this._initializedStream;\n\n constructor(\n @Optional()\n @Inject(MAT_SORT_DEFAULT_OPTIONS)\n private _defaultOptions?: MatSortDefaultOptions,\n ) {}\n\n /**\n * Register function to be used by the contained MatSortables. Adds the MatSortable to the\n * collection of MatSortables.\n */\n register(sortable: MatSortable): void {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!sortable.id) {\n throw getSortHeaderMissingIdError();\n }\n\n if (this.sortables.has(sortable.id)) {\n throw getSortDuplicateSortableIdError(sortable.id);\n }\n }\n\n this.sortables.set(sortable.id, sortable);\n }\n\n /**\n * Unregister function to be used by the contained MatSortables. Removes the MatSortable from the\n * collection of contained MatSortables.\n */\n deregister(sortable: MatSortable): void {\n this.sortables.delete(sortable.id);\n }\n\n /** Sets the active sort id and determines the new sort direction. */\n sort(sortable: MatSortable): void {\n if (this.active != sortable.id) {\n this.active = sortable.id;\n this.direction = sortable.start ? sortable.start : this.start;\n } else {\n this.direction = this.getNextSortDirection(sortable);\n }\n\n this.sortChange.emit({active: this.active, direction: this.direction});\n }\n\n /** Returns the next sort direction of the active sortable, checking for potential overrides. */\n getNextSortDirection(sortable: MatSortable): SortDirection {\n if (!sortable) {\n return '';\n }\n\n // Get the sort direction cycle with the potential sortable overrides.\n const disableClear =\n sortable?.disableClear ?? this.disableClear ?? !!this._defaultOptions?.disableClear;\n let sortDirectionCycle = getSortDirectionCycle(sortable.start || this.start, disableClear);\n\n // Get and return the next direction in the cycle\n let nextDirectionIndex = sortDirectionCycle.indexOf(this.direction) + 1;\n if (nextDirectionIndex >= sortDirectionCycle.length) {\n nextDirectionIndex = 0;\n }\n return sortDirectionCycle[nextDirectionIndex];\n }\n\n ngOnInit() {\n this._initializedStream.next();\n }\n\n ngOnChanges() {\n this._stateChanges.next();\n }\n\n ngOnDestroy() {\n this._stateChanges.complete();\n this._initializedStream.complete();\n }\n}\n\n/** Returns the sort direction cycle to use given the provided parameters of order and clear. */\nfunction getSortDirectionCycle(start: SortDirection, disableClear: boolean): SortDirection[] {\n let sortOrder: SortDirection[] = ['asc', 'desc'];\n if (start == 'desc') {\n sortOrder.reverse();\n }\n if (!disableClear) {\n sortOrder.push('');\n }\n\n return sortOrder;\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 {Injectable} from '@angular/core';\nimport {Subject} from 'rxjs';\n\n/**\n * To modify the labels and text displayed, create a new instance of MatSortHeaderIntl and\n * include it in a custom provider.\n */\n@Injectable({providedIn: 'root'})\nexport class MatSortHeaderIntl {\n /**\n * Stream that emits whenever the labels here are changed. Use this to notify\n * components if the labels have changed after initialization.\n */\n readonly changes: Subject<void> = new Subject<void>();\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 {AriaDescriber, FocusMonitor} from '@angular/cdk/a11y';\nimport {ENTER, SPACE} from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n OnDestroy,\n OnInit,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n signal,\n ChangeDetectorRef,\n} from '@angular/core';\nimport {merge, Subscription} from 'rxjs';\nimport {\n MAT_SORT_DEFAULT_OPTIONS,\n MatSort,\n MatSortable,\n MatSortDefaultOptions,\n SortHeaderArrowPosition,\n} from './sort';\nimport {SortDirection} from './sort-direction';\nimport {getSortHeaderNotContainedWithinSortError} from './sort-errors';\nimport {MatSortHeaderIntl} from './sort-header-intl';\nimport {_CdkPrivateStyleLoader} from '@angular/cdk/private';\nimport {_animationsDisabled, _StructuralStylesLoader} from '../core';\n\n/**\n * Valid positions for the arrow to be in for its opacity and translation. If the state is a\n * sort direction, the position of the arrow will be above/below and opacity 0. If the state is\n * hint, the arrow will be in the center with a slight opacity. Active state means the arrow will\n * be fully opaque in the center.\n *\n * @docs-private\n * @deprecated No longer being used, to be removed.\n * @breaking-change 21.0.0\n */\nexport type ArrowViewState = SortDirection | 'hint' | 'active';\n\n/**\n * States describing the arrow's animated position (animating fromState to toState).\n * If the fromState is not defined, there will be no animated transition to the toState.\n * @docs-private\n * @deprecated No longer being used, to be removed.\n * @breaking-change 21.0.0\n */\nexport interface ArrowViewStateTransition {\n fromState?: ArrowViewState;\n toState?: ArrowViewState;\n}\n\n/** Column definition associated with a `MatSortHeader`. */\ninterface MatSortHeaderColumnDef {\n name: string;\n}\n\n/**\n * Applies sorting behavior (click to change sort) and styles to an element, including an\n * arrow to display the current sort direction.\n *\n * Must be provided with an id and contained within a parent MatSort directive.\n *\n * If used on header cells in a CdkTable, it will automatically default its id from its containing\n * column definition.\n */\n@Component({\n selector: '[mat-sort-header]',\n exportAs: 'matSortHeader',\n templateUrl: 'sort-header.html',\n styleUrl: 'sort-header.css',\n host: {\n 'class': 'mat-sort-header',\n '(click)': '_toggleOnInteraction()',\n '(keydown)': '_handleKeydown($event)',\n '(mouseleave)': '_recentlyCleared.set(null)',\n '[attr.aria-sort]': '_getAriaSortAttribute()',\n '[class.mat-sort-header-disabled]': '_isDisabled()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatSortHeader implements MatSortable, OnDestroy, OnInit, AfterViewInit {\n _intl = inject(MatSortHeaderIntl);\n _sort = inject(MatSort, {optional: true})!;\n _columnDef = inject<MatSortHeaderColumnDef>('MAT_SORT_HEADER_COLUMN_DEF' as any, {\n optional: true,\n });\n private _changeDetectorRef = inject(ChangeDetectorRef);\n private _focusMonitor = inject(FocusMonitor);\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private _ariaDescriber = inject(AriaDescriber, {optional: true});\n private _renderChanges: Subscription | undefined;\n protected _animationsDisabled = _animationsDisabled();\n\n /**\n * Indicates which state was just cleared from the sort header.\n * Will be reset on the next interaction. Used for coordinating animations.\n */\n protected _recentlyCleared = signal<SortDirection | null>(null);\n\n /**\n * The element with role=\"button\" inside this component's view. We need this\n * in order to apply a description with AriaDescriber.\n */\n private _sortButton: HTMLElement;\n\n /**\n * ID of this sort header. If used within the context of a CdkColumnDef, this will default to\n * the column's name.\n */\n @Input('mat-sort-header') id: string;\n\n /** Sets the position of the arrow that displays when sorted. */\n @Input() arrowPosition: SortHeaderArrowPosition = 'after';\n\n /** Overrides the sort start value of the containing MatSort for this MatSortable. */\n @Input() start: SortDirection;\n\n /** whether the sort header is disabled. */\n @Input({transform: booleanAttribute})\n disabled: boolean = false;\n\n /**\n * Description applied to MatSortHeader's button element with aria-describedby. This text should\n * describe the action that will occur when the user clicks the sort header.\n */\n @Input()\n get sortActionDescription(): string {\n return this._sortActionDescription;\n }\n set sortActionDescription(value: string) {\n this._updateSortActionDescription(value);\n }\n // Default the action description to \"Sort\" because it's better than nothing.\n // Without a description, the button's label comes from the sort header text content,\n // which doesn't give any indication that it performs a sorting operation.\n private _sortActionDescription: string = 'Sort';\n\n /** Overrides the disable clear value of the containing MatSort for this MatSortable. */\n @Input({transform: booleanAttribute})\n disableClear: boolean;\n\n constructor(...args: unknown[]);\n\n constructor() {\n inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);\n const defaultOptions = inject<MatSortDefaultOptions>(MAT_SORT_DEFAULT_OPTIONS, {\n optional: true,\n });\n\n // Note that we use a string token for the `_columnDef`, because the value is provided both by\n // `material/table` and `cdk/table` and we can't have the CDK depending on Material,\n // and we want to avoid having the sort header depending on the CDK table because\n // of this single reference.\n if (!this._sort && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getSortHeaderNotContainedWithinSortError();\n }\n\n if (defaultOptions?.arrowPosition) {\n this.arrowPosition = defaultOptions?.arrowPosition;\n }\n }\n\n ngOnInit() {\n if (!this.id && this._columnDef) {\n this.id = this._columnDef.name;\n }\n\n this._sort.register(this);\n this._renderChanges = merge(this._sort._stateChanges, this._sort.sortChange).subscribe(() =>\n this._changeDetectorRef.markForCheck(),\n );\n this._sortButton = this._elementRef.nativeElement.querySelector('.mat-sort-header-container')!;\n this._updateSortActionDescription(this._sortActionDescription);\n }\n\n ngAfterViewInit() {\n // We use the focus monitor because we also want to style\n // things differently based on the focus origin.\n this._focusMonitor.monitor(this._elementRef, true).subscribe(() => {\n // We need the delay here, because we can trigger a signal write error if the header\n // has a signal bound to `disabled` which causes it to be blurred (see #31723.)\n Promise.resolve().then(() => this._recentlyCleared.set(null));\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._sort.deregister(this);\n this._renderChanges?.unsubscribe();\n\n if (this._sortButton) {\n this._ariaDescriber?.removeDescription(this._sortButton, this._sortActionDescription);\n }\n }\n\n /** Triggers the sort on this sort header and removes the indicator hint. */\n _toggleOnInteraction() {\n if (!this._isDisabled()) {\n const wasSorted = this._isSorted();\n const prevDirection = this._sort.direction;\n this._sort.sort(this);\n this._recentlyCleared.set(wasSorted && !this._isSorted() ? prevDirection : null);\n }\n }\n\n _handleKeydown(event: KeyboardEvent) {\n if (event.keyCode === SPACE || event.keyCode === ENTER) {\n event.preventDefault();\n this._toggleOnInteraction();\n }\n }\n\n /** Whether this MatSortHeader is currently sorted in either ascending or descending order. */\n _isSorted() {\n return (\n this._sort.active == this.id &&\n (this._sort.direction === 'asc' || this._sort.direction === 'desc')\n );\n }\n\n _isDisabled() {\n return this._sort.disabled || this.disabled;\n }\n\n /**\n * Gets the aria-sort attribute that should be applied to this sort header. If this header\n * is not sorted, returns null so that the attribute is removed from the host element. Aria spec\n * says that the aria-sort property should only be present on one header at a time, so removing\n * ensures this is true.\n */\n _getAriaSortAttribute() {\n if (!this._isSorted()) {\n return 'none';\n }\n\n return this._sort.direction == 'asc' ? 'ascending' : 'descending';\n }\n\n /** Whether the arrow inside the sort header should be rendered. */\n _renderArrow() {\n return !this._isDisabled() || this._isSorted();\n }\n\n private _updateSortActionDescription(newDescription: string) {\n // We use AriaDescriber for the sort button instead of setting an `aria-label` because some\n // screen readers (notably VoiceOver) will read both the column header *and* the button's label\n // for every *cell* in the table, creating a lot of unnecessary noise.\n\n // If _sortButton is undefined, the component hasn't been initialized yet so there's\n // nothing to update in the DOM.\n if (this._sortButton) {\n // removeDescription will no-op if there is no existing message.\n // TODO(jelbourn): remove optional chaining when AriaDescriber is required.\n this._ariaDescriber?.removeDescription(this._sortButton, this._sortActionDescription);\n this._ariaDescriber?.describe(this._sortButton, newDescription);\n }\n\n this._sortActionDescription = newDescription;\n }\n}\n","<!--\n We set the `tabindex` on an element inside the table header, rather than the header itself,\n because of a bug in NVDA where having a `tabindex` on a `th` breaks keyboard navigation in the\n table (see https://github.com/nvaccess/nvda/issues/7718). This allows for the header to both\n be focusable, and have screen readers read out its `aria-sort` state. We prefer this approach\n over having a button with an `aria-label` inside the header, because the button's `aria-label`\n will be read out as the user is navigating the table's cell (see #13012).\n\n The approach is based off of: https://dequeuniversity.com/library/aria/tables/sf-sortable-grid\n-->\n<div class=\"mat-sort-header-container mat-focus-indicator\"\n [class.mat-sort-header-sorted]=\"_isSorted()\"\n [class.mat-sort-header-position-before]=\"arrowPosition === 'before'\"\n [class.mat-sort-header-descending]=\"_sort.direction === 'desc'\"\n [class.mat-sort-header-ascending]=\"_sort.direction === 'asc'\"\n [class.mat-sort-header-recently-cleared-ascending]=\"_recentlyCleared() === 'asc'\"\n [class.mat-sort-header-recently-cleared-descending]=\"_recentlyCleared() === 'desc'\"\n [class.mat-sort-header-animations-disabled]=\"_animationsDisabled\"\n [attr.tabindex]=\"_isDisabled() ? null : 0\"\n [attr.role]=\"_isDisabled() ? null : 'button'\">\n\n <!--\n TODO(crisbeto): this div isn't strictly necessary, but we have to keep it due to a large\n number of screenshot diff failures. It should be removed eventually. Note that the difference\n isn't visible with a shorter header, but once it breaks up into multiple lines, this element\n causes it to be center-aligned, whereas removing it will keep the text to the left.\n -->\n <div class=\"mat-sort-header-content\">\n <ng-content></ng-content>\n </div>\n\n <!-- Disable animations while a current animation is running -->\n @if (_renderArrow()) {\n <div class=\"mat-sort-header-arrow\">\n <ng-content select=\"[matSortHeaderIcon]\">\n <svg viewBox=\"0 -960 960 960\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z\"/>\n </svg>\n </ng-content>\n </div>\n }\n</div>\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 {BidiModule} from '@angular/cdk/bidi';\nimport {NgModule} from '@angular/core';\nimport {MatSortHeader} from './sort-header';\nimport {MatSort} from './sort';\n\n@NgModule({\n imports: [MatSort, MatSortHeader],\n exports: [MatSort, MatSortHeader, BidiModule],\n})\nexport class MatSortModule {}\n"],"names":[],"mappings":";;;;;;;;;;;AAQA;AACM,SAAU,+BAA+B,CAAC,EAAU,EAAA;AACxD,IAAA,OAAO,KAAK,CAAC,CAAA,+CAAA,EAAkD,EAAE,CAAA,EAAA,CAAI,CAAC;AACxE;AAEA;SACgB,wCAAwC,GAAA;AACtD,IAAA,OAAO,KAAK,CAAC,CAAkF,gFAAA,CAAA,CAAC;AAClG;AAEA;SACgB,2BAA2B,GAAA;AACzC,IAAA,OAAO,KAAK,CAAC,CAAkD,gDAAA,CAAA,CAAC;AAClE;AAEA;AACM,SAAU,4BAA4B,CAAC,SAAiB,EAAA;AAC5D,IAAA,OAAO,KAAK,CAAC,CAAA,EAAG,SAAS,CAAA,iDAAA,CAAmD,CAAC;AAC/E;;ACmCA;MACa,wBAAwB,GAAG,IAAI,cAAc,CACxD,0BAA0B;AAG5B;MAQa,OAAO,CAAA;AAwDR,IAAA,eAAA;AAvDF,IAAA,kBAAkB,GAAG,IAAI,aAAa,CAAO,CAAC,CAAC;;AAGvD,IAAA,SAAS,GAAG,IAAI,GAAG,EAAuB;;AAGjC,IAAA,aAAa,GAAG,IAAI,OAAO,EAAQ;;AAGpB,IAAA,MAAM;AAE9B;;;AAGG;IACoB,KAAK,GAAkB,KAAK;;AAGnD,IAAA,IACI,SAAS,GAAA;QACX,OAAO,IAAI,CAAC,UAAU;;IAExB,IAAI,SAAS,CAAC,SAAwB,EAAA;AACpC,QAAA,IACE,SAAS;AACT,YAAA,SAAS,KAAK,KAAK;AACnB,YAAA,SAAS,KAAK,MAAM;aACnB,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,EAC/C;AACA,YAAA,MAAM,4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CAAA;sBAAb;gBAID,QAAQ,EAAA,CAAA;sBADP,KAAK;uBAAC,EAAC,SAAS,EAAE,gBAAgB,EAAC;gBAQhC,qBAAqB,EAAA,CAAA;sBADxB;gBAcD,YAAY,EAAA,CAAA;sBADX,KAAK;uBAAC,EAAC,SAAS,EAAE,gBAAgB,EAAC;;;MErIzB,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;+GAAb,aAAa,EAAA,OAAA,EAAA,CAHd,OAAO,EAAE,aAAa,aACtB,OAAO,EAAE,aAAa,EAAE,UAAU,CAAA,EAAA,CAAA;AAEjC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAFU,UAAU,CAAA,EAAA,CAAA;;kGAEjC,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC;AACjC,oBAAA,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,UAAU,CAAC;AAC9C,iBAAA;;;;;"}
1
+ {"version":3,"file":"sort.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort-errors.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort-header-intl.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort-header.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/sort/sort-module.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\n/** @docs-private */\nexport function getSortDuplicateSortableIdError(id: string): Error {\n return Error(`Cannot have two MatSortables with the same id (${id}).`);\n}\n\n/** @docs-private */\nexport function getSortHeaderNotContainedWithinSortError(): Error {\n return Error(`MatSortHeader must be placed within a parent element with the MatSort directive.`);\n}\n\n/** @docs-private */\nexport function getSortHeaderMissingIdError(): Error {\n return Error(`MatSortHeader must be provided with a unique id.`);\n}\n\n/** @docs-private */\nexport function getSortInvalidDirectionError(direction: string): Error {\n return Error(`${direction} is not a valid sort direction ('asc' or 'desc').`);\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 {\n Directive,\n EventEmitter,\n Inject,\n InjectionToken,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n booleanAttribute,\n} from '@angular/core';\nimport {Observable, ReplaySubject, Subject} from 'rxjs';\nimport {SortDirection} from './sort-direction';\nimport {\n getSortDuplicateSortableIdError,\n getSortHeaderMissingIdError,\n getSortInvalidDirectionError,\n} from './sort-errors';\n\n/** Position of the arrow that displays when sorted. */\nexport type SortHeaderArrowPosition = 'before' | 'after';\n\n/** Interface for a directive that holds sorting state consumed by `MatSortHeader`. */\nexport interface MatSortable {\n /** The id of the column being sorted. */\n id: string;\n\n /** Starting sort direction. */\n start: SortDirection;\n\n /** Whether to disable clearing the sorting state. */\n disableClear: boolean;\n}\n\n/** The current sort state. */\nexport interface Sort {\n /** The id of the column being sorted. */\n active: string;\n\n /** The sort direction. */\n direction: SortDirection;\n}\n\n/** Default options for `mat-sort`. */\nexport interface MatSortDefaultOptions {\n /** Whether to disable clearing the sorting state. */\n disableClear?: boolean;\n /** Position of the arrow that displays when sorted. */\n arrowPosition?: SortHeaderArrowPosition;\n}\n\n/** Injection token to be used to override the default options for `mat-sort`. */\nexport const MAT_SORT_DEFAULT_OPTIONS = new InjectionToken<MatSortDefaultOptions>(\n 'MAT_SORT_DEFAULT_OPTIONS',\n);\n\n/** Container for MatSortables to manage the sort state and provide default sort parameters. */\n@Directive({\n selector: '[matSort]',\n exportAs: 'matSort',\n host: {\n 'class': 'mat-sort',\n },\n})\nexport class MatSort implements OnChanges, OnDestroy, OnInit {\n private _initializedStream = new ReplaySubject<void>(1);\n\n /** Collection of all registered sortables that this directive manages. */\n sortables = new Map<string, MatSortable>();\n\n /** Used to notify any child components listening to state changes. */\n readonly _stateChanges = new Subject<void>();\n\n /** The id of the most recently sorted MatSortable. */\n @Input('matSortActive') active: string;\n\n /**\n * The direction to set when an MatSortable is initially sorted.\n * May be overridden by the MatSortable's sort start.\n */\n @Input('matSortStart') start: SortDirection = 'asc';\n\n /** The sort direction of the currently active MatSortable. */\n @Input('matSortDirection')\n get direction(): SortDirection {\n return this._direction;\n }\n set direction(direction: SortDirection) {\n if (\n direction &&\n direction !== 'asc' &&\n direction !== 'desc' &&\n (typeof ngDevMode === 'undefined' || ngDevMode)\n ) {\n throw getSortInvalidDirectionError(direction);\n }\n this._direction = direction;\n }\n private _direction: SortDirection = '';\n\n /**\n * Whether to disable the user from clearing the sort by finishing the sort direction cycle.\n * May be overridden by the MatSortable's disable clear input.\n */\n @Input({alias: 'matSortDisableClear', transform: booleanAttribute})\n disableClear: boolean;\n\n /** Whether the sortable is disabled. */\n @Input({alias: 'matSortDisabled', transform: booleanAttribute})\n disabled: boolean = false;\n\n /** Event emitted when the user changes either the active sort or sort direction. */\n @Output('matSortChange') readonly sortChange: EventEmitter<Sort> = new EventEmitter<Sort>();\n\n /** Emits when the paginator is initialized. */\n initialized: Observable<void> = this._initializedStream;\n\n constructor(\n @Optional()\n @Inject(MAT_SORT_DEFAULT_OPTIONS)\n private _defaultOptions?: MatSortDefaultOptions,\n ) {}\n\n /**\n * Register function to be used by the contained MatSortables. Adds the MatSortable to the\n * collection of MatSortables.\n */\n register(sortable: MatSortable): void {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!sortable.id) {\n throw getSortHeaderMissingIdError();\n }\n\n if (this.sortables.has(sortable.id)) {\n throw getSortDuplicateSortableIdError(sortable.id);\n }\n }\n\n this.sortables.set(sortable.id, sortable);\n }\n\n /**\n * Unregister function to be used by the contained MatSortables. Removes the MatSortable from the\n * collection of contained MatSortables.\n */\n deregister(sortable: MatSortable): void {\n this.sortables.delete(sortable.id);\n }\n\n /** Sets the active sort id and determines the new sort direction. */\n sort(sortable: MatSortable): void {\n if (this.active != sortable.id) {\n this.active = sortable.id;\n this.direction = sortable.start ? sortable.start : this.start;\n } else {\n this.direction = this.getNextSortDirection(sortable);\n }\n\n this.sortChange.emit({active: this.active, direction: this.direction});\n }\n\n /** Returns the next sort direction of the active sortable, checking for potential overrides. */\n getNextSortDirection(sortable: MatSortable): SortDirection {\n if (!sortable) {\n return '';\n }\n\n // Get the sort direction cycle with the potential sortable overrides.\n const disableClear =\n sortable?.disableClear ?? this.disableClear ?? !!this._defaultOptions?.disableClear;\n let sortDirectionCycle = getSortDirectionCycle(sortable.start || this.start, disableClear);\n\n // Get and return the next direction in the cycle\n let nextDirectionIndex = sortDirectionCycle.indexOf(this.direction) + 1;\n if (nextDirectionIndex >= sortDirectionCycle.length) {\n nextDirectionIndex = 0;\n }\n return sortDirectionCycle[nextDirectionIndex];\n }\n\n ngOnInit() {\n this._initializedStream.next();\n }\n\n ngOnChanges() {\n this._stateChanges.next();\n }\n\n ngOnDestroy() {\n this._stateChanges.complete();\n this._initializedStream.complete();\n }\n}\n\n/** Returns the sort direction cycle to use given the provided parameters of order and clear. */\nfunction getSortDirectionCycle(start: SortDirection, disableClear: boolean): SortDirection[] {\n let sortOrder: SortDirection[] = ['asc', 'desc'];\n if (start == 'desc') {\n sortOrder.reverse();\n }\n if (!disableClear) {\n sortOrder.push('');\n }\n\n return sortOrder;\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 {Injectable} from '@angular/core';\nimport {Subject} from 'rxjs';\n\n/**\n * To modify the labels and text displayed, create a new instance of MatSortHeaderIntl and\n * include it in a custom provider.\n */\n@Injectable({providedIn: 'root'})\nexport class MatSortHeaderIntl {\n /**\n * Stream that emits whenever the labels here are changed. Use this to notify\n * components if the labels have changed after initialization.\n */\n readonly changes: Subject<void> = new Subject<void>();\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 {AriaDescriber, FocusMonitor} from '@angular/cdk/a11y';\nimport {ENTER, SPACE} from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n OnDestroy,\n OnInit,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n signal,\n ChangeDetectorRef,\n} from '@angular/core';\nimport {merge, Subscription} from 'rxjs';\nimport {\n MAT_SORT_DEFAULT_OPTIONS,\n MatSort,\n MatSortable,\n MatSortDefaultOptions,\n SortHeaderArrowPosition,\n} from './sort';\nimport {SortDirection} from './sort-direction';\nimport {getSortHeaderNotContainedWithinSortError} from './sort-errors';\nimport {MatSortHeaderIntl} from './sort-header-intl';\nimport {_CdkPrivateStyleLoader} from '@angular/cdk/private';\nimport {_animationsDisabled, _StructuralStylesLoader} from '../core';\n\n/**\n * Valid positions for the arrow to be in for its opacity and translation. If the state is a\n * sort direction, the position of the arrow will be above/below and opacity 0. If the state is\n * hint, the arrow will be in the center with a slight opacity. Active state means the arrow will\n * be fully opaque in the center.\n *\n * @docs-private\n * @deprecated No longer being used, to be removed.\n * @breaking-change 21.0.0\n */\nexport type ArrowViewState = SortDirection | 'hint' | 'active';\n\n/**\n * States describing the arrow's animated position (animating fromState to toState).\n * If the fromState is not defined, there will be no animated transition to the toState.\n * @docs-private\n * @deprecated No longer being used, to be removed.\n * @breaking-change 21.0.0\n */\nexport interface ArrowViewStateTransition {\n fromState?: ArrowViewState;\n toState?: ArrowViewState;\n}\n\n/** Column definition associated with a `MatSortHeader`. */\ninterface MatSortHeaderColumnDef {\n name: string;\n}\n\n/**\n * Applies sorting behavior (click to change sort) and styles to an element, including an\n * arrow to display the current sort direction.\n *\n * Must be provided with an id and contained within a parent MatSort directive.\n *\n * If used on header cells in a CdkTable, it will automatically default its id from its containing\n * column definition.\n */\n@Component({\n selector: '[mat-sort-header]',\n exportAs: 'matSortHeader',\n templateUrl: 'sort-header.html',\n styleUrl: 'sort-header.css',\n host: {\n 'class': 'mat-sort-header',\n '(click)': '_toggleOnInteraction()',\n '(keydown)': '_handleKeydown($event)',\n '(mouseleave)': '_recentlyCleared.set(null)',\n '[attr.aria-sort]': '_getAriaSortAttribute()',\n '[class.mat-sort-header-disabled]': '_isDisabled()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatSortHeader implements MatSortable, OnDestroy, OnInit, AfterViewInit {\n _intl = inject(MatSortHeaderIntl);\n _sort = inject(MatSort, {optional: true})!;\n _columnDef = inject<MatSortHeaderColumnDef>('MAT_SORT_HEADER_COLUMN_DEF' as any, {\n optional: true,\n });\n private _changeDetectorRef = inject(ChangeDetectorRef);\n private _focusMonitor = inject(FocusMonitor);\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private _ariaDescriber = inject(AriaDescriber, {optional: true});\n private _renderChanges: Subscription | undefined;\n protected _animationsDisabled = _animationsDisabled();\n\n /**\n * Indicates which state was just cleared from the sort header.\n * Will be reset on the next interaction. Used for coordinating animations.\n */\n protected _recentlyCleared = signal<SortDirection | null>(null);\n\n /**\n * The element with role=\"button\" inside this component's view. We need this\n * in order to apply a description with AriaDescriber.\n */\n private _sortButton: HTMLElement;\n\n /**\n * ID of this sort header. If used within the context of a CdkColumnDef, this will default to\n * the column's name.\n */\n @Input('mat-sort-header') id: string;\n\n /** Sets the position of the arrow that displays when sorted. */\n @Input() arrowPosition: SortHeaderArrowPosition = 'after';\n\n /** Overrides the sort start value of the containing MatSort for this MatSortable. */\n @Input() start: SortDirection;\n\n /** whether the sort header is disabled. */\n @Input({transform: booleanAttribute})\n disabled: boolean = false;\n\n /**\n * Description applied to MatSortHeader's button element with aria-describedby. This text should\n * describe the action that will occur when the user clicks the sort header.\n */\n @Input()\n get sortActionDescription(): string {\n return this._sortActionDescription;\n }\n set sortActionDescription(value: string) {\n this._updateSortActionDescription(value);\n }\n // Default the action description to \"Sort\" because it's better than nothing.\n // Without a description, the button's label comes from the sort header text content,\n // which doesn't give any indication that it performs a sorting operation.\n private _sortActionDescription: string = 'Sort';\n\n /** Overrides the disable clear value of the containing MatSort for this MatSortable. */\n @Input({transform: booleanAttribute})\n disableClear: boolean;\n\n constructor(...args: unknown[]);\n\n constructor() {\n inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);\n const defaultOptions = inject<MatSortDefaultOptions>(MAT_SORT_DEFAULT_OPTIONS, {\n optional: true,\n });\n\n // Note that we use a string token for the `_columnDef`, because the value is provided both by\n // `material/table` and `cdk/table` and we can't have the CDK depending on Material,\n // and we want to avoid having the sort header depending on the CDK table because\n // of this single reference.\n if (!this._sort && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getSortHeaderNotContainedWithinSortError();\n }\n\n if (defaultOptions?.arrowPosition) {\n this.arrowPosition = defaultOptions?.arrowPosition;\n }\n }\n\n ngOnInit() {\n if (!this.id && this._columnDef) {\n this.id = this._columnDef.name;\n }\n\n this._sort.register(this);\n this._renderChanges = merge(this._sort._stateChanges, this._sort.sortChange).subscribe(() =>\n this._changeDetectorRef.markForCheck(),\n );\n this._sortButton = this._elementRef.nativeElement.querySelector('.mat-sort-header-container')!;\n this._updateSortActionDescription(this._sortActionDescription);\n }\n\n ngAfterViewInit() {\n // We use the focus monitor because we also want to style\n // things differently based on the focus origin.\n this._focusMonitor.monitor(this._elementRef, true).subscribe(() => {\n // We need the delay here, because we can trigger a signal write error if the header\n // has a signal bound to `disabled` which causes it to be blurred (see #31723.)\n Promise.resolve().then(() => this._recentlyCleared.set(null));\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._sort.deregister(this);\n this._renderChanges?.unsubscribe();\n\n if (this._sortButton) {\n this._ariaDescriber?.removeDescription(this._sortButton, this._sortActionDescription);\n }\n }\n\n /** Triggers the sort on this sort header and removes the indicator hint. */\n _toggleOnInteraction() {\n if (!this._isDisabled()) {\n const wasSorted = this._isSorted();\n const prevDirection = this._sort.direction;\n this._sort.sort(this);\n this._recentlyCleared.set(wasSorted && !this._isSorted() ? prevDirection : null);\n }\n }\n\n _handleKeydown(event: KeyboardEvent) {\n if (event.keyCode === SPACE || event.keyCode === ENTER) {\n event.preventDefault();\n this._toggleOnInteraction();\n }\n }\n\n /** Whether this MatSortHeader is currently sorted in either ascending or descending order. */\n _isSorted() {\n return (\n this._sort.active == this.id &&\n (this._sort.direction === 'asc' || this._sort.direction === 'desc')\n );\n }\n\n _isDisabled() {\n return this._sort.disabled || this.disabled;\n }\n\n /**\n * Gets the aria-sort attribute that should be applied to this sort header. If this header\n * is not sorted, returns null so that the attribute is removed from the host element. Aria spec\n * says that the aria-sort property should only be present on one header at a time, so removing\n * ensures this is true.\n */\n _getAriaSortAttribute() {\n if (!this._isSorted()) {\n return 'none';\n }\n\n return this._sort.direction == 'asc' ? 'ascending' : 'descending';\n }\n\n /** Whether the arrow inside the sort header should be rendered. */\n _renderArrow() {\n return !this._isDisabled() || this._isSorted();\n }\n\n private _updateSortActionDescription(newDescription: string) {\n // We use AriaDescriber for the sort button instead of setting an `aria-label` because some\n // screen readers (notably VoiceOver) will read both the column header *and* the button's label\n // for every *cell* in the table, creating a lot of unnecessary noise.\n\n // If _sortButton is undefined, the component hasn't been initialized yet so there's\n // nothing to update in the DOM.\n if (this._sortButton) {\n // removeDescription will no-op if there is no existing message.\n // TODO(jelbourn): remove optional chaining when AriaDescriber is required.\n this._ariaDescriber?.removeDescription(this._sortButton, this._sortActionDescription);\n this._ariaDescriber?.describe(this._sortButton, newDescription);\n }\n\n this._sortActionDescription = newDescription;\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 {BidiModule} from '@angular/cdk/bidi';\nimport {NgModule} from '@angular/core';\nimport {MatSortHeader} from './sort-header';\nimport {MatSort} from './sort';\n\n@NgModule({\n imports: [MatSort, MatSortHeader],\n exports: [MatSort, MatSortHeader, BidiModule],\n})\nexport class MatSortModule {}\n"],"names":["Error","getSortHeaderMissingIdError","getSortInvalidDirectionError","direction","MatSort","start","ngDevMode","_direction","_initializedStream","constructor","_defaultOptions","sortable","id","deregister","sortables","delete","ctorParameters","type","undefined","decorators","Optional","Inject","MAT_SORT_DEFAULT_OPTIONS","propDecorators","active","Input","transform","booleanAttribute","Output","getSortDirectionCycle","disableClear","MatSortHeaderIntl","ɵfac","i0","ɵɵngDeclareFactory","minVersion","version","ngImport","deps","target","ɵɵFactoryTarget","Injectable","inject","FocusMonitor","ElementRef","AriaDescriber","optional","_animationsDisabled","_recentlyCleared","signal","debugName","arrowPosition","sortActionDescription","value","_sortActionDescription","getSortHeaderNotContainedWithinSortError","defaultOptions","_sort","register","_renderChanges","merge","_stateChanges","sortChange","subscribe","_changeDetectorRef","markForCheck","_sortButton","_elementRef","nativeElement","querySelector","_updateSortActionDescription","monitor","stopMonitoring","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","template","styles","ɵmod","ɵɵngDeclareNgModule","MatSortModule","imports","MatSortHeader","exports","BidiModule"],"mappings":";;;;;;;;;;;;;;;AAeE,EAAA,OAAAA,KAAA,CAAA,CAAA,gFAAA,CAAA,CAAA;AAGF;AAEE,SAAYC,2BAAAA,GAAA;AACd,EAAA,OAAAD,KAAA,CAAA,CAAA,gDAAA,CAAA,CAAA;AAGA;AAEA,S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AAAA,SAAA,EAAAC;AAAA,OAAA;;;;;;;;;;;;;;ACxNE,EAAA,OAAAqD,IAAA,GAAA/C,EAAA,CAAAgD,mBAAA,CAAA;IAAA9C,UAAA,EAAA,QAAA;IAAAC,OAAA,EAAA,eAAA;AAAAC,IAAAA,QAAA,EAAAJ,EAAA;AAAAhB,IAAAA,IAAA,EAAAiE,aAAA;IAAAC,OAAA,EAAA,CAAA/E,OAAA,EAAAgF,aAAA,CAAA;AAAAC,IAAAA,OAAA,EAAAjF,CAAAA,OAAA,EAAAgF,aAAA,EAAAE,UAAA;AAAA,GAAA,CAAA;;;;;;;;;2BAJJ,CAAA;EAAAnD,UAAA,EAAA,QAAA;EAAAC,OAAA,EAAA,eAAA;AAAAC,EAAAA,QAAA,EAAAJ,EAAA;AAAAhB,EAAAA,IAAA,EAAAiE,aAAA;EAAA/D,UAAA,EAAA,CAAA;;;;;;;;;;;"}
@@ -1,174 +1,98 @@
1
1
  import { ContentContainerComponentHarness, HarnessPredicate, ComponentHarness } from '@angular/cdk/testing';
2
2
 
3
- /** Harness for interacting with a standard Angular Material step in tests. */
4
3
  class MatStepHarness extends ContentContainerComponentHarness {
5
- /** The selector for the host element of a `MatStep` instance. */
6
- static hostSelector = '.mat-step-header';
7
- /**
8
- * Gets a `HarnessPredicate` that can be used to search for a `MatStepHarness` that meets
9
- * certain criteria.
10
- * @param options Options for filtering which steps are considered a match.
11
- * @return a `HarnessPredicate` configured with the given options.
12
- */
13
- static with(options = {}) {
14
- return new HarnessPredicate(MatStepHarness, options)
15
- .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))
16
- .addOption('selected', options.selected, async (harness, selected) => (await harness.isSelected()) === selected)
17
- .addOption('completed', options.completed, async (harness, completed) => (await harness.isCompleted()) === completed)
18
- .addOption('invalid', options.invalid, async (harness, invalid) => (await harness.hasErrors()) === invalid);
19
- }
20
- /** Gets the label of the step. */
21
- async getLabel() {
22
- return (await this.locatorFor('.mat-step-text-label')()).text();
23
- }
24
- /** Gets the `aria-label` of the step. */
25
- async getAriaLabel() {
26
- return (await this.host()).getAttribute('aria-label');
27
- }
28
- /** Gets the value of the `aria-labelledby` attribute. */
29
- async getAriaLabelledby() {
30
- return (await this.host()).getAttribute('aria-labelledby');
31
- }
32
- /** Whether the step is selected. */
33
- async isSelected() {
34
- const host = await this.host();
35
- return ((await host.getAttribute('aria-selected')) === 'true' ||
36
- (await host.getAttribute('aria-current')) === 'step');
37
- }
38
- /** Whether the step has been filled out. */
39
- async isCompleted() {
40
- const state = await this._getIconState();
41
- return state === 'done' || (state === 'edit' && !(await this.isSelected()));
42
- }
43
- /**
44
- * Whether the step is currently showing its error state. Note that this doesn't mean that there
45
- * are or aren't any invalid form controls inside the step, but that the step is showing its
46
- * error-specific styling which depends on there being invalid controls, as well as the
47
- * `ErrorStateMatcher` determining that an error should be shown and that the `showErrors`
48
- * option was enabled through the `STEPPER_GLOBAL_OPTIONS` injection token.
49
- */
50
- async hasErrors() {
51
- return (await this._getIconState()) === 'error';
52
- }
53
- /** Whether the step is optional. */
54
- async isOptional() {
55
- // If the node with the optional text is present, it means that the step is optional.
56
- const optionalNode = await this.locatorForOptional('.mat-step-optional')();
57
- return !!optionalNode;
58
- }
59
- /**
60
- * Selects the given step by clicking on the label. The step may not be selected
61
- * if the stepper doesn't allow it (e.g. if there are validation errors).
62
- */
63
- async select() {
64
- await (await this.host()).click();
65
- }
66
- async getRootHarnessLoader() {
67
- const contentId = await (await this.host()).getAttribute('aria-controls');
68
- return this.documentRootLocatorFactory().harnessLoaderFor(`#${contentId}`);
69
- }
70
- /**
71
- * Gets the state of the step. Note that we have a `StepState` which we could use to type the
72
- * return value, but it's basically the same as `string`, because the type has `| string`.
73
- */
74
- async _getIconState() {
75
- // The state is exposed on the icon with a class that looks like `mat-step-icon-state-{{state}}`
76
- const icon = await this.locatorFor('.mat-step-icon')();
77
- const classes = (await icon.getAttribute('class'));
78
- const match = classes.match(/mat-step-icon-state-([a-z]+)/);
79
- if (!match) {
80
- throw Error(`Could not determine step state from "${classes}".`);
81
- }
82
- return match[1];
83
- }
4
+ static hostSelector = '.mat-step-header';
5
+ static with(options = {}) {
6
+ return new HarnessPredicate(MatStepHarness, options).addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label)).addOption('selected', options.selected, async (harness, selected) => (await harness.isSelected()) === selected).addOption('completed', options.completed, async (harness, completed) => (await harness.isCompleted()) === completed).addOption('invalid', options.invalid, async (harness, invalid) => (await harness.hasErrors()) === invalid);
7
+ }
8
+ async getLabel() {
9
+ return (await this.locatorFor('.mat-step-text-label')()).text();
10
+ }
11
+ async getAriaLabel() {
12
+ return (await this.host()).getAttribute('aria-label');
13
+ }
14
+ async getAriaLabelledby() {
15
+ return (await this.host()).getAttribute('aria-labelledby');
16
+ }
17
+ async isSelected() {
18
+ const host = await this.host();
19
+ return (await host.getAttribute('aria-selected')) === 'true' || (await host.getAttribute('aria-current')) === 'step';
20
+ }
21
+ async isCompleted() {
22
+ const state = await this._getIconState();
23
+ return state === 'done' || state === 'edit' && !(await this.isSelected());
24
+ }
25
+ async hasErrors() {
26
+ return (await this._getIconState()) === 'error';
27
+ }
28
+ async isOptional() {
29
+ const optionalNode = await this.locatorForOptional('.mat-step-optional')();
30
+ return !!optionalNode;
31
+ }
32
+ async select() {
33
+ await (await this.host()).click();
34
+ }
35
+ async getRootHarnessLoader() {
36
+ const contentId = await (await this.host()).getAttribute('aria-controls');
37
+ return this.documentRootLocatorFactory().harnessLoaderFor(`#${contentId}`);
38
+ }
39
+ async _getIconState() {
40
+ const icon = await this.locatorFor('.mat-step-icon')();
41
+ const classes = await icon.getAttribute('class');
42
+ const match = classes.match(/mat-step-icon-state-([a-z]+)/);
43
+ if (!match) {
44
+ throw Error(`Could not determine step state from "${classes}".`);
45
+ }
46
+ return match[1];
47
+ }
84
48
  }
85
49
 
86
- /** Possible orientations for a stepper. */
87
50
  var StepperOrientation;
88
51
  (function (StepperOrientation) {
89
- StepperOrientation[StepperOrientation["HORIZONTAL"] = 0] = "HORIZONTAL";
90
- StepperOrientation[StepperOrientation["VERTICAL"] = 1] = "VERTICAL";
52
+ StepperOrientation[StepperOrientation["HORIZONTAL"] = 0] = "HORIZONTAL";
53
+ StepperOrientation[StepperOrientation["VERTICAL"] = 1] = "VERTICAL";
91
54
  })(StepperOrientation || (StepperOrientation = {}));
92
55
 
93
- /** Harness for interacting with a standard Material stepper in tests. */
94
56
  class MatStepperHarness extends ComponentHarness {
95
- /** The selector for the host element of a `MatStepper` instance. */
96
- static hostSelector = '.mat-stepper-horizontal, .mat-stepper-vertical';
97
- /**
98
- * Gets a `HarnessPredicate` that can be used to search for a `MatStepperHarness` that meets
99
- * certain criteria.
100
- * @param options Options for filtering which stepper instances are considered a match.
101
- * @return a `HarnessPredicate` configured with the given options.
102
- */
103
- static with(options = {}) {
104
- return new HarnessPredicate(MatStepperHarness, options).addOption('orientation', options.orientation, async (harness, orientation) => (await harness.getOrientation()) === orientation);
105
- }
106
- /**
107
- * Gets the list of steps in the stepper.
108
- * @param filter Optionally filters which steps are included.
109
- */
110
- async getSteps(filter = {}) {
111
- return this.locatorForAll(MatStepHarness.with(filter))();
112
- }
113
- /** Gets the orientation of the stepper. */
114
- async getOrientation() {
115
- const host = await this.host();
116
- return (await host.hasClass('mat-stepper-horizontal'))
117
- ? StepperOrientation.HORIZONTAL
118
- : StepperOrientation.VERTICAL;
119
- }
120
- /**
121
- * Selects a step in this stepper.
122
- * @param filter An optional filter to apply to the child steps. The first step matching the
123
- * filter will be selected.
124
- */
125
- async selectStep(filter = {}) {
126
- const steps = await this.getSteps(filter);
127
- if (!steps.length) {
128
- throw Error(`Cannot find mat-step matching filter ${JSON.stringify(filter)}`);
129
- }
130
- await steps[0].select();
131
- }
57
+ static hostSelector = '.mat-stepper-horizontal, .mat-stepper-vertical';
58
+ static with(options = {}) {
59
+ return new HarnessPredicate(MatStepperHarness, options).addOption('orientation', options.orientation, async (harness, orientation) => (await harness.getOrientation()) === orientation);
60
+ }
61
+ async getSteps(filter = {}) {
62
+ return this.locatorForAll(MatStepHarness.with(filter))();
63
+ }
64
+ async getOrientation() {
65
+ const host = await this.host();
66
+ return (await host.hasClass('mat-stepper-horizontal')) ? StepperOrientation.HORIZONTAL : StepperOrientation.VERTICAL;
67
+ }
68
+ async selectStep(filter = {}) {
69
+ const steps = await this.getSteps(filter);
70
+ if (!steps.length) {
71
+ throw Error(`Cannot find mat-step matching filter ${JSON.stringify(filter)}`);
72
+ }
73
+ await steps[0].select();
74
+ }
132
75
  }
133
76
 
134
- /** Base class for stepper button harnesses. */
135
77
  class StepperButtonHarness extends ComponentHarness {
136
- /** Gets the text of the button. */
137
- async getText() {
138
- return (await this.host()).text();
139
- }
140
- /** Clicks the button. */
141
- async click() {
142
- return (await this.host()).click();
143
- }
78
+ async getText() {
79
+ return (await this.host()).text();
80
+ }
81
+ async click() {
82
+ return (await this.host()).click();
83
+ }
144
84
  }
145
- /** Harness for interacting with a standard Angular Material stepper next button in tests. */
146
85
  class MatStepperNextHarness extends StepperButtonHarness {
147
- /** The selector for the host element of a `MatStep` instance. */
148
- static hostSelector = '.mat-stepper-next';
149
- /**
150
- * Gets a `HarnessPredicate` that can be used to search for a `MatStepperNextHarness` that meets
151
- * certain criteria.
152
- * @param options Options for filtering which steps are considered a match.
153
- * @return a `HarnessPredicate` configured with the given options.
154
- */
155
- static with(options = {}) {
156
- return new HarnessPredicate(MatStepperNextHarness, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
157
- }
86
+ static hostSelector = '.mat-stepper-next';
87
+ static with(options = {}) {
88
+ return new HarnessPredicate(MatStepperNextHarness, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
89
+ }
158
90
  }
159
- /** Harness for interacting with a standard Angular Material stepper previous button in tests. */
160
91
  class MatStepperPreviousHarness extends StepperButtonHarness {
161
- /** The selector for the host element of a `MatStep` instance. */
162
- static hostSelector = '.mat-stepper-previous';
163
- /**
164
- * Gets a `HarnessPredicate` that can be used to search for a `MatStepperPreviousHarness`
165
- * that meets certain criteria.
166
- * @param options Options for filtering which steps are considered a match.
167
- * @return a `HarnessPredicate` configured with the given options.
168
- */
169
- static with(options = {}) {
170
- return new HarnessPredicate(MatStepperPreviousHarness, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
171
- }
92
+ static hostSelector = '.mat-stepper-previous';
93
+ static with(options = {}) {
94
+ return new HarnessPredicate(MatStepperPreviousHarness, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
95
+ }
172
96
  }
173
97
 
174
98
  export { MatStepHarness, MatStepperHarness, MatStepperNextHarness, MatStepperPreviousHarness, StepperOrientation };
@@ -1 +1 @@
1
- {"version":3,"file":"stepper-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/stepper/testing/step-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/stepper/testing/step-harness-filters.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/stepper/testing/stepper-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/stepper/testing/stepper-button-harnesses.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 {\n ContentContainerComponentHarness,\n HarnessPredicate,\n HarnessLoader,\n} from '@angular/cdk/testing';\nimport {StepHarnessFilters} from './step-harness-filters';\n\n/** Harness for interacting with a standard Angular Material step in tests. */\nexport class MatStepHarness extends ContentContainerComponentHarness<string> {\n /** The selector for the host element of a `MatStep` instance. */\n static hostSelector = '.mat-step-header';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatStepHarness` that meets\n * certain criteria.\n * @param options Options for filtering which steps are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: StepHarnessFilters = {}): HarnessPredicate<MatStepHarness> {\n return new HarnessPredicate(MatStepHarness, options)\n .addOption('label', options.label, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getLabel(), label),\n )\n .addOption(\n 'selected',\n options.selected,\n async (harness, selected) => (await harness.isSelected()) === selected,\n )\n .addOption(\n 'completed',\n options.completed,\n async (harness, completed) => (await harness.isCompleted()) === completed,\n )\n .addOption(\n 'invalid',\n options.invalid,\n async (harness, invalid) => (await harness.hasErrors()) === invalid,\n );\n }\n\n /** Gets the label of the step. */\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.mat-step-text-label')()).text();\n }\n\n /** Gets the `aria-label` of the step. */\n async getAriaLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /** Gets the value of the `aria-labelledby` attribute. */\n async getAriaLabelledby(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-labelledby');\n }\n\n /** Whether the step is selected. */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n return (\n (await host.getAttribute('aria-selected')) === 'true' ||\n (await host.getAttribute('aria-current')) === 'step'\n );\n }\n\n /** Whether the step has been filled out. */\n async isCompleted(): Promise<boolean> {\n const state = await this._getIconState();\n return state === 'done' || (state === 'edit' && !(await this.isSelected()));\n }\n\n /**\n * Whether the step is currently showing its error state. Note that this doesn't mean that there\n * are or aren't any invalid form controls inside the step, but that the step is showing its\n * error-specific styling which depends on there being invalid controls, as well as the\n * `ErrorStateMatcher` determining that an error should be shown and that the `showErrors`\n * option was enabled through the `STEPPER_GLOBAL_OPTIONS` injection token.\n */\n async hasErrors(): Promise<boolean> {\n return (await this._getIconState()) === 'error';\n }\n\n /** Whether the step is optional. */\n async isOptional(): Promise<boolean> {\n // If the node with the optional text is present, it means that the step is optional.\n const optionalNode = await this.locatorForOptional('.mat-step-optional')();\n return !!optionalNode;\n }\n\n /**\n * Selects the given step by clicking on the label. The step may not be selected\n * if the stepper doesn't allow it (e.g. if there are validation errors).\n */\n async select(): Promise<void> {\n await (await this.host()).click();\n }\n\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n const contentId = await (await this.host()).getAttribute('aria-controls');\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${contentId}`);\n }\n\n /**\n * Gets the state of the step. Note that we have a `StepState` which we could use to type the\n * return value, but it's basically the same as `string`, because the type has `| string`.\n */\n private async _getIconState(): Promise<string> {\n // The state is exposed on the icon with a class that looks like `mat-step-icon-state-{{state}}`\n const icon = await this.locatorFor('.mat-step-icon')();\n const classes = (await icon.getAttribute('class'))!;\n const match = classes.match(/mat-step-icon-state-([a-z]+)/);\n\n if (!match) {\n throw Error(`Could not determine step state from \"${classes}\".`);\n }\n\n return match[1];\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 */\nimport {BaseHarnessFilters} from '@angular/cdk/testing';\n\n/** Possible orientations for a stepper. */\nexport enum StepperOrientation {\n HORIZONTAL,\n VERTICAL,\n}\n\n/** A set of criteria that can be used to filter a list of `MatStepHarness` instances. */\nexport interface StepHarnessFilters extends BaseHarnessFilters {\n /** Only find instances whose label matches the given value. */\n label?: string | RegExp;\n /** Only find steps with the given selected state. */\n selected?: boolean;\n /** Only find completed steps. */\n completed?: boolean;\n /** Only find steps that have errors. */\n invalid?: boolean;\n}\n\n/** A set of criteria that can be used to filter a list of `MatStepperHarness` instances. */\nexport interface StepperHarnessFilters extends BaseHarnessFilters {\n /** Only find instances whose orientation matches the given value. */\n orientation?: StepperOrientation;\n}\n\n/**\n * A set of criteria that can be used to filter a list of\n * `MatStepperNextHarness` and `MatStepperPreviousHarness` instances.\n */\nexport interface StepperButtonHarnessFilters extends BaseHarnessFilters {\n /** Only find instances whose text matches the given value. */\n text?: string | RegExp;\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 {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {MatStepHarness} from './step-harness';\nimport {\n StepperHarnessFilters,\n StepHarnessFilters,\n StepperOrientation,\n} from './step-harness-filters';\n\n/** Harness for interacting with a standard Material stepper in tests. */\nexport class MatStepperHarness extends ComponentHarness {\n /** The selector for the host element of a `MatStepper` instance. */\n static hostSelector = '.mat-stepper-horizontal, .mat-stepper-vertical';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatStepperHarness` that meets\n * certain criteria.\n * @param options Options for filtering which stepper instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: StepperHarnessFilters = {}): HarnessPredicate<MatStepperHarness> {\n return new HarnessPredicate(MatStepperHarness, options).addOption(\n 'orientation',\n options.orientation,\n async (harness, orientation) => (await harness.getOrientation()) === orientation,\n );\n }\n\n /**\n * Gets the list of steps in the stepper.\n * @param filter Optionally filters which steps are included.\n */\n async getSteps(filter: StepHarnessFilters = {}): Promise<MatStepHarness[]> {\n return this.locatorForAll(MatStepHarness.with(filter))();\n }\n\n /** Gets the orientation of the stepper. */\n async getOrientation(): Promise<StepperOrientation> {\n const host = await this.host();\n return (await host.hasClass('mat-stepper-horizontal'))\n ? StepperOrientation.HORIZONTAL\n : StepperOrientation.VERTICAL;\n }\n\n /**\n * Selects a step in this stepper.\n * @param filter An optional filter to apply to the child steps. The first step matching the\n * filter will be selected.\n */\n async selectStep(filter: StepHarnessFilters = {}): Promise<void> {\n const steps = await this.getSteps(filter);\n if (!steps.length) {\n throw Error(`Cannot find mat-step matching filter ${JSON.stringify(filter)}`);\n }\n await steps[0].select();\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 {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {StepperButtonHarnessFilters} from './step-harness-filters';\n\n/** Base class for stepper button harnesses. */\nabstract class StepperButtonHarness extends ComponentHarness {\n /** Gets the text of the button. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Clicks the button. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n}\n\n/** Harness for interacting with a standard Angular Material stepper next button in tests. */\nexport class MatStepperNextHarness extends StepperButtonHarness {\n /** The selector for the host element of a `MatStep` instance. */\n static hostSelector = '.mat-stepper-next';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatStepperNextHarness` that meets\n * certain criteria.\n * @param options Options for filtering which steps are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: StepperButtonHarnessFilters = {}): HarnessPredicate<MatStepperNextHarness> {\n return new HarnessPredicate(MatStepperNextHarness, options).addOption(\n 'text',\n options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text),\n );\n }\n}\n\n/** Harness for interacting with a standard Angular Material stepper previous button in tests. */\nexport class MatStepperPreviousHarness extends StepperButtonHarness {\n /** The selector for the host element of a `MatStep` instance. */\n static hostSelector = '.mat-stepper-previous';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatStepperPreviousHarness`\n * that meets certain criteria.\n * @param options Options for filtering which steps are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(\n options: StepperButtonHarnessFilters = {},\n ): HarnessPredicate<MatStepperPreviousHarness> {\n return new HarnessPredicate(MatStepperPreviousHarness, options).addOption(\n 'text',\n options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text),\n );\n }\n}\n"],"names":[],"mappings":";;AAeA;AACM,MAAO,cAAe,SAAQ,gCAAwC,CAAA;;AAE1E,IAAA,OAAO,YAAY,GAAG,kBAAkB;AAExC;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAA8B,EAAE,EAAA;AAC1C,QAAA,OAAO,IAAI,gBAAgB,CAAC,cAAc,EAAE,OAAO;aAChD,SAAS,CAAC,OAAO,EAAE,OA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C,MAAM,EAAE;;;;AClD3B;AACA,MAAe,oBAAqB,SAAQ,gBAAgB,CAAA;;AAE1D,IAAA,MAAM,OAAO,GAAA;QACX,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE;;;AAInC,IAAA,MAAM,KAAK,GAAA;QACT,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE;;AAErC;AAED;AACM,MAAO,qBAAsB,SAAQ,oBAAoB,CAAA;;AAE7D,IAAA,OAAO,YAAY,GAAG,mBAAmB;AAEzC;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAuC,EAAE,EAAA;AACnD,QAAA,OAAO,IAAI,gBAAgB,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC,SAAS,CACnE,MAAM,EACN,OAAO,CAAC,IAAI,EACZ,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAC3E;;;AAIL;AACM,MAAO,yBAA0B,SAAQ,oBAAoB,CAAA;;AAEjE,IAAA,OAAO,YAAY,GAAG,uBAAuB;AAE7C;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CACT,OAAA,GAAuC,EAAE,EAAA;AAEzC,QAAA,OAAO,IAAI,gBAAgB,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC,SAAS,CACvE,MAAM,EACN,OAAO,CAAC,IAAI,EACZ,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAC3E;;;;;;"}
1
+ {"version":3,"file":"stepper-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/stepper/testing/step-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/stepper/testing/stepper-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/stepper/testing/stepper-button-harnesses.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 {\n ContentContainerComponentHarness,\n HarnessPredicate,\n HarnessLoader,\n} from '@angular/cdk/testing';\nimport {StepHarnessFilters} from './step-harness-filters';\n\n/** Harness for interacting with a standard Angular Material step in tests. */\nexport class MatStepHarness extends ContentContainerComponentHarness<string> {\n /** The selector for the host element of a `MatStep` instance. */\n static hostSelector = '.mat-step-header';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatStepHarness` that meets\n * certain criteria.\n * @param options Options for filtering which steps are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: StepHarnessFilters = {}): HarnessPredicate<MatStepHarness> {\n return new HarnessPredicate(MatStepHarness, options)\n .addOption('label', options.label, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getLabel(), label),\n )\n .addOption(\n 'selected',\n options.selected,\n async (harness, selected) => (await harness.isSelected()) === selected,\n )\n .addOption(\n 'completed',\n options.completed,\n async (harness, completed) => (await harness.isCompleted()) === completed,\n )\n .addOption(\n 'invalid',\n options.invalid,\n async (harness, invalid) => (await harness.hasErrors()) === invalid,\n );\n }\n\n /** Gets the label of the step. */\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.mat-step-text-label')()).text();\n }\n\n /** Gets the `aria-label` of the step. */\n async getAriaLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /** Gets the value of the `aria-labelledby` attribute. */\n async getAriaLabelledby(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-labelledby');\n }\n\n /** Whether the step is selected. */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n return (\n (await host.getAttribute('aria-selected')) === 'true' ||\n (await host.getAttribute('aria-current')) === 'step'\n );\n }\n\n /** Whether the step has been filled out. */\n async isCompleted(): Promise<boolean> {\n const state = await this._getIconState();\n return state === 'done' || (state === 'edit' && !(await this.isSelected()));\n }\n\n /**\n * Whether the step is currently showing its error state. Note that this doesn't mean that there\n * are or aren't any invalid form controls inside the step, but that the step is showing its\n * error-specific styling which depends on there being invalid controls, as well as the\n * `ErrorStateMatcher` determining that an error should be shown and that the `showErrors`\n * option was enabled through the `STEPPER_GLOBAL_OPTIONS` injection token.\n */\n async hasErrors(): Promise<boolean> {\n return (await this._getIconState()) === 'error';\n }\n\n /** Whether the step is optional. */\n async isOptional(): Promise<boolean> {\n // If the node with the optional text is present, it means that the step is optional.\n const optionalNode = await this.locatorForOptional('.mat-step-optional')();\n return !!optionalNode;\n }\n\n /**\n * Selects the given step by clicking on the label. The step may not be selected\n * if the stepper doesn't allow it (e.g. if there are validation errors).\n */\n async select(): Promise<void> {\n await (await this.host()).click();\n }\n\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n const contentId = await (await this.host()).getAttribute('aria-controls');\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${contentId}`);\n }\n\n /**\n * Gets the state of the step. Note that we have a `StepState` which we could use to type the\n * return value, but it's basically the same as `string`, because the type has `| string`.\n */\n private async _getIconState(): Promise<string> {\n // The state is exposed on the icon with a class that looks like `mat-step-icon-state-{{state}}`\n const icon = await this.locatorFor('.mat-step-icon')();\n const classes = (await icon.getAttribute('class'))!;\n const match = classes.match(/mat-step-icon-state-([a-z]+)/);\n\n if (!match) {\n throw Error(`Could not determine step state from \"${classes}\".`);\n }\n\n return match[1];\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 {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {MatStepHarness} from './step-harness';\nimport {\n StepperHarnessFilters,\n StepHarnessFilters,\n StepperOrientation,\n} from './step-harness-filters';\n\n/** Harness for interacting with a standard Material stepper in tests. */\nexport class MatStepperHarness extends ComponentHarness {\n /** The selector for the host element of a `MatStepper` instance. */\n static hostSelector = '.mat-stepper-horizontal, .mat-stepper-vertical';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatStepperHarness` that meets\n * certain criteria.\n * @param options Options for filtering which stepper instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: StepperHarnessFilters = {}): HarnessPredicate<MatStepperHarness> {\n return new HarnessPredicate(MatStepperHarness, options).addOption(\n 'orientation',\n options.orientation,\n async (harness, orientation) => (await harness.getOrientation()) === orientation,\n );\n }\n\n /**\n * Gets the list of steps in the stepper.\n * @param filter Optionally filters which steps are included.\n */\n async getSteps(filter: StepHarnessFilters = {}): Promise<MatStepHarness[]> {\n return this.locatorForAll(MatStepHarness.with(filter))();\n }\n\n /** Gets the orientation of the stepper. */\n async getOrientation(): Promise<StepperOrientation> {\n const host = await this.host();\n return (await host.hasClass('mat-stepper-horizontal'))\n ? StepperOrientation.HORIZONTAL\n : StepperOrientation.VERTICAL;\n }\n\n /**\n * Selects a step in this stepper.\n * @param filter An optional filter to apply to the child steps. The first step matching the\n * filter will be selected.\n */\n async selectStep(filter: StepHarnessFilters = {}): Promise<void> {\n const steps = await this.getSteps(filter);\n if (!steps.length) {\n throw Error(`Cannot find mat-step matching filter ${JSON.stringify(filter)}`);\n }\n await steps[0].select();\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 {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {StepperButtonHarnessFilters} from './step-harness-filters';\n\n/** Base class for stepper button harnesses. */\nabstract class StepperButtonHarness extends ComponentHarness {\n /** Gets the text of the button. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Clicks the button. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n}\n\n/** Harness for interacting with a standard Angular Material stepper next button in tests. */\nexport class MatStepperNextHarness extends StepperButtonHarness {\n /** The selector for the host element of a `MatStep` instance. */\n static hostSelector = '.mat-stepper-next';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatStepperNextHarness` that meets\n * certain criteria.\n * @param options Options for filtering which steps are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: StepperButtonHarnessFilters = {}): HarnessPredicate<MatStepperNextHarness> {\n return new HarnessPredicate(MatStepperNextHarness, options).addOption(\n 'text',\n options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text),\n );\n }\n}\n\n/** Harness for interacting with a standard Angular Material stepper previous button in tests. */\nexport class MatStepperPreviousHarness extends StepperButtonHarness {\n /** The selector for the host element of a `MatStep` instance. */\n static hostSelector = '.mat-stepper-previous';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatStepperPreviousHarness`\n * that meets certain criteria.\n * @param options Options for filtering which steps are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(\n options: StepperButtonHarnessFilters = {},\n ): HarnessPredicate<MatStepperPreviousHarness> {\n return new HarnessPredicate(MatStepperPreviousHarness, options).addOption(\n 'text',\n options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text),\n );\n }\n}\n"],"names":["with","options","HarnessPredicate","MatStepHarness","getLabel","locatorFor","text","getAriaLabel","getAriaLabelledby","isSelected","state","_getIconState","hasErrors","hostSelector","MatStepperHarness","addOption","orientation","harness","getOrientation","getSteps","filter","locatorForAll","StepperOrientation","HORIZONTAL","VERTICAL","click","host","MatStepperNextHarness","StepperButtonHarness","stringMatches","getText"],"mappings":";;;;SAgDoCA,IAAAA,CAAAC,OAAA,GAAA,EAAA,EAAA;AAEhC,IAAA,OAAA,IAAAC,gBAAA,CAAAC,cAAA,EAAAF,OAAA;;AASFG,EAAAA,MAAAA,QAAuBA,GAAA;AACrB,IAAA,OAAA,CAAA,MAAQ,IAAA,CAAAC,UAAU,CAAuC,sBAAA,CAAA,IAAAC,IAC3D,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