diff --git a/components/cron-expression/cron-expression-input.component.ts b/components/cron-expression/cron-expression-input.component.ts new file mode 100644 index 00000000000..0d9c3c9271a --- /dev/null +++ b/components/cron-expression/cron-expression-input.component.ts @@ -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: ` +
cron: {{ cron }}
` }) export class NzDemoCronExpressionShortcutsComponent { - defaults: string | null = null; + value: string = '1 1 * * *'; + cron: string = ''; options = [ { label: 'Every hour', @@ -35,7 +42,11 @@ export class NzDemoCronExpressionShortcutsComponent { } ]; - Shortcuts(value: string): void { - this.defaults = value; + setValue(value: string): void { + this.value = value; + } + + getValue(value: string): void { + this.cron = value; } } diff --git a/components/cron-expression/demo/type.md b/components/cron-expression/demo/type.md index c34d649b75f..e642cf8b8b6 100644 --- a/components/cron-expression/demo/type.md +++ b/components/cron-expression/demo/type.md @@ -7,8 +7,8 @@ title: ## zh-CN -我们为 `nz-cron-expression` 输入框定义了两种规则类型(五段式, 六段式),分别为: `nzCronType="linux"`、`nzCronType="spring"`。 +我们为 `nz-cron-expression` 输入框定义了两种规则类型(五段式, 六段式),分别为: `nzType="linux"`、`nzType="spring"`。 ## en-US -There are two rule types of an CronExpression box: `nzCronType="linux"` (five-segment) and`nzCronType="spring"` (six-segment). +There are two rule types of an CronExpression box: `nzType="linux"` (five-segment) and`nzType="spring"` (six-segment). diff --git a/components/cron-expression/demo/type.ts b/components/cron-expression/demo/type.ts index f90d9c617fa..40c5b858bcb 100644 --- a/components/cron-expression/demo/type.ts +++ b/components/cron-expression/demo/type.ts @@ -4,8 +4,8 @@ import { Component } from '@angular/core'; selector: 'nz-demo-cron-expression-type', template: `*Any value
,Separator between multiple values
-Connector for interval values
/Equally distributed
1-12Allowable range
', weekError: - '*Any value
,Separator between multiple values
-Connector for interval values
/Equally distributed
0-7Allowable range (0 represents Sunday, 1-7 are Monday to Sunday)
' + '*Any value
,Separator between multiple values
-Connector for interval values
/Equally distributed
? Not specify0-7Allowable range (0 represents Sunday, 1-7 are Monday to Sunday)
' } }; diff --git a/components/i18n/languages/zh_CN.ts b/components/i18n/languages/zh_CN.ts index e4ffa9f31cf..45fa17658d7 100755 --- a/components/i18n/languages/zh_CN.ts +++ b/components/i18n/languages/zh_CN.ts @@ -193,6 +193,6 @@ export default { monthError: '* 任意值
, 多个值之间的分隔符
- 区间值的连接符
/ 平均分配
1-12 允许范围
', weekError: - '* 任意值
, 多个值之间的分隔符
- 区间值的连接符
/ 平均分配
0-7 允许范围(0代表周日,1-7依次为周一到周日)
' + '* 任意值
, 多个值之间的分隔符
- 区间值的连接符
/ 平均分配
? 不指定
0-7 允许范围(0代表周日,1-7依次为周一到周日)
' } }; diff --git a/components/i18n/nz-i18n.interface.ts b/components/i18n/nz-i18n.interface.ts index a417e547674..a4e000a9a8a 100644 --- a/components/i18n/nz-i18n.interface.ts +++ b/components/i18n/nz-i18n.interface.ts @@ -131,23 +131,28 @@ export interface NzTextI18nInterface { expand: string; } -export interface NzCronExpressionI18nInterface { - cronError: string; - second: string; - minute: string; - hour: string; - day: string; - month: string; - week: string; +export interface NzCronExpressionLabelI18n { + second?: string; + minute?: string; + hour?: string; + day?: string; + month?: string; + week?: string; // innerHTML - secondError: string; - minuteError: string; - hourError: string; - dayError: string; - monthError: string; - weekError: string; + secondError?: string; + minuteError?: string; + hourError?: string; + dayError?: string; + monthError?: string; + weekError?: string; +} + +export interface NzCronExpressionCronErrorI18n { + cronError?: string; } +export type NzCronExpressionI18nInterface = NzCronExpressionCronErrorI18n & NzCronExpressionLabelI18n; + export interface NzI18nInterface { locale: string; Pagination: NzPaginationI18nInterface;