1 | import _extends from 'babel-runtime/helpers/extends';
|
2 | import _typeof from 'babel-runtime/helpers/typeof';
|
3 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
4 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
5 | import _inherits from 'babel-runtime/helpers/inherits';
|
6 |
|
7 | var _class, _temp;
|
8 |
|
9 | import React, { Component } from 'react';
|
10 | import { findDOMNode } from 'react-dom';
|
11 | import PropTypes from 'prop-types';
|
12 | import { polyfill } from 'react-lifecycles-compat';
|
13 | import cx from 'classnames';
|
14 | import Icon from '../../icon';
|
15 | import Checkbox from '../../checkbox';
|
16 | import Animate from '../../animate';
|
17 | import { func, obj, KEYCODE } from '../../util';
|
18 | import TreeNodeInput from './tree-node-input';
|
19 | import TreeNodeIndent from './tree-node-indent';
|
20 |
|
21 | var Expand = Animate.Expand;
|
22 | var bindCtx = func.bindCtx;
|
23 | var isPromise = obj.isPromise,
|
24 | pickOthers = obj.pickOthers,
|
25 | pickAttrsWith = obj.pickAttrsWith;
|
26 |
|
27 | var isRoot = function isRoot(pos) {
|
28 | return (/^0-(\d)+$/.test(pos)
|
29 | );
|
30 | };
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | var TreeNode = (_temp = _class = function (_Component) {
|
36 | _inherits(TreeNode, _Component);
|
37 |
|
38 | function TreeNode(props) {
|
39 | _classCallCheck(this, TreeNode);
|
40 |
|
41 | var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
42 |
|
43 | _this.saveRef = function (ref) {
|
44 | _this.nodeEl = ref;
|
45 | };
|
46 |
|
47 | _this.saveLabelWrapperRef = function (ref) {
|
48 | _this.labelWrapperEl = ref;
|
49 | };
|
50 |
|
51 | _this.state = {
|
52 | editing: false,
|
53 | loading: false,
|
54 | label: props.label
|
55 | };
|
56 |
|
57 | bindCtx(_this, ['handleExpand', 'handleSelect', 'handleCheck', 'handleEditStart', 'handleEditFinish', 'handleRightClick', 'handleDragStart', 'handleDragEnter', 'handleDragOver', 'handleDragLeave', 'handleDragEnd', 'handleDrop', 'handleInputKeyDown', 'handleKeyDown']);
|
58 | return _this;
|
59 | }
|
60 |
|
61 | TreeNode.getDerivedStateFromProps = function getDerivedStateFromProps(props) {
|
62 | if ('label' in props) {
|
63 | return {
|
64 | label: props.label
|
65 | };
|
66 | }
|
67 |
|
68 | return null;
|
69 | };
|
70 |
|
71 | TreeNode.prototype.componentDidMount = function componentDidMount() {
|
72 | this.itemNode = findDOMNode(this.nodeEl);
|
73 | this.setFocus();
|
74 | };
|
75 |
|
76 | TreeNode.prototype.componentDidUpdate = function componentDidUpdate() {
|
77 | this.setFocus();
|
78 | };
|
79 |
|
80 | TreeNode.prototype.getParentNode = function getParentNode() {
|
81 | return this.props.root.getParentNode(this.props.pos);
|
82 | };
|
83 |
|
84 | TreeNode.prototype.focusable = function focusable() {
|
85 | var _props = this.props,
|
86 | root = _props.root,
|
87 | disabled = _props.disabled;
|
88 | var focusable = root.props.focusable;
|
89 |
|
90 | return focusable && !disabled;
|
91 | };
|
92 |
|
93 | TreeNode.prototype.getFocused = function getFocused() {
|
94 | var _props2 = this.props,
|
95 | _key = _props2._key,
|
96 | root = _props2.root;
|
97 | var focusedKey = root.state.focusedKey;
|
98 |
|
99 | return focusedKey === _key;
|
100 | };
|
101 |
|
102 | TreeNode.prototype.setFocus = function setFocus() {
|
103 | var focused = this.getFocused();
|
104 | if (focused && this.focusable()) {
|
105 | this.itemNode.focus({ preventScroll: true });
|
106 | }
|
107 | };
|
108 |
|
109 | TreeNode.prototype.handleExpand = function handleExpand(e) {
|
110 | var _this2 = this;
|
111 |
|
112 | var _props3 = this.props,
|
113 | root = _props3.root,
|
114 | expanded = _props3.expanded,
|
115 | eventKey = _props3.eventKey;
|
116 |
|
117 |
|
118 | if (root.props.isNodeBlock) {
|
119 | e.stopPropagation();
|
120 | }
|
121 |
|
122 | var loading = this.state.loading;
|
123 |
|
124 | if (loading) {
|
125 | return;
|
126 | }
|
127 |
|
128 | var returnValue = root.handleExpand(!expanded, eventKey, this);
|
129 | if (isPromise(returnValue)) {
|
130 | this.setLoading(true);
|
131 | return returnValue.then(function () {
|
132 | _this2.setLoading(false);
|
133 | }, function () {
|
134 | _this2.setLoading(false);
|
135 | });
|
136 | }
|
137 | };
|
138 |
|
139 | TreeNode.prototype.setLoading = function setLoading(loading) {
|
140 | this.setState({ loading: loading });
|
141 | };
|
142 |
|
143 | TreeNode.prototype.handleSelect = function handleSelect(e) {
|
144 | e.preventDefault();
|
145 |
|
146 | var _props4 = this.props,
|
147 | root = _props4.root,
|
148 | selected = _props4.selected,
|
149 | eventKey = _props4.eventKey;
|
150 |
|
151 | root.handleSelect(!selected, eventKey, this, e);
|
152 | };
|
153 |
|
154 | TreeNode.prototype.handleCheck = function handleCheck() {
|
155 | var _props5 = this.props,
|
156 | root = _props5.root,
|
157 | checked = _props5.checked,
|
158 | eventKey = _props5.eventKey;
|
159 |
|
160 | root.handleCheck(!checked, eventKey, this);
|
161 | };
|
162 |
|
163 | TreeNode.prototype.handleEditStart = function handleEditStart(e) {
|
164 | e.preventDefault();
|
165 |
|
166 | this.setState({
|
167 | editing: true
|
168 | });
|
169 | };
|
170 |
|
171 | TreeNode.prototype.handleEditFinish = function handleEditFinish(e) {
|
172 | var label = e.target.value;
|
173 |
|
174 | this.setState({
|
175 | editing: false
|
176 | });
|
177 |
|
178 | var _props6 = this.props,
|
179 | root = _props6.root,
|
180 | eventKey = _props6.eventKey;
|
181 |
|
182 | root.props.onEditFinish(eventKey, label, this);
|
183 | };
|
184 |
|
185 | TreeNode.prototype.handleRightClick = function handleRightClick(e) {
|
186 | this.props.root.props.onRightClick({
|
187 | event: e,
|
188 | node: this
|
189 | });
|
190 | };
|
191 |
|
192 | TreeNode.prototype.handleDragStart = function handleDragStart(e) {
|
193 | e.stopPropagation();
|
194 |
|
195 | this.props.root.handleDragStart(e, this);
|
196 | };
|
197 |
|
198 | TreeNode.prototype.handleDragEnter = function handleDragEnter(e) {
|
199 | e.preventDefault();
|
200 | e.stopPropagation();
|
201 |
|
202 | this.props.root.handleDragEnter(e, this);
|
203 | };
|
204 |
|
205 | TreeNode.prototype.handleDragOver = function handleDragOver(e) {
|
206 | if (this.props.root.canDrop(this)) {
|
207 | e.preventDefault();
|
208 |
|
209 | this.props.root.handleDragOver(e, this);
|
210 | }
|
211 | e.stopPropagation();
|
212 | };
|
213 |
|
214 | TreeNode.prototype.handleDragLeave = function handleDragLeave(e) {
|
215 | e.stopPropagation();
|
216 |
|
217 | this.props.root.handleDragLeave(e, this);
|
218 | };
|
219 |
|
220 | TreeNode.prototype.handleDragEnd = function handleDragEnd(e) {
|
221 | e.stopPropagation();
|
222 |
|
223 | this.props.root.handleDragEnd(e, this);
|
224 | };
|
225 |
|
226 | TreeNode.prototype.handleDrop = function handleDrop(e) {
|
227 | e.preventDefault();
|
228 | e.stopPropagation();
|
229 |
|
230 | this.props.root.handleDrop(e, this);
|
231 | };
|
232 |
|
233 | TreeNode.prototype.handleInputKeyDown = function handleInputKeyDown(e) {
|
234 | if (e.keyCode === KEYCODE.ENTER) {
|
235 | this.handleEditFinish(e);
|
236 | }
|
237 | e.stopPropagation();
|
238 | };
|
239 |
|
240 | TreeNode.prototype.handleKeyDown = function handleKeyDown(e) {
|
241 | var _props7 = this.props,
|
242 | _key = _props7._key,
|
243 | root = _props7.root,
|
244 | disabled = _props7.disabled;
|
245 |
|
246 | if (disabled) {
|
247 | return;
|
248 | }
|
249 |
|
250 | if (this.focusable()) {
|
251 | root.handleItemKeyDown(_key, this, e);
|
252 | }
|
253 |
|
254 | this.props.onKeyDown && this.props.onKeyDown(e);
|
255 | };
|
256 |
|
257 | TreeNode.prototype.addCallbacks = function addCallbacks(props) {
|
258 | var _props8 = this.props,
|
259 | disabled = _props8.disabled,
|
260 | root = _props8.root;
|
261 |
|
262 | if (!disabled) {
|
263 | var selectable = typeof this.props.selectable !== 'undefined' ? this.props.selectable : root.props.selectable;
|
264 | if (selectable) {
|
265 | props.onClick = this.handleSelect;
|
266 | }
|
267 | var editable = typeof this.props.editable !== 'undefined' ? this.props.editable : root.props.editable;
|
268 | if (editable) {
|
269 | props.onDoubleClick = this.handleEditStart;
|
270 | }
|
271 | var draggable = typeof this.props.draggable !== 'undefined' ? this.props.draggable : root.props.draggable;
|
272 | if (draggable) {
|
273 | props.draggable = true;
|
274 | props.onDragStart = this.handleDragStart;
|
275 | props.onDragEnd = this.handleDragEnd;
|
276 | }
|
277 | props.onContextMenu = this.handleRightClick;
|
278 | }
|
279 | };
|
280 |
|
281 | TreeNode.prototype.renderSwitcher = function renderSwitcher(showLine) {
|
282 | var _cx, _cx2;
|
283 |
|
284 | var _props9 = this.props,
|
285 | prefix = _props9.prefix,
|
286 | disabled = _props9.disabled,
|
287 | expanded = _props9.expanded,
|
288 | root = _props9.root;
|
289 | var loadData = root.props.loadData;
|
290 | var loading = this.state.loading;
|
291 |
|
292 |
|
293 | var lineState = showLine ? 'line' : 'noline';
|
294 | var className = cx((_cx = {}, _cx[prefix + 'tree-switcher'] = true, _cx['' + prefix + lineState] = !loading, _cx[prefix + 'close'] = !loading && !showLine && !expanded, _cx[prefix + 'disabled'] = disabled, _cx[prefix + 'loading'] = loading, _cx[prefix + 'loading-' + lineState] = loading, _cx));
|
295 | var iconType = loadData && loading ? 'loading' : showLine ? expanded ? 'minus' : 'add' : 'arrow-down';
|
296 | var iconCls = cx((_cx2 = {}, _cx2[prefix + 'tree-switcher-icon'] = true, _cx2[prefix + 'tree-fold-icon'] = iconType === 'arrow-down', _cx2[prefix + 'tree-switcher-fold-icon'] = showLine && !expanded, _cx2[prefix + 'tree-switcher-unfold-icon'] = showLine && expanded, _cx2));
|
297 |
|
298 | return (
|
299 |
|
300 | React.createElement(
|
301 | 'span',
|
302 | { className: className, onClick: disabled ? null : this.handleExpand },
|
303 | this.renderRightAngle(showLine),
|
304 | React.createElement(Icon, { className: iconCls, type: iconType })
|
305 | )
|
306 | );
|
307 | };
|
308 |
|
309 | TreeNode.prototype.renderNoopSwitcher = function renderNoopSwitcher(showLine) {
|
310 | var _cx3;
|
311 |
|
312 | var _props10 = this.props,
|
313 | prefix = _props10.prefix,
|
314 | pos = _props10.pos;
|
315 |
|
316 |
|
317 | var lineState = showLine ? 'line' : 'noline';
|
318 | var className = cx((_cx3 = {}, _cx3[prefix + 'tree-switcher'] = true, _cx3[prefix + 'noop-' + lineState] = true, _cx3[prefix + 'noop-line-noroot'] = showLine && !isRoot(pos), _cx3));
|
319 |
|
320 | return React.createElement(
|
321 | 'span',
|
322 | { className: className },
|
323 | this.renderRightAngle(showLine)
|
324 | );
|
325 | };
|
326 |
|
327 | TreeNode.prototype.renderRightAngle = function renderRightAngle(showLine) {
|
328 | var _props11 = this.props,
|
329 | prefix = _props11.prefix,
|
330 | pos = _props11.pos;
|
331 |
|
332 |
|
333 | return showLine && !isRoot(pos) ? React.createElement('span', { className: prefix + 'tree-right-angle' }) : null;
|
334 | };
|
335 |
|
336 | TreeNode.prototype.renderCheckbox = function renderCheckbox() {
|
337 | var _props12 = this.props,
|
338 | checked = _props12.checked,
|
339 | indeterminate = _props12.indeterminate,
|
340 | disabled = _props12.disabled,
|
341 | checkboxDisabled = _props12.checkboxDisabled;
|
342 | var label = this.state.label;
|
343 |
|
344 |
|
345 | return React.createElement(Checkbox, {
|
346 | 'aria-label': typeof label === 'string' ? label : null,
|
347 | checked: checked,
|
348 | tabIndex: -1,
|
349 | indeterminate: indeterminate,
|
350 | disabled: disabled || checkboxDisabled
|
351 |
|
352 | , onClick: this.handleCheck
|
353 | });
|
354 | };
|
355 |
|
356 | TreeNode.prototype.renderLabel = function renderLabel() {
|
357 | var _cx4;
|
358 |
|
359 | var _props13 = this.props,
|
360 | prefix = _props13.prefix,
|
361 | root = _props13.root,
|
362 | disabled = _props13.disabled,
|
363 | icon = _props13.icon;
|
364 | var isNodeBlock = root.props.isNodeBlock;
|
365 | var label = this.state.label;
|
366 |
|
367 | var selectable = typeof this.props.selectable !== 'undefined' ? this.props.selectable : root.props.selectable;
|
368 | var labelProps = {
|
369 | className: cx((_cx4 = {}, _cx4[prefix + 'tree-node-label'] = true, _cx4[prefix + 'tree-node-label-selectable'] = selectable && !disabled, _cx4))
|
370 | };
|
371 |
|
372 | if (!isNodeBlock) {
|
373 | this.addCallbacks(labelProps);
|
374 | }
|
375 |
|
376 | var iconEl = typeof icon === 'string' ? React.createElement(Icon, { type: icon }) : icon;
|
377 |
|
378 | return React.createElement(
|
379 | 'div',
|
380 | { className: prefix + 'tree-node-label-wrapper', ref: this.saveLabelWrapperRef },
|
381 | React.createElement(
|
382 | 'div',
|
383 | labelProps,
|
384 | iconEl,
|
385 | label
|
386 | )
|
387 | );
|
388 | };
|
389 |
|
390 | TreeNode.prototype.renderInput = function renderInput() {
|
391 | var prefix = this.props.prefix;
|
392 | var label = this.state.label;
|
393 |
|
394 | return React.createElement(
|
395 | 'div',
|
396 | { className: prefix + 'tree-node-label-wrapper', ref: this.saveLabelWrapperRef },
|
397 | React.createElement(TreeNodeInput, {
|
398 | prefix: prefix,
|
399 | defaultValue: label,
|
400 | onBlur: this.handleEditFinish,
|
401 | onKeyDown: this.handleInputKeyDown
|
402 | })
|
403 | );
|
404 | };
|
405 |
|
406 | TreeNode.prototype.renderChildTree = function renderChildTree() {
|
407 | var _props14 = this.props,
|
408 | prefix = _props14.prefix,
|
409 | children = _props14.children;
|
410 |
|
411 |
|
412 | return children && this.addAnimationIfNeeded(React.createElement(
|
413 | 'ul',
|
414 | { role: 'group', className: prefix + 'tree-child-tree' },
|
415 | children
|
416 | ));
|
417 | };
|
418 |
|
419 | TreeNode.prototype.addAnimationIfNeeded = function addAnimationIfNeeded(node) {
|
420 | var root = this.props.root;
|
421 |
|
422 |
|
423 | return root && root.props.animation ? React.createElement(
|
424 | Expand,
|
425 | { animationAppear: false },
|
426 | node
|
427 | ) : node;
|
428 | };
|
429 |
|
430 | TreeNode.prototype.render = function render() {
|
431 | var _cx5, _cx6, _ref;
|
432 |
|
433 | var _props15 = this.props,
|
434 | prefix = _props15.prefix,
|
435 | rtl = _props15.rtl,
|
436 | className = _props15.className,
|
437 | isLeaf = _props15.isLeaf,
|
438 | level = _props15.level,
|
439 | root = _props15.root,
|
440 | selected = _props15.selected,
|
441 | checked = _props15.checked,
|
442 | disabled = _props15.disabled,
|
443 | dragOver = _props15.dragOver,
|
444 | dragOverGapTop = _props15.dragOverGapTop,
|
445 | dragOverGapBottom = _props15.dragOverGapBottom,
|
446 | _key = _props15._key,
|
447 | size = _props15.size,
|
448 | posinset = _props15.posinset,
|
449 | children = _props15.children,
|
450 | expanded = _props15.expanded,
|
451 | isLastChild = _props15.isLastChild;
|
452 | var _root$props = root.props,
|
453 | isNodeBlock = _root$props.isNodeBlock,
|
454 | showLine = _root$props.showLine,
|
455 | rootDraggable = _root$props.draggable,
|
456 | filterTreeNode = _root$props.filterTreeNode;
|
457 | var label = this.state.label;
|
458 |
|
459 |
|
460 | var ARIA_PREFIX = 'aria-';
|
461 | var ariaProps = pickAttrsWith(this.props, ARIA_PREFIX);
|
462 | var others = pickOthers(Object.keys(TreeNode.propTypes), this.props);
|
463 |
|
464 | var hasRenderChildNodes = root && root.props.renderChildNodes;
|
465 | var shouldShouldLine = !isNodeBlock && showLine && !hasRenderChildNodes;
|
466 | var useVirtual = root && root.props.useVirtual;
|
467 |
|
468 |
|
469 | Object.keys(others).forEach(function (key) {
|
470 | if (key.match(ARIA_PREFIX)) {
|
471 | delete others[key];
|
472 | }
|
473 | });
|
474 |
|
475 | if (rootDraggable) {
|
476 | others.onDragEnter = this.handleDragEnter;
|
477 | others.onDragOver = this.handleDragOver;
|
478 | others.onDragLeave = this.handleDragLeave;
|
479 | others.onDrop = this.handleDrop;
|
480 | }
|
481 | var newClassName = cx((_cx5 = {}, _cx5[prefix + 'tree-node'] = true, _cx5[prefix + 'filtered'] = !!filterTreeNode && !!root.filterTreeNode(this), _cx5[className] = !!className, _cx5));
|
482 |
|
483 | var innerClassName = cx((_cx6 = {}, _cx6[prefix + 'tree-node-inner'] = true, _cx6[prefix + 'selected'] = selected, _cx6[prefix + 'disabled'] = disabled, _cx6[prefix + 'drag-over'] = dragOver, _cx6[prefix + 'drag-over-gap-top'] = dragOverGapTop, _cx6[prefix + 'drag-over-gap-bottom'] = dragOverGapBottom, _cx6));
|
484 |
|
485 | var defaultPaddingLeft = (typeof isNodeBlock === 'undefined' ? 'undefined' : _typeof(isNodeBlock)) === 'object' ? parseInt(isNodeBlock.defaultPaddingLeft || 0) : 0;
|
486 | var paddingLeftProp = rtl ? 'paddingRight' : 'paddingLeft';
|
487 |
|
488 | var indent = (typeof isNodeBlock === 'undefined' ? 'undefined' : _typeof(isNodeBlock)) === 'object' ? parseInt(isNodeBlock.indent || 24) : 24;
|
489 | var innerStyle = isNodeBlock ? (_ref = {}, _ref[paddingLeftProp] = (useVirtual ? 0 : indent * (level - 1)) + defaultPaddingLeft + 'px', _ref) : null;
|
490 |
|
491 | var innerProps = _extends({
|
492 | className: innerClassName,
|
493 | style: innerStyle,
|
494 | onKeyDown: this.handleKeyDown
|
495 | }, ariaProps);
|
496 |
|
497 | if (isNodeBlock) {
|
498 | this.addCallbacks(innerProps);
|
499 | }
|
500 |
|
501 | var checkable = typeof this.props.checkable !== 'undefined' ? this.props.checkable : root.props.checkable;
|
502 |
|
503 | var editing = this.state.editing;
|
504 |
|
505 |
|
506 | innerProps.tabIndex = root.tabbableKey === _key ? '0' : '-1';
|
507 |
|
508 | if (rtl) {
|
509 | others.dir = 'rtl';
|
510 | }
|
511 |
|
512 | return this.addAnimationIfNeeded(React.createElement(
|
513 | 'li',
|
514 | _extends({ role: 'presentation', className: newClassName }, others),
|
515 | React.createElement(
|
516 | 'div',
|
517 | _extends({
|
518 | ref: this.saveRef,
|
519 | role: 'treeitem',
|
520 | 'aria-selected': selected,
|
521 | 'aria-disabled': disabled,
|
522 | 'aria-checked': checked,
|
523 | 'aria-expanded': !isLeaf,
|
524 | 'aria-label': typeof label === 'string' ? label : null,
|
525 | 'aria-level': level,
|
526 | 'aria-posinset': posinset,
|
527 | 'aria-setsize': size
|
528 | }, innerProps),
|
529 | useVirtual && !hasRenderChildNodes && React.createElement(TreeNodeIndent, {
|
530 | prefix: prefix,
|
531 | level: level,
|
532 | isLastChild: isLastChild,
|
533 | showLine: shouldShouldLine
|
534 | }),
|
535 | isLeaf ? this.renderNoopSwitcher(shouldShouldLine) : this.renderSwitcher(shouldShouldLine),
|
536 | checkable ? this.renderCheckbox() : null,
|
537 | editing ? this.renderInput() : this.renderLabel()
|
538 | ),
|
539 | expanded && (hasRenderChildNodes ? children : this.renderChildTree(children))
|
540 | ));
|
541 | };
|
542 |
|
543 | return TreeNode;
|
544 | }(Component), _class.propTypes = {
|
545 | prefix: PropTypes.string,
|
546 | rtl: PropTypes.bool,
|
547 | _key: PropTypes.string,
|
548 | className: PropTypes.string,
|
549 | |
550 |
|
551 |
|
552 | children: PropTypes.node,
|
553 | |
554 |
|
555 |
|
556 | label: PropTypes.node,
|
557 | |
558 |
|
559 |
|
560 | selectable: PropTypes.bool,
|
561 | |
562 |
|
563 |
|
564 | checkable: PropTypes.bool,
|
565 | |
566 |
|
567 |
|
568 | editable: PropTypes.bool,
|
569 | |
570 |
|
571 |
|
572 | draggable: PropTypes.bool,
|
573 | |
574 |
|
575 |
|
576 | disabled: PropTypes.bool,
|
577 | |
578 |
|
579 |
|
580 | checkboxDisabled: PropTypes.bool,
|
581 | |
582 |
|
583 |
|
584 | isLeaf: PropTypes.bool,
|
585 | root: PropTypes.object,
|
586 | eventKey: PropTypes.string,
|
587 | pos: PropTypes.string,
|
588 | expanded: PropTypes.bool,
|
589 | selected: PropTypes.bool,
|
590 | checked: PropTypes.bool,
|
591 | indeterminate: PropTypes.bool,
|
592 | dragOver: PropTypes.bool,
|
593 | dragOverGapTop: PropTypes.bool,
|
594 | dragOverGapBottom: PropTypes.bool,
|
595 | parentNode: PropTypes.object,
|
596 | onKeyDown: PropTypes.func,
|
597 |
|
598 | size: PropTypes.number,
|
599 |
|
600 | posinset: PropTypes.number,
|
601 |
|
602 | isLastChild: PropTypes.arrayOf(PropTypes.bool),
|
603 | |
604 |
|
605 |
|
606 |
|
607 | icon: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
|
608 | }, _class.defaultProps = {
|
609 | label: '---',
|
610 | rtl: false,
|
611 | disabled: false,
|
612 | checkboxDisabled: false,
|
613 | size: 1,
|
614 | posinset: 1
|
615 | }, _temp);
|
616 | TreeNode.displayName = 'TreeNode';
|
617 |
|
618 |
|
619 | export default polyfill(TreeNode); |
\ | No newline at end of file |