Skip to content

Commit 3f8a1ca

Browse files
committed
refactor(multiple): adjustments for pull/30741
1 parent 0174309 commit 3f8a1ca

File tree

9 files changed

+28
-28
lines changed

9 files changed

+28
-28
lines changed

goldens/material/snack-bar/index.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class MatSnackBar implements OnDestroy {
5151
get _openedSnackBarRef(): MatSnackBarRef<unknown> | null;
5252
set _openedSnackBarRef(value: MatSnackBarRef<unknown> | null);
5353
openFromComponent<T, D = unknown>(component: ComponentType<T>, config?: MatSnackBarConfig<D>): MatSnackBarRef<T>;
54-
openFromTemplate(template: TemplateRef<unknown>, config?: MatSnackBarConfig): MatSnackBarRef<EmbeddedViewRef<unknown>>;
54+
openFromTemplate<C = unknown>(template: TemplateRef<C>, config?: MatSnackBarConfig): MatSnackBarRef<EmbeddedViewRef<C>>;
5555
simpleSnackBarComponent: typeof SimpleSnackBar;
5656
snackBarContainerComponent: typeof MatSnackBarContainer;
5757
// (undocumented)

goldens/material/stepper/index.api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ export class MatStep extends CdkStep implements ErrorStateMatcher, AfterContentI
6161
}
6262

6363
// @public
64-
export class MatStepContent {
64+
export class MatStepContent<C = unknown> {
6565
constructor(...args: unknown[]);
6666
// (undocumented)
67-
_template: TemplateRef<unknown>;
67+
_template: TemplateRef<C>;
6868
// (undocumented)
69-
static ɵdir: i0.ɵɵDirectiveDeclaration<MatStepContent, "ng-template[matStepContent]", never, {}, {}, never, never, true, never>;
69+
static ɵdir: i0.ɵɵDirectiveDeclaration<MatStepContent<any>, "ng-template[matStepContent]", never, {}, {}, never, never, true, never>;
7070
// (undocumented)
71-
static ɵfac: i0.ɵɵFactoryDeclaration<MatStepContent, never>;
71+
static ɵfac: i0.ɵɵFactoryDeclaration<MatStepContent<any>, never>;
7272
}
7373

7474
// @public (undocumented)

goldens/material/tabs/index.api.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function _MAT_INK_BAR_POSITIONER_FACTORY(): _MatInkBarPositioner;
3838
export const MAT_TAB: InjectionToken<MatTabBase>;
3939

4040
// @public
41-
export const MAT_TAB_CONTENT: InjectionToken<MatTabContent>;
41+
export const MAT_TAB_CONTENT: InjectionToken<MatTabContent<unknown>>;
4242

4343
// @public
4444
export const MAT_TAB_GROUP: InjectionToken<MatTabGroupBase>;
@@ -143,7 +143,7 @@ export abstract class MatPaginatedTabHeader implements AfterContentChecked, Afte
143143
}
144144

