react-beauty-calendar 1.5.1 → 2.0.1
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/@types/calendar-instance.d.ts +8 -7
- package/dist/@types/index.d.ts +1 -1
- package/dist/build/assets/main.css +1 -1
- package/dist/build/main.cjs.js +61 -61
- package/dist/build/main.es.js +19885 -19778
- package/dist/components/ui/Checkbox.d.ts +1 -1
- package/dist/constants/index.d.ts +2 -2
- package/dist/context/date-and-time/DateAndTimeContext.d.ts +1 -1
- package/dist/context/index.d.ts +4 -4
- package/dist/context/users-info/users-info-store.d.ts +2 -2
- package/dist/core/Root.d.ts +1 -1
- package/dist/core/booking-card/BookingCardOnResize.d.ts +1 -1
- package/dist/core/booking-card/CardContent.d.ts +1 -1
- package/dist/core/booking-creation-dialog/BookingCreationDialog.d.ts +1 -1
- package/dist/core/calendar/CalendarActionButton.d.ts +5 -0
- package/dist/core/calendar/CalendarDayHeader.d.ts +5 -0
- package/dist/core/calendar/CalendarDays.d.ts +5 -0
- package/dist/core/calendar/CalendarHolder.d.ts +1 -1
- package/dist/core/calendar/CalendarView.d.ts +4 -0
- package/dist/core/calendar/DateCalendarIndicator.d.ts +8 -0
- package/dist/core/calendar/DaysOfWeek.d.ts +1 -2
- package/dist/core/calendar/HourWithActions.d.ts +1 -1
- package/dist/core/calendar/ScheduleSlots.d.ts +14 -0
- package/dist/core/calendar/SlotRender.d.ts +1 -1
- package/dist/core/calendar/TableDayOfWeekColumn.d.ts +6 -0
- package/dist/core/card-slots/ResizableTimeSlot.d.ts +17 -0
- package/dist/core/card-slots/SlotTrigger.d.ts +1 -1
- package/dist/core/card-slots/TimeInfo.d.ts +4 -2
- package/dist/core/card-slots/UniSlot.d.ts +3 -0
- package/dist/core/header-calendar/Actions.d.ts +5 -0
- package/dist/core/header-calendar/Header.d.ts +4 -7
- package/dist/core/header-calendar/HeaderDayActions.d.ts +1 -1
- package/dist/core/header-calendar/HeaderTodayAction.d.ts +2 -4
- package/dist/core/slots/CardOverlay.d.ts +1 -2
- package/dist/core/table-view-type/Columns.d.ts +1 -1
- package/dist/core/table-view-type/TableViewType.d.ts +4 -4
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/useCalendarInstance.d.ts +1 -1
- package/dist/hooks/useResizableBothSides.d.ts +1 -1
- package/dist/utils/cardResize.utils.d.ts +9 -0
- package/dist/utils/date.utils.d.ts +1 -0
- package/dist/utils/forward.d.ts +6 -1
- package/dist/utils/index.d.ts +5 -4
- package/dist/utils/props.d.ts +41 -36
- package/dist/utils/types.d.ts +8 -1
- package/package.json +2 -1
- package/dist/core/calendar/Slots.d.ts +0 -15
- package/dist/core/card-slots/EmptySlot.d.ts +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2
|
+
import type * as React from "react";
|
|
3
3
|
declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export { Checkbox };
|
|
@@ -3,8 +3,8 @@ import { INITIAL_SIZE, MIN_DIFF_TIME_THRESHOLD } from './card.constant';
|
|
|
3
3
|
import { DAY_TIME_STARTER, INITIAL_START_TIME } from './day-time-starter.constant';
|
|
4
4
|
import { MONTH } from './month.constant';
|
|
5
5
|
import { PAYMENT_STATUS, PAYMENT_TYPE } from './payment.constant';
|
|
6
|
+
import { BASE_VALUE } from './resize-base-value.constant';
|
|
6
7
|
import { SIDE_OPTIONS } from './side-options.constant';
|
|
7
8
|
import { SYSTEM_COLORS_THEME_1 } from './system-colors.constant';
|
|
8
9
|
import { URL_PARAM } from './url-param.constant';
|
|
9
|
-
|
|
10
|
-
export { BOOKING_VIEW_TYPE, MONTH, PAYMENT_TYPE, PAYMENT_STATUS, SIDE_OPTIONS, SYSTEM_COLORS_THEME_1, URL_PARAM, DAY_TIME_STARTER, INITIAL_SIZE, MIN_DIFF_TIME_THRESHOLD, INITIAL_START_TIME, BASE_VALUE };
|
|
10
|
+
export { BOOKING_VIEW_TYPE, MONTH, PAYMENT_TYPE, PAYMENT_STATUS, SIDE_OPTIONS, SYSTEM_COLORS_THEME_1, URL_PARAM, DAY_TIME_STARTER, INITIAL_SIZE, MIN_DIFF_TIME_THRESHOLD, INITIAL_START_TIME, BASE_VALUE, };
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as BookingProvider } from './booking/bookingProvider';
|
|
2
2
|
import { default as BookingModalProvider } from './bookingModal/BookingModalProvider';
|
|
3
|
+
import { default as useDragStore } from './drag/dragStore';
|
|
4
|
+
import { default as useDragStartAtStore } from './drag/useDragStateAtStore';
|
|
5
|
+
import { default as useEmptySlotStore } from './emptySlotsStore/useEmptySlotStore';
|
|
3
6
|
import { ConfigProvider } from './global/config/ConfigProvider';
|
|
4
7
|
import { default as MonthDescriptionProvider } from './month-description/MonthDescriptionProvider';
|
|
5
8
|
import { NewEventProvider } from './new-event/new-event-context';
|
|
6
|
-
|
|
7
|
-
import { default as useEmptySlotStore } from './emptySlotsStore/useEmptySlotStore';
|
|
8
|
-
import { default as useDragStartAtStore } from './drag/useDragStateAtStore';
|
|
9
|
-
export { MonthDescriptionProvider, BookingModalProvider, BookingProvider, NewEventProvider, ConfigProvider, useDragStore, useEmptySlotStore, useDragStartAtStore };
|
|
9
|
+
export { MonthDescriptionProvider, BookingModalProvider, BookingProvider, NewEventProvider, ConfigProvider, useDragStore, useEmptySlotStore, useDragStartAtStore, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UserProfileStatus } from '../../@types/user';
|
|
2
1
|
import { Ref } from 'react';
|
|
2
|
+
import { UserProfileStatus } from '../../@types/user';
|
|
3
3
|
import { UsersInfoRef } from '../../utils/forward';
|
|
4
|
-
export declare const initialUsersInfoFormState:
|
|
4
|
+
export declare const initialUsersInfoFormState: UsersInfoProps;
|
|
5
5
|
export interface UsersInfoProps {
|
|
6
6
|
users: UserProfileStatus[];
|
|
7
7
|
ref?: Ref<UsersInfoRef>;
|
package/dist/core/Root.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RootProps } from '../@types/calendar-instance';
|
|
2
|
-
declare const Root:
|
|
2
|
+
declare const Root: ({ viewModes, startView, createBookingModal, onChangeViewType, onCardDropCallback, onCardResizeEnd, onDayChange, onHeaderDayClick, onTodayClick, onSlotClick, onModalClose, bookings, isTimeInfoVisible, systemColor, tableAccessors, users, operationalHours, ref, }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Root;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BookingCarOnResizeProps } from '../../utils';
|
|
2
|
-
declare const BookingCardOnResize: ({ afterResize, booking, slotData, events,
|
|
2
|
+
declare const BookingCardOnResize: ({ afterResize, booking, slotData, events, }: BookingCarOnResizeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export default BookingCardOnResize;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CardContentProps } from '../../utils';
|
|
2
|
-
declare const CardContent: ({ resize, bookingInit, slotData, heightStyle, topHeightIncrement, customClasses, resizableParam, events, open, lastCard, half,
|
|
2
|
+
declare const CardContent: ({ resize, bookingInit, slotData, heightStyle, topHeightIncrement, customClasses, resizableParam, events, open, lastCard, half, cardsQuantity, cardIndex, hoveringAdditionalCardId, cardContentRef: dataRef, ref, }: CardContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export default CardContent;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BookingCreationDialogProps } from '../../utils/props';
|
|
2
|
-
declare const BookingCreationDialog: ({ modal, side, onClose, onOpenChange, buttonTrigger, ref, }: BookingCreationDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const BookingCreationDialog: ({ modal, side, onClose, slotTrigger, onOpenChange, buttonTrigger, ref, }: BookingCreationDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default BookingCreationDialog;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
interface CalendarDaysProps {
|
|
2
|
+
handleClickDay: (day: Date) => void;
|
|
3
|
+
}
|
|
4
|
+
declare const CalendarDays: import('react').MemoExoticComponent<({ handleClickDay }: CalendarDaysProps) => (import("react/jsx-runtime").JSX.Element | undefined)[] | undefined>;
|
|
5
|
+
export default CalendarDays;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CalendarHolderProps } from '../../utils';
|
|
2
|
-
declare const CalendarHolder: ({ tableAccessors }: CalendarHolderProps
|
|
2
|
+
declare const CalendarHolder: ({ tableAccessors }: CalendarHolderProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default CalendarHolder;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WeekDays } from '../../constants/week.constant';
|
|
2
|
+
interface DateCalendarIndicatorProps {
|
|
3
|
+
day: Date;
|
|
4
|
+
dayOfWeek: WeekDays;
|
|
5
|
+
handleClickDay: (day: Date) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const DateCalendarIndicator: ({ day, dayOfWeek, handleClickDay, }: DateCalendarIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default DateCalendarIndicator;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
-
declare const DaysWeek: ({ children }: DaysWeekPropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const DaysWeek: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default DaysWeek;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UserProfileStatus } from '../../@types';
|
|
2
|
+
import { BookingViewType } from '../../@types/booking';
|
|
3
|
+
import { DaysOfWeek } from '../../context/global/days-and-week/day-and-week-store';
|
|
4
|
+
import { LunchTimeBlock } from './CalendarView';
|
|
5
|
+
interface DaysSlotsProps {
|
|
6
|
+
bookingViewType: BookingViewType;
|
|
7
|
+
lunchTimeBlock: LunchTimeBlock;
|
|
8
|
+
daysOfWeek: DaysOfWeek;
|
|
9
|
+
users: UserProfileStatus[];
|
|
10
|
+
dayViewModeWithUsers: Date[];
|
|
11
|
+
hour: string;
|
|
12
|
+
}
|
|
13
|
+
declare const ScheduleSlots: ({ bookingViewType, lunchTimeBlock, daysOfWeek, users, dayViewModeWithUsers, hour, }: DaysSlotsProps) => import("react/jsx-runtime").JSX.Element[];
|
|
14
|
+
export default ScheduleSlots;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SlotRenderProps } from '../../utils';
|
|
2
|
-
declare const SlotRender: import('react').MemoExoticComponent<({
|
|
2
|
+
declare const SlotRender: import('react').MemoExoticComponent<({ bookings, dayHour, user, firstDay, }: SlotRenderProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
3
|
export default SlotRender;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
interface CalendarDayProps {
|
|
3
|
+
handleClickDay: (day: Date) => void;
|
|
4
|
+
}
|
|
5
|
+
declare const TableDayOfWeekColumn: ({ handleClickDay, children, }: PropsWithChildren<CalendarDayProps>) => import("react/jsx-runtime").JSX.Element[];
|
|
6
|
+
export default TableDayOfWeekColumn;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { BlocksTimeStructure } from '../../utils';
|
|
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;
|
|
17
|
+
export default ResizableTimeSlot;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SlotTriggerProps } from '../../utils';
|
|
2
|
-
declare const SlotTrigger: ({ slotData, blockTimeString, dayHour,
|
|
2
|
+
declare const SlotTrigger: ({ slotData, blockTimeString, dayHour, lastPosition, disabledCss, events, bookings, getCreationDialogRef, children, ref, }: SlotTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default SlotTrigger;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const TimeInfo: import('react').ForwardRefExoticComponent<
|
|
1
|
+
import { TimeInfoRef } from '../../utils';
|
|
2
|
+
declare const TimeInfo: import('react').ForwardRefExoticComponent<import('../../utils').TimeInfoProps & {
|
|
3
|
+
children?: import('react').ReactNode | undefined;
|
|
4
|
+
} & import('react').RefAttributes<TimeInfoRef>>;
|
|
3
5
|
export default TimeInfo;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
interface
|
|
3
|
-
|
|
4
|
-
codeCommands: string;
|
|
5
|
-
onClick: () => void;
|
|
1
|
+
import { BookingCreationDialogRef } from '../../utils';
|
|
2
|
+
interface HeaderProps {
|
|
3
|
+
getBookingModalCreateRef: () => BookingCreationDialogRef | null;
|
|
6
4
|
}
|
|
7
|
-
|
|
8
|
-
declare const Header: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const Header: ({ getBookingModalCreateRef }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
6
|
export default Header;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
declare const HeaderTodayAction: ({ onClick }: HeaderTodayActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { HeaderTodayActionProps } from '../../utils/props';
|
|
2
|
+
declare const HeaderTodayAction: ({ onClick, showCreationModal, }: HeaderTodayActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
3
|
export default HeaderTodayAction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ColumnDef } from '@tanstack/react-table';
|
|
2
2
|
import { ColumnsProps } from '../../utils';
|
|
3
|
-
declare const Columns:
|
|
3
|
+
declare const Columns: ({ keyToCopy, accessors, }: ColumnsProps<unknown>) => ColumnDef<Record<string, unknown>>[];
|
|
4
4
|
export default Columns;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ColumnDef } from '@tanstack/react-table';
|
|
2
2
|
import { Booking } from '../../@types/booking';
|
|
3
|
-
import {
|
|
3
|
+
import { UserProfileStatus } from '../../@types/user';
|
|
4
4
|
interface TableViewTypeProps {
|
|
5
|
-
user:
|
|
5
|
+
user: UserProfileStatus;
|
|
6
6
|
bookings: Booking[];
|
|
7
|
-
tableAccessors: ColumnDef<
|
|
7
|
+
tableAccessors: ColumnDef<unknown>[];
|
|
8
8
|
}
|
|
9
|
-
declare const TableViewType: ({ user, bookings, tableAccessors }: TableViewTypeProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const TableViewType: ({ user, bookings, tableAccessors, }: TableViewTypeProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default TableViewType;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { default as useBooking } from './useBooking';
|
|
|
2
2
|
import { default as useBookingModal } from './useBookingModal';
|
|
3
3
|
import { default as useDaysSelectedView } from './useDaysSelectedView';
|
|
4
4
|
import { default as useEventPrevention } from './useEventPrevention';
|
|
5
|
+
import { default as useGlobalConfig } from './useGlobalConfig';
|
|
5
6
|
import { default as useGlobalStore } from './useGlobalStore';
|
|
6
7
|
import { default as useMonthDescription } from './useMonthDescription';
|
|
7
8
|
import { default as useNewEventStore } from './useNewEventStore';
|
|
@@ -9,5 +10,4 @@ import { default as useQueryData } from './useQuery';
|
|
|
9
10
|
import { default as useThrottleCallback } from './useTrottleCallback';
|
|
10
11
|
import { default as useUrlParam } from './useUrlParam';
|
|
11
12
|
import { default as useUserInfoStore } from './useUserInfoStore';
|
|
12
|
-
|
|
13
|
-
export { useBooking, useEventPrevention, useThrottleCallback, useDaysSelectedView, useMonthDescription, useUrlParam, useGlobalStore, useQueryData, useNewEventStore, useBookingModal, useUserInfoStore, useGlobalConfig };
|
|
13
|
+
export { useBooking, useEventPrevention, useThrottleCallback, useDaysSelectedView, useMonthDescription, useUrlParam, useGlobalStore, useQueryData, useNewEventStore, useBookingModal, useUserInfoStore, useGlobalConfig, };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CalendarInstanceRef, UseBookingInstanceProps } from '../@types/calendar-instance';
|
|
2
|
-
declare const useCalendarInstance:
|
|
2
|
+
declare const useCalendarInstance: (props: UseBookingInstanceProps) => CalendarInstanceRef;
|
|
3
3
|
export default useCalendarInstance;
|
|
@@ -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 useResizableBothSides: ({ booking, onAddTime, onStartAtChange, onSubTime,
|
|
4
|
+
declare const useResizableBothSides: ({ booking, onAddTime, onStartAtChange, onSubTime, starter, }: useResizableCardHookProps) => {
|
|
5
5
|
state: {
|
|
6
6
|
height: number;
|
|
7
7
|
width: number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type DirectionBound = "upperBound" | "lowerBound";
|
|
2
|
+
export declare const cardResizeUtils: {
|
|
3
|
+
isUpperBoundReached(operationalStartTime: number | undefined, closureDate: Date): boolean;
|
|
4
|
+
isLowerBoundReached(operationalEndTime: number, closureDate: Date): boolean;
|
|
5
|
+
adjustedDateMinutes(initialDate: Date, action: "add" | "remove"): Date;
|
|
6
|
+
baseValueLimitMin(prevHeight: number): boolean;
|
|
7
|
+
checkBoundConditions(hours: number, bounds: number, closureMinutes: number, directionBound: DirectionBound): boolean;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
package/dist/utils/forward.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export interface TimeInfoRef {
|
|
|
8
8
|
show: () => void;
|
|
9
9
|
hide: () => void;
|
|
10
10
|
changeIsOpen: (isOpen: boolean) => void;
|
|
11
|
-
reset: () => void;
|
|
12
11
|
}
|
|
13
12
|
export interface BlockTimeRef {
|
|
14
13
|
ref: (element: HTMLElement | null) => void;
|
|
@@ -22,6 +21,8 @@ export interface SlotTriggerForwardRef {
|
|
|
22
21
|
removeFromAdditionalBooking: (booking: Booking) => void;
|
|
23
22
|
hoveringAdditionalCard: (hoveringCardId: string) => void;
|
|
24
23
|
clearHoveringCard: () => void;
|
|
24
|
+
onCloseCreationModal: (event?: React.MouseEvent) => void;
|
|
25
|
+
onOpenChange: (status: boolean) => void;
|
|
25
26
|
}
|
|
26
27
|
export interface BookingCardContentRef {
|
|
27
28
|
updateBooking: (booking: Booking) => void;
|
|
@@ -34,3 +35,7 @@ export interface BookingCreationDialogRef {
|
|
|
34
35
|
export interface UsersInfoRef {
|
|
35
36
|
updateDisabledUser: (userId: string, status: boolean) => void;
|
|
36
37
|
}
|
|
38
|
+
export interface ResizableTimeSlotRef {
|
|
39
|
+
resetState: () => void;
|
|
40
|
+
resetHeightStyle: () => void;
|
|
41
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { buildEmptyTimeSlotKey } from './buildEmptyTimeSlotKey';
|
|
2
1
|
import { bookingUtils } from './booking.utils';
|
|
2
|
+
import { buildEmptyTimeSlotKey } from './buildEmptyTimeSlotKey';
|
|
3
|
+
import { cardResizeUtils } from './cardResize.utils';
|
|
3
4
|
import { dateUtils } from './date.utils';
|
|
4
|
-
import { stringUtils } from './string.utils';
|
|
5
|
-
import { generateTimes, generateWorkingTimes } from './hours';
|
|
6
5
|
import { TimeInfoRef, BookingCardRef, SlotTriggerForwardRef, BookingCreationDialogRef, BookingCardContentRef } from './forward';
|
|
6
|
+
import { generateTimes, generateWorkingTimes } from './hours';
|
|
7
7
|
import { SlotTriggerProps, CardContentProps, BlockTimeData, EmptySlotProps, TimeInfoProps, useResizableCardHookProps, BlocksTimeStructure, SlotRenderProps, BookingCarContextProps, CalendarHolderProps, ColumnsProps, BookingCarOnResizeProps } from './props';
|
|
8
|
-
|
|
8
|
+
import { stringUtils } from './string.utils';
|
|
9
|
+
export { bookingUtils, dateUtils, stringUtils, cardResizeUtils, generateTimes, generateWorkingTimes, buildEmptyTimeSlotKey, type BookingCardRef, type SlotTriggerForwardRef, type BookingCreationDialogRef, type TimeInfoRef, type BookingCardContentRef, type BlockTimeData, type BlocksTimeStructure, type SlotTriggerProps, type CardContentProps, type EmptySlotProps, type TimeInfoProps, type useResizableCardHookProps, type BookingCarContextProps, type SlotRenderProps, type CalendarHolderProps, type ColumnsProps, type BookingCarOnResizeProps, };
|
package/dist/utils/props.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { DraggableAttributes } from '@dnd-kit/core';
|
|
2
2
|
import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
|
|
3
|
-
import {
|
|
3
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
4
|
+
import { CSSProperties, JSX, PropsWithChildren, ReactNode, Ref } from 'react';
|
|
4
5
|
import { Booking, BookingDateAndTime, Bookings, UserProfileStatus } from '../@types';
|
|
5
|
-
import { ResizableParam } from './types';
|
|
6
|
-
import { TimesBlock } from '../core/calendar/Slots';
|
|
7
|
-
import { BlockTimeRef, BookingCardContentRef, BookingCardRef, BookingCreationDialogRef, CardContentRef, SlotTriggerForwardRef } from './forward';
|
|
8
6
|
import { Side } from '../core/booking-options/BookingInfoOptions';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { BlockTimeRef, BookingCardContentRef, BookingCardRef, BookingCreationDialogRef, CardContentRef, SlotTriggerForwardRef } from './forward';
|
|
8
|
+
import { ResizableParam, TimesBlock } from './types';
|
|
11
9
|
export interface CardContentProps {
|
|
12
10
|
resize?: boolean;
|
|
13
11
|
bookingInit: Booking;
|
|
@@ -38,15 +36,9 @@ export interface BookingCardProps {
|
|
|
38
36
|
hoveringAdditionalCardId?: string;
|
|
39
37
|
ref?: Ref<BookingCardRef>;
|
|
40
38
|
}
|
|
41
|
-
|
|
42
|
-
onClick: (finishAt?: string, startAt?: string) => void;
|
|
43
|
-
renderPreviewCard: () => void;
|
|
44
|
-
openOptions: () => void;
|
|
45
|
-
resetPrevView: () => void;
|
|
46
|
-
}
|
|
39
|
+
export type TimeInfoPropsWithChildren = PropsWithChildren<TimeInfoProps>;
|
|
47
40
|
export interface TimeInfoProps {
|
|
48
|
-
|
|
49
|
-
events: TimeInfoEvents;
|
|
41
|
+
isDraggingOnClick: boolean;
|
|
50
42
|
}
|
|
51
43
|
export interface BlockTimeData {
|
|
52
44
|
key: string;
|
|
@@ -55,28 +47,25 @@ export interface BlockTimeData {
|
|
|
55
47
|
}
|
|
56
48
|
export type BlocksTimeStructure = BlockTimeRef & BlockTimeData;
|
|
57
49
|
export interface EmptySlotProps {
|
|
58
|
-
bookings
|
|
59
|
-
dayHour
|
|
60
|
-
|
|
61
|
-
second: BlocksTimeStructure;
|
|
62
|
-
third: BlocksTimeStructure;
|
|
63
|
-
fourth: BlocksTimeStructure;
|
|
64
|
-
disabledCss: string;
|
|
50
|
+
bookings: Booking[];
|
|
51
|
+
dayHour: BookingDateAndTime;
|
|
52
|
+
disabledCss?: string;
|
|
65
53
|
userId?: string;
|
|
66
54
|
firstDay: boolean;
|
|
67
55
|
}
|
|
68
56
|
export interface SlotEvents {
|
|
69
|
-
onMouseEnterEvent: () =>
|
|
57
|
+
onMouseEnterEvent: () => TimesBlock;
|
|
70
58
|
}
|
|
71
59
|
export interface SlotTriggerProps {
|
|
72
60
|
slotData: BlocksTimeStructure;
|
|
73
61
|
blockTimeString?: string;
|
|
74
62
|
dayHour?: BookingDateAndTime;
|
|
75
|
-
|
|
76
|
-
disabledCss: string;
|
|
63
|
+
disabledCss?: string;
|
|
77
64
|
events: SlotEvents;
|
|
78
65
|
bookings?: Bookings;
|
|
79
66
|
children?: ReactNode;
|
|
67
|
+
lastPosition?: boolean;
|
|
68
|
+
getCreationDialogRef: () => BookingCreationDialogRef | null;
|
|
80
69
|
ref: Ref<SlotTriggerForwardRef>;
|
|
81
70
|
}
|
|
82
71
|
export interface CardOverlayProps {
|
|
@@ -94,10 +83,9 @@ export interface BookingCarContextProps {
|
|
|
94
83
|
}
|
|
95
84
|
export type BookingCarOnResizeProps = Omit<BookingCarContextProps & {
|
|
96
85
|
afterResize?: boolean;
|
|
97
|
-
},
|
|
86
|
+
}, "ref">;
|
|
98
87
|
export interface useResizableCardHookProps {
|
|
99
88
|
starter?: boolean;
|
|
100
|
-
operationalHours?: OperationalHours;
|
|
101
89
|
booking: Booking;
|
|
102
90
|
onAddTime?: (datetime: Date) => void;
|
|
103
91
|
onAddStartTime?: (datetime: Date) => void;
|
|
@@ -120,26 +108,43 @@ export interface BookingCreationDialogProps {
|
|
|
120
108
|
modal?: boolean;
|
|
121
109
|
side?: Side;
|
|
122
110
|
buttonTrigger?: JSX.Element;
|
|
111
|
+
ref: Ref<BookingCreationDialogRef>;
|
|
112
|
+
slotTrigger?: () => SlotTriggerForwardRef | null;
|
|
123
113
|
onClose?: () => void;
|
|
124
114
|
onOpenChange?: (status: boolean) => void;
|
|
125
|
-
ref: Ref<BookingCreationDialogRef>;
|
|
126
115
|
}
|
|
127
|
-
export interface
|
|
128
|
-
firstDay: boolean;
|
|
129
|
-
booking: Booking[];
|
|
130
|
-
dayHour: BookingDateAndTime;
|
|
131
|
-
disabledCss: string;
|
|
132
|
-
user?: UserProfileStatus;
|
|
116
|
+
export interface BlockTimeDataChunk {
|
|
133
117
|
firstBlockTimeData: BlocksTimeStructure;
|
|
134
118
|
secondBlockTimeData: BlocksTimeStructure;
|
|
135
119
|
thirdBlockTimeData: BlocksTimeStructure;
|
|
136
120
|
fourthBlockTimeData: BlocksTimeStructure;
|
|
137
121
|
}
|
|
138
|
-
export interface
|
|
139
|
-
|
|
122
|
+
export interface SlotRenderProps {
|
|
123
|
+
bookings: Booking[];
|
|
124
|
+
lunchTimeBlock?: {
|
|
125
|
+
startAt: string;
|
|
126
|
+
finishAt: string;
|
|
127
|
+
};
|
|
128
|
+
firstDay: boolean;
|
|
129
|
+
dayHour: BookingDateAndTime;
|
|
130
|
+
user?: UserProfileStatus;
|
|
131
|
+
}
|
|
132
|
+
export interface CalendarHolderProps {
|
|
133
|
+
tableAccessors: ColumnDef<unknown>[];
|
|
140
134
|
}
|
|
141
135
|
export interface ColumnsProps<T> {
|
|
142
136
|
keyToCopy: string;
|
|
143
137
|
accessors: ColumnDef<T>[];
|
|
144
138
|
}
|
|
145
|
-
export {
|
|
139
|
+
export interface UniSlotProps {
|
|
140
|
+
dayHour: BookingDateAndTime;
|
|
141
|
+
slotPosition: TimesBlock;
|
|
142
|
+
firstDay: boolean;
|
|
143
|
+
bookings: Booking[];
|
|
144
|
+
userId?: string;
|
|
145
|
+
lastPosition?: boolean;
|
|
146
|
+
}
|
|
147
|
+
export interface HeaderTodayActionProps {
|
|
148
|
+
onClick: () => void;
|
|
149
|
+
showCreationModal: () => void;
|
|
150
|
+
}
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { Booking, ViewModes } from '../@types';
|
|
|
3
3
|
import { ResizeCallbackData, ResizeHandle } from 'react-resizable';
|
|
4
4
|
import { BookingDateAndTime, BookingViewType } from '../@types/booking';
|
|
5
5
|
import { CalendarInstanceRef } from '../@types/calendar-instance';
|
|
6
|
-
import { ActionType } from '../core/header-calendar/Header';
|
|
7
6
|
import { BlockTimeData } from './props';
|
|
8
7
|
export type UseBookingInstanceProps = RootProps;
|
|
9
8
|
export interface RootProps extends RootEventsProps {
|
|
@@ -32,4 +31,12 @@ export interface ResizableParam {
|
|
|
32
31
|
onResizeStop?: (e: React.SyntheticEvent, data: ResizeCallbackData) => void;
|
|
33
32
|
resizeHandle?: ResizeHandle[];
|
|
34
33
|
}
|
|
34
|
+
export type TimesBlock = 0 | 1 | 2 | 3;
|
|
35
|
+
export type ActionType = "next" | "previous";
|
|
36
|
+
interface ShortcutButtons {
|
|
37
|
+
label: string;
|
|
38
|
+
codeCommands: string;
|
|
39
|
+
onClick: () => void;
|
|
40
|
+
}
|
|
41
|
+
export type ShortcutButtonsList = ShortcutButtons[];
|
|
35
42
|
export {};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "
|
|
14
|
+
"version": "2.0.1",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"react",
|
|
17
17
|
"component",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"@dnd-kit/core": "^6.3.1",
|
|
52
52
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
53
53
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
54
|
+
"@react-spring/web": "^10.0.3",
|
|
54
55
|
"@tailwindcss/vite": "^4.0.15",
|
|
55
56
|
"@tanstack/react-query": "^5.69.0",
|
|
56
57
|
"@tanstack/react-table": "^8.21.2",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Booking, BookingDateAndTime } from '../../@types/booking';
|
|
2
|
-
import { UserProfileStatus } from '../../@types/user';
|
|
3
|
-
export type TimesBlock = "first" | "second" | "third" | "fourth";
|
|
4
|
-
interface SlotsProps {
|
|
5
|
-
dayHour: BookingDateAndTime;
|
|
6
|
-
lunchTimeBlock: {
|
|
7
|
-
startAt: string;
|
|
8
|
-
finishAt: string;
|
|
9
|
-
};
|
|
10
|
-
firstDay: boolean;
|
|
11
|
-
user?: UserProfileStatus;
|
|
12
|
-
bookingBulk: Booking[];
|
|
13
|
-
}
|
|
14
|
-
declare const Slots: ({ dayHour, firstDay, user, bookingBulk, }: SlotsProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export default Slots;
|