-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(module:transfer): refactor transfer (#2553)
* refactor(module:transfer): refactor transfer - feat: add nzDisabled property - need verify design details, ant-design/ant-design#13330 * chore: search muse be disabled * chore: add encapsulation:ViewEncapsulation.None ref #2381
- Loading branch information
Showing
11 changed files
with
132 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,41 @@ | ||
import { Component, EventEmitter, Input, Output } from '@angular/core'; | ||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, ViewEncapsulation } from '@angular/core'; | ||
|
||
@Component({ | ||
selector : '[nz-transfer-search]', | ||
preserveWhitespaces: false, | ||
templateUrl : './nz-transfer-search.component.html' | ||
templateUrl : './nz-transfer-search.component.html', | ||
encapsulation : ViewEncapsulation.None, | ||
changeDetection : ChangeDetectionStrategy.OnPush | ||
}) | ||
export class NzTransferSearchComponent { | ||
export class NzTransferSearchComponent implements OnChanges { | ||
|
||
// region: fields | ||
|
||
@Input() placeholder: string; | ||
@Input() value: string; | ||
@Input() disabled: boolean; | ||
|
||
@Output() readonly valueChanged = new EventEmitter<string>(); | ||
@Output() readonly valueClear = new EventEmitter(); | ||
|
||
// endregion | ||
|
||
constructor(private cdr: ChangeDetectorRef) {} | ||
|
||
_handle(): void { | ||
this.valueChanged.emit(this.value); | ||
} | ||
|
||
_clear(): void { | ||
if (this.disabled) { | ||
return ; | ||
} | ||
this.value = ''; | ||
this.valueClear.emit(); | ||
} | ||
|
||
ngOnChanges(): void { | ||
this.cdr.detectChanges(); | ||
} | ||
|
||
} |
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.