@vuu-ui/vuu-ui-controls 3.3.8 → 3.3.10
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 +10 -10
- package/types/src/calendar/Calendar.d.ts +13 -0
- package/types/src/calendar/index.d.ts +4 -0
- package/types/src/calendar/internal/CalendarCarousel.d.ts +3 -0
- package/types/src/calendar/internal/CalendarContext.d.ts +8 -0
- package/types/src/calendar/internal/CalendarDay.d.ts +14 -0
- package/types/src/calendar/internal/CalendarMonth.d.ts +10 -0
- package/types/src/calendar/internal/CalendarNavigation.d.ts +16 -0
- package/types/src/calendar/internal/CalendarWeekHeader.d.ts +3 -0
- package/types/src/calendar/internal/useFocusManagement.d.ts +9 -0
- package/types/src/calendar/internal/utils.d.ts +15 -0
- package/types/src/calendar/useCalendar.d.ts +54 -0
- package/types/src/calendar/useCalendarDay.d.ts +22 -0
- package/types/src/calendar/useSelection.d.ts +78 -0
- package/types/src/column-picker/ColumnPicker.d.ts +7 -0
- package/types/src/column-picker/ColumnSearch.d.ts +12 -0
- package/types/src/column-picker/index.d.ts +2 -0
- package/types/src/column-picker/moving-window.d.ts +14 -0
- package/types/src/common-hooks/index.d.ts +3 -0
- package/types/src/common-hooks/selectionTypes.d.ts +70 -0
- package/types/src/common-hooks/use-resize-observer.d.ts +16 -0
- package/types/src/common-hooks/useControlled.d.ts +24 -0
- package/types/src/context-panel-provider/ContextPanelProvider.d.ts +17 -0
- package/types/src/cycle-state-button/CycleStateButton.d.ts +11 -0
- package/types/src/cycle-state-button/index.d.ts +1 -0
- package/types/src/date-input/DateInput.d.ts +60 -0
- package/types/src/date-input/index.d.ts +1 -0
- package/types/src/date-picker/DatePicker.d.ts +66 -0
- package/types/src/date-picker/DatePickerContext.d.ts +19 -0
- package/types/src/date-picker/DatePickerPanel.d.ts +10 -0
- package/types/src/date-picker/index.d.ts +1 -0
- package/types/src/drag-drop/DragDropProvider.d.ts +38 -0
- package/types/src/drag-drop/DragDropState.d.ts +15 -0
- package/types/src/drag-drop/Draggable.d.ts +13 -0
- package/types/src/drag-drop/DropIndicator.d.ts +5 -0
- package/types/src/drag-drop/dragDropTypes.d.ts +100 -0
- package/types/src/drag-drop/drop-target-utils.d.ts +82 -0
- package/types/src/drag-drop/index.d.ts +6 -0
- package/types/src/drag-drop/useAutoScroll.d.ts +11 -0
- package/types/src/drag-drop/useDragDisplacers.d.ts +17 -0
- package/types/src/drag-drop/useDragDrop.d.ts +2 -0
- package/types/src/drag-drop/useDragDropCopy.d.ts +6 -0
- package/types/src/drag-drop/useDragDropIndicator.d.ts +2 -0
- package/types/src/drag-drop/useDragDropNaturalMovement.d.ts +2 -0
- package/types/src/drag-drop/useDropIndicator.d.ts +8 -0
- package/types/src/drag-drop/useGlobalDragDrop.d.ts +11 -0
- package/types/src/drag-drop/useTransition.d.ts +3 -0
- package/types/src/editable/index.d.ts +1 -0
- package/types/src/editable/useEditableText.d.ts +21 -0
- package/types/src/editable-label/EditableLabel.d.ts +19 -0
- package/types/src/editable-label/index.d.ts +1 -0
- package/types/src/expando-input/ExpandoInput.d.ts +6 -0
- package/types/src/expando-input/index.d.ts +1 -0
- package/types/src/highlighter/Highlighter.d.ts +6 -0
- package/types/src/highlighter/index.d.ts +1 -0
- package/types/src/hover-overlay/HoverOverlay.d.ts +8 -0
- package/types/src/icon-button/Icon.d.ts +6 -0
- package/types/src/icon-button/IconButton.d.ts +6 -0
- package/types/src/icon-button/ToggleIconButton.d.ts +5 -0
- package/types/src/icon-button/index.d.ts +3 -0
- package/types/src/index.d.ts +33 -0
- package/types/src/instrument-picker/SearchCell.d.ts +2 -0
- package/types/src/instrument-picker/TablePicker.d.ts +11 -0
- package/types/src/instrument-picker/index.d.ts +1 -0
- package/types/src/instrument-picker/moving-window.d.ts +14 -0
- package/types/src/instrument-picker/useDataSource.d.ts +6 -0
- package/types/src/instrument-picker/useTablePicker.d.ts +47 -0
- package/types/src/item-picker/ItemPicker.d.ts +14 -0
- package/types/src/item-picker/useItemPicker.d.ts +35 -0
- package/types/src/measured-container/MeasuredContainer.d.ts +16 -0
- package/types/src/measured-container/index.d.ts +2 -0
- package/types/src/measured-container/useMeasuredContainer.d.ts +23 -0
- package/types/src/modal-provider/ModalProvider.d.ts +13 -0
- package/types/src/overflow-container/OverflowContainer.d.ts +15 -0
- package/types/src/overflow-container/index.d.ts +2 -0
- package/types/src/overflow-container/overflow-utils.d.ts +48 -0
- package/types/src/overflow-container/useOverflowContainer.d.ts +19 -0
- package/types/src/price-ticker/PriceTicker.d.ts +7 -0
- package/types/src/price-ticker/index.d.ts +1 -0
- package/types/src/prompt/Prompt.d.ts +53 -0
- package/types/src/sortable-list/SortableList.d.ts +8 -0
- package/types/src/split-button/SplitButton.d.ts +11 -0
- package/types/src/split-button/SplitStateButton.d.ts +5 -0
- package/types/src/split-button/index.d.ts +2 -0
- package/types/src/split-button/useSplitButton.d.ts +311 -0
- package/types/src/table-search/SearchCell.d.ts +2 -0
- package/types/src/table-search/TableSearch.d.ts +9 -0
- package/types/src/table-search/index.d.ts +1 -0
- package/types/src/table-search/moving-window.d.ts +14 -0
- package/types/src/table-search/useTableSearch.d.ts +15 -0
- package/types/src/tabs-next/TabBar.d.ts +12 -0
- package/types/src/tabs-next/TabListNext.d.ts +12 -0
- package/types/src/tabs-next/TabNext.d.ts +12 -0
- package/types/src/tabs-next/TabNextAction.d.ts +5 -0
- package/types/src/tabs-next/TabNextContext.d.ts +12 -0
- package/types/src/tabs-next/TabNextPanel.d.ts +8 -0
- package/types/src/tabs-next/TabNextTrigger.d.ts +5 -0
- package/types/src/tabs-next/TabOverflowList.d.ts +11 -0
- package/types/src/tabs-next/TabsNext.d.ts +17 -0
- package/types/src/tabs-next/TabsNextContext.d.ts +21 -0
- package/types/src/tabs-next/hooks/useCollection.d.ts +18 -0
- package/types/src/tabs-next/hooks/useFocusOutside.d.ts +2 -0
- package/types/src/tabs-next/hooks/useOverflow.d.ts +11 -0
- package/types/src/tabs-next/index.d.ts +7 -0
- package/types/src/tabstrip/Tab.d.ts +27 -0
- package/types/src/tabstrip/TabMenu.d.ts +23 -0
- package/types/src/tabstrip/TabMenuOptions.d.ts +10 -0
- package/types/src/tabstrip/TabsTypes.d.ts +127 -0
- package/types/src/tabstrip/Tabstrip.d.ts +3 -0
- package/types/src/tabstrip/index.d.ts +5 -0
- package/types/src/tabstrip/tabstrip-dom-utils.d.ts +2 -0
- package/types/src/tabstrip/useAnimatedSelectionThumb.d.ts +7 -0
- package/types/src/tabstrip/useKeyboardNavigation.d.ts +29 -0
- package/types/src/tabstrip/useSelection.d.ts +13 -0
- package/types/src/tabstrip/useTabstrip.d.ts +55 -0
- package/types/src/time-input/MaskedInput.d.ts +49 -0
- package/types/src/time-input/TimeInput.d.ts +5 -0
- package/types/src/time-input/useTimeInput.d.ts +21 -0
- package/types/src/toolbar/Toolbar.d.ts +20 -0
- package/types/src/toolbar/index.d.ts +1 -0
- package/types/src/toolbar/toolbar-dom-utils.d.ts +3 -0
- package/types/src/toolbar/useKeyboardNavigation.d.ts +32 -0
- package/types/src/toolbar/useSelection.d.ts +22 -0
- package/types/src/toolbar/useToolbar.d.ts +28 -0
- package/types/src/utils/deprecated-types.d.ts +2 -0
- package/types/src/utils/escapeRegExp.d.ts +1 -0
- package/types/src/utils/forwardCallbackProps.d.ts +3 -0
- package/types/src/utils/index.d.ts +5 -0
- package/types/src/utils/isOverflowElement.d.ts +1 -0
- package/types/src/utils/isPlainObject.d.ts +1 -0
- package/types/src/vuu-date-picker/VuuDatePicker.d.ts +7 -0
- package/types/src/vuu-date-picker/index.d.ts +1 -0
- package/types/src/vuu-input/VuuInput.d.ts +18 -0
- package/types/src/vuu-input/index.d.ts +1 -0
- package/types/src/vuu-time-picker/TimeRangePicker.d.ts +0 -0
- package/types/src/vuu-time-picker/VuuTimePicker.d.ts +7 -0
- package/types/src/vuu-typeahead-input/VuuTypeaheadInput.d.ts +6 -0
- package/types/src/vuu-typeahead-input/index.d.ts +1 -0
- package/types/src/vuu-typeahead-input/useVuuTypeaheadInput.d.ts +49 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { orientationType } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { FocusEvent, FocusEventHandler, KeyboardEvent, MouseEvent as ReactMouseEvent, MouseEventHandler, RefObject } from "react";
|
|
3
|
+
import { NavigationOutOfBoundsHandler } from "./Toolbar";
|
|
4
|
+
import { MenuCloseHandler } from "@vuu-ui/vuu-popups";
|
|
5
|
+
export interface ContainerNavigationProps {
|
|
6
|
+
onBlur: FocusEventHandler;
|
|
7
|
+
onFocus: FocusEventHandler;
|
|
8
|
+
onMouseDownCapture: MouseEventHandler;
|
|
9
|
+
onMouseLeave: MouseEventHandler;
|
|
10
|
+
}
|
|
11
|
+
interface ToolbarNavigationHookProps {
|
|
12
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
13
|
+
defaultHighlightedIdx?: number;
|
|
14
|
+
highlightedIdx?: number;
|
|
15
|
+
onNavigateOutOfBounds?: NavigationOutOfBoundsHandler;
|
|
16
|
+
orientation: orientationType;
|
|
17
|
+
}
|
|
18
|
+
interface ToolbarNavigationHookResult {
|
|
19
|
+
containerProps: ContainerNavigationProps;
|
|
20
|
+
focusableIdx: number;
|
|
21
|
+
highlightedIdx: number;
|
|
22
|
+
focusItem: (itemIndex: number, immediateFocus?: boolean, withKeyboard?: boolean, delay?: number) => void;
|
|
23
|
+
focusVisible: number;
|
|
24
|
+
focusIsWithinComponent: boolean;
|
|
25
|
+
onClick: (evt: ReactMouseEvent, tabIndex: number) => void;
|
|
26
|
+
onFocus: (evt: FocusEvent<HTMLElement>) => void;
|
|
27
|
+
onKeyDown: (evt: KeyboardEvent) => void;
|
|
28
|
+
onOverflowMenuClose?: MenuCloseHandler;
|
|
29
|
+
setHighlightedIdx: (highlightedIndex: number) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare const useKeyboardNavigation: ({ containerRef, defaultHighlightedIdx, highlightedIdx: highlightedIdxProp, onNavigateOutOfBounds, orientation, }: ToolbarNavigationHookProps) => ToolbarNavigationHookResult;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MouseEvent, RefObject } from "react";
|
|
2
|
+
import { SelectionStrategy, SpecialKeyMultipleSelection } from "../common-hooks";
|
|
3
|
+
export interface SelectionHookProps {
|
|
4
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
5
|
+
defaultSelected?: number[];
|
|
6
|
+
highlightedIdx: number;
|
|
7
|
+
itemQuery: string;
|
|
8
|
+
onSelectionChange?: (selectedIndices: number[]) => void;
|
|
9
|
+
selected?: number[];
|
|
10
|
+
selectionStrategy: SelectionStrategy | SpecialKeyMultipleSelection;
|
|
11
|
+
}
|
|
12
|
+
export interface ItemHandlers {
|
|
13
|
+
onClick?: (e: MouseEvent, itemIndex: number) => void;
|
|
14
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface SelectionHookResult {
|
|
17
|
+
activateItem: (tabIndex: number) => void;
|
|
18
|
+
itemHandlers: ItemHandlers;
|
|
19
|
+
isControlled: boolean;
|
|
20
|
+
selected: number[];
|
|
21
|
+
}
|
|
22
|
+
export declare const useSelection: ({ defaultSelected, highlightedIdx, onSelectionChange, selected: selectedProp, selectionStrategy, }: SelectionHookProps) => SelectionHookResult;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { KeyboardEvent, MouseEvent as ReactMouseEvent, RefObject } from "react";
|
|
2
|
+
import { OverflowItem } from "../overflow-container";
|
|
3
|
+
import { ToolbarProps } from "./Toolbar";
|
|
4
|
+
export interface ToolbarHookProps extends Pick<ToolbarProps, "activeItemIndex" | "defaultActiveItemIndex" | "onActiveChange" | "onNavigateOutOfBounds">, Required<Pick<ToolbarProps, "orientation" | "selectionStrategy">> {
|
|
5
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
6
|
+
itemQuery?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const useToolbar: ({ activeItemIndex: activeItemIndexProp, defaultActiveItemIndex, containerRef, itemQuery, onActiveChange, onNavigateOutOfBounds, orientation, selectionStrategy, }: ToolbarHookProps) => {
|
|
9
|
+
activeItemIndex: number[];
|
|
10
|
+
focusableIdx: number;
|
|
11
|
+
focusVisible: number;
|
|
12
|
+
containerProps: {
|
|
13
|
+
onBlur: import("react").FocusEventHandler;
|
|
14
|
+
onFocus: import("react").FocusEventHandler;
|
|
15
|
+
onMouseDownCapture: import("react").MouseEventHandler;
|
|
16
|
+
onMouseLeave: import("react").MouseEventHandler;
|
|
17
|
+
PopupMenuProps: {
|
|
18
|
+
onKeyDown: (evt: KeyboardEvent) => void;
|
|
19
|
+
onMenuClose: import("@vuu-ui/vuu-popups").MenuCloseHandler | undefined;
|
|
20
|
+
};
|
|
21
|
+
onSwitchWrappedItemIntoView: (item: OverflowItem) => void;
|
|
22
|
+
};
|
|
23
|
+
itemProps: {
|
|
24
|
+
onClick: (evt: ReactMouseEvent<HTMLElement>) => void;
|
|
25
|
+
onFocus: (evt: import("react").FocusEvent<HTMLElement>) => void;
|
|
26
|
+
onKeyDown: (evt: KeyboardEvent) => void;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function escapeRegExp(string: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isOverflowElement: (element: HTMLElement | null) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isPlainObject: (obj: Record<never, never>) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommitHandler } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { SingleSelectionValueType } from "../calendar";
|
|
3
|
+
import { DatePickerProps } from "../date-picker";
|
|
4
|
+
export declare const VuuDatePicker: ({ className, onSelectionChange, selectedDate: selectedDateProp, onCommit, preserveFocusOnSelect, ...props }: Omit<DatePickerProps<SingleSelectionValueType>, "defaultSelectedDate"> & {
|
|
5
|
+
onCommit?: CommitHandler<HTMLElement, number>;
|
|
6
|
+
preserveFocusOnSelect?: boolean;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./VuuDatePicker";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import { CommitHandler } from "@vuu-ui/vuu-utils";
|
|
3
|
+
import { InputProps } from "@salt-ds/core";
|
|
4
|
+
import { ForwardedRef, ReactElement, ReactNode } from "react";
|
|
5
|
+
export interface VuuInputProps<T extends VuuRowDataItemType = string> extends Omit<InputProps, "validationStatus"> {
|
|
6
|
+
commitOnBlur?: boolean;
|
|
7
|
+
commitWhenCleared?: boolean;
|
|
8
|
+
errorMessage?: ReactNode;
|
|
9
|
+
onCommit: CommitHandler;
|
|
10
|
+
type?: T;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A variant of Salt Input that provides a commit callback prop,
|
|
14
|
+
* TODO along with cancel behaviour ?
|
|
15
|
+
*/
|
|
16
|
+
export declare const VuuInput: <T extends VuuRowDataItemType = string>(props: VuuInputProps<T> & {
|
|
17
|
+
ref?: ForwardedRef<HTMLDivElement>;
|
|
18
|
+
}) => ReactElement<VuuInputProps<T>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./VuuInput";
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommitHandler, TimeString } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
import { TimeInputProps } from "../time-input/TimeInput";
|
|
4
|
+
export interface VuuTimePickerProps extends Pick<TimeInputProps, "defaultValue" | "onChange" | "value">, Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "value"> {
|
|
5
|
+
onCommit: CommitHandler<HTMLInputElement, TimeString>;
|
|
6
|
+
}
|
|
7
|
+
export declare const VuuTimePicker: ({ className, defaultValue, onChange, onCommit, value, ...htmlAttributes }: VuuTimePickerProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComboBoxProps } from "@salt-ds/core";
|
|
2
|
+
import { VuuTypeaheadInputHookProps } from "./useVuuTypeaheadInput";
|
|
3
|
+
export interface VuuTypeaheadInputProps extends VuuTypeaheadInputHookProps, Pick<ComboBoxProps, "selectOnTab"> {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const VuuTypeaheadInput: ({ allowFreeInput, className, column, freeTextWarning, highlightFirstSuggestion, inputProps: inputPropsProp, minCharacterCountToTriggerSuggestions, onCommit, selectOnTab, table, }: VuuTypeaheadInputProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./VuuTypeaheadInput";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PillInputProps } from "@salt-ds/core/dist-types/pill-input";
|
|
2
|
+
import { TableSchemaTable } from "@vuu-ui/vuu-data-types";
|
|
3
|
+
import { type CommitHandler } from "@vuu-ui/vuu-utils";
|
|
4
|
+
import { KeyboardEventHandler, type ChangeEventHandler, type RefCallback, type SyntheticEvent } from "react";
|
|
5
|
+
export interface VuuTypeaheadInputHookProps {
|
|
6
|
+
/**
|
|
7
|
+
* Allows a text string to be submitted that does not match any suggestion
|
|
8
|
+
* Defaults to true
|
|
9
|
+
*/
|
|
10
|
+
allowFreeInput?: boolean;
|
|
11
|
+
column: string;
|
|
12
|
+
/**
|
|
13
|
+
* A warning to display to the user if allowFreeText is false and they attempt
|
|
14
|
+
* to commit text which does not match any suggestions. A default message will
|
|
15
|
+
* be shown if not provided
|
|
16
|
+
*/
|
|
17
|
+
freeTextWarning?: string;
|
|
18
|
+
/**
|
|
19
|
+
* When suggestions are displayed, should first option be highlighted ?
|
|
20
|
+
* Highlighted option will be selected if Enter pressed. If this option
|
|
21
|
+
* is not applied and no suggestion is highlighted, Enter will commit
|
|
22
|
+
* current text. This will be desirable if filter operator will be
|
|
23
|
+
* 'contains', not if filter operator will be '='.
|
|
24
|
+
*/
|
|
25
|
+
highlightFirstSuggestion?: boolean;
|
|
26
|
+
inputProps?: PillInputProps["inputProps"];
|
|
27
|
+
/**
|
|
28
|
+
* If zero, suggestions will be shown even without any text input.
|
|
29
|
+
* Suggestions will be displayed on click, or, if focused via keynoard,
|
|
30
|
+
* on ArrowDown.
|
|
31
|
+
* If n, where n > 0, then n characters must be typed before suggestion
|
|
32
|
+
* list will be fetched.
|
|
33
|
+
*/
|
|
34
|
+
minCharacterCountToTriggerSuggestions?: 0 | 1 | 2 | 3;
|
|
35
|
+
onCommit: CommitHandler<HTMLInputElement>;
|
|
36
|
+
table: TableSchemaTable;
|
|
37
|
+
}
|
|
38
|
+
export declare const useVuuTypeaheadInput: ({ allowFreeInput, column, freeTextWarning, highlightFirstSuggestion, inputProps: inputPropsProp, minCharacterCountToTriggerSuggestions, onCommit, table, }: VuuTypeaheadInputHookProps) => {
|
|
39
|
+
inputProps: Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">;
|
|
40
|
+
noFreeText: string;
|
|
41
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
42
|
+
onKeyDown: KeyboardEventHandler<HTMLInputElement>;
|
|
43
|
+
onOpenChange: (newOpen: boolean) => void;
|
|
44
|
+
onSelectionChange: (evt: SyntheticEvent, [newSelected]: string[]) => void;
|
|
45
|
+
open: boolean;
|
|
46
|
+
ref: RefCallback<HTMLDivElement>;
|
|
47
|
+
typeaheadValues: string[];
|
|
48
|
+
value: string;
|
|
49
|
+
};
|