121 lines
6.2 KiB
TypeScript
121 lines
6.2 KiB
TypeScript
import * as i0 from '@angular/core';
|
|
import { OnInit, OnChanges, TemplateRef, SimpleChanges, EventEmitter } from '@angular/core';
|
|
import { ControlValueAccessor, AsyncValidator, FormGroup, FormControl, ValidationErrors, ValidatorFn } from '@angular/forms';
|
|
import { Observable } from 'rxjs';
|
|
import { CronExpression } from 'cron-parser';
|
|
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
|
import { NzCronExpressionI18nInterface, NzCronExpressionLabelI18n, NzCronExpressionCronErrorI18n } from 'ng-zorro-antd/i18n';
|
|
import * as ng_zorro_antd_cron_expression from 'ng-zorro-antd/cron-expression';
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
type TimeType = keyof Cron;
|
|
interface Cron {
|
|
second?: CronValue;
|
|
minute?: CronValue;
|
|
hour?: CronValue;
|
|
day?: CronValue;
|
|
month?: CronValue;
|
|
week?: CronValue;
|
|
}
|
|
type CronValue = '*' | `${number}` | `${number}-${number}` | `${number}/${number}` | string;
|
|
interface CronChangeType {
|
|
label: TimeType;
|
|
value: CronValue;
|
|
}
|
|
type NzCronExpressionSize = 'large' | 'default' | 'small';
|
|
type NzCronExpressionType = 'linux' | 'spring';
|
|
|
|
declare class NzCronExpressionComponent implements OnInit, OnChanges, ControlValueAccessor, AsyncValidator {
|
|
private formBuilder;
|
|
private cdr;
|
|
private i18n;
|
|
private destroyRef;
|
|
nzSize: NzCronExpressionSize;
|
|
nzType: NzCronExpressionType;
|
|
nzCollapseDisable: boolean;
|
|
nzExtra?: TemplateRef<void> | null;
|
|
nzSemantic: TemplateRef<void> | null;
|
|
nzBorderless: boolean;
|
|
nzDisabled: boolean;
|
|
locale: NzCronExpressionI18nInterface;
|
|
focus: boolean;
|
|
labelFocus: TimeType | null;
|
|
labels: TimeType[];
|
|
interval: CronExpression<false>;
|
|
nextTimeList: Date[];
|
|
private isNzDisableFirstChange;
|
|
validateForm: FormGroup<Record<TimeType, FormControl<CronValue>>>;
|
|
onChange: NzSafeAny;
|
|
onTouch: () => void;
|
|
convertFormat(value: string): void;
|
|
writeValue(value: string | null): void;
|
|
registerOnChange(fn: NzSafeAny): void;
|
|
registerOnTouched(fn: NzSafeAny): void;
|
|
validate(): Observable<ValidationErrors | null>;
|
|
setDisabledState(isDisabled: boolean): void;
|
|
constructor();
|
|
ngOnInit(): void;
|
|
ngOnChanges(changes: SimpleChanges): void;
|
|
cronFormType(): void;
|
|
previewDate(value: Cron): void;
|
|
loadMorePreview(): void;
|
|
focusEffect(value: TimeType): void;
|
|
blurEffect(): void;
|
|
getValue(item: CronChangeType): void;
|
|
checkValid: ValidatorFn;
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NzCronExpressionComponent, never>;
|
|
static ɵcmp: i0.ɵɵComponentDeclaration<NzCronExpressionComponent, "nz-cron-expression", ["nzCronExpression"], { "nzSize": { "alias": "nzSize"; "required": false; }; "nzType": { "alias": "nzType"; "required": false; }; "nzCollapseDisable": { "alias": "nzCollapseDisable"; "required": false; }; "nzExtra": { "alias": "nzExtra"; "required": false; }; "nzSemantic": { "alias": "nzSemantic"; "required": false; }; "nzBorderless": { "alias": "nzBorderless"; "required": false; }; "nzDisabled": { "alias": "nzDisabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
static ngAcceptInputType_nzCollapseDisable: unknown;
|
|
static ngAcceptInputType_nzBorderless: unknown;
|
|
static ngAcceptInputType_nzDisabled: unknown;
|
|
}
|
|
|
|
declare class NzCronExpressionLabelComponent {
|
|
type: TimeType;
|
|
locale: NzCronExpressionLabelI18n;
|
|
labelFocus: string | null;
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NzCronExpressionLabelComponent, never>;
|
|
static ɵcmp: i0.ɵɵComponentDeclaration<NzCronExpressionLabelComponent, "nz-cron-expression-label", ["nzCronExpressionLabel"], { "type": { "alias": "type"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "labelFocus": { "alias": "labelFocus"; "required": false; }; }, {}, never, never, true, never>;
|
|
}
|
|
|
|
declare class NzCronExpressionInputComponent {
|
|
value: string;
|
|
label: TimeType;
|
|
disabled: boolean;
|
|
readonly focusEffect: EventEmitter<keyof ng_zorro_antd_cron_expression.Cron>;
|
|
readonly blurEffect: EventEmitter<void>;
|
|
readonly getValue: EventEmitter<CronChangeType>;
|
|
focusInputEffect(event: FocusEvent): void;
|
|
blurInputEffect(): void;
|
|
setValue(): void;
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NzCronExpressionInputComponent, never>;
|
|
static ɵcmp: i0.ɵɵComponentDeclaration<NzCronExpressionInputComponent, "nz-cron-expression-input", ["nzCronExpressionInput"], { "value": { "alias": "value"; "required": false; }; "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "focusEffect": "focusEffect"; "blurEffect": "blurEffect"; "getValue": "getValue"; }, never, never, true, never>;
|
|
static ngAcceptInputType_disabled: unknown;
|
|
}
|
|
|
|
declare class NzCronExpressionPreviewComponent {
|
|
private cdr;
|
|
TimeList: Date[];
|
|
visible: boolean;
|
|
locale: NzCronExpressionCronErrorI18n;
|
|
nzSemantic: TemplateRef<void> | null;
|
|
readonly loadMorePreview: EventEmitter<void>;
|
|
isExpand: boolean;
|
|
setExpand(): void;
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NzCronExpressionPreviewComponent, never>;
|
|
static ɵcmp: i0.ɵɵComponentDeclaration<NzCronExpressionPreviewComponent, "nz-cron-expression-preview", ["nzCronExpressionPreview"], { "TimeList": { "alias": "TimeList"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "nzSemantic": { "alias": "nzSemantic"; "required": false; }; }, { "loadMorePreview": "loadMorePreview"; }, never, never, true, never>;
|
|
static ngAcceptInputType_visible: unknown;
|
|
}
|
|
|
|
declare class NzCronExpressionModule {
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NzCronExpressionModule, never>;
|
|
static ɵmod: i0.ɵɵNgModuleDeclaration<NzCronExpressionModule, never, [typeof NzCronExpressionComponent, typeof NzCronExpressionLabelComponent, typeof NzCronExpressionInputComponent, typeof NzCronExpressionPreviewComponent], [typeof NzCronExpressionComponent]>;
|
|
static ɵinj: i0.ɵɵInjectorDeclaration<NzCronExpressionModule>;
|
|
}
|
|
|
|
export { NzCronExpressionComponent, NzCronExpressionModule };
|
|
export type { Cron, CronChangeType, CronValue, NzCronExpressionSize, NzCronExpressionType, TimeType };
|