Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'NG-ZORRO:master' into feat/alert-support-custom-icon
- Loading branch information
Showing
44 changed files
with
1,122 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 5 | ||
title: | ||
zh-CN: 循环 | ||
en-US: Loop | ||
--- | ||
|
||
## zh-CN | ||
|
||
防止轮播进入循环 | ||
|
||
## en-US | ||
|
||
Prevent the carousel to go in a loop |
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,34 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-carousel-loop', | ||
template: ` | ||
<nz-carousel nzAutoPlay [nzEffect]="effect" [nzLoop]="false"> | ||
<div nz-carousel-content *ngFor="let index of array"> | ||
<h3>{{ index }}</h3> | ||
</div> | ||
</nz-carousel> | ||
`, | ||
styles: [ | ||
` | ||
[nz-carousel-content] { | ||
text-align: center; | ||
height: 160px; | ||
line-height: 160px; | ||
background: #364d79; | ||
color: #fff; | ||
overflow: hidden; | ||
} | ||
h3 { | ||
color: #fff; | ||
margin-bottom: 0; | ||
user-select: none; | ||
} | ||
` | ||
] | ||
}) | ||
export class NzDemoCarouselLoopComponent { | ||
array = [1, 2, 3, 4]; | ||
effect = 'scrollx'; | ||
} |
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
49 changes: 49 additions & 0 deletions
49
components/cron-expression/cron-expression-input.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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE | ||
*/ | ||
|
||
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, EventEmitter } from '@angular/core'; | ||
|
||
import { CronChangeType, TimeType } from './typings'; | ||
|
||
@Component({ | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
encapsulation: ViewEncapsulation.None, | ||
selector: 'nz-cron-expression-input', | ||
exportAs: 'nzCronExpression', | ||
template: ` | ||
<div class="ant-cron-expression-input"> | ||
<input | ||
nz-input | ||
[(ngModel)]="value" | ||
[name]="label" | ||
(focus)="focusInputEffect($event)" | ||
(blur)="blurInputEffect()" | ||
(ngModelChange)="setValue()" | ||
/> | ||
</div> | ||
` | ||
}) | ||
export class NzCronExpressionInputComponent { | ||
@Input() value: string = '0'; | ||
@Input() label: TimeType = 'second'; | ||
@Output() readonly focusEffect = new EventEmitter<TimeType>(); | ||
@Output() readonly blurEffect = new EventEmitter<void>(); | ||
@Output() readonly getValue = new EventEmitter<CronChangeType>(); | ||
|
||
constructor() {} | ||
|
||
focusInputEffect(event: FocusEvent): void { | ||
this.focusEffect.emit(this.label); | ||
(event.target as HTMLInputElement).select(); | ||
} | ||
|
||
blurInputEffect(): void { | ||
this.blurEffect.emit(); | ||
} | ||
|
||
setValue(): void { | ||
this.getValue.emit({ label: this.label, value: this.value }); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
components/cron-expression/cron-expression-label.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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE | ||
*/ | ||
|
||
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input, OnInit } from '@angular/core'; | ||
|
||
import { NzCronExpressionLabelI18n } from 'ng-zorro-antd/i18n'; | ||
|
||
import { TimeType, TimeTypeError } from './typings'; | ||
|
||
@Component({ | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
encapsulation: ViewEncapsulation.None, | ||
selector: 'nz-cron-expression-label', | ||
exportAs: 'nzCronExpression', | ||
template: ` | ||
<div | ||
class="ant-cron-expression-label" | ||
[class.ant-cron-expression-label-foucs]="labelFocus === type" | ||
[class.ant-cron-expression-error]="!valid" | ||
> | ||
<label nz-tooltip [nzTooltipTitle]="error" [nzTooltipVisible]="!valid" nzTooltipPlacement="bottom"> | ||
{{ locale[type] }} | ||
</label> | ||
</div> | ||
<ng-template #error> | ||
<div class="ant-cron-expression-hint" [innerHTML]="locale[labelError]"></div> | ||
</ng-template> | ||
` | ||
}) | ||
export class NzCronExpressionLabelComponent implements OnInit { | ||
@Input() type: TimeType = 'second'; | ||
@Input() valid: boolean = true; | ||
@Input() locale!: NzCronExpressionLabelI18n; | ||
@Input() labelFocus: string | null = null; | ||
labelError: TimeTypeError = 'secondError'; | ||
|
||
constructor() {} | ||
|
||
ngOnInit(): void { | ||
this.labelError = `${this.type}Error`; | ||
} | ||
} |
Oops, something went wrong.