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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/core/tokens/_classes.scss +1 -1
  2. package/core/tokens/m2/_md-sys-color.scss +17 -17
  3. package/fesm2022/_animation-chunk.mjs +10 -16
  4. package/fesm2022/_animation-chunk.mjs.map +1 -1
  5. package/fesm2022/_date-formats-chunk.mjs +68 -164
  6. package/fesm2022/_date-formats-chunk.mjs.map +1 -1
  7. package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
  8. package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
  9. package/fesm2022/_error-options-chunk.mjs +56 -19
  10. package/fesm2022/_error-options-chunk.mjs.map +1 -1
  11. package/fesm2022/_error-state-chunk.mjs +24 -31
  12. package/fesm2022/_error-state-chunk.mjs.map +1 -1
  13. package/fesm2022/_form-field-chunk.mjs +1224 -1017
  14. package/fesm2022/_form-field-chunk.mjs.map +1 -1
  15. package/fesm2022/_icon-button-chunk.mjs +243 -187
  16. package/fesm2022/_icon-button-chunk.mjs.map +1 -1
  17. package/fesm2022/_icon-registry-chunk.mjs +350 -575
  18. package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
  19. package/fesm2022/_input-harness-chunk.mjs +56 -107
  20. package/fesm2022/_input-harness-chunk.mjs.map +1 -1
  21. package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
  22. package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
  23. package/fesm2022/_internal-form-field-chunk.mjs +59 -19
  24. package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
  25. package/fesm2022/_line-chunk.mjs +83 -43
  26. package/fesm2022/_line-chunk.mjs.map +1 -1
  27. package/fesm2022/_option-chunk.mjs +348 -311
  28. package/fesm2022/_option-chunk.mjs.map +1 -1
  29. package/fesm2022/_option-harness-chunk.mjs +23 -39
  30. package/fesm2022/_option-harness-chunk.mjs.map +1 -1
  31. package/fesm2022/_option-module-chunk.mjs +36 -10
  32. package/fesm2022/_option-module-chunk.mjs.map +1 -1
  33. package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
  34. package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
  35. package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
  36. package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
  37. package/fesm2022/_public-api-chunk.mjs +71 -134
  38. package/fesm2022/_public-api-chunk.mjs.map +1 -1
  39. package/fesm2022/_ripple-chunk.mjs +504 -600
  40. package/fesm2022/_ripple-chunk.mjs.map +1 -1
  41. package/fesm2022/_ripple-loader-chunk.mjs +120 -138
  42. package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
  43. package/fesm2022/_ripple-module-chunk.mjs +36 -10
  44. package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
  45. package/fesm2022/_structural-styles-chunk.mjs +37 -10
  46. package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
  47. package/fesm2022/_tooltip-chunk.mjs +811 -888
  48. package/fesm2022/_tooltip-chunk.mjs.map +1 -1
  49. package/fesm2022/autocomplete-testing.mjs +62 -86
  50. package/fesm2022/autocomplete-testing.mjs.map +1 -1
  51. package/fesm2022/autocomplete.mjs +965 -1126
  52. package/fesm2022/autocomplete.mjs.map +1 -1
  53. package/fesm2022/badge-testing.mjs +38 -54
  54. package/fesm2022/badge-testing.mjs.map +1 -1
  55. package/fesm2022/badge.mjs +321 -272
  56. package/fesm2022/badge.mjs.map +1 -1
  57. package/fesm2022/bottom-sheet-testing.mjs +10 -24
  58. package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
  59. package/fesm2022/bottom-sheet.mjs +349 -344
  60. package/fesm2022/bottom-sheet.mjs.map +1 -1
  61. package/fesm2022/button-testing.mjs +60 -94
  62. package/fesm2022/button-testing.mjs.map +1 -1
  63. package/fesm2022/button-toggle-testing.mjs +76 -125
  64. package/fesm2022/button-toggle-testing.mjs.map +1 -1
  65. package/fesm2022/button-toggle.mjs +752 -662
  66. package/fesm2022/button-toggle.mjs.map +1 -1
  67. package/fesm2022/button.mjs +263 -158
  68. package/fesm2022/button.mjs.map +1 -1
  69. package/fesm2022/card-testing.mjs +19 -33
  70. package/fesm2022/card-testing.mjs.map +1 -1
  71. package/fesm2022/card.mjs +576 -272
  72. package/fesm2022/card.mjs.map +1 -1
  73. package/fesm2022/checkbox-testing.mjs +71 -123
  74. package/fesm2022/checkbox-testing.mjs.map +1 -1
  75. package/fesm2022/checkbox.mjs +515 -477
  76. package/fesm2022/checkbox.mjs.map +1 -1
  77. package/fesm2022/chips-testing.mjs +201 -344
  78. package/fesm2022/chips-testing.mjs.map +1 -1
  79. package/fesm2022/chips.mjs +2552 -2289
  80. package/fesm2022/chips.mjs.map +1 -1
  81. package/fesm2022/core-testing.mjs +14 -28
  82. package/fesm2022/core-testing.mjs.map +1 -1
  83. package/fesm2022/core.mjs +357 -328
  84. package/fesm2022/core.mjs.map +1 -1
  85. package/fesm2022/datepicker-testing.mjs +15 -25
  86. package/fesm2022/datepicker-testing.mjs.map +1 -1
  87. package/fesm2022/datepicker.mjs +4826 -4563
  88. package/fesm2022/datepicker.mjs.map +1 -1
  89. package/fesm2022/dialog-testing.mjs +93 -129
  90. package/fesm2022/dialog-testing.mjs.map +1 -1
  91. package/fesm2022/dialog.mjs +810 -829
  92. package/fesm2022/dialog.mjs.map +1 -1
  93. package/fesm2022/divider-testing.mjs +10 -11
  94. package/fesm2022/divider-testing.mjs.map +1 -1
  95. package/fesm2022/divider.mjs +119 -43
  96. package/fesm2022/divider.mjs.map +1 -1
  97. package/fesm2022/expansion-testing.mjs +74 -130
  98. package/fesm2022/expansion-testing.mjs.map +1 -1
  99. package/fesm2022/expansion.mjs +703 -515
  100. package/fesm2022/expansion.mjs.map +1 -1
  101. package/fesm2022/form-field-testing-control.mjs +16 -33
  102. package/fesm2022/form-field-testing-control.mjs.map +1 -1
  103. package/fesm2022/form-field-testing.mjs +118 -179
  104. package/fesm2022/form-field-testing.mjs.map +1 -1
  105. package/fesm2022/form-field.mjs +36 -10
  106. package/fesm2022/form-field.mjs.map +1 -1
  107. package/fesm2022/grid-list-testing.mjs +65 -113
  108. package/fesm2022/grid-list-testing.mjs.map +1 -1
  109. package/fesm2022/grid-list.mjs +559 -494
  110. package/fesm2022/grid-list.mjs.map +1 -1
  111. package/fesm2022/icon-testing.mjs +148 -127
  112. package/fesm2022/icon-testing.mjs.map +1 -1
  113. package/fesm2022/icon.mjs +325 -351
  114. package/fesm2022/icon.mjs.map +1 -1
  115. package/fesm2022/input-testing.mjs +59 -99
  116. package/fesm2022/input-testing.mjs.map +1 -1
  117. package/fesm2022/input.mjs +457 -520
  118. package/fesm2022/input.mjs.map +1 -1
  119. package/fesm2022/list-testing.mjs +251 -434
  120. package/fesm2022/list-testing.mjs.map +1 -1
  121. package/fesm2022/list.mjs +1522 -1204
  122. package/fesm2022/list.mjs.map +1 -1
  123. package/fesm2022/material.mjs +0 -5
  124. package/fesm2022/material.mjs.map +1 -1
  125. package/fesm2022/menu-testing.mjs +159 -228
  126. package/fesm2022/menu-testing.mjs.map +1 -1
  127. package/fesm2022/menu.mjs +1338 -1343
  128. package/fesm2022/menu.mjs.map +1 -1
  129. package/fesm2022/paginator-testing.mjs +55 -79
  130. package/fesm2022/paginator-testing.mjs.map +1 -1
  131. package/fesm2022/paginator.mjs +381 -309
  132. package/fesm2022/paginator.mjs.map +1 -1
  133. package/fesm2022/progress-bar-testing.mjs +12 -21
  134. package/fesm2022/progress-bar-testing.mjs.map +1 -1
  135. package/fesm2022/progress-bar.mjs +224 -169
  136. package/fesm2022/progress-bar.mjs.map +1 -1
  137. package/fesm2022/progress-spinner-testing.mjs +13 -23
  138. package/fesm2022/progress-spinner-testing.mjs.map +1 -1
  139. package/fesm2022/progress-spinner.mjs +235 -160
  140. package/fesm2022/progress-spinner.mjs.map +1 -1
  141. package/fesm2022/radio-testing.mjs +133 -208
  142. package/fesm2022/radio-testing.mjs.map +1 -1
  143. package/fesm2022/radio.mjs +712 -679
  144. package/fesm2022/radio.mjs.map +1 -1
  145. package/fesm2022/select-testing.mjs +83 -117
  146. package/fesm2022/select-testing.mjs.map +1 -1
  147. package/fesm2022/select.mjs +1116 -1246
  148. package/fesm2022/select.mjs.map +1 -1
  149. package/fesm2022/sidenav-testing.mjs +54 -120
  150. package/fesm2022/sidenav-testing.mjs.map +1 -1
  151. package/fesm2022/sidenav.mjs +1078 -995
  152. package/fesm2022/sidenav.mjs.map +1 -1
  153. package/fesm2022/slide-toggle-testing.mjs +57 -92
  154. package/fesm2022/slide-toggle-testing.mjs.map +1 -1
  155. package/fesm2022/slide-toggle.mjs +369 -279
  156. package/fesm2022/slide-toggle.mjs.map +1 -1
  157. package/fesm2022/slider-testing.mjs +90 -138
  158. package/fesm2022/slider-testing.mjs.map +1 -1
  159. package/fesm2022/slider.mjs +1651 -1716
  160. package/fesm2022/slider.mjs.map +1 -1
  161. package/fesm2022/snack-bar-testing.mjs +40 -87
  162. package/fesm2022/snack-bar-testing.mjs.map +1 -1
  163. package/fesm2022/snack-bar.mjs +763 -714
  164. package/fesm2022/snack-bar.mjs.map +1 -1
  165. package/fesm2022/sort-testing.mjs +45 -66
  166. package/fesm2022/sort-testing.mjs.map +1 -1
  167. package/fesm2022/sort.mjs +419 -344
  168. package/fesm2022/sort.mjs.map +1 -1
  169. package/fesm2022/stepper-testing.mjs +78 -154
  170. package/fesm2022/stepper-testing.mjs.map +1 -1
  171. package/fesm2022/stepper.mjs +790 -498
  172. package/fesm2022/stepper.mjs.map +1 -1
  173. package/fesm2022/table-testing.mjs +120 -213
  174. package/fesm2022/table-testing.mjs.map +1 -1
  175. package/fesm2022/table.mjs +1026 -684
  176. package/fesm2022/table.mjs.map +1 -1
  177. package/fesm2022/tabs-testing.mjs +125 -197
  178. package/fesm2022/tabs-testing.mjs.map +1 -1
  179. package/fesm2022/tabs.mjs +2351 -2028
  180. package/fesm2022/tabs.mjs.map +1 -1
  181. package/fesm2022/timepicker-testing.mjs +113 -172
  182. package/fesm2022/timepicker-testing.mjs.map +1 -1
  183. package/fesm2022/timepicker.mjs +1019 -826
  184. package/fesm2022/timepicker.mjs.map +1 -1
  185. package/fesm2022/toolbar-testing.mjs +16 -27
  186. package/fesm2022/toolbar-testing.mjs.map +1 -1
  187. package/fesm2022/toolbar.mjs +163 -78
  188. package/fesm2022/toolbar.mjs.map +1 -1
  189. package/fesm2022/tooltip-testing.mjs +41 -52
  190. package/fesm2022/tooltip-testing.mjs.map +1 -1
  191. package/fesm2022/tooltip.mjs +36 -10
  192. package/fesm2022/tooltip.mjs.map +1 -1
  193. package/fesm2022/tree-testing.mjs +86 -162
  194. package/fesm2022/tree-testing.mjs.map +1 -1
  195. package/fesm2022/tree.mjs +638 -466
  196. package/fesm2022/tree.mjs.map +1 -1
  197. package/package.json +2 -2
  198. package/schematics/ng-add/index.js +1 -1
  199. package/types/expansion.d.ts +4 -2
  200. package/types/menu-testing.d.ts +2 -0
  201. package/types/select.d.ts +1 -1
  202. package/types/timepicker.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-sheet.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet-container.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet-container.html","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet-config.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet-ref.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet-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\nimport {CdkDialogContainer} from '@angular/cdk/dialog';\nimport {BreakpointObserver, Breakpoints} from '@angular/cdk/layout';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n OnDestroy,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {CdkPortalOutlet} from '@angular/cdk/portal';\nimport {_animationsDisabled} from '../core';\n\nconst ENTER_ANIMATION = '_mat-bottom-sheet-enter';\nconst EXIT_ANIMATION = '_mat-bottom-sheet-exit';\n\n/**\n * Internal component that wraps user-provided bottom sheet content.\n * @docs-private\n */\n@Component({\n selector: 'mat-bottom-sheet-container',\n templateUrl: 'bottom-sheet-container.html',\n styleUrl: 'bottom-sheet-container.css',\n // In Ivy embedded views will be change detected from their declaration place, rather than where\n // they were stamped out. This means that we can't have the bottom sheet container be OnPush,\n // because it might cause the sheets that were opened from a template not to be out of date.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'class': 'mat-bottom-sheet-container',\n '[class.mat-bottom-sheet-container-animations-enabled]': '!_animationsDisabled',\n '[class.mat-bottom-sheet-container-enter]': '_animationState === \"visible\"',\n '[class.mat-bottom-sheet-container-exit]': '_animationState === \"hidden\"',\n 'tabindex': '-1',\n '[attr.role]': '_config.role',\n '[attr.aria-modal]': '_config.ariaModal',\n '[attr.aria-label]': '_config.ariaLabel',\n '(animationstart)': '_handleAnimationEvent(true, $event.animationName)',\n '(animationend)': '_handleAnimationEvent(false, $event.animationName)',\n '(animationcancel)': '_handleAnimationEvent(false, $event.animationName)',\n },\n imports: [CdkPortalOutlet],\n})\nexport class MatBottomSheetContainer extends CdkDialogContainer implements OnDestroy {\n private _breakpointSubscription: Subscription;\n protected _animationsDisabled = _animationsDisabled();\n\n /** The state of the bottom sheet animations. */\n _animationState: 'void' | 'visible' | 'hidden' = 'void';\n\n /** Emits whenever the state of the animation changes. */\n _animationStateChanged = new EventEmitter<{\n toState: 'visible' | 'hidden';\n phase: 'start' | 'done';\n }>();\n\n /** Whether the component has been destroyed. */\n private _destroyed: boolean;\n\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n\n const breakpointObserver = inject(BreakpointObserver);\n\n this._breakpointSubscription = breakpointObserver\n .observe([Breakpoints.Medium, Breakpoints.Large, Breakpoints.XLarge])\n .subscribe(() => {\n const classList = (this._elementRef.nativeElement as HTMLElement).classList;\n\n classList.toggle(\n 'mat-bottom-sheet-container-medium',\n breakpointObserver.isMatched(Breakpoints.Medium),\n );\n classList.toggle(\n 'mat-bottom-sheet-container-large',\n breakpointObserver.isMatched(Breakpoints.Large),\n );\n classList.toggle(\n 'mat-bottom-sheet-container-xlarge',\n breakpointObserver.isMatched(Breakpoints.XLarge),\n );\n });\n }\n\n /** Begin animation of bottom sheet entrance into view. */\n enter(): void {\n if (!this._destroyed) {\n this._animationState = 'visible';\n this._changeDetectorRef.markForCheck();\n this._changeDetectorRef.detectChanges();\n if (this._animationsDisabled) {\n this._simulateAnimation(ENTER_ANIMATION);\n }\n }\n }\n\n /** Begin animation of the bottom sheet exiting from view. */\n exit(): void {\n if (!this._destroyed) {\n this._elementRef.nativeElement.setAttribute('mat-exit', '');\n this._animationState = 'hidden';\n this._changeDetectorRef.markForCheck();\n if (this._animationsDisabled) {\n this._simulateAnimation(EXIT_ANIMATION);\n }\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this._breakpointSubscription.unsubscribe();\n this._destroyed = true;\n }\n\n private _simulateAnimation(name: typeof ENTER_ANIMATION | typeof EXIT_ANIMATION) {\n this._ngZone.run(() => {\n this._handleAnimationEvent(true, name);\n setTimeout(() => this._handleAnimationEvent(false, name));\n });\n }\n\n protected override _trapFocus(): void {\n // The bottom sheet starts off-screen and animates in, and at the same time we trap focus\n // within it. With some styles this appears to cause the page to jump around. See:\n // https://github.com/angular/components/issues/30774. Preventing the browser from\n // scrolling resolves the issue and isn't really necessary since the bottom sheet\n // normally isn't scrollable.\n super._trapFocus({preventScroll: true});\n }\n\n protected _handleAnimationEvent(isStart: boolean, animationName: string) {\n const isEnter = animationName === ENTER_ANIMATION;\n const isExit = animationName === EXIT_ANIMATION;\n\n if (isEnter || isExit) {\n this._animationStateChanged.emit({\n toState: isEnter ? 'visible' : 'hidden',\n phase: isStart ? 'start' : 'done',\n });\n }\n }\n}\n","<ng-template cdkPortalOutlet></ng-template>\r\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 {InjectionToken, Injector, ViewContainerRef} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\nimport {ScrollStrategy} from '@angular/cdk/overlay';\n\n/** Options for where to set focus to automatically on dialog open */\nexport type AutoFocusTarget = 'dialog' | 'first-tabbable' | 'first-heading';\n\n/** Injection token that can be used to access the data that was passed in to a bottom sheet. */\nexport const MAT_BOTTOM_SHEET_DATA = new InjectionToken<any>('MatBottomSheetData');\n\n/**\n * Configuration used when opening a bottom sheet.\n */\nexport class MatBottomSheetConfig<D = any> {\n /** The view container to place the overlay for the bottom sheet into. */\n viewContainerRef?: ViewContainerRef;\n\n /**\n * Injector used for the instantiation of the component to be attached. If provided,\n * takes precedence over the injector indirectly provided by `ViewContainerRef`.\n */\n injector?: Injector;\n\n /** Extra CSS classes to be added to the bottom sheet container. */\n panelClass?: string | string[];\n\n /** Text layout direction for the bottom sheet. */\n direction?: Direction;\n\n /** Data being injected into the child component. */\n data?: D | null = null;\n\n /** Whether the bottom sheet has a backdrop. */\n hasBackdrop?: boolean = true;\n\n /** Custom class for the backdrop. */\n backdropClass?: string;\n\n /** Whether the user can use escape or clicking outside to close the bottom sheet. */\n disableClose?: boolean = false;\n\n /** Aria label to assign to the bottom sheet element. */\n ariaLabel?: string | null = null;\n\n /**\n * Whether this is a modal dialog. Used to set the `aria-modal` attribute. Off by default,\n * because it can interfere with other overlay-based components (e.g. `mat-select`) and because\n * it is redundant since the dialog marks all outside content as `aria-hidden` anyway.\n */\n ariaModal?: boolean = false;\n\n /**\n * Whether the bottom sheet should close when the user goes backwards/forwards in history.\n * Note that this usually doesn't include clicking on links (unless the user is using\n * the `HashLocationStrategy`).\n */\n closeOnNavigation?: boolean = true;\n\n /**\n * Where the bottom sheet should focus on open.\n * @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or\n * AutoFocusTarget instead.\n */\n autoFocus?: AutoFocusTarget | string | boolean = 'first-tabbable';\n\n /**\n * Whether the bottom sheet should restore focus to the\n * previously-focused element, after it's closed.\n */\n restoreFocus?: boolean = true;\n\n /** Scroll strategy to be used for the bottom sheet. */\n scrollStrategy?: ScrollStrategy;\n\n /** Height for the bottom sheet. */\n height?: string = '';\n\n /** Minimum height for the bottom sheet. If a number is provided, assumes pixel units. */\n minHeight?: number | string;\n\n /** Maximum height for the bottom sheet. If a number is provided, assumes pixel units. */\n maxHeight?: number | string;\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 {ComponentRef} from '@angular/core';\nimport {DialogRef} from '@angular/cdk/dialog';\nimport {ESCAPE, hasModifierKey} from '@angular/cdk/keycodes';\nimport {merge, Observable, Subject} from 'rxjs';\nimport {filter, take} from 'rxjs/operators';\nimport {MatBottomSheetConfig} from './bottom-sheet-config';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\n\n/**\n * Reference to a bottom sheet dispatched from the bottom sheet service.\n */\nexport class MatBottomSheetRef<T = any, R = any> {\n /** Instance of the component making up the content of the bottom sheet. */\n get instance(): T {\n return this._ref.componentInstance!;\n }\n\n /**\n * `ComponentRef` of the component opened into the bottom sheet. Will be\n * null when the bottom sheet is opened using a `TemplateRef`.\n */\n get componentRef(): ComponentRef<T> | null {\n return this._ref.componentRef;\n }\n\n /**\n * Instance of the component into which the bottom sheet content is projected.\n * @docs-private\n */\n containerInstance: MatBottomSheetContainer;\n\n /** Whether the user is allowed to close the bottom sheet. */\n disableClose: boolean | undefined;\n\n /** Subject for notifying the user that the bottom sheet has opened and appeared. */\n private readonly _afterOpened = new Subject<void>();\n\n /** Result to be passed down to the `afterDismissed` stream. */\n private _result: R | undefined;\n\n /** Handle to the timeout that's running as a fallback in case the exit animation doesn't fire. */\n private _closeFallbackTimeout: ReturnType<typeof setTimeout>;\n\n constructor(\n private _ref: DialogRef<R, T>,\n config: MatBottomSheetConfig,\n containerInstance: MatBottomSheetContainer,\n ) {\n this.containerInstance = containerInstance;\n this.disableClose = config.disableClose;\n\n // Emit when opening animation completes\n containerInstance._animationStateChanged\n .pipe(\n filter(event => event.phase === 'done' && event.toState === 'visible'),\n take(1),\n )\n .subscribe(() => {\n this._afterOpened.next();\n this._afterOpened.complete();\n });\n\n // Dispose overlay when closing animation is complete\n containerInstance._animationStateChanged\n .pipe(\n filter(event => event.phase === 'done' && event.toState === 'hidden'),\n take(1),\n )\n .subscribe(() => {\n clearTimeout(this._closeFallbackTimeout);\n this._ref.close(this._result);\n });\n\n _ref.overlayRef.detachments().subscribe(() => {\n this._ref.close(this._result);\n });\n\n merge(\n this.backdropClick(),\n this.keydownEvents().pipe(filter(event => event.keyCode === ESCAPE)),\n ).subscribe(event => {\n if (\n !this.disableClose &&\n (event.type !== 'keydown' || !hasModifierKey(event as KeyboardEvent))\n ) {\n event.preventDefault();\n this.dismiss();\n }\n });\n }\n\n /**\n * Dismisses the bottom sheet.\n * @param result Data to be passed back to the bottom sheet opener.\n */\n dismiss(result?: R): void {\n if (!this.containerInstance) {\n return;\n }\n\n // Transition the backdrop in parallel to the bottom sheet.\n this.containerInstance._animationStateChanged\n .pipe(\n filter(event => event.phase === 'start'),\n take(1),\n )\n .subscribe(() => {\n // The logic that disposes of the overlay depends on the exit animation completing, however\n // it isn't guaranteed if the parent view is destroyed while it's running. Add a fallback\n // timeout which will clean everything up if the animation hasn't fired within the specified\n // amount of time plus 100ms. We don't need to run this outside the NgZone, because for the\n // vast majority of cases the timeout will have been cleared before it has fired.\n this._closeFallbackTimeout = setTimeout(() => this._ref.close(this._result), 500);\n this._ref.overlayRef.detachBackdrop();\n });\n\n this._result = result;\n this.containerInstance.exit();\n this.containerInstance = null!;\n }\n\n /** Gets an observable that is notified when the bottom sheet is finished closing. */\n afterDismissed(): Observable<R | undefined> {\n return this._ref.closed;\n }\n\n /** Gets an observable that is notified when the bottom sheet has opened and appeared. */\n afterOpened(): Observable<void> {\n return this._afterOpened;\n }\n\n /**\n * Gets an observable that emits when the overlay's backdrop has been clicked.\n */\n backdropClick(): Observable<MouseEvent> {\n return this._ref.backdropClick;\n }\n\n /**\n * Gets an observable that emits when keydown events are targeted on the overlay.\n */\n keydownEvents(): Observable<KeyboardEvent> {\n return this._ref.keydownEvents;\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 {Dialog} from '@angular/cdk/dialog';\nimport {createBlockScrollStrategy, createGlobalPositionStrategy} from '@angular/cdk/overlay';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {Injectable, TemplateRef, InjectionToken, OnDestroy, inject, Injector} from '@angular/core';\nimport {MAT_BOTTOM_SHEET_DATA, MatBottomSheetConfig} from './bottom-sheet-config';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\nimport {MatBottomSheetRef} from './bottom-sheet-ref';\nimport {_animationsDisabled} from '../core';\n\n/** Injection token that can be used to specify default bottom sheet options. */\nexport const MAT_BOTTOM_SHEET_DEFAULT_OPTIONS = new InjectionToken<MatBottomSheetConfig>(\n 'mat-bottom-sheet-default-options',\n);\n\n/**\n * Service to trigger Material Design bottom sheets.\n */\n@Injectable({providedIn: 'root'})\nexport class MatBottomSheet implements OnDestroy {\n private _injector = inject(Injector);\n private _parentBottomSheet = inject(MatBottomSheet, {optional: true, skipSelf: true});\n private _animationsDisabled = _animationsDisabled();\n private _defaultOptions = inject<MatBottomSheetConfig>(MAT_BOTTOM_SHEET_DEFAULT_OPTIONS, {\n optional: true,\n });\n\n private _bottomSheetRefAtThisLevel: MatBottomSheetRef<any> | null = null;\n private _dialog = inject(Dialog);\n\n /** Reference to the currently opened bottom sheet. */\n get _openedBottomSheetRef(): MatBottomSheetRef<any> | null {\n const parent = this._parentBottomSheet;\n return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;\n }\n\n set _openedBottomSheetRef(value: MatBottomSheetRef<any> | null) {\n if (this._parentBottomSheet) {\n this._parentBottomSheet._openedBottomSheetRef = value;\n } else {\n this._bottomSheetRefAtThisLevel = value;\n }\n }\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /**\n * Opens a bottom sheet containing the given component.\n * @param component Type of the component to load into the bottom sheet.\n * @param config Extra configuration options.\n * @returns Reference to the newly-opened bottom sheet.\n */\n open<T, D = any, R = any>(\n component: ComponentType<T>,\n config?: MatBottomSheetConfig<D>,\n ): MatBottomSheetRef<T, R>;\n\n /**\n * Opens a bottom sheet containing the given template.\n * @param template TemplateRef to instantiate as the bottom sheet content.\n * @param config Extra configuration options.\n * @returns Reference to the newly-opened bottom sheet.\n */\n open<T, D = any, R = any>(\n template: TemplateRef<T>,\n config?: MatBottomSheetConfig<D>,\n ): MatBottomSheetRef<T, R>;\n\n open<T, D = any, R = any>(\n componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,\n config?: MatBottomSheetConfig<D>,\n ): MatBottomSheetRef<T, R> {\n const _config = {...(this._defaultOptions || new MatBottomSheetConfig()), ...config};\n let ref: MatBottomSheetRef<T, R>;\n\n this._dialog.open<R, D, T>(componentOrTemplateRef, {\n ..._config,\n // Disable closing since we need to sync it up to the animation ourselves.\n disableClose: true,\n // Disable closing on detachments so that we can sync up the animation.\n closeOnOverlayDetachments: false,\n maxWidth: '100%',\n container: MatBottomSheetContainer,\n scrollStrategy: _config.scrollStrategy || createBlockScrollStrategy(this._injector),\n positionStrategy: createGlobalPositionStrategy(this._injector)\n .centerHorizontally()\n .bottom('0'),\n disableAnimations: this._animationsDisabled,\n templateContext: () => ({bottomSheetRef: ref}),\n providers: (cdkRef, _cdkConfig, container) => {\n ref = new MatBottomSheetRef(cdkRef, _config, container as MatBottomSheetContainer);\n return [\n {provide: MatBottomSheetRef, useValue: ref},\n {provide: MAT_BOTTOM_SHEET_DATA, useValue: _config.data},\n ];\n },\n });\n\n // When the bottom sheet is dismissed, clear the reference to it.\n ref!.afterDismissed().subscribe(() => {\n // Clear the bottom sheet ref if it hasn't already been replaced by a newer one.\n if (this._openedBottomSheetRef === ref) {\n this._openedBottomSheetRef = null;\n }\n });\n\n if (this._openedBottomSheetRef) {\n // If a bottom sheet is already in view, dismiss it and enter the\n // new bottom sheet after exit animation is complete.\n this._openedBottomSheetRef.afterDismissed().subscribe(() => ref.containerInstance?.enter());\n this._openedBottomSheetRef.dismiss();\n } else {\n // If no bottom sheet is in view, enter the new bottom sheet.\n ref!.containerInstance.enter();\n }\n\n this._openedBottomSheetRef = ref!;\n return ref!;\n }\n\n /**\n * Dismisses the currently-visible bottom sheet.\n * @param result Data to pass to the bottom sheet instance.\n */\n dismiss<R = any>(result?: R): void {\n if (this._openedBottomSheetRef) {\n this._openedBottomSheetRef.dismiss(result);\n }\n }\n\n ngOnDestroy() {\n if (this._bottomSheetRefAtThisLevel) {\n this._bottomSheetRefAtThisLevel.dismiss();\n }\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 {DialogModule} from '@angular/cdk/dialog';\nimport {PortalModule} from '@angular/cdk/portal';\nimport {NgModule} from '@angular/core';\nimport {BidiModule} from '@angular/cdk/bidi';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\nimport {MatBottomSheet} from './bottom-sheet';\n\n@NgModule({\n imports: [DialogModule, PortalModule, MatBottomSheetContainer],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E,CAAC,uBAAuB,EAAE,UAAU,CAAC;oBAC9C,SAAS,EAAE,CAAC,cAAc,CAAC;AAC5B,iBAAA;;;;;"}
1
+ {"version":3,"file":"bottom-sheet.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet-container.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet-container.html","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet-config.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet-ref.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/bottom-sheet/bottom-sheet-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\nimport {CdkDialogContainer} from '@angular/cdk/dialog';\nimport {BreakpointObserver, Breakpoints} from '@angular/cdk/layout';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n OnDestroy,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {CdkPortalOutlet} from '@angular/cdk/portal';\nimport {_animationsDisabled} from '../core';\n\nconst ENTER_ANIMATION = '_mat-bottom-sheet-enter';\nconst EXIT_ANIMATION = '_mat-bottom-sheet-exit';\n\n/**\n * Internal component that wraps user-provided bottom sheet content.\n * @docs-private\n */\n@Component({\n selector: 'mat-bottom-sheet-container',\n templateUrl: 'bottom-sheet-container.html',\n styleUrl: 'bottom-sheet-container.css',\n // In Ivy embedded views will be change detected from their declaration place, rather than where\n // they were stamped out. This means that we can't have the bottom sheet container be OnPush,\n // because it might cause the sheets that were opened from a template not to be out of date.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'class': 'mat-bottom-sheet-container',\n '[class.mat-bottom-sheet-container-animations-enabled]': '!_animationsDisabled',\n '[class.mat-bottom-sheet-container-enter]': '_animationState === \"visible\"',\n '[class.mat-bottom-sheet-container-exit]': '_animationState === \"hidden\"',\n 'tabindex': '-1',\n '[attr.role]': '_config.role',\n '[attr.aria-modal]': '_config.ariaModal',\n '[attr.aria-label]': '_config.ariaLabel',\n '(animationstart)': '_handleAnimationEvent(true, $event.animationName)',\n '(animationend)': '_handleAnimationEvent(false, $event.animationName)',\n '(animationcancel)': '_handleAnimationEvent(false, $event.animationName)',\n },\n imports: [CdkPortalOutlet],\n})\nexport class MatBottomSheetContainer extends CdkDialogContainer implements OnDestroy {\n private _breakpointSubscription: Subscription;\n protected _animationsDisabled = _animationsDisabled();\n\n /** The state of the bottom sheet animations. */\n _animationState: 'void' | 'visible' | 'hidden' = 'void';\n\n /** Emits whenever the state of the animation changes. */\n _animationStateChanged = new EventEmitter<{\n toState: 'visible' | 'hidden';\n phase: 'start' | 'done';\n }>();\n\n /** Whether the component has been destroyed. */\n private _destroyed: boolean;\n\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n\n const breakpointObserver = inject(BreakpointObserver);\n\n this._breakpointSubscription = breakpointObserver\n .observe([Breakpoints.Medium, Breakpoints.Large, Breakpoints.XLarge])\n .subscribe(() => {\n const classList = (this._elementRef.nativeElement as HTMLElement).classList;\n\n classList.toggle(\n 'mat-bottom-sheet-container-medium',\n breakpointObserver.isMatched(Breakpoints.Medium),\n );\n classList.toggle(\n 'mat-bottom-sheet-container-large',\n breakpointObserver.isMatched(Breakpoints.Large),\n );\n classList.toggle(\n 'mat-bottom-sheet-container-xlarge',\n breakpointObserver.isMatched(Breakpoints.XLarge),\n );\n });\n }\n\n /** Begin animation of bottom sheet entrance into view. */\n enter(): void {\n if (!this._destroyed) {\n this._animationState = 'visible';\n this._changeDetectorRef.markForCheck();\n this._changeDetectorRef.detectChanges();\n if (this._animationsDisabled) {\n this._simulateAnimation(ENTER_ANIMATION);\n }\n }\n }\n\n /** Begin animation of the bottom sheet exiting from view. */\n exit(): void {\n if (!this._destroyed) {\n this._elementRef.nativeElement.setAttribute('mat-exit', '');\n this._animationState = 'hidden';\n this._changeDetectorRef.markForCheck();\n if (this._animationsDisabled) {\n this._simulateAnimation(EXIT_ANIMATION);\n }\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this._breakpointSubscription.unsubscribe();\n this._destroyed = true;\n }\n\n private _simulateAnimation(name: typeof ENTER_ANIMATION | typeof EXIT_ANIMATION) {\n this._ngZone.run(() => {\n this._handleAnimationEvent(true, name);\n setTimeout(() => this._handleAnimationEvent(false, name));\n });\n }\n\n protected override _trapFocus(): void {\n // The bottom sheet starts off-screen and animates in, and at the same time we trap focus\n // within it. With some styles this appears to cause the page to jump around. See:\n // https://github.com/angular/components/issues/30774. Preventing the browser from\n // scrolling resolves the issue and isn't really necessary since the bottom sheet\n // normally isn't scrollable.\n super._trapFocus({preventScroll: true});\n }\n\n protected _handleAnimationEvent(isStart: boolean, animationName: string) {\n const isEnter = animationName === ENTER_ANIMATION;\n const isExit = animationName === EXIT_ANIMATION;\n\n if (isEnter || isExit) {\n this._animationStateChanged.emit({\n toState: isEnter ? 'visible' : 'hidden',\n phase: isStart ? 'start' : 'done',\n });\n }\n }\n}\n","<ng-template cdkPortalOutlet></ng-template>\r\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 {InjectionToken, Injector, ViewContainerRef} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\nimport {ScrollStrategy} from '@angular/cdk/overlay';\n\n/** Options for where to set focus to automatically on dialog open */\nexport type AutoFocusTarget = 'dialog' | 'first-tabbable' | 'first-heading';\n\n/** Injection token that can be used to access the data that was passed in to a bottom sheet. */\nexport const MAT_BOTTOM_SHEET_DATA = new InjectionToken<any>('MatBottomSheetData');\n\n/**\n * Configuration used when opening a bottom sheet.\n */\nexport class MatBottomSheetConfig<D = any> {\n /** The view container to place the overlay for the bottom sheet into. */\n viewContainerRef?: ViewContainerRef;\n\n /**\n * Injector used for the instantiation of the component to be attached. If provided,\n * takes precedence over the injector indirectly provided by `ViewContainerRef`.\n */\n injector?: Injector;\n\n /** Extra CSS classes to be added to the bottom sheet container. */\n panelClass?: string | string[];\n\n /** Text layout direction for the bottom sheet. */\n direction?: Direction;\n\n /** Data being injected into the child component. */\n data?: D | null = null;\n\n /** Whether the bottom sheet has a backdrop. */\n hasBackdrop?: boolean = true;\n\n /** Custom class for the backdrop. */\n backdropClass?: string;\n\n /** Whether the user can use escape or clicking outside to close the bottom sheet. */\n disableClose?: boolean = false;\n\n /** Aria label to assign to the bottom sheet element. */\n ariaLabel?: string | null = null;\n\n /**\n * Whether this is a modal dialog. Used to set the `aria-modal` attribute. Off by default,\n * because it can interfere with other overlay-based components (e.g. `mat-select`) and because\n * it is redundant since the dialog marks all outside content as `aria-hidden` anyway.\n */\n ariaModal?: boolean = false;\n\n /**\n * Whether the bottom sheet should close when the user goes backwards/forwards in history.\n * Note that this usually doesn't include clicking on links (unless the user is using\n * the `HashLocationStrategy`).\n */\n closeOnNavigation?: boolean = true;\n\n /**\n * Where the bottom sheet should focus on open.\n * @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or\n * AutoFocusTarget instead.\n */\n autoFocus?: AutoFocusTarget | string | boolean = 'first-tabbable';\n\n /**\n * Whether the bottom sheet should restore focus to the\n * previously-focused element, after it's closed.\n */\n restoreFocus?: boolean = true;\n\n /** Scroll strategy to be used for the bottom sheet. */\n scrollStrategy?: ScrollStrategy;\n\n /** Height for the bottom sheet. */\n height?: string = '';\n\n /** Minimum height for the bottom sheet. If a number is provided, assumes pixel units. */\n minHeight?: number | string;\n\n /** Maximum height for the bottom sheet. If a number is provided, assumes pixel units. */\n maxHeight?: number | string;\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 {ComponentRef} from '@angular/core';\nimport {DialogRef} from '@angular/cdk/dialog';\nimport {ESCAPE, hasModifierKey} from '@angular/cdk/keycodes';\nimport {merge, Observable, Subject} from 'rxjs';\nimport {filter, take} from 'rxjs/operators';\nimport {MatBottomSheetConfig} from './bottom-sheet-config';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\n\n/**\n * Reference to a bottom sheet dispatched from the bottom sheet service.\n */\nexport class MatBottomSheetRef<T = any, R = any> {\n /** Instance of the component making up the content of the bottom sheet. */\n get instance(): T {\n return this._ref.componentInstance!;\n }\n\n /**\n * `ComponentRef` of the component opened into the bottom sheet. Will be\n * null when the bottom sheet is opened using a `TemplateRef`.\n */\n get componentRef(): ComponentRef<T> | null {\n return this._ref.componentRef;\n }\n\n /**\n * Instance of the component into which the bottom sheet content is projected.\n * @docs-private\n */\n containerInstance: MatBottomSheetContainer;\n\n /** Whether the user is allowed to close the bottom sheet. */\n disableClose: boolean | undefined;\n\n /** Subject for notifying the user that the bottom sheet has opened and appeared. */\n private readonly _afterOpened = new Subject<void>();\n\n /** Result to be passed down to the `afterDismissed` stream. */\n private _result: R | undefined;\n\n /** Handle to the timeout that's running as a fallback in case the exit animation doesn't fire. */\n private _closeFallbackTimeout: ReturnType<typeof setTimeout>;\n\n constructor(\n private _ref: DialogRef<R, T>,\n config: MatBottomSheetConfig,\n containerInstance: MatBottomSheetContainer,\n ) {\n this.containerInstance = containerInstance;\n this.disableClose = config.disableClose;\n\n // Emit when opening animation completes\n containerInstance._animationStateChanged\n .pipe(\n filter(event => event.phase === 'done' && event.toState === 'visible'),\n take(1),\n )\n .subscribe(() => {\n this._afterOpened.next();\n this._afterOpened.complete();\n });\n\n // Dispose overlay when closing animation is complete\n containerInstance._animationStateChanged\n .pipe(\n filter(event => event.phase === 'done' && event.toState === 'hidden'),\n take(1),\n )\n .subscribe(() => {\n clearTimeout(this._closeFallbackTimeout);\n this._ref.close(this._result);\n });\n\n _ref.overlayRef.detachments().subscribe(() => {\n this._ref.close(this._result);\n });\n\n merge(\n this.backdropClick(),\n this.keydownEvents().pipe(filter(event => event.keyCode === ESCAPE)),\n ).subscribe(event => {\n if (\n !this.disableClose &&\n (event.type !== 'keydown' || !hasModifierKey(event as KeyboardEvent))\n ) {\n event.preventDefault();\n this.dismiss();\n }\n });\n }\n\n /**\n * Dismisses the bottom sheet.\n * @param result Data to be passed back to the bottom sheet opener.\n */\n dismiss(result?: R): void {\n if (!this.containerInstance) {\n return;\n }\n\n // Transition the backdrop in parallel to the bottom sheet.\n this.containerInstance._animationStateChanged\n .pipe(\n filter(event => event.phase === 'start'),\n take(1),\n )\n .subscribe(() => {\n // The logic that disposes of the overlay depends on the exit animation completing, however\n // it isn't guaranteed if the parent view is destroyed while it's running. Add a fallback\n // timeout which will clean everything up if the animation hasn't fired within the specified\n // amount of time plus 100ms. We don't need to run this outside the NgZone, because for the\n // vast majority of cases the timeout will have been cleared before it has fired.\n this._closeFallbackTimeout = setTimeout(() => this._ref.close(this._result), 500);\n this._ref.overlayRef.detachBackdrop();\n });\n\n this._result = result;\n this.containerInstance.exit();\n this.containerInstance = null!;\n }\n\n /** Gets an observable that is notified when the bottom sheet is finished closing. */\n afterDismissed(): Observable<R | undefined> {\n return this._ref.closed;\n }\n\n /** Gets an observable that is notified when the bottom sheet has opened and appeared. */\n afterOpened(): Observable<void> {\n return this._afterOpened;\n }\n\n /**\n * Gets an observable that emits when the overlay's backdrop has been clicked.\n */\n backdropClick(): Observable<MouseEvent> {\n return this._ref.backdropClick;\n }\n\n /**\n * Gets an observable that emits when keydown events are targeted on the overlay.\n */\n keydownEvents(): Observable<KeyboardEvent> {\n return this._ref.keydownEvents;\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 {Dialog} from '@angular/cdk/dialog';\nimport {createBlockScrollStrategy, createGlobalPositionStrategy} from '@angular/cdk/overlay';\nimport {ComponentType} from '@angular/cdk/portal';\nimport {Injectable, TemplateRef, InjectionToken, OnDestroy, inject, Injector} from '@angular/core';\nimport {MAT_BOTTOM_SHEET_DATA, MatBottomSheetConfig} from './bottom-sheet-config';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\nimport {MatBottomSheetRef} from './bottom-sheet-ref';\nimport {_animationsDisabled} from '../core';\n\n/** Injection token that can be used to specify default bottom sheet options. */\nexport const MAT_BOTTOM_SHEET_DEFAULT_OPTIONS = new InjectionToken<MatBottomSheetConfig>(\n 'mat-bottom-sheet-default-options',\n);\n\n/**\n * Service to trigger Material Design bottom sheets.\n */\n@Injectable({providedIn: 'root'})\nexport class MatBottomSheet implements OnDestroy {\n private _injector = inject(Injector);\n private _parentBottomSheet = inject(MatBottomSheet, {optional: true, skipSelf: true});\n private _animationsDisabled = _animationsDisabled();\n private _defaultOptions = inject<MatBottomSheetConfig>(MAT_BOTTOM_SHEET_DEFAULT_OPTIONS, {\n optional: true,\n });\n\n private _bottomSheetRefAtThisLevel: MatBottomSheetRef<any> | null = null;\n private _dialog = inject(Dialog);\n\n /** Reference to the currently opened bottom sheet. */\n get _openedBottomSheetRef(): MatBottomSheetRef<any> | null {\n const parent = this._parentBottomSheet;\n return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;\n }\n\n set _openedBottomSheetRef(value: MatBottomSheetRef<any> | null) {\n if (this._parentBottomSheet) {\n this._parentBottomSheet._openedBottomSheetRef = value;\n } else {\n this._bottomSheetRefAtThisLevel = value;\n }\n }\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /**\n * Opens a bottom sheet containing the given component.\n * @param component Type of the component to load into the bottom sheet.\n * @param config Extra configuration options.\n * @returns Reference to the newly-opened bottom sheet.\n */\n open<T, D = any, R = any>(\n component: ComponentType<T>,\n config?: MatBottomSheetConfig<D>,\n ): MatBottomSheetRef<T, R>;\n\n /**\n * Opens a bottom sheet containing the given template.\n * @param template TemplateRef to instantiate as the bottom sheet content.\n * @param config Extra configuration options.\n * @returns Reference to the newly-opened bottom sheet.\n */\n open<T, D = any, R = any>(\n template: TemplateRef<T>,\n config?: MatBottomSheetConfig<D>,\n ): MatBottomSheetRef<T, R>;\n\n open<T, D = any, R = any>(\n componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,\n config?: MatBottomSheetConfig<D>,\n ): MatBottomSheetRef<T, R> {\n const _config = {...(this._defaultOptions || new MatBottomSheetConfig()), ...config};\n let ref: MatBottomSheetRef<T, R>;\n\n this._dialog.open<R, D, T>(componentOrTemplateRef, {\n ..._config,\n // Disable closing since we need to sync it up to the animation ourselves.\n disableClose: true,\n // Disable closing on detachments so that we can sync up the animation.\n closeOnOverlayDetachments: false,\n maxWidth: '100%',\n container: MatBottomSheetContainer,\n scrollStrategy: _config.scrollStrategy || createBlockScrollStrategy(this._injector),\n positionStrategy: createGlobalPositionStrategy(this._injector)\n .centerHorizontally()\n .bottom('0'),\n disableAnimations: this._animationsDisabled,\n templateContext: () => ({bottomSheetRef: ref}),\n providers: (cdkRef, _cdkConfig, container) => {\n ref = new MatBottomSheetRef(cdkRef, _config, container as MatBottomSheetContainer);\n return [\n {provide: MatBottomSheetRef, useValue: ref},\n {provide: MAT_BOTTOM_SHEET_DATA, useValue: _config.data},\n ];\n },\n });\n\n // When the bottom sheet is dismissed, clear the reference to it.\n ref!.afterDismissed().subscribe(() => {\n // Clear the bottom sheet ref if it hasn't already been replaced by a newer one.\n if (this._openedBottomSheetRef === ref) {\n this._openedBottomSheetRef = null;\n }\n });\n\n if (this._openedBottomSheetRef) {\n // If a bottom sheet is already in view, dismiss it and enter the\n // new bottom sheet after exit animation is complete.\n this._openedBottomSheetRef.afterDismissed().subscribe(() => ref.containerInstance?.enter());\n this._openedBottomSheetRef.dismiss();\n } else {\n // If no bottom sheet is in view, enter the new bottom sheet.\n ref!.containerInstance.enter();\n }\n\n this._openedBottomSheetRef = ref!;\n return ref!;\n }\n\n /**\n * Dismisses the currently-visible bottom sheet.\n * @param result Data to pass to the bottom sheet instance.\n */\n dismiss<R = any>(result?: R): void {\n if (this._openedBottomSheetRef) {\n this._openedBottomSheetRef.dismiss(result);\n }\n }\n\n ngOnDestroy() {\n if (this._bottomSheetRefAtThisLevel) {\n this._bottomSheetRefAtThisLevel.dismiss();\n }\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 {DialogModule} from '@angular/cdk/dialog';\nimport {PortalModule} from '@angular/cdk/portal';\nimport {NgModule} from '@angular/core';\nimport {BidiModule} from '@angular/cdk/bidi';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\nimport {MatBottomSheet} from './bottom-sheet';\n\n@NgModule({\n imports: [DialogModule, PortalModule, MatBottomSheetContainer],\n exports: [MatBottomSheetContainer, BidiModule],\n providers: [MatBottomSheet],\n})\nexport class MatBottomSheetModule {}\n"],"names":["ENTER_ANIMATION","EXIT_ANIMATION","MatBottomSheetContainer","CdkDialogContainer","_breakpointSubscription","_animationsDisabled","_animationState","_animationStateChanged","EventEmitter","_destroyed","constructor","breakpointObserver","inject","BreakpointObserver","observe","Breakpoints","Medium","Large","XLarge","subscribe","classList","_elementRef","nativeElement","toggle","isMatched","enter","_changeDetectorRef","markForCheck","detectChanges","_simulateAnimation","exit","setAttribute","ngOnDestroy","unsubscribe","name","_ngZone","run","_handleAnimationEvent","setTimeout","_trapFocus","preventScroll","isStart","animationName","isEnter","isExit","emit","toState","phase","deps","target","i0","ɵɵFactoryTarget","Component","isStandalone","selector","host","attributes","listeners","properties","classAttribute","usesInheritance","ngImport","template","styles","dependencies","kind","type","CdkPortalOutlet","inputs","outputs","exportAs","changeDetection","ChangeDetectionStrategy","Default","encapsulation","ViewEncapsulation","None","decorators","imports","MAT_BOTTOM_SHEET_DATA","InjectionToken","MatBottomSheetConfig","viewContainerRef","injector","panelClass","direction","data","hasBackdrop","backdropClass","disableClose","ariaLabel","ariaModal","closeOnNavigation","autoFocus","restoreFocus","scrollStrategy","height","minHeight","maxHeight","MatBottomSheetRef","_ref","instance","componentInstance","componentRef","containerInstance","_afterOpened","Subject","_result","_closeFallbackTimeout","config","pipe","filter","event","take","next","complete","clearTimeout","close","overlayRef","detachments","merge","backdropClick","keydownEvents","keyCode","ESCAPE","hasModifierKey","preventDefault","dismiss","result","detachBackdrop","afterDismissed","closed","afterOpened","MAT_BOTTOM_SHEET_DEFAULT_OPTIONS","MatBottomSheet","_injector","Injector","_parentBottomSheet","optional","skipSelf","_defaultOptions","_bottomSheetRefAtThisLevel","_dialog","Dialog","_openedBottomSheetRef","parent","value","open","componentOrTemplateRef","_config","ref","closeOnOverlayDetachments","maxWidth","container","createBlockScrollStrategy","positionStrategy","createGlobalPositionStrategy","centerHorizontally","bottom","disableAnimations","templateContext","bottomSheetRef","providers","cdkRef","_cdkConfig","provide","useValue","Injectable","ɵprov","ɵɵngDeclareInjectable","minVersion","version","providedIn","MatBottomSheetModule","NgModule","DialogModule","PortalModule","exports","BidiModule","args"],"mappings":";;;;;;;;;;;;AAsBA,MAAMA,eAAe,GAAG,yBAAyB;AACjD,MAAMC,cAAc,GAAG,wBAAwB;AA+BzC,MAAOC,uBAAwB,SAAQC,kBAAkB,CAAA;EACrDC,uBAAuB;EACrBC,mBAAmB,GAAGA,mBAAmB,EAAE;AAGrDC,EAAAA,eAAe,GAAkC,MAAM;AAGvDC,EAAAA,sBAAsB,GAAG,IAAIC,YAAY,EAGrC;EAGIC,UAAU;AAIlBC,EAAAA,WAAAA,GAAA;AACE,IAAA,KAAK,EAAE;AAEP,IAAA,MAAMC,kBAAkB,GAAGC,MAAM,CAACC,kBAAkB,CAAC;IAErD,IAAI,CAACT,uBAAuB,GAAGO,kBAAkB,CAC9CG,OAAO,CAAC,CAACC,WAAW,CAACC,MAAM,EAAED,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AAY,EACDE,UAAU;AAAA,GAAA,CAAA;;;;;;QAGlCL,oBAAoB;AAAAhG,EAAAA,UAAA,EAAA,CAAA;UALhCiG,QAAQ;AAACK,IAAAA,IAAA,EAAA,CAAA;AACRrG,MAAAA,OAAO,EAAE,CAACiG,YAAY,EAAEC,YAAY,EAAE9K,uBAAuB,CAAC;AAC9D+K,MAAAA,OAAO,EAAE,CAAC/K,uBAAuB,EAAEgL,UAAU,CAAC;MAC9ChB,SAAS,EAAE,CAAC5B,cAAc;KAC3B;;;;;;"}
@@ -2,112 +2,78 @@ import { booleanAttribute } from '@angular/core';
2
2
  import { ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
3
3
  import { MatIconHarness } from '@angular/material/icon/testing';
4
4
 
5
- /** Harness for interacting with a mat-button in tests. */
6
5
  class MatButtonHarness extends ContentContainerComponentHarness {
7
- // Note: `.mat-mdc-button-base` should be enough for all buttons, however some apps are using
8
- // the harness without actually having an applied button. Keep the attributes for backwards
9
- // compatibility.
10
- /** Selector for the harness. */
11
- static hostSelector = `.mat-mdc-button-base, [matButton], [mat-button], [matIconButton],
6
+ static hostSelector = `.mat-mdc-button-base, [matButton], [mat-button], [matIconButton],
12
7
  [matFab], [matMiniFab], [mat-raised-button], [mat-flat-button], [mat-icon-button],
13
8
  [mat-stroked-button], [mat-fab], [mat-mini-fab]`;
14
- /**
15
- * Gets a `HarnessPredicate` that can be used to search for a button with specific attributes.
16
- * @param options Options for narrowing the search:
17
- * - `selector` finds a button whose host element matches the given selector.
18
- * - `text` finds a button with specific text content.
19
- * - `variant` finds buttons matching a specific variant.
20
- * - `appearance` finds buttons matching a specific appearance.
21
- * @return a `HarnessPredicate` configured with the given options.
22
- */
23
- static with(options = {}) {
24
- return new HarnessPredicate(this, options)
25
- .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))
26
- .addOption('variant', options.variant, (harness, variant) => HarnessPredicate.stringMatches(harness.getVariant(), variant))
27
- .addOption('appearance', options.appearance, (harness, appearance) => HarnessPredicate.stringMatches(harness.getAppearance(), appearance))
28
- .addOption('disabled', options.disabled, async (harness, disabled) => {
29
- return (await harness.isDisabled()) === disabled;
30
- })
31
- .addOption('buttonType', options.buttonType, (harness, buttonType) => HarnessPredicate.stringMatches(harness.getType(), buttonType))
32
- .addOption('iconName', options.iconName, (harness, iconName) => {
33
- return harness.hasHarness(MatIconHarness.with({ name: iconName }));
34
- });
9
+ static with(options = {}) {
10
+ return new HarnessPredicate(this, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text)).addOption('variant', options.variant, (harness, variant) => HarnessPredicate.stringMatches(harness.getVariant(), variant)).addOption('appearance', options.appearance, (harness, appearance) => HarnessPredicate.stringMatches(harness.getAppearance(), appearance)).addOption('disabled', options.disabled, async (harness, disabled) => {
11
+ return (await harness.isDisabled()) === disabled;
12
+ }).addOption('buttonType', options.buttonType, (harness, buttonType) => HarnessPredicate.stringMatches(harness.getType(), buttonType)).addOption('iconName', options.iconName, (harness, iconName) => {
13
+ return harness.hasHarness(MatIconHarness.with({
14
+ name: iconName
15
+ }));
16
+ });
17
+ }
18
+ async click(...args) {
19
+ return (await this.host()).click(...args);
20
+ }
21
+ async isDisabled() {
22
+ const host = await this.host();
23
+ return booleanAttribute(await host.getAttribute('disabled')) || (await host.hasClass('mat-mdc-button-disabled'));
24
+ }
25
+ async getText() {
26
+ return (await this.host()).text();
27
+ }
28
+ async focus() {
29
+ return (await this.host()).focus();
30
+ }
31
+ async blur() {
32
+ return (await this.host()).blur();
33
+ }
34
+ async isFocused() {
35
+ return (await this.host()).isFocused();
36
+ }
37
+ async getVariant() {
38
+ const host = await this.host();
39
+ if ((await host.hasClass('mat-mdc-icon-button')) || (await host.getAttribute('mat-icon-button')) != null) {
40
+ return 'icon';
35
41
  }
36
- async click(...args) {
37
- return (await this.host()).click(...args);
42
+ if ((await host.hasClass('mat-mdc-mini-fab')) || (await host.getAttribute('mat-mini-fab')) != null) {
43
+ return 'mini-fab';
38
44
  }
39
- /** Gets a boolean promise indicating if the button is disabled. */
40
- async isDisabled() {
41
- const host = await this.host();
42
- return (booleanAttribute(await host.getAttribute('disabled')) ||
43
- (await host.hasClass('mat-mdc-button-disabled')));
45
+ if ((await host.hasClass('mat-mdc-fab')) || (await host.getAttribute('mat-fab')) != null) {
46
+ return 'fab';
44
47
  }
45
- /** Gets a promise for the button's label text. */
46
- async getText() {
47
- return (await this.host()).text();
48
+ return 'basic';
49
+ }
50
+ async getAppearance() {
51
+ const host = await this.host();
52
+ if (await host.hasClass('mat-mdc-outlined-button')) {
53
+ return 'outlined';
48
54
  }
49
- /** Focuses the button and returns a void promise that indicates when the action is complete. */
50
- async focus() {
51
- return (await this.host()).focus();
55
+ if (await host.hasClass('mat-mdc-raised-button')) {
56
+ return 'elevated';
52
57
  }
53
- /** Blurs the button and returns a void promise that indicates when the action is complete. */
54
- async blur() {
55
- return (await this.host()).blur();
58
+ if (await host.hasClass('mat-mdc-unelevated-button')) {
59
+ return 'filled';
56
60
  }
57
- /** Whether the button is focused. */
58
- async isFocused() {
59
- return (await this.host()).isFocused();
61
+ if (await host.hasClass('mat-mdc-button')) {
62
+ return 'text';
60
63
  }
61
- /** Gets the variant of the button. */
62
- async getVariant() {
63
- const host = await this.host();
64
- // TODO(crisbeto): we're checking both classes and attributes for backwards compatibility
65
- // with some internal apps that were applying the attribute without importing the directive.
66
- // Really we should be only targeting the classes.
67
- if ((await host.hasClass('mat-mdc-icon-button')) ||
68
- (await host.getAttribute('mat-icon-button')) != null) {
69
- return 'icon';
70
- }
71
- if ((await host.hasClass('mat-mdc-mini-fab')) ||
72
- (await host.getAttribute('mat-mini-fab')) != null) {
73
- return 'mini-fab';
74
- }
75
- if ((await host.hasClass('mat-mdc-fab')) || (await host.getAttribute('mat-fab')) != null) {
76
- return 'fab';
77
- }
78
- return 'basic';
64
+ if (await host.hasClass('mat-tonal-button')) {
65
+ return 'tonal';
79
66
  }
80
- /** Gets the appearance of the button. */
81
- async getAppearance() {
82
- const host = await this.host();
83
- if (await host.hasClass('mat-mdc-outlined-button')) {
84
- return 'outlined';
85
- }
86
- if (await host.hasClass('mat-mdc-raised-button')) {
87
- return 'elevated';
88
- }
89
- if (await host.hasClass('mat-mdc-unelevated-button')) {
90
- return 'filled';
91
- }
92
- if (await host.hasClass('mat-mdc-button')) {
93
- return 'text';
94
- }
95
- if (await host.hasClass('mat-tonal-button')) {
96
- return 'tonal';
97
- }
98
- return null;
99
- }
100
- /**
101
- * Gets the type of the button. Supported values are 'button', 'submit', and 'reset'.
102
- */
103
- async getType() {
104
- const host = await this.host();
105
- const buttonType = await host.getAttribute('type');
106
- if (buttonType === 'button' || buttonType === 'submit' || buttonType === 'reset') {
107
- return buttonType;
108
- }
109
- return null;
67
+ return null;
68
+ }
69
+ async getType() {
70
+ const host = await this.host();
71
+ const buttonType = await host.getAttribute('type');
72
+ if (buttonType === 'button' || buttonType === 'submit' || buttonType === 'reset') {
73
+ return buttonType;
110
74
  }
75
+ return null;
76
+ }
111
77
  }
112
78
 
113
79
  export { MatButtonHarness };
@@ -1 +1 @@
1
- {"version":3,"file":"button-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/button/testing/button-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 {booleanAttribute} from '@angular/core';\nimport {\n ComponentHarnessConstructor,\n ContentContainerComponentHarness,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {MatIconHarness} from '@angular/material/icon/testing';\nimport {\n ButtonAppearance,\n ButtonHarnessFilters,\n ButtonType,\n ButtonVariant,\n} from './button-harness-filters';\n\n/** Harness for interacting with a mat-button in tests. */\nexport class MatButtonHarness extends ContentContainerComponentHarness {\n // Note: `.mat-mdc-button-base` should be enough for all buttons, however some apps are using\n // the harness without actually having an applied button. Keep the attributes for backwards\n // compatibility.\n\n /** Selector for the harness. */\n static hostSelector = `.mat-mdc-button-base, [matButton], [mat-button], [matIconButton],\n [matFab], [matMiniFab], [mat-raised-button], [mat-flat-button], [mat-icon-button],\n [mat-stroked-button], [mat-fab], [mat-mini-fab]`;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button with specific attributes.\n * @param options Options for narrowing the search:\n * - `selector` finds a button whose host element matches the given selector.\n * - `text` finds a button with specific text content.\n * - `variant` finds buttons matching a specific variant.\n * - `appearance` finds buttons matching a specific appearance.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatButtonHarness>(\n this: ComponentHarnessConstructor<T>,\n options: ButtonHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n )\n .addOption('variant', options.variant, (harness, variant) =>\n HarnessPredicate.stringMatches(harness.getVariant(), variant),\n )\n .addOption('appearance', options.appearance, (harness, appearance) =>\n HarnessPredicate.stringMatches(harness.getAppearance(), appearance),\n )\n .addOption('disabled', options.disabled, async (harness, disabled) => {\n return (await harness.isDisabled()) === disabled;\n })\n .addOption('buttonType', options.buttonType, (harness, buttonType) =>\n HarnessPredicate.stringMatches(harness.getType(), buttonType),\n )\n .addOption('iconName', options.iconName, (harness, iconName) => {\n return harness.hasHarness(MatIconHarness.with({name: iconName}));\n });\n }\n\n /**\n * Clicks the button at the given position relative to its top-left.\n * @param relativeX The relative x position of the click.\n * @param relativeY The relative y position of the click.\n */\n click(relativeX: number, relativeY: number): Promise<void>;\n /** Clicks the button at its center. */\n click(location: 'center'): Promise<void>;\n /** Clicks the button. */\n click(): Promise<void>;\n async click(...args: [] | ['center'] | [number, number]): Promise<void> {\n return (await this.host()).click(...(args as []));\n }\n\n /** Gets a boolean promise indicating if the button is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (\n booleanAttribute(await host.getAttribute('disabled')) ||\n (await host.hasClass('mat-mdc-button-disabled'))\n );\n }\n\n /** Gets a promise for the button's label text. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Focuses the button 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 button 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 button is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Gets the variant of the button. */\n async getVariant(): Promise<ButtonVariant> {\n const host = await this.host();\n\n // TODO(crisbeto): we're checking both classes and attributes for backwards compatibility\n // with some internal apps that were applying the attribute without importing the directive.\n // Really we should be only targeting the classes.\n if (\n (await host.hasClass('mat-mdc-icon-button')) ||\n (await host.getAttribute('mat-icon-button')) != null\n ) {\n return 'icon';\n }\n\n if (\n (await host.hasClass('mat-mdc-mini-fab')) ||\n (await host.getAttribute('mat-mini-fab')) != null\n ) {\n return 'mini-fab';\n }\n\n if ((await host.hasClass('mat-mdc-fab')) || (await host.getAttribute('mat-fab')) != null) {\n return 'fab';\n }\n\n return 'basic';\n }\n\n /** Gets the appearance of the button. */\n async getAppearance(): Promise<ButtonAppearance | null> {\n const host = await this.host();\n\n if (await host.hasClass('mat-mdc-outlined-button')) {\n return 'outlined';\n }\n\n if (await host.hasClass('mat-mdc-raised-button')) {\n return 'elevated';\n }\n\n if (await host.hasClass('mat-mdc-unelevated-button')) {\n return 'filled';\n }\n\n if (await host.hasClass('mat-mdc-button')) {\n return 'text';\n }\n\n if (await host.hasClass('mat-tonal-button')) {\n return 'tonal';\n }\n\n return null;\n }\n\n /**\n * Gets the type of the button. Supported values are 'button', 'submit', and 'reset'.\n */\n async getType(): Promise<ButtonType | null> {\n const host = await this.host();\n const buttonType = await host.getAttribute('type');\n if (buttonType === 'button' || buttonType === 'submit' || buttonType === 'reset') {\n return buttonType;\n }\n return null;\n }\n}\n"],"names":[],"mappings":";;;;AAsBA;AACM,MAA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AAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;AACxF,YAAA,OAAO,KAAK;;AAGd,QAAA,OAAO,OAAO;;;AAIhB,IAAA,MAAM,aAAa,GAAA;AACjB,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE;QAE9B,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE;AAClD,YAAA,OAAO,UAAU;;QAGnB,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE;AAChD,YAAA,OAAO,UAAU;;QAGnB,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE;AACpD,YAAA,OAAO,QAAQ;;QAGjB,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;AACzC,YAAA,OAAO,MAAM;;QAGf,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE;AAC3C,YAAA,OAAO,OAAO;;AAGhB,QAAA,OAAO,IAAI;;AAGb;;AAEG;AACH,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE;QAC9B,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;AAClD,QAAA,IAAI,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,OAAO,EAAE;AAChF,YAAA,OAAO,UAAU;;AAEnB,QAAA,OAAO,IAAI;;;;;;"}
1
+ {"version":3,"file":"button-testing.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/button/testing/button-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 {booleanAttribute} from '@angular/core';\nimport {\n ComponentHarnessConstructor,\n ContentContainerComponentHarness,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {MatIconHarness} from '@angular/material/icon/testing';\nimport {\n ButtonAppearance,\n ButtonHarnessFilters,\n ButtonType,\n ButtonVariant,\n} from './button-harness-filters';\n\n/** Harness for interacting with a mat-button in tests. */\nexport class MatButtonHarness extends ContentContainerComponentHarness {\n // Note: `.mat-mdc-button-base` should be enough for all buttons, however some apps are using\n // the harness without actually having an applied button. Keep the attributes for backwards\n // compatibility.\n\n /** Selector for the harness. */\n static hostSelector = `.mat-mdc-button-base, [matButton], [mat-button], [matIconButton],\n [matFab], [matMiniFab], [mat-raised-button], [mat-flat-button], [mat-icon-button],\n [mat-stroked-button], [mat-fab], [mat-mini-fab]`;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button with specific attributes.\n * @param options Options for narrowing the search:\n * - `selector` finds a button whose host element matches the given selector.\n * - `text` finds a button with specific text content.\n * - `variant` finds buttons matching a specific variant.\n * - `appearance` finds buttons matching a specific appearance.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatButtonHarness>(\n this: ComponentHarnessConstructor<T>,\n options: ButtonHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n )\n .addOption('variant', options.variant, (harness, variant) =>\n HarnessPredicate.stringMatches(harness.getVariant(), variant),\n )\n .addOption('appearance', options.appearance, (harness, appearance) =>\n HarnessPredicate.stringMatches(harness.getAppearance(), appearance),\n )\n .addOption('disabled', options.disabled, async (harness, disabled) => {\n return (await harness.isDisabled()) === disabled;\n })\n .addOption('buttonType', options.buttonType, (harness, buttonType) =>\n HarnessPredicate.stringMatches(harness.getType(), buttonType),\n )\n .addOption('iconName', options.iconName, (harness, iconName) => {\n return harness.hasHarness(MatIconHarness.with({name: iconName}));\n });\n }\n\n /**\n * Clicks the button at the given position relative to its top-left.\n * @param relativeX The relative x position of the click.\n * @param relativeY The relative y position of the click.\n */\n click(relativeX: number, relativeY: number): Promise<void>;\n /** Clicks the button at its center. */\n click(location: 'center'): Promise<void>;\n /** Clicks the button. */\n click(): Promise<void>;\n async click(...args: [] | ['center'] | [number, number]): Promise<void> {\n return (await this.host()).click(...(args as []));\n }\n\n /** Gets a boolean promise indicating if the button is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (\n booleanAttribute(await host.getAttribute('disabled')) ||\n (await host.hasClass('mat-mdc-button-disabled'))\n );\n }\n\n /** Gets a promise for the button's label text. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Focuses the button 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 button 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 button is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Gets the variant of the button. */\n async getVariant(): Promise<ButtonVariant> {\n const host = await this.host();\n\n // TODO(crisbeto): we're checking both classes and attributes for backwards compatibility\n // with some internal apps that were applying the attribute without importing the directive.\n // Really we should be only targeting the classes.\n if (\n (await host.hasClass('mat-mdc-icon-button')) ||\n (await host.getAttribute('mat-icon-button')) != null\n ) {\n return 'icon';\n }\n\n if (\n (await host.hasClass('mat-mdc-mini-fab')) ||\n (await host.getAttribute('mat-mini-fab')) != null\n ) {\n return 'mini-fab';\n }\n\n if ((await host.hasClass('mat-mdc-fab')) || (await host.getAttribute('mat-fab')) != null) {\n return 'fab';\n }\n\n return 'basic';\n }\n\n /** Gets the appearance of the button. */\n async getAppearance(): Promise<ButtonAppearance | null> {\n const host = await this.host();\n\n if (await host.hasClass('mat-mdc-outlined-button')) {\n return 'outlined';\n }\n\n if (await host.hasClass('mat-mdc-raised-button')) {\n return 'elevated';\n }\n\n if (await host.hasClass('mat-mdc-unelevated-button')) {\n return 'filled';\n }\n\n if (await host.hasClass('mat-mdc-button')) {\n return 'text';\n }\n\n if (await host.hasClass('mat-tonal-button')) {\n return 'tonal';\n }\n\n return null;\n }\n\n /**\n * Gets the type of the button. Supported values are 'button', 'submit', and 'reset'.\n */\n async getType(): Promise<ButtonType | null> {\n const host = await this.host();\n const buttonType = await host.getAttribute('type');\n if (buttonType === 'button' || buttonType === 'submit' || buttonType === 'reset') {\n return buttonType;\n }\n return null;\n }\n}\n"],"names":["MatButtonHarness","ContentContainerComponentHarness","hostSelector","with","options","HarnessPredicate","addOption","text","harness","stringMatches","getText","variant","getVariant","appearance","getAppearance","disabled","isDisabled","buttonType","getType","iconName","hasHarness","MatIconHarness","name","click","args","host","booleanAttribute","getAttribute","hasClass","focus","blur","isFocused"],"mappings":";;;;AAuBM,MAAOA,gBAAiB,SAAQC,gCAAgC,CAAA;AAMpE,EAAA,OAAOC,YAAY,GAAG,CAAA;;mDAE4B,CAAA;AAWlD,EAAA,OAAOC,IAAIA,CAETC,OAAA,GAAgC,EAAE,EAAA;IAElC,OAAO,IAAIC,gBAAgB,CAAC,IAAI,EAAED,OAAO,CAAA,CACtCE,SAAS,CAAC,MAAM,EAAEF,OAAO,CAACG,IAAI,EAAE,CAACC,OAAO,EAAED,IAAI,KAC7CF,gBAAgB,CAACI,aAAa,CAACD,OAAO,CAACE,OAAO,EAAE,EAAEH,IAAI,CAAC,CAAA,CAExDD,SAAS,CAAC,SAAS,EAAEF,OAAO,CAACO,OAAO,EAAE,CAACH,OAAO,EAAEG,OAAO,KACtDN,gBAAgB,CAACI,aAAa,CAACD,OAAO,CAACI,UAAU,EAAE,EAAED,OAAO,CAAC,CAAA,CAE9DL,SAAS,CAAC,YAAY,EAAEF,OAAO,CAACS,UAAU,EAAE,CAACL,OAAO,EAAEK,UAAU,KAC/DR,gBAAgB,CAACI,aAAa,CAACD,OAAO,CAACM,aAAa,EAAE,EAAED,UAAU,CAAC,CAAA,CAEpEP,SAAS,CAAC,UAAU,EAAEF,OAAO,CAACW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AAMH,IAAI,CAACG,QAAQ,CAAC,kBAAkB,CAAC,EAAE;AAC3C,MAAA,OAAO,OAAO;AAChB;AAEA,IAAA,OAAO,IAAI;AACb;EAKA,MAAMV,OAAOA,GAAA;AACX,IAAA,MAAMO,IAAI,GAAG,MAAM,IAAI,CAACA,IAAI,EAAE;IAC9B,MAAMR,UAAU,GAAG,MAAMQ,IAAI,CAACE,YAAY,CAAC,MAAM,CAAC;IAClD,IAAIV,UAAU,KAAK,QAAQ,IAAIA,UAAU,KAAK,QAAQ,IAAIA,UAAU,KAAK,OAAO,EAAE;AAChF,MAAA,OAAOA,UAAU;AACnB;AACA,IAAA,OAAO,IAAI;AACb;;;;;"}
@@ -1,135 +1,86 @@
1
1
  import { ComponentHarness, HarnessPredicate, parallel } from '@angular/cdk/testing';
2
2
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
3
3
 
4
- /** Harness for interacting with a standard mat-button-toggle in tests. */
5
4
  class MatButtonToggleHarness extends ComponentHarness {
6
- /** The selector for the host element of a `MatButton` instance. */
7
- static hostSelector = '.mat-button-toggle';
8
- _label = this.locatorFor('.mat-button-toggle-label-content');
9
- _button = this.locatorFor('.mat-button-toggle-button');
10
- /**
11
- * Gets a `HarnessPredicate` that can be used to search for a `MatButtonToggleHarness` that meets
12
- * certain criteria.
13
- * @param options Options for filtering which button toggle instances are considered a match.
14
- * @return a `HarnessPredicate` configured with the given options.
15
- */
16
- static with(options = {}) {
17
- return new HarnessPredicate(MatButtonToggleHarness, options)
18
- .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))
19
- .addOption('name', options.name, (harness, name) => HarnessPredicate.stringMatches(harness.getName(), name))
20
- .addOption('checked', options.checked, async (harness, checked) => (await harness.isChecked()) === checked)
21
- .addOption('disabled', options.disabled, async (harness, disabled) => {
22
- return (await harness.isDisabled()) === disabled;
23
- });
24
- }
25
- /** Gets a boolean promise indicating if the button toggle is checked. */
26
- async isChecked() {
27
- const button = await this._button();
28
- const [checked, pressed] = await parallel(() => [
29
- button.getAttribute('aria-checked'),
30
- button.getAttribute('aria-pressed'),
31
- ]);
32
- return coerceBooleanProperty(checked) || coerceBooleanProperty(pressed);
33
- }
34
- /** Gets a boolean promise indicating if the button toggle is disabled. */
35
- async isDisabled() {
36
- const host = await this.host();
37
- return host.hasClass('mat-button-toggle-disabled');
38
- }
39
- /** Gets a promise for the button toggle's name. */
40
- async getName() {
41
- return (await this._button()).getAttribute('name');
42
- }
43
- /** Gets a promise for the button toggle's aria-label. */
44
- async getAriaLabel() {
45
- return (await this._button()).getAttribute('aria-label');
46
- }
47
- /** Gets a promise for the button toggles's aria-labelledby. */
48
- async getAriaLabelledby() {
49
- return (await this._button()).getAttribute('aria-labelledby');
50
- }
51
- /** Gets a promise for the button toggle's text. */
52
- async getText() {
53
- return (await this._label()).text();
54
- }
55
- /** Gets the appearance that the button toggle is using. */
56
- async getAppearance() {
57
- const host = await this.host();
58
- const className = 'mat-button-toggle-appearance-standard';
59
- return (await host.hasClass(className)) ? 'standard' : 'legacy';
60
- }
61
- /** Focuses the toggle. */
62
- async focus() {
63
- return (await this._button()).focus();
64
- }
65
- /** Blurs the toggle. */
66
- async blur() {
67
- return (await this._button()).blur();
68
- }
69
- /** Whether the toggle is focused. */
70
- async isFocused() {
71
- return (await this._button()).isFocused();
72
- }
73
- /** Toggle the checked state of the buttons toggle. */
74
- async toggle() {
75
- return (await this._button()).click();
76
- }
77
- /**
78
- * Puts the button toggle in a checked state by toggling it if it's
79
- * currently unchecked, or doing nothing if it is already checked.
80
- */
81
- async check() {
82
- if (!(await this.isChecked())) {
83
- await this.toggle();
84
- }
85
- }
86
- /**
87
- * Puts the button toggle in an unchecked state by toggling it if it's
88
- * currently checked, or doing nothing if it's already unchecked.
89
- */
90
- async uncheck() {
91
- if (await this.isChecked()) {
92
- await this.toggle();
93
- }
94
- }
5
+ static hostSelector = '.mat-button-toggle';
6
+ _label = this.locatorFor('.mat-button-toggle-label-content');
7
+ _button = this.locatorFor('.mat-button-toggle-button');
8
+ static with(options = {}) {
9
+ return new HarnessPredicate(MatButtonToggleHarness, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text)).addOption('name', options.name, (harness, name) => HarnessPredicate.stringMatches(harness.getName(), name)).addOption('checked', options.checked, async (harness, checked) => (await harness.isChecked()) === checked).addOption('disabled', options.disabled, async (harness, disabled) => {
10
+ return (await harness.isDisabled()) === disabled;
11
+ });
12
+ }
13
+ async isChecked() {
14
+ const button = await this._button();
15
+ const [checked, pressed] = await parallel(() => [button.getAttribute('aria-checked'), button.getAttribute('aria-pressed')]);
16
+ return coerceBooleanProperty(checked) || coerceBooleanProperty(pressed);
17
+ }
18
+ async isDisabled() {
19
+ const host = await this.host();
20
+ return host.hasClass('mat-button-toggle-disabled');
21
+ }
22
+ async getName() {
23
+ return (await this._button()).getAttribute('name');
24
+ }
25
+ async getAriaLabel() {
26
+ return (await this._button()).getAttribute('aria-label');
27
+ }
28
+ async getAriaLabelledby() {
29
+ return (await this._button()).getAttribute('aria-labelledby');
30
+ }
31
+ async getText() {
32
+ return (await this._label()).text();
33
+ }
34
+ async getAppearance() {
35
+ const host = await this.host();
36
+ const className = 'mat-button-toggle-appearance-standard';
37
+ return (await host.hasClass(className)) ? 'standard' : 'legacy';
38
+ }
39
+ async focus() {
40
+ return (await this._button()).focus();
41
+ }
42
+ async blur() {
43
+ return (await this._button()).blur();
44
+ }
45
+ async isFocused() {
46
+ return (await this._button()).isFocused();
47
+ }
48
+ async toggle() {
49
+ return (await this._button()).click();
50
+ }
51
+ async check() {
52
+ if (!(await this.isChecked())) {
53
+ await this.toggle();
54
+ }
55
+ }
56
+ async uncheck() {
57
+ if (await this.isChecked()) {
58
+ await this.toggle();
59
+ }
60
+ }
95
61
  }
96
62
 
97
- /** Harness for interacting with a standard mat-button-toggle in tests. */
98
63
  class MatButtonToggleGroupHarness extends ComponentHarness {
99
- /** The selector for the host element of a `MatButton` instance. */
100
- static hostSelector = '.mat-button-toggle-group';
101
- /**
102
- * Gets a `HarnessPredicate` that can be used to search for a `MatButtonToggleGroupHarness`
103
- * that meets certain criteria.
104
- * @param options Options for filtering which button toggle instances are considered a match.
105
- * @return a `HarnessPredicate` configured with the given options.
106
- */
107
- static with(options = {}) {
108
- return new HarnessPredicate(MatButtonToggleGroupHarness, options).addOption('disabled', options.disabled, async (harness, disabled) => {
109
- return (await harness.isDisabled()) === disabled;
110
- });
111
- }
112
- /**
113
- * Gets the button toggles that are inside the group.
114
- * @param filter Optionally filters which toggles are included.
115
- */
116
- async getToggles(filter = {}) {
117
- return this.locatorForAll(MatButtonToggleHarness.with(filter))();
118
- }
119
- /** Gets whether the button toggle group is disabled. */
120
- async isDisabled() {
121
- return (await (await this.host()).getAttribute('aria-disabled')) === 'true';
122
- }
123
- /** Gets whether the button toggle group is laid out vertically. */
124
- async isVertical() {
125
- return (await this.host()).hasClass('mat-button-toggle-vertical');
126
- }
127
- /** Gets the appearance that the group is using. */
128
- async getAppearance() {
129
- const host = await this.host();
130
- const className = 'mat-button-toggle-group-appearance-standard';
131
- return (await host.hasClass(className)) ? 'standard' : 'legacy';
132
- }
64
+ static hostSelector = '.mat-button-toggle-group';
65
+ static with(options = {}) {
66
+ return new HarnessPredicate(MatButtonToggleGroupHarness, options).addOption('disabled', options.disabled, async (harness, disabled) => {
67
+ return (await harness.isDisabled()) === disabled;
68
+ });
69
+ }
70
+ async getToggles(filter = {}) {
71
+ return this.locatorForAll(MatButtonToggleHarness.with(filter))();
72
+ }
73
+ async isDisabled() {
74
+ return (await (await this.host()).getAttribute('aria-disabled')) === 'true';
75
+ }
76
+ async isVertical() {
77
+ return (await this.host()).hasClass('mat-button-toggle-vertical');
78
+ }
79
+ async getAppearance() {
80
+ const host = await this.host();
81
+ const className = 'mat-button-toggle-group-appearance-standard';
82
+ return (await host.hasClass(className)) ? 'standard' : 'legacy';
83
+ }
133
84
  }
134
85
 
135
86
  export { MatButtonToggleGroupHarness, MatButtonToggleHarness };