fix: updates typing on DatePicker component and joi schema
This commit is contained in:
@@ -225,7 +225,21 @@ export const date = baseField.keys({
|
||||
type: joi.string().valid('date').required(),
|
||||
name: joi.string().required(),
|
||||
defaultValue: joi.string(),
|
||||
}).unknown(true); // remove when we better specify options allowed to pass to React Datepicker
|
||||
admin: baseAdminFields.keys({
|
||||
date: joi.object({
|
||||
displayFormat: joi.string(),
|
||||
pickerAppearance: joi.string(),
|
||||
minDate: joi.date(),
|
||||
maxDate: joi.date(),
|
||||
minTime: joi.date(),
|
||||
maxTime: joi.date(),
|
||||
timeIntervals: joi.number(),
|
||||
timeFormat: joi.string(),
|
||||
monthsToShow: joi.number(),
|
||||
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
const fieldSchema = joi.alternatives()
|
||||
.try(
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Editor } from 'slate';
|
||||
import { PayloadRequest } from '../../express/types';
|
||||
import { Access } from '../../config/types';
|
||||
import { Document } from '../../types';
|
||||
import { ConditionalDateProps } from '../../admin/components/elements/DatePicker/types';
|
||||
|
||||
export type FieldHook = (args: {
|
||||
value?: unknown,
|
||||
@@ -112,6 +113,10 @@ export type CheckboxField = FieldBase & {
|
||||
|
||||
export type DateField = FieldBase & {
|
||||
type: 'date';
|
||||
admin?: Admin & {
|
||||
placeholder?: string
|
||||
date?: ConditionalDateProps
|
||||
}
|
||||
}
|
||||
|
||||
export type GroupField = FieldBase & {
|
||||
|
||||
Reference in New Issue
Block a user