UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

38 lines (37 loc) 1.48 kB
/** * Web DatePicker Provider * */ import React from 'react'; import type { DatePickerEventAttributes, DatePickerAllProps } from './DatePicker'; import type { DatePickerContextValue } from './DatePickerContext'; import type { DatePickerDates } from './hooks/useDates'; import type { DatePickerInvalidDates } from './DatePickerInput'; import type { DatePickerPartialDates } from './hooks/usePartialDates'; type DatePickerProviderProps = DatePickerAllProps & { setReturnObject: (func: DatePickerContextValue['getReturnObject']) => DatePickerContextValue['getReturnObject']; hidePicker?: DatePickerContextValue['hidePicker']; attributes?: DatePickerEventAttributes; children: React.ReactNode; }; export type DatePickerChangeEvent<E> = DatePickerDates & DatePickerInvalidDates & { nr?: number; hidePicker?: boolean; event?: E; }; export type GetReturnObjectParams<E> = DatePickerDates & DatePickerPartialDates & DatePickerInvalidDates & { event?: E; }; export type DatePickerReturnObject<E> = DatePickerInvalidDates & DatePickerPartialDates & { event?: E; attributes?: Record<string, unknown>; daysBetween?: number; date?: string | null; startDate?: string | null; endDate?: string | null; isValid?: boolean; isValidStartDate?: boolean; isValidEndDate?: boolean; }; declare function DatePickerProvider(props: DatePickerProviderProps): import("react/jsx-runtime").JSX.Element; export default DatePickerProvider;