@vuu-ui/vuu-ui-controls 0.8.20-debug → 0.8.21-debug
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/cjs/index.js +3800 -425
- package/cjs/index.js.map +4 -4
- package/esm/index.js +3875 -485
- package/esm/index.js.map +4 -4
- package/index.css +257 -0
- package/index.css.map +3 -3
- package/package.json +9 -7
- package/types/calendar/Calendar.d.ts +13 -0
- package/types/calendar/index.d.ts +4 -0
- package/types/calendar/internal/CalendarCarousel.d.ts +5 -0
- package/types/calendar/internal/CalendarContext.d.ts +9 -0
- package/types/calendar/internal/CalendarDay.d.ts +15 -0
- package/types/calendar/internal/CalendarMonth.d.ts +12 -0
- package/types/calendar/internal/CalendarNavigation.d.ts +21 -0
- package/types/calendar/internal/CalendarWeekHeader.d.ts +6 -0
- package/types/calendar/internal/useFocusManagement.d.ts +9 -0
- package/types/calendar/internal/utils.d.ts +15 -0
- package/types/calendar/useCalendar.d.ts +57 -0
- package/types/calendar/useCalendarDay.d.ts +19 -0
- package/types/calendar/useSelection.d.ts +75 -0
- package/types/common-hooks/isPlainObject.d.ts +1 -0
- package/types/date-picker/DatePicker.d.ts +5 -0
- package/types/date-picker/DateRangePicker.d.ts +5 -0
- package/types/date-picker/index.d.ts +2 -0
- package/types/date-picker/input/DatePickerInput.d.ts +7 -0
- package/types/date-picker/input/DateRangePickerInput.d.ts +7 -0
- package/types/date-picker/input/types.d.ts +6 -0
- package/types/date-picker/internal/CalendarIconButton.d.ts +3 -0
- package/types/date-picker/types.d.ts +15 -0
- package/types/date-picker/useBaseDatePicker.d.ts +17 -0
- package/types/date-picker/useBaseDatePickerDropdown.d.ts +15 -0
- package/types/drag-drop/DragDropState.d.ts +2 -2
- package/types/drag-drop/DropIndicator.d.ts +1 -1
- package/types/drag-drop/{dragDropTypesNext.d.ts → dragDropTypes.d.ts} +4 -0
- package/types/drag-drop/drop-target-utils.d.ts +18 -18
- package/types/drag-drop/index.d.ts +2 -2
- package/types/drag-drop/useAutoScroll.d.ts +1 -1
- package/types/drag-drop/useDragDisplacers.d.ts +1 -1
- package/types/drag-drop/useDragDrop.d.ts +2 -0
- package/types/drag-drop/useDragDropCopy.d.ts +1 -1
- package/types/drag-drop/useDragDropIndicator.d.ts +1 -1
- package/types/drag-drop/{useDragDropNaturalMovementNext.d.ts → useDragDropNaturalMovement.d.ts} +1 -1
- package/types/index.d.ts +2 -0
- package/types/tabstrip/Tab.d.ts +2 -2
- package/types/drag-drop/useDragDropNext.d.ts +0 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TooltipProps } from "@salt-ds/core";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement } from "react";
|
|
3
|
+
import { DateValue } from "@internationalized/date";
|
|
4
|
+
import { DayStatus } from "../useCalendarDay";
|
|
5
|
+
import "./CalendarDay.css";
|
|
6
|
+
export type DateFormatter = (day: Date) => string | undefined;
|
|
7
|
+
export interface CalendarDayProps extends Omit<ComponentPropsWithRef<"button">, "children"> {
|
|
8
|
+
day: DateValue;
|
|
9
|
+
formatDate?: DateFormatter;
|
|
10
|
+
renderDayContents?: (date: DateValue, status: DayStatus) => ReactElement;
|
|
11
|
+
status?: DayStatus;
|
|
12
|
+
month: DateValue;
|
|
13
|
+
TooltipProps?: Partial<TooltipProps>;
|
|
14
|
+
}
|
|
15
|
+
export declare const CalendarDay: import("react").ForwardRefExoticComponent<Omit<CalendarDayProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
import { DateValue } from "@internationalized/date";
|
|
3
|
+
import { CalendarDayProps } from "./CalendarDay";
|
|
4
|
+
import "./CalendarMonth.css";
|
|
5
|
+
export interface CalendarMonthProps extends ComponentPropsWithRef<"div"> {
|
|
6
|
+
date: DateValue;
|
|
7
|
+
hideOutOfRangeDates?: boolean;
|
|
8
|
+
renderDayContents?: CalendarDayProps["renderDayContents"];
|
|
9
|
+
isVisible?: boolean;
|
|
10
|
+
TooltipProps?: CalendarDayProps["TooltipProps"];
|
|
11
|
+
}
|
|
12
|
+
export declare const CalendarMonth: import("react").ForwardRefExoticComponent<Omit<CalendarMonthProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ButtonProps } from "@salt-ds/core";
|
|
2
|
+
import { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { DropdownProps } from "../../dropdown";
|
|
4
|
+
import "./CalendarNavigation.css";
|
|
5
|
+
import { DateValue } from "@internationalized/date";
|
|
6
|
+
type DropdownItem = {
|
|
7
|
+
value: DateValue;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
type dateDropdownProps = DropdownProps<DropdownItem>;
|
|
11
|
+
export interface CalendarNavigationProps extends ComponentPropsWithRef<"div"> {
|
|
12
|
+
MonthDropdownProps?: dateDropdownProps;
|
|
13
|
+
YearDropdownProps?: dateDropdownProps;
|
|
14
|
+
onMonthSelect?: dateDropdownProps["onChange"];
|
|
15
|
+
onYearSelect?: dateDropdownProps["onChange"];
|
|
16
|
+
onNavigateNext?: ButtonProps["onClick"];
|
|
17
|
+
onNavigatePrevious?: ButtonProps["onClick"];
|
|
18
|
+
hideYearDropdown?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const CalendarNavigation: import("react").ForwardRefExoticComponent<Omit<CalendarNavigationProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
import "./CalendarWeekHeader.css";
|
|
3
|
+
export type CalendarWeekHeaderProps = ComponentPropsWithRef<"div">;
|
|
4
|
+
export declare const CalendarWeekHeader: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
5
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
6
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FocusEventHandler, KeyboardEventHandler, MouseEventHandler } from "react";
|
|
2
|
+
import { DateValue } from "@internationalized/date";
|
|
3
|
+
export declare function useFocusManagement({ date }: {
|
|
4
|
+
date: DateValue;
|
|
5
|
+
}): {
|
|
6
|
+
handleClick: MouseEventHandler<HTMLButtonElement>;
|
|
7
|
+
handleKeyDown: KeyboardEventHandler<HTMLButtonElement>;
|
|
8
|
+
handleFocus: FocusEventHandler<HTMLButtonElement>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DateFormatter, DateValue } from "@internationalized/date";
|
|
2
|
+
export declare function getCurrentLocale(): string;
|
|
3
|
+
export declare function getDateFormatter(options?: Intl.DateTimeFormatOptions): DateFormatter;
|
|
4
|
+
export declare function formatDate(date: DateValue, options?: Intl.DateTimeFormatOptions): string;
|
|
5
|
+
export declare function getCalender(): import("@internationalized/date").Calendar;
|
|
6
|
+
type WeekdayFormat = Intl.DateTimeFormatOptions["weekday"];
|
|
7
|
+
export declare function daysForLocale(weekday?: WeekdayFormat): string[];
|
|
8
|
+
export declare function monthsForLocale(currentYear: DateValue): (import("@internationalized/date").CalendarDate | import("@internationalized/date").CalendarDateTime | import("@internationalized/date").ZonedDateTime)[];
|
|
9
|
+
export declare function generateVisibleDays(currentMonth: DateValue): {
|
|
10
|
+
date: DateValue;
|
|
11
|
+
dateOfMonth: number;
|
|
12
|
+
isCurrentMonth: boolean;
|
|
13
|
+
}[];
|
|
14
|
+
export declare function monthDiff(a: DateValue, b: DateValue): number;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DateValue } from "@internationalized/date";
|
|
2
|
+
import { SyntheticEvent } from "react";
|
|
3
|
+
import { UseMultiSelectionCalendarProps, UseOffsetSelectionCalendarProps, UseRangeSelectionCalendarProps, UseSingleSelectionCalendarProps } from "./useSelection";
|
|
4
|
+
export type UnselectableInfo = {
|
|
5
|
+
emphasis: "medium";
|
|
6
|
+
tooltip: string;
|
|
7
|
+
} | {
|
|
8
|
+
emphasis: "low";
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
};
|
|
11
|
+
interface BaseUseCalendarProps {
|
|
12
|
+
defaultVisibleMonth?: DateValue;
|
|
13
|
+
onVisibleMonthChange?: (event: SyntheticEvent, visibleMonth: DateValue) => void;
|
|
14
|
+
isDayUnselectable?: (date: DateValue) => UnselectableInfo | boolean | void;
|
|
15
|
+
visibleMonth?: DateValue;
|
|
16
|
+
hideOutOfRangeDates?: boolean;
|
|
17
|
+
hideYearDropdown?: boolean;
|
|
18
|
+
minDate?: DateValue;
|
|
19
|
+
maxDate?: DateValue;
|
|
20
|
+
}
|
|
21
|
+
export type useCalendarProps = (Omit<UseSingleSelectionCalendarProps, "isDaySelectable"> | Omit<UseMultiSelectionCalendarProps, "isDaySelectable"> | Omit<UseRangeSelectionCalendarProps, "isDaySelectable"> | Omit<UseOffsetSelectionCalendarProps, "isDaySelectable">) & BaseUseCalendarProps;
|
|
22
|
+
export declare function useCalendar(props: useCalendarProps): {
|
|
23
|
+
state: {
|
|
24
|
+
selectedDate: DateValue | import("./useSelection").RangeSelectionValueType | {
|
|
25
|
+
startDate?: DateValue | undefined;
|
|
26
|
+
endDate?: DateValue | undefined;
|
|
27
|
+
} | DateValue[] | null | undefined;
|
|
28
|
+
hoveredDate: import("@internationalized/date").CalendarDate | import("@internationalized/date").CalendarDateTime | import("@internationalized/date").ZonedDateTime | null | undefined;
|
|
29
|
+
visibleMonth: DateValue;
|
|
30
|
+
focusedDate: DateValue;
|
|
31
|
+
minDate: DateValue | undefined;
|
|
32
|
+
maxDate: DateValue | undefined;
|
|
33
|
+
selectionVariant: "default" | "range" | "offset" | "multiselect";
|
|
34
|
+
hideOutOfRangeDates: boolean | undefined;
|
|
35
|
+
calendarFocused: boolean;
|
|
36
|
+
};
|
|
37
|
+
helpers: {
|
|
38
|
+
setSelectedDate: (event: SyntheticEvent<HTMLButtonElement, Event>, newSelectedDate: DateValue) => void;
|
|
39
|
+
isSelected: (date: DateValue) => boolean;
|
|
40
|
+
setHoveredDate: (event: SyntheticEvent<Element, Event>, date: DateValue | null) => void;
|
|
41
|
+
isHovered: (date: DateValue) => boolean;
|
|
42
|
+
isSelectedSpan: (date: DateValue) => boolean;
|
|
43
|
+
isHoveredSpan: (date: DateValue) => boolean;
|
|
44
|
+
isSelectedStart: (date: DateValue) => boolean;
|
|
45
|
+
isSelectedEnd: (date: DateValue) => boolean;
|
|
46
|
+
isHoveredOffset: (date: DateValue) => boolean;
|
|
47
|
+
setVisibleMonth: (event: SyntheticEvent, newVisibleMonth: DateValue) => void;
|
|
48
|
+
setFocusedDate: (event: SyntheticEvent, date: DateValue) => void;
|
|
49
|
+
setCalendarFocused: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
50
|
+
isDayUnselectable: (date: DateValue) => boolean | void | UnselectableInfo;
|
|
51
|
+
isDayVisible: (date: DateValue) => boolean;
|
|
52
|
+
isOutsideAllowedDates: (date: DateValue) => boolean;
|
|
53
|
+
isOutsideAllowedMonths: (date: DateValue) => boolean;
|
|
54
|
+
isOutsideAllowedYears: (date: DateValue) => boolean;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DateValue } from "@internationalized/date";
|
|
2
|
+
import { RefObject } from "react";
|
|
3
|
+
export type DayStatus = {
|
|
4
|
+
outOfRange?: boolean;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
today?: boolean;
|
|
7
|
+
unselectable?: "medium" | "low" | false;
|
|
8
|
+
focused?: boolean;
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export interface useCalendarDayProps {
|
|
12
|
+
date: DateValue;
|
|
13
|
+
month: DateValue;
|
|
14
|
+
}
|
|
15
|
+
export declare function useCalendarDay({ date, month }: useCalendarDayProps, ref: RefObject<HTMLElement>): {
|
|
16
|
+
status: DayStatus;
|
|
17
|
+
dayProps: Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">;
|
|
18
|
+
unselectableReason: string | undefined;
|
|
19
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { KeyboardEventHandler, MouseEventHandler, SyntheticEvent } from "react";
|
|
2
|
+
import { CalendarDate, DateValue } from "@internationalized/date";
|
|
3
|
+
interface BaseUseSelectionCalendarProps<SelectionVariantType> {
|
|
4
|
+
hoveredDate?: DateValue | null;
|
|
5
|
+
selectedDate?: SelectionVariantType | null;
|
|
6
|
+
defaultSelectedDate?: SelectionVariantType;
|
|
7
|
+
onSelectedDateChange?: (event: SyntheticEvent, selectedDate: SelectionVariantType) => void;
|
|
8
|
+
isDaySelectable: (date?: DateValue) => boolean;
|
|
9
|
+
onHoveredDateChange?: (event: SyntheticEvent, hoveredDate: DateValue | null) => void;
|
|
10
|
+
}
|
|
11
|
+
type SingleSelectionValueType = DateValue;
|
|
12
|
+
type MultiSelectionValueType = DateValue[];
|
|
13
|
+
export type RangeSelectionValueType = {
|
|
14
|
+
startDate?: DateValue;
|
|
15
|
+
endDate?: DateValue;
|
|
16
|
+
};
|
|
17
|
+
type OffsetSelectionValueType = {
|
|
18
|
+
startDate?: DateValue;
|
|
19
|
+
endDate?: DateValue;
|
|
20
|
+
};
|
|
21
|
+
export interface UseOffsetSelectionCalendarProps extends Omit<BaseUseSelectionCalendarProps<OffsetSelectionValueType>, "startDateOffset" | "endDateOffset"> {
|
|
22
|
+
selectionVariant: "offset";
|
|
23
|
+
startDateOffset?: (date: DateValue) => DateValue;
|
|
24
|
+
endDateOffset?: (date: DateValue) => DateValue;
|
|
25
|
+
}
|
|
26
|
+
export interface UseRangeSelectionCalendarProps extends BaseUseSelectionCalendarProps<RangeSelectionValueType> {
|
|
27
|
+
selectionVariant: "range";
|
|
28
|
+
}
|
|
29
|
+
export interface UseMultiSelectionCalendarProps extends BaseUseSelectionCalendarProps<MultiSelectionValueType> {
|
|
30
|
+
selectionVariant: "multiselect";
|
|
31
|
+
}
|
|
32
|
+
export interface UseSingleSelectionCalendarProps extends BaseUseSelectionCalendarProps<SingleSelectionValueType> {
|
|
33
|
+
selectionVariant: "default";
|
|
34
|
+
}
|
|
35
|
+
export type useSelectionCalendarProps = UseSingleSelectionCalendarProps | UseMultiSelectionCalendarProps | UseRangeSelectionCalendarProps | UseOffsetSelectionCalendarProps;
|
|
36
|
+
export declare function useSelectionCalendar(props: useSelectionCalendarProps): {
|
|
37
|
+
state: {
|
|
38
|
+
selectedDate: DateValue | RangeSelectionValueType | OffsetSelectionValueType | MultiSelectionValueType | null | undefined;
|
|
39
|
+
hoveredDate: CalendarDate | import("@internationalized/date").CalendarDateTime | import("@internationalized/date").ZonedDateTime | null | undefined;
|
|
40
|
+
};
|
|
41
|
+
helpers: {
|
|
42
|
+
setSelectedDate: (event: SyntheticEvent<HTMLButtonElement>, newSelectedDate: DateValue) => void;
|
|
43
|
+
isSelected: (date: DateValue) => boolean;
|
|
44
|
+
setHoveredDate: (event: SyntheticEvent, date: DateValue | null) => void;
|
|
45
|
+
isHovered: (date: DateValue) => boolean;
|
|
46
|
+
isSelectedSpan: (date: DateValue) => boolean;
|
|
47
|
+
isHoveredSpan: (date: DateValue) => boolean;
|
|
48
|
+
isSelectedStart: (date: DateValue) => boolean;
|
|
49
|
+
isSelectedEnd: (date: DateValue) => boolean;
|
|
50
|
+
isHoveredOffset: (date: DateValue) => boolean;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export declare function useSelectionDay({ date }: {
|
|
54
|
+
date: DateValue;
|
|
55
|
+
}): {
|
|
56
|
+
handleClick: MouseEventHandler<HTMLButtonElement>;
|
|
57
|
+
handleKeyDown: KeyboardEventHandler<HTMLButtonElement>;
|
|
58
|
+
handleMouseOver: MouseEventHandler<HTMLButtonElement>;
|
|
59
|
+
handleMouseLeave: MouseEventHandler<HTMLButtonElement>;
|
|
60
|
+
status: {
|
|
61
|
+
selected: boolean;
|
|
62
|
+
selectedSpan: boolean;
|
|
63
|
+
hoveredSpan: boolean;
|
|
64
|
+
selectedStart: boolean;
|
|
65
|
+
selectedEnd: boolean;
|
|
66
|
+
hovered: boolean;
|
|
67
|
+
hoveredOffset: boolean;
|
|
68
|
+
};
|
|
69
|
+
dayProps: {
|
|
70
|
+
className: string;
|
|
71
|
+
"aria-pressed": string | undefined;
|
|
72
|
+
"aria-disabled": string | undefined;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isPlainObject: (obj: unknown) => boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseDatePickerProps } from "./types";
|
|
3
|
+
import { RangeSelectionValueType } from "../calendar";
|
|
4
|
+
import "./DatePicker.css";
|
|
5
|
+
export declare const DateRangePicker: (props: BaseDatePickerProps<RangeSelectionValueType>) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DateValue } from "@internationalized/date";
|
|
3
|
+
import { BasePickerInputProps } from "./types";
|
|
4
|
+
import "./DatePickerInput.css";
|
|
5
|
+
type Props = BasePickerInputProps<DateValue>;
|
|
6
|
+
export declare const DatePickerInput: React.FC<Props>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BasePickerInputProps } from "./types";
|
|
3
|
+
import { RangeSelectionValueType } from "../../calendar";
|
|
4
|
+
import "./DateRangePickerInput.css";
|
|
5
|
+
type Props = BasePickerInputProps<RangeSelectionValueType>;
|
|
6
|
+
export declare const DateRangePickerInput: React.FC<Props>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./CalendarIconButton.css";
|
|
3
|
+
export declare const CalendarIconButton: import("react").ForwardRefExoticComponent<Omit<import("@salt-ds/core").ButtonProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DateValue } from "@internationalized/date";
|
|
2
|
+
import { CalendarProps } from "../calendar/Calendar";
|
|
3
|
+
import { RangeSelectionValueType } from "../calendar";
|
|
4
|
+
export type PickerSelectionType = DateValue | RangeSelectionValueType;
|
|
5
|
+
export interface BaseDatePickerProps<T = PickerSelectionType> extends Pick<CalendarProps, "hideOutOfRangeDates" | "hideYearDropdown"> {
|
|
6
|
+
onSelectedDateChange: (selected: T) => void;
|
|
7
|
+
selectedDate: T | undefined;
|
|
8
|
+
closeOnSelection?: boolean;
|
|
9
|
+
onBlur?: () => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface BaseDatePickerDropdownProps<T = PickerSelectionType> extends BaseDatePickerProps<T> {
|
|
13
|
+
visibleMonth: DateValue | undefined;
|
|
14
|
+
onVisibleMonthChange: (d: DateValue) => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseDatePickerProps } from "./types";
|
|
3
|
+
import { DateValue } from "@internationalized/date";
|
|
4
|
+
import { PickerSelectionType } from "./types";
|
|
5
|
+
import { RangeSelectionValueType } from "../calendar";
|
|
6
|
+
type InheritedProps<T extends PickerSelectionType> = Pick<BaseDatePickerProps<T>, "onBlur" | "selectedDate">;
|
|
7
|
+
type Props = ({
|
|
8
|
+
variant: "range";
|
|
9
|
+
} & InheritedProps<RangeSelectionValueType>) | ({
|
|
10
|
+
variant: "default";
|
|
11
|
+
} & InheritedProps<DateValue>);
|
|
12
|
+
export declare function useBaseDatePicker(props: Props): {
|
|
13
|
+
handleOnBlur: import("react").FocusEventHandler<HTMLDivElement>;
|
|
14
|
+
visibleMonth: DateValue | undefined;
|
|
15
|
+
handleVisibleMonthChange: import("react").Dispatch<import("react").SetStateAction<DateValue | undefined>>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DateValue } from "@internationalized/date";
|
|
3
|
+
import { PickerSelectionType } from "./types";
|
|
4
|
+
import { BaseDatePickerDropdownProps } from "./types";
|
|
5
|
+
type Props<T extends PickerSelectionType> = Pick<BaseDatePickerDropdownProps<T>, "onSelectedDateChange" | "onVisibleMonthChange"> & {
|
|
6
|
+
shouldCloseOnSelectionChange: (v: T) => boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function useBaseDatePickerDropdown<T extends PickerSelectionType>({ onVisibleMonthChange, onSelectedDateChange, shouldCloseOnSelectionChange, }: Props<T>): {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
handleOpenChange: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
11
|
+
triggererRef: import("react").RefObject<HTMLButtonElement>;
|
|
12
|
+
handleVisibleMonthChange: (_: React.SyntheticEvent, d: DateValue) => void;
|
|
13
|
+
handleDateSelection: (_: React.SyntheticEvent, d: T) => void;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseOffset } from "./
|
|
1
|
+
import { MouseOffset, MousePosition } from "./dragDropTypes";
|
|
2
2
|
export declare class DragDropState {
|
|
3
3
|
/** Distance between start (top | left) of dragged element and point where user pressed to drag */
|
|
4
4
|
readonly mouseOffset: MouseOffset;
|
|
@@ -7,7 +7,7 @@ export declare class DragDropState {
|
|
|
7
7
|
/** Element being dragged, (initial element cloned and rendered in portal). */
|
|
8
8
|
draggableElement: HTMLElement | null;
|
|
9
9
|
payload: unknown;
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(mousePosition: MousePosition, dragElement: HTMLElement);
|
|
11
11
|
/** Used to capture a ref to the Draggable JSX.Element */
|
|
12
12
|
setDraggable: (el: HTMLElement | null) => void;
|
|
13
13
|
setPayload(payload: unknown): void;
|
|
@@ -21,6 +21,10 @@ export type dragStrategy = "drop-indicator" | "natural-movement" | "drag-copy" |
|
|
|
21
21
|
export type Direction = "fwd" | "bwd";
|
|
22
22
|
export declare const FWD: Direction;
|
|
23
23
|
export declare const BWD: Direction;
|
|
24
|
+
export interface MousePosition {
|
|
25
|
+
clientX: number;
|
|
26
|
+
clientY: number;
|
|
27
|
+
}
|
|
24
28
|
export interface MouseOffset {
|
|
25
29
|
x: number;
|
|
26
30
|
y: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { orientationType } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import { ViewportRange } from "./
|
|
3
|
-
import { Direction, Rect } from "./
|
|
2
|
+
import { ViewportRange } from "./dragDropTypes";
|
|
3
|
+
import { Direction, Rect } from "./dragDropTypes";
|
|
4
4
|
export declare const NOT_OVERFLOWED = ":not(.wrapped)";
|
|
5
5
|
export declare const NOT_HIDDEN = ":not([aria-hidden=\"true\"])";
|
|
6
6
|
export type MeasuredDropTarget = {
|
|
@@ -32,31 +32,31 @@ type Dimension = keyof Pick<DOMRect, "width" | "height">;
|
|
|
32
32
|
type ElementPosition = "x" | "y";
|
|
33
33
|
export declare const measureElementSizeAndPosition: (element: HTMLElement, dimension?: Dimension, includeAutoMargin?: boolean) => number[];
|
|
34
34
|
export declare const dimensions: (orientation: orientationType) => {
|
|
35
|
-
CLIENT_POS: "
|
|
36
|
-
CLIENT_SIZE: "
|
|
37
|
-
CONTRA: "width" | "height" | "
|
|
38
|
-
CONTRA_CLIENT_POS: "
|
|
35
|
+
CLIENT_POS: "clientY" | "clientX";
|
|
36
|
+
CLIENT_SIZE: "scrollTop" | "scrollHeight" | "scrollWidth" | "clientHeight" | "clientWidth" | "scrollLeft";
|
|
37
|
+
CONTRA: "width" | "height" | "left" | "right" | "top" | "bottom" | "x" | "y";
|
|
38
|
+
CONTRA_CLIENT_POS: "clientY" | "clientX";
|
|
39
39
|
CONTRA_END: "width" | "height";
|
|
40
40
|
CONTRA_POS: ElementPosition;
|
|
41
41
|
DIMENSION: "width" | "height";
|
|
42
|
-
END: "width" | "height" | "
|
|
42
|
+
END: "width" | "height" | "left" | "right" | "top" | "bottom" | "x" | "y";
|
|
43
43
|
POS: ElementPosition;
|
|
44
|
-
SCROLL_POS: "
|
|
45
|
-
SCROLL_SIZE: "
|
|
46
|
-
START: "width" | "height" | "
|
|
44
|
+
SCROLL_POS: "scrollTop" | "scrollHeight" | "scrollWidth" | "clientHeight" | "clientWidth" | "scrollLeft";
|
|
45
|
+
SCROLL_SIZE: "scrollTop" | "scrollHeight" | "scrollWidth" | "clientHeight" | "clientWidth" | "scrollLeft";
|
|
46
|
+
START: "width" | "height" | "left" | "right" | "top" | "bottom" | "x" | "y";
|
|
47
47
|
} | {
|
|
48
|
-
CLIENT_POS: "
|
|
49
|
-
CLIENT_SIZE: "
|
|
50
|
-
CONTRA: "width" | "height" | "
|
|
51
|
-
CONTRA_CLIENT_POS: "
|
|
48
|
+
CLIENT_POS: "clientY" | "clientX";
|
|
49
|
+
CLIENT_SIZE: "scrollTop" | "scrollHeight" | "scrollWidth" | "clientHeight" | "clientWidth" | "scrollLeft";
|
|
50
|
+
CONTRA: "width" | "height" | "left" | "right" | "top" | "bottom" | "x" | "y";
|
|
51
|
+
CONTRA_CLIENT_POS: "clientY" | "clientX";
|
|
52
52
|
CONTRA_END: "width" | "height";
|
|
53
53
|
CONTRA_POS: ElementPosition;
|
|
54
54
|
DIMENSION: "width" | "height";
|
|
55
|
-
END: "width" | "height" | "
|
|
55
|
+
END: "width" | "height" | "left" | "right" | "top" | "bottom" | "x" | "y";
|
|
56
56
|
POS: ElementPosition;
|
|
57
|
-
SCROLL_POS: "
|
|
58
|
-
SCROLL_SIZE: "
|
|
59
|
-
START: "width" | "height" | "
|
|
57
|
+
SCROLL_POS: "scrollTop" | "scrollHeight" | "scrollWidth" | "clientHeight" | "clientWidth" | "scrollLeft";
|
|
58
|
+
SCROLL_SIZE: "scrollTop" | "scrollHeight" | "scrollWidth" | "clientHeight" | "clientWidth" | "scrollLeft";
|
|
59
|
+
START: "width" | "height" | "left" | "right" | "top" | "bottom" | "x" | "y";
|
|
60
60
|
};
|
|
61
61
|
export declare const getItemById: (measuredItems: MeasuredDropTarget[], id: string) => MeasuredDropTarget | undefined;
|
|
62
62
|
export declare const removeDraggedItem: (measuredItems: MeasuredDropTarget[], index: number) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./dragDropTypes";
|
|
2
2
|
export * from "./DragDropProvider";
|
|
3
3
|
export * from "./DragDropState";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./useDragDrop";
|
|
5
5
|
export * from "./drop-target-utils";
|
|
6
6
|
export * from "./useGlobalDragDrop";
|
|
@@ -3,7 +3,7 @@ export type ScrollStopHandler = (scrollDirection: "fwd" | "bwd", scrollPos: numb
|
|
|
3
3
|
export declare const useAutoScroll: ({ containerRef, onScrollingStopped, orientation, }: {
|
|
4
4
|
containerRef: RefObject<HTMLElement>;
|
|
5
5
|
onScrollingStopped?: ScrollStopHandler | undefined;
|
|
6
|
-
orientation?: "
|
|
6
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
7
7
|
}) => {
|
|
8
8
|
isScrolling: import("react").MutableRefObject<boolean>;
|
|
9
9
|
startScrolling: (direction: "fwd" | "bwd", scrollRate: number, scrollUnit?: any) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { orientationType } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import { Direction } from "./
|
|
2
|
+
import { Direction } from "./dragDropTypes";
|
|
3
3
|
import { MeasuredDropTarget } from "./drop-target-utils";
|
|
4
4
|
export type DragDisplacersHookResult = {
|
|
5
5
|
displaceItem: (dropTargets: MeasuredDropTarget[], dropTarget: MeasuredDropTarget, size: number, useTransition?: boolean, direction?: Direction | "static", orientation?: "horizontal" | "vertical") => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { InternalDragDropProps, InternalDragHookResult } from "./
|
|
1
|
+
import { InternalDragDropProps, InternalDragHookResult } from "./dragDropTypes";
|
|
2
2
|
export declare const useDragDropCopy: ({ selected, viewportRange, }: InternalDragDropProps) => InternalDragHookResult;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { InternalDragDropProps, InternalDragHookResult } from "./
|
|
1
|
+
import { InternalDragDropProps, InternalDragHookResult } from "./dragDropTypes";
|
|
2
2
|
export declare const useDragDropIndicator: ({ onDrop, orientation, containerRef, itemQuery, selected, viewportRange, }: InternalDragDropProps) => InternalDragHookResult;
|
package/types/drag-drop/{useDragDropNaturalMovementNext.d.ts → useDragDropNaturalMovement.d.ts}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { InternalDragDropProps, InternalDragHookResult } from "./
|
|
1
|
+
import { InternalDragDropProps, InternalDragHookResult } from "./dragDropTypes";
|
|
2
2
|
export declare const useDragDropNaturalMovement: ({ onDrop, orientation, containerRef, itemQuery, selected, viewportRange, }: InternalDragDropProps) => InternalDragHookResult;
|
package/types/index.d.ts
CHANGED
package/types/tabstrip/Tab.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MenuActionHandler } from "@vuu-ui/vuu-data-types";
|
|
2
2
|
import { KeyboardEvent, MouseEvent } from "react";
|
|
3
3
|
import "./Tab.css";
|
|
4
|
-
export declare const Tab: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLElement>, "
|
|
4
|
+
export declare const Tab: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLElement>, "onClick" | "onKeyUp"> & {
|
|
5
5
|
ariaControls?: string | undefined;
|
|
6
6
|
closeable?: boolean | undefined;
|
|
7
7
|
draggable?: boolean | undefined;
|
|
@@ -23,5 +23,5 @@ export declare const Tab: import("react").ForwardRefExoticComponent<Omit<import(
|
|
|
23
23
|
onKeyUp?: ((e: KeyboardEvent<Element>, index: number) => void) | undefined;
|
|
24
24
|
onMenuAction?: MenuActionHandler | undefined;
|
|
25
25
|
onMenuClose?: (() => void) | undefined;
|
|
26
|
-
orientation?: "
|
|
26
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
27
27
|
} & import("react").RefAttributes<HTMLDivElement>>;
|