Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add the types for the Flatpickr custom options for the widget #40

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/formio/components/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
PastDateConstraint as BasePastDateConstraint,
DateConstraintConfiguration,
DatePickerConfig,
PickerCustomOptions,
} from '../dates';

type Validator = 'required';
Expand Down Expand Up @@ -33,6 +34,7 @@ export interface BaseDateComponentSchema extends Omit<DateInputSchema, 'hideLabe
maxDate?: Exclude<DateConstraintConfiguration, FutureOrPastDateConstraint> | PastDateConstraint;
};
datePicker?: DatePickerConfig;
customOptions?: PickerCustomOptions;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/formio/components/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
DatePickerConfig,
FutureDateConstraint,
PastDateConstraint,
PickerCustomOptions,
} from '../dates';

type Validator = 'required';
Expand All @@ -25,6 +26,7 @@ export interface BaseDateTimeComponentSchema
maxDate?: Exclude<DateConstraintConfiguration, FutureDateConstraint>;
};
datePicker?: DatePickerConfig;
customOptions?: PickerCustomOptions;
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/formio/dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,8 @@ export interface DatePickerConfig {
minDate: string | null;
maxDate: string | null;
}

/** Flatpickr specific custom options for the widget **/
export interface PickerCustomOptions {
allowInvalidPreload?: boolean;
}