-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module:table): support filter & fixed header add more table demo (…
- Loading branch information
Showing
22 changed files
with
841 additions
and
185 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { Directive, ElementRef } from '@angular/core'; | ||
import { Directive, ElementRef, HostBinding } from '@angular/core'; | ||
|
||
@Directive({ | ||
selector: '[nz-dropdown]', | ||
}) | ||
export class NzDropDownDirective { | ||
@HostBinding('class.ant-dropdown-trigger') _dropDownTrigger = true; | ||
constructor(public elementRef: ElementRef) { | ||
} | ||
} |
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,33 @@ | ||
import { | ||
Component, | ||
HostBinding, OnInit | ||
} from '@angular/core'; | ||
import { NzDropDownComponent } from '../dropdown/nz-dropdown.component'; | ||
|
||
@Component({ | ||
selector: '[nz-table-filter]', | ||
template: ` | ||
<a class="ant-table-filter-dropdown-link confirm" (click)="hideDropDown()"> | ||
<ng-content select="[nz-table-filter-confirm]"></ng-content> | ||
</a> | ||
<a class="ant-table-filter-dropdown-link clear" (click)="hideDropDown()"> | ||
<ng-content select="[nz-table-filter-clear]"></ng-content> | ||
</a> | ||
` | ||
}) | ||
export class NzTableFilterComponent implements OnInit { | ||
@HostBinding('class.ant-table-filter-dropdown-btns') _dropDownButton = true; | ||
|
||
hideDropDown() { | ||
this.nzDropDownComponent.nzVisible = false; | ||
this.nzDropDownComponent._hide(); | ||
} | ||
|
||
constructor(private nzDropDownComponent: NzDropDownComponent) { | ||
} | ||
|
||
ngOnInit() { | ||
this.nzDropDownComponent.hasFilterButton = true; | ||
this.nzDropDownComponent.nzClickHide = false; | ||
} | ||
} |
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,30 @@ | ||
let scrollbarWidth; | ||
|
||
// Measure scrollbar width for padding body during modal show/hide | ||
const scrollbarMeasure = { | ||
position: 'absolute', | ||
top: '-9999px', | ||
width: '50px', | ||
height: '50px', | ||
overflow: 'scroll', | ||
}; | ||
|
||
export function measureScrollbar() { | ||
if (typeof document === 'undefined' || typeof window === 'undefined') { | ||
return 0; | ||
} | ||
if (scrollbarWidth) { | ||
return scrollbarWidth; | ||
} | ||
const scrollDiv = document.createElement('div'); | ||
for (const scrollProp in scrollbarMeasure) { | ||
if (scrollbarMeasure.hasOwnProperty(scrollProp)) { | ||
scrollDiv.style[scrollProp] = scrollbarMeasure[scrollProp]; | ||
} | ||
} | ||
document.body.appendChild(scrollDiv); | ||
const width = scrollDiv.offsetWidth - scrollDiv.clientWidth; | ||
document.body.removeChild(scrollDiv); | ||
scrollbarWidth = width; | ||
return scrollbarWidth; | ||
} |
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
Oops, something went wrong.