Skip to content

Commit f53b10f

Browse files
committed
review changes
1 parent ab0dbe5 commit f53b10f

File tree

6 files changed

+42
-42
lines changed

6 files changed

+42
-42
lines changed

src/material-experimental/mdc-snack-bar/simple-snack-bar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import {ChangeDetectionStrategy, Component, Inject, ViewEncapsulation} from '@angular/core';
1010
import {
1111
MAT_SNACK_BAR_DATA,
12-
TextOnlySnackBar,
12+
_TextOnlySnackBar,
1313
MatSnackBarRef,
1414
SimpleSnackBar
1515
} from '@angular/material/snack-bar';
@@ -25,7 +25,7 @@ import {
2525
'class': 'mat-mdc-simple-snack-bar',
2626
}
2727
})
28-
export class MatSimpleSnackBar implements TextOnlySnackBar {
28+
export class MatSimpleSnackBar implements _TextOnlySnackBar {
2929
constructor(
3030
public snackBarRef: MatSnackBarRef<SimpleSnackBar>,
3131
@Inject(MAT_SNACK_BAR_DATA) public data: {message: string, action: string}) {

src/material-experimental/mdc-snack-bar/snack-bar-container.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
ViewChild,
2424
ViewEncapsulation
2525
} from '@angular/core';
26-
import {MatSnackBarConfig, MatSnackBarContainerInterface} from '@angular/material/snack-bar';
26+
import {MatSnackBarConfig, _SnackBarContainer} from '@angular/material/snack-bar';
2727
import {MDCSnackbarAdapter, MDCSnackbarFoundation} from '@material/snackbar';
2828
import {Observable, Subject} from 'rxjs';
2929

@@ -58,7 +58,7 @@ const MDC_SNACKBAR_LABEL_CLASS = 'mdc-snackbar__label';
5858
}
5959
})
6060
export class MatSnackBarContainer extends BasePortalOutlet
61-
implements MatSnackBarContainerInterface, AfterViewChecked, OnDestroy {
61+
implements _SnackBarContainer, AfterViewChecked, OnDestroy {
6262
/** Subject for notifying that the snack bar has exited from view. */
6363
readonly _onExit: Subject<void> = new Subject();
6464

src/material/snack-bar/simple-snack-bar.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import {MatSnackBarRef} from './snack-bar-ref';
1515
* Internal interface for a simple snack bar component..
1616
* @docs-private
1717
*/
18-
export interface TextOnlySnackBar {
18+
export interface _TextOnlySnackBar {
1919
data: {message: string, action: string};
20-
snackBarRef: MatSnackBarRef<TextOnlySnackBar>;
20+
snackBarRef: MatSnackBarRef<_TextOnlySnackBar>;
2121
}
2222

2323
/**
@@ -34,7 +34,7 @@ export interface TextOnlySnackBar {
3434
'class': 'mat-simple-snackbar',
3535
}
3636
})
37-
export class SimpleSnackBar implements TextOnlySnackBar {
37+
export class SimpleSnackBar implements _TextOnlySnackBar {
3838
/** Data that was injected into the snack bar. */
3939
data: {message: string, action: string};
4040

src/material/snack-bar/snack-bar-ref.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {OverlayRef} from '@angular/cdk/overlay';
1010
import {Observable, Subject} from 'rxjs';
11-
import {MatSnackBarContainerInterface} from './snack-bar-container';
11+
import {_SnackBarContainer} from './snack-bar-container';
1212

1313

1414
/** Event that is emitted when a snack bar is dismissed. */
@@ -31,7 +31,7 @@ export class MatSnackBarRef<T> {
3131
* The instance of the component making up the content of the snack bar.
3232
* @docs-private
3333
*/
34-
containerInstance: MatSnackBarContainerInterface;
34+
containerInstance: _SnackBarContainer;
3535

3636
/** Subject for notifying the user that the snack bar has been dismissed. */
3737
private readonly _afterDismissed = new Subject<MatSnackBarDismiss>();
@@ -51,7 +51,7 @@ export class MatSnackBarRef<T> {
5151
/** Whether the snack bar was dismissed using the action button. */
5252
private _dismissedByAction = false;
5353

54-
constructor(containerInstance: MatSnackBarContainerInterface,
54+
constructor(containerInstance: _SnackBarContainer,
5555
private _overlayRef: OverlayRef) {
5656
this.containerInstance = containerInstance;
5757
// Dismiss snackbar on action.

src/material/snack-bar/snack-bar.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import {
2323
OnDestroy, Type,
2424
} from '@angular/core';
2525
import {takeUntil} from 'rxjs/operators';
26-
import {TextOnlySnackBar, SimpleSnackBar} from './simple-snack-bar';
26+
import {_TextOnlySnackBar, SimpleSnackBar} from './simple-snack-bar';
2727
import {MAT_SNACK_BAR_DATA, MatSnackBarConfig} from './snack-bar-config';
28-
import {MatSnackBarContainer, MatSnackBarContainerInterface} from './snack-bar-container';
28+
import {MatSnackBarContainer, _SnackBarContainer} from './snack-bar-container';
2929
import {MatSnackBarModule} from './snack-bar-module';
3030
import {MatSnackBarRef} from './snack-bar-ref';
3131

@@ -55,10 +55,10 @@ export class MatSnackBar implements OnDestroy {
5555
private _snackBarRefAtThisLevel: MatSnackBarRef<any> | null = null;
5656

5757
/** The component that should be rendered as the snack bar's simple component. */
58-
protected simpleSnackBarComponent: Type<TextOnlySnackBar> = SimpleSnackBar;
58+
protected simpleSnackBarComponent: Type<_TextOnlySnackBar> = SimpleSnackBar;
5959

6060
/** The container component that attaches the provided template or component. */
61-
protected snackBarContainerComponent: Type<MatSnackBarContainerInterface> = MatSnackBarContainer;
61+
protected snackBarContainerComponent: Type<_SnackBarContainer> = MatSnackBarContainer;
6262

6363
/** The CSS class to applie for handset mode. */
6464
protected handsetCssClass = 'mat-snack-bar-handset';
@@ -116,7 +116,7 @@ export class MatSnackBar implements OnDestroy {
116116
* @param config Additional configuration options for the snackbar.
117117
*/
118118
open(message: string, action: string = '', config?: MatSnackBarConfig):
119-
MatSnackBarRef<TextOnlySnackBar> {
119+
MatSnackBarRef<_TextOnlySnackBar> {
120120
const _config = {...this._defaultConfig, ...config};
121121

122122
// Since the user doesn't have access to the component, we can
@@ -150,7 +150,7 @@ export class MatSnackBar implements OnDestroy {
150150
* Attaches the snack bar container component to the overlay.
151151
*/
152152
private _attachSnackBarContainer(overlayRef: OverlayRef,
153-
config: MatSnackBarConfig): MatSnackBarContainerInterface {
153+
config: MatSnackBarConfig): _SnackBarContainer {
154154

155155
const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
156156
const injector = new PortalInjector(userInjector || this._injector, new WeakMap([
@@ -159,7 +159,7 @@ export class MatSnackBar implements OnDestroy {
159159

160160
const containerPortal =
161161
new ComponentPortal(this.snackBarContainerComponent, config.viewContainerRef, injector);
162-
const containerRef: ComponentRef<MatSnackBarContainerInterface> =
162+
const containerRef: ComponentRef<_SnackBarContainer> =
163163
overlayRef.attach(containerPortal);
164164
containerRef.instance.snackBarConfig = config;
165165
return containerRef.instance;

tools/public_api_guard/material/snack-bar.d.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
export interface _SnackBarContainer {
2+
_onEnter: Subject<any>;
3+
_onExit: Subject<any>;
4+
attachComponentPortal: <T>(portal: ComponentPortal<T>) => ComponentRef<T>;
5+
attachTemplatePortal: <C>(portal: TemplatePortal<C>) => EmbeddedViewRef<C>;
6+
enter: () => void;
7+
exit: () => Observable<void>;
8+
snackBarConfig: MatSnackBarConfig;
9+
}
10+
11+
export interface _TextOnlySnackBar {
12+
data: {
13+
message: string;
14+
action: string;
15+
};
16+
snackBarRef: MatSnackBarRef<_TextOnlySnackBar>;
17+
}
18+
119
export declare const MAT_SNACK_BAR_DATA: InjectionToken<any>;
220

321
export declare const MAT_SNACK_BAR_DEFAULT_OPTIONS: InjectionToken<MatSnackBarConfig<any>>;
@@ -8,12 +26,12 @@ export declare class MatSnackBar implements OnDestroy {
826
get _openedSnackBarRef(): MatSnackBarRef<any> | null;
927
set _openedSnackBarRef(value: MatSnackBarRef<any> | null);
1028
protected handsetCssClass: string;
11-
protected simpleSnackBarComponent: Type<TextOnlySnackBar>;
12-
protected snackBarContainerComponent: Type<MatSnackBarContainerInterface>;
29+
protected simpleSnackBarComponent: Type<_TextOnlySnackBar>;
30+
protected snackBarContainerComponent: Type<_SnackBarContainer>;
1331
constructor(_overlay: Overlay, _live: LiveAnnouncer, _injector: Injector, _breakpointObserver: BreakpointObserver, _parentSnackBar: MatSnackBar, _defaultConfig: MatSnackBarConfig);
1432
dismiss(): void;
1533
ngOnDestroy(): void;
16-
open(message: string, action?: string, config?: MatSnackBarConfig): MatSnackBarRef<TextOnlySnackBar>;
34+
open(message: string, action?: string, config?: MatSnackBarConfig): MatSnackBarRef<_TextOnlySnackBar>;
1735
openFromComponent<T>(component: ComponentType<T>, config?: MatSnackBarConfig): MatSnackBarRef<T>;
1836
openFromTemplate(template: TemplateRef<any>, config?: MatSnackBarConfig): MatSnackBarRef<EmbeddedViewRef<any>>;
1937
static ɵfac: i0.ɵɵFactoryDef<MatSnackBar, [null, null, null, null, { optional: true; skipSelf: true; }, null]>;
@@ -36,7 +54,7 @@ export declare class MatSnackBarConfig<D = any> {
3654
viewContainerRef?: ViewContainerRef;
3755
}
3856

39-
export declare class MatSnackBarContainer extends BasePortalOutlet implements OnDestroy, MatSnackBarContainerInterface {
57+
export declare class MatSnackBarContainer extends BasePortalOutlet implements OnDestroy, _SnackBarContainer {
4058
_animationState: string;
4159
readonly _onEnter: Subject<any>;
4260
readonly _onExit: Subject<any>;
@@ -56,16 +74,6 @@ export declare class MatSnackBarContainer extends BasePortalOutlet implements On
5674
static ɵfac: i0.ɵɵFactoryDef<MatSnackBarContainer, never>;
5775
}
5876

59-
export interface MatSnackBarContainerInterface {
60-
_onEnter: Subject<any>;
61-
_onExit: Subject<any>;
62-
attachComponentPortal: <T>(portal: ComponentPortal<T>) => ComponentRef<T>;
63-
attachTemplatePortal: <C>(portal: TemplatePortal<C>) => EmbeddedViewRef<C>;
64-
enter: () => void;
65-
exit: () => Observable<void>;
66-
snackBarConfig: MatSnackBarConfig;
67-
}
68-
6977
export interface MatSnackBarDismiss {
7078
dismissedByAction: boolean;
7179
}
@@ -78,9 +86,9 @@ export declare class MatSnackBarModule {
7886
}
7987

8088
export declare class MatSnackBarRef<T> {
81-
containerInstance: MatSnackBarContainerInterface;
89+
containerInstance: _SnackBarContainer;
8290
instance: T;
83-
constructor(containerInstance: MatSnackBarContainerInterface, _overlayRef: OverlayRef);
91+
constructor(containerInstance: _SnackBarContainer, _overlayRef: OverlayRef);
8492
_dismissAfter(duration: number): void;
8593
_open(): void;
8694
afterDismissed(): Observable<MatSnackBarDismiss>;
@@ -93,7 +101,7 @@ export declare class MatSnackBarRef<T> {
93101

94102
export declare type MatSnackBarVerticalPosition = 'top' | 'bottom';
95103

96-
export declare class SimpleSnackBar implements TextOnlySnackBar {
104+
export declare class SimpleSnackBar implements _TextOnlySnackBar {
97105
data: {
98106
message: string;
99107
action: string;
@@ -105,11 +113,3 @@ export declare class SimpleSnackBar implements TextOnlySnackBar {
105113
static ɵcmp: i0.ɵɵComponentDefWithMeta<SimpleSnackBar, "simple-snack-bar", never, {}, {}, never, never>;
106114
static ɵfac: i0.ɵɵFactoryDef<SimpleSnackBar, never>;
107115
}
108-
109-
export interface TextOnlySnackBar {
110-
data: {
111-
message: string;
112-
action: string;
113-
};
114-
snackBarRef: MatSnackBarRef<TextOnlySnackBar>;
115-
}

0 commit comments

Comments
 (0)