-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new TreeGrid component (#1226)
Closes #1143
- Loading branch information
Showing
58 changed files
with
3,509 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { BidiModule, Directionality } from '@angular/cdk/bidi'; | ||
import { NbDirectionality } from './bidi'; | ||
|
||
@NgModule({ | ||
providers: [ | ||
{ provide: NbDirectionality, useExisting: Directionality }, | ||
], | ||
}) | ||
export class NbBidiModule extends BidiModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Directionality } from '@angular/cdk/bidi'; | ||
|
||
@Injectable() | ||
export class NbDirectionality extends Directionality {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './bidi'; | ||
export * from './bidi.module'; |
6 changes: 6 additions & 0 deletions
6
src/framework/theme/components/cdk/collections/collection-viewer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { CollectionViewer, ListRange } from '@angular/cdk/collections'; | ||
import { Observable } from 'rxjs'; | ||
|
||
export interface NbCollectionViewer extends CollectionViewer { | ||
viewChange: Observable<ListRange>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './collection-viewer'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './platform.module'; | ||
export * from './platform'; |
10 changes: 10 additions & 0 deletions
10
src/framework/theme/components/cdk/platform/platform.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Platform, PlatformModule } from '@angular/cdk/platform'; | ||
import { NbPlatform } from './platform'; | ||
|
||
@NgModule({ | ||
providers: [ | ||
{ provide: NbPlatform, useExisting: Platform }, | ||
], | ||
}) | ||
export class NbPlatformModule extends PlatformModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Platform } from '@angular/cdk/platform'; | ||
|
||
export class NbPlatform extends Platform {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
/* | ||
* @license | ||
* Copyright Akveo. All Rights Reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license infornbion. | ||
*/ | ||
|
||
import { Directive, ElementRef, InjectionToken, Input } from '@angular/core'; | ||
import { | ||
CdkCell, | ||
CdkCellDef, | ||
CdkColumnDef, | ||
CdkFooterCell, | ||
CdkFooterCellDef, | ||
CdkHeaderCell, | ||
CdkHeaderCellDef, | ||
} from '@angular/cdk/table'; | ||
|
||
/** | ||
* Cell definition for the nb-table. | ||
* Captures the template of a column's data row cell as well as cell-specific properties. | ||
*/ | ||
@Directive({ | ||
selector: '[nbCellDef]', | ||
providers: [{ provide: CdkCellDef, useExisting: NbCellDefDirective }], | ||
}) | ||
export class NbCellDefDirective extends CdkCellDef { | ||
} | ||
|
||
/** | ||
* Header cell definition for the nb-table. | ||
* Captures the template of a column's header cell and as well as cell-specific properties. | ||
*/ | ||
@Directive({ | ||
selector: '[nbHeaderCellDef]', | ||
providers: [{ provide: CdkHeaderCellDef, useExisting: NbHeaderCellDefDirective }], | ||
}) | ||
export class NbHeaderCellDefDirective extends CdkHeaderCellDef { | ||
} | ||
|
||
/** | ||
* Footer cell definition for the nb-table. | ||
* Captures the template of a column's footer cell and as well as cell-specific properties. | ||
*/ | ||
@Directive({ | ||
selector: '[nbFooterCellDef]', | ||
providers: [{ provide: CdkFooterCellDef, useExisting: NbFooterCellDefDirective }], | ||
}) | ||
export class NbFooterCellDefDirective extends CdkFooterCellDef { | ||
} | ||
|
||
export const NB_SORT_HEADER_COLUMN_DEF = new InjectionToken('NB_SORT_HEADER_COLUMN_DEF'); | ||
|
||
/** | ||
* Column definition for the nb-table. | ||
* Defines a set of cells available for a table column. | ||
*/ | ||
@Directive({ | ||
selector: '[nbColumnDef]', | ||
providers: [ | ||
{ provide: CdkColumnDef, useExisting: NbColumnDefDirective }, | ||
{ provide: NB_SORT_HEADER_COLUMN_DEF, useExisting: NbColumnDefDirective }, | ||
], | ||
}) | ||
export class NbColumnDefDirective extends CdkColumnDef { | ||
/** Unique name for this column. */ | ||
@Input('nbColumnDef') name: string; | ||
|
||
/** Whether this column should be sticky positioned at the start of the row */ | ||
@Input() sticky: boolean; | ||
|
||
/** Whether this column should be sticky positioned on the end of the row */ | ||
@Input() stickyEnd: boolean; | ||
} | ||
|
||
/** Header cell template container that adds the right classes and role. */ | ||
@Directive({ | ||
selector: 'nb-header-cell, th[nbHeaderCell]', | ||
host: { | ||
'class': 'nb-header-cell', | ||
'role': 'columnheader', | ||
}, | ||
}) | ||
export class NbHeaderCellDirective extends CdkHeaderCell { | ||
constructor(columnDef: NbColumnDefDirective, | ||
elementRef: ElementRef<HTMLElement>) { | ||
super(columnDef, elementRef); | ||
elementRef.nativeElement.classList.add(`nb-column-${columnDef.cssClassFriendlyName}`); | ||
} | ||
} | ||
|
||
/** Footer cell template container that adds the right classes and role. */ | ||
@Directive({ | ||
selector: 'nb-footer-cell, td[nbFooterCell]', | ||
host: { | ||
'class': 'nb-footer-cell', | ||
'role': 'gridcell', | ||
}, | ||
}) | ||
export class NbFooterCellDirective extends CdkFooterCell { | ||
constructor(columnDef: NbColumnDefDirective, | ||
elementRef: ElementRef) { | ||
super(columnDef, elementRef); | ||
elementRef.nativeElement.classList.add(`nb-column-${columnDef.cssClassFriendlyName}`); | ||
} | ||
} | ||
|
||
/** Cell template container that adds the right classes and role. */ | ||
@Directive({ | ||
selector: 'nb-cell, td[nbCell]', | ||
host: { | ||
'class': 'nb-cell', | ||
'role': 'gridcell', | ||
}, | ||
}) | ||
export class NbCellDirective extends CdkCell { | ||
constructor(columnDef: NbColumnDefDirective, | ||
elementRef: ElementRef<HTMLElement>) { | ||
super(columnDef, elementRef); | ||
elementRef.nativeElement.classList.add(`nb-column-${columnDef.cssClassFriendlyName}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { DataSource } from '@angular/cdk/table'; | ||
|
||
export abstract class NbDataSource<T> extends DataSource<T> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from './table.module'; | ||
export * from './cell'; | ||
export * from './row'; | ||
export * from './data-source'; | ||
export * from './type-mappings'; |
Oops, something went wrong.