-
Notifications
You must be signed in to change notification settings - Fork 877
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
d648ee1
commit 69e883c
Showing
18 changed files
with
193 additions
and
68 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
src/ng2-smart-table/components/cell/cell-view-mode/view-cell.component.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
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
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
12 changes: 9 additions & 3 deletions
12
src/ng2-smart-table/components/thead/cells/actions-title.component.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 |
---|---|---|
@@ -1,21 +1,27 @@ | ||
import { Component, Input, AfterViewInit, ElementRef } from '@angular/core'; | ||
import {Component, Input, AfterViewInit, ElementRef, OnChanges} from '@angular/core'; | ||
|
||
import { Grid } from '../../../lib/grid'; | ||
|
||
@Component({ | ||
selector: '[ng2-st-actions-title]', | ||
template: ` | ||
<div class="ng2-smart-title">{{ grid.getSetting('actions.columnTitle') }}</div> | ||
<div class="ng2-smart-title">{{ actionsColumnTitle }}</div> | ||
`, | ||
}) | ||
export class ActionsTitleComponent implements AfterViewInit { | ||
export class ActionsTitleComponent implements AfterViewInit, OnChanges { | ||
|
||
@Input() grid: Grid; | ||
|
||
actionsColumnTitle: string; | ||
|
||
constructor(private ref: ElementRef) { | ||
} | ||
|
||
ngAfterViewInit() { | ||
this.ref.nativeElement.classList.add('ng2-smart-actions'); | ||
} | ||
|
||
ngOnChanges() { | ||
this.actionsColumnTitle = this.grid.getSetting('actions.columnTitle'); | ||
} | ||
} |
16 changes: 12 additions & 4 deletions
16
src/ng2-smart-table/components/thead/cells/actions.component.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 |
---|---|---|
@@ -1,20 +1,28 @@ | ||
import { Component, Input, Output, EventEmitter } from '@angular/core'; | ||
import {Component, Input, Output, EventEmitter, OnChanges } from '@angular/core'; | ||
|
||
import { Grid } from '../../../lib/grid'; | ||
|
||
@Component({ | ||
selector: 'ng2-st-actions', | ||
template: ` | ||
<a href="#" class="ng2-smart-action ng2-smart-action-add-create" | ||
[innerHTML]="grid.getSetting('add.createButtonContent')" | ||
[innerHTML]="createButtonContent" | ||
(click)="$event.preventDefault();create.emit($event)"></a> | ||
<a href="#" class="ng2-smart-action ng2-smart-action-add-cancel" | ||
[innerHTML]="grid.getSetting('add.cancelButtonContent')" | ||
[innerHTML]="cancelButtonContent" | ||
(click)="$event.preventDefault();grid.createFormShown = false;"></a> | ||
`, | ||
}) | ||
export class ActionsComponent { | ||
export class ActionsComponent implements OnChanges { | ||
|
||
@Input() grid: Grid; | ||
@Output() create = new EventEmitter<any>(); | ||
|
||
createButtonContent: string; | ||
cancelButtonContent: string; | ||
|
||
ngOnChanges() { | ||
this.createButtonContent = this.grid.getSetting('add.createButtonContent'); | ||
this.cancelButtonContent = this.grid.getSetting('add.cancelButtonContent'); | ||
} | ||
} |
16 changes: 12 additions & 4 deletions
16
src/ng2-smart-table/components/thead/cells/add-button.component.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
24 changes: 18 additions & 6 deletions
24
src/ng2-smart-table/components/thead/rows/thead-filters-row.component.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 |
---|---|---|
@@ -1,36 +1,48 @@ | ||
import { Component, Input, Output, EventEmitter } from '@angular/core'; | ||
import {Component, Input, Output, EventEmitter, OnChanges} from '@angular/core'; | ||
|
||
import { Grid } from '../../../lib/grid'; | ||
import { DataSource } from '../../../lib/data-source/data-source'; | ||
import { Column } from "../../../lib/data-set/column"; | ||
|
||
@Component({ | ||
selector: '[ng2-st-thead-filters-row]', | ||
template: ` | ||
<th *ngIf="grid.isMultiSelectVisible()"></th> | ||
<th ng2-st-add-button *ngIf="grid.showActionColumn('left')" | ||
<th *ngIf="isMultiSelectVisible"></th> | ||
<th ng2-st-add-button *ngIf="showActionColumnLeft" | ||
[grid]="grid" | ||
(create)="create.emit($event)"> | ||
</th> | ||
<th *ngFor="let column of grid.getColumns()" class="ng2-smart-th {{ column.id }}"> | ||
<ng2-smart-table-filter [source]="source" | ||
[column]="column" | ||
[inputClass]="grid.getSetting('filter.inputClass')" | ||
[inputClass]="filterInputClass" | ||
(filter)="filter.emit($event)"> | ||
</ng2-smart-table-filter> | ||
</th> | ||
<th ng2-st-add-button *ngIf="grid.showActionColumn('right')" | ||
<th ng2-st-add-button *ngIf="showActionColumnRight" | ||
[grid]="grid" | ||
[source]="source" | ||
(create)="create.emit($event)"> | ||
</th> | ||
`, | ||
}) | ||
export class TheadFitlersRowComponent { | ||
export class TheadFitlersRowComponent implements OnChanges { | ||
|
||
@Input() grid: Grid; | ||
@Input() source: DataSource; | ||
|
||
@Output() create = new EventEmitter<any>(); | ||
@Output() filter = new EventEmitter<any>(); | ||
|
||
isMultiSelectVisible: boolean; | ||
showActionColumnLeft: boolean; | ||
showActionColumnRight: boolean; | ||
filterInputClass: string; | ||
|
||
ngOnChanges() { | ||
this.isMultiSelectVisible = this.grid.isMultiSelectVisible(); | ||
this.showActionColumnLeft = this.grid.showActionColumn('left'); | ||
this.showActionColumnRight = this.grid.showActionColumn('right'); | ||
this.filterInputClass = this.grid.getSetting('filter.inputClass'); | ||
} | ||
} |
Oops, something went wrong.