react-beauty-calendar 1.0.7 → 1.1.0
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/README.md +43 -0
- package/dist/{lib/@types → @types}/booking.d.ts +1 -1
- package/dist/@types/calendar-instance.d.ts +36 -0
- package/dist/build/assets/main.css +1 -1
- package/dist/build/main.cjs.js +37 -37
- package/dist/build/main.es.js +8685 -8503
- package/dist/classes/reference-error.d.ts +4 -0
- package/dist/components/ui/Badge.d.ts +9 -0
- package/dist/{lib/components → components}/ui/Button.d.ts +2 -2
- package/dist/constants/booking-view-type.constant.d.ts +6 -0
- package/dist/{lib/context → context}/bookingModal/BookingModalProvider.d.ts +2 -1
- package/dist/{lib/context → context}/drag/dragStore.d.ts +0 -3
- package/dist/context/emptySlotsStore.ts/retrieveSlotKey.d.ts +6 -0
- package/dist/{lib/context → context}/emptySlotsStore.ts/useEmptySlotStore.d.ts +1 -1
- package/dist/{lib/context → context}/global/days-and-week/day-and-week-store.d.ts +6 -6
- package/dist/{lib/context → context}/month-description/month-description-store.d.ts +1 -0
- package/dist/{lib/context → context}/new-event/new-event-context.d.ts +1 -1
- package/dist/{lib/context → context}/new-event/new-event-store.d.ts +6 -0
- package/dist/core/Root.d.ts +3 -0
- package/dist/core/booking-card/BookingCard.d.ts +11 -0
- package/dist/{lib/core → core}/calendar/HourWithActions.d.ts +0 -1
- package/dist/{lib/core → core}/card-slots/SlotTrigger.d.ts +2 -3
- package/dist/core/header-calendar/HeaderDayActions.d.ts +6 -0
- package/dist/core/header-calendar/HeaderTodayAction.d.ts +5 -0
- package/dist/{lib/core → core}/slots/Card.d.ts +0 -2
- package/dist/{lib/core → core}/slots/CardContent.d.ts +1 -1
- package/dist/{lib/core → core}/slots/EventsTab.d.ts +3 -1
- package/dist/{lib/core → core}/slots/TimeInfo.d.ts +2 -1
- package/dist/core/slots/actualTimeIndicator/ActualTimeIndicator.d.ts +8 -0
- package/dist/core/slots/actualTimeIndicator/FirstDaySlot.d.ts +6 -0
- package/dist/{lib/core → core}/slots/actualTimeIndicator/position-based-on-seconds.d.ts +1 -3
- package/dist/core/slots/innerCardHandle/inner-card-handle.d.ts +5 -0
- package/dist/{lib/core → core}/slots/useResizableCardHook.d.ts +2 -0
- package/dist/hooks/use-calendar-instance.d.ts +3 -0
- package/dist/{lib/utils → utils}/date-utils.d.ts +3 -2
- package/dist/{lib/utils → utils}/types.d.ts +1 -1
- package/package.json +24 -14
- package/dist/lib/@types/calendar-instance.d.ts +0 -21
- package/dist/lib/constants/booking-view-type.constant.d.ts +0 -6
- package/dist/lib/core/Root.d.ts +0 -6
- package/dist/lib/core/booking-card/BookingCard.d.ts +0 -10
- package/dist/lib/core/slots/actualTimeIndicator/ActualTimeIndicator.d.ts +0 -8
- package/dist/lib/hooks/use-calendar-instance.d.ts +0 -7
- /package/dist/{lib/@types → @types}/calendar.d.ts +0 -0
- /package/dist/{lib/@types → @types}/index.d.ts +0 -0
- /package/dist/{lib/@types → @types}/profile.d.ts +0 -0
- /package/dist/{lib/@types → @types}/user.d.ts +0 -0
- /package/dist/{lib/@types → @types}/working-time.d.ts +0 -0
- /package/dist/{lib/components → components}/ui/Dropdown-menu.d.ts +0 -0
- /package/dist/{lib/components → components}/ui/Input.d.ts +0 -0
- /package/dist/{lib/components → components}/ui/Label.d.ts +0 -0
- /package/dist/{lib/components → components}/ui/Popover.d.ts +0 -0
- /package/dist/{lib/components → components}/ui/Select.d.ts +0 -0
- /package/dist/{lib/components → components}/ui/Separator.d.ts +0 -0
- /package/dist/{lib/components → components}/ui/Table.d.ts +0 -0
- /package/dist/{lib/components → components}/ui/Tabs.d.ts +0 -0
- /package/dist/{lib/components → components}/ui/Toggle.d.ts +0 -0
- /package/dist/{lib/components → components}/ui/Tooltip.d.ts +0 -0
- /package/dist/{lib/constants → constants}/index.d.ts +0 -0
- /package/dist/{lib/constants → constants}/month.constant.d.ts +0 -0
- /package/dist/{lib/constants → constants}/payment.constant.d.ts +0 -0
- /package/dist/{lib/constants → constants}/side-options.constant.d.ts +0 -0
- /package/dist/{lib/constants → constants}/system-colors.constant.d.ts +0 -0
- /package/dist/{lib/constants → constants}/url-param.constant.d.ts +0 -0
- /package/dist/{lib/context → context}/booking/booking-context.d.ts +0 -0
- /package/dist/{lib/context → context}/booking/booking-store.d.ts +0 -0
- /package/dist/{lib/context → context}/booking/bookingProvider.d.ts +0 -0
- /package/dist/{lib/context → context}/bookingModal/booking-modal-context.d.ts +0 -0
- /package/dist/{lib/context → context}/date-and-time/DateAndTimeContext.d.ts +0 -0
- /package/dist/{lib/context → context}/emptySlotsStore.ts/emptySlotKey.d.ts +0 -0
- /package/dist/{lib/context → context}/global/booking-info/booking-info.d.ts +0 -0
- /package/dist/{lib/context → context}/global/slice-global/slice-global-store.d.ts +0 -0
- /package/dist/{lib/context → context}/index.d.ts +0 -0
- /package/dist/{lib/context → context}/month-description/MonthDescriptionProvider.d.ts +0 -0
- /package/dist/{lib/context → context}/month-description/month-description-context.d.ts +0 -0
- /package/dist/{lib/core → core}/booking-options/BookingInfoContent.d.ts +0 -0
- /package/dist/{lib/core → core}/booking-options/BookingInfoOptions.d.ts +0 -0
- /package/dist/{lib/core → core}/calendar/CalendarHolder.d.ts +0 -0
- /package/dist/{lib/core → core}/calendar/CalendarView.d.ts +0 -0
- /package/dist/{lib/core → core}/calendar/ViewTypes.d.ts +0 -0
- /package/dist/{lib/core → core}/favorite-booking/FavoriteBooking.d.ts +0 -0
- /package/dist/{lib/core → core}/header-calendar/DaysOfWeek.d.ts +0 -0
- /package/dist/{lib/core → core}/header-calendar/Header.d.ts +0 -0
- /package/dist/{lib/core → core}/header-calendar/HeaderViewType.d.ts +0 -0
- /package/dist/{lib/core → core}/header-calendar/SelectItem.d.ts +0 -0
- /package/dist/{lib/core → core}/info/Info.d.ts +0 -0
- /package/dist/{lib/core → core}/shortcut-commands/ShortcutCommands.d.ts +0 -0
- /package/dist/{lib/core → core}/slots/CardOverlay.d.ts +0 -0
- /package/dist/{lib/core → core}/slots/EmptySlot.d.ts +0 -0
- /package/dist/{lib/core → core}/slots/Slots.d.ts +0 -0
- /package/dist/{lib/core → core}/slots/TabsContent.d.ts +0 -0
- /package/dist/{lib/core → core}/slots/service/ProcedureWithColor.d.ts +0 -0
- /package/dist/{lib/core → core}/slots/service/StartAt.d.ts +0 -0
- /package/dist/{lib/core → core}/table-view-type/TableViewType.d.ts +0 -0
- /package/dist/{lib/hoc → hoc}/WithTooltip.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/index.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/use-booking-model.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/use-days-selected-view.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/use-global-store.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/use-is-mobile.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/use-month-description.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/use-tanstack-table.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/useBooking.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/useDebounce.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/useEventPrevention.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/useMutation.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/useNewEventStore.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/useQuery.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/useTrottleCallback.d.ts +0 -0
- /package/dist/{lib/hooks → hooks}/useUrlParam.d.ts +0 -0
- /package/dist/lib/{lib/utils.d.ts → utils.d.ts} +0 -0
- /package/dist/{lib/main.d.ts → main.d.ts} +0 -0
- /package/dist/{lib/mock → mock}/booking-mock.d.ts +0 -0
- /package/dist/{lib/utils → utils}/hours.d.ts +0 -0
- /package/dist/{lib/utils → utils}/string.utils.d.ts +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
declare const buttonVariants: (props?: ({
|
|
3
|
-
variant?: "
|
|
4
|
-
size?: "default" | "
|
|
3
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
4
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
7
7
|
asChild?: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import { BookingViewType, Bookings } from '../../@types/booking';
|
|
3
3
|
import { RootEventsProps } from '../../@types/calendar-instance';
|
|
4
|
-
|
|
4
|
+
type BookingModalContextPick = Omit<RootEventsProps, "onChangeViewType">;
|
|
5
|
+
export interface BookingModalContextProps extends BookingModalContextPick {
|
|
5
6
|
createBookingModal: ReactNode;
|
|
6
7
|
bookings: Bookings;
|
|
7
8
|
viewModes: BookingViewType[];
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
export interface DragProps {
|
|
2
2
|
isDragging: boolean;
|
|
3
|
-
isDelayActive: boolean;
|
|
4
3
|
}
|
|
5
4
|
export interface DragState extends DragProps {
|
|
6
5
|
updateIsDragging: (status: boolean) => void;
|
|
7
|
-
updateIsDelayActive: (status: boolean) => void;
|
|
8
|
-
onChangeIsDelayActive: () => void;
|
|
9
6
|
}
|
|
10
7
|
declare const useDragStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DragState>>;
|
|
11
8
|
export default useDragStore;
|
|
@@ -7,7 +7,7 @@ export interface EmptySlotStore {
|
|
|
7
7
|
}
|
|
8
8
|
export interface EmptySlotState extends EmptySlotStore {
|
|
9
9
|
setEmptySlotNode: (node: SlotTriggerForwardRef, slotData: BlockTimeData) => void;
|
|
10
|
-
setSelectedNode: (nodeKey: string
|
|
10
|
+
setSelectedNode: (nodeKey: string) => void;
|
|
11
11
|
resetSelectedNode: () => void;
|
|
12
12
|
resetNodes: () => void;
|
|
13
13
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { StateCreator } from 'zustand';
|
|
2
2
|
import { HourWithActionsRef } from '../../../core/calendar/HourWithActions';
|
|
3
3
|
import { Times } from '../../../utils/hours';
|
|
4
|
+
export type DaysOfWeek = Date[];
|
|
4
5
|
export interface NextAndPreviousWeek {
|
|
5
6
|
firstDayOfWeek: Date;
|
|
6
7
|
lastDayOfWeek: Date;
|
|
7
8
|
}
|
|
8
|
-
export interface DayAndWeekProps
|
|
9
|
+
export interface DayAndWeekProps {
|
|
9
10
|
hours: Times;
|
|
10
|
-
|
|
11
|
-
daysOfWeek: Date[];
|
|
11
|
+
daysOfWeek: DaysOfWeek;
|
|
12
12
|
timesRendered: Map<string, HourWithActionsRef>;
|
|
13
13
|
}
|
|
14
14
|
export interface DayAndWeekState extends DayAndWeekProps {
|
|
15
15
|
setTodayDay: (date: Date) => Date;
|
|
16
16
|
setDays: (days: number) => Date[];
|
|
17
|
-
todayWeek: (date?: Date) =>
|
|
17
|
+
todayWeek: (date?: Date) => DaysOfWeek;
|
|
18
18
|
getWeek: () => NextAndPreviousWeek;
|
|
19
|
-
nextWeek: () =>
|
|
20
|
-
previousWeek: () =>
|
|
19
|
+
nextWeek: () => DaysOfWeek;
|
|
20
|
+
previousWeek: () => DaysOfWeek;
|
|
21
21
|
addTimesRendered: (element: HourWithActionsRef, hourKey: string) => void;
|
|
22
22
|
}
|
|
23
23
|
declare const dayAndWeekStore: StateCreator<DayAndWeekState>;
|
|
@@ -10,6 +10,7 @@ export interface MonthDescriptionProps {
|
|
|
10
10
|
}
|
|
11
11
|
export interface MonthDescriptionState extends MonthDescriptionProps {
|
|
12
12
|
updateMonthMessage: (monthDescriptionProps: Partial<MonthDescriptionProps>) => void;
|
|
13
|
+
updateHeaderDateLabel: (targetDate: Date) => void;
|
|
13
14
|
}
|
|
14
15
|
declare const monthDescriptionStore: (initialProps?: Partial<MonthDescriptionState>) => import('zustand').StoreApi<MonthDescriptionState>;
|
|
15
16
|
export type MonthDescriptionStore = ReturnType<typeof monthDescriptionStore>;
|
|
@@ -2,5 +2,5 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { NewEventFormProps } from './new-event-store';
|
|
3
3
|
declare const NewEventContext: import('react').Context<import('zustand').StoreApi<import('./new-event-store').NewEventFormState> | null>;
|
|
4
4
|
type NewEventProviderProps = PropsWithChildren<NewEventFormProps>;
|
|
5
|
-
declare const NewEventProvider: ({ children, ...props }: NewEventProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const NewEventProvider: ({ children, ref, ...props }: NewEventProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export { NewEventProvider, NewEventContext };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
export interface NewEventFormRef {
|
|
3
|
+
updateFinishAt: (selectedHour: string) => void;
|
|
4
|
+
}
|
|
1
5
|
export interface NewEventFormProps {
|
|
2
6
|
date: string;
|
|
3
7
|
startAt: string;
|
|
4
8
|
finishAt: string;
|
|
9
|
+
ref?: Ref<NewEventFormRef>;
|
|
5
10
|
}
|
|
6
11
|
export interface NewEventFormState extends NewEventFormProps {
|
|
7
12
|
updateForm: (newEventForm: NewEventFormState) => void;
|
|
@@ -9,6 +14,7 @@ export interface NewEventFormState extends NewEventFormProps {
|
|
|
9
14
|
updateStartAt: (selectedHour: string) => void;
|
|
10
15
|
updateFinishAt: (selectedHour: string) => void;
|
|
11
16
|
updateDate: (dateAsString: string) => void;
|
|
17
|
+
updateFinishAtWithOffset: (time: string, increasingMinutes?: number) => string;
|
|
12
18
|
resetForm: () => void;
|
|
13
19
|
}
|
|
14
20
|
export declare const initialFormState: NewEventFormProps;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RootProps } from '../@types/calendar-instance';
|
|
2
|
+
declare const Root: ({ viewModes, createBookingModal, onChangeViewType, onCardDropCallback, onDayChange, onHeaderDayClick, onTodayClick, onSlotClick, onModalClose, bookings, ref, }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Root;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Booking, BookingDateAndTime } from '../../@types/booking';
|
|
2
|
+
interface BookingCardProps {
|
|
3
|
+
booking: Booking;
|
|
4
|
+
slotData: BookingDateAndTime;
|
|
5
|
+
customClasses?: string;
|
|
6
|
+
heightStyleTransformer?: string;
|
|
7
|
+
layerCount?: number;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const BookingCard: ({ booking, slotData, layerCount, onClick, heightStyleTransformer, customClasses, }: BookingCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default BookingCard;
|
|
@@ -4,7 +4,6 @@ export interface HourWithActionsProps {
|
|
|
4
4
|
ref: Ref<HourWithActionsRef>;
|
|
5
5
|
}
|
|
6
6
|
export interface HourWithActionsRef {
|
|
7
|
-
setDisabledHour: () => void;
|
|
8
7
|
setActivateHour: () => void;
|
|
9
8
|
}
|
|
10
9
|
declare const HourWithActions: ({ hour, ref }: HourWithActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,15 +9,14 @@ interface SlotTriggerProps {
|
|
|
9
9
|
slotPosition: TimesBlock;
|
|
10
10
|
disabledCss: string;
|
|
11
11
|
events: SlotEvents;
|
|
12
|
-
border?: boolean;
|
|
13
12
|
children?: ReactNode;
|
|
14
13
|
actualTimerIndicatorChildren?: ReactNode;
|
|
15
14
|
ref: Ref<SlotTriggerForwardRef>;
|
|
16
15
|
}
|
|
17
16
|
export interface SlotTriggerForwardRef {
|
|
18
|
-
showEvent: () => void;
|
|
17
|
+
showEvent: (slotNode: string) => void;
|
|
19
18
|
closeEvent: () => void;
|
|
20
19
|
onOpenCloseChange: (status: boolean) => void;
|
|
21
20
|
}
|
|
22
|
-
declare const SlotTrigger: ({ slotData, slotPosition, disabledCss, events,
|
|
21
|
+
declare const SlotTrigger: ({ slotData, slotPosition, disabledCss, events, actualTimerIndicatorChildren, children, ref, }: SlotTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
22
|
export default SlotTrigger;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionType } from './Header';
|
|
2
|
+
interface handleWeekChangeProps {
|
|
3
|
+
handleWeekChange: (actionType: ActionType) => void;
|
|
4
|
+
}
|
|
5
|
+
declare const HeaderDayActions: ({ handleWeekChange }: handleWeekChangeProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default HeaderDayActions;
|
|
@@ -33,5 +33,5 @@ interface CardContentProps {
|
|
|
33
33
|
ref?: Ref<CardContentForward>;
|
|
34
34
|
}
|
|
35
35
|
type CardContentForward = HTMLDivElement;
|
|
36
|
-
declare const CardContent: ({ bookingInit, slotData, heightStyleTransformer, onClick, customClasses, bookingViewType, resizableParam, events, open, }: CardContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
36
|
+
declare const CardContent: ({ bookingInit, slotData, heightStyleTransformer, onClick, customClasses, bookingViewType, resizableParam, events, open, ref, }: CardContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
37
37
|
export default CardContent;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { JSX, PropsWithChildren } from 'react';
|
|
2
2
|
import { EmptySlotNodes } from '../../context/emptySlotsStore.ts/useEmptySlotStore';
|
|
3
|
+
import { Side } from '../booking-options/BookingInfoOptions';
|
|
3
4
|
interface EventTabsProps {
|
|
4
5
|
emptySlotNodes?: EmptySlotNodes;
|
|
6
|
+
side: Side;
|
|
5
7
|
buttonTrigger: JSX.Element;
|
|
6
8
|
onClose: (event: React.MouseEvent) => void;
|
|
7
9
|
onOpenChange: (status: boolean) => void;
|
|
8
10
|
}
|
|
9
11
|
type EventTabsWithChildren = PropsWithChildren<EventTabsProps>;
|
|
10
|
-
declare const EventTabs: ({ onClose, onOpenChange, buttonTrigger, }: EventTabsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const EventTabs: ({ onClose, side, onOpenChange, buttonTrigger, children, }: EventTabsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export default EventTabs;
|
|
@@ -6,8 +6,9 @@ interface TimeInfoEvents {
|
|
|
6
6
|
resetPrevView: () => void;
|
|
7
7
|
}
|
|
8
8
|
interface TimeInfoProps {
|
|
9
|
+
isDragging: boolean;
|
|
9
10
|
slotData: BlocksTimeStructure;
|
|
10
11
|
events: TimeInfoEvents;
|
|
11
12
|
}
|
|
12
|
-
declare const TimeInfo: ({ slotData, events: { onClick, renderPreviewCard, resetPrevView }, }: TimeInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const TimeInfo: ({ isDragging, slotData, events: { onClick, renderPreviewCard, resetPrevView }, }: TimeInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export default TimeInfo;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BlocksTimeStructure } from '../EmptySlot';
|
|
2
|
+
interface ActualTimerIndicatorProps {
|
|
3
|
+
color?: string;
|
|
4
|
+
isFirstDay: boolean;
|
|
5
|
+
slotData: BlocksTimeStructure;
|
|
6
|
+
}
|
|
7
|
+
export declare const ActualTimerIndicator: ({ color, isFirstDay, slotData, }: ActualTimerIndicatorProps) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
8
|
+
export default ActualTimerIndicator;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { HourWithActionsRef } from '../../calendar/HourWithActions';
|
|
2
1
|
declare class TimeIndicatorPosition {
|
|
3
|
-
positionBasedOnSeconds: (
|
|
4
|
-
toggleTimeVisibility: (slotDataTime: string, dateToRenderHour: string, minutes: number, timesRendered: Map<string, HourWithActionsRef>) => void;
|
|
2
|
+
positionBasedOnSeconds: (dateToRender: string) => number;
|
|
5
3
|
normalizingMinutes: (minutes: number) => number;
|
|
6
4
|
isInitialMinute: (minutes: number) => boolean;
|
|
7
5
|
isSameHour: (dateToRenderHour: string, slotDataTime: string) => boolean;
|
|
@@ -8,6 +8,8 @@ interface useResizableCardHookProps {
|
|
|
8
8
|
onSubTime?: (datetime: Date) => void;
|
|
9
9
|
starter?: boolean;
|
|
10
10
|
}
|
|
11
|
+
export declare const INITIAL_HEIGHT = 600;
|
|
12
|
+
export declare const MIN_DIFF_TIME_THRESHOLD = 15;
|
|
11
13
|
declare const useResizableCardHook: ({ booking, onAddTime, onAddStartTime, onSubTime, starter, }: useResizableCardHookProps) => {
|
|
12
14
|
state: {
|
|
13
15
|
height: number;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { DaysOfWeek, NextAndPreviousWeek } from '../context/global/days-and-week/day-and-week-store';
|
|
1
2
|
export declare const WEEK_DAYS: readonly ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
2
3
|
type WeekDays = (typeof WEEK_DAYS)[number];
|
|
3
4
|
export declare const WEEK_DAYS_FULL_NAME: readonly ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
|
|
4
5
|
export type DatesData = {
|
|
5
6
|
week: Date[];
|
|
6
|
-
firstDayOfWeek: Date;
|
|
7
|
-
lastDayOfWeek: Date;
|
|
8
7
|
};
|
|
9
8
|
export declare const DateUtils: {
|
|
10
9
|
findIndexToStart(date?: Date): number;
|
|
@@ -29,5 +28,7 @@ export declare const DateUtils: {
|
|
|
29
28
|
addMinutesToHour(startAt: string, interval: number): string;
|
|
30
29
|
convertStringTimeToDateFormat(timeString: string): Date;
|
|
31
30
|
isTodayDate(date: Date): boolean;
|
|
31
|
+
firstAndLastWeekDays(week: DaysOfWeek): NextAndPreviousWeek;
|
|
32
|
+
generateWeekMonthLabel(week: DaysOfWeek): string;
|
|
32
33
|
};
|
|
33
34
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX, Ref } from 'react';
|
|
2
|
-
import { CalendarInstanceRef } from '../../src/App';
|
|
3
2
|
import { Booking, ViewModes } from '../@types';
|
|
4
3
|
import { BookingDateAndTime, BookingViewType } from '../@types/booking';
|
|
4
|
+
import { CalendarInstanceRef } from '../@types/calendar-instance';
|
|
5
5
|
import { ActionType } from '../core/header-calendar/Header';
|
|
6
6
|
import { BlockTimeData } from '../core/slots/EmptySlot';
|
|
7
7
|
export type UseBookingInstanceProps = RootProps;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"private": false,
|
|
14
|
-
"version": "1.0
|
|
14
|
+
"version": "1.1.0",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"react",
|
|
17
17
|
"component",
|
|
@@ -28,8 +28,13 @@
|
|
|
28
28
|
"dist",
|
|
29
29
|
"README.md"
|
|
30
30
|
],
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"import": "./dist/build/main.es.js",
|
|
34
|
+
"require": "./dist/build/main.cjs.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
31
37
|
"scripts": {
|
|
32
|
-
"dev": "vite",
|
|
33
38
|
"biome": "npx biome ci .",
|
|
34
39
|
"preview": "vite preview",
|
|
35
40
|
"prepare": "husky",
|
|
@@ -37,21 +42,14 @@
|
|
|
37
42
|
"storybook": "storybook dev -p 6006",
|
|
38
43
|
"build-storybook": "storybook build",
|
|
39
44
|
"prepublish": "rm -rf ./dist && npm run build",
|
|
40
|
-
"test": ""
|
|
45
|
+
"test": "",
|
|
46
|
+
"build:watch": "vite build --watch",
|
|
47
|
+
"dev": "vite",
|
|
48
|
+
"dev:c": "concurrently \"npm run build:watch\" \"cd ../appointment-react && npm run dev\""
|
|
41
49
|
},
|
|
42
50
|
"dependencies": {
|
|
43
51
|
"@dnd-kit/core": "^6.3.1",
|
|
44
52
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
45
|
-
"@radix-ui/react-dropdown-menu": "^2.1.6",
|
|
46
|
-
"@radix-ui/react-icons": "^1.3.2",
|
|
47
|
-
"@radix-ui/react-label": "^2.1.2",
|
|
48
|
-
"@radix-ui/react-popover": "^1.1.6",
|
|
49
|
-
"@radix-ui/react-select": "^2.1.6",
|
|
50
|
-
"@radix-ui/react-separator": "^1.1.2",
|
|
51
|
-
"@radix-ui/react-slot": "^1.1.2",
|
|
52
|
-
"@radix-ui/react-tabs": "^1.1.3",
|
|
53
|
-
"@radix-ui/react-toggle": "^1.1.2",
|
|
54
|
-
"@radix-ui/react-tooltip": "^1.1.8",
|
|
55
53
|
"@tailwindcss/vite": "^4.0.15",
|
|
56
54
|
"@tanstack/react-query": "^5.69.0",
|
|
57
55
|
"@tanstack/react-table": "^8.21.2",
|
|
@@ -60,9 +58,9 @@
|
|
|
60
58
|
"cmdk": "^1.1.1",
|
|
61
59
|
"date-fns": "^4.1.0",
|
|
62
60
|
"dayjs": "^1.11.13",
|
|
63
|
-
"lucide-react": "^0.483.0",
|
|
64
61
|
"react-resizable": "^3.0.5",
|
|
65
62
|
"react-router": "^7.4.0",
|
|
63
|
+
"react-spinners": "^0.16.1",
|
|
66
64
|
"tailwindcss": "^4.0.15",
|
|
67
65
|
"tw-animate-css": "^1.2.4",
|
|
68
66
|
"vite-plugin-lib-inject-css": "^2.2.1",
|
|
@@ -75,6 +73,16 @@
|
|
|
75
73
|
"@commitlint/cli": "^19.8.0",
|
|
76
74
|
"@commitlint/config-conventional": "^19.8.0",
|
|
77
75
|
"@eslint/js": "^9.21.0",
|
|
76
|
+
"@radix-ui/react-dropdown-menu": "^2.1.6",
|
|
77
|
+
"@radix-ui/react-icons": "^1.3.2",
|
|
78
|
+
"@radix-ui/react-label": "^2.1.2",
|
|
79
|
+
"@radix-ui/react-popover": "^1.1.6",
|
|
80
|
+
"@radix-ui/react-select": "^2.1.6",
|
|
81
|
+
"@radix-ui/react-separator": "^1.1.2",
|
|
82
|
+
"@radix-ui/react-slot": "^1.1.2",
|
|
83
|
+
"@radix-ui/react-tabs": "^1.1.3",
|
|
84
|
+
"@radix-ui/react-toggle": "^1.1.2",
|
|
85
|
+
"@radix-ui/react-tooltip": "^1.1.8",
|
|
78
86
|
"@storybook/addon-essentials": "^8.6.8",
|
|
79
87
|
"@storybook/addon-mdx-gfm": "^8.6.8",
|
|
80
88
|
"@storybook/addon-onboarding": "^8.6.8",
|
|
@@ -92,12 +100,14 @@
|
|
|
92
100
|
"@vitest/browser": "^3.0.9",
|
|
93
101
|
"@vitest/coverage-v8": "^3.0.9",
|
|
94
102
|
"chromatic": "^11.27.0",
|
|
103
|
+
"concurrently": "^9.1.2",
|
|
95
104
|
"eslint": "^9.21.0",
|
|
96
105
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
97
106
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
98
107
|
"eslint-plugin-storybook": "^0.11.6",
|
|
99
108
|
"globals": "^15.15.0",
|
|
100
109
|
"husky": "^9.1.7",
|
|
110
|
+
"lucide-react": "^0.483.0",
|
|
101
111
|
"playwright": "^1.51.1",
|
|
102
112
|
"react": "^19.0.0",
|
|
103
113
|
"react-dom": "^19.0.0",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { JSX, Ref } from 'react';
|
|
2
|
-
import { CalendarInstanceRef } from '../../src/App';
|
|
3
|
-
import { ActionType } from '../core/header-calendar/Header';
|
|
4
|
-
import { BlockTimeData } from '../core/slots/EmptySlot';
|
|
5
|
-
import { Booking, BookingDateAndTime, BookingViewType } from './booking';
|
|
6
|
-
import { ViewModes } from './calendar';
|
|
7
|
-
export type UseBookingInstanceProps = RootProps;
|
|
8
|
-
export interface RootProps extends RootEventsProps {
|
|
9
|
-
bookings: Booking[];
|
|
10
|
-
createBookingModal: JSX.Element;
|
|
11
|
-
viewModes: ViewModes;
|
|
12
|
-
ref?: Ref<CalendarInstanceRef>;
|
|
13
|
-
}
|
|
14
|
-
export interface RootEventsProps {
|
|
15
|
-
onChangeViewType: (bookingViewType: BookingViewType) => void;
|
|
16
|
-
onTodayClick: (date: Date) => void;
|
|
17
|
-
onCardDropCallback: (booking: Booking, overId: string, slotData: BookingDateAndTime) => Promise<void>;
|
|
18
|
-
onDayChange: (date: Date[], actionType: ActionType) => void;
|
|
19
|
-
onModalClose: () => void;
|
|
20
|
-
onSlotClick: (slotData: BlockTimeData) => void;
|
|
21
|
-
}
|
package/dist/lib/core/Root.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RootProps } from '../@types/calendar-instance';
|
|
2
|
-
export interface CalendarInstanceRef {
|
|
3
|
-
getStatus: () => boolean;
|
|
4
|
-
}
|
|
5
|
-
declare const Root: ({ viewModes, createBookingModal, onChangeViewType, onCardDropCallback, onDayChange, onTodayClick, onSlotClick, onModalClose, bookings, ref, }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export default Root;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Booking, BookingDateAndTime } from '../../@types/booking';
|
|
2
|
-
interface BookingCardProps {
|
|
3
|
-
booking: Booking;
|
|
4
|
-
slotData: BookingDateAndTime;
|
|
5
|
-
customClasses?: string | undefined;
|
|
6
|
-
heightStyleTransformer?: string;
|
|
7
|
-
onClick?: (() => void) | undefined;
|
|
8
|
-
}
|
|
9
|
-
declare const BookingCard: ({ booking, slotData, onClick, heightStyleTransformer, customClasses, }: BookingCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default BookingCard;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BlocksTimeStructure } from '../EmptySlot';
|
|
2
|
-
interface ActualTimerIndicatorProps {
|
|
3
|
-
tailwindColor: string;
|
|
4
|
-
isFirstDay: boolean;
|
|
5
|
-
slotData: BlocksTimeStructure;
|
|
6
|
-
}
|
|
7
|
-
export declare const ActualTimerIndicator: ({ tailwindColor, isFirstDay, slotData, }: ActualTimerIndicatorProps) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
8
|
-
export default ActualTimerIndicator;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
|
-
import { UseBookingInstanceProps } from '../@types/calendar-instance';
|
|
3
|
-
interface BookingInstance {
|
|
4
|
-
getCalendar: () => JSX.Element;
|
|
5
|
-
}
|
|
6
|
-
declare const useCalendarInstance: (props: UseBookingInstanceProps) => BookingInstance;
|
|
7
|
-
export default useCalendarInstance;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|