mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
[CL-343] Create a new table component for virtual scrolling (#10113)
This creates a new component called bit-table-scroll as it's a breaking change in how tables works. We could probably conditionally support both behaviors in the existing table component if we desire. Rather than iterating the rows in the consuming component, we now need to define a row definition, bitRowDef which provides access to the rows data through angular let- syntax. This allows the table component to own the behaviour which is needed in order to use the cdkVirtualFor directive which must be inside the cdk-virtual-scroll-viewport component.
This commit is contained in:
@@ -30,7 +30,7 @@ export class TableComponent implements OnDestroy, AfterContentChecked {
|
||||
|
||||
@ContentChild(TableBodyDirective) templateVariable: TableBodyDirective;
|
||||
|
||||
protected rows: Observable<readonly any[]>;
|
||||
protected rows$: Observable<any[]>;
|
||||
|
||||
private _initialized = false;
|
||||
|
||||
@@ -50,7 +50,7 @@ export class TableComponent implements OnDestroy, AfterContentChecked {
|
||||
this._initialized = true;
|
||||
|
||||
const dataStream = this.dataSource.connect();
|
||||
this.rows = dataStream;
|
||||
this.rows$ = dataStream;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user