@instructure/ui-tree-browser 11.7.3-snapshot-7 → 11.7.3-snapshot-26
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.
- package/CHANGELOG.md +5 -2
- package/es/TreeBrowser/v1/TreeButton/index.js +56 -49
- package/es/TreeBrowser/v1/TreeButton/styles.js +7 -5
- package/es/TreeBrowser/v1/TreeButton/theme.js +32 -31
- package/es/TreeBrowser/v1/TreeCollection/index.js +115 -104
- package/es/TreeBrowser/v1/TreeCollection/styles.js +4 -2
- package/es/TreeBrowser/v1/TreeCollection/theme.js +11 -10
- package/es/TreeBrowser/v1/TreeNode/index.js +39 -37
- package/es/TreeBrowser/v1/index.js +94 -82
- package/es/TreeBrowser/v1/theme.js +8 -7
- package/es/TreeBrowser/v2/TreeButton/index.js +82 -71
- package/es/TreeBrowser/v2/TreeButton/styles.js +10 -8
- package/es/TreeBrowser/v2/TreeCollection/index.js +115 -104
- package/es/TreeBrowser/v2/TreeCollection/styles.js +4 -2
- package/es/TreeBrowser/v2/TreeNode/index.js +64 -58
- package/es/TreeBrowser/v2/index.js +112 -99
- package/lib/TreeBrowser/v1/TreeButton/index.js +56 -49
- package/lib/TreeBrowser/v1/TreeButton/styles.js +7 -5
- package/lib/TreeBrowser/v1/TreeButton/theme.js +32 -31
- package/lib/TreeBrowser/v1/TreeCollection/index.js +115 -104
- package/lib/TreeBrowser/v1/TreeCollection/styles.js +4 -2
- package/lib/TreeBrowser/v1/TreeCollection/theme.js +11 -10
- package/lib/TreeBrowser/v1/TreeNode/index.js +39 -37
- package/lib/TreeBrowser/v1/index.js +94 -82
- package/lib/TreeBrowser/v1/theme.js +8 -7
- package/lib/TreeBrowser/v2/TreeButton/index.js +82 -71
- package/lib/TreeBrowser/v2/TreeButton/styles.js +10 -8
- package/lib/TreeBrowser/v2/TreeCollection/index.js +115 -104
- package/lib/TreeBrowser/v2/TreeCollection/styles.js +4 -2
- package/lib/TreeBrowser/v2/TreeNode/index.js +64 -58
- package/lib/TreeBrowser/v2/index.js +112 -99
- package/package.json +12 -12
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -15,7 +15,7 @@ var _props = require("./props");
|
|
|
15
15
|
var _TreeBrowserContext = _interopRequireDefault(require("../TreeBrowserContext"));
|
|
16
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
|
-
var _dec, _class
|
|
18
|
+
var _dec, _class;
|
|
19
19
|
/*
|
|
20
20
|
* The MIT License (MIT)
|
|
21
21
|
*
|
|
@@ -45,72 +45,88 @@ parent: TreeBrowser
|
|
|
45
45
|
id: TreeBrowser.Collection
|
|
46
46
|
---
|
|
47
47
|
**/
|
|
48
|
-
let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
48
|
+
let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class TreeCollection extends _react.Component {
|
|
49
|
+
static displayName = "TreeCollection";
|
|
50
|
+
static componentId = 'TreeBrowser.Collection';
|
|
51
|
+
static allowedProps = _props.allowedProps;
|
|
52
|
+
static contextType = _TreeBrowserContext.default;
|
|
53
|
+
static defaultProps = {
|
|
54
|
+
collections: [],
|
|
55
|
+
items: [],
|
|
56
|
+
expanded: false,
|
|
57
|
+
selection: '',
|
|
58
|
+
size: 'medium',
|
|
59
|
+
variant: 'folderTree',
|
|
60
|
+
getItemProps: props => props,
|
|
61
|
+
getCollectionProps: props => props,
|
|
62
|
+
isCollectionFlattened: false
|
|
63
|
+
};
|
|
64
|
+
ref = null;
|
|
49
65
|
constructor(props) {
|
|
50
66
|
super(props);
|
|
51
|
-
this.ref = null;
|
|
52
|
-
this.handleFocus = (e, item) => {
|
|
53
|
-
e.stopPropagation();
|
|
54
|
-
this.setState({
|
|
55
|
-
focused: `${item.type}_${item.id}`
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
this.handleBlur = (e, _item) => {
|
|
59
|
-
e.stopPropagation();
|
|
60
|
-
this.setState({
|
|
61
|
-
focused: ''
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
this.handleCollectionClick = e => {
|
|
65
|
-
const _this$props = this.props,
|
|
66
|
-
id = _this$props.id,
|
|
67
|
-
onCollectionClick = _this$props.onCollectionClick,
|
|
68
|
-
expanded = _this$props.expanded;
|
|
69
|
-
const collection = {
|
|
70
|
-
id,
|
|
71
|
-
expanded: !expanded,
|
|
72
|
-
type: 'collection'
|
|
73
|
-
};
|
|
74
|
-
if (onCollectionClick && typeof onCollectionClick === 'function') {
|
|
75
|
-
onCollectionClick(e, collection);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
this.handleCollectionKeyDown = e => {
|
|
79
|
-
const _this$props2 = this.props,
|
|
80
|
-
id = _this$props2.id,
|
|
81
|
-
onKeyDown = _this$props2.onKeyDown,
|
|
82
|
-
expanded = _this$props2.expanded;
|
|
83
|
-
const collection = {
|
|
84
|
-
id,
|
|
85
|
-
expanded: !expanded,
|
|
86
|
-
type: 'collection'
|
|
87
|
-
};
|
|
88
|
-
if (onKeyDown && typeof onKeyDown === 'function') {
|
|
89
|
-
onKeyDown(e, collection);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
67
|
this.state = {
|
|
93
68
|
focused: ''
|
|
94
69
|
};
|
|
95
70
|
}
|
|
96
71
|
componentDidMount() {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
animation: (_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.animation
|
|
72
|
+
this.props.makeStyles?.({
|
|
73
|
+
animation: this.context?.animation
|
|
100
74
|
});
|
|
101
75
|
}
|
|
102
76
|
componentDidUpdate() {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
animation: (_this$context2 = this.context) === null || _this$context2 === void 0 ? void 0 : _this$context2.animation
|
|
77
|
+
this.props.makeStyles?.({
|
|
78
|
+
animation: this.context?.animation
|
|
106
79
|
});
|
|
107
80
|
}
|
|
108
81
|
get itemsLevel() {
|
|
109
|
-
const
|
|
110
|
-
level
|
|
111
|
-
isCollectionFlattened
|
|
82
|
+
const {
|
|
83
|
+
level,
|
|
84
|
+
isCollectionFlattened
|
|
85
|
+
} = this.props;
|
|
112
86
|
return isCollectionFlattened ? level : level + 1;
|
|
113
87
|
}
|
|
88
|
+
handleFocus = (e, item) => {
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
this.setState({
|
|
91
|
+
focused: `${item.type}_${item.id}`
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
handleBlur = (e, _item) => {
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
this.setState({
|
|
97
|
+
focused: ''
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
handleCollectionClick = e => {
|
|
101
|
+
const {
|
|
102
|
+
id,
|
|
103
|
+
onCollectionClick,
|
|
104
|
+
expanded
|
|
105
|
+
} = this.props;
|
|
106
|
+
const collection = {
|
|
107
|
+
id,
|
|
108
|
+
expanded: !expanded,
|
|
109
|
+
type: 'collection'
|
|
110
|
+
};
|
|
111
|
+
if (onCollectionClick && typeof onCollectionClick === 'function') {
|
|
112
|
+
onCollectionClick(e, collection);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
handleCollectionKeyDown = e => {
|
|
116
|
+
const {
|
|
117
|
+
id,
|
|
118
|
+
onKeyDown,
|
|
119
|
+
expanded
|
|
120
|
+
} = this.props;
|
|
121
|
+
const collection = {
|
|
122
|
+
id,
|
|
123
|
+
expanded: !expanded,
|
|
124
|
+
type: 'collection'
|
|
125
|
+
};
|
|
126
|
+
if (onKeyDown && typeof onKeyDown === 'function') {
|
|
127
|
+
onKeyDown(e, collection);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
114
130
|
get collectionsCount() {
|
|
115
131
|
const collections = this.props.collections;
|
|
116
132
|
return collections && collections.length > 0 ? collections.length : 0;
|
|
@@ -123,10 +139,11 @@ let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLega
|
|
|
123
139
|
return this.collectionsCount + this.itemsCount + (this.props.renderBeforeItems ? 1 : 0) + (this.props.renderAfterItems ? 1 : 0);
|
|
124
140
|
}
|
|
125
141
|
sortChildren() {
|
|
126
|
-
const
|
|
127
|
-
collections
|
|
128
|
-
items
|
|
129
|
-
compareFunc
|
|
142
|
+
const {
|
|
143
|
+
collections,
|
|
144
|
+
items,
|
|
145
|
+
compareFunc
|
|
146
|
+
} = this.props;
|
|
130
147
|
if (!compareFunc) return [];
|
|
131
148
|
const collections_ = collections ? collections.map(collection => {
|
|
132
149
|
return {
|
|
@@ -145,13 +162,14 @@ let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLega
|
|
|
145
162
|
return renderQueue;
|
|
146
163
|
}
|
|
147
164
|
renderChildren() {
|
|
148
|
-
const
|
|
149
|
-
collections
|
|
150
|
-
items
|
|
151
|
-
id
|
|
152
|
-
renderBeforeItems
|
|
153
|
-
renderAfterItems
|
|
154
|
-
compareFunc
|
|
165
|
+
const {
|
|
166
|
+
collections,
|
|
167
|
+
items,
|
|
168
|
+
id,
|
|
169
|
+
renderBeforeItems,
|
|
170
|
+
renderAfterItems,
|
|
171
|
+
compareFunc
|
|
172
|
+
} = this.props;
|
|
155
173
|
let position = 1;
|
|
156
174
|
const sortedChildren = this.sortChildren();
|
|
157
175
|
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -169,11 +187,12 @@ let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLega
|
|
|
169
187
|
});
|
|
170
188
|
}
|
|
171
189
|
renderCollectionChildren(collectionId, child, position, keyword) {
|
|
172
|
-
const
|
|
173
|
-
selection
|
|
174
|
-
onKeyDown
|
|
175
|
-
getItemProps
|
|
176
|
-
styles
|
|
190
|
+
const {
|
|
191
|
+
selection,
|
|
192
|
+
onKeyDown,
|
|
193
|
+
getItemProps,
|
|
194
|
+
styles
|
|
195
|
+
} = this.props;
|
|
177
196
|
const key = `${collectionId}_${keyword}`;
|
|
178
197
|
const ariaSelected = {};
|
|
179
198
|
if (selection) {
|
|
@@ -193,7 +212,7 @@ let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLega
|
|
|
193
212
|
id: key
|
|
194
213
|
/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */,
|
|
195
214
|
role: "treeitem",
|
|
196
|
-
css: styles
|
|
215
|
+
css: styles?.item,
|
|
197
216
|
tabIndex: -1,
|
|
198
217
|
"aria-posinset": position,
|
|
199
218
|
"aria-setsize": this.childCount,
|
|
@@ -211,7 +230,7 @@ let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLega
|
|
|
211
230
|
if (typeof child.props.onKeyDown === 'function') {
|
|
212
231
|
child.props.onKeyDown(e);
|
|
213
232
|
} else {
|
|
214
|
-
onKeyDown
|
|
233
|
+
onKeyDown?.(e, itemHash);
|
|
215
234
|
}
|
|
216
235
|
},
|
|
217
236
|
onBlur: e => this.handleBlur(e, itemHash),
|
|
@@ -240,12 +259,13 @@ let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLega
|
|
|
240
259
|
});
|
|
241
260
|
}
|
|
242
261
|
renderItemNode(item, position) {
|
|
243
|
-
const
|
|
244
|
-
selection
|
|
245
|
-
onItemClick
|
|
246
|
-
onKeyDown
|
|
247
|
-
getItemProps
|
|
248
|
-
styles
|
|
262
|
+
const {
|
|
263
|
+
selection,
|
|
264
|
+
onItemClick,
|
|
265
|
+
onKeyDown,
|
|
266
|
+
getItemProps,
|
|
267
|
+
styles
|
|
268
|
+
} = this.props;
|
|
249
269
|
const ariaSelected = {};
|
|
250
270
|
if (selection) {
|
|
251
271
|
ariaSelected['aria-selected'] = selection === `item_${item.id}`;
|
|
@@ -269,12 +289,12 @@ let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLega
|
|
|
269
289
|
/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */,
|
|
270
290
|
role: "treeitem",
|
|
271
291
|
"aria-label": item.name,
|
|
272
|
-
css: styles
|
|
292
|
+
css: styles?.item,
|
|
273
293
|
"aria-level": this.itemsLevel,
|
|
274
294
|
"aria-posinset": position,
|
|
275
295
|
"aria-setsize": this.childCount,
|
|
276
|
-
onClick: e => onItemClick
|
|
277
|
-
onKeyDown: e => onKeyDown
|
|
296
|
+
onClick: e => onItemClick?.(e, itemHash),
|
|
297
|
+
onKeyDown: e => onKeyDown?.(e, itemHash),
|
|
278
298
|
onFocus: e => this.handleFocus(e, itemHash),
|
|
279
299
|
onBlur: e => this.handleBlur(e, itemHash),
|
|
280
300
|
...ariaSelected,
|
|
@@ -296,17 +316,18 @@ let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLega
|
|
|
296
316
|
};
|
|
297
317
|
}
|
|
298
318
|
render() {
|
|
299
|
-
const
|
|
300
|
-
id
|
|
301
|
-
name
|
|
302
|
-
expanded
|
|
303
|
-
collectionIcon
|
|
304
|
-
collectionIconExpanded
|
|
305
|
-
isCollectionFlattened
|
|
306
|
-
getCollectionProps
|
|
307
|
-
level
|
|
308
|
-
position
|
|
309
|
-
styles
|
|
319
|
+
const {
|
|
320
|
+
id,
|
|
321
|
+
name,
|
|
322
|
+
expanded,
|
|
323
|
+
collectionIcon,
|
|
324
|
+
collectionIconExpanded,
|
|
325
|
+
isCollectionFlattened,
|
|
326
|
+
getCollectionProps,
|
|
327
|
+
level,
|
|
328
|
+
position,
|
|
329
|
+
styles
|
|
330
|
+
} = this.props;
|
|
310
331
|
const collectionProps = getCollectionProps({
|
|
311
332
|
...this.getCommonButtonProps(),
|
|
312
333
|
expanded: expanded,
|
|
@@ -319,14 +340,14 @@ let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLega
|
|
|
319
340
|
level
|
|
320
341
|
});
|
|
321
342
|
const ariaSelected = {
|
|
322
|
-
'aria-selected':
|
|
343
|
+
'aria-selected': undefined
|
|
323
344
|
};
|
|
324
345
|
if (this.props.selection) ariaSelected['aria-selected'] = this.props.selection === `collection_${id}`;
|
|
325
346
|
return isCollectionFlattened ? this.renderChildren() : (0, _jsxRuntime.jsxs)("li", {
|
|
326
347
|
ref: el => {
|
|
327
348
|
this.ref = el;
|
|
328
349
|
},
|
|
329
|
-
css: styles
|
|
350
|
+
css: styles?.treeCollection,
|
|
330
351
|
tabIndex: -1
|
|
331
352
|
/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */,
|
|
332
353
|
role: "treeitem",
|
|
@@ -351,21 +372,11 @@ let TreeCollection = exports.TreeCollection = (_dec = (0, _emotion.withStyleLega
|
|
|
351
372
|
...collectionProps
|
|
352
373
|
}), expanded && this.childCount > 0 && (0, _jsxRuntime.jsx)("ul", {
|
|
353
374
|
"aria-label": name,
|
|
354
|
-
css: styles
|
|
375
|
+
css: styles?.list,
|
|
355
376
|
role: "group",
|
|
356
377
|
children: this.renderChildren()
|
|
357
378
|
})]
|
|
358
379
|
});
|
|
359
380
|
}
|
|
360
|
-
}
|
|
361
|
-
collections: [],
|
|
362
|
-
items: [],
|
|
363
|
-
expanded: false,
|
|
364
|
-
selection: '',
|
|
365
|
-
size: 'medium',
|
|
366
|
-
variant: 'folderTree',
|
|
367
|
-
getItemProps: props => props,
|
|
368
|
-
getCollectionProps: props => props,
|
|
369
|
-
isCollectionFlattened: false
|
|
370
|
-
}, _TreeCollection)) || _class);
|
|
381
|
+
}) || _class);
|
|
371
382
|
var _default = exports.default = TreeCollection;
|
|
@@ -46,8 +46,10 @@ const list = (0, _emotion.keyframes)`
|
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
48
|
const generateStyles = (componentTheme, props, state) => {
|
|
49
|
-
const
|
|
50
|
-
|
|
49
|
+
const {
|
|
50
|
+
size,
|
|
51
|
+
variant
|
|
52
|
+
} = props;
|
|
51
53
|
const sizeMap = {
|
|
52
54
|
small: {
|
|
53
55
|
indent: {
|
|
@@ -34,18 +34,19 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
spacing
|
|
40
|
-
typography
|
|
41
|
-
borders
|
|
37
|
+
const {
|
|
38
|
+
colors,
|
|
39
|
+
spacing,
|
|
40
|
+
typography,
|
|
41
|
+
borders
|
|
42
|
+
} = theme;
|
|
42
43
|
const componentVariables = {
|
|
43
|
-
fontFamily: typography
|
|
44
|
-
baseSpacingSmall: spacing
|
|
45
|
-
baseSpacingMedium: spacing
|
|
44
|
+
fontFamily: typography?.fontFamily,
|
|
45
|
+
baseSpacingSmall: spacing?.xSmall,
|
|
46
|
+
baseSpacingMedium: spacing?.small,
|
|
46
47
|
baseSpacingLarge: '1rem',
|
|
47
|
-
borderWidth: borders
|
|
48
|
-
borderColor: colors
|
|
48
|
+
borderWidth: borders?.widthSmall,
|
|
49
|
+
borderColor: colors?.contrasts?.grey4570
|
|
49
50
|
};
|
|
50
51
|
return {
|
|
51
52
|
...componentVariables
|
|
@@ -14,7 +14,7 @@ var _theme = _interopRequireDefault(require("../TreeButton/theme"));
|
|
|
14
14
|
var _props = require("./props");
|
|
15
15
|
var _TreeBrowserContext = _interopRequireDefault(require("../TreeBrowserContext"));
|
|
16
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
-
var _dec, _class
|
|
17
|
+
var _dec, _class;
|
|
18
18
|
/*
|
|
19
19
|
* The MIT License (MIT)
|
|
20
20
|
*
|
|
@@ -47,37 +47,43 @@ id: TreeBrowser.Node
|
|
|
47
47
|
A helper class used to render the :renderBeforeItems and :renderAfterItems
|
|
48
48
|
in the TreeBrowser.
|
|
49
49
|
**/
|
|
50
|
-
let TreeNode = exports.TreeNode = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
50
|
+
let TreeNode = exports.TreeNode = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class TreeNode extends _react.Component {
|
|
51
|
+
static displayName = "TreeNode";
|
|
52
|
+
static componentId = 'TreeBrowser.Node';
|
|
53
|
+
static allowedProps = _props.allowedProps;
|
|
54
|
+
static contextType = _TreeBrowserContext.default;
|
|
55
|
+
static defaultProps = {
|
|
56
|
+
size: 'medium',
|
|
57
|
+
variant: 'folderTree',
|
|
58
|
+
selected: false,
|
|
59
|
+
focused: false
|
|
60
|
+
};
|
|
61
|
+
ref = null;
|
|
61
62
|
componentDidMount() {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
animation: (_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.animation
|
|
63
|
+
this.props.makeStyles?.({
|
|
64
|
+
animation: this.context?.animation
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
componentDidUpdate() {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
animation: (_this$context2 = this.context) === null || _this$context2 === void 0 ? void 0 : _this$context2.animation
|
|
68
|
+
this.props.makeStyles?.({
|
|
69
|
+
animation: this.context?.animation
|
|
71
70
|
});
|
|
72
71
|
}
|
|
72
|
+
handleRef = el => {
|
|
73
|
+
if (el && typeof this.props.containerRef === 'function') {
|
|
74
|
+
this.props.containerRef(el.parentElement);
|
|
75
|
+
}
|
|
76
|
+
this.ref = el;
|
|
77
|
+
};
|
|
73
78
|
renderItemImage() {
|
|
74
|
-
const
|
|
75
|
-
thumbnail
|
|
76
|
-
itemIcon
|
|
77
|
-
styles
|
|
79
|
+
const {
|
|
80
|
+
thumbnail,
|
|
81
|
+
itemIcon,
|
|
82
|
+
styles
|
|
83
|
+
} = this.props;
|
|
78
84
|
if (thumbnail) {
|
|
79
85
|
return (0, _jsxRuntime.jsx)("div", {
|
|
80
|
-
css: styles
|
|
86
|
+
css: styles?.thumbnail,
|
|
81
87
|
children: (0, _jsxRuntime.jsx)(_v11_.Img, {
|
|
82
88
|
src: thumbnail,
|
|
83
89
|
constrain: "cover",
|
|
@@ -87,34 +93,30 @@ let TreeNode = exports.TreeNode = (_dec = (0, _emotion.withStyleLegacy)(_styles.
|
|
|
87
93
|
}
|
|
88
94
|
if (itemIcon) {
|
|
89
95
|
return (0, _jsxRuntime.jsx)("div", {
|
|
90
|
-
css: styles
|
|
96
|
+
css: styles?.icon,
|
|
91
97
|
children: (0, _callRenderProp.callRenderProp)(itemIcon)
|
|
92
98
|
});
|
|
93
99
|
}
|
|
94
|
-
return
|
|
100
|
+
return undefined;
|
|
95
101
|
}
|
|
96
102
|
render() {
|
|
97
|
-
const
|
|
98
|
-
children
|
|
99
|
-
styles
|
|
103
|
+
const {
|
|
104
|
+
children,
|
|
105
|
+
styles
|
|
106
|
+
} = this.props;
|
|
100
107
|
return (0, _jsxRuntime.jsx)("div", {
|
|
101
108
|
ref: this.handleRef,
|
|
102
109
|
tabIndex: -1,
|
|
103
|
-
css: styles
|
|
110
|
+
css: styles?.treeButton,
|
|
104
111
|
"data-cid": "TreeNode",
|
|
105
112
|
children: (0, _jsxRuntime.jsxs)("span", {
|
|
106
|
-
css: styles
|
|
113
|
+
css: styles?.layout,
|
|
107
114
|
children: [this.renderItemImage(), (0, _jsxRuntime.jsx)("span", {
|
|
108
|
-
css: styles
|
|
115
|
+
css: styles?.node,
|
|
109
116
|
children: children
|
|
110
117
|
})]
|
|
111
118
|
})
|
|
112
119
|
});
|
|
113
120
|
}
|
|
114
|
-
}
|
|
115
|
-
size: 'medium',
|
|
116
|
-
variant: 'folderTree',
|
|
117
|
-
selected: false,
|
|
118
|
-
focused: false
|
|
119
|
-
}, _TreeNode)) || _class);
|
|
121
|
+
}) || _class);
|
|
120
122
|
var _default = exports.default = TreeNode;
|