@vuu-ui/vuu-ui-controls 0.8.10-debug → 0.8.11-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 +1188 -939
- package/cjs/index.js.map +4 -4
- package/esm/index.js +1052 -797
- package/esm/index.js.map +4 -4
- package/index.css +35 -3
- package/index.css.map +3 -3
- package/package.json +8 -8
- package/types/combo-box/ComboBox.d.ts +19 -0
- package/types/combo-box/useCombobox.d.ts +25 -0
- package/types/{vuu-ui-controls/src/common-hooks → common-hooks}/collectionTypes.d.ts +4 -4
- package/types/{vuu-ui-controls/src/common-hooks → common-hooks}/navigationTypes.d.ts +2 -3
- package/types/{vuu-ui-controls/src/common-hooks → common-hooks}/selectionTypes.d.ts +30 -14
- package/types/common-hooks/useSelection.d.ts +8 -0
- package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/drop-target-utils.d.ts +6 -6
- package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/useDragDisplacers.d.ts +2 -2
- package/types/dropdown/Dropdown.d.ts +10 -0
- package/types/{vuu-ui-controls/src/dropdown → dropdown}/dropdownTypes.d.ts +9 -4
- package/types/{vuu-ui-controls/src/dropdown → dropdown}/useClickAway.d.ts +2 -1
- package/types/dropdown/useDropdown.d.ts +13 -0
- package/types/{vuu-ui-controls/src/index.d.ts → index.d.ts} +1 -0
- package/types/instrument-picker/InstrumentPicker.d.ts +16 -0
- package/types/instrument-picker/index.d.ts +1 -0
- package/types/{vuu-ui-controls/src/instrument-search → instrument-picker}/useDataSource.d.ts +1 -1
- package/types/instrument-picker/useInstrumentPicker.d.ts +24 -0
- package/types/instrument-search/SearchCell.d.ts +4 -0
- package/types/instrument-search/moving-window.d.ts +14 -0
- package/types/instrument-search/useDataSource.d.ts +7 -0
- package/types/list/List.d.ts +7 -0
- package/types/list/common-hooks/useKeyboardNavigation.d.ts +3 -0
- package/types/list/common-hooks/utils/isSelected.d.ts +2 -0
- package/types/{vuu-ui-controls/src/list → list}/listTypes.d.ts +6 -12
- package/types/list/useList.d.ts +3 -0
- package/types/list/useListDrop.d.ts +15 -0
- package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/Tab.d.ts +1 -1
- package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/TabMenuOptions.d.ts +1 -1
- package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/TabsTypes.d.ts +1 -1
- package/types/vuu-input/VuuInput.d.ts +13 -0
- package/types/vuu-popups/src/dialog/Dialog.d.ts +0 -8
- package/types/vuu-popups/src/dialog/index.d.ts +0 -1
- package/types/vuu-popups/src/index.d.ts +0 -8
- package/types/vuu-popups/src/menu/ContextMenu.d.ts +0 -16
- package/types/vuu-popups/src/menu/MenuList.d.ts +0 -43
- package/types/vuu-popups/src/menu/context-menu-provider.d.ts +0 -10
- package/types/vuu-popups/src/menu/index.d.ts +0 -4
- package/types/vuu-popups/src/menu/key-code.d.ts +0 -12
- package/types/vuu-popups/src/menu/list-dom-utils.d.ts +0 -4
- package/types/vuu-popups/src/menu/use-cascade.d.ts +0 -25
- package/types/vuu-popups/src/menu/use-items-with-ids-next.d.ts +0 -13
- package/types/vuu-popups/src/menu/use-keyboard-navigation.d.ts +0 -27
- package/types/vuu-popups/src/menu/useContextMenu.d.ts +0 -20
- package/types/vuu-popups/src/menu/utils.d.ts +0 -2
- package/types/vuu-popups/src/popup/Popup.d.ts +0 -10
- package/types/vuu-popups/src/popup/index.d.ts +0 -3
- package/types/vuu-popups/src/popup/popup-service.d.ts +0 -59
- package/types/vuu-popups/src/popup/useAnchoredPosition.d.ts +0 -12
- package/types/vuu-popups/src/popup-menu/PopupMenu.d.ts +0 -16
- package/types/vuu-popups/src/popup-menu/index.d.ts +0 -1
- package/types/vuu-popups/src/portal/Portal.d.ts +0 -30
- package/types/vuu-popups/src/portal/index.d.ts +0 -1
- package/types/vuu-popups/src/portal-deprecated/PortalDeprecated.d.ts +0 -8
- package/types/vuu-popups/src/portal-deprecated/index.d.ts +0 -3
- package/types/vuu-popups/src/portal-deprecated/portal-utils.d.ts +0 -1
- package/types/vuu-popups/src/portal-deprecated/render-portal.d.ts +0 -10
- package/types/vuu-popups/src/prompt/Prompt.d.ts +0 -14
- package/types/vuu-popups/src/prompt/index.d.ts +0 -1
- package/types/vuu-popups/src/tooltip/Tooltip.d.ts +0 -12
- package/types/vuu-popups/src/tooltip/index.d.ts +0 -2
- package/types/vuu-popups/src/tooltip/useAnchoredPosition.d.ts +0 -12
- package/types/vuu-popups/src/tooltip/useTooltip.d.ts +0 -16
- package/types/vuu-ui-controls/src/combo-box/ComboBox.d.ts +0 -18
- package/types/vuu-ui-controls/src/combo-box/useCombobox.d.ts +0 -22
- package/types/vuu-ui-controls/src/common-hooks/useSelection.d.ts +0 -8
- package/types/vuu-ui-controls/src/dropdown/Dropdown.d.ts +0 -10
- package/types/vuu-ui-controls/src/dropdown/useDropdown.d.ts +0 -13
- package/types/vuu-ui-controls/src/list/List.d.ts +0 -7
- package/types/vuu-ui-controls/src/list/common-hooks/useKeyboardNavigation.d.ts +0 -3
- package/types/vuu-ui-controls/src/list/common-hooks/utils/isSelected.d.ts +0 -2
- package/types/vuu-ui-controls/src/list/useList.d.ts +0 -3
- package/types/vuu-ui-controls/src/vuu-input/VuuInput.d.ts +0 -10
- package/types/vuu-utils/src/DataWindow.d.ts +0 -39
- package/types/vuu-utils/src/array-utils.d.ts +0 -6
- package/types/vuu-utils/src/box-utils.d.ts +0 -9
- package/types/vuu-utils/src/column-utils.d.ts +0 -130
- package/types/vuu-utils/src/common-types.d.ts +0 -6
- package/types/vuu-utils/src/component-registry.d.ts +0 -23
- package/types/vuu-utils/src/cookie-utils.d.ts +0 -1
- package/types/vuu-utils/src/data-utils.d.ts +0 -14
- package/types/vuu-utils/src/date-utils.d.ts +0 -7
- package/types/vuu-utils/src/debug-utils.d.ts +0 -9
- package/types/vuu-utils/src/event-emitter.d.ts +0 -13
- package/types/vuu-utils/src/filter-utils.d.ts +0 -14
- package/types/vuu-utils/src/formatting-utils.d.ts +0 -9
- package/types/vuu-utils/src/getUniqueId.d.ts +0 -1
- package/types/vuu-utils/src/group-utils.d.ts +0 -3
- package/types/vuu-utils/src/html-utils.d.ts +0 -12
- package/types/vuu-utils/src/index.d.ts +0 -34
- package/types/vuu-utils/src/input-utils.d.ts +0 -2
- package/types/vuu-utils/src/invariant.d.ts +0 -1
- package/types/vuu-utils/src/itemToString.d.ts +0 -2
- package/types/vuu-utils/src/json-utils.d.ts +0 -6
- package/types/vuu-utils/src/keyboard-utils.d.ts +0 -12
- package/types/vuu-utils/src/keyset.d.ts +0 -11
- package/types/vuu-utils/src/logging-utils.d.ts +0 -44
- package/types/vuu-utils/src/menu-utils.d.ts +0 -2
- package/types/vuu-utils/src/nanoid/index.d.ts +0 -1
- package/types/vuu-utils/src/perf-utils.d.ts +0 -5
- package/types/vuu-utils/src/range-utils.d.ts +0 -24
- package/types/vuu-utils/src/round-decimal.d.ts +0 -1
- package/types/vuu-utils/src/row-utils.d.ts +0 -7
- package/types/vuu-utils/src/screenshot-utils.d.ts +0 -6
- package/types/vuu-utils/src/selection-utils.d.ts +0 -27
- package/types/vuu-utils/src/sort-utils.d.ts +0 -5
- package/types/vuu-utils/src/text-utils.d.ts +0 -2
- package/types/vuu-utils/src/url-utils.d.ts +0 -2
- /package/types/{vuu-ui-controls/src/combo-box → combo-box}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/common-hooks → common-hooks}/collectionProvider.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/common-hooks → common-hooks}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/common-hooks → common-hooks}/itemToString.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/common-hooks → common-hooks}/use-resize-observer.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/common-hooks → common-hooks}/useCollectionItems.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/common-hooks → common-hooks}/useControlled.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/DragDropProvider.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/DragDropState.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/Draggable.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/DropIndicator.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/dragDropTypesNext.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/useAutoScroll.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/useDragDropIndicator.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/useDragDropNaturalMovementNext.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/useDragDropNext.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/useDropIndicator.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/useGlobalDragDrop.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/drag-drop → drag-drop}/useTransition.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/dropdown → dropdown}/DropdownBase.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/dropdown → dropdown}/DropdownButton.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/dropdown → dropdown}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/dropdown → dropdown}/useDropdownBase.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/editable → editable}/editable-utils.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/editable → editable}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/editable → editable}/useEditableText.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/editable-label → editable-label}/EditableLabel.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/editable-label → editable-label}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/expando-input → expando-input}/ExpandoInput.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/expando-input → expando-input}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/inputs → inputs}/Checkbox.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/inputs → inputs}/RadioButton.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/inputs → inputs}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/instrument-search → instrument-picker}/SearchCell.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/instrument-search → instrument-picker}/moving-window.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/instrument-search → instrument-search}/InstrumentSearch.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/instrument-search → instrument-search}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/CheckboxIcon.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/ChevronIcon.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/Highlighter.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/ListItem.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/ListItemGroup.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/ListItemHeader.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/RadioIcon.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/VirtualizedList.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/common-hooks/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/common-hooks/keyUtils.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/common-hooks/list-dom-utils.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/common-hooks/useCollapsibleGroups.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/common-hooks/useImperativeScrollingAPI.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/common-hooks/useTypeahead.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/common-hooks/useViewportTracking.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/common-hooks/utils/collection-item-utils.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/common-hooks/utils/filter-utils.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/common-hooks/utils/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/keyset.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/useListHeight.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/useScrollPosition.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/list → list}/useVirtualization.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/price-ticker → price-ticker}/PriceTicker.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/price-ticker → price-ticker}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/TabMenu.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/Tabstrip.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/tabstrip-dom-utils.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/useAnimatedSelectionThumb.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/useKeyboardNavigation.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/useSelection.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tabstrip → tabstrip}/useTabstrip.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/Tree.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/hierarchical-data-utils.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/key-code.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/list-dom-utils.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/use-collapsible-groups.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/use-hierarchical-data.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/use-items-with-ids.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/use-keyboard-navigation.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/use-selection.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/use-tree-keyboard-navigation.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/use-viewport-tracking.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/tree → tree}/useTree.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/utils → utils}/escapeRegExp.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/utils → utils}/forwardCallbackProps.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/utils → utils}/index.d.ts +0 -0
- /package/types/{vuu-ui-controls/src/vuu-input → vuu-input}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InstrumentPicker";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DataSource } from "@vuu-ui/vuu-data";
|
|
2
|
+
import { TableRowSelectHandler } from "@vuu-ui/vuu-table";
|
|
3
|
+
import { ColumnMap } from "@vuu-ui/vuu-utils";
|
|
4
|
+
import { ChangeEvent } from "react";
|
|
5
|
+
export interface InstrumentPickerHookProps {
|
|
6
|
+
columnMap: ColumnMap;
|
|
7
|
+
dataSource: DataSource;
|
|
8
|
+
defaultIsOpen?: boolean;
|
|
9
|
+
isOpen?: boolean;
|
|
10
|
+
onSelect: TableRowSelectHandler;
|
|
11
|
+
searchColumns: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare const useInstrumentPicker: ({ columnMap, dataSource, defaultIsOpen, isOpen: isOpenProp, onSelect, searchColumns, }: InstrumentPickerHookProps) => {
|
|
14
|
+
controlProps: {};
|
|
15
|
+
inputProps: {
|
|
16
|
+
onChange: (evt: ChangeEvent<HTMLInputElement>) => void;
|
|
17
|
+
};
|
|
18
|
+
isOpen: boolean;
|
|
19
|
+
onOpenChange: (open: any) => void;
|
|
20
|
+
tableHandlers: {
|
|
21
|
+
onSelect: TableRowSelectHandler;
|
|
22
|
+
};
|
|
23
|
+
value: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { VuuRange } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
export declare class MovingWindow {
|
|
4
|
+
data: DataSourceRow[];
|
|
5
|
+
rowCount: number;
|
|
6
|
+
private range;
|
|
7
|
+
constructor({ from, to }: VuuRange);
|
|
8
|
+
setRowCount: (rowCount: number) => void;
|
|
9
|
+
add(data: DataSourceRow): void;
|
|
10
|
+
getAtIndex(index: number): DataSourceRow | undefined;
|
|
11
|
+
isWithinRange(index: number): boolean;
|
|
12
|
+
setRange({ from, to }: VuuRange): void;
|
|
13
|
+
getSelectedRows(): DataSourceRow[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DataSource } from "@vuu-ui/vuu-data";
|
|
2
|
+
import { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
3
|
+
export interface DataSourceHookProps {
|
|
4
|
+
dataSource: DataSource;
|
|
5
|
+
instruments: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const useDataSource: ({ dataSource }: DataSourceHookProps) => DataSourceRow[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ForwardedRef, ReactElement } from "react";
|
|
2
|
+
import { SelectionStrategy } from "../common-hooks";
|
|
3
|
+
import { ListProps } from "./listTypes";
|
|
4
|
+
import "./List.css";
|
|
5
|
+
export declare const List: <Item = string, S extends SelectionStrategy = "default">(props: ListProps<Item, S> & {
|
|
6
|
+
ref?: ForwardedRef<HTMLDivElement> | undefined;
|
|
7
|
+
}) => ReactElement<ListProps<Item, "default">, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { NavigationHookProps, NavigationHookResult } from "../../common-hooks";
|
|
2
|
+
export declare const LIST_FOCUS_VISIBLE = -2;
|
|
3
|
+
export declare const useKeyboardNavigation: <Item>({ containerRef, defaultHighlightedIndex, disableHighlightOnFocus, highlightedIndex: highlightedIndexProp, indexPositions, itemCount, onHighlight, onKeyboardNavigation, restoreLastFocus, selected, viewportItemCount, }: NavigationHookProps<Item>) => NavigationHookResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FocusEventHandler, ForwardedRef, HTMLAttributes, KeyboardEvent, KeyboardEventHandler, MouseEventHandler, PropsWithChildren, Ref, RefObject } from "react";
|
|
2
2
|
import { ScrollingAPI, ViewportTrackingResult } from "./common-hooks";
|
|
3
|
-
import { CollectionHookResult, ListHandlers, NavigationHookResult,
|
|
3
|
+
import { CollectionHookResult, ComponentSelectionProps, ListHandlers, NavigationHookResult, SelectionHookResult, SelectionStrategy } from "../common-hooks";
|
|
4
4
|
import { DragHookResult, DragStartHandler, dragStrategy, DropHandler } from "../drag-drop";
|
|
5
5
|
import { ViewportRange } from "./useScrollPosition";
|
|
6
6
|
export type ComponentType<T = unknown> = (props: PropsWithChildren<T>) => JSX.Element;
|
|
@@ -32,7 +32,7 @@ export interface ListScrollHandles<Item> {
|
|
|
32
32
|
scrollToItem: (item: Item) => void;
|
|
33
33
|
scrollTo: (scrollOffset: number) => void;
|
|
34
34
|
}
|
|
35
|
-
export interface ListProps<Item = string,
|
|
35
|
+
export interface ListProps<Item = string, S extends SelectionStrategy = "default"> extends ComponentSelectionProps<Item, S>, Omit<HTMLAttributes<HTMLDivElement>, "onDragStart" | "onDrop" | "onSelect" | "defaultValue"> {
|
|
36
36
|
/**
|
|
37
37
|
* The component used to render a ListItem instead of the default. This must itself render a ListItem,
|
|
38
38
|
* must implement props that extend ListItemProps and must forward ListItem props to the ListItem.
|
|
@@ -146,11 +146,6 @@ export interface ListProps<Item = string, Selection extends SelectionStrategy =
|
|
|
146
146
|
*/
|
|
147
147
|
restoreLastFocus?: boolean;
|
|
148
148
|
scrollingApiRef?: ForwardedRef<ScrollingAPI<Item>>;
|
|
149
|
-
/**
|
|
150
|
-
* The keyboard keys used to effect selection, defaults to SPACE and ENTER
|
|
151
|
-
* TODO maybe this belongs on the SelectionProps interface ?
|
|
152
|
-
*/
|
|
153
|
-
selectionKeys?: string[];
|
|
154
149
|
showEmptyMessage?: boolean;
|
|
155
150
|
source?: ReadonlyArray<Item>;
|
|
156
151
|
stickyHeaders?: boolean;
|
|
@@ -176,11 +171,12 @@ export interface ListControlProps {
|
|
|
176
171
|
onMouseDownCapture: MouseEventHandler;
|
|
177
172
|
onMouseLeave: MouseEventHandler;
|
|
178
173
|
}
|
|
179
|
-
export interface ListHookProps<Item,
|
|
174
|
+
export interface ListHookProps<Item = string, S extends SelectionStrategy = "default"> extends Pick<ListProps<Item, S>, "allowDragDrop" | "collapsibleHeaders" | "disabled" | "id" | "onDragStart" | "onDrop" | "onHighlight" | "onMoveListItem" | "onSelect" | "onSelectionChange" | "restoreLastFocus" | "selectionKeys" | "selectionStrategy" | "stickyHeaders" | "tabToSelect"> {
|
|
180
175
|
collectionHook: CollectionHookResult<Item>;
|
|
181
176
|
containerRef: RefObject<HTMLElement>;
|
|
182
177
|
contentRef?: RefObject<HTMLElement>;
|
|
183
178
|
defaultHighlightedIndex?: number;
|
|
179
|
+
defaultSelected?: string[];
|
|
184
180
|
disableAriaActiveDescendant?: boolean;
|
|
185
181
|
disableHighlightOnFocus?: boolean;
|
|
186
182
|
disableTypeToSelect?: boolean;
|
|
@@ -190,13 +186,11 @@ export interface ListHookProps<Item, Selection extends SelectionStrategy> extend
|
|
|
190
186
|
listHandlers?: ListHandlers;
|
|
191
187
|
onKeyboardNavigation?: (event: React.KeyboardEvent, currentIndex: number) => void;
|
|
192
188
|
onKeyDown?: (evt: KeyboardEvent) => void;
|
|
193
|
-
onSelect?: SelectHandler<Item>;
|
|
194
|
-
onSelectionChange?: SelectionChangeHandler<Item, Selection>;
|
|
195
189
|
scrollContainerRef?: RefObject<HTMLElement>;
|
|
196
|
-
|
|
190
|
+
selected?: string[];
|
|
197
191
|
viewportRange?: ViewportRange;
|
|
198
192
|
}
|
|
199
|
-
export interface ListHookResult<Item
|
|
193
|
+
export interface ListHookResult<Item> extends Partial<ViewportTrackingResult<Item>>, Pick<SelectionHookResult, "selected" | "setSelected">, Partial<Omit<NavigationHookResult, "listProps">>, Omit<DragHookResult, "isDragging" | "isScrolling"> {
|
|
200
194
|
keyboardNavigation: RefObject<boolean>;
|
|
201
195
|
listHandlers: ListHandlers;
|
|
202
196
|
listItemHeaderHandlers: Partial<ListHandlers>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SelectionStrategy } from "../common-hooks";
|
|
2
|
+
import { ListHookProps, ListHookResult } from "./listTypes";
|
|
3
|
+
export declare const useList: <Item, S extends SelectionStrategy>({ allowDragDrop, collapsibleHeaders, collectionHook: dataHook, containerRef, contentRef, defaultHighlightedIndex, defaultSelected, disabled, disableAriaActiveDescendant, disableHighlightOnFocus, disableTypeToSelect, highlightedIndex: highlightedIndexProp, id, label, listHandlers: listHandlersProp, onDragStart, onDrop, onHighlight, onKeyboardNavigation, onKeyDown, onMoveListItem, onSelect, onSelectionChange, restoreLastFocus, scrollContainerRef, selected, selectionStrategy, selectionKeys, stickyHeaders, tabToSelect, viewportRange, }: ListHookProps<Item, S>) => ListHookResult<Item>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CollectionHookResult } from "../common-hooks";
|
|
2
|
+
import { DropHandler } from "../drag-drop";
|
|
3
|
+
import { MoveItemHandler } from "./listTypes";
|
|
4
|
+
export interface ListDropProps<Item = string> {
|
|
5
|
+
dataHook: CollectionHookResult<Item>;
|
|
6
|
+
onDrop?: DropHandler;
|
|
7
|
+
onMoveListItem?: MoveItemHandler;
|
|
8
|
+
selected: string[];
|
|
9
|
+
setHighlightedIndex: (idx: number) => void;
|
|
10
|
+
setSelected: (selected: string[]) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const useListDrop: <Item>({ dataHook, onDrop, onMoveListItem, selected, setHighlightedIndex, setSelected, }: ListDropProps<Item>) => {
|
|
13
|
+
handleDrop: DropHandler;
|
|
14
|
+
onDropSettle: (toIndex: number) => void;
|
|
15
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MenuActionHandler } from "
|
|
1
|
+
import { MenuActionHandler } from "@vuu-ui/vuu-data-types";
|
|
2
2
|
import { KeyboardEvent, MouseEvent } from "react";
|
|
3
3
|
import "./Tab.css";
|
|
4
4
|
export declare const Tab: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLElement>, "onKeyUp" | "onClick"> & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AriaAttributes, HTMLAttributes, KeyboardEvent, MouseEvent, ReactElement } from "react";
|
|
2
2
|
import { orientationType } from "@vuu-ui/vuu-utils";
|
|
3
3
|
import type { EditableLabelProps } from "../editable-label";
|
|
4
|
-
import type { MenuActionHandler } from "
|
|
4
|
+
import type { MenuActionHandler } from "@vuu-ui/vuu-data-types";
|
|
5
5
|
export type ExitEditModeHandler = (originalValue: string, editedValue: string, allowDeactivation: boolean, tabIndex: number) => void;
|
|
6
6
|
export interface FocusAPI {
|
|
7
7
|
focus: () => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import { InputProps } from "@salt-ds/core";
|
|
3
|
+
import { SyntheticEvent } from "react";
|
|
4
|
+
export type Commithandler<T extends VuuRowDataItemType = VuuRowDataItemType> = (evt: SyntheticEvent<HTMLInputElement>, value: T) => void;
|
|
5
|
+
export interface VuuInputProps<T extends VuuRowDataItemType = VuuRowDataItemType> extends InputProps {
|
|
6
|
+
onCommit: Commithandler<T>;
|
|
7
|
+
type?: T;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A variant of Salt Input that provides a commit callback prop,
|
|
11
|
+
* TODO along with cancel behaviour ?
|
|
12
|
+
*/
|
|
13
|
+
export declare const VuuInput: <T extends VuuRowDataItemType = string>({ className, onCommit, onKeyDown, type, ...props }: VuuInputProps<T>) => JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
2
|
-
import "./Dialog.css";
|
|
3
|
-
export interface DialogProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
isOpen?: boolean;
|
|
5
|
-
onClose?: () => void;
|
|
6
|
-
hideCloseButton?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const Dialog: ({ children, className, isOpen, onClose, title, hideCloseButton, ...props }: DialogProps) => JSX.Element | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Dialog";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { MenuListProps } from "./MenuList";
|
|
3
|
-
import { PopupCloseCallback } from "../popup";
|
|
4
|
-
import "./ContextMenu.css";
|
|
5
|
-
export interface ContextMenuProps extends Omit<MenuListProps, "onCloseMenu"> {
|
|
6
|
-
onClose?: PopupCloseCallback;
|
|
7
|
-
position?: {
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
};
|
|
11
|
-
withPortal?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const ContextMenu: {
|
|
14
|
-
({ activatedByKeyboard, children: childrenProp, className, id: idProp, onClose, position, style, ...menuListProps }: ContextMenuProps): JSX.Element;
|
|
15
|
-
displayName: string;
|
|
16
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React, { FC, HTMLAttributes, ReactElement, ReactNode } from "react";
|
|
2
|
-
import "./MenuList.css";
|
|
3
|
-
export declare const Separator: () => JSX.Element;
|
|
4
|
-
export interface MenuItemGroupProps {
|
|
5
|
-
children: ReactElement<MenuItemProps>[] | [ReactElement<MenuItemLabelProps>, ...ReactElement<MenuItemProps>[]];
|
|
6
|
-
label?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface MenuItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
-
action?: string;
|
|
10
|
-
idx?: number;
|
|
11
|
-
options?: unknown;
|
|
12
|
-
}
|
|
13
|
-
export declare const MenuItemGroup: FC<MenuItemGroupProps>;
|
|
14
|
-
export declare const MenuItem: {
|
|
15
|
-
({ children, idx, ...props }: MenuItemProps): JSX.Element;
|
|
16
|
-
Label: {
|
|
17
|
-
({ children }: {
|
|
18
|
-
children: ReactNode;
|
|
19
|
-
}): JSX.Element;
|
|
20
|
-
displayName: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export interface MenuItemLabelProps {
|
|
24
|
-
children: ReactNode;
|
|
25
|
-
}
|
|
26
|
-
export declare const isMenuItemLabel: (item: ReactNode) => item is React.ReactElement<MenuItemLabelProps, string | React.JSXElementConstructor<any>>;
|
|
27
|
-
export interface MenuListProps extends HTMLAttributes<HTMLDivElement> {
|
|
28
|
-
activatedByKeyboard?: boolean;
|
|
29
|
-
children: ReactElement[];
|
|
30
|
-
childMenuShowing?: string;
|
|
31
|
-
defaultHighlightedIdx?: number;
|
|
32
|
-
highlightedIdx?: number;
|
|
33
|
-
isRoot?: boolean;
|
|
34
|
-
listItemProps?: Partial<MenuItemProps>;
|
|
35
|
-
onActivate?: (menuId: string) => void;
|
|
36
|
-
onCloseMenu: (idx: number) => void;
|
|
37
|
-
onOpenMenu?: (menuItemEl: HTMLElement) => void;
|
|
38
|
-
onHighlightMenuItem?: (idx: number) => void;
|
|
39
|
-
}
|
|
40
|
-
export declare const MenuList: {
|
|
41
|
-
({ activatedByKeyboard, childMenuShowing, children, className, defaultHighlightedIdx, highlightedIdx: highlightedIdxProp, id: idProp, isRoot, listItemProps, onHighlightMenuItem, onActivate, onCloseMenu, onOpenMenu, ...props }: MenuListProps): JSX.Element;
|
|
42
|
-
displayName: string;
|
|
43
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ContextMenuContextType, MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
export declare const ContextMenuContext: import("react").Context<ContextMenuContextType | null>;
|
|
4
|
-
export interface ContextMenuProviderProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
label?: string;
|
|
7
|
-
menuActionHandler?: MenuActionHandler;
|
|
8
|
-
menuBuilder: MenuBuilder;
|
|
9
|
-
}
|
|
10
|
-
export declare const ContextMenuProvider: ({ children, label, menuActionHandler, menuBuilder, }: ContextMenuProviderProps) => JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const ArrowUp = "ArrowUp";
|
|
2
|
-
export declare const ArrowDown = "ArrowDown";
|
|
3
|
-
export declare const ArrowLeft = "ArrowLeft";
|
|
4
|
-
export declare const Backspace = "Backspace";
|
|
5
|
-
export declare const ArrowRight = "ArrowRight";
|
|
6
|
-
export declare const Enter = "Enter";
|
|
7
|
-
export declare const Escape = "Escape";
|
|
8
|
-
export declare const Delete = "Delete";
|
|
9
|
-
export declare const isCharacterKey: (evt: KeyboardEvent) => boolean | undefined;
|
|
10
|
-
export declare const isNavigationKey: ({ key }: {
|
|
11
|
-
key: string;
|
|
12
|
-
}, orientation?: string) => boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function listItemIndex(listItemEl: HTMLElement): number | undefined;
|
|
2
|
-
export declare const closestListItem: (el: HTMLElement | null | undefined) => HTMLElement;
|
|
3
|
-
export declare const closestListItemId: (el: HTMLElement) => string | undefined;
|
|
4
|
-
export declare const closestListItemIndex: (el: HTMLElement) => number | undefined;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from "react";
|
|
2
|
-
import { MenuItemProps } from "./MenuList";
|
|
3
|
-
export type RuntimeMenuDescriptor = {
|
|
4
|
-
id: string;
|
|
5
|
-
left: number;
|
|
6
|
-
top: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const getHostMenuId: (id: string, rootId: string) => string;
|
|
9
|
-
export interface CascadeHookProps {
|
|
10
|
-
id: string;
|
|
11
|
-
onActivate: (menuId: string) => void;
|
|
12
|
-
onMouseEnterItem: (evt: MouseEvent, itemId: string) => void;
|
|
13
|
-
position: {
|
|
14
|
-
x: number;
|
|
15
|
-
y: number;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export interface CascadeHooksResult {
|
|
19
|
-
closeMenu: () => void;
|
|
20
|
-
handleRender: () => void;
|
|
21
|
-
listItemProps: Partial<MenuItemProps>;
|
|
22
|
-
openMenu: (menuItemEl: HTMLElement) => void;
|
|
23
|
-
openMenus: RuntimeMenuDescriptor[];
|
|
24
|
-
}
|
|
25
|
-
export declare const useCascade: ({ id: rootId, onActivate, onMouseEnterItem, position: { x: posX, y: posY }, }: CascadeHookProps) => CascadeHooksResult;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
export declare const isMenuItemGroup: (child: ReactElement) => boolean;
|
|
3
|
-
type Menus = {
|
|
4
|
-
[key: string]: ReactElement[];
|
|
5
|
-
};
|
|
6
|
-
type Actions = {
|
|
7
|
-
[key: string]: {
|
|
8
|
-
action: string;
|
|
9
|
-
options?: unknown;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare const useItemsWithIdsNext: (childrenProp: ReactElement[], rootId: string) => [Menus, Actions];
|
|
13
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { FocusEvent, KeyboardEvent } from "react";
|
|
2
|
-
export interface KeyboardNavigationProps {
|
|
3
|
-
autoHighlightFirstItem?: boolean;
|
|
4
|
-
count: number;
|
|
5
|
-
defaultHighlightedIdx?: number;
|
|
6
|
-
highlightedIndex?: number;
|
|
7
|
-
onActivate: (idx: number) => void;
|
|
8
|
-
onHighlight?: (idx: number) => void;
|
|
9
|
-
onCloseMenu: (idx: number) => void;
|
|
10
|
-
onOpenMenu?: (menuItemEl: HTMLElement) => void;
|
|
11
|
-
}
|
|
12
|
-
export interface KeyboardHookListProps {
|
|
13
|
-
onFocus: (evt: FocusEvent) => void;
|
|
14
|
-
onKeyDown: (evt: KeyboardEvent) => void;
|
|
15
|
-
onMouseDownCapture: () => void;
|
|
16
|
-
onMouseMove: () => void;
|
|
17
|
-
onMouseLeave: () => void;
|
|
18
|
-
}
|
|
19
|
-
export interface NavigationHookResult {
|
|
20
|
-
focusVisible: number;
|
|
21
|
-
controlledHighlighting: boolean;
|
|
22
|
-
highlightedIndex: number;
|
|
23
|
-
setHighlightedIndex: (idx: number) => void;
|
|
24
|
-
listProps: KeyboardHookListProps;
|
|
25
|
-
setIgnoreFocus: (ignoreFocus: boolean) => void;
|
|
26
|
-
}
|
|
27
|
-
export declare const useKeyboardNavigation: ({ autoHighlightFirstItem, count, defaultHighlightedIdx, highlightedIndex: highlightedIndexProp, onActivate, onHighlight, onCloseMenu, onOpenMenu, }: KeyboardNavigationProps) => NavigationHookResult;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-data-types";
|
|
3
|
-
import { ContextMenuProps } from "./ContextMenu";
|
|
4
|
-
export type ContextMenuOptions = {
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
contextMenu?: JSX.Element;
|
|
7
|
-
ContextMenuProps?: Partial<ContextMenuProps> & {
|
|
8
|
-
className?: string;
|
|
9
|
-
"data-mode"?: string;
|
|
10
|
-
};
|
|
11
|
-
controlledComponentId?: string;
|
|
12
|
-
};
|
|
13
|
-
export type EventLike = {
|
|
14
|
-
clientX: number;
|
|
15
|
-
clientY: number;
|
|
16
|
-
preventDefault?: () => void;
|
|
17
|
-
stopPropagation?: () => void;
|
|
18
|
-
};
|
|
19
|
-
export type ShowContextMenu = (e: EventLike, location: string, options: ContextMenuOptions) => void;
|
|
20
|
-
export declare const useContextMenu: (menuBuilder?: MenuBuilder, menuActionHandler?: MenuActionHandler) => [ShowContextMenu, () => void];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, RefObject } from "react";
|
|
2
|
-
import "./Popup.css";
|
|
3
|
-
export type PopupPlacement = "below" | "below-center" | "below-full-width" | "center" | "right";
|
|
4
|
-
export interface PopupComponentProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
placement: PopupPlacement;
|
|
6
|
-
anchorElement: RefObject<HTMLElement>;
|
|
7
|
-
offsetLeft?: number;
|
|
8
|
-
offsetTop?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare const PopupComponent: ({ children, className, anchorElement, placement, }: PopupComponentProps) => JSX.Element | null;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from "react";
|
|
2
|
-
import { ContextMenuOptions } from "../menu";
|
|
3
|
-
import "./popup-service.css";
|
|
4
|
-
export type PopupCloseCallback = (reason?: PopupCloseReason) => void;
|
|
5
|
-
export type ClickAwayClosePopup = {
|
|
6
|
-
type: "click-away";
|
|
7
|
-
mouseEvt: MouseEvent;
|
|
8
|
-
};
|
|
9
|
-
export type EscapeClosePopup = {
|
|
10
|
-
type: "escape";
|
|
11
|
-
event: KeyboardEvent;
|
|
12
|
-
};
|
|
13
|
-
export type MenuActionClosePopup = {
|
|
14
|
-
menuId: string;
|
|
15
|
-
options: ContextMenuOptions;
|
|
16
|
-
type: "menu-action";
|
|
17
|
-
};
|
|
18
|
-
export type PopupCloseReason = ClickAwayClosePopup | EscapeClosePopup | MenuActionClosePopup;
|
|
19
|
-
export declare const reasonIsMenuAction: (reason?: PopupCloseReason) => reason is MenuActionClosePopup;
|
|
20
|
-
export declare const reasonIsClickAway: (reason?: PopupCloseReason) => reason is ClickAwayClosePopup;
|
|
21
|
-
export interface ShowPopupProps {
|
|
22
|
-
depth?: number;
|
|
23
|
-
/**
|
|
24
|
-
* if true, focus will be invoked on first focusable element
|
|
25
|
-
*/
|
|
26
|
-
focus?: boolean;
|
|
27
|
-
name?: string;
|
|
28
|
-
group?: string;
|
|
29
|
-
position?: "above" | "below" | "";
|
|
30
|
-
left?: number;
|
|
31
|
-
right?: "auto" | number;
|
|
32
|
-
top?: number;
|
|
33
|
-
component: ReactElement;
|
|
34
|
-
width?: number | "auto";
|
|
35
|
-
}
|
|
36
|
-
export declare class PopupService {
|
|
37
|
-
static onClose: PopupCloseCallback | undefined;
|
|
38
|
-
static showPopup({ group, name, left, position, right, top, width, component, }: ShowPopupProps): void;
|
|
39
|
-
static escapeKeyListener(evt: KeyboardEvent): void;
|
|
40
|
-
static hidePopup(reason?: PopupCloseReason, name?: string, group?: string): void;
|
|
41
|
-
static keepWithinThePage(el: HTMLElement, right?: number | "auto"): void;
|
|
42
|
-
}
|
|
43
|
-
export declare class DialogService {
|
|
44
|
-
static showDialog(dialog: ReactElement): void;
|
|
45
|
-
static closeDialog(): void;
|
|
46
|
-
}
|
|
47
|
-
export interface PopupProps {
|
|
48
|
-
children: ReactElement;
|
|
49
|
-
close?: boolean;
|
|
50
|
-
depth: number;
|
|
51
|
-
group?: string;
|
|
52
|
-
name: string;
|
|
53
|
-
position?: "above" | "below" | "";
|
|
54
|
-
width: number;
|
|
55
|
-
}
|
|
56
|
-
export declare const Popup: (props: PopupProps) => React.DetailedReactHTMLElement<{
|
|
57
|
-
className: string;
|
|
58
|
-
ref: React.RefObject<HTMLElement>;
|
|
59
|
-
}, HTMLElement>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
|
-
import { PopupPlacement } from "./Popup";
|
|
3
|
-
export interface AnchoredPositionHookProps {
|
|
4
|
-
anchorElement: RefObject<HTMLElement>;
|
|
5
|
-
offsetLeft?: number;
|
|
6
|
-
offsetTop?: number;
|
|
7
|
-
placement: PopupPlacement;
|
|
8
|
-
}
|
|
9
|
-
export declare const useAnchoredPosition: ({ anchorElement, offsetLeft, offsetTop, placement, }: AnchoredPositionHookProps) => {
|
|
10
|
-
left: number;
|
|
11
|
-
top: number;
|
|
12
|
-
} | undefined;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
2
|
-
import { PopupCloseReason } from "@vuu-ui/vuu-popups";
|
|
3
|
-
import "./PopupMenu.css";
|
|
4
|
-
import { MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-data-types";
|
|
5
|
-
export interface PopupMenuProps extends HTMLAttributes<HTMLButtonElement> {
|
|
6
|
-
icon?: string;
|
|
7
|
-
label?: string;
|
|
8
|
-
menuActionHandler?: MenuActionHandler;
|
|
9
|
-
menuBuilder?: MenuBuilder;
|
|
10
|
-
menuLocation?: string;
|
|
11
|
-
menuOptions?: {
|
|
12
|
-
[key: string]: unknown;
|
|
13
|
-
};
|
|
14
|
-
onMenuClose?: (reason?: PopupCloseReason) => void;
|
|
15
|
-
}
|
|
16
|
-
export declare const PopupMenu: ({ className, label, icon, id: idProp, menuActionHandler, menuBuilder, menuLocation, menuOptions, onMenuClose, tabIndex, ...htmlAttributes }: PopupMenuProps) => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./PopupMenu";
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import "./Portal.css";
|
|
3
|
-
export interface PortalProps {
|
|
4
|
-
/**
|
|
5
|
-
* The children to render into the `container`.
|
|
6
|
-
*/
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* An HTML element, component instance, or function that returns either.
|
|
10
|
-
* The `container` will have the portal children appended to it.
|
|
11
|
-
*
|
|
12
|
-
* By default, it uses the body of the top-level document object,
|
|
13
|
-
* so it's simply `document.body` most of the time.
|
|
14
|
-
*/
|
|
15
|
-
container?: Element | (() => Element | null) | null;
|
|
16
|
-
/**
|
|
17
|
-
* If this node does not exist on the document, it will be created for you.
|
|
18
|
-
*/
|
|
19
|
-
id?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Allow conditional rendering of this Portal, if false, will render nothing.
|
|
22
|
-
* Defaults to true
|
|
23
|
-
*/
|
|
24
|
-
open?: boolean;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Portals provide a first-class way to render children into a DOM node
|
|
28
|
-
* that exists outside the DOM hierarchy of the parent component.
|
|
29
|
-
*/
|
|
30
|
-
export declare const Portal: ({ children, container: containerProp, id, open, }: PortalProps) => import("react").ReactPortal | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Portal";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
export interface PortalDeprecatedProps {
|
|
3
|
-
children: ReactElement;
|
|
4
|
-
onRender?: () => void;
|
|
5
|
-
x?: number;
|
|
6
|
-
y?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare const PortalDeprecated: ({ children, x, y, onRender, }: PortalDeprecatedProps) => null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const installTheme: (themeId: string) => void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
export interface HTMLContainerProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
dataMode?: string;
|
|
5
|
-
x?: number;
|
|
6
|
-
y?: number;
|
|
7
|
-
win?: typeof globalThis;
|
|
8
|
-
}
|
|
9
|
-
export declare const createContainer: (props: HTMLContainerProps) => HTMLDivElement;
|
|
10
|
-
export declare const renderPortal: (component: ReactElement, container: HTMLElement, x: number, y: number, onRender?: () => void) => void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
2
|
-
import { PopupComponentProps } from "../popup";
|
|
3
|
-
import "./Prompt.css";
|
|
4
|
-
export interface PromptProps extends HTMLAttributes<HTMLDialogElement> {
|
|
5
|
-
PopupProps?: Partial<PopupComponentProps>;
|
|
6
|
-
cancelButtonLabel?: string;
|
|
7
|
-
confirmButtonLabel?: string;
|
|
8
|
-
onCancel: () => void;
|
|
9
|
-
onConfirm: () => void;
|
|
10
|
-
icon?: string;
|
|
11
|
-
text: string;
|
|
12
|
-
variant?: "warn" | "error" | "info";
|
|
13
|
-
}
|
|
14
|
-
export declare const Prompt: ({ PopupProps, cancelButtonLabel, confirmButtonLabel, icon, onCancel, onConfirm, style, text, title, variant, ...htmlAttributes }: PromptProps) => JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Prompt";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler, ReactNode, RefObject } from "react";
|
|
2
|
-
import { TooltipPlacement } from "./useAnchoredPosition";
|
|
3
|
-
import "./Tooltip.css";
|
|
4
|
-
export interface TooltipProps {
|
|
5
|
-
anchorElement: RefObject<HTMLElement>;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
id?: string;
|
|
8
|
-
onMouseEnter: MouseEventHandler;
|
|
9
|
-
onMouseLeave: MouseEventHandler;
|
|
10
|
-
placement: TooltipPlacement;
|
|
11
|
-
}
|
|
12
|
-
export declare const Tooltip: ({ anchorElement, children, id, onMouseEnter, onMouseLeave, placement, }: TooltipProps) => JSX.Element | null;
|