@vuu-ui/vuu-ui-controls 0.8.8-debug → 0.8.9-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 +5705 -3779
- package/cjs/index.js.map +4 -4
- package/esm/index.js +5754 -3781
- package/esm/index.js.map +4 -4
- package/index.css +419 -105
- package/index.css.map +3 -3
- package/package.json +8 -6
- package/types/vuu-popups/src/dialog/Dialog.d.ts +8 -0
- package/types/vuu-popups/src/dialog/index.d.ts +1 -0
- package/types/vuu-popups/src/index.d.ts +8 -0
- package/types/vuu-popups/src/menu/ContextMenu.d.ts +16 -0
- package/types/vuu-popups/src/menu/MenuList.d.ts +43 -0
- package/types/vuu-popups/src/menu/context-menu-provider.d.ts +10 -0
- package/types/vuu-popups/src/menu/index.d.ts +4 -0
- package/types/vuu-popups/src/menu/key-code.d.ts +12 -0
- package/types/vuu-popups/src/menu/list-dom-utils.d.ts +4 -0
- package/types/vuu-popups/src/menu/use-cascade.d.ts +25 -0
- package/types/vuu-popups/src/menu/use-items-with-ids-next.d.ts +13 -0
- package/types/vuu-popups/src/menu/use-keyboard-navigation.d.ts +27 -0
- package/types/vuu-popups/src/menu/useContextMenu.d.ts +20 -0
- package/types/vuu-popups/src/menu/utils.d.ts +2 -0
- package/types/vuu-popups/src/popup/Popup.d.ts +10 -0
- package/types/vuu-popups/src/popup/index.d.ts +3 -0
- package/types/vuu-popups/src/popup/popup-service.d.ts +59 -0
- package/types/vuu-popups/src/popup/useAnchoredPosition.d.ts +12 -0
- package/types/vuu-popups/src/popup-menu/PopupMenu.d.ts +16 -0
- package/types/vuu-popups/src/popup-menu/index.d.ts +1 -0
- package/types/vuu-popups/src/portal/Portal.d.ts +30 -0
- package/types/vuu-popups/src/portal/index.d.ts +1 -0
- package/types/vuu-popups/src/portal-deprecated/PortalDeprecated.d.ts +8 -0
- package/types/vuu-popups/src/portal-deprecated/index.d.ts +3 -0
- package/types/vuu-popups/src/portal-deprecated/portal-utils.d.ts +1 -0
- package/types/vuu-popups/src/portal-deprecated/render-portal.d.ts +10 -0
- package/types/vuu-popups/src/prompt/Prompt.d.ts +14 -0
- package/types/vuu-popups/src/prompt/index.d.ts +1 -0
- package/types/vuu-popups/src/tooltip/Tooltip.d.ts +12 -0
- package/types/vuu-popups/src/tooltip/index.d.ts +2 -0
- package/types/vuu-popups/src/tooltip/useAnchoredPosition.d.ts +12 -0
- package/types/vuu-popups/src/tooltip/useTooltip.d.ts +16 -0
- package/types/vuu-ui-controls/src/combo-box/ComboBox.d.ts +18 -0
- package/types/vuu-ui-controls/src/combo-box/index.d.ts +1 -0
- package/types/vuu-ui-controls/src/combo-box/useCombobox.d.ts +22 -0
- package/types/{list → vuu-ui-controls/src}/common-hooks/collectionTypes.d.ts +1 -0
- package/types/vuu-ui-controls/src/common-hooks/index.d.ts +8 -0
- package/types/{list → vuu-ui-controls/src}/common-hooks/navigationTypes.d.ts +5 -3
- package/types/{list → vuu-ui-controls/src}/common-hooks/selectionTypes.d.ts +16 -12
- package/types/{list → vuu-ui-controls/src}/common-hooks/useCollectionItems.d.ts +1 -1
- package/types/vuu-ui-controls/src/common-hooks/useControlled.d.ts +24 -0
- package/types/{list → vuu-ui-controls/src}/common-hooks/useSelection.d.ts +1 -1
- package/types/vuu-ui-controls/src/drag-drop/DragDropProvider.d.ts +37 -0
- package/types/vuu-ui-controls/src/drag-drop/DragDropState.d.ts +15 -0
- package/types/{drag-drop → vuu-ui-controls/src/drag-drop}/dragDropTypesNext.d.ts +24 -5
- package/types/{drag-drop → vuu-ui-controls/src/drag-drop}/drop-target-utils.d.ts +8 -9
- package/types/{drag-drop → vuu-ui-controls/src/drag-drop}/useDragDisplacers.d.ts +3 -2
- package/types/vuu-ui-controls/src/drag-drop/useDragDropIndicator.d.ts +2 -0
- package/types/vuu-ui-controls/src/drag-drop/useDragDropNaturalMovementNext.d.ts +2 -0
- package/types/vuu-ui-controls/src/drag-drop/useGlobalDragDrop.d.ts +10 -0
- package/types/vuu-ui-controls/src/dropdown/Dropdown.d.ts +10 -0
- package/types/vuu-ui-controls/src/dropdown/DropdownBase.d.ts +10 -0
- package/types/vuu-ui-controls/src/dropdown/DropdownButton.d.ts +42 -0
- package/types/vuu-ui-controls/src/dropdown/dropdownTypes.d.ts +45 -0
- package/types/vuu-ui-controls/src/dropdown/index.d.ts +5 -0
- package/types/vuu-ui-controls/src/dropdown/useClickAway.d.ts +8 -0
- package/types/vuu-ui-controls/src/dropdown/useDropdown.d.ts +13 -0
- package/types/vuu-ui-controls/src/dropdown/useDropdownBase.d.ts +2 -0
- package/types/vuu-ui-controls/src/editable/editable-utils.d.ts +4 -0
- package/types/vuu-ui-controls/src/editable/index.d.ts +2 -0
- package/types/vuu-ui-controls/src/editable/useEditableText.d.ts +16 -0
- package/types/vuu-ui-controls/src/expando-input/ExpandoInput.d.ts +4 -0
- package/types/vuu-ui-controls/src/expando-input/index.d.ts +1 -0
- package/types/vuu-ui-controls/src/index.d.ts +15 -0
- package/types/vuu-ui-controls/src/inputs/Checkbox.d.ts +10 -0
- package/types/vuu-ui-controls/src/inputs/RadioButton.d.ts +10 -0
- package/types/vuu-ui-controls/src/inputs/index.d.ts +2 -0
- package/types/vuu-ui-controls/src/instrument-search/InstrumentSearch.d.ts +11 -0
- package/types/vuu-ui-controls/src/instrument-search/SearchCell.d.ts +4 -0
- package/types/vuu-ui-controls/src/instrument-search/index.d.ts +1 -0
- package/types/vuu-ui-controls/src/instrument-search/moving-window.d.ts +14 -0
- package/types/vuu-ui-controls/src/instrument-search/useDataSource.d.ts +7 -0
- package/types/vuu-ui-controls/src/list/ChevronIcon.d.ts +8 -0
- package/types/{list → vuu-ui-controls/src/list}/List.d.ts +2 -2
- package/types/{list → vuu-ui-controls/src/list}/ListItem.d.ts +3 -1
- package/types/vuu-ui-controls/src/list/RadioIcon.d.ts +6 -0
- package/types/{list → vuu-ui-controls/src/list}/VirtualizedList.d.ts +1 -1
- package/types/{list → vuu-ui-controls/src/list}/common-hooks/index.d.ts +2 -7
- package/types/{list → vuu-ui-controls/src/list}/common-hooks/keyUtils.d.ts +0 -1
- package/types/{list → vuu-ui-controls/src/list}/common-hooks/list-dom-utils.d.ts +0 -1
- package/types/{list → vuu-ui-controls/src/list}/common-hooks/useCollapsibleGroups.d.ts +2 -2
- package/types/{list → vuu-ui-controls/src/list}/common-hooks/useImperativeScrollingAPI.d.ts +1 -1
- package/types/vuu-ui-controls/src/list/common-hooks/useKeyboardNavigation.d.ts +3 -0
- package/types/{list → vuu-ui-controls/src/list}/common-hooks/useTypeahead.d.ts +1 -1
- package/types/{list → vuu-ui-controls/src/list}/common-hooks/useViewportTracking.d.ts +1 -1
- package/types/{list → vuu-ui-controls/src/list}/common-hooks/utils/collection-item-utils.d.ts +1 -1
- package/types/{list → vuu-ui-controls/src/list}/common-hooks/utils/index.d.ts +1 -0
- package/types/vuu-ui-controls/src/list/common-hooks/utils/isSelected.d.ts +2 -0
- package/types/{list → vuu-ui-controls/src/list}/index.d.ts +3 -0
- package/types/{list → vuu-ui-controls/src/list}/listTypes.d.ts +15 -15
- package/types/{list → vuu-ui-controls/src/list}/useList.d.ts +2 -2
- package/types/{list → vuu-ui-controls/src/list}/useListHeight.d.ts +5 -4
- package/types/{list → vuu-ui-controls/src/list}/useVirtualization.d.ts +1 -1
- package/types/vuu-ui-controls/src/price-ticker/PriceTicker.d.ts +8 -0
- package/types/vuu-ui-controls/src/price-ticker/index.d.ts +1 -0
- package/types/vuu-ui-controls/src/tabstrip/TabMenu.d.ts +16 -0
- package/types/{tabstrip → vuu-ui-controls/src/tabstrip}/TabsTypes.d.ts +2 -2
- package/types/{tabstrip → vuu-ui-controls/src/tabstrip}/tabstrip-dom-utils.d.ts +0 -1
- package/types/{tabstrip → vuu-ui-controls/src/tabstrip}/useSelection.d.ts +0 -1
- package/types/{tabstrip → vuu-ui-controls/src/tabstrip}/useTabstrip.d.ts +1 -1
- package/types/vuu-ui-controls/src/utils/forwardCallbackProps.d.ts +3 -0
- package/types/vuu-ui-controls/src/utils/index.d.ts +2 -0
- package/types/vuu-ui-controls/src/vuu-input/VuuInput.d.ts +10 -0
- package/types/vuu-ui-controls/src/vuu-input/index.d.ts +1 -0
- package/types/vuu-utils/src/DataWindow.d.ts +39 -0
- package/types/vuu-utils/src/array-utils.d.ts +6 -0
- package/types/vuu-utils/src/box-utils.d.ts +9 -0
- package/types/vuu-utils/src/column-utils.d.ts +130 -0
- package/types/vuu-utils/src/common-types.d.ts +6 -0
- package/types/vuu-utils/src/component-registry.d.ts +23 -0
- package/types/vuu-utils/src/cookie-utils.d.ts +1 -0
- package/types/vuu-utils/src/data-utils.d.ts +14 -0
- package/types/vuu-utils/src/date-utils.d.ts +7 -0
- package/types/vuu-utils/src/debug-utils.d.ts +9 -0
- package/types/vuu-utils/src/event-emitter.d.ts +13 -0
- package/types/vuu-utils/src/filter-utils.d.ts +14 -0
- package/types/vuu-utils/src/formatting-utils.d.ts +9 -0
- package/types/vuu-utils/src/getUniqueId.d.ts +1 -0
- package/types/vuu-utils/src/group-utils.d.ts +3 -0
- package/types/vuu-utils/src/html-utils.d.ts +12 -0
- package/types/vuu-utils/src/index.d.ts +34 -0
- package/types/vuu-utils/src/input-utils.d.ts +2 -0
- package/types/vuu-utils/src/invariant.d.ts +1 -0
- package/types/vuu-utils/src/itemToString.d.ts +2 -0
- package/types/vuu-utils/src/json-utils.d.ts +6 -0
- package/types/vuu-utils/src/keyboard-utils.d.ts +12 -0
- package/types/vuu-utils/src/keyset.d.ts +11 -0
- package/types/vuu-utils/src/logging-utils.d.ts +44 -0
- package/types/vuu-utils/src/menu-utils.d.ts +2 -0
- package/types/vuu-utils/src/nanoid/index.d.ts +1 -0
- package/types/vuu-utils/src/perf-utils.d.ts +5 -0
- package/types/vuu-utils/src/range-utils.d.ts +24 -0
- package/types/vuu-utils/src/round-decimal.d.ts +1 -0
- package/types/vuu-utils/src/row-utils.d.ts +7 -0
- package/types/vuu-utils/src/screenshot-utils.d.ts +6 -0
- package/types/vuu-utils/src/selection-utils.d.ts +27 -0
- package/types/vuu-utils/src/sort-utils.d.ts +5 -0
- package/types/vuu-utils/src/text-utils.d.ts +2 -0
- package/types/vuu-utils/src/url-utils.d.ts +2 -0
- package/types/common-hooks/index.d.ts +0 -1
- package/types/drag-drop/DragDropProvider.d.ts +0 -22
- package/types/drag-drop/drag-utils.d.ts +0 -49
- package/types/drag-drop/useDragDropIndicator.d.ts +0 -2
- package/types/drag-drop/useDragDropNaturalMovementNext.d.ts +0 -2
- package/types/drag-drop/useDragSpacers.d.ts +0 -7
- package/types/index.d.ts +0 -5
- package/types/list/common-hooks/useKeyboardNavigation.d.ts +0 -4
- package/types/list/common-hooks/utils/isSelected.d.ts +0 -2
- package/types/tabstrip/TabMenu.d.ts +0 -12
- package/types/utils/index.d.ts +0 -1
- /package/types/{list → vuu-ui-controls/src}/common-hooks/collectionProvider.d.ts +0 -0
- /package/types/{list → vuu-ui-controls/src}/common-hooks/itemToString.d.ts +0 -0
- /package/types/{common-hooks → vuu-ui-controls/src/common-hooks}/use-resize-observer.d.ts +0 -0
- /package/types/{drag-drop → vuu-ui-controls/src/drag-drop}/Draggable.d.ts +0 -0
- /package/types/{drag-drop → vuu-ui-controls/src/drag-drop}/DropIndicator.d.ts +0 -0
- /package/types/{drag-drop → vuu-ui-controls/src/drag-drop}/index.d.ts +0 -0
- /package/types/{drag-drop → vuu-ui-controls/src/drag-drop}/useAutoScroll.d.ts +0 -0
- /package/types/{drag-drop → vuu-ui-controls/src/drag-drop}/useDragDropNext.d.ts +0 -0
- /package/types/{drag-drop → vuu-ui-controls/src/drag-drop}/useDropIndicator.d.ts +0 -0
- /package/types/{drag-drop → vuu-ui-controls/src/drag-drop}/useTransition.d.ts +0 -0
- /package/types/{editable-label → vuu-ui-controls/src/editable-label}/EditableLabel.d.ts +0 -0
- /package/types/{editable-label → vuu-ui-controls/src/editable-label}/index.d.ts +0 -0
- /package/types/{list → vuu-ui-controls/src/list}/CheckboxIcon.d.ts +0 -0
- /package/types/{list → vuu-ui-controls/src/list}/Highlighter.d.ts +0 -0
- /package/types/{list → vuu-ui-controls/src/list}/ListItemGroup.d.ts +0 -0
- /package/types/{list → vuu-ui-controls/src/list}/ListItemHeader.d.ts +0 -0
- /package/types/{list → vuu-ui-controls/src/list}/common-hooks/utils/filter-utils.d.ts +0 -0
- /package/types/{list → vuu-ui-controls/src/list}/keyset.d.ts +0 -0
- /package/types/{list → vuu-ui-controls/src/list}/useScrollPosition.d.ts +0 -0
- /package/types/{tabstrip → vuu-ui-controls/src/tabstrip}/Tab.d.ts +0 -0
- /package/types/{tabstrip → vuu-ui-controls/src/tabstrip}/TabMenuOptions.d.ts +0 -0
- /package/types/{tabstrip → vuu-ui-controls/src/tabstrip}/Tabstrip.d.ts +0 -0
- /package/types/{tabstrip → vuu-ui-controls/src/tabstrip}/index.d.ts +0 -0
- /package/types/{tabstrip → vuu-ui-controls/src/tabstrip}/useAnimatedSelectionThumb.d.ts +0 -0
- /package/types/{tabstrip → vuu-ui-controls/src/tabstrip}/useKeyboardNavigation.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/Tree.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/hierarchical-data-utils.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/index.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/key-code.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/list-dom-utils.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/use-collapsible-groups.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/use-hierarchical-data.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/use-items-with-ids.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/use-keyboard-navigation.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/use-selection.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/use-tree-keyboard-navigation.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/use-viewport-tracking.d.ts +0 -0
- /package/types/{tree → vuu-ui-controls/src/tree}/useTree.d.ts +0 -0
- /package/types/{utils → vuu-ui-controls/src/utils}/escapeRegExp.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ExpandoInput";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./combo-box";
|
|
2
|
+
export * from "./common-hooks";
|
|
3
|
+
export * from "./drag-drop";
|
|
4
|
+
export * from "./dropdown";
|
|
5
|
+
export * from "./editable";
|
|
6
|
+
export * from "./editable-label";
|
|
7
|
+
export * from "./expando-input";
|
|
8
|
+
export * from "./inputs";
|
|
9
|
+
export * from "./instrument-search";
|
|
10
|
+
export * from "./list";
|
|
11
|
+
export * from "./price-ticker";
|
|
12
|
+
export * from "./tabstrip";
|
|
13
|
+
export * from "./tree";
|
|
14
|
+
export * from "./utils";
|
|
15
|
+
export * from "./vuu-input";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./RadioButton.css";
|
|
3
|
+
type RadioButtonProps = {
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
checked: boolean;
|
|
6
|
+
label: string;
|
|
7
|
+
groupName: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const RadioButton: (props: RadioButtonProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataSource } from "@vuu-ui/vuu-data";
|
|
2
|
+
import { TableProps } from "@vuu-ui/vuu-table";
|
|
3
|
+
import { HTMLAttributes } from "react";
|
|
4
|
+
import "./SearchCell";
|
|
5
|
+
import "./InstrumentSearch.css";
|
|
6
|
+
export interface InstrumentSearchProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
TableProps?: Partial<TableProps>;
|
|
8
|
+
dataSource: DataSource;
|
|
9
|
+
searchColumn?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const InstrumentSearch: ({ TableProps, className, dataSource, searchColumn, ...htmlAttributes }: InstrumentSearchProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InstrumentSearch";
|
|
@@ -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 "packages/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,8 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import "./ChevronIcon.css";
|
|
3
|
+
type Direction = "up" | "down" | "left" | "right";
|
|
4
|
+
interface ChevronProps extends HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
direction: Direction;
|
|
6
|
+
}
|
|
7
|
+
export declare const ChevronIcon: (props: ChevronProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ForwardedRef, ReactElement } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { SelectionStrategy } from "../common-hooks";
|
|
3
3
|
import { ListProps } from "./listTypes";
|
|
4
4
|
import "./List.css";
|
|
5
5
|
export declare const List: <Item = string, Selection_1 extends SelectionStrategy = "default">(props: ListProps<Item, Selection_1> & {
|
|
6
|
-
ref?: ForwardedRef<
|
|
6
|
+
ref?: ForwardedRef<HTMLDivElement> | undefined;
|
|
7
7
|
}) => ReactElement<ListProps<Item, Selection_1>, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
import { ListItemType } from "./listTypes";
|
|
3
3
|
import "./ListItem.css";
|
|
4
|
-
export declare const ListItemProxy: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> &
|
|
4
|
+
export declare const ListItemProxy: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
height?: number | undefined;
|
|
6
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
7
|
export declare const ListItem: ListItemType<unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ForwardedRef, ReactElement } from "react";
|
|
2
|
-
import { SelectionStrategy } from "
|
|
2
|
+
import { SelectionStrategy } from "../common-hooks";
|
|
3
3
|
import { ListProps } from "./listTypes";
|
|
4
4
|
import "./List.css";
|
|
5
5
|
export declare const VirtualizedList: <Item = string, Selection_1 extends SelectionStrategy = "default">(props: ListProps<Item, Selection_1> & {
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
export * from "./collectionProvider";
|
|
2
|
-
export * from "./collectionTypes";
|
|
3
|
-
export * from "./itemToString";
|
|
4
1
|
export * from "./keyUtils";
|
|
5
2
|
export * from "./useCollapsibleGroups";
|
|
6
3
|
export * from "./list-dom-utils";
|
|
7
|
-
export * from "
|
|
8
|
-
export * from "./selectionTypes";
|
|
9
|
-
export * from "./useCollectionItems";
|
|
4
|
+
export * from "../../common-hooks/useCollectionItems";
|
|
10
5
|
export * from "./useImperativeScrollingAPI";
|
|
11
6
|
export * from "./useKeyboardNavigation";
|
|
12
|
-
export * from "
|
|
7
|
+
export * from "../../common-hooks/useSelection";
|
|
13
8
|
export * from "./useTypeahead";
|
|
14
9
|
export * from "./useViewportTracking";
|
|
15
10
|
export * from "./utils";
|
|
@@ -10,6 +10,5 @@ export declare const End = "End";
|
|
|
10
10
|
export declare const PageUp = "PageUp";
|
|
11
11
|
export declare const PageDown = "PageDown";
|
|
12
12
|
export declare const Space = " ";
|
|
13
|
-
export declare const Tab = "Tab";
|
|
14
13
|
export declare const isCharacterKey: (evt: React.KeyboardEvent) => boolean;
|
|
15
14
|
export declare const isNavigationKey: ({ key }: React.KeyboardEvent) => boolean;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const listItemElement: (listEl: HTMLElement, listItemIdx: number) => Element | null;
|
|
2
2
|
export declare function listItemIndex(listItemEl?: HTMLElement): number;
|
|
3
3
|
export declare const listItemId: (el: HTMLElement | null) => string | undefined;
|
|
4
|
-
export declare const closestListItem: (el: HTMLElement) => HTMLElement;
|
|
5
4
|
export declare const closestListItemId: (el: HTMLElement) => string | undefined;
|
|
6
5
|
export declare const closestListItemIndex: (el: HTMLElement) => number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ListHandlers } from "
|
|
2
|
-
import { CollectionHookResult } from "
|
|
1
|
+
import { ListHandlers } from "../../common-hooks";
|
|
2
|
+
import { CollectionHookResult } from "../../common-hooks/collectionTypes";
|
|
3
3
|
interface CollapsibleHookProps<Item> {
|
|
4
4
|
collapsibleHeaders?: boolean;
|
|
5
5
|
collectionHook: CollectionHookResult<Item>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ForwardedRef, MutableRefObject } from "react";
|
|
2
|
-
import { CollectionHookResult, CollectionItem } from "
|
|
2
|
+
import { CollectionHookResult, CollectionItem } from "../../common-hooks/collectionTypes";
|
|
3
3
|
export interface ScrollingAPI<Item> {
|
|
4
4
|
scrollToIndex: (itemIndex: number) => void;
|
|
5
5
|
scrollToItem: (item: Item) => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { NavigationHookProps, NavigationHookResult, SelectionStrategy } from "../../common-hooks";
|
|
2
|
+
export declare const LIST_FOCUS_VISIBLE = -2;
|
|
3
|
+
export declare const useKeyboardNavigation: <Item, Selection_1 extends SelectionStrategy>({ containerRef, defaultHighlightedIndex, disableHighlightOnFocus, highlightedIndex: highlightedIndexProp, indexPositions, itemCount, onHighlight, onKeyboardNavigation, restoreLastFocus, selected, viewportItemCount, }: NavigationHookProps<Item, Selection_1>) => NavigationHookResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MutableRefObject, RefObject } from "react";
|
|
2
|
-
import { CollectionItem } from "
|
|
2
|
+
import { CollectionItem } from "../../common-hooks/collectionTypes";
|
|
3
3
|
export interface ViewportTrackingProps<Item> {
|
|
4
4
|
containerRef: RefObject<HTMLElement>;
|
|
5
5
|
contentRef?: RefObject<HTMLElement>;
|
package/types/{list → vuu-ui-controls/src/list}/common-hooks/utils/collection-item-utils.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from "react";
|
|
2
|
-
import { CollectionItem, CollectionOptions } from "
|
|
2
|
+
import { CollectionItem, CollectionOptions } from "../../../common-hooks/collectionTypes";
|
|
3
3
|
export declare const sourceItemHasProp: (item: unknown, propertyName: string) => boolean;
|
|
4
4
|
export declare const isHeader: (item: unknown) => boolean;
|
|
5
5
|
export declare const isGroupNode: (item: unknown) => boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./common-hooks";
|
|
1
2
|
export * from "./Highlighter";
|
|
2
3
|
export * from "./ListItem";
|
|
3
4
|
export * from "./List";
|
|
@@ -6,3 +7,5 @@ export * from "./ListItemHeader";
|
|
|
6
7
|
export * from "./ListItemGroup";
|
|
7
8
|
export * from "./useList";
|
|
8
9
|
export * from "./VirtualizedList";
|
|
10
|
+
export * from "./CheckboxIcon";
|
|
11
|
+
export * from "./RadioIcon";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { FocusEventHandler, ForwardedRef, HTMLAttributes, KeyboardEvent, KeyboardEventHandler, MouseEventHandler, PropsWithChildren, Ref, RefObject } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ScrollingAPI, ViewportTrackingResult } from "./common-hooks";
|
|
3
|
+
import { CollectionHookResult, ListHandlers, NavigationHookResult, SelectHandler, SelectionChangeHandler, SelectionHookResult, SelectionProps, SelectionStrategy } from "../common-hooks";
|
|
4
|
+
import { DragHookResult, DragStartHandler, dragStrategy, DropHandler } from "../drag-drop";
|
|
4
5
|
import { ViewportRange } from "./useScrollPosition";
|
|
5
6
|
export type ComponentType<T = unknown> = (props: PropsWithChildren<T>) => JSX.Element;
|
|
6
7
|
export type ListItemType<T = unknown> = ComponentType<ListItemProps<T> & {
|
|
7
8
|
ref?: Ref<HTMLDivElement>;
|
|
8
9
|
}>;
|
|
10
|
+
export type MoveItemHandler = (fromIndex: number, toIndex: number) => void;
|
|
9
11
|
export interface ListItemProps<T = unknown> extends HTMLAttributes<HTMLDivElement> {
|
|
10
12
|
children?: React.ReactNode;
|
|
11
13
|
disabled?: boolean;
|
|
@@ -30,7 +32,7 @@ export interface ListScrollHandles<Item> {
|
|
|
30
32
|
scrollToItem: (item: Item) => void;
|
|
31
33
|
scrollTo: (scrollOffset: number) => void;
|
|
32
34
|
}
|
|
33
|
-
export interface ListProps<Item = string, Selection extends SelectionStrategy = "default"> extends SelectionProps<Item, Selection>, Omit<HTMLAttributes<HTMLDivElement>, "onSelect" | "defaultValue"> {
|
|
35
|
+
export interface ListProps<Item = string, Selection extends SelectionStrategy = "default"> extends SelectionProps<Item, Selection>, Omit<HTMLAttributes<HTMLDivElement>, "onDragStart" | "onDrop" | "onSelect" | "defaultValue"> {
|
|
34
36
|
/**
|
|
35
37
|
* The component used to render a ListItem instead of the default. This must itself render a ListItem,
|
|
36
38
|
* must implement props that extend ListItemProps and must forward ListItem props to the ListItem.
|
|
@@ -129,8 +131,14 @@ export interface ListProps<Item = string, Selection extends SelectionStrategy =
|
|
|
129
131
|
* Minimum list width.
|
|
130
132
|
*/
|
|
131
133
|
minWidth?: number | string;
|
|
134
|
+
onDragStart?: DragStartHandler;
|
|
135
|
+
/**
|
|
136
|
+
* Handle item dropped onto list. Note, this will not be triggered if a list item is
|
|
137
|
+
* dragged within its owning list - this will trigger the onMoveListItem callback.
|
|
138
|
+
*/
|
|
139
|
+
onDrop?: DropHandler;
|
|
132
140
|
onHighlight?: (index: number) => void;
|
|
133
|
-
onMoveListItem?:
|
|
141
|
+
onMoveListItem?: MoveItemHandler;
|
|
134
142
|
onViewportScroll?: (firstVisibleRowIndex: number, lastVisibleRowIndex: number) => void;
|
|
135
143
|
/**
|
|
136
144
|
* If `true`, the component will remember the last keyboard-interacted position
|
|
@@ -168,35 +176,27 @@ export interface ListControlProps {
|
|
|
168
176
|
onMouseDownCapture: MouseEventHandler;
|
|
169
177
|
onMouseLeave: MouseEventHandler;
|
|
170
178
|
}
|
|
171
|
-
export interface ListHookProps<Item, Selection extends SelectionStrategy> extends Omit<SelectionProps<
|
|
172
|
-
allowDragDrop?: boolean | dragStrategy;
|
|
173
|
-
collapsibleHeaders?: boolean;
|
|
179
|
+
export interface ListHookProps<Item, Selection extends SelectionStrategy> extends Omit<SelectionProps<string, Selection>, "onSelect" | "onSelectionChange">, Pick<ListProps, "allowDragDrop" | "collapsibleHeaders" | "disabled" | "id" | "onDragStart" | "onDrop" | "onHighlight" | "onMoveListItem" | "restoreLastFocus" | "stickyHeaders" | "tabToSelect"> {
|
|
174
180
|
collectionHook: CollectionHookResult<Item>;
|
|
175
181
|
containerRef: RefObject<HTMLElement>;
|
|
176
182
|
contentRef?: RefObject<HTMLElement>;
|
|
177
183
|
defaultHighlightedIndex?: number;
|
|
178
|
-
disabled?: boolean;
|
|
179
184
|
disableAriaActiveDescendant?: boolean;
|
|
180
185
|
disableHighlightOnFocus?: boolean;
|
|
181
186
|
disableTypeToSelect?: boolean;
|
|
182
187
|
focusVisible?: boolean;
|
|
183
188
|
highlightedIndex?: number;
|
|
184
|
-
id?: string;
|
|
185
189
|
label?: string;
|
|
186
190
|
listHandlers?: ListHandlers;
|
|
187
|
-
onHighlight?: (index: number) => void;
|
|
188
191
|
onKeyboardNavigation?: (event: React.KeyboardEvent, currentIndex: number) => void;
|
|
189
192
|
onKeyDown?: (evt: KeyboardEvent) => void;
|
|
190
|
-
onMoveListItem?: (fromIndex: number, toIndex: number) => void;
|
|
191
193
|
onSelect?: SelectHandler<Item>;
|
|
192
194
|
onSelectionChange?: SelectionChangeHandler<Item, Selection>;
|
|
193
|
-
|
|
195
|
+
scrollContainerRef?: RefObject<HTMLElement>;
|
|
194
196
|
selectionKeys?: string[];
|
|
195
|
-
stickyHeaders?: boolean;
|
|
196
|
-
tabToSelect?: boolean;
|
|
197
197
|
viewportRange?: ViewportRange;
|
|
198
198
|
}
|
|
199
|
-
export interface ListHookResult<Item, Selection extends SelectionStrategy> extends Partial<ViewportTrackingResult<Item>>, Pick<SelectionHookResult<
|
|
199
|
+
export interface ListHookResult<Item, Selection extends SelectionStrategy> extends Partial<ViewportTrackingResult<Item>>, Pick<SelectionHookResult<Selection>, "selected" | "setSelected">, Partial<Omit<NavigationHookResult, "listProps">>, Omit<DragHookResult, "isDragging" | "isScrolling"> {
|
|
200
200
|
keyboardNavigation: RefObject<boolean>;
|
|
201
201
|
listHandlers: ListHandlers;
|
|
202
202
|
listItemHeaderHandlers: Partial<ListHandlers>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SelectionStrategy } from "
|
|
1
|
+
import { SelectionStrategy } from "../common-hooks";
|
|
2
2
|
import { ListHookProps, ListHookResult } from "./listTypes";
|
|
3
|
-
export declare const useList: <Item, Selection_1 extends SelectionStrategy = "default">({ allowDragDrop, collapsibleHeaders, collectionHook: dataHook, containerRef, contentRef, defaultHighlightedIndex, defaultSelected, disabled, disableAriaActiveDescendant, disableHighlightOnFocus, disableTypeToSelect, highlightedIndex: highlightedIndexProp, id, label, listHandlers: listHandlersProp, onHighlight, onKeyboardNavigation, onKeyDown, onMoveListItem, onSelect, onSelectionChange, restoreLastFocus, selected, selectionStrategy, selectionKeys, stickyHeaders, tabToSelect, viewportRange, }: ListHookProps<Item, Selection_1>) => ListHookResult<Item, Selection_1>;
|
|
3
|
+
export declare const useList: <Item, Selection_1 extends SelectionStrategy = "default">({ 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, Selection_1>) => ListHookResult<Item, Selection_1>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { MeasuredSize } from "@vuu-ui/vuu-layout";
|
|
1
2
|
import { RefObject } from "react";
|
|
2
3
|
export interface ListHeightHookProps {
|
|
3
|
-
borderless?: boolean;
|
|
4
4
|
displayedItemCount: number;
|
|
5
5
|
getItemHeight?: (index: number) => number;
|
|
6
6
|
height?: number | string;
|
|
@@ -8,12 +8,13 @@ export interface ListHeightHookProps {
|
|
|
8
8
|
itemGapSize: number;
|
|
9
9
|
itemHeight?: number;
|
|
10
10
|
rootRef: RefObject<HTMLElement>;
|
|
11
|
-
|
|
11
|
+
size: MeasuredSize | undefined;
|
|
12
12
|
}
|
|
13
13
|
export interface HeightHookResult {
|
|
14
|
+
computedListHeight: number | undefined;
|
|
14
15
|
contentHeight: number;
|
|
15
16
|
listClientHeight?: number;
|
|
16
17
|
listItemHeight: number;
|
|
17
|
-
|
|
18
|
+
rowHeightProxyRef: (el: HTMLDivElement | null) => void;
|
|
18
19
|
}
|
|
19
|
-
export declare const useListHeight: ({
|
|
20
|
+
export declare const useListHeight: ({ displayedItemCount, getItemHeight, height, itemCount, itemGapSize, itemHeight: itemHeightProp, size, }: ListHeightHookProps) => HeightHookResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import "./PriceTicker.css";
|
|
3
|
+
export interface PriceTickerProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
decimals?: number;
|
|
5
|
+
price?: number;
|
|
6
|
+
showArrow?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const PriceTicker: import("react").MemoExoticComponent<({ className, decimals, price, showArrow, ...htmlAttributes }: PriceTickerProps) => JSX.Element>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PriceTicker";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuActionHandler } from "@vuu-ui/vuu-data-types";
|
|
3
|
+
import "./TabMenu.css";
|
|
4
|
+
export interface TabMenuProps {
|
|
5
|
+
allowClose: boolean;
|
|
6
|
+
allowRename: boolean;
|
|
7
|
+
index: number;
|
|
8
|
+
location?: string;
|
|
9
|
+
onMenuAction: MenuActionHandler;
|
|
10
|
+
onMenuClose?: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* The id of associated component, if available
|
|
13
|
+
*/
|
|
14
|
+
controlledComponentId?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const TabMenu: ({ allowClose, allowRename, controlledComponentId, location, onMenuAction, onMenuClose, index, }: TabMenuProps) => JSX.Element;
|
|
@@ -42,7 +42,7 @@ export interface TabstripProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
42
42
|
editing?: boolean;
|
|
43
43
|
keyBoardActivation?: "manual" | "automatic";
|
|
44
44
|
/**
|
|
45
|
-
* A custom context menu location for TabMenu
|
|
45
|
+
* A custom context menu location for TabMenu, applied to all tabs
|
|
46
46
|
*/
|
|
47
47
|
location?: string;
|
|
48
48
|
/**
|
|
@@ -78,7 +78,7 @@ export interface TabstripProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
78
78
|
promptForNewTabName?: boolean;
|
|
79
79
|
/**
|
|
80
80
|
* Should each tab render a popup menu. Default is false if tab is
|
|
81
|
-
* not closeable
|
|
81
|
+
* not closeable, not renameable and has no tab-location , otherwise true.
|
|
82
82
|
*/
|
|
83
83
|
showTabMenuButton?: boolean;
|
|
84
84
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { KeyboardEvent, MouseEvent } from "react";
|
|
2
|
-
export declare const isTabElement: (el: HTMLElement) => boolean;
|
|
3
2
|
export declare const useSelection: ({ defaultSelected, highlightedIdx, onSelectionChange, selected: selectedProp, }: {
|
|
4
3
|
defaultSelected?: number | undefined;
|
|
5
4
|
highlightedIdx: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MenuActionHandler } from "@vuu-ui/vuu-data-types";
|
|
2
2
|
import type { OverflowItem } from "@vuu-ui/vuu-layout";
|
|
3
|
-
import
|
|
3
|
+
import { orientationType } from "@vuu-ui/vuu-utils";
|
|
4
4
|
import { KeyboardEvent, MouseEvent as ReactMouseEvent, RefObject } from "react";
|
|
5
5
|
export type ExitEditModeHandler = (originalValue: string, editedValue: string, allowDeactivation: boolean, tabIndex: number) => void;
|
|
6
6
|
export interface TabstripHookProps {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputProps } from "@salt-ds/core";
|
|
2
|
+
import { SyntheticEvent } from "react";
|
|
3
|
+
export interface VuuInputProps extends InputProps {
|
|
4
|
+
onCommit: (evt: SyntheticEvent<HTMLInputElement>) => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A variant of Salt Input that provides a commit callback prop,
|
|
8
|
+
* TODO along with cancel behaviour ?
|
|
9
|
+
*/
|
|
10
|
+
export declare const VuuInput: ({ className, onCommit, onKeyDown, ...props }: VuuInputProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./VuuInput";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type DataItem = string | number | boolean;
|
|
2
|
+
export type DataRow = [
|
|
3
|
+
/** index */
|
|
4
|
+
number,
|
|
5
|
+
/** render index */
|
|
6
|
+
number,
|
|
7
|
+
/** isLeaf */
|
|
8
|
+
boolean,
|
|
9
|
+
/** isExpanded */
|
|
10
|
+
boolean,
|
|
11
|
+
/** depth */
|
|
12
|
+
number,
|
|
13
|
+
/** child count */
|
|
14
|
+
number,
|
|
15
|
+
/** key */
|
|
16
|
+
string,
|
|
17
|
+
/** selected */
|
|
18
|
+
number,
|
|
19
|
+
/** data values */
|
|
20
|
+
...DataItem[]
|
|
21
|
+
];
|
|
22
|
+
export type RangeLike = {
|
|
23
|
+
from: number;
|
|
24
|
+
to: number;
|
|
25
|
+
};
|
|
26
|
+
export declare class DataWindow {
|
|
27
|
+
private range;
|
|
28
|
+
data: DataRow[];
|
|
29
|
+
rowCount: number;
|
|
30
|
+
constructor({ from, to }: RangeLike);
|
|
31
|
+
setRowCount: (rowCount: number) => void;
|
|
32
|
+
add(data: DataRow): boolean;
|
|
33
|
+
getAtIndex(index: number): DataRow | undefined;
|
|
34
|
+
getByKey(key: string): DataRow | undefined;
|
|
35
|
+
isWithinRange(index: number): boolean;
|
|
36
|
+
setRange(from: number, to: number): void;
|
|
37
|
+
hasData(from: number, to: number): boolean;
|
|
38
|
+
getData(from: number, to: number): any[];
|
|
39
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type PartitionTest<T> = (value: T, index: number) => boolean;
|
|
2
|
+
export declare function partition<T>(array: T[], test: PartitionTest<T>, pass?: T[], fail?: T[]): [T[], T[]];
|
|
3
|
+
export declare function itemsChanged<T = unknown>(currentItems: T[], newItems: T[], identityProperty?: string): boolean;
|
|
4
|
+
export declare function itemsOrOrderChanged<T = unknown>(currentItems: T[], newItems: T[], identityProperty?: string): boolean;
|
|
5
|
+
export declare const moveItemDeprecated: <T = unknown>(items: T[], item: T, moveTo: number) => T[];
|
|
6
|
+
export declare const moveItem: <T = unknown>(items: T[], fromIndex: number, toIndex: number) => T[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface rect {
|
|
2
|
+
bottom: number;
|
|
3
|
+
left: number;
|
|
4
|
+
right: number;
|
|
5
|
+
top: number;
|
|
6
|
+
}
|
|
7
|
+
export type rectTuple = [number, number, number, number];
|
|
8
|
+
export type dimension = "width" | "height";
|
|
9
|
+
export declare function boxContainsPoint(rect: rect, x: number, y: number): boolean | undefined;
|