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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/core/tokens/_classes.scss +1 -1
  2. package/core/tokens/m2/_md-sys-color.scss +17 -17
  3. package/fesm2022/_animation-chunk.mjs +10 -16
  4. package/fesm2022/_animation-chunk.mjs.map +1 -1
  5. package/fesm2022/_date-formats-chunk.mjs +68 -164
  6. package/fesm2022/_date-formats-chunk.mjs.map +1 -1
  7. package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
  8. package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
  9. package/fesm2022/_error-options-chunk.mjs +56 -19
  10. package/fesm2022/_error-options-chunk.mjs.map +1 -1
  11. package/fesm2022/_error-state-chunk.mjs +24 -31
  12. package/fesm2022/_error-state-chunk.mjs.map +1 -1
  13. package/fesm2022/_form-field-chunk.mjs +1224 -1017
  14. package/fesm2022/_form-field-chunk.mjs.map +1 -1
  15. package/fesm2022/_icon-button-chunk.mjs +243 -187
  16. package/fesm2022/_icon-button-chunk.mjs.map +1 -1
  17. package/fesm2022/_icon-registry-chunk.mjs +350 -575
  18. package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
  19. package/fesm2022/_input-harness-chunk.mjs +56 -107
  20. package/fesm2022/_input-harness-chunk.mjs.map +1 -1
  21. package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
  22. package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
  23. package/fesm2022/_internal-form-field-chunk.mjs +59 -19
  24. package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
  25. package/fesm2022/_line-chunk.mjs +83 -43
  26. package/fesm2022/_line-chunk.mjs.map +1 -1
  27. package/fesm2022/_option-chunk.mjs +348 -311
  28. package/fesm2022/_option-chunk.mjs.map +1 -1
  29. package/fesm2022/_option-harness-chunk.mjs +23 -39
  30. package/fesm2022/_option-harness-chunk.mjs.map +1 -1
  31. package/fesm2022/_option-module-chunk.mjs +36 -10
  32. package/fesm2022/_option-module-chunk.mjs.map +1 -1
  33. package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
  34. package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
  35. package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
  36. package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
  37. package/fesm2022/_public-api-chunk.mjs +71 -134
  38. package/fesm2022/_public-api-chunk.mjs.map +1 -1
  39. package/fesm2022/_ripple-chunk.mjs +504 -600
  40. package/fesm2022/_ripple-chunk.mjs.map +1 -1
  41. package/fesm2022/_ripple-loader-chunk.mjs +120 -138
  42. package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
  43. package/fesm2022/_ripple-module-chunk.mjs +36 -10
  44. package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
  45. package/fesm2022/_structural-styles-chunk.mjs +37 -10
  46. package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
  47. package/fesm2022/_tooltip-chunk.mjs +810 -888
  48. package/fesm2022/_tooltip-chunk.mjs.map +1 -1
  49. package/fesm2022/autocomplete-testing.mjs +62 -86
  50. package/fesm2022/autocomplete-testing.mjs.map +1 -1
  51. package/fesm2022/autocomplete.mjs +965 -1126
  52. package/fesm2022/autocomplete.mjs.map +1 -1
  53. package/fesm2022/badge-testing.mjs +38 -54
  54. package/fesm2022/badge-testing.mjs.map +1 -1
  55. package/fesm2022/badge.mjs +321 -272
  56. package/fesm2022/badge.mjs.map +1 -1
  57. package/fesm2022/bottom-sheet-testing.mjs +10 -24
  58. package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
  59. package/fesm2022/bottom-sheet.mjs +349 -344
  60. package/fesm2022/bottom-sheet.mjs.map +1 -1
  61. package/fesm2022/button-testing.mjs +60 -94
  62. package/fesm2022/button-testing.mjs.map +1 -1
  63. package/fesm2022/button-toggle-testing.mjs +76 -125
  64. package/fesm2022/button-toggle-testing.mjs.map +1 -1
  65. package/fesm2022/button-toggle.mjs +752 -662
  66. package/fesm2022/button-toggle.mjs.map +1 -1
  67. package/fesm2022/button.mjs +263 -158
  68. package/fesm2022/button.mjs.map +1 -1
  69. package/fesm2022/card-testing.mjs +19 -33
  70. package/fesm2022/card-testing.mjs.map +1 -1
  71. package/fesm2022/card.mjs +576 -272
  72. package/fesm2022/card.mjs.map +1 -1
  73. package/fesm2022/checkbox-testing.mjs +71 -123
  74. package/fesm2022/checkbox-testing.mjs.map +1 -1
  75. package/fesm2022/checkbox.mjs +515 -477
  76. package/fesm2022/checkbox.mjs.map +1 -1
  77. package/fesm2022/chips-testing.mjs +201 -344
  78. package/fesm2022/chips-testing.mjs.map +1 -1
  79. package/fesm2022/chips.mjs +2552 -2289
  80. package/fesm2022/chips.mjs.map +1 -1
  81. package/fesm2022/core-testing.mjs +14 -28
  82. package/fesm2022/core-testing.mjs.map +1 -1
  83. package/fesm2022/core.mjs +357 -328
  84. package/fesm2022/core.mjs.map +1 -1
  85. package/fesm2022/datepicker-testing.mjs +15 -25
  86. package/fesm2022/datepicker-testing.mjs.map +1 -1
  87. package/fesm2022/datepicker.mjs +4826 -4563
  88. package/fesm2022/datepicker.mjs.map +1 -1
  89. package/fesm2022/dialog-testing.mjs +93 -129
  90. package/fesm2022/dialog-testing.mjs.map +1 -1
  91. package/fesm2022/dialog.mjs +810 -829
  92. package/fesm2022/dialog.mjs.map +1 -1
  93. package/fesm2022/divider-testing.mjs +10 -11
  94. package/fesm2022/divider-testing.mjs.map +1 -1
  95. package/fesm2022/divider.mjs +119 -43
  96. package/fesm2022/divider.mjs.map +1 -1
  97. package/fesm2022/expansion-testing.mjs +74 -130
  98. package/fesm2022/expansion-testing.mjs.map +1 -1
  99. package/fesm2022/expansion.mjs +703 -515
  100. package/fesm2022/expansion.mjs.map +1 -1
  101. package/fesm2022/form-field-testing-control.mjs +16 -33
  102. package/fesm2022/form-field-testing-control.mjs.map +1 -1
  103. package/fesm2022/form-field-testing.mjs +118 -179
  104. package/fesm2022/form-field-testing.mjs.map +1 -1
  105. package/fesm2022/form-field.mjs +36 -10
  106. package/fesm2022/form-field.mjs.map +1 -1
  107. package/fesm2022/grid-list-testing.mjs +65 -113
  108. package/fesm2022/grid-list-testing.mjs.map +1 -1
  109. package/fesm2022/grid-list.mjs +559 -494
  110. package/fesm2022/grid-list.mjs.map +1 -1
  111. package/fesm2022/icon-testing.mjs +148 -127
  112. package/fesm2022/icon-testing.mjs.map +1 -1
  113. package/fesm2022/icon.mjs +325 -351
  114. package/fesm2022/icon.mjs.map +1 -1
  115. package/fesm2022/input-testing.mjs +59 -99
  116. package/fesm2022/input-testing.mjs.map +1 -1
  117. package/fesm2022/input.mjs +457 -520
  118. package/fesm2022/input.mjs.map +1 -1
  119. package/fesm2022/list-testing.mjs +251 -434
  120. package/fesm2022/list-testing.mjs.map +1 -1
  121. package/fesm2022/list.mjs +1522 -1204
  122. package/fesm2022/list.mjs.map +1 -1
  123. package/fesm2022/material.mjs +0 -5
  124. package/fesm2022/material.mjs.map +1 -1
  125. package/fesm2022/menu-testing.mjs +159 -228
  126. package/fesm2022/menu-testing.mjs.map +1 -1
  127. package/fesm2022/menu.mjs +1338 -1343
  128. package/fesm2022/menu.mjs.map +1 -1
  129. package/fesm2022/paginator-testing.mjs +55 -79
  130. package/fesm2022/paginator-testing.mjs.map +1 -1
  131. package/fesm2022/paginator.mjs +381 -309
  132. package/fesm2022/paginator.mjs.map +1 -1
  133. package/fesm2022/progress-bar-testing.mjs +12 -21
  134. package/fesm2022/progress-bar-testing.mjs.map +1 -1
  135. package/fesm2022/progress-bar.mjs +224 -169
  136. package/fesm2022/progress-bar.mjs.map +1 -1
  137. package/fesm2022/progress-spinner-testing.mjs +13 -23
  138. package/fesm2022/progress-spinner-testing.mjs.map +1 -1
  139. package/fesm2022/progress-spinner.mjs +235 -160
  140. package/fesm2022/progress-spinner.mjs.map +1 -1
  141. package/fesm2022/radio-testing.mjs +133 -208
  142. package/fesm2022/radio-testing.mjs.map +1 -1
  143. package/fesm2022/radio.mjs +712 -679
  144. package/fesm2022/radio.mjs.map +1 -1
  145. package/fesm2022/select-testing.mjs +83 -117
  146. package/fesm2022/select-testing.mjs.map +1 -1
  147. package/fesm2022/select.mjs +1116 -1246
  148. package/fesm2022/select.mjs.map +1 -1
  149. package/fesm2022/sidenav-testing.mjs +54 -120
  150. package/fesm2022/sidenav-testing.mjs.map +1 -1
  151. package/fesm2022/sidenav.mjs +1078 -995
  152. package/fesm2022/sidenav.mjs.map +1 -1
  153. package/fesm2022/slide-toggle-testing.mjs +57 -92
  154. package/fesm2022/slide-toggle-testing.mjs.map +1 -1
  155. package/fesm2022/slide-toggle.mjs +369 -279
  156. package/fesm2022/slide-toggle.mjs.map +1 -1
  157. package/fesm2022/slider-testing.mjs +90 -138
  158. package/fesm2022/slider-testing.mjs.map +1 -1
  159. package/fesm2022/slider.mjs +1651 -1716
  160. package/fesm2022/slider.mjs.map +1 -1
  161. package/fesm2022/snack-bar-testing.mjs +40 -87
  162. package/fesm2022/snack-bar-testing.mjs.map +1 -1
  163. package/fesm2022/snack-bar.mjs +763 -714
  164. package/fesm2022/snack-bar.mjs.map +1 -1
  165. package/fesm2022/sort-testing.mjs +45 -66
  166. package/fesm2022/sort-testing.mjs.map +1 -1
  167. package/fesm2022/sort.mjs +419 -344
  168. package/fesm2022/sort.mjs.map +1 -1
  169. package/fesm2022/stepper-testing.mjs +78 -154
  170. package/fesm2022/stepper-testing.mjs.map +1 -1
  171. package/fesm2022/stepper.mjs +790 -498
  172. package/fesm2022/stepper.mjs.map +1 -1
  173. package/fesm2022/table-testing.mjs +120 -213
  174. package/fesm2022/table-testing.mjs.map +1 -1
  175. package/fesm2022/table.mjs +1026 -684
  176. package/fesm2022/table.mjs.map +1 -1
  177. package/fesm2022/tabs-testing.mjs +125 -197
  178. package/fesm2022/tabs-testing.mjs.map +1 -1
  179. package/fesm2022/tabs.mjs +2351 -2028
  180. package/fesm2022/tabs.mjs.map +1 -1
  181. package/fesm2022/timepicker-testing.mjs +113 -172
  182. package/fesm2022/timepicker-testing.mjs.map +1 -1
  183. package/fesm2022/timepicker.mjs +1019 -826
  184. package/fesm2022/timepicker.mjs.map +1 -1
  185. package/fesm2022/toolbar-testing.mjs +16 -27
  186. package/fesm2022/toolbar-testing.mjs.map +1 -1
  187. package/fesm2022/toolbar.mjs +163 -78
  188. package/fesm2022/toolbar.mjs.map +1 -1
  189. package/fesm2022/tooltip-testing.mjs +41 -52
  190. package/fesm2022/tooltip-testing.mjs.map +1 -1
  191. package/fesm2022/tooltip.mjs +36 -10
  192. package/fesm2022/tooltip.mjs.map +1 -1
  193. package/fesm2022/tree-testing.mjs +86 -162
  194. package/fesm2022/tree-testing.mjs.map +1 -1
  195. package/fesm2022/tree.mjs +638 -466
  196. package/fesm2022/tree.mjs.map +1 -1
  197. package/package.json +2 -2
  198. package/schematics/ng-add/index.js +1 -1
  199. package/types/expansion.d.ts +4 -2
  200. package/types/menu-testing.d.ts +2 -0
  201. package/types/select.d.ts +1 -1
  202. package/types/timepicker.d.ts +1 -0
