forked from NG-ZORRO/ng-zorro-antd
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(module:switch & checkbox): refactor switch & checkbox (NG-ZO…
- Loading branch information
Showing
6 changed files
with
120 additions
and
219 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
<span nz-wave [nzWaveExtraNode]="true" [ngClass]="classMap" [tabindex]="nzDisabled?-1:0" #switchElement (keydown)="onKeyDown($event)"> | ||
<button type="button" #switchElement | ||
nz-wave | ||
class="ant-switch" | ||
[disabled]="nzDisabled" | ||
[class.ant-switch-checked]="checked" | ||
[class.ant-switch-loading]="nzLoading" | ||
[class.ant-switch-disabled]="nzDisabled" | ||
[class.ant-switch-small]="nzSize === 'small'" | ||
[nzWaveExtraNode]="true" | ||
(keydown)="onKeyDown($event)"> | ||
<i *ngIf="nzLoading" nz-icon type="loading" class="ant-switch-loading-icon"></i> | ||
<span class="ant-switch-inner"> | ||
<span *ngIf="checked"> | ||
<ng-container *ngIf="isCheckedChildrenString; else checkedChildrenTemplate">{{ nzCheckedChildren }}</ng-container> | ||
<ng-template #checkedChildrenTemplate> | ||
<ng-template [ngTemplateOutlet]="nzCheckedChildren"></ng-template> | ||
</ng-template> | ||
</span> | ||
<span *ngIf="!checked"> | ||
<ng-container *ngIf="isUnCheckedChildrenString; else unCheckedChildrenTemplate">{{ nzUnCheckedChildren }}</ng-container> | ||
<ng-template #unCheckedChildrenTemplate> | ||
<ng-template [ngTemplateOutlet]="nzUnCheckedChildren"></ng-template> | ||
</ng-template> | ||
<span> | ||
<ng-container *ngIf="checked"> | ||
<ng-container *nzStringTemplateOutlet="nzCheckedChildren">{{ nzCheckedChildren }}</ng-container> | ||
</ng-container> | ||
<ng-container *ngIf="!checked"> | ||
<ng-container *nzStringTemplateOutlet="nzUnCheckedChildren">{{ nzUnCheckedChildren }}</ng-container> | ||
</ng-container> | ||
</span> | ||
</span> | ||
</span> | ||
</button> |
Oops, something went wrong.