react-accessible-treeview
Advanced tools
Comparing version 2.5.0 to 2.5.1
import TreeView, { ITreeViewOnExpandProps, ITreeViewOnSelectProps, ITreeViewOnNodeSelectProps, ITreeViewProps, ITreeViewOnLoadDataProps } from "./TreeView"; | ||
import { CLICK_ACTIONS } from "./TreeView/constants"; | ||
import { ITreeViewState, TreeViewAction } from "./TreeView/reducer"; | ||
import { INode, TreeViewData, EventCallback, ClickActions, INodeRendererProps, IBranchProps, LeafProps } from "./TreeView/types"; | ||
import { INode, NodeId, EventCallback, ClickActions, INodeRendererProps, IBranchProps, LeafProps } from "./TreeView/types"; | ||
import { flattenTree } from "./TreeView/utils"; | ||
export { flattenTree, ITreeViewProps, INode, TreeViewData, ITreeViewOnSelectProps, ITreeViewOnNodeSelectProps, CLICK_ACTIONS, ITreeViewOnExpandProps, ITreeViewOnLoadDataProps, EventCallback, TreeViewAction, INodeRendererProps, ClickActions, IBranchProps, LeafProps, ITreeViewState, }; | ||
export { flattenTree, ITreeViewProps, INode, NodeId, ITreeViewOnSelectProps, ITreeViewOnNodeSelectProps, CLICK_ACTIONS, ITreeViewOnExpandProps, ITreeViewOnLoadDataProps, EventCallback, TreeViewAction, INodeRendererProps, ClickActions, IBranchProps, LeafProps, ITreeViewState, }; | ||
export default TreeView; |
import React from "react"; | ||
import { ITreeViewState, TreeViewAction } from "./reducer"; | ||
import { ClickActions, INode, INodeRendererProps, NodeAction, NodeId, TreeViewData } from "./types"; | ||
import { ClickActions, INode, INodeRendererProps, NodeAction, NodeId } from "./types"; | ||
export interface ITreeViewOnSelectProps { | ||
@@ -37,3 +37,3 @@ element: INode; | ||
/** Tree data*/ | ||
data: TreeViewData; | ||
data: INode[]; | ||
/** Function called when a node changes its selected state */ | ||
@@ -40,0 +40,0 @@ onSelect?: (props: ITreeViewOnSelectProps) => void; |
import React from "react"; | ||
import { ITreeViewState, TreeViewAction } from "./reducer"; | ||
import { ClickActions, INode, INodeRefs, INodeRendererProps, NodeAction, NodeId, TreeViewData } from "./types"; | ||
import { ClickActions, INode, INodeRefs, INodeRendererProps, NodeAction, NodeId } from "./types"; | ||
import { baseClassNames } from "./constants"; | ||
@@ -8,3 +8,3 @@ export interface INodeProps { | ||
dispatch: React.Dispatch<TreeViewAction>; | ||
data: TreeViewData; | ||
data: INode[]; | ||
nodeAction: NodeAction; | ||
@@ -11,0 +11,0 @@ selectedIds: Set<NodeId>; |
@@ -12,3 +12,2 @@ /// <reference types="react" /> | ||
}>; | ||
export type TreeViewData = INode[]; | ||
export type EventCallback = <T, E>(event: React.MouseEvent<T, E> | React.KeyboardEvent<T>) => void; | ||
@@ -15,0 +14,0 @@ export interface INode { |
@@ -1,2 +0,2 @@ | ||
import { EventCallback, INode, INodeRef, NodeId, TreeViewData } from "./types"; | ||
import { EventCallback, INode, INodeRef, NodeId } from "./types"; | ||
export declare const noop: () => void; | ||
@@ -7,14 +7,14 @@ export declare const composeHandlers: (...handlers: EventCallback[]) => EventCallback; | ||
export declare const usePrevious: (x: Set<NodeId>) => Set<NodeId> | undefined; | ||
export declare const usePreviousData: (value: TreeViewData) => TreeViewData | undefined; | ||
export declare const isBranchNode: (data: TreeViewData, i: NodeId) => boolean; | ||
export declare const usePreviousData: (value: INode[]) => INode[] | undefined; | ||
export declare const isBranchNode: (data: INode[], i: NodeId) => boolean; | ||
export declare const scrollToRef: (ref: INodeRef) => void; | ||
export declare const focusRef: (ref: INodeRef) => void; | ||
export declare const getParent: (data: TreeViewData, id: NodeId) => NodeId | null; | ||
export declare const getAncestors: (data: TreeViewData, childId: NodeId, disabledIds: Set<NodeId>) => NodeId[]; | ||
export declare const getDescendants: (data: TreeViewData, id: NodeId, disabledIds: Set<NodeId>) => NodeId[]; | ||
export declare const getSibling: (data: TreeViewData, id: NodeId, diff: number) => NodeId | null; | ||
export declare const getLastAccessible: (data: TreeViewData, id: NodeId, expandedIds: Set<NodeId>) => NodeId; | ||
export declare const getPreviousAccessible: (data: TreeViewData, id: NodeId, expandedIds: Set<NodeId>) => NodeId | null; | ||
export declare const getNextAccessible: (data: TreeViewData, id: NodeId, expandedIds: Set<NodeId>) => NodeId | null; | ||
export declare const propagateSelectChange: (data: TreeViewData, ids: Set<NodeId>, selectedIds: Set<NodeId>, disabledIds: Set<NodeId>, halfSelectedIds: Set<NodeId>, multiSelect?: boolean) => { | ||
export declare const getParent: (data: INode[], id: NodeId) => NodeId | null; | ||
export declare const getAncestors: (data: INode[], childId: NodeId, disabledIds: Set<NodeId>) => NodeId[]; | ||
export declare const getDescendants: (data: INode[], id: NodeId, disabledIds: Set<NodeId>) => NodeId[]; | ||
export declare const getSibling: (data: INode[], id: NodeId, diff: number) => NodeId | null; | ||
export declare const getLastAccessible: (data: INode[], id: NodeId, expandedIds: Set<NodeId>) => NodeId; | ||
export declare const getPreviousAccessible: (data: INode[], id: NodeId, expandedIds: Set<NodeId>) => NodeId | null; | ||
export declare const getNextAccessible: (data: INode[], id: NodeId, expandedIds: Set<NodeId>) => NodeId | null; | ||
export declare const propagateSelectChange: (data: INode[], ids: Set<NodeId>, selectedIds: Set<NodeId>, disabledIds: Set<NodeId>, halfSelectedIds: Set<NodeId>, multiSelect?: boolean) => { | ||
every: Set<NodeId>; | ||
@@ -25,3 +25,3 @@ some: Set<NodeId>; | ||
export declare const getAccessibleRange: ({ data, expandedIds, from, to, }: { | ||
data: TreeViewData; | ||
data: INode[]; | ||
expandedIds: Set<NodeId>; | ||
@@ -36,3 +36,3 @@ from: NodeId; | ||
} | ||
export declare const flattenTree: (tree: ITreeNode) => TreeViewData; | ||
export declare const flattenTree: (tree: ITreeNode) => INode[]; | ||
export declare const getAriaSelected: ({ isSelected, isDisabled, multiSelect, }: { | ||
@@ -49,8 +49,8 @@ isSelected: boolean; | ||
}) => boolean | undefined | "mixed"; | ||
export declare const propagatedIds: (data: TreeViewData, ids: NodeId[], disabledIds: Set<NodeId>) => NodeId[]; | ||
export declare const propagatedIds: (data: INode[], ids: NodeId[], disabledIds: Set<NodeId>) => NodeId[]; | ||
export declare const onComponentBlur: (event: React.FocusEvent, treeNode: HTMLUListElement | null, callback: () => void) => void; | ||
export declare const isBranchSelectedAndHasSelectedDescendants: (data: TreeViewData, elementId: NodeId, selectedIds: Set<NodeId>) => boolean; | ||
export declare const getTreeParent: (data: TreeViewData) => INode; | ||
export declare const getTreeNode: (data: TreeViewData, id: NodeId) => INode; | ||
export declare const validateTreeViewData: (data: TreeViewData) => void; | ||
export declare const isBranchSelectedAndHasSelectedDescendants: (data: INode[], elementId: NodeId, selectedIds: Set<NodeId>) => boolean; | ||
export declare const getTreeParent: (data: INode[]) => INode; | ||
export declare const getTreeNode: (data: INode[], id: NodeId) => INode; | ||
export declare const validateTreeViewData: (data: INode[]) => void; | ||
export {}; |
{ | ||
"name": "react-accessible-treeview", | ||
"description": "A react component that implements the treeview pattern as described by the WAI-ARIA Authoring Practices.", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"author": "lissitz (https://github.com/lissitz)", | ||
@@ -6,0 +6,0 @@ "main": "dist/react-accessible-treeview.cjs.js", |
@@ -12,3 +12,3 @@ import TreeView, { | ||
INode, | ||
TreeViewData, | ||
NodeId, | ||
EventCallback, | ||
@@ -26,3 +26,3 @@ ClickActions, | ||
INode, | ||
TreeViewData, | ||
NodeId, | ||
ITreeViewOnSelectProps, | ||
@@ -29,0 +29,0 @@ ITreeViewOnNodeSelectProps, |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
92447
652