@clevertask/react-sortable-tree 0.0.5 → 0.0.6
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SortableTreeProps } from './types';
|
|
2
|
-
declare function PrivateSortableTree({ items, setItems, isCollapsible, onLazyLoadChildren, showDropIndicator, indentationWidth, isRemovable, onRemoveItem, allowNestedItemAddition, onAddItem, onDragEnd, onItemClick, }: SortableTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function PrivateSortableTree({ items, setItems, isCollapsible, onLazyLoadChildren, showDropIndicator, indentationWidth, isRemovable, onRemoveItem, allowNestedItemAddition, onAddItem, onDragEnd, onItemClick, renderItem, }: SortableTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const SortableTree: import('react').MemoExoticComponent<typeof PrivateSortableTree>;
|
|
4
4
|
export {};
|
|
@@ -17,6 +17,7 @@ export interface Props extends Omit<HTMLAttributes<HTMLLIElement>, 'id'> {
|
|
|
17
17
|
onAdd?(): void;
|
|
18
18
|
onLabelClick?(): void;
|
|
19
19
|
wrapperRef?(node: HTMLLIElement): void;
|
|
20
|
+
renderedItem?: React.ReactNode;
|
|
20
21
|
}
|
|
21
22
|
export declare const _TreeItem: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
22
23
|
export declare const TreeItem: React.MemoExoticComponent<React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>>;
|
|
@@ -113,6 +113,13 @@ export interface SortableTreeProps {
|
|
|
113
113
|
* @param id - The id of the clicked item.
|
|
114
114
|
*/
|
|
115
115
|
onItemClick?: (id: UniqueIdentifier) => void;
|
|
116
|
+
/**
|
|
117
|
+
* You can place a react component next to the item's label. This is temporal while we
|
|
118
|
+
* figure out a way of rendering a whole custom item
|
|
119
|
+
* @param item
|
|
120
|
+
* @returns
|
|
121
|
+
*/
|
|
122
|
+
renderItem?: (item: TreeItem) => React.ReactNode;
|
|
116
123
|
}
|
|
117
124
|
/**
|
|
118
125
|
* Represents the result of a drag operation in the tree.
|