cron-core
Props
Name | Type | Default | Description |
---|---|---|---|
model-value |
|
| the current cron expression |
fields |
|
| each field defines on position of the cron expression |
periods |
|
| the |
locale |
|
| |
custom-locale |
|
Types
type Field = {
id: string,
items: Array<{
text: string
alt: string
value: string
}>
}
type Period = {
id: string,
value: string[]
}
// strings are nested by periodId -> fieldId -> cronType -> position
// '*' can be used as a wildcard
// cronType = empty | value | range | everyX | *
// position = prefix | text | suffix | *
type Locale = {
'{periodId}'?: {
'{position}'?: string // prefix/text/suffix of period selection
'{fieldId}'?: {
'{cronType}'?: {
'{positon}'?: string // prefix/text/suffix of field
}
}
}
}
Events
Name | Description |
---|---|
update:model-value | emitted when the cron expression changed |
error | emitted when the cron expression is invalid |
Slots
Name | Description | Slot Props |
---|---|---|
default | used to render the cron editor |
|
Types
type CronState = {
fields: Array<{
attrs: {
modelValue: Array<number> //array item values
},
events: {
'update:model-value': (arg1: Array<number>) => void
},
id: string,
items: Array<Object> //see type Field
cron: string,
selectedStr: string,
prefix: string,
suffix: string
}>,
period: {
attrs: {
modelValue: string //selected period id
},
events: {
'update:model-value': (periodId: string) => void
},
items: Array<Period>,
prefix: string,
suffix: string
},
error: string
}