-
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.
fix(module:select): fix select input not grow correctly in IE
- Loading branch information
vthinkxie
committed
Oct 10, 2019
1 parent
51b26b4
commit 3a094ce
Showing
26 changed files
with
247 additions
and
118 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
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
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,15 @@ | ||
--- | ||
order: 20 | ||
title: | ||
zh-CN: 前端搜索 | ||
en-US: Select with font-end search | ||
--- | ||
|
||
## zh-CN | ||
|
||
当数据量过大时,在前端根据搜索关键字对数据进行处理后二次展示 | ||
|
||
## en-US | ||
|
||
Search the options in the frontend. | ||
|
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,46 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-select-frontend-search', | ||
template: ` | ||
<nz-select | ||
nzMode="multiple" | ||
[(ngModel)]="selectedUser" | ||
nzPlaceHolder="Type a10 to search" | ||
nzAllowClear | ||
nzShowSearch | ||
[nzServerSearch]="true" | ||
(nzOnSearch)="onSearch($event)" | ||
> | ||
<nz-option *ngFor="let o of optionList" [nzValue]="o" [nzLabel]="o"></nz-option> | ||
<nz-option *ngIf="displayTips" nzDisabled nzCustomContent> | ||
Type at lease 2 letters to Search | ||
</nz-option> | ||
</nz-select> | ||
`, | ||
styles: [ | ||
` | ||
nz-select { | ||
width: 100%; | ||
} | ||
` | ||
] | ||
}) | ||
export class NzDemoSelectFrontendSearchComponent { | ||
bigList: string[] = new Array(10000).fill(0).map((_, i) => i.toString(36) + i); | ||
optionList: string[] = []; | ||
selectedUser: string; | ||
displayTips = true; | ||
|
||
onSearch(value: string): void { | ||
if (value && value.length > 1) { | ||
this.optionList = this.bigList.filter(item => item.indexOf(value) > -1); | ||
this.displayTips = false; | ||
} else { | ||
this.optionList = []; | ||
this.displayTips = true; | ||
} | ||
} | ||
|
||
constructor() {} | ||
} |
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
Oops, something went wrong.