react-beauty-calendar 2.0.1 → 2.0.2
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/dist/build/main.cjs.js +28 -28
- package/dist/build/main.es.js +5531 -5453
- package/dist/context/new-event/new-event-store.d.ts +1 -0
- package/dist/core/booking-card/BookingCard.d.ts +1 -1
- package/dist/core/booking-creation-dialog/BookingCreationDialog.d.ts +1 -1
- package/dist/core/card-slots/CardResizeEventOpened.d.ts +11 -0
- package/dist/core/card-slots/ResizableTimeSlot.d.ts +2 -16
- package/dist/hooks/useResizableCardHook.d.ts +1 -1
- package/dist/utils/date.utils.d.ts +3 -1
- package/dist/utils/forward.d.ts +4 -0
- package/dist/utils/props.d.ts +12 -4
- package/package.json +1 -1
- package/dist/core/slots/CardContentWithResize.d.ts +0 -17
|
@@ -16,6 +16,7 @@ export interface NewEventFormState extends NewEventFormProps {
|
|
|
16
16
|
updateFinishAt: (selectedHour: string) => void;
|
|
17
17
|
updateDate: (dateAsString: string) => void;
|
|
18
18
|
updateFinishAtWithOffset: (time: string, increasingMinutes?: number) => string;
|
|
19
|
+
updatePreviewFromSlot: (dateAsString: string, time: string, increasingMinutes?: number) => string;
|
|
19
20
|
resetForm: () => void;
|
|
20
21
|
updatePrevStartAt: (slotStartAt: string) => void;
|
|
21
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { BookingCardProps } from '../../utils/props';
|
|
3
|
-
declare const BookingCard: ({ booking, slotData, customClasses, hoveringAdditionalCardId, children, ref, }: PropsWithChildren<BookingCardProps>) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
3
|
+
declare const BookingCard: ({ booking, slotData, customClasses, hoveringAdditionalCardId, isResizing, children, ref, }: PropsWithChildren<BookingCardProps>) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
4
4
|
export default BookingCard;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BookingCreationDialogProps } from '../../utils/props';
|
|
2
|
-
declare const BookingCreationDialog: ({ modal, side,
|
|
2
|
+
declare const BookingCreationDialog: ({ modal, side, slotTrigger, buttonTrigger, ref, }: BookingCreationDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default BookingCreationDialog;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { BlocksTimeStructure } from '../../utils';
|
|
3
|
+
import { CardResizeEventRef } from '../../utils/forward';
|
|
4
|
+
interface CardResizeEventOpenedProps {
|
|
5
|
+
hoveringAdditionalCardId: string;
|
|
6
|
+
renderEvent: boolean;
|
|
7
|
+
slotData: BlocksTimeStructure;
|
|
8
|
+
ref: Ref<CardResizeEventRef>;
|
|
9
|
+
}
|
|
10
|
+
declare const CardResizeEventOpened: ({ hoveringAdditionalCardId, renderEvent, slotData, ref, }: CardResizeEventOpenedProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default CardResizeEventOpened;
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { ResizableTimeSlotRef } from '../../utils/forward';
|
|
4
|
-
interface ResizingProps {
|
|
5
|
-
isDraggingOnClick: boolean;
|
|
6
|
-
startAtBoth: string;
|
|
7
|
-
finishAtBoth: string;
|
|
8
|
-
slotData: BlocksTimeStructure;
|
|
9
|
-
onStartAtChange: (dateTime: Date) => void;
|
|
10
|
-
onAddTime: (dateTime: Date) => void;
|
|
11
|
-
onSubTime: (dateTime: Date) => void;
|
|
12
|
-
startCounter: () => void;
|
|
13
|
-
showBookingCreationModal: () => void;
|
|
14
|
-
ref: Ref<ResizableTimeSlotRef>;
|
|
15
|
-
}
|
|
16
|
-
declare const ResizableTimeSlot: ({ isDraggingOnClick, slotData, startAtBoth, finishAtBoth, onStartAtChange, onAddTime, onSubTime, startCounter, showBookingCreationModal, ref, }: ResizingProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { ResizableTimeSlotProps } from '../../utils/props';
|
|
2
|
+
declare const ResizableTimeSlot: ({ isCreatingOnResize, slotData, renderEvent, startCounter, resetPrevView, ref, }: ResizableTimeSlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
3
|
export default ResizableTimeSlot;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SyntheticEvent } from 'react';
|
|
2
2
|
import { ResizeCallbackData } from 'react-resizable';
|
|
3
3
|
import { useResizableCardHookProps } from '../utils';
|
|
4
|
-
declare const useResizableCardHook: ({ booking, onAddTime, onAddStartTime, onSubTime, starter, }: useResizableCardHookProps) => {
|
|
4
|
+
declare const useResizableCardHook: ({ booking, onAddTime, onAddStartTime, onSubTime, skipUpdate, starter, }: useResizableCardHookProps) => {
|
|
5
5
|
state: {
|
|
6
6
|
height: number;
|
|
7
7
|
width: number;
|
|
@@ -30,8 +30,10 @@ export declare const dateUtils: {
|
|
|
30
30
|
addMinutesToDate(targetDate: Date, minutes: number): Date;
|
|
31
31
|
newDateKey(date: string, hour: string): string;
|
|
32
32
|
addMinutesToHour(startAt: string, interval: number): string;
|
|
33
|
-
convertStringTimeToDateFormat(timeString: string): Date;
|
|
33
|
+
convertStringTimeToDateFormat(timeString: string, day?: string): Date;
|
|
34
|
+
isSameDayMonthAndYea(initialDate: Date, dateToCompare: Date): boolean;
|
|
34
35
|
isTodayDate(date: Date): boolean;
|
|
36
|
+
isSameDay(initialDate: Date, dateToCompare: Date): boolean;
|
|
35
37
|
firstAndLastWeekDays(week: DaysOfWeek): NextAndPreviousWeek;
|
|
36
38
|
generateWeekMonthLabel(week: DaysOfWeek): string;
|
|
37
39
|
isFinishDateAnotherDay(finish: Date, start: Date): boolean;
|
package/dist/utils/forward.d.ts
CHANGED
|
@@ -38,4 +38,8 @@ export interface UsersInfoRef {
|
|
|
38
38
|
export interface ResizableTimeSlotRef {
|
|
39
39
|
resetState: () => void;
|
|
40
40
|
resetHeightStyle: () => void;
|
|
41
|
+
resetResizeTimeSlots: () => void;
|
|
42
|
+
}
|
|
43
|
+
export interface CardResizeEventRef {
|
|
44
|
+
updateCardEventHeight: (finish: Date, start: Date) => void;
|
|
41
45
|
}
|
package/dist/utils/props.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ColumnDef } from '@tanstack/react-table';
|
|
|
4
4
|
import { CSSProperties, JSX, PropsWithChildren, ReactNode, Ref } from 'react';
|
|
5
5
|
import { Booking, BookingDateAndTime, Bookings, UserProfileStatus } from '../@types';
|
|
6
6
|
import { Side } from '../core/booking-options/BookingInfoOptions';
|
|
7
|
-
import { BlockTimeRef, BookingCardContentRef, BookingCardRef, BookingCreationDialogRef, CardContentRef, SlotTriggerForwardRef } from './forward';
|
|
7
|
+
import { BlockTimeRef, BookingCardContentRef, BookingCardRef, BookingCreationDialogRef, CardContentRef, ResizableTimeSlotRef, SlotTriggerForwardRef } from './forward';
|
|
8
8
|
import { ResizableParam, TimesBlock } from './types';
|
|
9
9
|
export interface CardContentProps {
|
|
10
10
|
resize?: boolean;
|
|
@@ -34,11 +34,12 @@ export interface BookingCardProps {
|
|
|
34
34
|
slotData: BookingDateAndTime;
|
|
35
35
|
customClasses?: string;
|
|
36
36
|
hoveringAdditionalCardId?: string;
|
|
37
|
+
isResizing?: boolean;
|
|
37
38
|
ref?: Ref<BookingCardRef>;
|
|
38
39
|
}
|
|
39
40
|
export type TimeInfoPropsWithChildren = PropsWithChildren<TimeInfoProps>;
|
|
40
41
|
export interface TimeInfoProps {
|
|
41
|
-
|
|
42
|
+
isCreatingOnResize: boolean;
|
|
42
43
|
}
|
|
43
44
|
export interface BlockTimeData {
|
|
44
45
|
key: string;
|
|
@@ -87,6 +88,7 @@ export type BookingCarOnResizeProps = Omit<BookingCarContextProps & {
|
|
|
87
88
|
export interface useResizableCardHookProps {
|
|
88
89
|
starter?: boolean;
|
|
89
90
|
booking: Booking;
|
|
91
|
+
skipUpdate?: boolean;
|
|
90
92
|
onAddTime?: (datetime: Date) => void;
|
|
91
93
|
onAddStartTime?: (datetime: Date) => void;
|
|
92
94
|
onStartAtChange?: (datetime: Date) => void;
|
|
@@ -110,8 +112,6 @@ export interface BookingCreationDialogProps {
|
|
|
110
112
|
buttonTrigger?: JSX.Element;
|
|
111
113
|
ref: Ref<BookingCreationDialogRef>;
|
|
112
114
|
slotTrigger?: () => SlotTriggerForwardRef | null;
|
|
113
|
-
onClose?: () => void;
|
|
114
|
-
onOpenChange?: (status: boolean) => void;
|
|
115
115
|
}
|
|
116
116
|
export interface BlockTimeDataChunk {
|
|
117
117
|
firstBlockTimeData: BlocksTimeStructure;
|
|
@@ -148,3 +148,11 @@ export interface HeaderTodayActionProps {
|
|
|
148
148
|
onClick: () => void;
|
|
149
149
|
showCreationModal: () => void;
|
|
150
150
|
}
|
|
151
|
+
export interface ResizableTimeSlotProps {
|
|
152
|
+
isCreatingOnResize: boolean;
|
|
153
|
+
slotData: BlocksTimeStructure;
|
|
154
|
+
renderEvent: boolean;
|
|
155
|
+
resetPrevView: () => void;
|
|
156
|
+
startCounter: () => void;
|
|
157
|
+
ref: Ref<ResizableTimeSlotRef>;
|
|
158
|
+
}
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
2
|
-
import { Booking, BookingDateAndTime } from '../../@types/booking';
|
|
3
|
-
interface CardProps {
|
|
4
|
-
booking: Booking;
|
|
5
|
-
slotData: BookingDateAndTime;
|
|
6
|
-
lastCard?: boolean;
|
|
7
|
-
half?: boolean;
|
|
8
|
-
cardsQuantity?: number;
|
|
9
|
-
cardIndex?: number;
|
|
10
|
-
hoveringAdditionalCardId?: string;
|
|
11
|
-
ref?: Ref<CardRef>;
|
|
12
|
-
}
|
|
13
|
-
export interface CardRef {
|
|
14
|
-
bookingId: string;
|
|
15
|
-
}
|
|
16
|
-
declare const CardContentWithResize: ({ booking, slotData, cardsQuantity, cardIndex, lastCard, half, hoveringAdditionalCardId, ref, }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export default CardContentWithResize;
|