@vuu-ui/vuu-ui-controls 0.8.5 → 0.8.6-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 +7687 -6564
- package/cjs/index.js.map +4 -4
- package/esm/index.js +7761 -6564
- package/esm/index.js.map +4 -4
- package/index.css +1102 -1
- package/index.css.map +3 -3
- package/package.json +6 -6
- package/types/drag-drop/drag-utils.d.ts +14 -13
- package/types/drag-drop/dragDropTypesNext.d.ts +1 -1
- package/types/drag-drop/drop-target-utils.d.ts +14 -13
- package/types/drag-drop/index.d.ts +1 -0
- package/types/drag-drop/useDragDisplacers.d.ts +0 -1
- package/types/index.d.ts +2 -0
- package/types/tabstrip/Tab.d.ts +2 -2
- package/types/tabstrip/TabsTypes.d.ts +8 -2
- package/types/tabstrip/useAnimatedSelectionThumb.d.ts +2 -1
- package/types/tabstrip/useKeyboardNavigation.d.ts +1 -1
- package/types/tabstrip/useTabstrip.d.ts +1 -1
- package/types/tree/Tree.d.ts +38 -0
- package/types/tree/hierarchical-data-utils.d.ts +8 -0
- package/types/tree/index.d.ts +3 -0
- package/types/tree/key-code.d.ts +11 -0
- package/types/tree/list-dom-utils.d.ts +6 -0
- package/types/tree/use-collapsible-groups.d.ts +18 -0
- package/types/tree/use-hierarchical-data.d.ts +6 -0
- package/types/tree/use-items-with-ids.d.ts +8 -0
- package/types/tree/use-keyboard-navigation.d.ts +26 -0
- package/types/tree/use-resize-observer.d.ts +15 -0
- package/types/tree/use-selection.d.ts +31 -0
- package/types/tree/use-tree-keyboard-navigation.d.ts +12 -0
- package/types/tree/use-viewport-tracking.d.ts +2 -0
- package/types/tree/useTree.d.ts +30 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { KeyboardEvent, MouseEvent, SyntheticEvent } from "react";
|
|
2
|
+
import { NormalisedTreeSourceNode } from "./Tree";
|
|
3
|
+
export type TreeSelection = "none" | "single" | "checkbox" | "multi" | "extended";
|
|
4
|
+
export declare const SINGLE = "single";
|
|
5
|
+
export declare const CHECKBOX = "checkbox";
|
|
6
|
+
export declare const MULTI = "multi";
|
|
7
|
+
export declare const EXTENDED = "extended";
|
|
8
|
+
export type GroupSelection = "none" | "single" | "cascade";
|
|
9
|
+
export type TreeNodeSelectionHandler = (evt: SyntheticEvent, selected: string[]) => void;
|
|
10
|
+
export declare const groupSelectionEnabled: (groupSelection: GroupSelection) => boolean;
|
|
11
|
+
export interface SelectionHookProps {
|
|
12
|
+
defaultSelected?: string[];
|
|
13
|
+
highlightedIdx: number;
|
|
14
|
+
onChange: TreeNodeSelectionHandler;
|
|
15
|
+
selected?: string[];
|
|
16
|
+
selection: TreeSelection;
|
|
17
|
+
selectionKeys?: string[];
|
|
18
|
+
treeNodes: NormalisedTreeSourceNode[];
|
|
19
|
+
}
|
|
20
|
+
export interface SelectionHookResult {
|
|
21
|
+
listHandlers: {
|
|
22
|
+
onKeyDown?: (evt: KeyboardEvent) => void;
|
|
23
|
+
onKeyboardNavigation?: (evt: KeyboardEvent, currentIndex: number) => void;
|
|
24
|
+
};
|
|
25
|
+
listItemHandlers: {
|
|
26
|
+
onClick?: (evt: MouseEvent) => void;
|
|
27
|
+
};
|
|
28
|
+
selected: string[];
|
|
29
|
+
setSelected: (selected: string[]) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare const useSelection: ({ defaultSelected, highlightedIdx, treeNodes, onChange, selected: selectedProp, selection, selectionKeys, }: SelectionHookProps) => SelectionHookResult;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NormalisedTreeSourceNode } from "./Tree";
|
|
2
|
+
export interface TreeKeyboardNavigationHookProps {
|
|
3
|
+
highlightedIdx: number;
|
|
4
|
+
hiliteItemAtIndex: (idx: number) => void;
|
|
5
|
+
indexPositions: NormalisedTreeSourceNode[];
|
|
6
|
+
source: NormalisedTreeSourceNode[];
|
|
7
|
+
}
|
|
8
|
+
export declare const useTreeKeyboardNavigation: ({ highlightedIdx, hiliteItemAtIndex, indexPositions, source, }: TreeKeyboardNavigationHookProps) => {
|
|
9
|
+
listHandlers: {
|
|
10
|
+
onKeyDown: (e: any) => void;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { GroupSelection, TreeNodeSelectionHandler, TreeSelection } from "./use-selection";
|
|
2
|
+
import { NormalisedTreeSourceNode } from "./Tree";
|
|
3
|
+
export interface TreeHookProps {
|
|
4
|
+
defaultSelected?: string[];
|
|
5
|
+
groupSelection: GroupSelection;
|
|
6
|
+
onChange: TreeNodeSelectionHandler;
|
|
7
|
+
onHighlight?: (index: number) => void;
|
|
8
|
+
selected?: string[];
|
|
9
|
+
selection: TreeSelection;
|
|
10
|
+
sourceWithIds: NormalisedTreeSourceNode[];
|
|
11
|
+
}
|
|
12
|
+
export declare const useTree: ({ defaultSelected, sourceWithIds, onChange, onHighlight: onHighlightProp, selected: selectedProp, selection, }: TreeHookProps) => {
|
|
13
|
+
focusVisible: number;
|
|
14
|
+
highlightedIdx: number;
|
|
15
|
+
hiliteItemAtIndex: (idx: any) => void;
|
|
16
|
+
listProps: {
|
|
17
|
+
"aria-activedescendant": string | undefined;
|
|
18
|
+
onBlur: () => void;
|
|
19
|
+
onFocus: () => void;
|
|
20
|
+
onKeyDown: (evt: any) => void;
|
|
21
|
+
onMouseDownCapture: () => void;
|
|
22
|
+
onMouseLeave: () => void;
|
|
23
|
+
onMouseMove: () => void;
|
|
24
|
+
};
|
|
25
|
+
listItemHandlers: {
|
|
26
|
+
onClick: (evt: any) => void;
|
|
27
|
+
};
|
|
28
|
+
selected: string[];
|
|
29
|
+
visibleData: NormalisedTreeSourceNode[];
|
|
30
|
+
};
|