@douyinfe/semi-ui 2.39.2 → 2.39.3

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.
@@ -6,7 +6,7 @@ import BaseComponent from '../_base/baseComponent';
6
6
  import Input from '../input/index';
7
7
  import TreeNode from './treeNode';
8
8
  import '@douyinfe/semi-foundation/lib/cjs/tree/tree.css';
9
- import { TreeProps, TreeState, TreeNodeProps, TreeNodeData, FlattenNode, KeyEntity, ScrollData } from './interface';
9
+ import { TreeProps, TreeState, TreeNodeProps, TreeNodeData, FlattenNode, KeyEntity, OptionProps, ScrollData } from './interface';
10
10
  export * from './interface';
11
11
  export type { AutoSizerProps } from './autoSizer';
12
12
  declare class Tree extends BaseComponent<TreeProps, TreeState> {
@@ -137,6 +137,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
137
137
  getTreeNodeKey: (treeNode: TreeNodeData) => any;
138
138
  renderTreeNode: (treeNode: FlattenNode, ind?: number, style?: React.CSSProperties) => JSX.Element;
139
139
  itemKey: (index: number, data: KeyEntity) => any;
140
+ option: ({ index, style, data }: OptionProps) => JSX.Element;
140
141
  renderNodeList(): JSX.Element;
141
142
  render(): JSX.Element;
142
143
  }
@@ -183,6 +183,14 @@ class Tree extends _baseComponent.default {
183
183
  // Return a value that uniquely identifies this item.
184
184
  return item.key;
185
185
  };
186
+ this.option = _ref2 => {
187
+ let {
188
+ index,
189
+ style,
190
+ data
191
+ } = _ref2;
192
+ return this.renderTreeNode(data[index], index, style);
193
+ };
186
194
  this.state = {
187
195
  inputValue: '',
188
196
  keyEntities: {},
@@ -441,11 +449,11 @@ class Tree extends _baseComponent.default {
441
449
  updateState: states => {
442
450
  this.setState(Object.assign({}, states));
443
451
  },
444
- notifyExpand: (expandedKeys, _ref2) => {
452
+ notifyExpand: (expandedKeys, _ref3) => {
445
453
  let {
446
454
  expanded: bool,
447
455
  node
448
- } = _ref2;
456
+ } = _ref3;
449
457
  this.props.onExpand && this.props.onExpand([...expandedKeys], {
450
458
  expanded: bool,
451
459
  node
@@ -546,14 +554,6 @@ class Tree extends _baseComponent.default {
546
554
  renderTreeNode: this.renderTreeNode
547
555
  });
548
556
  }
549
- const option = _ref3 => {
550
- let {
551
- index,
552
- style,
553
- data
554
- } = _ref3;
555
- return this.renderTreeNode(data[index], index, style);
556
- };
557
557
  return /*#__PURE__*/_react.default.createElement(_autoSizer.default, {
558
558
  defaultHeight: virtualize.height,
559
559
  defaultWidth: virtualize.width
@@ -574,7 +574,7 @@ class Tree extends _baseComponent.default {
574
574
  style: {
575
575
  direction
576
576
  }
577
- }, option);
577
+ }, this.option);
578
578
  });
579
579
  }
580
580
  render() {
@@ -6,7 +6,7 @@ import BaseComponent from '../_base/baseComponent';
6
6
  import Input from '../input/index';
7
7
  import TreeNode from './treeNode';
8
8
  import '@douyinfe/semi-foundation/lib/es/tree/tree.css';
9
- import { TreeProps, TreeState, TreeNodeProps, TreeNodeData, FlattenNode, KeyEntity, ScrollData } from './interface';
9
+ import { TreeProps, TreeState, TreeNodeProps, TreeNodeData, FlattenNode, KeyEntity, OptionProps, ScrollData } from './interface';
10
10
  export * from './interface';
11
11
  export type { AutoSizerProps } from './autoSizer';
12
12
  declare class Tree extends BaseComponent<TreeProps, TreeState> {
@@ -137,6 +137,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
137
137
  getTreeNodeKey: (treeNode: TreeNodeData) => any;
138
138
  renderTreeNode: (treeNode: FlattenNode, ind?: number, style?: React.CSSProperties) => JSX.Element;
139
139
  itemKey: (index: number, data: KeyEntity) => any;
140
+ option: ({ index, style, data }: OptionProps) => JSX.Element;
140
141
  renderNodeList(): JSX.Element;
141
142
  render(): JSX.Element;
142
143
  }
@@ -164,6 +164,14 @@ class Tree extends BaseComponent {
164
164
  // Return a value that uniquely identifies this item.
165
165
  return item.key;
166
166
  };
167
+ this.option = _ref2 => {
168
+ let {
169
+ index,
170
+ style,
171
+ data
172
+ } = _ref2;
173
+ return this.renderTreeNode(data[index], index, style);
174
+ };
167
175
  this.state = {
168
176
  inputValue: '',
169
177
  keyEntities: {},
@@ -422,11 +430,11 @@ class Tree extends BaseComponent {
422
430
  updateState: states => {
423
431
  this.setState(Object.assign({}, states));
424
432
  },
425
- notifyExpand: (expandedKeys, _ref2) => {
433
+ notifyExpand: (expandedKeys, _ref3) => {
426
434
  let {
427
435
  expanded: bool,
428
436
  node
429
- } = _ref2;
437
+ } = _ref3;
430
438
  this.props.onExpand && this.props.onExpand([...expandedKeys], {
431
439
  expanded: bool,
432
440
  node
@@ -527,14 +535,6 @@ class Tree extends BaseComponent {
527
535
  renderTreeNode: this.renderTreeNode
528
536
  });
529
537
  }
530
- const option = _ref3 => {
531
- let {
532
- index,
533
- style,
534
- data
535
- } = _ref3;
536
- return this.renderTreeNode(data[index], index, style);
537
- };
538
538
  return /*#__PURE__*/React.createElement(AutoSizer, {
539
539
  defaultHeight: virtualize.height,
540
540
  defaultWidth: virtualize.width
@@ -555,7 +555,7 @@ class Tree extends BaseComponent {
555
555
  style: {
556
556
  direction
557
557
  }
558
- }, option);
558
+ }, this.option);
559
559
  });
560
560
  }
561
561
  render() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.39.2",
3
+ "version": "2.39.3",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -17,12 +17,12 @@
17
17
  "lib/*"
18
18
  ],
19
19
  "dependencies": {
20
- "@douyinfe/semi-animation": "2.39.2",
21
- "@douyinfe/semi-animation-react": "2.39.2",
22
- "@douyinfe/semi-foundation": "2.39.2",
23
- "@douyinfe/semi-icons": "2.39.2",
24
- "@douyinfe/semi-illustrations": "2.39.2",
25
- "@douyinfe/semi-theme-default": "2.39.2",
20
+ "@douyinfe/semi-animation": "2.39.3",
21
+ "@douyinfe/semi-animation-react": "2.39.3",
22
+ "@douyinfe/semi-foundation": "2.39.3",
23
+ "@douyinfe/semi-icons": "2.39.3",
24
+ "@douyinfe/semi-illustrations": "2.39.3",
25
+ "@douyinfe/semi-theme-default": "2.39.3",
26
26
  "async-validator": "^3.5.0",
27
27
  "classnames": "^2.2.6",
28
28
  "copy-text-to-clipboard": "^2.1.1",
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "4a5d81c6ff12a6ecf0a0f96b5a9ae96174dd12b7",
72
+ "gitHead": "3f036a160c7c671248a66274c749eeaaf3e92343",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",