@chayns-components/date 5.0.0-beta.1000
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +34 -0
- package/lib/cjs/components/calendar/Calendar.js +314 -0
- package/lib/cjs/components/calendar/Calendar.js.map +1 -0
- package/lib/cjs/components/calendar/Calendar.styles.js +34 -0
- package/lib/cjs/components/calendar/Calendar.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.js +158 -0
- package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.styles.js +23 -0
- package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/Month.js +65 -0
- package/lib/cjs/components/calendar/month-wrapper/month/Month.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/Month.styles.js +26 -0
- package/lib/cjs/components/calendar/month-wrapper/month/Month.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js +129 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js +16 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.js +63 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js +114 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js +17 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js +18 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js +42 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js +16 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js +15 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js +17 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-year-pickers/MonthYearPickers.js +86 -0
- package/lib/cjs/components/calendar/month-year-pickers/MonthYearPickers.js.map +1 -0
- package/lib/cjs/components/date-info/DateInfo.js +35 -0
- package/lib/cjs/components/date-info/DateInfo.js.map +1 -0
- package/lib/cjs/components/opening-times/OpeningTimes.js +246 -0
- package/lib/cjs/components/opening-times/OpeningTimes.js.map +1 -0
- package/lib/cjs/components/opening-times/OpeningTimes.styles.js +28 -0
- package/lib/cjs/components/opening-times/OpeningTimes.styles.js.map +1 -0
- package/lib/cjs/components/opening-times/hint-text/HintText.js +19 -0
- package/lib/cjs/components/opening-times/hint-text/HintText.js.map +1 -0
- package/lib/cjs/components/opening-times/hint-text/HintText.styles.js +24 -0
- package/lib/cjs/components/opening-times/hint-text/HintText.styles.js.map +1 -0
- package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.js +153 -0
- package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.js.map +1 -0
- package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.styles.js +24 -0
- package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.styles.js.map +1 -0
- package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.js +106 -0
- package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.js.map +1 -0
- package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js +41 -0
- package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map +1 -0
- package/lib/cjs/hooks/useDateInfo.js +63 -0
- package/lib/cjs/hooks/useDateInfo.js.map +1 -0
- package/lib/cjs/index.js +177 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/types/calendar.js +28 -0
- package/lib/cjs/types/calendar.js.map +1 -0
- package/lib/cjs/types/dateinfo.js +2 -0
- package/lib/cjs/types/dateinfo.js.map +1 -0
- package/lib/cjs/types/openingTimes.js +18 -0
- package/lib/cjs/types/openingTimes.js.map +1 -0
- package/lib/cjs/utils/calendar.js +73 -0
- package/lib/cjs/utils/calendar.js.map +1 -0
- package/lib/cjs/utils/date.js +114 -0
- package/lib/cjs/utils/date.js.map +1 -0
- package/lib/cjs/utils/dateInfo.js +126 -0
- package/lib/cjs/utils/dateInfo.js.map +1 -0
- package/lib/esm/components/calendar/Calendar.js +306 -0
- package/lib/esm/components/calendar/Calendar.js.map +1 -0
- package/lib/esm/components/calendar/Calendar.styles.js +33 -0
- package/lib/esm/components/calendar/Calendar.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/MonthWrapper.js +150 -0
- package/lib/esm/components/calendar/month-wrapper/MonthWrapper.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/MonthWrapper.styles.js +22 -0
- package/lib/esm/components/calendar/month-wrapper/MonthWrapper.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/Month.js +61 -0
- package/lib/esm/components/calendar/month-wrapper/month/Month.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/Month.styles.js +22 -0
- package/lib/esm/components/calendar/month-wrapper/month/Month.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js +121 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js +9 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.js +54 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js +123 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js +13 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js +14 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js +34 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js +9 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js +11 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js +13 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-year-pickers/MonthYearPickers.js +79 -0
- package/lib/esm/components/calendar/month-year-pickers/MonthYearPickers.js.map +1 -0
- package/lib/esm/components/date-info/DateInfo.js +28 -0
- package/lib/esm/components/date-info/DateInfo.js.map +1 -0
- package/lib/esm/components/opening-times/OpeningTimes.js +240 -0
- package/lib/esm/components/opening-times/OpeningTimes.js.map +1 -0
- package/lib/esm/components/opening-times/OpeningTimes.styles.js +24 -0
- package/lib/esm/components/opening-times/OpeningTimes.styles.js.map +1 -0
- package/lib/esm/components/opening-times/hint-text/HintText.js +12 -0
- package/lib/esm/components/opening-times/hint-text/HintText.js.map +1 -0
- package/lib/esm/components/opening-times/hint-text/HintText.styles.js +23 -0
- package/lib/esm/components/opening-times/hint-text/HintText.styles.js.map +1 -0
- package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.js +149 -0
- package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.js.map +1 -0
- package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.styles.js +22 -0
- package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.styles.js.map +1 -0
- package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.js +99 -0
- package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.js.map +1 -0
- package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js +40 -0
- package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map +1 -0
- package/lib/esm/hooks/useDateInfo.js +57 -0
- package/lib/esm/hooks/useDateInfo.js.map +1 -0
- package/lib/esm/index.js +15 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/types/calendar.js +22 -0
- package/lib/esm/types/calendar.js.map +1 -0
- package/lib/esm/types/dateinfo.js +2 -0
- package/lib/esm/types/dateinfo.js.map +1 -0
- package/lib/esm/types/openingTimes.js +12 -0
- package/lib/esm/types/openingTimes.js.map +1 -0
- package/lib/esm/utils/calendar.js +63 -0
- package/lib/esm/utils/calendar.js.map +1 -0
- package/lib/esm/utils/date.js +89 -0
- package/lib/esm/utils/date.js.map +1 -0
- package/lib/esm/utils/dateInfo.js +120 -0
- package/lib/esm/utils/dateInfo.js.map +1 -0
- package/lib/types/components/calendar/Calendar.d.ts +97 -0
- package/lib/types/components/calendar/Calendar.styles.d.ts +8 -0
- package/lib/types/components/calendar/month-wrapper/MonthWrapper.d.ts +26 -0
- package/lib/types/components/calendar/month-wrapper/MonthWrapper.styles.d.ts +274 -0
- package/lib/types/components/calendar/month-wrapper/month/Month.d.ts +26 -0
- package/lib/types/components/calendar/month-wrapper/month/Month.styles.d.ts +8 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.d.ts +20 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.d.ts +1 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/Day.d.ts +19 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.d.ts +20 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.d.ts +6 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.d.ts +7 -0
- package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.d.ts +7 -0
- package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.d.ts +1 -0
- package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.d.ts +6 -0
- package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.d.ts +3 -0
- package/lib/types/components/calendar/month-year-pickers/MonthYearPickers.d.ts +19 -0
- package/lib/types/components/date-info/DateInfo.d.ts +5 -0
- package/lib/types/components/opening-times/OpeningTimes.d.ts +51 -0
- package/lib/types/components/opening-times/OpeningTimes.styles.d.ts +11 -0
- package/lib/types/components/opening-times/hint-text/HintText.d.ts +6 -0
- package/lib/types/components/opening-times/hint-text/HintText.styles.d.ts +3 -0
- package/lib/types/components/opening-times/opening-inputs/OpeningInputs.d.ts +46 -0
- package/lib/types/components/opening-times/opening-inputs/OpeningInputs.styles.d.ts +272 -0
- package/lib/types/components/opening-times/opening-inputs/opening-input/OpeningInput.d.ts +15 -0
- package/lib/types/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.d.ts +273 -0
- package/lib/types/hooks/useDateInfo.d.ts +2 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/types/calendar.d.ts +55 -0
- package/lib/types/types/dateinfo.d.ts +34 -0
- package/lib/types/types/openingTimes.d.ts +33 -0
- package/lib/types/utils/calendar.d.ts +18 -0
- package/lib/types/utils/date.d.ts +27 -0
- package/lib/types/utils/dateInfo.d.ts +14 -0
- package/package.json +86 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { getLanguage, Language } from 'chayns-api';
|
|
2
|
+
import { isCurrentYear, isToday, isTomorrow, isYesterday } from './date';
|
|
3
|
+
export const getDateInfo = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
date,
|
|
6
|
+
shouldShowYear,
|
|
7
|
+
shouldShowTime,
|
|
8
|
+
shouldShowDayOfWeek,
|
|
9
|
+
shouldShowRelativeDayOfWeek,
|
|
10
|
+
shouldUseShortText
|
|
11
|
+
} = _ref;
|
|
12
|
+
const {
|
|
13
|
+
active: language
|
|
14
|
+
} = getLanguage();
|
|
15
|
+
let dayPart = '';
|
|
16
|
+
if (shouldShowRelativeDayOfWeek) {
|
|
17
|
+
const rtf = new Intl.RelativeTimeFormat(language, {
|
|
18
|
+
numeric: 'auto'
|
|
19
|
+
});
|
|
20
|
+
if (isToday(date)) {
|
|
21
|
+
dayPart = capitalizeFirstLetter(rtf.format(0, 'day'));
|
|
22
|
+
}
|
|
23
|
+
if (isTomorrow(date)) {
|
|
24
|
+
dayPart = capitalizeFirstLetter(rtf.format(1, 'day'));
|
|
25
|
+
}
|
|
26
|
+
if (isYesterday(date)) {
|
|
27
|
+
dayPart = capitalizeFirstLetter(rtf.format(-1, 'day'));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (!dayPart && shouldShowDayOfWeek) {
|
|
31
|
+
dayPart = date.toLocaleDateString(language, {
|
|
32
|
+
weekday: shouldUseShortText ? 'short' : 'long'
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const dateParts = {
|
|
36
|
+
day: '2-digit',
|
|
37
|
+
month: shouldUseShortText ? 'short' : 'long'
|
|
38
|
+
};
|
|
39
|
+
if (shouldShowYear && !isCurrentYear(date)) {
|
|
40
|
+
dateParts.year = 'numeric';
|
|
41
|
+
}
|
|
42
|
+
const timeParts = {};
|
|
43
|
+
if (shouldShowTime) {
|
|
44
|
+
timeParts.hour = '2-digit';
|
|
45
|
+
timeParts.minute = '2-digit';
|
|
46
|
+
}
|
|
47
|
+
let formattedTime = '';
|
|
48
|
+
if (Object.keys(timeParts).length > 0) {
|
|
49
|
+
formattedTime = `, ${date.toLocaleTimeString(language, {
|
|
50
|
+
...timeParts
|
|
51
|
+
})}`;
|
|
52
|
+
}
|
|
53
|
+
const hourWord = getTimeString({
|
|
54
|
+
language
|
|
55
|
+
});
|
|
56
|
+
formattedTime += shouldShowTime ? ` ${hourWord}` : '';
|
|
57
|
+
const formattedDate = `${date.toLocaleDateString(language, dateParts)}${formattedTime}`;
|
|
58
|
+
return `${dayPart}${dayPart ? ', ' : ''}${formattedDate}`;
|
|
59
|
+
};
|
|
60
|
+
const capitalizeFirstLetter = text => text.charAt(0).toUpperCase() + text.slice(1);
|
|
61
|
+
export const getTimeTillNow = _ref2 => {
|
|
62
|
+
let {
|
|
63
|
+
date,
|
|
64
|
+
currentDate,
|
|
65
|
+
language = Language.English
|
|
66
|
+
} = _ref2;
|
|
67
|
+
const diffInSeconds = Math.floor((currentDate.getTime() - date.getTime()) / 1000);
|
|
68
|
+
const isPast = diffInSeconds > 0;
|
|
69
|
+
const units = [{
|
|
70
|
+
label: 'year',
|
|
71
|
+
seconds: 31536000
|
|
72
|
+
}, {
|
|
73
|
+
label: 'month',
|
|
74
|
+
seconds: 2592000
|
|
75
|
+
}, {
|
|
76
|
+
label: 'day',
|
|
77
|
+
seconds: 86400
|
|
78
|
+
}, {
|
|
79
|
+
label: 'hour',
|
|
80
|
+
seconds: 3600
|
|
81
|
+
}, {
|
|
82
|
+
label: 'minute',
|
|
83
|
+
seconds: 60
|
|
84
|
+
}, {
|
|
85
|
+
label: 'second',
|
|
86
|
+
seconds: 1
|
|
87
|
+
}];
|
|
88
|
+
const absDiff = Math.abs(diffInSeconds);
|
|
89
|
+
const {
|
|
90
|
+
label,
|
|
91
|
+
seconds
|
|
92
|
+
} = units.find(u => absDiff >= u.seconds) || {
|
|
93
|
+
label: 'second',
|
|
94
|
+
seconds: 1
|
|
95
|
+
};
|
|
96
|
+
const count = Math.floor(absDiff / seconds);
|
|
97
|
+
const formatter = new Intl.RelativeTimeFormat(language, {
|
|
98
|
+
numeric: 'auto'
|
|
99
|
+
});
|
|
100
|
+
return formatter.format(isPast ? -count : count, label);
|
|
101
|
+
};
|
|
102
|
+
export const getTimeString = _ref3 => {
|
|
103
|
+
let {
|
|
104
|
+
language
|
|
105
|
+
} = _ref3;
|
|
106
|
+
const map = {
|
|
107
|
+
nl: 'uur',
|
|
108
|
+
fr: 'heures',
|
|
109
|
+
de: 'Uhr',
|
|
110
|
+
es: 'horas',
|
|
111
|
+
it: 'ore',
|
|
112
|
+
pt: 'horas',
|
|
113
|
+
pl: 'godzina',
|
|
114
|
+
tr: 'saat',
|
|
115
|
+
uk: 'година',
|
|
116
|
+
en: ''
|
|
117
|
+
};
|
|
118
|
+
return map[language ?? ''] ?? '';
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=dateInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateInfo.js","names":["getLanguage","Language","isCurrentYear","isToday","isTomorrow","isYesterday","getDateInfo","_ref","date","shouldShowYear","shouldShowTime","shouldShowDayOfWeek","shouldShowRelativeDayOfWeek","shouldUseShortText","active","language","dayPart","rtf","Intl","RelativeTimeFormat","numeric","capitalizeFirstLetter","format","toLocaleDateString","weekday","dateParts","day","month","year","timeParts","hour","minute","formattedTime","Object","keys","length","toLocaleTimeString","hourWord","getTimeString","formattedDate","text","charAt","toUpperCase","slice","getTimeTillNow","_ref2","currentDate","English","diffInSeconds","Math","floor","getTime","isPast","units","label","seconds","absDiff","abs","find","u","count","formatter","_ref3","map","nl","fr","de","es","it","pt","pl","tr","uk","en"],"sources":["../../../src/utils/dateInfo.ts"],"sourcesContent":["import { getLanguage, Language } from 'chayns-api';\nimport { UseDateInfoOptions } from '../types/dateinfo';\nimport { isCurrentYear, isToday, isTomorrow, isYesterday } from './date';\n\nexport const getDateInfo = ({\n date,\n shouldShowYear,\n shouldShowTime,\n shouldShowDayOfWeek,\n shouldShowRelativeDayOfWeek,\n shouldUseShortText,\n}: Omit<UseDateInfoOptions, 'shouldShowDateToNowDifference' & 'preText'>) => {\n const { active: language } = getLanguage();\n\n let dayPart = '';\n\n if (shouldShowRelativeDayOfWeek) {\n const rtf = new Intl.RelativeTimeFormat(language, { numeric: 'auto' });\n\n if (isToday(date)) {\n dayPart = capitalizeFirstLetter(rtf.format(0, 'day'));\n }\n\n if (isTomorrow(date)) {\n dayPart = capitalizeFirstLetter(rtf.format(1, 'day'));\n }\n\n if (isYesterday(date)) {\n dayPart = capitalizeFirstLetter(rtf.format(-1, 'day'));\n }\n }\n\n if (!dayPart && shouldShowDayOfWeek) {\n dayPart = date.toLocaleDateString(language, {\n weekday: shouldUseShortText ? 'short' : 'long',\n });\n }\n\n const dateParts: Intl.DateTimeFormatOptions = {\n day: '2-digit',\n month: shouldUseShortText ? 'short' : 'long',\n };\n\n if (shouldShowYear && !isCurrentYear(date)) {\n dateParts.year = 'numeric';\n }\n\n const timeParts: Intl.DateTimeFormatOptions = {};\n\n if (shouldShowTime) {\n timeParts.hour = '2-digit';\n timeParts.minute = '2-digit';\n }\n\n let formattedTime = '';\n if (Object.keys(timeParts).length > 0) {\n formattedTime = `, ${date.toLocaleTimeString(language, { ...timeParts })}`;\n }\n\n const hourWord = getTimeString({ language });\n\n formattedTime += shouldShowTime ? ` ${hourWord}` : '';\n\n const formattedDate = `${date.toLocaleDateString(language, dateParts)}${formattedTime}`;\n\n return `${dayPart}${dayPart ? ', ' : ''}${formattedDate}`;\n};\n\nconst capitalizeFirstLetter = (text: string): string =>\n text.charAt(0).toUpperCase() + text.slice(1);\n\ntype RelativeTimeUnit = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second';\n\ninterface GetTimeTillNow {\n date: Date;\n currentDate: Date;\n language: Language;\n}\n\nexport const getTimeTillNow = ({\n date,\n currentDate,\n language = Language.English,\n}: GetTimeTillNow): string => {\n const diffInSeconds = Math.floor((currentDate.getTime() - date.getTime()) / 1000);\n const isPast = diffInSeconds > 0;\n\n const units: { label: RelativeTimeUnit; seconds: number }[] = [\n { label: 'year', seconds: 31536000 },\n { label: 'month', seconds: 2592000 },\n { label: 'day', seconds: 86400 },\n { label: 'hour', seconds: 3600 },\n { label: 'minute', seconds: 60 },\n { label: 'second', seconds: 1 },\n ];\n\n const absDiff = Math.abs(diffInSeconds);\n const { label, seconds } = units.find((u) => absDiff >= u.seconds) || {\n label: 'second',\n seconds: 1,\n };\n const count = Math.floor(absDiff / seconds);\n\n const formatter = new Intl.RelativeTimeFormat(language, { numeric: 'auto' });\n\n return formatter.format(isPast ? -count : count, label);\n};\n\ninterface GetTimeStringProps {\n language?: Language;\n}\n\nexport const getTimeString = ({ language }: GetTimeStringProps) => {\n const map: { [key: string]: string } = {\n nl: 'uur',\n fr: 'heures',\n de: 'Uhr',\n es: 'horas',\n it: 'ore',\n pt: 'horas',\n pl: 'godzina',\n tr: 'saat',\n uk: 'година',\n en: '',\n };\n\n return map[language ?? ''] ?? '';\n};\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Language } from 'chayns-api';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { CalendarType, Categories, CustomThumbColors, DateInterval, HighlightedDates } from '../../types/calendar';
|
|
4
|
+
interface BaseProps {
|
|
5
|
+
/**
|
|
6
|
+
* An array to group dates into a category.
|
|
7
|
+
*/
|
|
8
|
+
categories?: Categories[];
|
|
9
|
+
/**
|
|
10
|
+
* Custom colors for the thumb.
|
|
11
|
+
*/
|
|
12
|
+
customThumbColors?: CustomThumbColors;
|
|
13
|
+
/**
|
|
14
|
+
* An array with dates and corresponding styles to highlight.
|
|
15
|
+
*/
|
|
16
|
+
highlightedDates?: HighlightedDates[];
|
|
17
|
+
/**
|
|
18
|
+
* To disable the Calendar
|
|
19
|
+
*/
|
|
20
|
+
isDisabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The locale language to format the dates.
|
|
23
|
+
*/
|
|
24
|
+
locale?: Language;
|
|
25
|
+
/**
|
|
26
|
+
* The maximum date that can be selected.
|
|
27
|
+
*/
|
|
28
|
+
maxDate?: Date;
|
|
29
|
+
/**
|
|
30
|
+
* The minimum date that can be selected.
|
|
31
|
+
*/
|
|
32
|
+
minDate?: Date;
|
|
33
|
+
/**
|
|
34
|
+
* An array of dates that should be disabled.
|
|
35
|
+
*/
|
|
36
|
+
disabledDates?: Date[];
|
|
37
|
+
/**
|
|
38
|
+
* Whether the highlighted dates should be displayed for the greyed month overlay days.
|
|
39
|
+
*/
|
|
40
|
+
shouldShowHighlightsInMonthOverlay?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Shows the month and year pickers, if there are multiple months/years to select from.
|
|
43
|
+
*/
|
|
44
|
+
showMonthYearPickers?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Function to be executed when the selected date, dates or date interval change.
|
|
47
|
+
* @param date
|
|
48
|
+
*/
|
|
49
|
+
onChange?: (date: Date | Date[] | DateInterval) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Function to be executed when the shown dates change. Returns the start of the displayed month and the end of the last displayed month (since depending on the available widths, there are one or two months displayed).
|
|
52
|
+
@param { start: Date, end: Date }
|
|
53
|
+
*/
|
|
54
|
+
onShownDatesChange?: (dates: {
|
|
55
|
+
start: Date;
|
|
56
|
+
end: Date;
|
|
57
|
+
}) => void;
|
|
58
|
+
}
|
|
59
|
+
interface SingleSelectionProps {
|
|
60
|
+
/**
|
|
61
|
+
* The type of the calendar selection.
|
|
62
|
+
*/
|
|
63
|
+
type?: CalendarType.Single;
|
|
64
|
+
/**
|
|
65
|
+
* A date that should be preselected.
|
|
66
|
+
*/
|
|
67
|
+
selectedDate?: Date;
|
|
68
|
+
selectedDates?: never;
|
|
69
|
+
selectedDateInterval?: never;
|
|
70
|
+
}
|
|
71
|
+
interface MultipleSelectionProps {
|
|
72
|
+
/**
|
|
73
|
+
* The type of the calendar selection.
|
|
74
|
+
*/
|
|
75
|
+
type: CalendarType.Multiple;
|
|
76
|
+
/**
|
|
77
|
+
* An array of dates that should be preselected.
|
|
78
|
+
*/
|
|
79
|
+
selectedDates?: Date[];
|
|
80
|
+
selectedDate?: never;
|
|
81
|
+
selectedDateInterval?: never;
|
|
82
|
+
}
|
|
83
|
+
interface IntervalSelectionProps {
|
|
84
|
+
/**
|
|
85
|
+
* The type of the calendar selection.
|
|
86
|
+
*/
|
|
87
|
+
type: CalendarType.Interval;
|
|
88
|
+
/**
|
|
89
|
+
* An interval that should be preselected.
|
|
90
|
+
*/
|
|
91
|
+
selectedDateInterval?: DateInterval;
|
|
92
|
+
selectedDates?: never;
|
|
93
|
+
selectedDate?: never;
|
|
94
|
+
}
|
|
95
|
+
export type CalendarProps = BaseProps & (SingleSelectionProps | MultipleSelectionProps | IntervalSelectionProps);
|
|
96
|
+
declare const Calendar: FC<CalendarProps>;
|
|
97
|
+
export default Calendar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type StyledCalendarProps = {
|
|
2
|
+
$isDisabled?: boolean;
|
|
3
|
+
};
|
|
4
|
+
export declare const StyledCalendar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledCalendarProps>> & string;
|
|
5
|
+
export declare const StyledCalendarIconWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
|
+
export declare const StyledCalendarIconWrapperPseudo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const StyledPseudoMonthYearPicker: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarType, Categories, CustomThumbColors, DateInterval, HighlightedDates } from '../../../types/calendar';
|
|
3
|
+
import { Language } from "chayns-api";
|
|
4
|
+
export type MonthWrapperProps = {
|
|
5
|
+
locale: Language;
|
|
6
|
+
highlightedDates?: HighlightedDates[];
|
|
7
|
+
onSelect: (date: Date) => void;
|
|
8
|
+
selectedDate?: Date | Date[] | DateInterval;
|
|
9
|
+
categories?: Categories[];
|
|
10
|
+
currentDate: Date;
|
|
11
|
+
direction?: 'left' | 'right';
|
|
12
|
+
onAnimationFinished: () => void;
|
|
13
|
+
shouldRenderTwo: boolean;
|
|
14
|
+
width: number;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
maxDate: Date;
|
|
17
|
+
minDate: Date;
|
|
18
|
+
type: CalendarType;
|
|
19
|
+
disabledDates: Date[];
|
|
20
|
+
setCurrentDate: (date: Date) => void;
|
|
21
|
+
shouldShowHighlightsInMonthOverlay: boolean;
|
|
22
|
+
showMonthYearPickers: boolean;
|
|
23
|
+
customThumbColors?: CustomThumbColors;
|
|
24
|
+
};
|
|
25
|
+
declare const MonthWrapper: FC<MonthWrapperProps>;
|
|
26
|
+
export default MonthWrapper;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import type { WithTheme } from '@chayns-components/core';
|
|
2
|
+
type StyledMonthWrapperProps = WithTheme<{
|
|
3
|
+
$height: number;
|
|
4
|
+
$width: number;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const StyledMonthWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledMonthWrapperProps>> & string;
|
|
7
|
+
type StyledMotionWrapperProps = {
|
|
8
|
+
$isDisabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const StyledMotionWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<{
|
|
11
|
+
color?: string | undefined;
|
|
12
|
+
defaultChecked?: boolean | undefined;
|
|
13
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
14
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
15
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
16
|
+
accessKey?: string | undefined;
|
|
17
|
+
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
18
|
+
autoFocus?: boolean | undefined;
|
|
19
|
+
className?: string | undefined;
|
|
20
|
+
contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
|
|
21
|
+
contextMenu?: string | undefined;
|
|
22
|
+
dir?: string | undefined;
|
|
23
|
+
draggable?: (boolean | "false" | "true") | undefined;
|
|
24
|
+
enterKeyHint?: "search" | "next" | "enter" | "done" | "go" | "previous" | "send" | undefined;
|
|
25
|
+
hidden?: boolean | undefined;
|
|
26
|
+
id?: string | undefined;
|
|
27
|
+
lang?: string | undefined;
|
|
28
|
+
nonce?: string | undefined;
|
|
29
|
+
slot?: string | undefined;
|
|
30
|
+
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
31
|
+
tabIndex?: number | undefined;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
translate?: "yes" | "no" | undefined;
|
|
34
|
+
radioGroup?: string | undefined;
|
|
35
|
+
role?: import("react").AriaRole | undefined;
|
|
36
|
+
about?: string | undefined;
|
|
37
|
+
content?: string | undefined;
|
|
38
|
+
datatype?: string | undefined;
|
|
39
|
+
inlist?: any;
|
|
40
|
+
prefix?: string | undefined;
|
|
41
|
+
property?: string | undefined;
|
|
42
|
+
rel?: string | undefined;
|
|
43
|
+
resource?: string | undefined;
|
|
44
|
+
rev?: string | undefined;
|
|
45
|
+
typeof?: string | undefined;
|
|
46
|
+
vocab?: string | undefined;
|
|
47
|
+
autoCorrect?: string | undefined;
|
|
48
|
+
autoSave?: string | undefined;
|
|
49
|
+
itemProp?: string | undefined;
|
|
50
|
+
itemScope?: boolean | undefined;
|
|
51
|
+
itemType?: string | undefined;
|
|
52
|
+
itemID?: string | undefined;
|
|
53
|
+
itemRef?: string | undefined;
|
|
54
|
+
results?: number | undefined;
|
|
55
|
+
security?: string | undefined;
|
|
56
|
+
unselectable?: "off" | "on" | undefined;
|
|
57
|
+
inputMode?: "numeric" | "none" | "search" | "text" | "tel" | "url" | "email" | "decimal" | undefined;
|
|
58
|
+
is?: string | undefined;
|
|
59
|
+
"aria-activedescendant"?: string | undefined;
|
|
60
|
+
"aria-atomic"?: (boolean | "false" | "true") | undefined;
|
|
61
|
+
"aria-autocomplete"?: "none" | "list" | "both" | "inline" | undefined;
|
|
62
|
+
"aria-braillelabel"?: string | undefined;
|
|
63
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
64
|
+
"aria-busy"?: (boolean | "false" | "true") | undefined;
|
|
65
|
+
"aria-checked"?: boolean | "mixed" | "false" | "true" | undefined;
|
|
66
|
+
"aria-colcount"?: number | undefined;
|
|
67
|
+
"aria-colindex"?: number | undefined;
|
|
68
|
+
"aria-colindextext"?: string | undefined;
|
|
69
|
+
"aria-colspan"?: number | undefined;
|
|
70
|
+
"aria-controls"?: string | undefined;
|
|
71
|
+
"aria-current"?: boolean | "time" | "step" | "page" | "false" | "true" | "date" | "location" | undefined;
|
|
72
|
+
"aria-describedby"?: string | undefined;
|
|
73
|
+
"aria-description"?: string | undefined;
|
|
74
|
+
"aria-details"?: string | undefined;
|
|
75
|
+
"aria-disabled"?: (boolean | "false" | "true") | undefined;
|
|
76
|
+
"aria-dropeffect"?: "none" | "link" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
77
|
+
"aria-errormessage"?: string | undefined;
|
|
78
|
+
"aria-expanded"?: (boolean | "false" | "true") | undefined;
|
|
79
|
+
"aria-flowto"?: string | undefined;
|
|
80
|
+
"aria-grabbed"?: (boolean | "false" | "true") | undefined;
|
|
81
|
+
"aria-haspopup"?: boolean | "dialog" | "menu" | "listbox" | "grid" | "false" | "true" | "tree" | undefined;
|
|
82
|
+
"aria-hidden"?: (boolean | "false" | "true") | undefined;
|
|
83
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
84
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
85
|
+
"aria-label"?: string | undefined;
|
|
86
|
+
"aria-labelledby"?: string | undefined;
|
|
87
|
+
"aria-level"?: number | undefined;
|
|
88
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
89
|
+
"aria-modal"?: (boolean | "false" | "true") | undefined;
|
|
90
|
+
"aria-multiline"?: (boolean | "false" | "true") | undefined;
|
|
91
|
+
"aria-multiselectable"?: (boolean | "false" | "true") | undefined;
|
|
92
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
93
|
+
"aria-owns"?: string | undefined;
|
|
94
|
+
"aria-placeholder"?: string | undefined;
|
|
95
|
+
"aria-posinset"?: number | undefined;
|
|
96
|
+
"aria-pressed"?: boolean | "mixed" | "false" | "true" | undefined;
|
|
97
|
+
"aria-readonly"?: (boolean | "false" | "true") | undefined;
|
|
98
|
+
"aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
99
|
+
"aria-required"?: (boolean | "false" | "true") | undefined;
|
|
100
|
+
"aria-roledescription"?: string | undefined;
|
|
101
|
+
"aria-rowcount"?: number | undefined;
|
|
102
|
+
"aria-rowindex"?: number | undefined;
|
|
103
|
+
"aria-rowindextext"?: string | undefined;
|
|
104
|
+
"aria-rowspan"?: number | undefined;
|
|
105
|
+
"aria-selected"?: (boolean | "false" | "true") | undefined;
|
|
106
|
+
"aria-setsize"?: number | undefined;
|
|
107
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
108
|
+
"aria-valuemax"?: number | undefined;
|
|
109
|
+
"aria-valuemin"?: number | undefined;
|
|
110
|
+
"aria-valuenow"?: number | undefined;
|
|
111
|
+
"aria-valuetext"?: string | undefined;
|
|
112
|
+
dangerouslySetInnerHTML?: {
|
|
113
|
+
__html: string | TrustedHTML;
|
|
114
|
+
} | undefined;
|
|
115
|
+
onCopy?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
116
|
+
onCopyCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
117
|
+
onCut?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
118
|
+
onCutCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
119
|
+
onPaste?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
120
|
+
onPasteCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
121
|
+
onCompositionEnd?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
122
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
123
|
+
onCompositionStart?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
124
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
125
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
126
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
127
|
+
onFocus?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
128
|
+
onFocusCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
129
|
+
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
130
|
+
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
131
|
+
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
132
|
+
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
133
|
+
onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
134
|
+
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
135
|
+
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
136
|
+
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
137
|
+
onReset?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
138
|
+
onResetCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
139
|
+
onSubmit?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
140
|
+
onSubmitCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
141
|
+
onInvalid?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
142
|
+
onInvalidCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
143
|
+
onLoad?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
144
|
+
onLoadCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
145
|
+
onError?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
146
|
+
onErrorCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
147
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
148
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
149
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
150
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
151
|
+
onKeyUp?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
152
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
153
|
+
onAbort?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
154
|
+
onAbortCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
155
|
+
onCanPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
156
|
+
onCanPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
157
|
+
onCanPlayThrough?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
158
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
159
|
+
onDurationChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
160
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
161
|
+
onEmptied?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
162
|
+
onEmptiedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
163
|
+
onEncrypted?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
164
|
+
onEncryptedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
165
|
+
onEnded?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
166
|
+
onEndedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
167
|
+
onLoadedData?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
168
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
169
|
+
onLoadedMetadata?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
170
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
171
|
+
onLoadStart?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
172
|
+
onLoadStartCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
173
|
+
onPause?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
174
|
+
onPauseCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
175
|
+
onPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
176
|
+
onPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
177
|
+
onPlaying?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
178
|
+
onPlayingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
179
|
+
onProgress?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
180
|
+
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
181
|
+
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
182
|
+
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
183
|
+
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
184
|
+
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
185
|
+
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
186
|
+
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
187
|
+
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
188
|
+
onSeekingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
189
|
+
onStalled?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
190
|
+
onStalledCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
191
|
+
onSuspend?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
192
|
+
onSuspendCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
193
|
+
onTimeUpdate?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
194
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
195
|
+
onVolumeChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
196
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
197
|
+
onWaiting?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
198
|
+
onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
199
|
+
onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
200
|
+
onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
201
|
+
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
202
|
+
onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
203
|
+
onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
204
|
+
onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
205
|
+
onDoubleClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
206
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
207
|
+
onDragCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
208
|
+
onDragEndCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
209
|
+
onDragEnter?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
210
|
+
onDragEnterCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
211
|
+
onDragExit?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
212
|
+
onDragExitCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
213
|
+
onDragLeave?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
214
|
+
onDragLeaveCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
215
|
+
onDragOver?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
216
|
+
onDragOverCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
217
|
+
onDragStartCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
218
|
+
onDrop?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
219
|
+
onDropCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
220
|
+
onMouseDown?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
221
|
+
onMouseDownCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
222
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
223
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
224
|
+
onMouseMove?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
225
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
226
|
+
onMouseOut?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
227
|
+
onMouseOutCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
228
|
+
onMouseOver?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
229
|
+
onMouseOverCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
230
|
+
onMouseUp?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
231
|
+
onMouseUpCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
232
|
+
onSelect?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
233
|
+
onSelectCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
234
|
+
onTouchCancel?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
235
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
236
|
+
onTouchEnd?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
237
|
+
onTouchEndCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
238
|
+
onTouchMove?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
239
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
240
|
+
onTouchStart?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
241
|
+
onTouchStartCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
242
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
243
|
+
onPointerDownCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
244
|
+
onPointerMove?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
245
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
246
|
+
onPointerUp?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
247
|
+
onPointerUpCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
248
|
+
onPointerCancel?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
249
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
250
|
+
onPointerEnter?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
251
|
+
onPointerLeave?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
252
|
+
onPointerOver?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
253
|
+
onPointerOverCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
254
|
+
onPointerOut?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
255
|
+
onPointerOutCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
256
|
+
onGotPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
257
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
258
|
+
onLostPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
259
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
260
|
+
onScroll?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
261
|
+
onScrollCapture?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
262
|
+
onWheel?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
263
|
+
onWheelCapture?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
264
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
265
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
266
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
267
|
+
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
268
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
269
|
+
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
270
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
271
|
+
} & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
272
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
273
|
+
}, StyledMotionWrapperProps>> & string & Omit<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
274
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarType, Categories, CustomThumbColors, DateInterval, EMonth, HighlightedDates } from '../../../../types/calendar';
|
|
3
|
+
import { Language } from "chayns-api";
|
|
4
|
+
export type MonthProps = {
|
|
5
|
+
month: EMonth;
|
|
6
|
+
year: number;
|
|
7
|
+
locale: Language;
|
|
8
|
+
highlightedDates?: HighlightedDates[];
|
|
9
|
+
onSelect: (date: Date) => void;
|
|
10
|
+
selectedDate?: Date | Date[] | DateInterval;
|
|
11
|
+
categories?: Categories[];
|
|
12
|
+
height: number;
|
|
13
|
+
minDate: Date;
|
|
14
|
+
maxDate: Date;
|
|
15
|
+
type: CalendarType;
|
|
16
|
+
hoveringDay: Date | null;
|
|
17
|
+
setHoveringDay: (date: Date | null) => void;
|
|
18
|
+
disabledDates: Date[];
|
|
19
|
+
setCurrentDate: (date: Date) => void;
|
|
20
|
+
displayIndex?: number;
|
|
21
|
+
shouldShowHighlightsInMonthOverlay: boolean;
|
|
22
|
+
customThumbColors?: CustomThumbColors;
|
|
23
|
+
showMonthYearPickers: boolean;
|
|
24
|
+
};
|
|
25
|
+
declare const Month: FC<MonthProps>;
|
|
26
|
+
export default Month;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WithTheme } from '@chayns-components/core';
|
|
2
|
+
type StyledMonthProps = WithTheme<{
|
|
3
|
+
$height: number;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const StyledMonth: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledMonthProps>> & string;
|
|
6
|
+
export declare const StyledMonthHead: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const StyledMonthName: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarType, type Categories, CustomThumbColors, type DateInterval, type EMonth, type HighlightedDates } from '../../../../../types/calendar';
|
|
3
|
+
export type DayWrapperProps = {
|
|
4
|
+
month: EMonth;
|
|
5
|
+
year: number;
|
|
6
|
+
highlightedDates?: HighlightedDates[];
|
|
7
|
+
onSelect: (date: Date) => void;
|
|
8
|
+
selectedDate?: Date | Date[] | DateInterval;
|
|
9
|
+
categories?: Categories[];
|
|
10
|
+
minDate: Date;
|
|
11
|
+
maxDate: Date;
|
|
12
|
+
type: CalendarType;
|
|
13
|
+
hoveringDay: Date | null;
|
|
14
|
+
setHoveringDay: (date: Date | null) => void;
|
|
15
|
+
disabledDates: Date[];
|
|
16
|
+
customThumbColors?: CustomThumbColors;
|
|
17
|
+
shouldShowHighlightsInMonthOverlay: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare const DayWrapper: FC<DayWrapperProps>;
|
|
20
|
+
export default DayWrapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledDayWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Categories, CustomThumbColors, HighlightedDates } from '../../../../../../types/calendar';
|
|
3
|
+
export type DayProps = {
|
|
4
|
+
date: Date;
|
|
5
|
+
isSameMonth: boolean;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
onClick: (date: Date, shouldFireEvent: boolean) => void;
|
|
8
|
+
highlightedDates?: HighlightedDates[];
|
|
9
|
+
categories?: Categories[];
|
|
10
|
+
isDisabled: boolean;
|
|
11
|
+
isIntervalStart: boolean;
|
|
12
|
+
isIntervalEnd: boolean;
|
|
13
|
+
isWithinIntervalSelection: boolean;
|
|
14
|
+
setHoveringDay: (date: Date | null) => void;
|
|
15
|
+
shouldShowHighlightsInMonthOverlay: boolean;
|
|
16
|
+
customThumbColors?: CustomThumbColors;
|
|
17
|
+
};
|
|
18
|
+
declare const Day: FC<DayProps>;
|
|
19
|
+
export default Day;
|