@@ -12,374 +12,379 @@ import { filter, take } from 'rxjs/operators';
12
12
 
13
13
  const ENTER_ANIMATION = '_mat-bottom-sheet-enter';
14
14
  const EXIT_ANIMATION = '_mat-bottom-sheet-exit';
15
- /**
16
- * Internal component that wraps user-provided bottom sheet content.
17
- * @docs-private
18
- */
19
15
  class MatBottomSheetContainer extends CdkDialogContainer {
20
- _breakpointSubscription;
21
- _animationsDisabled = _animationsDisabled();
22
- /** The state of the bottom sheet animations. */
23
- _animationState = 'void';
24
- /** Emits whenever the state of the animation changes. */
25
- _animationStateChanged = new EventEmitter();
26
- /** Whether the component has been destroyed. */
27
- _destroyed;
28
- constructor() {
29
- super();
30
- const breakpointObserver = inject(BreakpointObserver);
31
- this._breakpointSubscription = breakpointObserver
32
- .observe([Breakpoints.Medium, Breakpoints.Large, Breakpoints.XLarge])
33
- .subscribe(() => {
34
- const classList = this._elementRef.nativeElement.classList;
35
- classList.toggle('mat-bottom-sheet-container-medium', breakpointObserver.isMatched(Breakpoints.Medium));
36
- classList.toggle('mat-bottom-sheet-container-large', breakpointObserver.isMatched(Breakpoints.Large));
37
- classList.toggle('mat-bottom-sheet-container-xlarge', breakpointObserver.isMatched(Breakpoints.XLarge));
38
- });
39
- }
40
- /** Begin animation of bottom sheet entrance into view. */
41
- enter() {
42
- if (!this._destroyed) {
43
- this._animationState = 'visible';
44
- this._changeDetectorRef.markForCheck();
45
- this._changeDetectorRef.detectChanges();
46
- if (this._animationsDisabled) {
47
- this._simulateAnimation(ENTER_ANIMATION);
48
- }
49
- }
50
- }
51
- /** Begin animation of the bottom sheet exiting from view. */
52
- exit() {
53
- if (!this._destroyed) {
54
- this._elementRef.nativeElement.setAttribute('mat-exit', '');
55
- this._animationState = 'hidden';
56
- this._changeDetectorRef.markForCheck();
57
- if (this._animationsDisabled) {
58
- this._simulateAnimation(EXIT_ANIMATION);
59
- }
60
- }
61
- }
62
- ngOnDestroy() {
63
- super.ngOnDestroy();
64
- this._breakpointSubscription.unsubscribe();
65
- this._destroyed = true;
66
- }
67
- _simulateAnimation(name) {
68
- this._ngZone.run(() => {
69
- this._handleAnimationEvent(true, name);
70
- setTimeout(() => this._handleAnimationEvent(false, name));
71
- });
16
+ _breakpointSubscription;
17
+ _animationsDisabled = _animationsDisabled();
18
+ _animationState = 'void';
19
+ _animationStateChanged = new EventEmitter();
20
+ _destroyed;
21
+ constructor() {
22
+ super();
23
+ const breakpointObserver = inject(BreakpointObserver);
24
+ this._breakpointSubscription = breakpointObserver.observe([Breakpoints.Medium, Breakpoints.Large, Breakpoints.XLarge]).subscribe(() => {
25
+ const classList = this._elementRef.nativeElement.classList;
26
+ classList.toggle('mat-bottom-sheet-container-medium', breakpointObserver.isMatched(Breakpoints.Medium));
27
+ classList.toggle('mat-bottom-sheet-container-large', breakpointObserver.isMatched(Breakpoints.Large));
28
+ classList.toggle('mat-bottom-sheet-container-xlarge', breakpointObserver.isMatched(Breakpoints.XLarge));
29
+ });
30
+ }
31
+ enter() {
32
+ if (!this._destroyed) {
33
+ this._animationState = 'visible';
34
+ this._changeDetectorRef.markForCheck();
35
+ this._changeDetectorRef.detectChanges();
36
+ if (this._animationsDisabled) {
37
+ this._simulateAnimation(ENTER_ANIMATION);
38
+ }
72
39
  }
73
- _trapFocus() {
74
- // The bottom sheet starts off-screen and animates in, and at the same time we trap focus
75
- // within it. With some styles this appears to cause the page to jump around. See:
76
- // https://github.com/angular/components/issues/30774. Preventing the browser from
77
- // scrolling resolves the issue and isn't really necessary since the bottom sheet
78
- // normally isn't scrollable.
79
- super._trapFocus({ preventScroll: true });
40
+ }
41
+ exit() {
42
+ if (!this._destroyed) {
43
+ this._elementRef.nativeElement.setAttribute('mat-exit', '');
44
+ this._animationState = 'hidden';
45
+ this._changeDetectorRef.markForCheck();
46
+ if (this._animationsDisabled) {
47
+ this._simulateAnimation(EXIT_ANIMATION);
48
+ }
80
49
  }
81
- _handleAnimationEvent(isStart, animationName) {
82
- const isEnter = animationName === ENTER_ANIMATION;
83
- const isExit = animationName === EXIT_ANIMATION;
84
- if (isEnter || isExit) {
85
- this._animationStateChanged.emit({
86
- toState: isEnter ? 'visible' : 'hidden',
87
- phase: isStart ? 'start' : 'done',
88
- });
89
- }
50
+ }
51
+ ngOnDestroy() {
52
+ super.ngOnDestroy();
53
+ this._breakpointSubscription.unsubscribe();
54
+ this._destroyed = true;
55
+ }
56
+ _simulateAnimation(name) {
57
+ this._ngZone.run(() => {
58
+ this._handleAnimationEvent(true, name);
59
+ setTimeout(() => this._handleAnimationEvent(false, name));
60
+ });
61
+ }
62
+ _trapFocus() {
63
+ super._trapFocus({
64
+ preventScroll: true
65
+ });
66
+ }
67
+ _handleAnimationEvent(isStart, animationName) {
68
+ const isEnter = animationName === ENTER_ANIMATION;
69
+ const isExit = animationName === EXIT_ANIMATION;
70
+ if (isEnter || isExit) {
71
+ this._animationStateChanged.emit({
72
+ toState: isEnter ? 'visible' : 'hidden',
73
+ phase: isStart ? 'start' : 'done'
74
+ });
90
75
  }
91
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatBottomSheetContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
92
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.0-next.2", type: MatBottomSheetContainer, isStandalone: true, selector: "mat-bottom-sheet-container", host: { attributes: { "tabindex": "-1" }, listeners: { "animationstart": "_handleAnimationEvent(true, $event.animationName)", "animationend": "_handleAnimationEvent(false, $event.animationName)", "animationcancel": "_handleAnimationEvent(false, $event.animationName)" }, properties: { "class.mat-bottom-sheet-container-animations-enabled": "!_animationsDisabled", "class.mat-bottom-sheet-container-enter": "_animationState === \"visible\"", "class.mat-bottom-sheet-container-exit": "_animationState === \"hidden\"", "attr.role": "_config.role", "attr.aria-modal": "_config.ariaModal", "attr.aria-label": "_config.ariaLabel" }, classAttribute: "mat-bottom-sheet-container" }, usesInheritance: true, ngImport: i0, template: "<ng-template cdkPortalOutlet></ng-template>\r\n", styles: ["@keyframes _mat-bottom-sheet-enter{from{transform:translateY(100%)}to{transform:none}}@keyframes _mat-bottom-sheet-exit{from{transform:none}to{transform:translateY(100%)}}.mat-bottom-sheet-container{box-shadow:0px 8px 10px -5px rgba(0, 0, 0, 0.2), 0px 16px 24px 2px rgba(0, 0, 0, 0.14), 0px 6px 30px 5px rgba(0, 0, 0, 0.12);padding:8px 16px;min-width:100vw;box-sizing:border-box;display:block;outline:0;max-height:80vh;overflow:auto;position:relative;background:var(--mat-bottom-sheet-container-background-color, var(--mat-sys-surface-container-low));color:var(--mat-bottom-sheet-container-text-color, var(--mat-sys-on-surface));font-family:var(--mat-bottom-sheet-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-bottom-sheet-container-text-size, var(--mat-sys-body-large-size));line-height:var(--mat-bottom-sheet-container-text-line-height, var(--mat-sys-body-large-line-height));font-weight:var(--mat-bottom-sheet-container-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-bottom-sheet-container-text-tracking, var(--mat-sys-body-large-tracking))}@media(forced-colors: active){.mat-bottom-sheet-container{outline:1px solid}}.mat-bottom-sheet-container-animations-enabled{transform:translateY(100%)}.mat-bottom-sheet-container-animations-enabled.mat-bottom-sheet-container-enter{animation:_mat-bottom-sheet-enter 195ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-bottom-sheet-container-animations-enabled.mat-bottom-sheet-container-exit{animation:_mat-bottom-sheet-exit 375ms cubic-bezier(0.4, 0, 1, 1) backwards}.mat-bottom-sheet-container-xlarge,.mat-bottom-sheet-container-large,.mat-bottom-sheet-container-medium{border-top-left-radius:var(--mat-bottom-sheet-container-shape, 28px);border-top-right-radius:var(--mat-bottom-sheet-container-shape, 28px)}.mat-bottom-sheet-container-medium{min-width:384px;max-width:calc(100vw - 128px)}.mat-bottom-sheet-container-large{min-width:512px;max-width:calc(100vw - 256px)}.mat-bottom-sheet-container-xlarge{min-width:576px;max-width:calc(100vw - 384px)}\n"], dependencies: [{ kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
76
+ }
77
+ static ɵfac = i0.ɵɵngDeclareFactory({
78
+ minVersion: "12.0.0",
79
+ version: "20.2.0-next.2",
80
+ ngImport: i0,
81
+ type: MatBottomSheetContainer,
82
+ deps: [],
83
+ target: i0.ɵɵFactoryTarget.Component
84
+ });
85
+ static ɵcmp = i0.ɵɵngDeclareComponent({
86
+ minVersion: "14.0.0",
87
+ version: "20.2.0-next.2",
88
+ type: MatBottomSheetContainer,
89
+ isStandalone: true,
90
+ selector: "mat-bottom-sheet-container",
91
+ host: {
92
+ attributes: {
93
+ "tabindex": "-1"
94
+ },
95
+ listeners: {
96
+ "animationstart": "_handleAnimationEvent(true, $event.animationName)",
97
+ "animationend": "_handleAnimationEvent(false, $event.animationName)",
98
+ "animationcancel": "_handleAnimationEvent(false, $event.animationName)"
99
+ },
100
+ properties: {
101
+ "class.mat-bottom-sheet-container-animations-enabled": "!_animationsDisabled",
102
+ "class.mat-bottom-sheet-container-enter": "_animationState === \"visible\"",
103
+ "class.mat-bottom-sheet-container-exit": "_animationState === \"hidden\"",
104
+ "attr.role": "_config.role",
105
+ "attr.aria-modal": "_config.ariaModal",
106
+ "attr.aria-label": "_config.ariaLabel"
107
+ },
108
+ classAttribute: "mat-bottom-sheet-container"
109
+ },
110
+ usesInheritance: true,
111
+ ngImport: i0,
112
+ template: "<ng-template cdkPortalOutlet></ng-template>\r\n",
113
+ styles: ["@keyframes _mat-bottom-sheet-enter{from{transform:translateY(100%)}to{transform:none}}@keyframes _mat-bottom-sheet-exit{from{transform:none}to{transform:translateY(100%)}}.mat-bottom-sheet-container{box-shadow:0px 8px 10px -5px rgba(0, 0, 0, 0.2), 0px 16px 24px 2px rgba(0, 0, 0, 0.14), 0px 6px 30px 5px rgba(0, 0, 0, 0.12);padding:8px 16px;min-width:100vw;box-sizing:border-box;display:block;outline:0;max-height:80vh;overflow:auto;position:relative;background:var(--mat-bottom-sheet-container-background-color, var(--mat-sys-surface-container-low));color:var(--mat-bottom-sheet-container-text-color, var(--mat-sys-on-surface));font-family:var(--mat-bottom-sheet-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-bottom-sheet-container-text-size, var(--mat-sys-body-large-size));line-height:var(--mat-bottom-sheet-container-text-line-height, var(--mat-sys-body-large-line-height));font-weight:var(--mat-bottom-sheet-container-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-bottom-sheet-container-text-tracking, var(--mat-sys-body-large-tracking))}@media(forced-colors: active){.mat-bottom-sheet-container{outline:1px solid}}.mat-bottom-sheet-container-animations-enabled{transform:translateY(100%)}.mat-bottom-sheet-container-animations-enabled.mat-bottom-sheet-container-enter{animation:_mat-bottom-sheet-enter 195ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-bottom-sheet-container-animations-enabled.mat-bottom-sheet-container-exit{animation:_mat-bottom-sheet-exit 375ms cubic-bezier(0.4, 0, 1, 1) backwards}.mat-bottom-sheet-container-xlarge,.mat-bottom-sheet-container-large,.mat-bottom-sheet-container-medium{border-top-left-radius:var(--mat-bottom-sheet-container-shape, 28px);border-top-right-radius:var(--mat-bottom-sheet-container-shape, 28px)}.mat-bottom-sheet-container-medium{min-width:384px;max-width:calc(100vw - 128px)}.mat-bottom-sheet-container-large{min-width:512px;max-width:calc(100vw - 256px)}.mat-bottom-sheet-container-xlarge{min-width:576px;max-width:calc(100vw - 384px)}\n"],
114
+ dependencies: [{
115
+ kind: "directive",
116
+ type: CdkPortalOutlet,
117
+ selector: "[cdkPortalOutlet]",
118
+ inputs: ["cdkPortalOutlet"],
119
+ outputs: ["attached"],
120
+ exportAs: ["cdkPortalOutlet"]
121
+ }],
122
+ changeDetection: i0.ChangeDetectionStrategy.Default,
123
+ encapsulation: i0.ViewEncapsulation.None
124
+ });
93
125
  }
94
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatBottomSheetContainer, decorators: [{
95
- type: Component,
96
- args: [{ selector: 'mat-bottom-sheet-container', changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, host: {
97
- 'class': 'mat-bottom-sheet-container',
98
- '[class.mat-bottom-sheet-container-animations-enabled]': '!_animationsDisabled',
99
- '[class.mat-bottom-sheet-container-enter]': '_animationState === "visible"',
100
- '[class.mat-bottom-sheet-container-exit]': '_animationState === "hidden"',
101
- 'tabindex': '-1',
102
- '[attr.role]': '_config.role',
103
- '[attr.aria-modal]': '_config.ariaModal',
104
- '[attr.aria-label]': '_config.ariaLabel',
105
- '(animationstart)': '_handleAnimationEvent(true, $event.animationName)',
106
- '(animationend)': '_handleAnimationEvent(false, $event.animationName)',
107
- '(animationcancel)': '_handleAnimationEvent(false, $event.animationName)',
108
- }, imports: [CdkPortalOutlet], template: "<ng-template cdkPortalOutlet></ng-template>\r\n", styles: ["@keyframes _mat-bottom-sheet-enter{from{transform:translateY(100%)}to{transform:none}}@keyframes _mat-bottom-sheet-exit{from{transform:none}to{transform:translateY(100%)}}.mat-bottom-sheet-container{box-shadow:0px 8px 10px -5px rgba(0, 0, 0, 0.2), 0px 16px 24px 2px rgba(0, 0, 0, 0.14), 0px 6px 30px 5px rgba(0, 0, 0, 0.12);padding:8px 16px;min-width:100vw;box-sizing:border-box;display:block;outline:0;max-height:80vh;overflow:auto;position:relative;background:var(--mat-bottom-sheet-container-background-color, var(--mat-sys-surface-container-low));color:var(--mat-bottom-sheet-container-text-color, var(--mat-sys-on-surface));font-family:var(--mat-bottom-sheet-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-bottom-sheet-container-text-size, var(--mat-sys-body-large-size));line-height:var(--mat-bottom-sheet-container-text-line-height, var(--mat-sys-body-large-line-height));font-weight:var(--mat-bottom-sheet-container-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-bottom-sheet-container-text-tracking, var(--mat-sys-body-large-tracking))}@media(forced-colors: active){.mat-bottom-sheet-container{outline:1px solid}}.mat-bottom-sheet-container-animations-enabled{transform:translateY(100%)}.mat-bottom-sheet-container-animations-enabled.mat-bottom-sheet-container-enter{animation:_mat-bottom-sheet-enter 195ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-bottom-sheet-container-animations-enabled.mat-bottom-sheet-container-exit{animation:_mat-bottom-sheet-exit 375ms cubic-bezier(0.4, 0, 1, 1) backwards}.mat-bottom-sheet-container-xlarge,.mat-bottom-sheet-container-large,.mat-bottom-sheet-container-medium{border-top-left-radius:var(--mat-bottom-sheet-container-shape, 28px);border-top-right-radius:var(--mat-bottom-sheet-container-shape, 28px)}.mat-bottom-sheet-container-medium{min-width:384px;max-width:calc(100vw - 128px)}.mat-bottom-sheet-container-large{min-width:512px;max-width:calc(100vw - 256px)}.mat-bottom-sheet-container-xlarge{min-width:576px;max-width:calc(100vw - 384px)}\n"] }]
109
- }], ctorParameters: () => [] });
126
+ i0.ɵɵngDeclareClassMetadata({
127
+ minVersion: "12.0.0",
128
+ version: "20.2.0-next.2",
129
+ ngImport: i0,
130
+ type: MatBottomSheetContainer,
131
+ decorators: [{
132
+ type: Component,
133
+ args: [{
134
+ selector: 'mat-bottom-sheet-container',
135
+ changeDetection: ChangeDetectionStrategy.Default,
136
+ encapsulation: ViewEncapsulation.None,
137
+ host: {
138
+ 'class': 'mat-bottom-sheet-container',
139
+ '[class.mat-bottom-sheet-container-animations-enabled]': '!_animationsDisabled',
140
+ '[class.mat-bottom-sheet-container-enter]': '_animationState === "visible"',
141
+ '[class.mat-bottom-sheet-container-exit]': '_animationState === "hidden"',
142
+ 'tabindex': '-1',
143
+ '[attr.role]': '_config.role',
144
+ '[attr.aria-modal]': '_config.ariaModal',
145
+ '[attr.aria-label]': '_config.ariaLabel',
146
+ '(animationstart)': '_handleAnimationEvent(true, $event.animationName)',
147
+ '(animationend)': '_handleAnimationEvent(false, $event.animationName)',
148
+ '(animationcancel)': '_handleAnimationEvent(false, $event.animationName)'
149
+ },
150
+ imports: [CdkPortalOutlet],
151
+ template: "<ng-template cdkPortalOutlet></ng-template>\r\n",
152
+ styles: ["@keyframes _mat-bottom-sheet-enter{from{transform:translateY(100%)}to{transform:none}}@keyframes _mat-bottom-sheet-exit{from{transform:none}to{transform:translateY(100%)}}.mat-bottom-sheet-container{box-shadow:0px 8px 10px -5px rgba(0, 0, 0, 0.2), 0px 16px 24px 2px rgba(0, 0, 0, 0.14), 0px 6px 30px 5px rgba(0, 0, 0, 0.12);padding:8px 16px;min-width:100vw;box-sizing:border-box;display:block;outline:0;max-height:80vh;overflow:auto;position:relative;background:var(--mat-bottom-sheet-container-background-color, var(--mat-sys-surface-container-low));color:var(--mat-bottom-sheet-container-text-color, var(--mat-sys-on-surface));font-family:var(--mat-bottom-sheet-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-bottom-sheet-container-text-size, var(--mat-sys-body-large-size));line-height:var(--mat-bottom-sheet-container-text-line-height, var(--mat-sys-body-large-line-height));font-weight:var(--mat-bottom-sheet-container-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-bottom-sheet-container-text-tracking, var(--mat-sys-body-large-tracking))}@media(forced-colors: active){.mat-bottom-sheet-container{outline:1px solid}}.mat-bottom-sheet-container-animations-enabled{transform:translateY(100%)}.mat-bottom-sheet-container-animations-enabled.mat-bottom-sheet-container-enter{animation:_mat-bottom-sheet-enter 195ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-bottom-sheet-container-animations-enabled.mat-bottom-sheet-container-exit{animation:_mat-bottom-sheet-exit 375ms cubic-bezier(0.4, 0, 1, 1) backwards}.mat-bottom-sheet-container-xlarge,.mat-bottom-sheet-container-large,.mat-bottom-sheet-container-medium{border-top-left-radius:var(--mat-bottom-sheet-container-shape, 28px);border-top-right-radius:var(--mat-bottom-sheet-container-shape, 28px)}.mat-bottom-sheet-container-medium{min-width:384px;max-width:calc(100vw - 128px)}.mat-bottom-sheet-container-large{min-width:512px;max-width:calc(100vw - 256px)}.mat-bottom-sheet-container-xlarge{min-width:576px;max-width:calc(100vw - 384px)}\n"]
153
+ }]
154
+ }],
155
+ ctorParameters: () => []
156
+ });
110
157
 
111
- /** Injection token that can be used to access the data that was passed in to a bottom sheet. */
112
158
  const MAT_BOTTOM_SHEET_DATA = new InjectionToken('MatBottomSheetData');
113
- /**
114
- * Configuration used when opening a bottom sheet.
115
- */
116
159
  class MatBottomSheetConfig {
117
- /** The view container to place the overlay for the bottom sheet into. */
118
- viewContainerRef;
119
- /**
120
- * Injector used for the instantiation of the component to be attached. If provided,
121
- * takes precedence over the injector indirectly provided by `ViewContainerRef`.
122
- */
123
- injector;
124
- /** Extra CSS classes to be added to the bottom sheet container. */
125
- panelClass;
126
- /** Text layout direction for the bottom sheet. */
127
- direction;
128
- /** Data being injected into the child component. */
129
- data = null;
130
- /** Whether the bottom sheet has a backdrop. */
131
- hasBackdrop = true;
132
- /** Custom class for the backdrop. */
133
- backdropClass;
134
- /** Whether the user can use escape or clicking outside to close the bottom sheet. */
135
- disableClose = false;
136
- /** Aria label to assign to the bottom sheet element. */
137
- ariaLabel = null;
138
- /**
139
- * Whether this is a modal dialog. Used to set the `aria-modal` attribute. Off by default,
140
- * because it can interfere with other overlay-based components (e.g. `mat-select`) and because
141
- * it is redundant since the dialog marks all outside content as `aria-hidden` anyway.
142
- */
143
- ariaModal = false;
144
- /**
145
- * Whether the bottom sheet should close when the user goes backwards/forwards in history.
146
- * Note that this usually doesn't include clicking on links (unless the user is using
147
- * the `HashLocationStrategy`).
148
- */
149
- closeOnNavigation = true;
150
- /**
151
- * Where the bottom sheet should focus on open.
152
- * @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or
153
- * AutoFocusTarget instead.
154
- */
155
- autoFocus = 'first-tabbable';
156
- /**
157
- * Whether the bottom sheet should restore focus to the
158
- * previously-focused element, after it's closed.
159
- */
160
- restoreFocus = true;
161
- /** Scroll strategy to be used for the bottom sheet. */
162
- scrollStrategy;
163
- /** Height for the bottom sheet. */
164
- height = '';
165
- /** Minimum height for the bottom sheet. If a number is provided, assumes pixel units. */
166
- minHeight;
167
- /** Maximum height for the bottom sheet. If a number is provided, assumes pixel units. */
168
- maxHeight;
160
+ viewContainerRef;
161
+ injector;
162
+ panelClass;
163
+ direction;
164
+ data = null;
165
+ hasBackdrop = true;
166
+ backdropClass;
167
+ disableClose = false;
168
+ ariaLabel = null;
169
+ ariaModal = false;
170
+ closeOnNavigation = true;
171
+ autoFocus = 'first-tabbable';
172
+ restoreFocus = true;
173
+ scrollStrategy;
174
+ height = '';
175
+ minHeight;
176
+ maxHeight;
169
177
  }
170
178
 
171
- /**
172
- * Reference to a bottom sheet dispatched from the bottom sheet service.
173
- */
174
179
  class MatBottomSheetRef {
175
- _ref;
176
- /** Instance of the component making up the content of the bottom sheet. */
177
- get instance() {
178
- return this._ref.componentInstance;
179
- }
180
- /**
181
- * `ComponentRef` of the component opened into the bottom sheet. Will be
182
- * null when the bottom sheet is opened using a `TemplateRef`.
183
- */
184
- get componentRef() {
185
- return this._ref.componentRef;
186
- }
187
- /**
188
- * Instance of the component into which the bottom sheet content is projected.
189
- * @docs-private
190
- */
191
- containerInstance;
192
- /** Whether the user is allowed to close the bottom sheet. */
193
- disableClose;
194
- /** Subject for notifying the user that the bottom sheet has opened and appeared. */
195
- _afterOpened = new Subject();
196
- /** Result to be passed down to the `afterDismissed` stream. */
197
- _result;
198
- /** Handle to the timeout that's running as a fallback in case the exit animation doesn't fire. */
199
- _closeFallbackTimeout;
200
- constructor(_ref, config, containerInstance) {
201
- this._ref = _ref;
202
- this.containerInstance = containerInstance;
203
- this.disableClose = config.disableClose;
204
- // Emit when opening animation completes
205
- containerInstance._animationStateChanged
206
- .pipe(filter(event => event.phase === 'done' && event.toState === 'visible'), take(1))
207
- .subscribe(() => {
208
- this._afterOpened.next();
209
- this._afterOpened.complete();
210
- });
211
- // Dispose overlay when closing animation is complete
212
- containerInstance._animationStateChanged
213
- .pipe(filter(event => event.phase === 'done' && event.toState === 'hidden'), take(1))
214
- .subscribe(() => {
215
- clearTimeout(this._closeFallbackTimeout);
216
- this._ref.close(this._result);
217
- });
218
- _ref.overlayRef.detachments().subscribe(() => {
219
- this._ref.close(this._result);
220
- });
221
- merge(this.backdropClick(), this.keydownEvents().pipe(filter(event => event.keyCode === ESCAPE))).subscribe(event => {
222
- if (!this.disableClose &&
223
- (event.type !== 'keydown' || !hasModifierKey(event))) {
224
- event.preventDefault();
225
- this.dismiss();
226
- }
227
- });
228
- }
229
- /**
230
- * Dismisses the bottom sheet.
231
- * @param result Data to be passed back to the bottom sheet opener.
232
- */
233
- dismiss(result) {
234
- if (!this.containerInstance) {
235
- return;
236
- }
237
- // Transition the backdrop in parallel to the bottom sheet.
238
- this.containerInstance._animationStateChanged
239
- .pipe(filter(event => event.phase === 'start'), take(1))
240
- .subscribe(() => {
241
- // The logic that disposes of the overlay depends on the exit animation completing, however
242
- // it isn't guaranteed if the parent view is destroyed while it's running. Add a fallback
243
- // timeout which will clean everything up if the animation hasn't fired within the specified
244
- // amount of time plus 100ms. We don't need to run this outside the NgZone, because for the
245
- // vast majority of cases the timeout will have been cleared before it has fired.
246
- this._closeFallbackTimeout = setTimeout(() => this._ref.close(this._result), 500);
247
- this._ref.overlayRef.detachBackdrop();
248
- });
249
- this._result = result;
250
- this.containerInstance.exit();
251
- this.containerInstance = null;
252
- }
253
- /** Gets an observable that is notified when the bottom sheet is finished closing. */
254
- afterDismissed() {
255
- return this._ref.closed;
256
- }
257
- /** Gets an observable that is notified when the bottom sheet has opened and appeared. */
258
- afterOpened() {
259
- return this._afterOpened;
260
- }
261
- /**
262
- * Gets an observable that emits when the overlay's backdrop has been clicked.
263
- */
264
- backdropClick() {
265
- return this._ref.backdropClick;
266
- }
267
- /**
268
- * Gets an observable that emits when keydown events are targeted on the overlay.
269
- */
270
- keydownEvents() {
271
- return this._ref.keydownEvents;
180
+ _ref;
181
+ get instance() {
182
+ return this._ref.componentInstance;
183
+ }
184
+ get componentRef() {
185
+ return this._ref.componentRef;
186
+ }
187
+ containerInstance;
188
+ disableClose;
189
+ _afterOpened = new Subject();
190
+ _result;
191
+ _closeFallbackTimeout;
192
+ constructor(_ref, config, containerInstance) {
193
+ this._ref = _ref;
194
+ this.containerInstance = containerInstance;
195
+ this.disableClose = config.disableClose;
196
+ containerInstance._animationStateChanged.pipe(filter(event => event.phase === 'done' && event.toState === 'visible'), take(1)).subscribe(() => {
197
+ this._afterOpened.next();
198
+ this._afterOpened.complete();
199
+ });
200
+ containerInstance._animationStateChanged.pipe(filter(event => event.phase === 'done' && event.toState === 'hidden'), take(1)).subscribe(() => {
201
+ clearTimeout(this._closeFallbackTimeout);
202
+ this._ref.close(this._result);
203
+ });
204
+ _ref.overlayRef.detachments().subscribe(() => {
205
+ this._ref.close(this._result);
206
+ });
207
+ merge(this.backdropClick(), this.keydownEvents().pipe(filter(event => event.keyCode === ESCAPE))).subscribe(event => {
208
+ if (!this.disableClose && (event.type !== 'keydown' || !hasModifierKey(event))) {
209
+ event.preventDefault();
210
+ this.dismiss();
211
+ }
212
+ });
213
+ }
214
+ dismiss(result) {
215
+ if (!this.containerInstance) {
216
+ return;
272
217
  }
218
+ this.containerInstance._animationStateChanged.pipe(filter(event => event.phase === 'start'), take(1)).subscribe(() => {
219
+ this._closeFallbackTimeout = setTimeout(() => this._ref.close(this._result), 500);
220
+ this._ref.overlayRef.detachBackdrop();
221
+ });
222
+ this._result = result;
223
+ this.containerInstance.exit();
224
+ this.containerInstance = null;
225
+ }
226
+ afterDismissed() {
227
+ return this._ref.closed;
228
+ }
229
+ afterOpened() {
230
+ return this._afterOpened;
231
+ }
232
+ backdropClick() {
233
+ return this._ref.backdropClick;
234
+ }
235
+ keydownEvents() {
236
+ return this._ref.keydownEvents;
237
+ }
273
238
  }
274
239
 
275
- /** Injection token that can be used to specify default bottom sheet options. */
276
240
  const MAT_BOTTOM_SHEET_DEFAULT_OPTIONS = new InjectionToken('mat-bottom-sheet-default-options');
277
- /**
278
- * Service to trigger Material Design bottom sheets.
279
- */
280
241
  class MatBottomSheet {
281
- _injector = inject(Injector);
282
- _parentBottomSheet = inject(MatBottomSheet, { optional: true, skipSelf: true });
283
- _animationsDisabled = _animationsDisabled();
284
- _defaultOptions = inject(MAT_BOTTOM_SHEET_DEFAULT_OPTIONS, {
285
- optional: true,
286
- });
287
- _bottomSheetRefAtThisLevel = null;
288
- _dialog = inject(Dialog);
289
- /** Reference to the currently opened bottom sheet. */
290
- get _openedBottomSheetRef() {
291
- const parent = this._parentBottomSheet;
292
- return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;
293
- }
294
- set _openedBottomSheetRef(value) {
295
- if (this._parentBottomSheet) {
296
- this._parentBottomSheet._openedBottomSheetRef = value;
297
- }
298
- else {
299
- this._bottomSheetRefAtThisLevel = value;
300
- }
242
+ _injector = inject(Injector);
243
+ _parentBottomSheet = inject(MatBottomSheet, {
244
+ optional: true,
245
+ skipSelf: true
246
+ });
247
+ _animationsDisabled = _animationsDisabled();
248
+ _defaultOptions = inject(MAT_BOTTOM_SHEET_DEFAULT_OPTIONS, {
249
+ optional: true
250
+ });
251
+ _bottomSheetRefAtThisLevel = null;
252
+ _dialog = inject(Dialog);
253
+ get _openedBottomSheetRef() {
254
+ const parent = this._parentBottomSheet;
255
+ return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;
256
+ }
257
+ set _openedBottomSheetRef(value) {
258
+ if (this._parentBottomSheet) {
259
+ this._parentBottomSheet._openedBottomSheetRef = value;
260
+ } else {
261
+ this._bottomSheetRefAtThisLevel = value;
301
262
  }
302
- constructor() { }
303
- open(componentOrTemplateRef, config) {
304
- const _config = { ...(this._defaultOptions || new MatBottomSheetConfig()), ...config };
305
- let ref;
306
- this._dialog.open(componentOrTemplateRef, {
307
- ..._config,
308
- // Disable closing since we need to sync it up to the animation ourselves.
309
- disableClose: true,
310
- // Disable closing on detachments so that we can sync up the animation.
311
- closeOnOverlayDetachments: false,
312
- maxWidth: '100%',
313
- container: MatBottomSheetContainer,
314
- scrollStrategy: _config.scrollStrategy || createBlockScrollStrategy(this._injector),
315
- positionStrategy: createGlobalPositionStrategy(this._injector)
316
- .centerHorizontally()
317
- .bottom('0'),
318
- disableAnimations: this._animationsDisabled,
319
- templateContext: () => ({ bottomSheetRef: ref }),
320
- providers: (cdkRef, _cdkConfig, container) => {
321
- ref = new MatBottomSheetRef(cdkRef, _config, container);
322
- return [
323
- { provide: MatBottomSheetRef, useValue: ref },
324
- { provide: MAT_BOTTOM_SHEET_DATA, useValue: _config.data },
325
- ];
326
- },
327
- });
328
- // When the bottom sheet is dismissed, clear the reference to it.
329
- ref.afterDismissed().subscribe(() => {
330
- // Clear the bottom sheet ref if it hasn't already been replaced by a newer one.
331
- if (this._openedBottomSheetRef === ref) {
332
- this._openedBottomSheetRef = null;
333
- }
334
- });
335
- if (this._openedBottomSheetRef) {
336
- // If a bottom sheet is already in view, dismiss it and enter the
337
- // new bottom sheet after exit animation is complete.
338
- this._openedBottomSheetRef.afterDismissed().subscribe(() => ref.containerInstance?.enter());
339
- this._openedBottomSheetRef.dismiss();
340
- }
341
- else {
342
- // If no bottom sheet is in view, enter the new bottom sheet.
343
- ref.containerInstance.enter();
344
- }
345
- this._openedBottomSheetRef = ref;
346
- return ref;
263
+ }
264
+ constructor() {}
265
+ open(componentOrTemplateRef, config) {
266
+ const _config = {
267
+ ...(this._defaultOptions || new MatBottomSheetConfig()),
268
+ ...config
269
+ };
270
+ let ref;
271
+ this._dialog.open(componentOrTemplateRef, {
272
+ ..._config,
273
+ disableClose: true,
274
+ closeOnOverlayDetachments: false,
275
+ maxWidth: '100%',
276
+ container: MatBottomSheetContainer,
277
+ scrollStrategy: _config.scrollStrategy || createBlockScrollStrategy(this._injector),
278
+ positionStrategy: createGlobalPositionStrategy(this._injector).centerHorizontally().bottom('0'),
279
+ disableAnimations: this._animationsDisabled,
280
+ templateContext: () => ({
281
+ bottomSheetRef: ref
282
+ }),
283
+ providers: (cdkRef, _cdkConfig, container) => {
284
+ ref = new MatBottomSheetRef(cdkRef, _config, container);
285
+ return [{
286
+ provide: MatBottomSheetRef,
287
+ useValue: ref
288
+ }, {
289
+ provide: MAT_BOTTOM_SHEET_DATA,
290
+ useValue: _config.data
291
+ }];
292
+ }
293
+ });
294
+ ref.afterDismissed().subscribe(() => {
295
+ if (this._openedBottomSheetRef === ref) {
296
+ this._openedBottomSheetRef = null;
297
+ }
298
+ });
299
+ if (this._openedBottomSheetRef) {
300
+ this._openedBottomSheetRef.afterDismissed().subscribe(() => ref.containerInstance?.enter());
301
+ this._openedBottomSheetRef.dismiss();
302
+ } else {
303
+ ref.containerInstance.enter();
347
304
  }
348
- /**
349
- * Dismisses the currently-visible bottom sheet.
350
- * @param result Data to pass to the bottom sheet instance.
351
- */
352
- dismiss(result) {
353
- if (this._openedBottomSheetRef) {
354
- this._openedBottomSheetRef.dismiss(result);
355
- }
305
+ this._openedBottomSheetRef = ref;
306
+ return ref;
307
+ }
308
+ dismiss(result) {
309
+ if (this._openedBottomSheetRef) {
310
+ this._openedBottomSheetRef.dismiss(result);
356
311
  }
357
- ngOnDestroy() {
358
- if (this._bottomSheetRefAtThisLevel) {
359
- this._bottomSheetRefAtThisLevel.dismiss();
360
- }
312
+ }
313
+ ngOnDestroy() {
314
+ if (this._bottomSheetRefAtThisLevel) {
315
+ this._bottomSheetRefAtThisLevel.dismiss();
361
316
  }
362
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatBottomSheet, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
363
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatBottomSheet, providedIn: 'root' });
317
+ }
318
+ static ɵfac = i0.ɵɵngDeclareFactory({
319
+ minVersion: "12.0.0",
320
+ version: "20.2.0-next.2",
321
+ ngImport: i0,
322
+ type: MatBottomSheet,
323
+ deps: [],
324
+ target: i0.ɵɵFactoryTarget.Injectable
325
+ });
326
+ static ɵprov = i0.ɵɵngDeclareInjectable({
327
+ minVersion: "12.0.0",
328
+ version: "20.2.0-next.2",
329
+ ngImport: i0,
330
+ type: MatBottomSheet,
331
+ providedIn: 'root'
332
+ });
364
333
  }
365
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatBottomSheet, decorators: [{
366
- type: Injectable,
367
- args: [{ providedIn: 'root' }]
368
- }], ctorParameters: () => [] });
334
+ i0.ɵɵngDeclareClassMetadata({
335
+ minVersion: "12.0.0",
336
+ version: "20.2.0-next.2",
337
+ ngImport: i0,
338
+ type: MatBottomSheet,
339
+ decorators: [{
340
+ type: Injectable,
341
+ args: [{
342
+ providedIn: 'root'
343
+ }]
344
+ }],
345
+ ctorParameters: () => []
346
+ });
369
347
 
370
348
  class MatBottomSheetModule {
371
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatBottomSheetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
372
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatBottomSheetModule, imports: [DialogModule, PortalModule, MatBottomSheetContainer], exports: [MatBottomSheetContainer, BidiModule] });
373
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatBottomSheetModule, providers: [MatBottomSheet], imports: [DialogModule, PortalModule, BidiModule] });
349
+ static ɵfac = i0.ɵɵngDeclareFactory({
350
+ minVersion: "12.0.0",
351
+ version: "20.2.0-next.2",
352
+ ngImport: i0,
353
+ type: MatBottomSheetModule,
354
+ deps: [],
355
+ target: i0.ɵɵFactoryTarget.NgModule
356
+ });
357
+ static ɵmod = i0.ɵɵngDeclareNgModule({
358
+ minVersion: "14.0.0",
359
+ version: "20.2.0-next.2",
360
+ ngImport: i0,
361
+ type: MatBottomSheetModule,
362
+ imports: [DialogModule, PortalModule, MatBottomSheetContainer],
363
+ exports: [MatBottomSheetContainer, BidiModule]
364
+ });
365
+ static ɵinj = i0.ɵɵngDeclareInjector({
366
+ minVersion: "12.0.0",
367
+ version: "20.2.0-next.2",
368
+ ngImport: i0,
369
+ type: MatBottomSheetModule,
370
+ providers: [MatBottomSheet],
371
+ imports: [DialogModule, PortalModule, BidiModule]
372
+ });
374
373
  }
375
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatBottomSheetModule, decorators: [{
376
- type: NgModule,
377
- args: [{
378
- imports: [DialogModule, PortalModule, MatBottomSheetContainer],
379
- exports: [MatBottomSheetContainer, BidiModule],
380
- providers: [MatBottomSheet],
381
- }]
382
- }] });
374
+ i0.ɵɵngDeclareClassMetadata({
375
+ minVersion: "12.0.0",
376
+ version: "20.2.0-next.2",
377
+ ngImport: i0,
378
+ type: MatBottomSheetModule,
379
+ decorators: [{
380
+ type: NgModule,
381
+ args: [{
382
+ imports: [DialogModule, PortalModule, MatBottomSheetContainer],
383
+ exports: [MatBottomSheetContainer, BidiModule],
384
+ providers: [MatBottomSheet]
385
+ }]
386
+ }]
387
+ });
383
388
 
384
389
  export { MAT_BOTTOM_SHEET_DATA, MAT_BOTTOM_SHEET_DEFAULT_OPTIONS, MatBottomSheet, MatBottomSheetConfig, MatBottomSheetContainer, MatBottomSheetModule, MatBottomSheetRef };
385
390
  //# sourceMappingURL=bottom-sheet.mjs.map