145145
// @public (undocumented)
146-
export class MatTab implements MatTabBase, OnInit, OnChanges, OnDestroy {
146+
export class MatTab<C = unknown> implements MatTabBase, OnInit, OnChanges, OnDestroy {
147147
constructor(...args: unknown[]);
148148
ariaLabel: string;
149149
ariaLabelledby: string;
@@ -153,7 +153,7 @@ export class MatTab implements MatTabBase, OnInit, OnChanges, OnDestroy {
153153
get content(): TemplatePortal | null;
154154
disabled: boolean;
155155
id: string | null;
156-
_implicitContent?: TemplateRef<unknown>;
156+
_implicitContent?: TemplateRef<C>;
157157
isActive: boolean;
158158
labelClass: string | string[];
159159
// (undocumented)
@@ -171,9 +171,9 @@ export class MatTab implements MatTabBase, OnInit, OnChanges, OnDestroy {
171171
set templateLabel(value: MatTabLabel);
172172
textLabel: string;
173173
// (undocumented)
174-
static ɵcmp: i0.ɵɵComponentDeclaration<MatTab, "mat-tab", ["matTab"], { "disabled": { "alias": "disabled"; "required": false; }; "textLabel": { "alias": "label"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "labelClass": { "alias": "labelClass"; "required": false; }; "bodyClass": { "alias": "bodyClass"; "required": false; }; "id": { "alias": "id"; "required": false; }; }, {}, ["templateLabel", "_explicitContent"], ["*"], true, never>;
174+
static ɵcmp: i0.ɵɵComponentDeclaration<MatTab<any>, "mat-tab", ["matTab"], { "disabled": { "alias": "disabled"; "required": false; }; "textLabel": { "alias": "label"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "labelClass": { "alias": "labelClass"; "required": false; }; "bodyClass": { "alias": "bodyClass"; "required": false; }; "id": { "alias": "id"; "required": false; }; }, {}, ["templateLabel", "_explicitContent"], ["*"], true, never>;
175175
// (undocumented)
176-
static ɵfac: i0.ɵɵFactoryDeclaration<MatTab, never>;
176+
static ɵfac: i0.ɵɵFactoryDeclaration<MatTab<any>, never>;
177177
}
178178

179179
// @public
@@ -232,18 +232,18 @@ export class MatTabChangeEvent {
232232
}
233233

234234
// @public
235-
export class MatTabContent {
235+
export class MatTabContent<C = unknown> {
236236
constructor(...args: unknown[]);
237237
// (undocumented)
238-
template: TemplateRef<unknown>;
238+
template: TemplateRef<C>;
239239
// (undocumented)
240-
static ɵdir: i0.ɵɵDirectiveDeclaration<MatTabContent, "[matTabContent]", never, {}, {}, never, never, true, never>;
240+
static ɵdir: i0.ɵɵDirectiveDeclaration<MatTabContent<any>, "[matTabContent]", never, {}, {}, never, never, true, never>;
241241
// (undocumented)
242-
static ɵfac: i0.ɵɵFactoryDeclaration<MatTabContent, never>;
242+
static ɵfac: i0.ɵɵFactoryDeclaration<MatTabContent<any>, never>;
243243
}
244244

245245
// @public
246-
export class MatTabGroup implements AfterViewInit, AfterContentInit, AfterContentChecked, OnDestroy {
246+
export class MatTabGroup implements MatTabGroupBase, AfterViewInit, AfterContentInit, AfterContentChecked, OnDestroy {
247247
constructor(...args: unknown[]);
248248
alignTabs: string | null;
249249
_allTabs: QueryList<MatTab>;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ export class MatSnackBar implements OnDestroy {
112112
* @param template Template to be instantiated.
113113
* @param config Extra configuration for the snack bar.
114114
*/
115-
openFromTemplate(
116-
template: TemplateRef<unknown>,
115+
openFromTemplate<C = unknown>(
116+
template: TemplateRef<C>,
117117
config?: MatSnackBarConfig,
118-
): MatSnackBarRef<EmbeddedViewRef<unknown>> {
118+
): MatSnackBarRef<EmbeddedViewRef<C>> {
119119
return this._attach(template, config);
120120
}
121121

src/material/stepper/step-content.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import {Directive, TemplateRef, inject} from '@angular/core';
1414
@Directive({
1515
selector: 'ng-template[matStepContent]',
1616
})
17-
export class MatStepContent {
18-
_template = inject<TemplateRef<unknown>>(TemplateRef);
17+
export class MatStepContent<C = unknown> {
18+
_template = inject<TemplateRef<C>>(TemplateRef);
1919

2020
constructor(...args: unknown[]);
2121
constructor() {}

src/material/stepper/stepper.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,7 @@ function asyncValidator(minLength: number, validationTrigger: Subject<void>): As
18221822
function createComponent<T>(
18231823
component: Type<T>,
18241824
providers: Provider[] = [],
1825-
imports: unknown[] = [],
1825+
imports: Type<unknown>[] = [],
18261826
encapsulation?: ViewEncapsulation,
18271827
declarations = [component],
18281828
): ComponentFixture<T> {

src/material/tabs/tab-content.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export const MAT_TAB_CONTENT = new InjectionToken<MatTabContent>('MatTabContent'
2020
selector: '[matTabContent]',
2121
providers: [{provide: MAT_TAB_CONTENT, useExisting: MatTabContent}],
2222
})
23-
export class MatTabContent {
24-
template = inject<TemplateRef<unknown>>(TemplateRef);
23+
export class MatTabContent<C = unknown> {
24+
template = inject<TemplateRef<C>>(TemplateRef);
2525

2626
constructor(...args: unknown[]);
2727
constructor() {}

src/material/tabs/tab-group.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {MatTabBody} from './tab-body';
3939
import {CdkPortalOutlet} from '@angular/cdk/portal';
4040
import {MatTabLabelWrapper} from './tab-label-wrapper';
4141
import {Platform} from '@angular/cdk/platform';
42-
import {MAT_TAB_GROUP} from './tab-group-token';
42+
import {MAT_TAB_GROUP, MatTabGroupBase} from './tab-group-token';
4343

4444
/** @docs-private */
4545
export interface MatTabGroupBaseHeader {
@@ -92,7 +92,7 @@ const ENABLE_BACKGROUND_INPUT = true;
9292
],
9393
})
9494
export class MatTabGroup
95-
implements AfterViewInit, AfterContentInit, AfterContentChecked, OnDestroy
95+
implements MatTabGroupBase, AfterViewInit, AfterContentInit, AfterContentChecked, OnDestroy
9696
{
9797
readonly _elementRef = inject(ElementRef);
9898
private _changeDetectorRef = inject(ChangeDetectorRef);

src/material/tabs/tab.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import {MAT_TAB_GROUP} from './tab-group-token';
5151
'[attr.id]': 'null',
5252
},
5353
})
54-
export class MatTab implements MatTabBase, OnInit, OnChanges, OnDestroy {
54+
export class MatTab<C = unknown> implements MatTabBase, OnInit, OnChanges, OnDestroy {
5555
private _viewContainerRef = inject(ViewContainerRef);
5656
_closestTabGroup = inject(MAT_TAB_GROUP, {optional: true});
5757

@@ -73,10 +73,10 @@ export class MatTab implements MatTabBase, OnInit, OnChanges, OnDestroy {
7373
* Template provided in the tab content that will be used if present, used to enable lazy-loading
7474
*/
7575
@ContentChild(MatTabContent, {read: TemplateRef, static: true})
76-
private _explicitContent?: TemplateRef<unknown>;
76+
private _explicitContent?: TemplateRef<C>;
7777

7878
/** Template inside the MatTab view that contains an `<ng-content>`. */
79-
@ViewChild(TemplateRef, {static: true}) _implicitContent?: TemplateRef<unknown>;
79+
@ViewChild(TemplateRef, {static: true}) _implicitContent?: TemplateRef<C>;
8080

8181
/** Plain text label for the tab, used when there is no template label. */
8282
@Input('label') textLabel: string = '';

0 commit comments

Comments
 (0)