mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
yarn: update react-complex-tree to v2.0.0
Includes fixes for breaking changes.
This commit is contained in:
committed by
David Lechner
parent
8b3fa29f65
commit
ee466ac904
+19
-12
@@ -18,6 +18,7 @@ import {
|
||||
import React, { createContext } from 'react';
|
||||
import { TreeItem, TreeRenderProps, useTree } from 'react-complex-tree';
|
||||
import { useBoolean } from 'usehooks-ts';
|
||||
import { assert } from '.';
|
||||
|
||||
/** Combines class names into a string. */
|
||||
const cx = (...classNames: Array<string | undefined | false>): string =>
|
||||
@@ -99,7 +100,7 @@ export const renderers: Omit<
|
||||
)}
|
||||
{...props.context.itemContainerWithoutChildrenProps}
|
||||
>
|
||||
{props.item.hasChildren ? (
|
||||
{props.item.isFolder ? (
|
||||
props.arrow
|
||||
) : (
|
||||
<span className={Classes.TREE_NODE_CARET_NONE} />
|
||||
@@ -201,17 +202,23 @@ export const renderers: Omit<
|
||||
</form>
|
||||
),
|
||||
|
||||
renderSearchInput: (props) => (
|
||||
<div className={cx('rct-tree-search-input-container')}>
|
||||
<InputGroup
|
||||
{...(props.inputProps as Omit<
|
||||
React.HTMLAttributes<HTMLInputElement>,
|
||||
'defaultValue'
|
||||
>)}
|
||||
placeholder="Search..."
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
renderSearchInput: (props) => {
|
||||
const { ref, defaultValue, value, ...inputProps } = props.inputProps;
|
||||
|
||||
assert(typeof ref !== 'string', 'cannot be a legacy ref');
|
||||
|
||||
// unused - have to be excluded from inputProps for InputGroup typing compatibility
|
||||
defaultValue;
|
||||
value;
|
||||
|
||||
// TODO: translate placeholder and inputProps.aria-label
|
||||
|
||||
return (
|
||||
<div className={cx('rct-tree-search-input-container')}>
|
||||
<InputGroup inputRef={ref} {...inputProps} placeholder="Search..." />
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
renderDepthOffset: 1,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user