react-beauty-calendar 1.2.1 → 1.2.3
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/booking.d.ts +5 -0
- package/dist/@types/calendar-instance.d.ts +1 -1
- package/dist/build/assets/main.css +1 -1
- package/dist/build/main.cjs.js +42 -42
- package/dist/build/main.es.js +13501 -8362
- package/dist/constants/card.constant.d.ts +2 -0
- package/dist/constants/day-time-starter.constant.d.ts +2 -0
- package/dist/constants/index.d.ts +7 -5
- package/dist/constants/month.constant.d.ts +1 -2
- package/dist/constants/side-options.constant.d.ts +1 -2
- package/dist/constants/system-colors.constant.d.ts +1 -2
- package/dist/constants/url-param.constant.d.ts +1 -2
- package/dist/constants/week.constant.d.ts +3 -0
- package/dist/context/drag/useDragStateAtStore.d.ts +5 -0
- package/dist/context/emptySlotsStore/emptySlotKey.d.ts +3 -0
- package/dist/context/{emptySlotsStore.ts → emptySlotsStore}/useEmptySlotStore.d.ts +2 -2
- package/dist/context/global/language/useLanguage.d.ts +2 -0
- package/dist/context/i18n/I18n.d.ts +3 -0
- package/dist/core/booking-card/BookingCard.d.ts +3 -16
- package/dist/core/booking-card/BookingCardContent.d.ts +3 -0
- package/dist/core/card-slots/SlotTrigger.d.ts +2 -21
- package/dist/core/slots/Card.d.ts +2 -1
- package/dist/core/slots/CardBlockContent.d.ts +5 -4
- package/dist/core/slots/CardContent.d.ts +2 -43
- package/dist/core/slots/CardOverlay.d.ts +2 -8
- package/dist/core/slots/EmptySlot.d.ts +1 -22
- package/dist/core/slots/SlotRender.d.ts +1 -1
- package/dist/core/slots/TimeInfo.d.ts +2 -17
- package/dist/core/slots/service/StartAt.d.ts +0 -2
- package/dist/core/slots/useResizableBothSides.d.ts +26 -0
- package/dist/core/slots/useResizableCardHook.d.ts +1 -10
- package/dist/hooks/index.d.ts +5 -4
- package/dist/locales/en_US.json.d.ts +6 -0
- package/dist/locales/pt_BR.json.d.ts +6 -0
- package/dist/main.d.ts +2 -2
- package/dist/utils/booking.utils.d.ts +6 -0
- package/dist/utils/{date-utils.d.ts → date.utils.d.ts} +4 -5
- package/dist/utils/forward.d.ts +28 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/props.d.ts +101 -0
- package/dist/utils/tests/date-utils.spec.d.ts +1 -0
- package/dist/utils/types.d.ts +16 -2
- package/package.json +5 -1
- package/dist/context/emptySlotsStore.ts/emptySlotKey.d.ts +0 -3
- /package/dist/context/{emptySlotsStore.ts → emptySlotsStore}/retrieveSlotKey.d.ts +0 -0
- /package/dist/hooks/{use-booking-model.d.ts → useBookingModal.d.ts} +0 -0
- /package/dist/hooks/{use-calendar-instance.d.ts → useCalendarInstance.d.ts} +0 -0
- /package/dist/hooks/{use-days-selected-view.d.ts → useDaysSelectedView.d.ts} +0 -0
- /package/dist/hooks/{use-global-store.d.ts → useGlobalStore.d.ts} +0 -0
- /package/dist/hooks/{use-is-mobile.d.ts → useIsMobile.d.ts} +0 -0
- /package/dist/hooks/{use-month-description.d.ts → useMonthDescription.d.ts} +0 -0
- /package/dist/hooks/{use-tanstack-table.d.ts → useTanstackTable.d.ts} +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BOOKING_VIEW_TYPE } from './booking-view-type.constant';
|
|
2
|
-
import {
|
|
2
|
+
import { INITIAL_SIZE, MIN_DIFF_TIME_THRESHOLD } from './card.constant';
|
|
3
|
+
import { DAY_TIME_STARTER, INITIAL_START_TIME } from './day-time-starter.constant';
|
|
4
|
+
import { MONTH } from './month.constant';
|
|
3
5
|
import { PAYMENT_STATUS, PAYMENT_TYPE } from './payment.constant';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
export { BOOKING_VIEW_TYPE, MONTH, PAYMENT_TYPE, PAYMENT_STATUS, SIDE_OPTIONS, SYSTEM_COLORS, URL_PARAM, };
|
|
6
|
+
import { SIDE_OPTIONS } from './side-options.constant';
|
|
7
|
+
import { SYSTEM_COLORS } from './system-colors.constant';
|
|
8
|
+
import { URL_PARAM } from './url-param.constant';
|
|
9
|
+
export { BOOKING_VIEW_TYPE, MONTH, PAYMENT_TYPE, PAYMENT_STATUS, SIDE_OPTIONS, SYSTEM_COLORS, URL_PARAM, DAY_TIME_STARTER, INITIAL_SIZE, MIN_DIFF_TIME_THRESHOLD, INITIAL_START_TIME, };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare const MONTH: string[];
|
|
2
|
-
export default MONTH;
|
|
1
|
+
export declare const MONTH: string[];
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare const SIDE_OPTIONS: readonly ["top", "right", "bottom", "left"];
|
|
2
|
-
export default SIDE_OPTIONS;
|
|
1
|
+
export declare const SIDE_OPTIONS: readonly ["top", "right", "bottom", "left"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const SYSTEM_COLORS: {
|
|
1
|
+
export declare const SYSTEM_COLORS: {
|
|
2
2
|
readonly option_1: "#2596be";
|
|
3
3
|
readonly option_2: "#ff0101";
|
|
4
4
|
readonly option_3: "#bf00e0";
|
|
@@ -8,4 +8,3 @@ declare const SYSTEM_COLORS: {
|
|
|
8
8
|
readonly option_7: "#3e0237";
|
|
9
9
|
readonly default: "#ae00ff";
|
|
10
10
|
};
|
|
11
|
-
export default SYSTEM_COLORS;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { Booking, BookingDateAndTime } from '../../@types';
|
|
1
2
|
export interface DragProps {
|
|
2
3
|
startAt: string;
|
|
4
|
+
booking: Booking | null;
|
|
5
|
+
slotData: BookingDateAndTime | null;
|
|
3
6
|
}
|
|
4
7
|
export interface DragState extends DragProps {
|
|
5
8
|
updateStartAt: (startAt: string) => void;
|
|
9
|
+
updateBooking: (booking: Booking | null) => void;
|
|
10
|
+
updateSlotData: (slotData: BookingDateAndTime | null) => void;
|
|
6
11
|
}
|
|
7
12
|
declare const useDragStartAtStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DragState>>;
|
|
8
13
|
export default useDragStartAtStore;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SlotTriggerForwardRef } from '../../
|
|
2
|
-
import { BlockTimeData } from '../../
|
|
1
|
+
import { SlotTriggerForwardRef } from '../../utils/forward';
|
|
2
|
+
import { BlockTimeData } from '../../utils/props';
|
|
3
3
|
export type EmptySlotNodes = Map<string, SlotTriggerForwardRef>;
|
|
4
4
|
export interface EmptySlotStore {
|
|
5
5
|
emptySlotNodes: EmptySlotNodes;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
changeCurrentCardResize: () => void;
|
|
5
|
-
}
|
|
6
|
-
interface BookingCardProps {
|
|
7
|
-
booking: Booking;
|
|
8
|
-
slotData: BookingDateAndTime;
|
|
9
|
-
customClasses?: string;
|
|
10
|
-
heightStyle: number;
|
|
11
|
-
layerCount?: number;
|
|
12
|
-
half?: boolean;
|
|
13
|
-
onClick?: () => void;
|
|
14
|
-
ref?: Ref<BookingCardRef>;
|
|
15
|
-
}
|
|
16
|
-
declare const BookingCard: ({ booking, slotData, onClick, heightStyle, customClasses, ref, }: BookingCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
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;
|
|
17
4
|
export default BookingCard;
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { TimesBlock } from '../slots/Slots';
|
|
4
|
-
interface SlotEvents {
|
|
5
|
-
onMouseEnterEvent: () => string;
|
|
6
|
-
}
|
|
7
|
-
interface SlotTriggerProps {
|
|
8
|
-
slotData: BlocksTimeStructure;
|
|
9
|
-
slotPosition: TimesBlock;
|
|
10
|
-
disabledCss: string;
|
|
11
|
-
events: SlotEvents;
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
actualTimerIndicatorChildren?: ReactNode;
|
|
14
|
-
ref: Ref<SlotTriggerForwardRef>;
|
|
15
|
-
}
|
|
16
|
-
export interface SlotTriggerForwardRef {
|
|
17
|
-
showEvent: (slotNode: string) => void;
|
|
18
|
-
closeEvent: () => void;
|
|
19
|
-
onOpenCloseChange: (status: boolean) => void;
|
|
20
|
-
}
|
|
21
|
-
declare const SlotTrigger: ({ slotData, slotPosition, disabledCss, events, actualTimerIndicatorChildren, children, ref, }: SlotTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { SlotTriggerProps } from '../../utils/props';
|
|
2
|
+
declare const SlotTrigger: ({ slotData, blockTimeString, dayHour, slotPosition, disabledCss, events, bookings, children, ref, }: SlotTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
3
|
export default SlotTrigger;
|
|
@@ -7,10 +7,11 @@ interface CardProps {
|
|
|
7
7
|
half?: boolean;
|
|
8
8
|
cardsQuantity?: number;
|
|
9
9
|
cardIndex?: number;
|
|
10
|
+
hoveringAdditionalCardId?: string;
|
|
10
11
|
ref?: Ref<CardRef>;
|
|
11
12
|
}
|
|
12
13
|
export interface CardRef {
|
|
13
14
|
bookingId: string;
|
|
14
15
|
}
|
|
15
|
-
declare const Card: ({ booking, slotData, cardsQuantity, cardIndex, lastCard, half, ref, }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const Card: ({ booking, slotData, cardsQuantity, cardIndex, lastCard, half, hoveringAdditionalCardId, ref, }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export default Card;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BookingDateAndTime, Bookings } from '../../@types';
|
|
2
2
|
interface CardBlockContentProps {
|
|
3
|
-
bookings?:
|
|
4
|
-
blockTimeString
|
|
3
|
+
bookings?: Bookings;
|
|
4
|
+
blockTimeString?: string;
|
|
5
5
|
slotData?: BookingDateAndTime;
|
|
6
|
+
hoveringAdditionalCardId?: string;
|
|
6
7
|
}
|
|
7
|
-
declare const CardBlockContent: ({ bookings, blockTimeString, slotData, }: CardBlockContentProps) => import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
8
|
+
declare const CardBlockContent: ({ bookings, blockTimeString, slotData, hoveringAdditionalCardId, }: CardBlockContentProps) => import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
8
9
|
export default CardBlockContent;
|
|
@@ -1,44 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { BookingDateAndTime } from '../../@types/booking';
|
|
4
|
-
import { DraggableAttributes } from '@dnd-kit/core';
|
|
5
|
-
import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
|
|
6
|
-
import { ResizeCallbackData, ResizeHandle } from 'react-resizable';
|
|
7
|
-
import { BookingCardRef } from '../booking-card/BookingCard';
|
|
8
|
-
interface ResizableState {
|
|
9
|
-
height: number;
|
|
10
|
-
width: number;
|
|
11
|
-
}
|
|
12
|
-
export interface ResizableParam {
|
|
13
|
-
state: ResizableState;
|
|
14
|
-
customClass?: string;
|
|
15
|
-
onResize: (event: SyntheticEvent<Element, Event>, args_1: ResizeCallbackData) => void;
|
|
16
|
-
onResizeStart?: (e: React.SyntheticEvent, data: ResizeCallbackData) => void;
|
|
17
|
-
onResizeStop?: (e: React.SyntheticEvent, data: ResizeCallbackData) => void;
|
|
18
|
-
resizeHandle?: ResizeHandle[];
|
|
19
|
-
}
|
|
20
|
-
interface CardContentProps {
|
|
21
|
-
bookingInit: Booking;
|
|
22
|
-
bookingViewType: string;
|
|
23
|
-
slotData: BookingDateAndTime;
|
|
24
|
-
heightStyle: number;
|
|
25
|
-
topHeightIncrement?: number;
|
|
26
|
-
listeners?: SyntheticListenerMap | undefined;
|
|
27
|
-
attributes?: DraggableAttributes;
|
|
28
|
-
onClick?: () => void;
|
|
29
|
-
customClasses?: string;
|
|
30
|
-
open?: boolean;
|
|
31
|
-
lastCard?: boolean;
|
|
32
|
-
half?: boolean;
|
|
33
|
-
cardsQuantity?: number;
|
|
34
|
-
cardIndex?: number;
|
|
35
|
-
resizableParam?: ResizableParam;
|
|
36
|
-
events?: {
|
|
37
|
-
onUnmount: () => void;
|
|
38
|
-
};
|
|
39
|
-
cardContentRef?: Ref<BookingCardRef>;
|
|
40
|
-
ref?: Ref<CardContentForward>;
|
|
41
|
-
}
|
|
42
|
-
type CardContentForward = HTMLDivElement;
|
|
43
|
-
declare const CardContent: ({ bookingInit, slotData, heightStyle, topHeightIncrement, onClick, customClasses, bookingViewType, resizableParam, events, open, lastCard, half, cardContentRef: dataRef, cardsQuantity, cardIndex, ref, }: CardContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
1
|
+
import { CardContentProps } from '../../utils/props';
|
|
2
|
+
declare const CardContent: ({ bookingInit, slotData, heightStyle, topHeightIncrement, customClasses, bookingViewType, resizableParam, events, open, lastCard, half, cardContentRef: dataRef, cardsQuantity, cardIndex, hoveringAdditionalCardId, ref, }: CardContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
44
3
|
export default CardContent;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
interface CardOverlayProps {
|
|
4
|
-
bookingInit: Booking;
|
|
5
|
-
slotData: BookingDateAndTime;
|
|
6
|
-
heightStyle: number;
|
|
7
|
-
}
|
|
8
|
-
declare const CardOverlay: ({ bookingInit, slotData, heightStyle, }: CardOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
declare const CardOverlay: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
9
3
|
export default CardOverlay;
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Booking } from '../../@types';
|
|
3
|
-
import { BookingDateAndTime } from '../../@types/booking';
|
|
4
|
-
export interface BlockTimeRef {
|
|
5
|
-
ref: (element: HTMLElement | null) => void;
|
|
6
|
-
style: CSSProperties;
|
|
7
|
-
}
|
|
8
|
-
export interface BlockTimeData {
|
|
9
|
-
key: string;
|
|
10
|
-
time: string;
|
|
11
|
-
}
|
|
12
|
-
export type BlocksTimeStructure = BlockTimeRef & BlockTimeData;
|
|
13
|
-
export interface EmptySlotProps {
|
|
14
|
-
bookings?: Booking[];
|
|
15
|
-
dayHour?: BookingDateAndTime;
|
|
16
|
-
first: BlocksTimeStructure;
|
|
17
|
-
second: BlocksTimeStructure;
|
|
18
|
-
third: BlocksTimeStructure;
|
|
19
|
-
fourth: BlocksTimeStructure;
|
|
20
|
-
disabledCss: string;
|
|
21
|
-
firstDay: boolean;
|
|
22
|
-
}
|
|
1
|
+
import { EmptySlotProps } from '../../utils/props';
|
|
23
2
|
declare const EmptySlot: ({ bookings, first, second, third, fourth, disabledCss, firstDay, dayHour, }: EmptySlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
3
|
export default EmptySlot;
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
onClick: (finishAt?: string) => void;
|
|
4
|
-
renderPreviewCard: () => void;
|
|
5
|
-
openOptions: () => void;
|
|
6
|
-
resetPrevView: () => void;
|
|
7
|
-
}
|
|
8
|
-
export interface TimeInfoRef {
|
|
9
|
-
show: () => void;
|
|
10
|
-
hide: () => void;
|
|
11
|
-
changeIsOpen: (isOpen: boolean) => void;
|
|
12
|
-
}
|
|
13
|
-
interface TimeInfoProps {
|
|
14
|
-
isDragging: boolean;
|
|
15
|
-
slotData: BlocksTimeStructure;
|
|
16
|
-
events: TimeInfoEvents;
|
|
17
|
-
}
|
|
1
|
+
import { TimeInfoRef } from '../../utils/forward';
|
|
2
|
+
import { TimeInfoProps } from '../../utils/props';
|
|
18
3
|
declare const TimeInfo: import('react').ForwardRefExoticComponent<TimeInfoProps & import('react').RefAttributes<TimeInfoRef>>;
|
|
19
4
|
export default TimeInfo;
|
|
@@ -3,7 +3,5 @@ interface StartAtFieldProps {
|
|
|
3
3
|
onStartTimeChange: (value: string) => void;
|
|
4
4
|
generateHoursArray: (startHour: string, isStartHour?: boolean) => string[];
|
|
5
5
|
}
|
|
6
|
-
export declare const INITIAL_START_TIME = "08:00";
|
|
7
|
-
export declare const TIME_INTERVAL_IN_MINUTES = 15;
|
|
8
6
|
declare const StartAtField: ({ formStartAt, onStartTimeChange, generateHoursArray, }: StartAtFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
7
|
export default StartAtField;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
|
+
import { ResizeCallbackData } from 'react-resizable';
|
|
3
|
+
import { useResizableCardHookProps } from '../../utils/props';
|
|
4
|
+
export declare const BASE_VALUE: number;
|
|
5
|
+
declare const ACTION_MOVEMENT: {
|
|
6
|
+
readonly UP: "UP";
|
|
7
|
+
readonly DOWN: "DOWN";
|
|
8
|
+
};
|
|
9
|
+
export type ActionMovement = keyof typeof ACTION_MOVEMENT;
|
|
10
|
+
declare const useResizableBothSides: ({ booking, onAddTime, onStartAtChange, onSubTime, starter, }: useResizableCardHookProps) => {
|
|
11
|
+
state: {
|
|
12
|
+
height: number;
|
|
13
|
+
width: number;
|
|
14
|
+
};
|
|
15
|
+
setState: import('react').Dispatch<import('react').SetStateAction<{
|
|
16
|
+
height: number;
|
|
17
|
+
width: number;
|
|
18
|
+
}>>;
|
|
19
|
+
resetState: () => void;
|
|
20
|
+
resetHeightStyle: () => void;
|
|
21
|
+
heightStyle: number;
|
|
22
|
+
topHeightIncrement: number;
|
|
23
|
+
onResize: (event: SyntheticEvent, { size }: ResizeCallbackData) => void;
|
|
24
|
+
updateHeightStyle: (finishMock: Date, startMock: Date) => void;
|
|
25
|
+
};
|
|
26
|
+
export default useResizableBothSides;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { SyntheticEvent } from 'react';
|
|
2
2
|
import { ResizeCallbackData } from 'react-resizable';
|
|
3
|
-
import {
|
|
4
|
-
interface useResizableCardHookProps {
|
|
5
|
-
booking: Booking;
|
|
6
|
-
onAddTime?: (datetime: Date) => void;
|
|
7
|
-
onAddStartTime?: (datetime: Date) => void;
|
|
8
|
-
onSubTime?: (datetime: Date) => void;
|
|
9
|
-
starter?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const INITIAL_SIZE = 600;
|
|
12
|
-
export declare const MIN_DIFF_TIME_THRESHOLD = 15;
|
|
3
|
+
import { useResizableCardHookProps } from '../../utils/props';
|
|
13
4
|
export declare const BASE_VALUE: number;
|
|
14
5
|
declare const useResizableCardHook: ({ booking, onAddTime, onAddStartTime, onSubTime, starter, }: useResizableCardHookProps) => {
|
|
15
6
|
state: {
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { default as useDaysSelectedView } from './use-days-selected-view';
|
|
2
|
-
import { default as useGlobalStore } from './use-global-store';
|
|
3
|
-
import { default as useMonthDescription } from './use-month-description';
|
|
4
1
|
import { default as useBooking } from './useBooking';
|
|
2
|
+
import { default as useBookingModal } from './useBookingModal';
|
|
3
|
+
import { default as useDaysSelectedView } from './useDaysSelectedView';
|
|
5
4
|
import { default as useEventPrevention } from './useEventPrevention';
|
|
5
|
+
import { default as useGlobalStore } from './useGlobalStore';
|
|
6
|
+
import { default as useMonthDescription } from './useMonthDescription';
|
|
6
7
|
import { default as useNewEventStore } from './useNewEventStore';
|
|
7
8
|
import { default as useQueryData } from './useQuery';
|
|
8
9
|
import { default as useThrottleCallback } from './useTrottleCallback';
|
|
9
10
|
import { default as useUrlParam } from './useUrlParam';
|
|
10
|
-
export { useBooking, useEventPrevention, useThrottleCallback, useDaysSelectedView, useMonthDescription, useUrlParam, useGlobalStore, useQueryData, useNewEventStore, };
|
|
11
|
+
export { useBooking, useEventPrevention, useThrottleCallback, useDaysSelectedView, useMonthDescription, useUrlParam, useGlobalStore, useQueryData, useNewEventStore, useBookingModal, };
|
package/dist/main.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as useCalendarInstance } from './hooks/
|
|
1
|
+
import { default as useCalendarInstance } from './hooks/useCalendarInstance';
|
|
2
2
|
export * from './utils/types';
|
|
3
|
-
export * from './hooks/
|
|
3
|
+
export * from './hooks/useCalendarInstance';
|
|
4
4
|
export { useCalendarInstance };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Booking } from '../@types';
|
|
2
|
+
import { WeekDays } from '../constants/week.constant';
|
|
2
3
|
import { DaysOfWeek, NextAndPreviousWeek } from '../context/global/days-and-week/day-and-week-store';
|
|
3
|
-
export declare const WEEK_DAYS: readonly ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
4
|
-
type WeekDays = (typeof WEEK_DAYS)[number];
|
|
5
|
-
export declare const WEEK_DAYS_FULL_NAME: readonly ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
|
|
6
4
|
export type DatesData = {
|
|
7
5
|
week: Date[];
|
|
8
6
|
};
|
|
9
|
-
export declare const
|
|
7
|
+
export declare const dateUtils: {
|
|
10
8
|
findIndexToStart(date?: Date): number;
|
|
11
9
|
findActualDayIndex(today: WeekDays): number;
|
|
12
10
|
generateWeekDays(newDate?: Date): DatesData;
|
|
@@ -15,9 +13,11 @@ export declare const DateUtils: {
|
|
|
15
13
|
formatDate(time: string): string;
|
|
16
14
|
dateTimeAsString(date: Date): string;
|
|
17
15
|
getTimeDiff(startTime: Date, endTime: Date): string;
|
|
16
|
+
buildFutureDateList(booking: Booking, daysDifference: number, dayOffSetQuantity?: number): Date[];
|
|
18
17
|
bookingTimeRange: (booking: Booking, overId: string) => Booking;
|
|
19
18
|
getNewFinishAt(newStartAt: string, timeString: string): Date;
|
|
20
19
|
minuteDifference(date1: Date, date2: Date): number;
|
|
20
|
+
calculateDaysDifference(finishAt: Date, startAt: Date): number;
|
|
21
21
|
dateAndHourDateToString(date: Date): string;
|
|
22
22
|
shortMonthDescription(...month: Date[]): string;
|
|
23
23
|
timeDiffInSeconds(startAt: Date, finishAt: Date): number;
|
|
@@ -35,4 +35,3 @@ export declare const DateUtils: {
|
|
|
35
35
|
firstAndLastWeekDays(week: DaysOfWeek): NextAndPreviousWeek;
|
|
36
36
|
generateWeekMonthLabel(week: DaysOfWeek): string;
|
|
37
37
|
};
|
|
38
|
-
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { Booking } from '../@types';
|
|
3
|
+
export type CardContentRef = HTMLDivElement;
|
|
4
|
+
export interface BookingCardRef {
|
|
5
|
+
changeCurrentCardResize: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface TimeInfoRef {
|
|
8
|
+
show: () => void;
|
|
9
|
+
hide: () => void;
|
|
10
|
+
changeIsOpen: (isOpen: boolean) => void;
|
|
11
|
+
reset: () => void;
|
|
12
|
+
}
|
|
13
|
+
export interface BlockTimeRef {
|
|
14
|
+
ref: (element: HTMLElement | null) => void;
|
|
15
|
+
style: CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
export interface SlotTriggerForwardRef {
|
|
18
|
+
showEvent: (slotNode: string) => void;
|
|
19
|
+
closeEvent: () => void;
|
|
20
|
+
onOpenCloseChange: (status: boolean) => void;
|
|
21
|
+
addAdditionalBooking: (booking: Booking, allEmptySlotNodesId: string[], full?: boolean) => void;
|
|
22
|
+
removeFromAdditionalBooking: (booking: Booking) => void;
|
|
23
|
+
hoveringAdditionalCard: (hoveringCardId: string) => void;
|
|
24
|
+
clearHoveringCard: () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface BookingCardContentRef {
|
|
27
|
+
updateBooking: (booking: Booking) => void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { DraggableAttributes } from '@dnd-kit/core';
|
|
2
|
+
import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
|
|
3
|
+
import { CSSProperties, ReactNode, Ref } from 'react';
|
|
4
|
+
import { Booking, BookingDateAndTime, Bookings } from '../@types';
|
|
5
|
+
import { TimesBlock } from '../core/slots/Slots';
|
|
6
|
+
import { BlockTimeRef, BookingCardContentRef, BookingCardRef, CardContentRef, SlotTriggerForwardRef } from './forward';
|
|
7
|
+
import { ResizableParam } from './types';
|
|
8
|
+
export interface CardContentProps {
|
|
9
|
+
bookingInit: Booking;
|
|
10
|
+
bookingViewType: string;
|
|
11
|
+
slotData: BookingDateAndTime;
|
|
12
|
+
heightStyle: number;
|
|
13
|
+
topHeightIncrement?: number;
|
|
14
|
+
customClasses?: string;
|
|
15
|
+
open?: boolean;
|
|
16
|
+
lastCard?: boolean;
|
|
17
|
+
half?: boolean;
|
|
18
|
+
cardsQuantity?: number;
|
|
19
|
+
cardIndex?: number;
|
|
20
|
+
resizableParam?: ResizableParam;
|
|
21
|
+
events?: {
|
|
22
|
+
onUnmount?: () => void;
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
};
|
|
25
|
+
hoveringAdditionalCardId?: string;
|
|
26
|
+
listeners?: SyntheticListenerMap | undefined;
|
|
27
|
+
attributes?: DraggableAttributes;
|
|
28
|
+
cardContentRef?: Ref<BookingCardRef>;
|
|
29
|
+
ref?: Ref<CardContentRef>;
|
|
30
|
+
}
|
|
31
|
+
export interface BookingCardProps {
|
|
32
|
+
booking: Booking;
|
|
33
|
+
slotData: BookingDateAndTime;
|
|
34
|
+
customClasses?: string;
|
|
35
|
+
layerCount?: number;
|
|
36
|
+
half?: boolean;
|
|
37
|
+
hoveringAdditionalCardId?: string;
|
|
38
|
+
ref?: Ref<BookingCardRef>;
|
|
39
|
+
}
|
|
40
|
+
interface TimeInfoEvents {
|
|
41
|
+
onClick: (finishAt?: string, startAt?: string) => void;
|
|
42
|
+
renderPreviewCard: () => void;
|
|
43
|
+
openOptions: () => void;
|
|
44
|
+
resetPrevView: () => void;
|
|
45
|
+
}
|
|
46
|
+
export interface TimeInfoProps {
|
|
47
|
+
isDragging: boolean;
|
|
48
|
+
slotData: BlocksTimeStructure;
|
|
49
|
+
events: TimeInfoEvents;
|
|
50
|
+
}
|
|
51
|
+
export interface BlockTimeData {
|
|
52
|
+
key: string;
|
|
53
|
+
time: string;
|
|
54
|
+
}
|
|
55
|
+
export type BlocksTimeStructure = BlockTimeRef & BlockTimeData;
|
|
56
|
+
export interface EmptySlotProps {
|
|
57
|
+
bookings?: Booking[];
|
|
58
|
+
dayHour?: BookingDateAndTime;
|
|
59
|
+
first: BlocksTimeStructure;
|
|
60
|
+
second: BlocksTimeStructure;
|
|
61
|
+
third: BlocksTimeStructure;
|
|
62
|
+
fourth: BlocksTimeStructure;
|
|
63
|
+
disabledCss: string;
|
|
64
|
+
firstDay: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface SlotEvents {
|
|
67
|
+
onMouseEnterEvent: () => string;
|
|
68
|
+
}
|
|
69
|
+
export interface SlotTriggerProps {
|
|
70
|
+
slotData: BlocksTimeStructure;
|
|
71
|
+
blockTimeString?: string;
|
|
72
|
+
dayHour?: BookingDateAndTime;
|
|
73
|
+
slotPosition: TimesBlock;
|
|
74
|
+
disabledCss: string;
|
|
75
|
+
events: SlotEvents;
|
|
76
|
+
bookings?: Bookings;
|
|
77
|
+
children?: ReactNode;
|
|
78
|
+
ref: Ref<SlotTriggerForwardRef>;
|
|
79
|
+
}
|
|
80
|
+
export interface CardOverlayProps {
|
|
81
|
+
bookingInit?: Booking;
|
|
82
|
+
slotData?: BookingDateAndTime;
|
|
83
|
+
}
|
|
84
|
+
export interface BookingCarContextProps {
|
|
85
|
+
booking?: Booking;
|
|
86
|
+
style?: CSSProperties;
|
|
87
|
+
slotData?: BookingDateAndTime;
|
|
88
|
+
events?: {
|
|
89
|
+
onClick?: () => void;
|
|
90
|
+
};
|
|
91
|
+
ref?: Ref<BookingCardContentRef>;
|
|
92
|
+
}
|
|
93
|
+
export interface useResizableCardHookProps {
|
|
94
|
+
starter?: boolean;
|
|
95
|
+
booking: Booking;
|
|
96
|
+
onAddTime?: (datetime: Date) => void;
|
|
97
|
+
onAddStartTime?: (datetime: Date) => void;
|
|
98
|
+
onStartAtChange?: (datetime: Date) => void;
|
|
99
|
+
onSubTime?: (datetime: Date) => void;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { JSX, Ref } from 'react';
|
|
1
|
+
import { JSX, Ref, SyntheticEvent } from 'react';
|
|
2
2
|
import { Booking, ViewModes } from '../@types';
|
|
3
|
+
import { ResizeCallbackData, ResizeHandle } from 'react-resizable';
|
|
3
4
|
import { BookingDateAndTime, BookingViewType } from '../@types/booking';
|
|
4
5
|
import { CalendarInstanceRef } from '../@types/calendar-instance';
|
|
5
6
|
import { ActionType } from '../core/header-calendar/Header';
|
|
6
|
-
import { BlockTimeData } from '
|
|
7
|
+
import { BlockTimeData } from './props';
|
|
7
8
|
export type UseBookingInstanceProps = RootProps;
|
|
8
9
|
export interface RootProps extends RootEventsProps {
|
|
9
10
|
bookings: Booking[];
|
|
@@ -19,3 +20,16 @@ export interface RootEventsProps {
|
|
|
19
20
|
onModalClose: () => void;
|
|
20
21
|
onSlotClick: (slotData: BlockTimeData) => void;
|
|
21
22
|
}
|
|
23
|
+
interface ResizableState {
|
|
24
|
+
height: number;
|
|
25
|
+
width: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ResizableParam {
|
|
28
|
+
state: ResizableState;
|
|
29
|
+
customClass?: string;
|
|
30
|
+
onResize: (event: SyntheticEvent<Element, Event>, args_1: ResizeCallbackData) => void;
|
|
31
|
+
onResizeStart?: (e: React.SyntheticEvent, data: ResizeCallbackData) => void;
|
|
32
|
+
onResizeStop?: (e: React.SyntheticEvent, data: ResizeCallbackData) => void;
|
|
33
|
+
resizeHandle?: ResizeHandle[];
|
|
34
|
+
}
|
|
35
|
+
export {};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "1.2.
|
|
14
|
+
"version": "1.2.3",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"react",
|
|
17
17
|
"component",
|
|
@@ -58,6 +58,9 @@
|
|
|
58
58
|
"cmdk": "^1.1.1",
|
|
59
59
|
"date-fns": "^4.1.0",
|
|
60
60
|
"dayjs": "^1.11.13",
|
|
61
|
+
"i18next": "^25.1.1",
|
|
62
|
+
"motion": "^12.12.1",
|
|
63
|
+
"react-i18next": "^15.5.1",
|
|
61
64
|
"react-resizable": "^3.0.5",
|
|
62
65
|
"react-router": "^7.4.0",
|
|
63
66
|
"react-spinners": "^0.16.1",
|
|
@@ -107,6 +110,7 @@
|
|
|
107
110
|
"eslint-plugin-storybook": "^0.11.6",
|
|
108
111
|
"globals": "^15.15.0",
|
|
109
112
|
"husky": "^9.1.7",
|
|
113
|
+
"jsdom": "^26.1.0",
|
|
110
114
|
"lucide-react": "^0.483.0",
|
|
111
115
|
"playwright": "^1.51.1",
|
|
112
116
|
"react": "^19.0.0",
|
|
File without changes
|
|
File without changes
|