import { OnInit, EventEmitter, OnDestroy, SimpleChanges } from '@angular/core';
import { CronOptions } from './cron-options';
import { ControlValueAccessor, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
import { Subject } from 'rxjs';
import * as i0 from "@angular/core";
/**
* build the cron from this form.
*
*/
export declare const CRON_VALUE_ACCESSOR: any;
export declare class CronEditorComponent implements OnInit, ControlValueAccessor, OnDestroy {
private fb;
private translateService;
options: CronOptions;
cronStartingValue: string;
cronChange: EventEmitter;
vaildExpression: EventEmitter;
/** what initial tab to show the cron on */
activeTab: any;
/** build the options of the cron form */
selectOptions: {
months: number[];
monthWeeks: string[];
days: string[];
daysSortedByWeekStart: any[];
minutes: string[];
seconds: number[];
hours: number[];
monthDays: number[];
monthDaysWithLasts: string[];
monthDaysWithOutLasts: string[];
hourTypes: string[];
};
state: any;
private isDirty;
private isValid;
readonly MonthWeeks: {
'#1': string;
'#2': string;
'#3': string;
'#4': string;
'#5': string;
L: string;
};
readonly Months: {
1: string;
2: string;
3: string;
4: string;
5: string;
6: string;
7: string;
8: string;
9: string;
10: string;
11: string;
12: string;
};
minutesForm: UntypedFormGroup;
hourlyForm: UntypedFormGroup;
dailyForm: UntypedFormGroup;
weeklyForm: UntypedFormGroup;
monthlyForm: UntypedFormGroup;
yearlyForm: UntypedFormGroup;
advancedForm: UntypedFormGroup;
currentLanguage: string;
cronValue: string;
/** it varies due to the option JSON */
tabList: string[];
unsub$: Subject;
firstChange: number;
/** get the value from the input value and use it around the component */
get cron(): string;
/** set the cron around this component */
set cron(value: string);
get isCronFlavorQuartz(): boolean;
get isCronFlavorStandard(): boolean;
get yearDefaultChar(): string;
get weekDayDefaultChar(): string;
get monthDayDefaultChar(): string;
constructor(fb: UntypedFormBuilder, translateService: TranslateService);
ngOnChanges(changes: SimpleChanges): void;
ngOnInit(): void;
private createForm;
/**
* Based on the hide... options create the list of tabs
*/
private createTabList;
private computeMinutesCron;
private computeHourlyCron;
private computeDailyCron;
private computeWeeklyCron;
private computeMonthlyCron;
private computeYearlyCron;
private computeAdvancedExpression;
private getAmPmHour;
private getHourType;
private hourToCron;
/**
* Populate the state with the cron expression
* passed as input to this component
*
* @param cron cronExpression coming from the input
*/
private handleModelChange;
/**
* Check cron expression and see what tab to populate
*
* @param cron cron expression
* @returns nothing
*/
private populateTab;
private advance;
private minutes;
private hourly;
private dailyEveryDays;
private dailyEveryWeekDay;
private weekly;
private monthlySpecificDay;
private monthlySpecificWeekDay;
private yearlySpecificMonthDay;
private yearlySpecificMonthWeek;
private cronIsValid;
/**
* Initialize state of the schedulation
* with hard coded values
*
*/
private getInitialState;
getSelectOptions(): {
months: number[];
monthWeeks: string[];
days: string[];
daysSortedByWeekStart: any[];
minutes: string[];
seconds: number[];
hours: number[];
monthDays: number[];
monthDaysWithLasts: string[];
monthDaysWithOutLasts: string[];
hourTypes: string[];
};
isExpressionValid(): void;
/**
* Create ranges for the different edge numbers
*
* @param start start from
* @param end end to
* @returns
*/
private getRange;
onChange: (_: any) => void;
onTouched: () => void;
writeValue(obj: string): void;
registerOnChange(fn: any): void;
registerOnTouched(fn: any): void;
/** Update the cron output to that of the selected tab
*/
onTabFocus(idx: number): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}