Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
62dc021
chore: init link
zombieJ Dec 9, 2021
999748c
chore: load Data
zombieJ Dec 9, 2021
3093133
chore: connect with displayValue
zombieJ Dec 9, 2021
9bf1c1f
chore: back of selec
zombieJ Dec 10, 2021
77c6779
chore: back of onChange
zombieJ Dec 10, 2021
e73fd1c
chore: checked logic
zombieJ Dec 10, 2021
010ae7b
chore: conduction tree data
zombieJ Dec 10, 2021
2d5692f
chore: conduction tree de-select logic
zombieJ Dec 10, 2021
a53e69d
chore: back of filter
zombieJ Dec 13, 2021
f410c76
fix: return type of onChange
zombieJ Dec 13, 2021
b813f70
fix: filter hightlight logic
zombieJ Dec 13, 2021
335c68b
fix: display logic
zombieJ Dec 13, 2021
e7a3087
fix: onChange return ueseless content
zombieJ Dec 13, 2021
ccb2203
fix: Selection remove also need conduction
zombieJ Dec 13, 2021
438dbac
fix: Missing expandedKeys
zombieJ Dec 13, 2021
68d0a50
fix: wrap with props
zombieJ Dec 13, 2021
e80ca74
fix: empty value should show placeholder
zombieJ Dec 13, 2021
d5d2d90
fix: single null
zombieJ Dec 14, 2021
707f5fe
fix: check logic conduction
zombieJ Dec 14, 2021
dee1c91
chore: rename
zombieJ Dec 14, 2021
6b00058
fix: first value logic
zombieJ Dec 14, 2021
cc4c3ad
fix: search logic
zombieJ Dec 14, 2021
5f3b9cb
fix: single always trigger onSelect
zombieJ Dec 14, 2021
1a66d92
fix: update snapshot
zombieJ Dec 14, 2021
8dd94b6
test: More snapshot
zombieJ Dec 14, 2021
b50837e
test: more snapshot
zombieJ Dec 14, 2021
2fcd341
test: accessibility
zombieJ Dec 14, 2021
0082319
fix: legacy logic of TreeSelect
zombieJ Dec 14, 2021
5343d49
test: Update snapshot
zombieJ Dec 14, 2021
39187b8
chore: Add onExpanded
zombieJ Dec 14, 2021
67c7d89
chore: back of origin warning
zombieJ Dec 14, 2021
d2aed86
chore: clean up
zombieJ Dec 14, 2021
1deb7fe
chore: move logic in
zombieJ Dec 14, 2021
a27135e
test: Add remove empty test case
zombieJ Dec 14, 2021
ad35834
fix: missing keys
zombieJ Dec 14, 2021
ec01304
fix: rm useless code
zombieJ Dec 14, 2021
82af61f
chore: fix lint
zombieJ Dec 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ class Demo extends React.Component {

<h2>check select</h2>
<TreeSelect
open
allowClear
className="check-select"
transitionName="rc-tree-select-dropdown-slide-up"
choiceTransitionName="rc-tree-select-selection__choice-zoom"
Expand All @@ -277,7 +279,7 @@ class Demo extends React.Component {
onSelect={this.onSelect}
maxTagCount="responsive"
maxTagPlaceholder={valueList => {
console.log('Max Tag Rest Value:', valueList);
// console.log('Max Tag Rest Value:', valueList);
return `${valueList.length} rest...`;
}}
/>
Expand Down
39 changes: 28 additions & 11 deletions examples/debug.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
/* eslint-disable react/no-array-index-key */
/* eslint-disable */

import React from 'react';
import TreeSelect from '../src';
import '../assets/index.less';

export default () => {
const [treeData, setTreeData] = React.useState([]);
const { TreeNode, SHOW_ALL, SHOW_CHILD } = TreeSelect;
const SelectNode = TreeNode;

React.useEffect(() => {
setTimeout(() => {
console.clear();
setTreeData([{ value: 'light', title: 'bamboo' }]);
}, 1000);
}, []);
const treeData = [
{ key: '0', value: '0', title: 'label0' },
{ key: '1', value: '1', title: 'label1' },
];

return <TreeSelect value="light" treeData={treeData} />;
};
const children = [
<TreeNode key="0" value="0" title="label0" foo={0} />,
<TreeNode key="1" value="1" title="label1" foo={1} />,
];

const createSelect = props => <TreeSelect treeData={treeData} multiple {...props} />;

// export default () => (
// <TreeSelect
// defaultValue={['not-exist']}
// treeCheckable
// style={{ width: 300 }}
// onDeselect={console.error}
// />
// );

export default () =>
createSelect({
maxTagCount: 1,
value: ['0', 'not exist'],
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
"dependencies": {
"@babel/runtime": "^7.10.1",
"classnames": "2.x",
"rc-select": "~13.2.1",
"rc-tree": "~5.3.0",
"rc-select": "~14.0.0-alpha.8",
"rc-tree": "~5.3.3",
"rc-util": "^5.16.1"
}
}
34 changes: 0 additions & 34 deletions src/Context.tsx

This file was deleted.

28 changes: 28 additions & 0 deletions src/LegacyContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as React from 'react';
import type { DataEntity, IconType } from 'rc-tree/lib/interface';
import type { Key, LegacyDataNode, RawValueType } from './interface';

interface LegacyContextProps {
checkable: boolean | React.ReactNode;
checkedKeys: Key[];
halfCheckedKeys: Key[];
treeExpandedKeys: Key[];
treeDefaultExpandedKeys: Key[];
onTreeExpand: (keys: Key[]) => void;
treeDefaultExpandAll: boolean;
treeIcon: IconType;
showTreeIcon: boolean;
switcherIcon: IconType;
treeLine: boolean;
treeNodeFilterProp: string;
treeLoadedKeys: Key[];
treeMotion: any;
loadData: (treeNode: LegacyDataNode) => Promise<unknown>;
onTreeLoad: (loadedKeys: Key[]) => void;

keyEntities: Record<RawValueType, DataEntity<any>>;
}

const LegacySelectContext = React.createContext<LegacyContextProps>(null);

export default LegacySelectContext;
Loading