@instructure/ui-tree-browser 8.18.0 → 8.18.1-snapshot.12
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/LICENSE.md +27 -0
- package/es/TreeBrowser/TreeButton/index.js +22 -18
- package/es/TreeBrowser/TreeButton/theme.js +25 -25
- package/es/TreeBrowser/TreeCollection/index.js +44 -40
- package/es/TreeBrowser/TreeCollection/theme.js +5 -5
- package/es/TreeBrowser/TreeNode/index.js +18 -14
- package/es/TreeBrowser/index.js +20 -12
- package/es/TreeBrowser/theme.js +4 -4
- package/lib/TreeBrowser/TreeButton/index.js +22 -18
- package/lib/TreeBrowser/TreeButton/theme.js +25 -25
- package/lib/TreeBrowser/TreeCollection/index.js +44 -40
- package/lib/TreeBrowser/TreeCollection/theme.js +5 -5
- package/lib/TreeBrowser/TreeNode/index.js +18 -14
- package/lib/TreeBrowser/index.js +20 -12
- package/lib/TreeBrowser/theme.js +4 -4
- package/package.json +16 -15
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -50,32 +50,32 @@ const generateComponentTheme = theme => {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
const componentVariables = {
|
|
53
|
-
hoverBackgroundColor: colors
|
|
54
|
-
hoverTextColor: colors
|
|
55
|
-
focusOutlineWidth: borders
|
|
56
|
-
focusOutlineColor: colors
|
|
57
|
-
focusOutlineStyle: borders
|
|
58
|
-
iconColor: colors
|
|
59
|
-
iconsMarginRight: spacing
|
|
60
|
-
descriptorMarginTop: spacing
|
|
61
|
-
descriptorTextColor: colors
|
|
62
|
-
descriptorFontSizeSmall: typography
|
|
63
|
-
descriptorFontSizeMedium: typography
|
|
64
|
-
descriptorFontSizeLarge: typography
|
|
65
|
-
nameTextColor: colors
|
|
66
|
-
nameFontSizeSmall: typography
|
|
67
|
-
nameFontSizeMedium: typography
|
|
68
|
-
nameFontSizeLarge: typography
|
|
69
|
-
baseSpacingSmall: spacing
|
|
70
|
-
baseSpacingMedium: spacing
|
|
53
|
+
hoverBackgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundBrand,
|
|
54
|
+
hoverTextColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
|
|
55
|
+
focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
|
|
56
|
+
focusOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
|
|
57
|
+
focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style,
|
|
58
|
+
iconColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
|
59
|
+
iconsMarginRight: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
|
|
60
|
+
descriptorMarginTop: spacing === null || spacing === void 0 ? void 0 : spacing.xxxSmall,
|
|
61
|
+
descriptorTextColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
|
62
|
+
descriptorFontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
|
|
63
|
+
descriptorFontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
|
|
64
|
+
descriptorFontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
|
|
65
|
+
nameTextColor: colors === null || colors === void 0 ? void 0 : colors.textBrand,
|
|
66
|
+
nameFontSizeSmall: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
|
|
67
|
+
nameFontSizeMedium: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
|
|
68
|
+
nameFontSizeLarge: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
|
69
|
+
baseSpacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
|
|
70
|
+
baseSpacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.small,
|
|
71
71
|
baseSpacingLarge: '1rem',
|
|
72
|
-
borderWidth: borders
|
|
73
|
-
borderRadius: borders
|
|
74
|
-
borderColor: colors
|
|
75
|
-
textLineHeight: typography
|
|
76
|
-
selectedTextColor: colors
|
|
77
|
-
selectedBackgroundColor: colors
|
|
78
|
-
selectedOutlineWidth: borders
|
|
72
|
+
borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
|
|
73
|
+
borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
|
|
74
|
+
borderColor: colors === null || colors === void 0 ? void 0 : colors.borderDark,
|
|
75
|
+
textLineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
|
|
76
|
+
selectedTextColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
|
|
77
|
+
selectedBackgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundDark,
|
|
78
|
+
selectedOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthLarge
|
|
79
79
|
};
|
|
80
80
|
return { ...componentVariables,
|
|
81
81
|
...themeSpecificStyles[themeName]
|
|
@@ -91,17 +91,21 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
componentDidMount() {
|
|
94
|
-
|
|
94
|
+
var _this$props$makeStyle, _this$props3;
|
|
95
|
+
|
|
96
|
+
(_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
componentDidUpdate() {
|
|
98
|
-
|
|
100
|
+
var _this$props$makeStyle2, _this$props4;
|
|
101
|
+
|
|
102
|
+
(_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
get itemsLevel() {
|
|
102
|
-
const _this$
|
|
103
|
-
level = _this$
|
|
104
|
-
isCollectionFlattened = _this$
|
|
106
|
+
const _this$props5 = this.props,
|
|
107
|
+
level = _this$props5.level,
|
|
108
|
+
isCollectionFlattened = _this$props5.isCollectionFlattened;
|
|
105
109
|
return isCollectionFlattened ? level : level + 1;
|
|
106
110
|
}
|
|
107
111
|
|
|
@@ -120,12 +124,12 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
renderChildren() {
|
|
123
|
-
const _this$
|
|
124
|
-
collections = _this$
|
|
125
|
-
items = _this$
|
|
126
|
-
id = _this$
|
|
127
|
-
renderBeforeItems = _this$
|
|
128
|
-
renderAfterItems = _this$
|
|
127
|
+
const _this$props6 = this.props,
|
|
128
|
+
collections = _this$props6.collections,
|
|
129
|
+
items = _this$props6.items,
|
|
130
|
+
id = _this$props6.id,
|
|
131
|
+
renderBeforeItems = _this$props6.renderBeforeItems,
|
|
132
|
+
renderAfterItems = _this$props6.renderAfterItems;
|
|
129
133
|
let position = 1;
|
|
130
134
|
return (0, _emotion.jsx)(_react.default.Fragment, null, renderBeforeItems && this.renderCollectionChildren(id, renderBeforeItems, position++, 'before'), collections.map(collection => {
|
|
131
135
|
return this.renderCollectionNode(collection, position++);
|
|
@@ -135,11 +139,11 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
135
139
|
}
|
|
136
140
|
|
|
137
141
|
renderCollectionChildren(collectionId, child, position, keyword) {
|
|
138
|
-
const _this$
|
|
139
|
-
selection = _this$
|
|
140
|
-
onKeyDown = _this$
|
|
141
|
-
getItemProps = _this$
|
|
142
|
-
styles = _this$
|
|
142
|
+
const _this$props7 = this.props,
|
|
143
|
+
selection = _this$props7.selection,
|
|
144
|
+
onKeyDown = _this$props7.onKeyDown,
|
|
145
|
+
getItemProps = _this$props7.getItemProps,
|
|
146
|
+
styles = _this$props7.styles;
|
|
143
147
|
const key = `${collectionId}_${keyword}`;
|
|
144
148
|
const ariaSelected = {};
|
|
145
149
|
|
|
@@ -160,7 +164,7 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
160
164
|
return (0, _emotion.jsx)("li", Object.assign({
|
|
161
165
|
id: key,
|
|
162
166
|
role: "treeitem",
|
|
163
|
-
css: styles
|
|
167
|
+
css: styles === null || styles === void 0 ? void 0 : styles.item,
|
|
164
168
|
tabIndex: -1,
|
|
165
169
|
key: key,
|
|
166
170
|
"aria-posinset": position,
|
|
@@ -181,7 +185,7 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
181
185
|
if (typeof child.props.onKeyDown === 'function') {
|
|
182
186
|
child.props.onKeyDown(e, n);
|
|
183
187
|
} else {
|
|
184
|
-
onKeyDown
|
|
188
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, itemHash);
|
|
185
189
|
}
|
|
186
190
|
},
|
|
187
191
|
onBlur: e => this.handleBlur(e, itemHash)
|
|
@@ -209,12 +213,12 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
209
213
|
}
|
|
210
214
|
|
|
211
215
|
renderItemNode(item, position) {
|
|
212
|
-
const _this$
|
|
213
|
-
selection = _this$
|
|
214
|
-
onItemClick = _this$
|
|
215
|
-
onKeyDown = _this$
|
|
216
|
-
getItemProps = _this$
|
|
217
|
-
styles = _this$
|
|
216
|
+
const _this$props8 = this.props,
|
|
217
|
+
selection = _this$props8.selection,
|
|
218
|
+
onItemClick = _this$props8.onItemClick,
|
|
219
|
+
onKeyDown = _this$props8.onKeyDown,
|
|
220
|
+
getItemProps = _this$props8.getItemProps,
|
|
221
|
+
styles = _this$props8.styles;
|
|
218
222
|
const ariaSelected = {};
|
|
219
223
|
|
|
220
224
|
if (selection) {
|
|
@@ -239,12 +243,12 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
239
243
|
tabIndex: -1,
|
|
240
244
|
role: "treeitem",
|
|
241
245
|
"aria-label": item.name,
|
|
242
|
-
css: styles
|
|
246
|
+
css: styles === null || styles === void 0 ? void 0 : styles.item,
|
|
243
247
|
"aria-level": this.itemsLevel,
|
|
244
248
|
"aria-posinset": position,
|
|
245
249
|
"aria-setsize": this.childCount,
|
|
246
|
-
onClick: e => onItemClick
|
|
247
|
-
onKeyDown: e => onKeyDown
|
|
250
|
+
onClick: e => onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(e, itemHash),
|
|
251
|
+
onKeyDown: e => onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, itemHash),
|
|
248
252
|
onFocus: e => this.handleFocus(e, itemHash),
|
|
249
253
|
onBlur: e => this.handleBlur(e, itemHash)
|
|
250
254
|
}, ariaSelected), (0, _emotion.jsx)(_TreeButton.TreeButton, itemProps));
|
|
@@ -264,17 +268,17 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
264
268
|
}
|
|
265
269
|
|
|
266
270
|
render() {
|
|
267
|
-
const _this$
|
|
268
|
-
id = _this$
|
|
269
|
-
name = _this$
|
|
270
|
-
expanded = _this$
|
|
271
|
-
collectionIcon = _this$
|
|
272
|
-
collectionIconExpanded = _this$
|
|
273
|
-
isCollectionFlattened = _this$
|
|
274
|
-
getCollectionProps = _this$
|
|
275
|
-
level = _this$
|
|
276
|
-
position = _this$
|
|
277
|
-
styles = _this$
|
|
271
|
+
const _this$props9 = this.props,
|
|
272
|
+
id = _this$props9.id,
|
|
273
|
+
name = _this$props9.name,
|
|
274
|
+
expanded = _this$props9.expanded,
|
|
275
|
+
collectionIcon = _this$props9.collectionIcon,
|
|
276
|
+
collectionIconExpanded = _this$props9.collectionIconExpanded,
|
|
277
|
+
isCollectionFlattened = _this$props9.isCollectionFlattened,
|
|
278
|
+
getCollectionProps = _this$props9.getCollectionProps,
|
|
279
|
+
level = _this$props9.level,
|
|
280
|
+
position = _this$props9.position,
|
|
281
|
+
styles = _this$props9.styles;
|
|
278
282
|
const collectionProps = getCollectionProps({ ...this.getCommonButtonProps(),
|
|
279
283
|
expanded: expanded,
|
|
280
284
|
collectionIcon: collectionIcon,
|
|
@@ -291,7 +295,7 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
291
295
|
ref: el => {
|
|
292
296
|
this.ref = el;
|
|
293
297
|
},
|
|
294
|
-
css: styles
|
|
298
|
+
css: styles === null || styles === void 0 ? void 0 : styles.treeCollection,
|
|
295
299
|
tabIndex: -1,
|
|
296
300
|
role: "treeitem",
|
|
297
301
|
"aria-label": this.props.name,
|
|
@@ -311,7 +315,7 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
311
315
|
})
|
|
312
316
|
}, ariaSelected), (0, _emotion.jsx)(_TreeButton.TreeButton, collectionProps), expanded && this.childCount > 0 && (0, _emotion.jsx)("ul", {
|
|
313
317
|
"aria-label": name,
|
|
314
|
-
css: styles
|
|
318
|
+
css: styles === null || styles === void 0 ? void 0 : styles.list,
|
|
315
319
|
role: "group"
|
|
316
320
|
}, this.renderChildren()));
|
|
317
321
|
}
|
|
@@ -40,12 +40,12 @@ const generateComponentTheme = theme => {
|
|
|
40
40
|
typography = theme.typography,
|
|
41
41
|
borders = theme.borders;
|
|
42
42
|
const componentVariables = {
|
|
43
|
-
fontFamily: typography
|
|
44
|
-
baseSpacingSmall: spacing
|
|
45
|
-
baseSpacingMedium: spacing
|
|
43
|
+
fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
|
44
|
+
baseSpacingSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
|
|
45
|
+
baseSpacingMedium: spacing === null || spacing === void 0 ? void 0 : spacing.small,
|
|
46
46
|
baseSpacingLarge: '1rem',
|
|
47
|
-
borderWidth: borders
|
|
48
|
-
borderColor: colors
|
|
47
|
+
borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
|
|
48
|
+
borderColor: colors === null || colors === void 0 ? void 0 : colors.borderDark
|
|
49
49
|
};
|
|
50
50
|
return { ...componentVariables
|
|
51
51
|
};
|
|
@@ -51,24 +51,28 @@ let TreeNode = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
componentDidMount() {
|
|
54
|
-
|
|
54
|
+
var _this$props$makeStyle, _this$props;
|
|
55
|
+
|
|
56
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
componentDidUpdate() {
|
|
58
|
-
|
|
60
|
+
var _this$props$makeStyle2, _this$props2;
|
|
61
|
+
|
|
62
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
renderItemImage() {
|
|
62
66
|
var _Img;
|
|
63
67
|
|
|
64
|
-
const _this$
|
|
65
|
-
thumbnail = _this$
|
|
66
|
-
itemIcon = _this$
|
|
67
|
-
styles = _this$
|
|
68
|
+
const _this$props3 = this.props,
|
|
69
|
+
thumbnail = _this$props3.thumbnail,
|
|
70
|
+
itemIcon = _this$props3.itemIcon,
|
|
71
|
+
styles = _this$props3.styles;
|
|
68
72
|
|
|
69
73
|
if (thumbnail) {
|
|
70
74
|
return (0, _emotion.jsx)("div", {
|
|
71
|
-
css: styles
|
|
75
|
+
css: styles === null || styles === void 0 ? void 0 : styles.thumbnail
|
|
72
76
|
}, _Img || (_Img = (0, _emotion.jsx)(_Img2.Img, {
|
|
73
77
|
src: thumbnail,
|
|
74
78
|
constrain: "cover",
|
|
@@ -78,7 +82,7 @@ let TreeNode = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
78
82
|
|
|
79
83
|
if (itemIcon) {
|
|
80
84
|
return (0, _emotion.jsx)("div", {
|
|
81
|
-
css: styles
|
|
85
|
+
css: styles === null || styles === void 0 ? void 0 : styles.icon
|
|
82
86
|
}, (0, _callRenderProp.callRenderProp)(itemIcon));
|
|
83
87
|
}
|
|
84
88
|
|
|
@@ -86,17 +90,17 @@ let TreeNode = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
render() {
|
|
89
|
-
const _this$
|
|
90
|
-
children = _this$
|
|
91
|
-
styles = _this$
|
|
93
|
+
const _this$props4 = this.props,
|
|
94
|
+
children = _this$props4.children,
|
|
95
|
+
styles = _this$props4.styles;
|
|
92
96
|
return (0, _emotion.jsx)("div", {
|
|
93
97
|
ref: this.handleRef,
|
|
94
98
|
tabIndex: -1,
|
|
95
|
-
css: styles
|
|
99
|
+
css: styles === null || styles === void 0 ? void 0 : styles.treeButton
|
|
96
100
|
}, (0, _emotion.jsx)("span", {
|
|
97
|
-
css: styles
|
|
101
|
+
css: styles === null || styles === void 0 ? void 0 : styles.layout
|
|
98
102
|
}, this.renderItemImage(), (0, _emotion.jsx)("span", {
|
|
99
|
-
css: styles
|
|
103
|
+
css: styles === null || styles === void 0 ? void 0 : styles.node
|
|
100
104
|
}, children)));
|
|
101
105
|
}
|
|
102
106
|
|
package/lib/TreeBrowser/index.js
CHANGED
|
@@ -56,14 +56,16 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
56
56
|
e.stopPropagation();
|
|
57
57
|
const onCollectionClick = _this.props.onCollectionClick;
|
|
58
58
|
if (expand) _this.expandOrCollapseNode(collection);
|
|
59
|
-
onCollectionClick
|
|
59
|
+
onCollectionClick === null || onCollectionClick === void 0 ? void 0 : onCollectionClick(collection.id, collection); // TODO: this should pass the event as the first arg
|
|
60
60
|
|
|
61
61
|
_this.handleSelection(collection.id, 'collection');
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
this.handleItemClick = (e, item) => {
|
|
65
|
+
var _this$props$onItemCli, _this$props;
|
|
66
|
+
|
|
65
67
|
e.stopPropagation();
|
|
66
|
-
this.props.onItemClick
|
|
68
|
+
(_this$props$onItemCli = (_this$props = this.props).onItemClick) === null || _this$props$onItemCli === void 0 ? void 0 : _this$props$onItemCli.call(_this$props, item);
|
|
67
69
|
this.handleSelection(item.id, 'item');
|
|
68
70
|
};
|
|
69
71
|
|
|
@@ -104,9 +106,9 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
104
106
|
};
|
|
105
107
|
|
|
106
108
|
this.getIsFlattened = collection => {
|
|
107
|
-
const _this$
|
|
108
|
-
rootId = _this$
|
|
109
|
-
showRootCollection = _this$
|
|
109
|
+
const _this$props2 = this.props,
|
|
110
|
+
rootId = _this$props2.rootId,
|
|
111
|
+
showRootCollection = _this$props2.showRootCollection;
|
|
110
112
|
return !showRootCollection && typeof rootId !== 'undefined' && collection.id === rootId;
|
|
111
113
|
};
|
|
112
114
|
|
|
@@ -123,11 +125,15 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
componentDidMount() {
|
|
126
|
-
|
|
128
|
+
var _this$props$makeStyle, _this$props3;
|
|
129
|
+
|
|
130
|
+
(_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
componentDidUpdate() {
|
|
130
|
-
|
|
134
|
+
var _this$props$makeStyle2, _this$props4;
|
|
135
|
+
|
|
136
|
+
(_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
|
|
131
137
|
}
|
|
132
138
|
|
|
133
139
|
get _root() {
|
|
@@ -135,9 +141,9 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
135
141
|
}
|
|
136
142
|
|
|
137
143
|
get collections() {
|
|
138
|
-
const _this$
|
|
139
|
-
collections = _this$
|
|
140
|
-
rootId = _this$
|
|
144
|
+
const _this$props5 = this.props,
|
|
145
|
+
collections = _this$props5.collections,
|
|
146
|
+
rootId = _this$props5.rootId;
|
|
141
147
|
|
|
142
148
|
if (typeof rootId !== 'undefined') {
|
|
143
149
|
return [collections[rootId]];
|
|
@@ -155,7 +161,9 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
155
161
|
}
|
|
156
162
|
|
|
157
163
|
expandOrCollapseNode(collection) {
|
|
158
|
-
|
|
164
|
+
var _this$props$onCollect, _this$props6;
|
|
165
|
+
|
|
166
|
+
(_this$props$onCollect = (_this$props6 = this.props).onCollectionToggle) === null || _this$props$onCollect === void 0 ? void 0 : _this$props$onCollect.call(_this$props6, collection);
|
|
159
167
|
|
|
160
168
|
if (typeof this.props.expanded === 'undefined') {
|
|
161
169
|
this.setState((state, props) => {
|
|
@@ -313,7 +321,7 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
313
321
|
render() {
|
|
314
322
|
const styles = this.props.styles;
|
|
315
323
|
return (0, _emotion.jsx)("ul", {
|
|
316
|
-
css: styles
|
|
324
|
+
css: styles === null || styles === void 0 ? void 0 : styles.treeBrowser,
|
|
317
325
|
tabIndex: 0,
|
|
318
326
|
role: "tree",
|
|
319
327
|
onKeyDown: this.handleKeyDown,
|
package/lib/TreeBrowser/theme.js
CHANGED
|
@@ -38,10 +38,10 @@ const generateComponentTheme = theme => {
|
|
|
38
38
|
const colors = theme.colors,
|
|
39
39
|
borders = theme.borders;
|
|
40
40
|
const componentVariables = {
|
|
41
|
-
borderRadius: borders
|
|
42
|
-
focusOutlineWidth: borders
|
|
43
|
-
focusOutlineColor: colors
|
|
44
|
-
focusOutlineStyle: borders
|
|
41
|
+
borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
|
|
42
|
+
focusOutlineWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
|
|
43
|
+
focusOutlineColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
|
|
44
|
+
focusOutlineStyle: borders === null || borders === void 0 ? void 0 : borders.style
|
|
45
45
|
};
|
|
46
46
|
return { ...componentVariables
|
|
47
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tree-browser",
|
|
3
|
-
"version": "8.18.
|
|
3
|
+
"version": "8.18.1-snapshot.12+ca14b3dc8",
|
|
4
4
|
"description": "A component for displaying a hierarchical view of information",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,22 +23,22 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.18.
|
|
27
|
-
"@instructure/ui-color-utils": "8.18.
|
|
28
|
-
"@instructure/ui-test-locator": "8.18.
|
|
29
|
-
"@instructure/ui-test-utils": "8.18.
|
|
30
|
-
"@instructure/ui-themes": "8.18.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.18.1-snapshot.12+ca14b3dc8",
|
|
27
|
+
"@instructure/ui-color-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
28
|
+
"@instructure/ui-test-locator": "8.18.1-snapshot.12+ca14b3dc8",
|
|
29
|
+
"@instructure/ui-test-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
30
|
+
"@instructure/ui-themes": "8.18.1-snapshot.12+ca14b3dc8"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.13.10",
|
|
34
|
-
"@instructure/emotion": "8.18.
|
|
35
|
-
"@instructure/shared-types": "8.18.
|
|
36
|
-
"@instructure/ui-icons": "8.18.
|
|
37
|
-
"@instructure/ui-img": "8.18.
|
|
38
|
-
"@instructure/ui-prop-types": "8.18.
|
|
39
|
-
"@instructure/ui-react-utils": "8.18.
|
|
40
|
-
"@instructure/ui-testable": "8.18.
|
|
41
|
-
"@instructure/ui-utils": "8.18.
|
|
34
|
+
"@instructure/emotion": "8.18.1-snapshot.12+ca14b3dc8",
|
|
35
|
+
"@instructure/shared-types": "8.18.1-snapshot.12+ca14b3dc8",
|
|
36
|
+
"@instructure/ui-icons": "8.18.1-snapshot.12+ca14b3dc8",
|
|
37
|
+
"@instructure/ui-img": "8.18.1-snapshot.12+ca14b3dc8",
|
|
38
|
+
"@instructure/ui-prop-types": "8.18.1-snapshot.12+ca14b3dc8",
|
|
39
|
+
"@instructure/ui-react-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
40
|
+
"@instructure/ui-testable": "8.18.1-snapshot.12+ca14b3dc8",
|
|
41
|
+
"@instructure/ui-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
42
42
|
"keycode": "^2",
|
|
43
43
|
"prop-types": "^15"
|
|
44
44
|
},
|
|
@@ -48,5 +48,6 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"sideEffects": false
|
|
51
|
+
"sideEffects": false,
|
|
52
|
+
"gitHead": "ca14b3dc8f0315daef7b86aa05f711e6d6684c58"
|
|
52
53
|
}
|