@angular/material 21.0.0-next.8 → 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.
- package/core/tokens/_classes.scss +1 -1
- package/core/tokens/m2/_md-sys-color.scss +17 -17
- package/fesm2022/_animation-chunk.mjs +10 -16
- package/fesm2022/_animation-chunk.mjs.map +1 -1
- package/fesm2022/_date-formats-chunk.mjs +68 -164
- package/fesm2022/_date-formats-chunk.mjs.map +1 -1
- package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
- package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_error-options-chunk.mjs +56 -19
- package/fesm2022/_error-options-chunk.mjs.map +1 -1
- package/fesm2022/_error-state-chunk.mjs +24 -31
- package/fesm2022/_error-state-chunk.mjs.map +1 -1
- package/fesm2022/_form-field-chunk.mjs +1224 -1017
- package/fesm2022/_form-field-chunk.mjs.map +1 -1
- package/fesm2022/_icon-button-chunk.mjs +243 -187
- package/fesm2022/_icon-button-chunk.mjs.map +1 -1
- package/fesm2022/_icon-registry-chunk.mjs +350 -575
- package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
- package/fesm2022/_input-harness-chunk.mjs +56 -107
- package/fesm2022/_input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
- package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
- package/fesm2022/_internal-form-field-chunk.mjs +59 -19
- package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
- package/fesm2022/_line-chunk.mjs +83 -43
- package/fesm2022/_line-chunk.mjs.map +1 -1
- package/fesm2022/_option-chunk.mjs +348 -311
- package/fesm2022/_option-chunk.mjs.map +1 -1
- package/fesm2022/_option-harness-chunk.mjs +23 -39
- package/fesm2022/_option-harness-chunk.mjs.map +1 -1
- package/fesm2022/_option-module-chunk.mjs +36 -10
- package/fesm2022/_option-module-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
- package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
- package/fesm2022/_public-api-chunk.mjs +71 -134
- package/fesm2022/_public-api-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-chunk.mjs +504 -600
- package/fesm2022/_ripple-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-loader-chunk.mjs +120 -138
- package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-module-chunk.mjs +36 -10
- package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
- package/fesm2022/_structural-styles-chunk.mjs +37 -10
- package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
- package/fesm2022/_tooltip-chunk.mjs +810 -888
- package/fesm2022/_tooltip-chunk.mjs.map +1 -1
- package/fesm2022/autocomplete-testing.mjs +62 -86
- package/fesm2022/autocomplete-testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +965 -1126
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge-testing.mjs +38 -54
- package/fesm2022/badge-testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +321 -272
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet-testing.mjs +10 -24
- package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +349 -344
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-testing.mjs +60 -94
- package/fesm2022/button-testing.mjs.map +1 -1
- package/fesm2022/button-toggle-testing.mjs +76 -125
- package/fesm2022/button-toggle-testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +752 -662
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +263 -158
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card-testing.mjs +19 -33
- package/fesm2022/card-testing.mjs.map +1 -1
- package/fesm2022/card.mjs +576 -272
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox-testing.mjs +71 -123
- package/fesm2022/checkbox-testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +515 -477
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips-testing.mjs +201 -350
- package/fesm2022/chips-testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +2552 -2289
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core-testing.mjs +14 -28
- package/fesm2022/core-testing.mjs.map +1 -1
- package/fesm2022/core.mjs +357 -328
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker-testing.mjs +15 -25
- package/fesm2022/datepicker-testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +4826 -4563
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog-testing.mjs +93 -129
- package/fesm2022/dialog-testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +810 -829
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider-testing.mjs +10 -11
- package/fesm2022/divider-testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +119 -43
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion-testing.mjs +74 -130
- package/fesm2022/expansion-testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +703 -515
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field-testing-control.mjs +16 -33
- package/fesm2022/form-field-testing-control.mjs.map +1 -1
- package/fesm2022/form-field-testing.mjs +118 -179
- package/fesm2022/form-field-testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +36 -10
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list-testing.mjs +65 -113
- package/fesm2022/grid-list-testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +559 -494
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon-testing.mjs +148 -127
- package/fesm2022/icon-testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +325 -351
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input-testing.mjs +59 -99
- package/fesm2022/input-testing.mjs.map +1 -1
- package/fesm2022/input.mjs +457 -520
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list-testing.mjs +251 -434
- package/fesm2022/list-testing.mjs.map +1 -1
- package/fesm2022/list.mjs +1522 -1204
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs +0 -5
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +159 -228
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +1338 -1343
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator-testing.mjs +55 -79
- package/fesm2022/paginator-testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +381 -309
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar-testing.mjs +12 -21
- package/fesm2022/progress-bar-testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +224 -169
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner-testing.mjs +13 -23
- package/fesm2022/progress-spinner-testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +235 -160
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio-testing.mjs +133 -208
- package/fesm2022/radio-testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +712 -679
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select-testing.mjs +83 -117
- package/fesm2022/select-testing.mjs.map +1 -1
- package/fesm2022/select.mjs +1116 -1246
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav-testing.mjs +54 -120
- package/fesm2022/sidenav-testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +1078 -995
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle-testing.mjs +57 -92
- package/fesm2022/slide-toggle-testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +369 -279
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider-testing.mjs +90 -138
- package/fesm2022/slider-testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +1651 -1716
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar-testing.mjs +40 -87
- package/fesm2022/snack-bar-testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +763 -714
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort-testing.mjs +45 -66
- package/fesm2022/sort-testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +419 -344
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper-testing.mjs +78 -154
- package/fesm2022/stepper-testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +790 -498
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table-testing.mjs +125 -186
- package/fesm2022/table-testing.mjs.map +1 -1
- package/fesm2022/table.mjs +1026 -684
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs +125 -197
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +2351 -2028
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker-testing.mjs +113 -172
- package/fesm2022/timepicker-testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1019 -826
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +16 -27
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +163 -78
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip-testing.mjs +41 -52
- package/fesm2022/tooltip-testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +36 -10
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +86 -162
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +638 -466
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/schematics/ng-add/index.js +1 -1
- package/types/expansion.d.ts +4 -2
- package/types/menu-testing.d.ts +2 -0
- package/types/select.d.ts +1 -1
- package/types/sort.d.ts +1 -1
- package/types/table-testing.d.ts +27 -1
- package/types/timepicker.d.ts +148 -128
|
@@ -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],\n exports: [MatBottomSheetContainer, BidiModule],\n providers: [MatBottomSheet],\n})\nexport class MatBottomSheetModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,MAAM,eAAe,GAAG,yBAAyB;AACjD,MAAM,cAAc,GAAG,wBAAwB;AAE/C;;;AAGG;AA0BG,MAAO,uBAAwB,SAAQ,kBAAkB,CAAA;AACrD,IAAA,uBAAuB;IACrB,mBAAmB,GAAG,mBAAmB,EAAE;;IAGrD,eAAe,GAAkC,MAAM;;AAGvD,IAAA,sBAAsB,GAAG,IAAI,YAAY,EAGrC;;AAGI,IAAA,UAAU;AAIlB,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AAEP,QAAA,MA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AA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADF,MAAM,EAAA,CAAA;;kGAClB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;MCLnB,oBAAoB,CAAA;8GAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;+GAApB,oBAAoB,EAAA,OAAA,EAAA,CAJrB,YAAY,EAAE,YAAY,EAAE,uBAAuB,CAAA,EAAA,OAAA,EAAA,CACnD,uBAAuB,EAAE,UAAU,CAAA,EAAA,CAAA;+GAGlC,oBAAoB,EAAA,SAAA,EAFpB,CAAC,cAAc,CAAC,YAFjB,YAAY,EAAE,YAAY,EACD,UAAU,CAAA,EAAA,CAAA;;kGAGlC,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,uBAAuB,CAAC;AAC9D,oBAAA,OAAO,EAAE,CAAC,uBAAuB,EAAE,UAAU,CAAC;oBAC9C,SAAS,EAAE,CAAC,cAAc,CAAC;AAC5B,iBAAA;;;;;"}
|
|
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-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","/**\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","_breakpointSubscription","_animationsDisabled","_animationStateChanged","EventEmitter","_destroyed","constructor","inject","BreakpointObserver","breakpointObserver","observe","Breakpoints","Medium","Large","XLarge","classList","_elementRef","nativeElement","toggle","isMatched","_changeDetectorRef","markForCheck","detectChanges","_simulateAnimation","CdkPortalOutlet","template","styles","ctorParameters","MatBottomSheetConfig","viewContainerRef","panelClass","backdropClass","ariaLabel","ariaModal","MatBottomSheetRef","_ref","instance","componentInstance","componentRef","containerInstance","disableClose","config","pipe","filter","event","phase","toState","take","_afterOpened","next","complete","subscribe","clearTimeout","_closeFallbackTimeout","close","_result","keydownEvents","keyCode","ESCAPE","hasModifierKey","preventDefault","dismiss","result","MatBottomSheet","_parentBottomSheet","optional","skipSelf","_dialog","Dialog","_openedBottomSheetRef","parent","_bottomSheetRefAtThisLevel","value","_config","_defaultOptions","closeOnOverlayDetachments","maxWidth","scrollStrategy","createBlockScrollStrategy","_injector","positionStrategy","createGlobalPositionStrategy","centerHorizontally","bottom","templateContext","bottomSheetRef","ref","providers","cdkRef","_cdkConfig","container","provide","useValue","MAT_BOTTOM_SHEET_DATA","data","minVersion","version","ngImport","i0","type","MatBottomSheetModule","decorators"],"mappings":";;;;;;;;;;;;MAsBMA,eAAA,GAAA,yBAAA;AAGN,MAAAC,cAAA,GAAA,wBAAA;;EAgDIC,uBAAO;EAEPC,2CAAkC;;AAO9BC,EAAAA,sBAAA,OAAAC,YAAA,EAAA;EAuCcC,UAAA;EACbC,WAAA,GAAA;AAEL,IAAA,KAAA,EAAA;4BACF,GAAAC,MAAA,CAAAC,kBAAA,CAAA;AAGE,IAAA,IAAA,CAAAP,uBAAA,GAAAQ,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;MA8BnBE,yBAAA,EAAA,KAAA;MAEAC,QAAA,EAAA,MAAA;;AAGGC,MAAAA,cAAA,EAAAJ,OAAA,CAAAI,cAAA,IAAAC,yBAAA,MAAAC,SAAA,CAAA;AACHC,MAAAA,gBAAA,EAAAC,4BAAA,CAAA,IAAA,CAAAF,SAAA,CACEG,CAAAA,kBAA8B,GAC5BC,MAAA,CAAA,GAAA,CAAA;iDACF;AACFC,MAAAA,eAAA,EAAAA,OAAA;AAAAC,QAAAA,cAAA,EAAAC;AAAA,OAAA,CAAA;AAEWC,MAAAA,SAAA,EAAAA,CAAAC,MAAA,EAAAC,UAAA,EAAAC,SAAA,KAAA;AACTJ,QAAAA,GAAA,OAAmCpD,iBAAA,CAAAsD,MAAA,EAAAf,OAAE,EAAAiB,SAAA,CAAA;QACnC,OACF,CAAA;AAAAC,UAAAA,OAAA,EAAAzD,iBAAA;AAAA0D,UAAAA,QAAA,EAAAN;SACF,EAAA;AAAAK,UAAAA,OAAA,EAAAE,qBAAA;UAAAD,QAAA,EAAAnB,OAAA,CAAAqB;;AApHW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BCXJ,CAAA;AAAAC,EAAAA,UAAA,EAAA,QAAA;EAAAC,OAAA,EAAA,eAAA;AAAAC,EAAAA,QAAA,EAAAC,EAAA;AAAAC,EAAAA,IAAA,EAAAC,oBAAA;EAAAC,UAAA,EAAA,CAAA;;;;;;;;;;;;"}
|
|
@@ -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
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
37
|
-
|
|
42
|
+
if ((await host.hasClass('mat-mdc-mini-fab')) || (await host.getAttribute('mat-mini-fab')) != null) {
|
|
43
|
+
return 'mini-fab';
|
|
38
44
|
}
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
return (await this.host()).focus();
|
|
55
|
+
if (await host.hasClass('mat-mdc-raised-button')) {
|
|
56
|
+
return 'elevated';
|
|
52
57
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return (await this.host()).blur();
|
|
58
|
+
if (await host.hasClass('mat-mdc-unelevated-button')) {
|
|
59
|
+
return 'filled';
|
|
56
60
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return (await this.host()).isFocused();
|
|
61
|
+
if (await host.hasClass('mat-mdc-button')) {
|
|
62
|
+
return 'text';
|
|
60
63
|
}
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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":[
|
|
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":["addOption","options","buttonType","harness","HarnessPredicate","stringMatches","getType","iconName","hasHarness","MatIconHarness","with","name","click","args","host","isDisabled","hasClass","text","focus","isFocused","getVariant"],"mappings":";;;;;;AA8CI;mDAC4B,CAAA;;;;MAyC9B,CAKAA,SAAA,CAAA,YAAA,EAAAC,OAAA,CAAAC,UAAA,EAAAC,CAAAA,OAAA,EAAAD,UAAA,KAAAE,gBAAA,CAAAC,aAAA,CAAAF,OAAA,CAAAG,OAAA,EAAA,EAAAJ,UAAA,CAAA,CAAA,CAEgGF,SAAA,CAAA,UAAA,EAAAC,OAAA,CAAAM,QAAA,EAAA,CAAAJ,OAAA,EAAAI,QAChG,KAAA;AAEAJ,MAAAA,OAAAA,OAAA,CAAAK,UAAA,CAAAC,cAAA,CAAAC,IAAA,CAAA;AAAAC,QAAAA,IAAA,EAAAJ;AAE8F,OAAA,CAAA,CAAA;;;AAO5FK,EAAAA,MAAAA,KAAAA,CAAA,GAAOC,IAAC,EAAA;AACV,IAAA,OAAA,CAAAC,MAAAA,IAAAA,CAAAA,IAAA,EAAAF,EAAAA,KAAA,IAAAC,IAAA,CAAA;;kBAO8FE,GAAA;UAC1CD,IAAA,cAAAA,IAAA,EAAA;oDAoBpD,UAAA,CAAA,CAAA,KAAA,MAAAA,IAAA,CAAAE,QAAA,CAAA,yBAAA,CAAA,CAAA;;;AAOI,IAAA,OAAA,CAAA,MAAA,IAAA,CAAAF,IAAA,EAAA,EAAAG,IAAA,EAAA;;;IAQA,OAAAH,CAAAA,MAAAA,IAAAA,CAAAA,IAAA,IAAAI,KAAA,EAAA;;eAKF;;;AAOFC,EAAAA,MAAAA,SAAAA,GAAA;IAEA,OAAAL,CAAAA,MAAAA,IAAAA,CAAAA,IAAA,IAAAK,SAAA,EAAA;AAEG;AAEDC,EAAAA,MAAAA,UAAAA,GAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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 };
|