Skip to content

Commit 2e511ae

Browse files
committed
7. reverse the tabs -> legacy-tabs dependency
1 parent 02f4081 commit 2e511ae

32 files changed

+1906
-1742
lines changed

src/material/legacy-tabs/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ ng_module(
3434
"//src/cdk/portal",
3535
"//src/cdk/scrolling",
3636
"//src/material/core",
37+
"//src/material/tabs",
3738
"@npm//@angular/animations",
3839
"@npm//@angular/common",
3940
"@npm//@angular/core",

src/material/legacy-tabs/ink-bar.ts

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,10 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {Directive, ElementRef, Inject, InjectionToken, NgZone, Optional} from '@angular/core';
9+
import {Directive, ElementRef, Inject, NgZone, Optional} from '@angular/core';
1010
import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';
1111
import {take} from 'rxjs/operators';
12-
13-
/**
14-
* Interface for a a MatInkBar positioner method, defining the positioning and width of the ink
15-
* bar in a set of tabs.
16-
*/
17-
export interface _MatLegacyInkBarPositioner {
18-
(element: HTMLElement): {left: string; width: string};
19-
}
20-
21-
/** Injection token for the MatInkBar's Positioner. */
22-
export const _MAT_LEGACY_INK_BAR_POSITIONER = new InjectionToken<_MatLegacyInkBarPositioner>(
23-
'MatInkBarPositioner',
24-
{
25-
providedIn: 'root',
26-
factory: _MAT_LEGACY_INK_BAR_POSITIONER_FACTORY,
27-
},
28-
);
29-
30-
/**
31-
* The default positioner function for the MatInkBar.
32-
* @docs-private
33-
*/
34-
export function _MAT_LEGACY_INK_BAR_POSITIONER_FACTORY(): _MatLegacyInkBarPositioner {
35-
const method = (element: HTMLElement) => ({
36-
left: element ? (element.offsetLeft || 0) + 'px' : '0',
37-
width: element ? (element.offsetWidth || 0) + 'px' : '0',
38-
});
39-
40-
return method;
41-
}
12+
import {_MAT_INK_BAR_POSITIONER, _MatInkBarPositioner} from '@angular/material/tabs';
4213

4314
/**
4415
* The ink-bar is used to display and animate the line underneath the current active tab label.
@@ -55,7 +26,7 @@ export class MatLegacyInkBar {
5526
constructor(
5627
private _elementRef: ElementRef<HTMLElement>,
5728
private _ngZone: NgZone,
58-
@Inject(_MAT_LEGACY_INK_BAR_POSITIONER) private _inkBarPositioner: _MatLegacyInkBarPositioner,
29+
@Inject(_MAT_INK_BAR_POSITIONER) private _inkBarPositioner: _MatInkBarPositioner,
5930
@Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string,
6031
) {}
6132

src/material/legacy-tabs/public-api.ts

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,37 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
import {_MatTabBase} from '@angular/material/tabs';
10+
911
export {MatLegacyTabsModule} from './tabs-module';
1012
export * from './tab-group';
11-
export {
12-
MatLegacyInkBar,
13-
_MatLegacyInkBarPositioner,
14-
_MAT_LEGACY_INK_BAR_POSITIONER,
15-
} from './ink-bar';
16-
export {
17-
MatLegacyTabBody,
18-
_MatLegacyTabBodyBase,
19-
MatLegacyTabBodyOriginState,
20-
MatLegacyTabBodyPositionState,
21-
MatLegacyTabBodyPortal,
22-
} from './tab-body';
23-
export {MatLegacyTabHeader, _MatLegacyTabHeaderBase} from './tab-header';
13+
export {MatLegacyInkBar} from './ink-bar';
14+
export {MatLegacyTabBody, MatLegacyTabBodyPortal} from './tab-body';
15+
export {MatLegacyTabHeader} from './tab-header';
16+
export {MatLegacyTab} from './tab';
17+
export {MatLegacyTabNav, MatLegacyTabLink, MatLegacyTabNavPanel} from './tab-nav-bar/index';
18+
export {MatLegacyTabLabel} from './tab-label';
2419
export {MatLegacyTabLabelWrapper} from './tab-label-wrapper';
25-
export {MatLegacyTab, MAT_LEGACY_TAB_GROUP} from './tab';
26-
export {MatLegacyTabLabel, MAT_LEGACY_TAB} from './tab-label';
27-
export {
28-
MatLegacyTabNav,
29-
MatLegacyTabLink,
30-
MatLegacyTabNavPanel,
31-
_MatLegacyTabNavBase,
32-
_MatLegacyTabLinkBase,
33-
} from './tab-nav-bar/index';
3420
export {MatLegacyTabContent} from './tab-content';
35-
export {LegacyScrollDirection} from './paginated-tab-header';
36-
export * from './tabs-animations';
37-
export {MAT_LEGACY_TABS_CONFIG, MatLegacyTabsConfig} from './tab-config';
21+
export {
22+
_MatTabNavBase as _MatLegacyTabNavBase,
23+
_MatTabLinkBase as _MatLegacyTabLinkBase,
24+
MatTabsConfig as MatLegacyTabsConfig,
25+
MAT_TABS_CONFIG as MAT_LEGACY_TABS_CONFIG,
26+
_MatTabBase as _MatLegacyTabBase,
27+
MAT_TAB as MAT_LEGACY_TAB,
28+
ScrollDirection as LegacyScrollDirection,
29+
MAT_TAB_GROUP as MAT_LEGACY_TAB_GROUP,
30+
_MatTabBodyBase as _MatLegacyTabBodyBase,
31+
MatTabBodyPositionState as MatLegacyTabBodyPositionState,
32+
matTabsAnimations as matLegacyTabsAnimations,
33+
MAT_TAB_CONTENT as MAT_LEGACY_TAB_CONTENT,
34+
MatTabBodyOriginState as MatLegacyTabBodyOriginState,
35+
_MatInkBarPositioner as _MatLegacyInkBarPositioner,
36+
_MAT_INK_BAR_POSITIONER as _MAT_LEGACY_INK_BAR_POSITIONER,
37+
_MAT_INK_BAR_POSITIONER_FACTORY as _MAT_LEGACY_INK_BAR_POSITIONER_FACTORY,
38+
MatTabChangeEvent as MatLegacyTabChangeEvent,
39+
_MatTabGroupBase as _MatLegacyTabGroupBase,
40+
MatTabHeaderPosition as MatLegacyTabHeaderPosition,
41+
_MatTabHeaderBase as _MatLegacyTabHeaderBase,
42+
} from '@angular/material/tabs';

0 commit comments

Comments
 (0)