-
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathindex.ts
115 lines (104 loc) · 2.56 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import format from 'date-fns/format';
import { Props as DayzedProps, RenderProps } from 'dayzed';
import { FormInputProps, SemanticICONS } from 'semantic-ui-react';
export type Object = { [key: string]: any };
export type Locale = {
todayButton: string;
nextMonth: string;
previousMonth: string;
nextYear: string;
previousYear: string;
weekdays: string[];
months: string[];
};
export type LocaleOptions =
| 'bg-BG'
| 'ca-ES'
| 'cs-CZ'
| 'da-DK'
| 'de-DE'
| 'el-GR'
| 'en-US'
| 'es-ES'
| 'et-EE'
| 'fi-FI'
| 'fr-FR'
| 'he-IL'
| 'it-IT'
| 'ja-JP'
| 'ko-KR'
| 'nb-NO'
| 'nl-NL'
| 'nn-NO'
| 'pl-PL'
| 'pt-BR'
| 'ro-RO'
| 'ru-RU'
| 'sk-SK'
| 'sv-SE'
| 'tr-TR'
| 'zh-CN';
export type PickedDayzedProps = Pick<
DayzedProps,
'date' | 'maxDate' | 'minDate' | 'firstDayOfWeek' | 'showOutsideDays'
>;
export type PickedFormInputProps = Pick<
FormInputProps,
| 'autoFocus'
| 'className'
| 'disabled'
| 'error'
| 'iconPosition'
| 'id'
| 'label'
| 'loading'
| 'name'
| 'placeholder'
| 'size'
| 'tabIndex'
| 'transparent'
| 'readOnly'
>;
export type FnsFormatOptions = Parameters<typeof format>[2];
export type SemanticDatepickerProps = PickedDayzedProps &
PickedFormInputProps & {
allowOnlyNumbers: boolean;
autoComplete?: string;
clearOnSameDateClick: boolean;
clearable: boolean;
clearIcon?: SemanticICONS | React.ReactElement;
filterDate: (date: Date) => boolean;
format: string;
formatOptions?: FnsFormatOptions;
keepOpenOnClear: boolean;
keepOpenOnSelect: boolean;
icon?: SemanticICONS | React.ReactElement;
inline: boolean;
inverted: boolean;
locale: LocaleOptions;
onBlur: (event: React.SyntheticEvent) => void;
onFocus: (event: React.SyntheticEvent) => void;
onChange: (
event: React.SyntheticEvent | undefined,
data: SemanticDatepickerProps
) => void;
pointing: 'left' | 'right' | 'top left' | 'top right';
required?: boolean;
showToday: boolean;
type: 'basic' | 'range';
datePickerOnly: boolean;
value: DayzedProps['selected'] | null;
};
export type BaseDatePickerProps = DayzedProps & {
children: any;
};
export interface BasicDatePickerProps extends BaseDatePickerProps {
clearOnSameDateClick?: boolean;
onChange: (event: React.SyntheticEvent, date: Date | null) => void;
selected: Date;
}
export interface RangeDatePickerProps extends BaseDatePickerProps {
onChange: (event: React.SyntheticEvent, dates: Date[] | null) => void;
selected: Date[];
}
export type { DayzedProps, RenderProps };