@vuu-ui/vuu-ui-controls 4.0.0-alpha.9 → 4.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +16 -14
- package/src/context-panel-provider/ContextPanelProvider.js +40 -28
- package/src/drag-drop/Draggable.css.js +2 -2
- package/src/expando-input/ExpandoInput.css.js +1 -1
- package/src/icon-button/Icon.js +0 -1
- package/src/icon-button/IconButton.js +1 -1
- package/src/icon-button/ToggleIconButton.css.js +1 -1
- package/src/index.js +1 -1
- package/src/instrument-picker/useTablePicker.js +2 -3
- package/src/item-picker/ItemPicker.css.js +1 -1
- package/src/item-picker/ItemPicker.js +53 -79
- package/src/price-ticker/PriceTicker.css.js +4 -4
- package/src/split-pane/SplitPane.css.js +82 -0
- package/src/split-pane/SplitPane.js +60 -0
- package/src/split-pane/Splitter.js +82 -0
- package/src/split-pane/index.js +1 -0
- package/src/split-pane/useSplitPane.js +101 -0
- package/src/tabstrip/Tab.css.js +3 -3
- package/src/tabstrip/Tabstrip.css.js +2 -2
- package/src/tabstrip/Tabstrip.js +1 -1
- package/src/time-input/MaskedInput.js +176 -156
- package/src/time-input/TimeInput.css.js +41 -18
- package/src/time-input/TimeInput.js +25 -14
- package/src/time-input/useTimeInput.js +57 -47
- package/src/toolbar/Toolbar.css.js +1 -1
- package/src/vuu-date-picker/VuuDatePicker.js +46 -52
- package/src/vuu-time-picker/VuuTimePicker.js +6 -5
- package/types/context-panel-provider/ContextPanelProvider.d.ts +7 -4
- package/types/drag-drop/DragDropProvider.d.ts +1 -1
- package/types/hover-overlay/HoverOverlay.d.ts +1 -1
- package/types/icon-button/Icon.d.ts +2 -2
- package/types/icon-button/IconButton.d.ts +1 -1
- package/types/icon-button/ToggleIconButton.d.ts +1 -1
- package/types/index.d.ts +4 -3
- package/types/instrument-picker/SearchCell.d.ts +1 -1
- package/types/instrument-picker/TablePicker.d.ts +1 -1
- package/types/instrument-picker/useTablePicker.d.ts +1 -1
- package/types/item-picker/ItemPicker.d.ts +5 -26
- package/types/item-picker/useItemPicker.d.ts +3 -4
- package/types/modal-provider/ModalProvider.d.ts +1 -1
- package/types/price-ticker/PriceTicker.d.ts +1 -1
- package/types/prompt/Prompt.d.ts +1 -1
- package/types/sortable-list/SortableList.d.ts +2 -2
- package/types/split-button/useSplitButton.d.ts +12 -12
- package/types/split-pane/SplitPane.d.ts +44 -0
- package/types/split-pane/Splitter.d.ts +10 -0
- package/types/split-pane/index.d.ts +2 -0
- package/types/split-pane/useSplitPane.d.ts +18 -0
- package/types/table-search/SearchCell.d.ts +1 -1
- package/types/table-search/TableSearch.d.ts +1 -1
- package/types/tabstrip/TabMenu.d.ts +1 -1
- package/types/tabstrip/Tabstrip.d.ts +2 -3
- package/types/time-input/MaskedInput.d.ts +60 -10
- package/types/time-input/TimeInput.d.ts +4 -3
- package/types/time-input/useTimeInput.d.ts +24 -5
- package/types/toolbar/Toolbar.d.ts +1 -2
- package/types/vuu-date-picker/VuuDatePicker.d.ts +19 -3
- package/types/vuu-time-picker/VuuTimePicker.d.ts +8 -6
- package/types/vuu-typeahead-input/VuuTypeaheadInput.d.ts +1 -1
- package/types/src/calendar/Calendar.d.ts +0 -13
- package/types/src/calendar/index.d.ts +0 -4
- package/types/src/calendar/internal/CalendarCarousel.d.ts +0 -3
- package/types/src/calendar/internal/CalendarContext.d.ts +0 -8
- package/types/src/calendar/internal/CalendarDay.d.ts +0 -14
- package/types/src/calendar/internal/CalendarMonth.d.ts +0 -10
- package/types/src/calendar/internal/CalendarNavigation.d.ts +0 -16
- package/types/src/calendar/internal/CalendarWeekHeader.d.ts +0 -3
- package/types/src/calendar/internal/useFocusManagement.d.ts +0 -9
- package/types/src/calendar/internal/utils.d.ts +0 -15
- package/types/src/calendar/useCalendar.d.ts +0 -54
- package/types/src/calendar/useCalendarDay.d.ts +0 -22
- package/types/src/calendar/useSelection.d.ts +0 -78
- package/types/src/column-picker/ColumnPicker.d.ts +0 -7
- package/types/src/column-picker/ColumnSearch.d.ts +0 -12
- package/types/src/column-picker/index.d.ts +0 -2
- package/types/src/column-picker/moving-window.d.ts +0 -14
- package/types/src/common-hooks/index.d.ts +0 -3
- package/types/src/common-hooks/selectionTypes.d.ts +0 -70
- package/types/src/common-hooks/use-resize-observer.d.ts +0 -16
- package/types/src/common-hooks/useControlled.d.ts +0 -24
- package/types/src/context-panel-provider/ContextPanelProvider.d.ts +0 -17
- package/types/src/cycle-state-button/CycleStateButton.d.ts +0 -11
- package/types/src/cycle-state-button/index.d.ts +0 -1
- package/types/src/date-input/DateInput.d.ts +0 -60
- package/types/src/date-input/index.d.ts +0 -1
- package/types/src/date-picker/DatePicker.d.ts +0 -66
- package/types/src/date-picker/DatePickerContext.d.ts +0 -19
- package/types/src/date-picker/DatePickerPanel.d.ts +0 -10
- package/types/src/date-picker/index.d.ts +0 -1
- package/types/src/drag-drop/DragDropProvider.d.ts +0 -38
- package/types/src/drag-drop/DragDropState.d.ts +0 -15
- package/types/src/drag-drop/Draggable.d.ts +0 -13
- package/types/src/drag-drop/DropIndicator.d.ts +0 -5
- package/types/src/drag-drop/dragDropTypes.d.ts +0 -100
- package/types/src/drag-drop/drop-target-utils.d.ts +0 -82
- package/types/src/drag-drop/index.d.ts +0 -6
- package/types/src/drag-drop/useAutoScroll.d.ts +0 -11
- package/types/src/drag-drop/useDragDisplacers.d.ts +0 -17
- package/types/src/drag-drop/useDragDrop.d.ts +0 -2
- package/types/src/drag-drop/useDragDropCopy.d.ts +0 -6
- package/types/src/drag-drop/useDragDropIndicator.d.ts +0 -2
- package/types/src/drag-drop/useDragDropNaturalMovement.d.ts +0 -2
- package/types/src/drag-drop/useDropIndicator.d.ts +0 -8
- package/types/src/drag-drop/useGlobalDragDrop.d.ts +0 -11
- package/types/src/drag-drop/useTransition.d.ts +0 -3
- package/types/src/editable/index.d.ts +0 -1
- package/types/src/editable/useEditableText.d.ts +0 -21
- package/types/src/editable-label/EditableLabel.d.ts +0 -19
- package/types/src/editable-label/index.d.ts +0 -1
- package/types/src/expando-input/ExpandoInput.d.ts +0 -6
- package/types/src/expando-input/index.d.ts +0 -1
- package/types/src/highlighter/Highlighter.d.ts +0 -6
- package/types/src/highlighter/index.d.ts +0 -1
- package/types/src/hover-overlay/HoverOverlay.d.ts +0 -8
- package/types/src/icon-button/Icon.d.ts +0 -6
- package/types/src/icon-button/IconButton.d.ts +0 -6
- package/types/src/icon-button/ToggleIconButton.d.ts +0 -5
- package/types/src/icon-button/index.d.ts +0 -3
- package/types/src/index.d.ts +0 -33
- package/types/src/instrument-picker/SearchCell.d.ts +0 -2
- package/types/src/instrument-picker/TablePicker.d.ts +0 -11
- package/types/src/instrument-picker/index.d.ts +0 -1
- package/types/src/instrument-picker/moving-window.d.ts +0 -14
- package/types/src/instrument-picker/useDataSource.d.ts +0 -6
- package/types/src/instrument-picker/useTablePicker.d.ts +0 -47
- package/types/src/item-picker/ItemPicker.d.ts +0 -14
- package/types/src/item-picker/useItemPicker.d.ts +0 -35
- package/types/src/measured-container/MeasuredContainer.d.ts +0 -16
- package/types/src/measured-container/index.d.ts +0 -2
- package/types/src/measured-container/useMeasuredContainer.d.ts +0 -23
- package/types/src/modal-provider/ModalProvider.d.ts +0 -13
- package/types/src/overflow-container/OverflowContainer.d.ts +0 -15
- package/types/src/overflow-container/index.d.ts +0 -2
- package/types/src/overflow-container/overflow-utils.d.ts +0 -48
- package/types/src/overflow-container/useOverflowContainer.d.ts +0 -19
- package/types/src/price-ticker/PriceTicker.d.ts +0 -7
- package/types/src/price-ticker/index.d.ts +0 -1
- package/types/src/prompt/Prompt.d.ts +0 -53
- package/types/src/sortable-list/SortableList.d.ts +0 -8
- package/types/src/split-button/SplitButton.d.ts +0 -11
- package/types/src/split-button/SplitStateButton.d.ts +0 -5
- package/types/src/split-button/index.d.ts +0 -2
- package/types/src/split-button/useSplitButton.d.ts +0 -311
- package/types/src/table-search/SearchCell.d.ts +0 -2
- package/types/src/table-search/TableSearch.d.ts +0 -9
- package/types/src/table-search/index.d.ts +0 -1
- package/types/src/table-search/moving-window.d.ts +0 -14
- package/types/src/table-search/useTableSearch.d.ts +0 -15
- package/types/src/tabs-next/TabBar.d.ts +0 -12
- package/types/src/tabs-next/TabListNext.d.ts +0 -12
- package/types/src/tabs-next/TabNext.d.ts +0 -12
- package/types/src/tabs-next/TabNextAction.d.ts +0 -5
- package/types/src/tabs-next/TabNextContext.d.ts +0 -12
- package/types/src/tabs-next/TabNextPanel.d.ts +0 -8
- package/types/src/tabs-next/TabNextTrigger.d.ts +0 -5
- package/types/src/tabs-next/TabOverflowList.d.ts +0 -11
- package/types/src/tabs-next/TabsNext.d.ts +0 -17
- package/types/src/tabs-next/TabsNextContext.d.ts +0 -21
- package/types/src/tabs-next/hooks/useCollection.d.ts +0 -18
- package/types/src/tabs-next/hooks/useFocusOutside.d.ts +0 -2
- package/types/src/tabs-next/hooks/useOverflow.d.ts +0 -11
- package/types/src/tabs-next/index.d.ts +0 -7
- package/types/src/tabstrip/Tab.d.ts +0 -27
- package/types/src/tabstrip/TabMenu.d.ts +0 -23
- package/types/src/tabstrip/TabMenuOptions.d.ts +0 -10
- package/types/src/tabstrip/TabsTypes.d.ts +0 -127
- package/types/src/tabstrip/Tabstrip.d.ts +0 -3
- package/types/src/tabstrip/index.d.ts +0 -5
- package/types/src/tabstrip/tabstrip-dom-utils.d.ts +0 -2
- package/types/src/tabstrip/useAnimatedSelectionThumb.d.ts +0 -7
- package/types/src/tabstrip/useKeyboardNavigation.d.ts +0 -29
- package/types/src/tabstrip/useSelection.d.ts +0 -13
- package/types/src/tabstrip/useTabstrip.d.ts +0 -55
- package/types/src/time-input/MaskedInput.d.ts +0 -49
- package/types/src/time-input/TimeInput.d.ts +0 -5
- package/types/src/time-input/useTimeInput.d.ts +0 -21
- package/types/src/toolbar/Toolbar.d.ts +0 -20
- package/types/src/toolbar/index.d.ts +0 -1
- package/types/src/toolbar/toolbar-dom-utils.d.ts +0 -3
- package/types/src/toolbar/useKeyboardNavigation.d.ts +0 -32
- package/types/src/toolbar/useSelection.d.ts +0 -22
- package/types/src/toolbar/useToolbar.d.ts +0 -28
- package/types/src/utils/deprecated-types.d.ts +0 -2
- package/types/src/utils/escapeRegExp.d.ts +0 -1
- package/types/src/utils/forwardCallbackProps.d.ts +0 -3
- package/types/src/utils/index.d.ts +0 -5
- package/types/src/utils/isOverflowElement.d.ts +0 -1
- package/types/src/utils/isPlainObject.d.ts +0 -1
- package/types/src/vuu-date-picker/VuuDatePicker.d.ts +0 -7
- package/types/src/vuu-date-picker/index.d.ts +0 -1
- package/types/src/vuu-input/VuuInput.d.ts +0 -18
- package/types/src/vuu-input/index.d.ts +0 -1
- package/types/src/vuu-time-picker/TimeRangePicker.d.ts +0 -0
- package/types/src/vuu-time-picker/VuuTimePicker.d.ts +0 -7
- package/types/src/vuu-typeahead-input/VuuTypeaheadInput.d.ts +0 -6
- package/types/src/vuu-typeahead-input/index.d.ts +0 -1
- package/types/src/vuu-typeahead-input/useVuuTypeaheadInput.d.ts +0 -49
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler, RefObject, SyntheticEvent } from "react";
|
|
2
|
-
export type SelectionDisallowed = "none";
|
|
3
|
-
export type SingleSelectionStrategy = "default" | "deselectable";
|
|
4
|
-
export type MultiSelectionStrategy = "multiple" | "extended" | "extended-multi-range";
|
|
5
|
-
/**
|
|
6
|
-
* SpecialKeyMultiple works as deselectable unless a special key
|
|
7
|
-
* (default SHIFT) is also pressed, then it allows multiple selection.
|
|
8
|
-
* Useful for column sorting, filters etc
|
|
9
|
-
*/
|
|
10
|
-
export type SpecialKeyMultipleSelection = "multiple-special-key";
|
|
11
|
-
export type SelectionStrategy = SelectionDisallowed | SingleSelectionStrategy | MultiSelectionStrategy;
|
|
12
|
-
export declare const isSingleSelection: (s?: SelectionStrategy) => s is SingleSelectionStrategy;
|
|
13
|
-
export declare const isMultiSelection: (s?: SelectionStrategy) => s is MultiSelectionStrategy;
|
|
14
|
-
export type SelectHandler<Item = string> = (event: SyntheticEvent, selectedItem: Item) => void;
|
|
15
|
-
export declare const selectionIsDisallowed: (selection?: SelectionStrategy | SpecialKeyMultipleSelection) => selection is SelectionDisallowed;
|
|
16
|
-
export declare const allowMultipleSelection: (selectionStrategy: SelectionStrategy | SpecialKeyMultipleSelection, specialKey?: boolean) => boolean;
|
|
17
|
-
export declare const deselectionIsAllowed: (selection?: SelectionStrategy | SpecialKeyMultipleSelection) => selection is "deselectable" | MultiSelectionStrategy;
|
|
18
|
-
export declare const hasSelection: <Item = unknown>(selected?: Item[]) => boolean;
|
|
19
|
-
export declare const getFirstSelectedItem: <Item = unknown>(selected: Item[]) => Item;
|
|
20
|
-
interface SelectionProps {
|
|
21
|
-
defaultSelected?: string[];
|
|
22
|
-
onSelect?: SelectHandler;
|
|
23
|
-
onSelectionChange?: MultiSelectionHandler;
|
|
24
|
-
selected?: string[];
|
|
25
|
-
selectionStrategy?: SelectionStrategy;
|
|
26
|
-
}
|
|
27
|
-
export interface ListHandlers {
|
|
28
|
-
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
29
|
-
onKeyDown?: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
30
|
-
onKeyboardNavigation?: (event: React.KeyboardEvent, currentIndex: number) => void;
|
|
31
|
-
onMouseMove?: (event: React.MouseEvent) => void;
|
|
32
|
-
}
|
|
33
|
-
export interface SelectionHookProps extends SelectionProps {
|
|
34
|
-
containerRef: RefObject<HTMLElement | null>;
|
|
35
|
-
disableSelection?: boolean;
|
|
36
|
-
highlightedIndex: number;
|
|
37
|
-
itemQuery: string;
|
|
38
|
-
label?: string;
|
|
39
|
-
onClick?: MouseEventHandler;
|
|
40
|
-
selectionKeys?: string[];
|
|
41
|
-
tabToSelect?: boolean;
|
|
42
|
-
}
|
|
43
|
-
export interface SelectionHookResult {
|
|
44
|
-
listHandlers: ListHandlers;
|
|
45
|
-
selected: string[];
|
|
46
|
-
setSelected: (selected: string[]) => void;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* evt is only null in the special case of a selection fired from a multi-select
|
|
50
|
-
* host on tab or selection based on freeform text in combobox
|
|
51
|
-
*/
|
|
52
|
-
export type MultiSelectionHandler<Item = string> = (event: SyntheticEvent | null, selected: Item[]) => void;
|
|
53
|
-
/**
|
|
54
|
-
* evt is only null in the special case of freeform text in combobox
|
|
55
|
-
*/
|
|
56
|
-
export type SingleSelectionHandler<Item = string> = (event: SyntheticEvent | null, selected: Item) => void;
|
|
57
|
-
export type SelectionType<I, S extends SelectionStrategy> = S extends MultiSelectionStrategy ? I[] : I | null;
|
|
58
|
-
export interface ComponentSelectionProps<Item = string, S extends SelectionStrategy = "default"> {
|
|
59
|
-
defaultSelected?: S extends MultiSelectionStrategy ? Item[] : Item;
|
|
60
|
-
onSelect?: SelectHandler<Item>;
|
|
61
|
-
onSelectionChange?: S extends MultiSelectionStrategy ? MultiSelectionHandler<Item> : SingleSelectionHandler<Item>;
|
|
62
|
-
selected?: SelectionType<Item, S>;
|
|
63
|
-
selectionStrategy?: S;
|
|
64
|
-
/**
|
|
65
|
-
* The keyboard keys used to effect selection, defaults to SPACE and ENTER
|
|
66
|
-
* TODO maybe this belongs on the SelectionProps interface ?
|
|
67
|
-
*/
|
|
68
|
-
selectionKeys?: string[];
|
|
69
|
-
}
|
|
70
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
|
-
export declare const WidthHeight: string[];
|
|
3
|
-
export declare const WidthOnly: string[];
|
|
4
|
-
export declare const HeightOnly: string[];
|
|
5
|
-
export type measurements<T = string | number> = {
|
|
6
|
-
height?: T;
|
|
7
|
-
clientHeight?: number;
|
|
8
|
-
clientWidth?: number;
|
|
9
|
-
contentHeight?: number;
|
|
10
|
-
contentWidth?: number;
|
|
11
|
-
scrollHeight?: number;
|
|
12
|
-
scrollWidth?: number;
|
|
13
|
-
width?: T;
|
|
14
|
-
};
|
|
15
|
-
export type ResizeHandler = (measurements: measurements<number>) => void;
|
|
16
|
-
export declare function useResizeObserver(ref: RefObject<Element | HTMLElement | null>, dimensions: string[], onResize: ResizeHandler, reportInitialSize?: boolean): void;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from "react";
|
|
2
|
-
export interface UseControlledProps<T> {
|
|
3
|
-
/**
|
|
4
|
-
* Holds the component value when it's controlled.
|
|
5
|
-
*/
|
|
6
|
-
controlled?: T;
|
|
7
|
-
/**
|
|
8
|
-
* The default value when uncontrolled.
|
|
9
|
-
*/
|
|
10
|
-
default: T;
|
|
11
|
-
/**
|
|
12
|
-
* The component name displayed in warnings.
|
|
13
|
-
*/
|
|
14
|
-
name: string;
|
|
15
|
-
/**
|
|
16
|
-
* The name of the state variable displayed in warnings.
|
|
17
|
-
*/
|
|
18
|
-
state?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Copied from MUI (v5) useControlled hook with one additional returned value
|
|
22
|
-
* @see https://github.com/mui-org/material-ui/blob/0979e6a54ba47c278d1f535953c0520a86349811/packages/material-ui-utils/src/useControlled.js
|
|
23
|
-
*/
|
|
24
|
-
export declare function useControlled<S>({ controlled, default: defaultProp, name, state, }: UseControlledProps<S>): [S, Dispatch<SetStateAction<S>>, boolean];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* If component is a string, the component will be read from the
|
|
4
|
-
* comoponent registry. In that case, componentProps can be used
|
|
5
|
-
* to pass props to the component.
|
|
6
|
-
*/
|
|
7
|
-
export type ShowContextPanel = (component: string | ReactElement, title: string, componentProps?: unknown) => void;
|
|
8
|
-
export interface ContextPanelProps {
|
|
9
|
-
hideContextPanel?: () => void;
|
|
10
|
-
showContextPanel: ShowContextPanel;
|
|
11
|
-
}
|
|
12
|
-
export declare const ContextPanelContext: import("react").Context<ContextPanelProps>;
|
|
13
|
-
export declare const ContextPanelProvider: ({ children, hideContextPanel: hideContextPanelProp, showContextPanel: showContextPanelProp, }: Partial<ContextPanelProps> & {
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
}) => import("react").JSX.Element;
|
|
16
|
-
export declare function useContextPanel(): ShowContextPanel;
|
|
17
|
-
export declare function useHideContextPanel(): (() => void) | undefined;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from "@salt-ds/core";
|
|
2
|
-
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
import type { CommitHandler } from "@vuu-ui/vuu-utils";
|
|
4
|
-
export type CycleStateButtonChangeHandler = (value: VuuRowDataItemType) => void;
|
|
5
|
-
export interface CycleStateButtonProps extends Omit<ButtonProps, "onChange"> {
|
|
6
|
-
onChange?: CycleStateButtonChangeHandler;
|
|
7
|
-
onCommit?: CommitHandler<HTMLButtonElement>;
|
|
8
|
-
values: string[];
|
|
9
|
-
value: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const CycleStateButton: import("react").ForwardRefExoticComponent<CycleStateButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./CycleStateButton";
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { type ChangeEvent, type ComponentPropsWithoutRef, type InputHTMLAttributes, type ReactNode, type RefObject, type SyntheticEvent } from "react";
|
|
2
|
-
import { type DateValue } from "@internationalized/date";
|
|
3
|
-
import { type RangeSelectionValueType, type SingleSelectionValueType } from "../calendar";
|
|
4
|
-
export interface DateInputProps<SelectionVariantType> extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "onChange">, Pick<ComponentPropsWithoutRef<"input">, "disabled" | "placeholder"> {
|
|
5
|
-
ariaLabel?: string;
|
|
6
|
-
/**
|
|
7
|
-
* The marker to use in an empty read only DateInput.
|
|
8
|
-
* Use `''` to disable this feature. Defaults to '—'.
|
|
9
|
-
*/
|
|
10
|
-
emptyReadOnlyMarker?: string;
|
|
11
|
-
/**
|
|
12
|
-
* End adornment component
|
|
13
|
-
*/
|
|
14
|
-
endAdornment?: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dateInput#Attributes) applied to the `input` elements.
|
|
17
|
-
*/
|
|
18
|
-
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
19
|
-
/**
|
|
20
|
-
* If `true`, the component is read only.
|
|
21
|
-
*/
|
|
22
|
-
readOnly?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Validation status.
|
|
25
|
-
*/
|
|
26
|
-
validationStatus?: "error" | "warning" | "success";
|
|
27
|
-
/**
|
|
28
|
-
* Styling variant. Defaults to "primary".
|
|
29
|
-
*/
|
|
30
|
-
variant?: "primary" | "secondary";
|
|
31
|
-
/**
|
|
32
|
-
* Styling variant with full border. Defaults to false
|
|
33
|
-
*/
|
|
34
|
-
bordered?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Function to format the input value.
|
|
37
|
-
*/
|
|
38
|
-
dateFormatter?: (input: DateValue | undefined) => string;
|
|
39
|
-
/**
|
|
40
|
-
* Reference for the startInput;
|
|
41
|
-
*/
|
|
42
|
-
startInputRef?: RefObject<HTMLInputElement | null>;
|
|
43
|
-
/**
|
|
44
|
-
* Reference for the endInput;
|
|
45
|
-
*/
|
|
46
|
-
endInputRef?: RefObject<HTMLInputElement | null>;
|
|
47
|
-
/**
|
|
48
|
-
* Selection variant. Defaults to single select.
|
|
49
|
-
*/
|
|
50
|
-
selectionVariant?: "default" | "range";
|
|
51
|
-
/**
|
|
52
|
-
* Callback fired when the selected date change.
|
|
53
|
-
*/
|
|
54
|
-
onSelectionChange?: (event: SyntheticEvent, selectedDate?: SelectionVariantType) => void;
|
|
55
|
-
/**
|
|
56
|
-
* Callback fired when the input value change.
|
|
57
|
-
*/
|
|
58
|
-
onChange?: SelectionVariantType extends SingleSelectionValueType ? (event: ChangeEvent<HTMLInputElement>, selectedDateInputValue?: string) => void : (event: ChangeEvent<HTMLInputElement>, startDateInputValue?: string, endDateInputValue?: string) => void;
|
|
59
|
-
}
|
|
60
|
-
export declare const DateInput: import("react").ForwardRefExoticComponent<DateInputProps<RangeSelectionValueType | DateValue> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./DateInput";
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { type ChangeEvent, type SyntheticEvent } from "react";
|
|
2
|
-
import { type DateValue } from "@internationalized/date";
|
|
3
|
-
import { type CalendarProps, type RangeSelectionValueType, type SingleSelectionValueType } from "../calendar";
|
|
4
|
-
import { type DateInputProps } from "../date-input";
|
|
5
|
-
export interface DatePickerProps<SelectionVariantType> extends DateInputProps<SelectionVariantType> {
|
|
6
|
-
/**
|
|
7
|
-
* Selection variant. Defaults to single select.
|
|
8
|
-
*/
|
|
9
|
-
selectionVariant?: "default" | "range";
|
|
10
|
-
/**
|
|
11
|
-
* If `true`, the component will be disabled.
|
|
12
|
-
*/
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* The selected date value. Use when the component is controlled.
|
|
16
|
-
* Can be a single date or an object with start and end dates for range selection.
|
|
17
|
-
*/
|
|
18
|
-
selectedDate?: SelectionVariantType;
|
|
19
|
-
/**
|
|
20
|
-
* The default date value. Use when the component is not controlled.
|
|
21
|
-
* Can be a single date or an object with start and end dates for range selection.
|
|
22
|
-
*/
|
|
23
|
-
defaultSelectedDate?: SelectionVariantType;
|
|
24
|
-
/**
|
|
25
|
-
* Props to be passed to the Calendar component.
|
|
26
|
-
*/
|
|
27
|
-
CalendarProps?: Partial<Omit<CalendarProps, "selectionVariant" | "selectedDate" | "defaultSelectedDate" | "onSelectedDateChange">>;
|
|
28
|
-
/**
|
|
29
|
-
* Function to format the input value.
|
|
30
|
-
*/
|
|
31
|
-
dateFormatter?: (input: DateValue | undefined) => string;
|
|
32
|
-
/**
|
|
33
|
-
* Callback function triggered when open state changes.
|
|
34
|
-
*/
|
|
35
|
-
onOpenChange?: (newOpen: boolean) => void;
|
|
36
|
-
/**
|
|
37
|
-
* Display or hide the component.
|
|
38
|
-
*/
|
|
39
|
-
open?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* The default open value. Use when the component is not controlled.
|
|
42
|
-
*/
|
|
43
|
-
defaultOpen?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Helper text to display in the panel
|
|
46
|
-
*/
|
|
47
|
-
helperText?: string;
|
|
48
|
-
/**
|
|
49
|
-
* Validation status.
|
|
50
|
-
*/
|
|
51
|
-
validationStatus?: "error" | "warning" | "success";
|
|
52
|
-
/**
|
|
53
|
-
* Callback fired when the selected date change.
|
|
54
|
-
*/
|
|
55
|
-
onSelectionChange?: (event: SyntheticEvent, selectedDate?: SelectionVariantType) => void;
|
|
56
|
-
/**
|
|
57
|
-
* Callback fired when the input value change.
|
|
58
|
-
*/
|
|
59
|
-
onChange?: SelectionVariantType extends SingleSelectionValueType ? (event: ChangeEvent<HTMLInputElement>, selectedDateInputValue?: string) => void : (event: ChangeEvent<HTMLInputElement>, startDateInputValue?: string, endDateInputValue?: string) => void;
|
|
60
|
-
/**
|
|
61
|
-
* Number of Calendars to be shown if selectionVariant is range.
|
|
62
|
-
* 2 is the default value.
|
|
63
|
-
*/
|
|
64
|
-
visibleMonths?: 1 | 2;
|
|
65
|
-
}
|
|
66
|
-
export declare const DatePicker: import("react").ForwardRefExoticComponent<DatePickerProps<RangeSelectionValueType | DateValue> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { DateValue } from "@internationalized/date";
|
|
2
|
-
import { type UseFloatingUIReturn } from "@salt-ds/core";
|
|
3
|
-
import type { RangeSelectionValueType } from "../calendar";
|
|
4
|
-
export interface DatePickerContextValue<SelectionVariantType> extends Partial<Pick<UseFloatingUIReturn, "context">> {
|
|
5
|
-
openState: boolean;
|
|
6
|
-
setOpen: (newOpen: boolean) => void;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
selectedDate: SelectionVariantType | undefined;
|
|
9
|
-
defaultSelectedDate: SelectionVariantType | undefined;
|
|
10
|
-
setSelectedDate: (newStartDate: SelectionVariantType | undefined) => void;
|
|
11
|
-
startVisibleMonth: DateValue | undefined;
|
|
12
|
-
setStartVisibleMonth: (newStartDate: DateValue | undefined) => void;
|
|
13
|
-
endVisibleMonth: DateValue | undefined;
|
|
14
|
-
setEndVisibleMonth: (newStartDate: DateValue | undefined) => void;
|
|
15
|
-
selectionVariant: "default" | "range";
|
|
16
|
-
getPanelPosition: () => Record<string, unknown>;
|
|
17
|
-
}
|
|
18
|
-
export declare const DatePickerContext: import("react").Context<DatePickerContextValue<RangeSelectionValueType | DateValue>>;
|
|
19
|
-
export declare function useDatePickerContext(): DatePickerContextValue<RangeSelectionValueType | DateValue>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type DateValue } from "@internationalized/date";
|
|
2
|
-
import { type ComponentPropsWithoutRef, type SyntheticEvent } from "react";
|
|
3
|
-
import { type CalendarProps, type RangeSelectionValueType } from "../calendar";
|
|
4
|
-
export interface DatePickerPanelProps<SelectionVariantType> extends ComponentPropsWithoutRef<"div"> {
|
|
5
|
-
onSelect?: (event: SyntheticEvent, selectedDate?: SelectionVariantType) => void;
|
|
6
|
-
helperText?: string;
|
|
7
|
-
visibleMonths?: 1 | 2;
|
|
8
|
-
CalendarProps?: Partial<Omit<CalendarProps, "selectionVariant" | "selectedDate" | "defaultSelectedDate" | "onSelectedDateChange">>;
|
|
9
|
-
}
|
|
10
|
-
export declare const DatePickerPanel: import("react").ForwardRefExoticComponent<DatePickerPanelProps<RangeSelectionValueType | DateValue> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./DatePicker";
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import type { DragDropState } from "./DragDropState";
|
|
3
|
-
import { type GlobalDropHandler, type ResumeDragHandler } from "./useGlobalDragDrop";
|
|
4
|
-
export type DragOutHandler = (id: string, dragDropState: DragDropState) => boolean;
|
|
5
|
-
export type DragDropRegistrationFn = (id: string, resumeDrag: ResumeDragHandler | false, onDrop?: GlobalDropHandler) => void;
|
|
6
|
-
export type EndOfDragOperationHandler = (id: string) => void;
|
|
7
|
-
export interface DragDropContextProps {
|
|
8
|
-
dragSources?: Map<string, string[]>;
|
|
9
|
-
dropTargets?: Map<string, string[]>;
|
|
10
|
-
onDragOut?: DragOutHandler;
|
|
11
|
-
onEndOfDragOperation?: EndOfDragOperationHandler;
|
|
12
|
-
registerDragDropParty: DragDropRegistrationFn;
|
|
13
|
-
}
|
|
14
|
-
export type DragSources = {
|
|
15
|
-
[key: string]: {
|
|
16
|
-
dropTargets: string | string[];
|
|
17
|
-
payloadType?: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export interface DragDropProviderProps {
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
dragSources: DragSources;
|
|
23
|
-
}
|
|
24
|
-
export type MeasuredTarget = {
|
|
25
|
-
bottom: number;
|
|
26
|
-
left: number;
|
|
27
|
-
right: number;
|
|
28
|
-
top: number;
|
|
29
|
-
};
|
|
30
|
-
export declare const DragDropProvider: ({ children, dragSources: dragSourcesProp, }: DragDropProviderProps) => import("react").JSX.Element;
|
|
31
|
-
export interface DragDropProviderResult {
|
|
32
|
-
isDragSource?: boolean;
|
|
33
|
-
isDropTarget?: boolean;
|
|
34
|
-
onDragOut?: DragOutHandler;
|
|
35
|
-
onEndOfDragOperation?: (id: string) => void;
|
|
36
|
-
register: DragDropRegistrationFn;
|
|
37
|
-
}
|
|
38
|
-
export declare const useDragDropProvider: (id?: string) => DragDropProviderResult;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MouseOffset, MousePosition } from "./dragDropTypes";
|
|
2
|
-
export declare class DragDropState {
|
|
3
|
-
/** Distance between start (top | left) of dragged element and point where user pressed to drag */
|
|
4
|
-
readonly mouseOffset: MouseOffset;
|
|
5
|
-
/** Element where the initial mousedown triggered the drag operation */
|
|
6
|
-
readonly initialDragElement: HTMLElement;
|
|
7
|
-
/** Element being dragged, (initial element cloned and rendered in portal). */
|
|
8
|
-
draggableElement: HTMLElement | null;
|
|
9
|
-
payload: unknown;
|
|
10
|
-
constructor(mousePosition: MousePosition, dragElement: HTMLElement);
|
|
11
|
-
/** Used to capture a ref to the Draggable ReactElement */
|
|
12
|
-
setDraggable: (el: HTMLElement | null) => void;
|
|
13
|
-
setPayload(payload: unknown): void;
|
|
14
|
-
private getMouseOffset;
|
|
15
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, HTMLAttributes, MutableRefObject, TransitionEventHandler } from "react";
|
|
2
|
-
export interface DraggableProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
wrapperClassName: string;
|
|
4
|
-
element: HTMLElement;
|
|
5
|
-
onDropped?: () => void;
|
|
6
|
-
onTransitionEnd?: TransitionEventHandler;
|
|
7
|
-
scale?: number;
|
|
8
|
-
style: CSSProperties;
|
|
9
|
-
}
|
|
10
|
-
export declare const Draggable: import("react").ForwardRefExoticComponent<DraggableProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
-
export declare const createDragSpacer: (transitioning?: MutableRefObject<boolean>) => HTMLElement;
|
|
12
|
-
export declare const createDropIndicatorPosition: () => HTMLElement;
|
|
13
|
-
export declare const createDropIndicator: (transitioning?: MutableRefObject<boolean>) => HTMLElement;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler, ReactElement, RefObject } from "react";
|
|
2
|
-
import type { orientationType } from "@vuu-ui/vuu-utils";
|
|
3
|
-
import { DragDropState } from "./DragDropState";
|
|
4
|
-
export type ViewportRange = {
|
|
5
|
-
atEnd: boolean;
|
|
6
|
-
atStart: boolean;
|
|
7
|
-
from: number;
|
|
8
|
-
to: number;
|
|
9
|
-
};
|
|
10
|
-
type dimension = "width" | "height" | "scrollWidth" | "scrollHeight";
|
|
11
|
-
type dimensions = {
|
|
12
|
-
size: dimension;
|
|
13
|
-
depth: dimension;
|
|
14
|
-
scrollDepth: dimension;
|
|
15
|
-
};
|
|
16
|
-
export type dimensionsType = {
|
|
17
|
-
horizontal: dimensions;
|
|
18
|
-
vertical: dimensions;
|
|
19
|
-
};
|
|
20
|
-
export type dragStrategy = "drop-indicator" | "natural-movement" | "drag-copy" | "drop-only";
|
|
21
|
-
export type Direction = "fwd" | "bwd";
|
|
22
|
-
export declare const FWD: Direction;
|
|
23
|
-
export declare const BWD: Direction;
|
|
24
|
-
export interface MousePosition {
|
|
25
|
-
clientX: number;
|
|
26
|
-
clientY: number;
|
|
27
|
-
}
|
|
28
|
-
export interface MouseOffset {
|
|
29
|
-
x: number;
|
|
30
|
-
y: number;
|
|
31
|
-
}
|
|
32
|
-
export type Rect = {
|
|
33
|
-
height: number;
|
|
34
|
-
left: number;
|
|
35
|
-
top: number;
|
|
36
|
-
width: number;
|
|
37
|
-
};
|
|
38
|
-
export interface DragHookResult {
|
|
39
|
-
draggable?: ReactElement;
|
|
40
|
-
dropIndicator?: ReactElement;
|
|
41
|
-
draggedItemIndex?: number;
|
|
42
|
-
isDragging: boolean;
|
|
43
|
-
isScrolling: RefObject<boolean>;
|
|
44
|
-
onMouseDown?: MouseEventHandler;
|
|
45
|
-
revealOverflowedItems?: boolean;
|
|
46
|
-
}
|
|
47
|
-
export interface InternalDragHookResult extends Omit<DragHookResult, "isDragging" | "isScrolling"> {
|
|
48
|
-
beginDrag: (dragElement: HTMLElement) => void;
|
|
49
|
-
drag: (dragPos: number, mouseMoveDirection: "fwd" | "bwd") => void;
|
|
50
|
-
drop: () => DropOptions;
|
|
51
|
-
handleScrollStart?: (scrollDirection: "fwd" | "bwd") => void;
|
|
52
|
-
handleScrollStop?: (scrollDirection: "fwd" | "bwd", _scrollPos: number, atEnd: boolean) => void;
|
|
53
|
-
/**
|
|
54
|
-
* Draggable item has been dragged out of container. Remove any local drop
|
|
55
|
-
* indicators. Dragged element itself should not yet be removed from DOM.
|
|
56
|
-
*/
|
|
57
|
-
releaseDrag?: () => void;
|
|
58
|
-
}
|
|
59
|
-
export interface DropOptions {
|
|
60
|
-
fromIndex: number;
|
|
61
|
-
toIndex: number;
|
|
62
|
-
isExternal?: boolean;
|
|
63
|
-
payload?: unknown;
|
|
64
|
-
}
|
|
65
|
-
export type DragStartHandler = (dragDropState: DragDropState) => void;
|
|
66
|
-
export type DropHandler = (options: DropOptions) => void;
|
|
67
|
-
export interface DragDropProps {
|
|
68
|
-
allowDragDrop?: boolean | dragStrategy;
|
|
69
|
-
containerRef: RefObject<HTMLElement | null>;
|
|
70
|
-
/** this is the className that will be assigned during drag to the dragged element */
|
|
71
|
-
draggableClassName: string;
|
|
72
|
-
extendedDropZone?: boolean;
|
|
73
|
-
getDragPayload?: (dragElement: HTMLElement) => unknown;
|
|
74
|
-
id?: string;
|
|
75
|
-
isDragSource?: boolean;
|
|
76
|
-
isDropTarget?: boolean;
|
|
77
|
-
itemQuery?: string;
|
|
78
|
-
onDragStart?: DragStartHandler;
|
|
79
|
-
onDrop: DropHandler;
|
|
80
|
-
onDropSettle?: (toIndex: number) => void;
|
|
81
|
-
orientation: orientationType;
|
|
82
|
-
/**
|
|
83
|
-
* The scrolling container does not necessarily have to be a
|
|
84
|
-
* descendant of the container, it may be an ancestor element;
|
|
85
|
-
*/
|
|
86
|
-
scrollingContainerRef?: RefObject<HTMLElement | null>;
|
|
87
|
-
viewportRange?: ViewportRange;
|
|
88
|
-
}
|
|
89
|
-
export type DragDropHook = (props: DragDropProps) => DragHookResult;
|
|
90
|
-
export interface InternalDragDropProps extends Omit<DragDropProps, "draggableClassName" | "id" | "onDrop"> {
|
|
91
|
-
isDragSource?: boolean;
|
|
92
|
-
isDropTarget?: boolean;
|
|
93
|
-
selected?: unknown;
|
|
94
|
-
}
|
|
95
|
-
export type DragDropContext = {
|
|
96
|
-
dragElement: HTMLElement;
|
|
97
|
-
dragPayload: unknown;
|
|
98
|
-
mouseOffset: MouseOffset;
|
|
99
|
-
};
|
|
100
|
-
export {};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { orientationType } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import { ViewportRange } from "./dragDropTypes";
|
|
3
|
-
import { Direction, Rect } from "./dragDropTypes";
|
|
4
|
-
export declare const NOT_OVERFLOWED = ":not(.wrapped)";
|
|
5
|
-
export declare const NOT_HIDDEN = ":not([aria-hidden=\"true\"])";
|
|
6
|
-
export type MeasuredDropTarget = {
|
|
7
|
-
/**
|
|
8
|
-
The index position currently occupied by this item. If draggable
|
|
9
|
-
is dropped here, this will be the destination drop position.
|
|
10
|
-
*/
|
|
11
|
-
currentIndex: number;
|
|
12
|
-
element: HTMLElement;
|
|
13
|
-
id: string;
|
|
14
|
-
index: number;
|
|
15
|
-
isDraggedItem: boolean;
|
|
16
|
-
isExternal?: boolean;
|
|
17
|
-
isLast?: boolean;
|
|
18
|
-
isOverflowIndicator?: boolean;
|
|
19
|
-
start: number;
|
|
20
|
-
end: number;
|
|
21
|
-
mid: number;
|
|
22
|
-
size: number;
|
|
23
|
-
};
|
|
24
|
-
export type targetType = {
|
|
25
|
-
element: HTMLElement | null;
|
|
26
|
-
index: number;
|
|
27
|
-
isLast?: boolean;
|
|
28
|
-
};
|
|
29
|
-
/** clones and removes id */
|
|
30
|
-
export declare const cloneElement: <T extends HTMLElement>(element: T) => T;
|
|
31
|
-
type MousePosKey = keyof Pick<MouseEvent, "clientX" | "clientY">;
|
|
32
|
-
type DOMRectKey = keyof Omit<DOMRect, "toJSON">;
|
|
33
|
-
type DOMRectDimensionKey = keyof Pick<DOMRect, "width" | "height">;
|
|
34
|
-
type Dimension = keyof Pick<DOMRect, "width" | "height">;
|
|
35
|
-
type ElementDimension = keyof Pick<HTMLElement, "scrollHeight" | "scrollWidth" | "clientHeight" | "clientWidth" | "scrollTop" | "scrollLeft">;
|
|
36
|
-
type ElementPosition = "x" | "y";
|
|
37
|
-
export declare const measureElementSizeAndPosition: (element: HTMLElement, dimension?: Dimension, includeAutoMargin?: boolean) => number[];
|
|
38
|
-
export declare const dimensions: (orientation: orientationType) => {
|
|
39
|
-
CLIENT_POS: MousePosKey;
|
|
40
|
-
CLIENT_SIZE: ElementDimension;
|
|
41
|
-
CONTRA: DOMRectKey;
|
|
42
|
-
CONTRA_CLIENT_POS: MousePosKey;
|
|
43
|
-
CONTRA_END: DOMRectDimensionKey;
|
|
44
|
-
CONTRA_POS: ElementPosition;
|
|
45
|
-
DIMENSION: DOMRectDimensionKey;
|
|
46
|
-
END: DOMRectKey;
|
|
47
|
-
POS: ElementPosition;
|
|
48
|
-
SCROLL_POS: ElementDimension;
|
|
49
|
-
SCROLL_SIZE: ElementDimension;
|
|
50
|
-
START: DOMRectKey;
|
|
51
|
-
} | {
|
|
52
|
-
CLIENT_POS: MousePosKey;
|
|
53
|
-
CLIENT_SIZE: ElementDimension;
|
|
54
|
-
CONTRA: DOMRectKey;
|
|
55
|
-
CONTRA_CLIENT_POS: MousePosKey;
|
|
56
|
-
CONTRA_END: DOMRectDimensionKey;
|
|
57
|
-
CONTRA_POS: ElementPosition;
|
|
58
|
-
DIMENSION: DOMRectDimensionKey;
|
|
59
|
-
END: DOMRectKey;
|
|
60
|
-
POS: ElementPosition;
|
|
61
|
-
SCROLL_POS: ElementDimension;
|
|
62
|
-
SCROLL_SIZE: ElementDimension;
|
|
63
|
-
START: DOMRectKey;
|
|
64
|
-
};
|
|
65
|
-
export declare const getItemById: (measuredItems: MeasuredDropTarget[], id: string) => MeasuredDropTarget | undefined;
|
|
66
|
-
export declare const removeDraggedItem: (measuredItems: MeasuredDropTarget[], index: number) => void;
|
|
67
|
-
export type dropZone = "start" | "end";
|
|
68
|
-
export declare const measureDropTargets: (container: HTMLElement, orientation: orientationType, itemQuery?: string, viewportRange?: ViewportRange, draggedItemId?: string) => MeasuredDropTarget[];
|
|
69
|
-
export declare const getIndexOfDraggedItem: (dropTargets: MeasuredDropTarget[]) => number;
|
|
70
|
-
export declare const mutateDropTargetsSwitchDropTargetPosition: (dropTargets: MeasuredDropTarget[], direction: Direction) => void;
|
|
71
|
-
export declare const getNextDropTarget: (dropTargets: MeasuredDropTarget[], pos: number, draggedItemSize: number, mouseMoveDirection: Direction) => MeasuredDropTarget;
|
|
72
|
-
/**
|
|
73
|
-
* An item within a scrollable container might have a width or height greater than that of
|
|
74
|
-
* the container. If we drag such an item, we don't want the draggable to be larger than
|
|
75
|
-
* the container.
|
|
76
|
-
*/
|
|
77
|
-
export declare function constrainRect(targetRect: Rect, constraintRect: Rect): Rect;
|
|
78
|
-
export declare const dropTargetsDebugString: (dropTargets: MeasuredDropTarget[]) => string;
|
|
79
|
-
export declare const getItemParentContainer: (container: HTMLElement | null, itemQuery: string) => HTMLElement | null;
|
|
80
|
-
export declare const getScrollableContainer: (container: HTMLElement | null, itemQuery: string) => HTMLElement | null;
|
|
81
|
-
export declare const isContainerScrollable: (scrollableContainer: HTMLElement | null, orientation: orientationType) => boolean;
|
|
82
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
|
-
export type ScrollStopHandler = (scrollDirection: "fwd" | "bwd", scrollPos: number, atEnd: boolean) => void;
|
|
3
|
-
export declare const useAutoScroll: ({ containerRef, onScrollingStopped, orientation, }: {
|
|
4
|
-
containerRef: RefObject<HTMLElement | null>;
|
|
5
|
-
onScrollingStopped?: ScrollStopHandler;
|
|
6
|
-
orientation?: "horizontal" | "vertical";
|
|
7
|
-
}) => {
|
|
8
|
-
isScrolling: RefObject<boolean>;
|
|
9
|
-
startScrolling: (direction: "fwd" | "bwd", scrollRate: number, scrollUnit?: number) => void;
|
|
10
|
-
stopScrolling: (atEnd?: boolean) => void;
|
|
11
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { orientationType } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import { Direction } from "./dragDropTypes";
|
|
3
|
-
import { MeasuredDropTarget } from "./drop-target-utils";
|
|
4
|
-
export type DragDisplacersHookResult = {
|
|
5
|
-
displaceItem: (dropTargets: MeasuredDropTarget[], dropTarget: MeasuredDropTarget, size: number, useTransition?: boolean, direction?: Direction | "static", orientation?: "horizontal" | "vertical") => number;
|
|
6
|
-
displaceLastItem: (dropTargets: MeasuredDropTarget[], dropTarget: MeasuredDropTarget, size: number, useTransition?: boolean, direction?: Direction | "static", orientation?: "horizontal" | "vertical") => number;
|
|
7
|
-
clearSpacers: (useAnimation?: boolean) => void;
|
|
8
|
-
/** Insert the sized spacer at start or end of collection */
|
|
9
|
-
setTerminalSpacer: (container: HTMLElement, position: "start" | "end", size: number) => void;
|
|
10
|
-
};
|
|
11
|
-
export type DragDisplacersHook = (orientation: orientationType) => DragDisplacersHookResult;
|
|
12
|
-
/**
|
|
13
|
-
* Manage a pair of displacer elements to smoothly display a moving gap between
|
|
14
|
-
* list items of any kind. Designed to be used in a drag drop operation. The 'static'
|
|
15
|
-
* direction option should be used at drag start or following scroll.
|
|
16
|
-
*/
|
|
17
|
-
export declare const useDragDisplacers: DragDisplacersHook;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { InternalDragDropProps, InternalDragHookResult } from "./dragDropTypes";
|
|
2
|
-
export declare const NULL_DROP_OPTIONS: {
|
|
3
|
-
readonly fromIndex: -1;
|
|
4
|
-
readonly toIndex: -1;
|
|
5
|
-
};
|
|
6
|
-
export declare const useDragDropCopy: ({ selected, viewportRange, }: InternalDragDropProps) => InternalDragHookResult;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { dropZone, MeasuredDropTarget } from "./drop-target-utils";
|
|
2
|
-
export declare const SPACER_SIZE = 0;
|
|
3
|
-
export type DropIndicatorHookResult = {
|
|
4
|
-
positionDropIndicator: (dropTarget: MeasuredDropTarget, dropZone: dropZone) => HTMLElement;
|
|
5
|
-
clearSpacer: () => void;
|
|
6
|
-
};
|
|
7
|
-
export type DropIndicatorHook = () => DropIndicatorHookResult;
|
|
8
|
-
export declare const useDropIndicator: DropIndicatorHook;
|