Skip to content

Commit 0f48b04

Browse files
authored
fix(cdk/table): move out unused style scheduler (#30963)
The style scheduler in the table is only used for an experimental module. These changes move it out into the module that's using it.
1 parent 0e39170 commit 0f48b04

File tree

17 files changed

+167
-192
lines changed

17 files changed

+167
-192
lines changed

goldens/cdk/table/index.api.md

-24
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,6 @@ export class CdkTable<T> implements AfterContentInit, AfterContentChecked, Colle
295295
addRowDef(rowDef: CdkRowDef<T>): void;
296296
// (undocumented)
297297
protected readonly _changeDetectorRef: ChangeDetectorRef;
298-
// (undocumented)
299-
protected readonly _coalescedStyleScheduler: _CoalescedStyleScheduler;
300298
readonly contentChanged: EventEmitter<void>;
301299
_contentColumnDefs: QueryList<CdkColumnDef>;
302300
_contentFooterRowDefs: QueryList<CdkFooterRowDef>;
@@ -414,20 +412,6 @@ export interface CellDef {
414412
template: TemplateRef<any>;
415413
}
416414

417-
// @public
418-
export const _COALESCED_STYLE_SCHEDULER: InjectionToken<_CoalescedStyleScheduler>;
419-
420-
// @public
421-
export class _CoalescedStyleScheduler {
422-
constructor(...args: unknown[]);
423-
schedule(task: () => unknown): void;
424-
scheduleEnd(task: () => unknown): void;
425-
// (undocumented)
426-
static ɵfac: i0.ɵɵFactoryDeclaration<_CoalescedStyleScheduler, never>;
427-
// (undocumented)
428-
static ɵprov: i0.ɵɵInjectableDeclaration<_CoalescedStyleScheduler>;
429-
}
430-
431415
// @public
432416
export class DataRowOutlet implements RowOutlet {
433417
constructor(...args: unknown[]);
@@ -506,14 +490,6 @@ export interface RowOutlet {
506490
viewContainer: ViewContainerRef;
507491
}
508492

509-
// @public
510-
export class _Schedule {
511-
// (undocumented)
512-
endTasks: (() => unknown)[];
513-
// (undocumented)
514-
tasks: (() => unknown)[];
515-
}
516-
517493
// @public
518494
export const STICKY_POSITIONING_LISTENER: InjectionToken<StickyPositioningListener>;
519495

src/cdk-experimental/column-resize/column-resize-directives/constants.ts

+2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import {
1313
TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER,
1414
FLEX_RESIZE_STRATEGY_PROVIDER,
1515
} from '../resize-strategy';
16+
import {_COALESCED_STYLE_SCHEDULER, _CoalescedStyleScheduler} from '../coalesced-style-scheduler';
1617

1718
const PROVIDERS: Provider[] = [
1819
ColumnResizeNotifier,
1920
HeaderRowEventDispatcher,
2021
ColumnResizeNotifierSource,
22+
{provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler},
2123
];
2224

2325
export const TABLE_PROVIDERS: Provider[] = [

src/cdk-experimental/column-resize/overlay-handle.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
import {coerceCssPixelValue} from '@angular/cdk/coercion';
1919
import {Directionality} from '@angular/cdk/bidi';
2020
import {ESCAPE} from '@angular/cdk/keycodes';
21-
import {CdkColumnDef, _CoalescedStyleScheduler} from '@angular/cdk/table';
21+
import {CdkColumnDef} from '@angular/cdk/table';
2222
import {Subject, merge, Observable} from 'rxjs';
2323
import {
2424
distinctUntilChanged,
@@ -36,6 +36,7 @@ import {HEADER_CELL_SELECTOR} from './selectors';
3636
import {ColumnResizeNotifierSource} from './column-resize-notifier';
3737
import {HeaderRowEventDispatcher} from './event-dispatcher';
3838
import {ResizeRef} from './resize-ref';
39+
import {_CoalescedStyleScheduler} from './coalesced-style-scheduler';
3940

4041
// TODO: Take another look at using cdk drag drop. IIRC I ran into a couple
4142
// good reasons for not using it but I don't remember what they were at this point.

src/cdk-experimental/column-resize/public-api.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ export * from './resizable';
1919
export * from './resize-ref';
2020
export * from './resize-strategy';
2121
export * from './overlay-handle';
22+
export * from './coalesced-style-scheduler';

src/cdk-experimental/column-resize/resizable.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
createRepositionScrollStrategy,
3030
OverlayRef,
3131
} from '@angular/cdk/overlay';
32-
import {CdkColumnDef, _CoalescedStyleScheduler} from '@angular/cdk/table';
32+
import {CdkColumnDef} from '@angular/cdk/table';
3333
import {merge, Subject} from 'rxjs';
3434
import {distinctUntilChanged, filter, take, takeUntil} from 'rxjs/operators';
3535

@@ -43,6 +43,7 @@ import {ColumnSizeStore} from './column-size-store';
4343
import {HeaderRowEventDispatcher} from './event-dispatcher';
4444
import {ResizeRef} from './resize-ref';
4545
import {ResizeStrategy} from './resize-strategy';
46+
import {_CoalescedStyleScheduler} from './coalesced-style-scheduler';
4647

4748
const OVERLAY_ACTIVE_CLASS = 'cdk-resizable-overlay-thumb-active';
4849

src/cdk-experimental/column-resize/resize-strategy.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
import {Injectable, OnDestroy, Provider, CSP_NONCE, inject, DOCUMENT} from '@angular/core';
1010

1111
import {coerceCssPixelValue} from '@angular/cdk/coercion';
12-
import {CdkTable, _CoalescedStyleScheduler, _COALESCED_STYLE_SCHEDULER} from '@angular/cdk/table';
12+
import {CdkTable} from '@angular/cdk/table';
1313

1414
import {ColumnResize} from './column-resize';
15+
import {_COALESCED_STYLE_SCHEDULER, _CoalescedStyleScheduler} from './coalesced-style-scheduler';
1516

1617
/**
1718
* Provides an implementation for resizing a column.

src/cdk/table/public-api.ts

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
export * from './table';
1010
export * from './cell';
11-
export * from './coalesced-style-scheduler';
1211
export * from './row';
1312
export * from './table-module';
1413
export * from './sticky-position-listener';

0 commit comments

Comments
 (0)