From 184a01397ee65dea0e9d53726bd243a57257b170 Mon Sep 17 00:00:00 2001 From: Aaron Beirlaen Date: Tue, 3 Oct 2023 11:42:26 +0200 Subject: [PATCH 1/4] add callback for `onDayClick` to `DatePicker` --- src/components/datepicker/DatePicker.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/datepicker/DatePicker.tsx b/src/components/datepicker/DatePicker.tsx index 7c197b9dd..0c8825c62 100644 --- a/src/components/datepicker/DatePicker.tsx +++ b/src/components/datepicker/DatePicker.tsx @@ -13,7 +13,8 @@ import localeUtils from './localeUtils'; import { GenericComponent } from '../../@types/types'; import { SIZES } from '../../constants'; -export interface DatePickerProps extends Omit { +export interface DatePickerProps + extends Omit { /** If true we give a border to our wrapper. */ bordered?: boolean; /** A class name for the DatePicker to give custom styles. */ @@ -32,6 +33,8 @@ export interface DatePickerProps extends Omit) => void; } const DatePicker: GenericComponent = ({ @@ -43,6 +46,7 @@ const DatePicker: GenericComponent = ({ showWeekNumbers, initialMonth, onChange, + onDayClick, ...others }) => { const [selectedDate, setSelectedDate] = useState(others.selectedDate); @@ -53,13 +57,14 @@ const DatePicker: GenericComponent = ({ setSelectedMonth(others.selectedDate); }, [others.selectedDate]); - const handleDayClick = (day: Date, modifiers: DayModifiers) => { + const handleDayClick = (day: Date, modifiers: DayModifiers, event: React.MouseEvent) => { if (modifiers[theme['disabled']]) { return; } setSelectedDate(day); onChange && onChange(day); + onDayClick && onDayClick(day, modifiers, event); }; const handleYearMonthChange = (selectedMonth: Date) => { From 208936da370dce4128f1fc556450382cdea549b8 Mon Sep 17 00:00:00 2001 From: Aaron Beirlaen Date: Tue, 3 Oct 2023 11:48:00 +0200 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 065956dca..62f57ec51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ ### Dependency updates +## [22.3.4] + +### Added + +`DatePicker`: `onDayClick` callback. ([@BeirlaenAaron](https://https://github.com/BeirlaenAaron) in [#2778](https://github.com/teamleadercrm/ui/pull/2778)) + ## [22.3.3] - 2023-09-13 - - `luxon`: Bump luxon from 3.0.3 to 3.4.3 ([@lowiebenoot](https://github.com/lowiebenoot)) in [#2518](https://github.com/teamleadercrm/ui/pull/2764) From d67404c4fe52bdcea277a8d7f8bc3b6a36bcaa85 Mon Sep 17 00:00:00 2001 From: Aaron Beirlaen Date: Tue, 3 Oct 2023 11:50:21 +0200 Subject: [PATCH 3/4] add date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62f57ec51..092159b11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ ### Dependency updates -## [22.3.4] +## [22.3.4] - 2023-10-03 ### Added From 7601edd0c264233ad191cce697760411c4fa9a7d Mon Sep 17 00:00:00 2001 From: Aaron Beirlaen Date: Tue, 3 Oct 2023 11:52:00 +0200 Subject: [PATCH 4/4] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eacdda7d9..6f13cb764 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@teamleader/ui", "description": "Teamleader UI library", - "version": "22.3.3", + "version": "22.3.4", "author": "Teamleader ", "bugs": { "url": "https://github.com/teamleadercrm/ui/issues"