@instructure/ui-tree-browser 8.10.1 → 8.10.3-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/CHANGELOG.md +4 -0
- package/LICENSE.md +27 -0
- package/es/TreeBrowser/TreeButton/index.js +2 -0
- package/es/TreeBrowser/TreeCollection/index.js +4 -0
- package/es/TreeBrowser/TreeNode/index.js +2 -0
- package/es/TreeBrowser/index.js +4 -1
- package/lib/TreeBrowser/TreeButton/index.js +2 -0
- package/lib/TreeBrowser/TreeCollection/index.js +4 -0
- package/lib/TreeBrowser/TreeNode/index.js +2 -0
- package/lib/TreeBrowser/index.js +4 -1
- package/package.json +16 -15
- package/src/TreeBrowser/TreeButton/index.tsx +2 -0
- package/src/TreeBrowser/TreeCollection/index.tsx +4 -0
- package/src/TreeBrowser/TreeNode/index.tsx +3 -0
- package/src/TreeBrowser/index.tsx +3 -1
- package/types/TreeBrowser/TreeBrowserLocator.d.ts +224 -224
- package/types/TreeBrowser/TreeButton/index.d.ts +1 -0
- package/types/TreeBrowser/TreeButton/index.d.ts.map +1 -1
- package/types/TreeBrowser/TreeCollection/index.d.ts +1 -0
- package/types/TreeBrowser/TreeCollection/index.d.ts.map +1 -1
- package/types/TreeBrowser/TreeNode/index.d.ts +1 -0
- package/types/TreeBrowser/TreeNode/index.d.ts.map +1 -1
- package/types/TreeBrowser/index.d.ts +1 -0
- package/types/TreeBrowser/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.10.2](https://github.com/instructure/instructure-ui/compare/v8.10.1...v8.10.2) (2021-10-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-tree-browser
|
|
9
|
+
|
|
6
10
|
## [8.10.1](https://github.com/instructure/instructure-ui/compare/v8.10.0...v8.10.1) (2021-10-01)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @instructure/ui-tree-browser
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: The MIT License (MIT)
|
|
3
|
+
category: Getting Started
|
|
4
|
+
order: 9
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# The MIT License (MIT)
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
+
|
|
11
|
+
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions.**
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
@@ -44,9 +44,11 @@ id: TreeBrowser.Button
|
|
|
44
44
|
let TreeButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class TreeButton extends Component {
|
|
45
45
|
constructor(...args) {
|
|
46
46
|
super(...args);
|
|
47
|
+
this.ref = null;
|
|
47
48
|
|
|
48
49
|
this.handleRef = el => {
|
|
49
50
|
el && this.props.containerRef(el.parentElement);
|
|
51
|
+
this.ref = el;
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
|
|
@@ -46,6 +46,7 @@ id: TreeBrowser.Collection
|
|
|
46
46
|
let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class TreeCollection extends Component {
|
|
47
47
|
constructor(props) {
|
|
48
48
|
super(props);
|
|
49
|
+
this.ref = null;
|
|
49
50
|
|
|
50
51
|
this.handleFocus = (e, item) => {
|
|
51
52
|
e.stopPropagation();
|
|
@@ -298,6 +299,9 @@ let TreeCollection = (_dec = withStyle(generateStyles, generateComponentTheme),
|
|
|
298
299
|
const ariaSelected = {};
|
|
299
300
|
if (this.props.selection) ariaSelected['aria-selected'] = this.props.selection === `collection_${id}`;
|
|
300
301
|
return isCollectionFlattened ? this.renderChildren() : jsx("li", Object.assign({
|
|
302
|
+
ref: el => {
|
|
303
|
+
this.ref = el;
|
|
304
|
+
},
|
|
301
305
|
css: styles === null || styles === void 0 ? void 0 : styles.treeCollection,
|
|
302
306
|
tabIndex: "-1",
|
|
303
307
|
role: "treeitem",
|
|
@@ -47,9 +47,11 @@ in the TreeBrowser.
|
|
|
47
47
|
let TreeNode = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class TreeNode extends Component {
|
|
48
48
|
constructor(...args) {
|
|
49
49
|
super(...args);
|
|
50
|
+
this.ref = null;
|
|
50
51
|
|
|
51
52
|
this.handleRef = el => {
|
|
52
53
|
el && this.props.containerRef(el.parentElement);
|
|
54
|
+
this.ref = el;
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
|
package/es/TreeBrowser/index.js
CHANGED
|
@@ -46,6 +46,7 @@ category: components
|
|
|
46
46
|
let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class TreeBrowser extends Component {
|
|
47
47
|
constructor(props) {
|
|
48
48
|
super(props);
|
|
49
|
+
this.ref = null;
|
|
49
50
|
|
|
50
51
|
this.handleCollectionClick = (e, collection, expand = true) => {
|
|
51
52
|
e.stopPropagation();
|
|
@@ -311,7 +312,9 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
|
|
|
311
312
|
role: "tree",
|
|
312
313
|
onKeyDown: this.handleKeyDown,
|
|
313
314
|
ref: el => {
|
|
314
|
-
this._root = el;
|
|
315
|
+
this._root = el; // TODO remove this and keep only 'ref' in V9
|
|
316
|
+
|
|
317
|
+
this.ref = el;
|
|
315
318
|
},
|
|
316
319
|
"aria-label": this.props.treeLabel
|
|
317
320
|
}, this.renderRoot());
|
|
@@ -35,9 +35,11 @@ id: TreeBrowser.Button
|
|
|
35
35
|
let TreeButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class TreeButton extends _react.Component {
|
|
36
36
|
constructor(...args) {
|
|
37
37
|
super(...args);
|
|
38
|
+
this.ref = null;
|
|
38
39
|
|
|
39
40
|
this.handleRef = el => {
|
|
40
41
|
el && this.props.containerRef(el.parentElement);
|
|
42
|
+
this.ref = el;
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
45
|
|
|
@@ -36,6 +36,7 @@ id: TreeBrowser.Collection
|
|
|
36
36
|
let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class TreeCollection extends _react.Component {
|
|
37
37
|
constructor(props) {
|
|
38
38
|
super(props);
|
|
39
|
+
this.ref = null;
|
|
39
40
|
|
|
40
41
|
this.handleFocus = (e, item) => {
|
|
41
42
|
e.stopPropagation();
|
|
@@ -288,6 +289,9 @@ let TreeCollection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
288
289
|
const ariaSelected = {};
|
|
289
290
|
if (this.props.selection) ariaSelected['aria-selected'] = this.props.selection === `collection_${id}`;
|
|
290
291
|
return isCollectionFlattened ? this.renderChildren() : (0, _emotion.jsx)("li", Object.assign({
|
|
292
|
+
ref: el => {
|
|
293
|
+
this.ref = el;
|
|
294
|
+
},
|
|
291
295
|
css: styles === null || styles === void 0 ? void 0 : styles.treeCollection,
|
|
292
296
|
tabIndex: "-1",
|
|
293
297
|
role: "treeitem",
|
|
@@ -37,9 +37,11 @@ in the TreeBrowser.
|
|
|
37
37
|
let TreeNode = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class TreeNode extends _react.Component {
|
|
38
38
|
constructor(...args) {
|
|
39
39
|
super(...args);
|
|
40
|
+
this.ref = null;
|
|
40
41
|
|
|
41
42
|
this.handleRef = el => {
|
|
42
43
|
el && this.props.containerRef(el.parentElement);
|
|
44
|
+
this.ref = el;
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
|
package/lib/TreeBrowser/index.js
CHANGED
|
@@ -45,6 +45,7 @@ category: components
|
|
|
45
45
|
let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class TreeBrowser extends _react.Component {
|
|
46
46
|
constructor(props) {
|
|
47
47
|
super(props);
|
|
48
|
+
this.ref = null;
|
|
48
49
|
|
|
49
50
|
this.handleCollectionClick = (e, collection, expand = true) => {
|
|
50
51
|
e.stopPropagation();
|
|
@@ -310,7 +311,9 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
310
311
|
role: "tree",
|
|
311
312
|
onKeyDown: this.handleKeyDown,
|
|
312
313
|
ref: el => {
|
|
313
|
-
this._root = el;
|
|
314
|
+
this._root = el; // TODO remove this and keep only 'ref' in V9
|
|
315
|
+
|
|
316
|
+
this.ref = el;
|
|
314
317
|
},
|
|
315
318
|
"aria-label": this.props.treeLabel
|
|
316
319
|
}, this.renderRoot());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tree-browser",
|
|
3
|
-
"version": "8.10.
|
|
3
|
+
"version": "8.10.3-snapshot.12+af470a237",
|
|
4
4
|
"description": "A component for displaying a hierarchical view of information",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -24,22 +24,22 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@instructure/ui-babel-preset": "8.10.
|
|
28
|
-
"@instructure/ui-color-utils": "8.10.
|
|
29
|
-
"@instructure/ui-test-locator": "8.10.
|
|
30
|
-
"@instructure/ui-test-utils": "8.10.
|
|
31
|
-
"@instructure/ui-themes": "8.10.
|
|
27
|
+
"@instructure/ui-babel-preset": "8.10.3-snapshot.12+af470a237",
|
|
28
|
+
"@instructure/ui-color-utils": "8.10.3-snapshot.12+af470a237",
|
|
29
|
+
"@instructure/ui-test-locator": "8.10.3-snapshot.12+af470a237",
|
|
30
|
+
"@instructure/ui-test-utils": "8.10.3-snapshot.12+af470a237",
|
|
31
|
+
"@instructure/ui-themes": "8.10.3-snapshot.12+af470a237"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.13.10",
|
|
35
|
-
"@instructure/emotion": "8.10.
|
|
36
|
-
"@instructure/shared-types": "8.10.
|
|
37
|
-
"@instructure/ui-icons": "8.10.
|
|
38
|
-
"@instructure/ui-img": "8.10.
|
|
39
|
-
"@instructure/ui-prop-types": "8.10.
|
|
40
|
-
"@instructure/ui-react-utils": "8.10.
|
|
41
|
-
"@instructure/ui-testable": "8.10.
|
|
42
|
-
"@instructure/ui-utils": "8.10.
|
|
35
|
+
"@instructure/emotion": "8.10.3-snapshot.12+af470a237",
|
|
36
|
+
"@instructure/shared-types": "8.10.3-snapshot.12+af470a237",
|
|
37
|
+
"@instructure/ui-icons": "8.10.3-snapshot.12+af470a237",
|
|
38
|
+
"@instructure/ui-img": "8.10.3-snapshot.12+af470a237",
|
|
39
|
+
"@instructure/ui-prop-types": "8.10.3-snapshot.12+af470a237",
|
|
40
|
+
"@instructure/ui-react-utils": "8.10.3-snapshot.12+af470a237",
|
|
41
|
+
"@instructure/ui-testable": "8.10.3-snapshot.12+af470a237",
|
|
42
|
+
"@instructure/ui-utils": "8.10.3-snapshot.12+af470a237",
|
|
43
43
|
"keycode": "^2",
|
|
44
44
|
"prop-types": "^15"
|
|
45
45
|
},
|
|
@@ -49,5 +49,6 @@
|
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"sideEffects": false
|
|
52
|
+
"sideEffects": false,
|
|
53
|
+
"gitHead": "af470a2374463c265ed1304870b7890fc8bb09a4"
|
|
53
54
|
}
|
|
@@ -70,6 +70,7 @@ class TreeButton extends Component<TreeBrowserButtonProps> {
|
|
|
70
70
|
containerRef: function () {},
|
|
71
71
|
renderContent: undefined
|
|
72
72
|
}
|
|
73
|
+
ref: Element | null = null
|
|
73
74
|
|
|
74
75
|
componentDidMount() {
|
|
75
76
|
this.props.makeStyles?.()
|
|
@@ -148,6 +149,7 @@ class TreeButton extends Component<TreeBrowserButtonProps> {
|
|
|
148
149
|
handleRef = (el) => {
|
|
149
150
|
// @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
|
|
150
151
|
el && this.props.containerRef(el.parentElement)
|
|
152
|
+
this.ref = el
|
|
151
153
|
}
|
|
152
154
|
|
|
153
155
|
render() {
|
|
@@ -82,6 +82,7 @@ class TreeCollection extends Component<TreeBrowserCollectionProps> {
|
|
|
82
82
|
isCollectionFlattened: false,
|
|
83
83
|
renderContent: undefined
|
|
84
84
|
}
|
|
85
|
+
ref: Element | null = null
|
|
85
86
|
|
|
86
87
|
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'props' implicitly has an 'any' type.
|
|
87
88
|
constructor(props) {
|
|
@@ -392,6 +393,9 @@ class TreeCollection extends Component<TreeBrowserCollectionProps> {
|
|
|
392
393
|
this.renderChildren()
|
|
393
394
|
) : (
|
|
394
395
|
<li
|
|
396
|
+
ref={(el) => {
|
|
397
|
+
this.ref = el
|
|
398
|
+
}}
|
|
395
399
|
css={styles?.treeCollection}
|
|
396
400
|
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'number | ... Remove this comment to see the full error message
|
|
397
401
|
tabIndex="-1"
|
|
@@ -71,6 +71,8 @@ class TreeNode extends Component<TreeBrowserNodeProps> {
|
|
|
71
71
|
onClick: undefined
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
ref: Element | null = null
|
|
75
|
+
|
|
74
76
|
componentDidMount() {
|
|
75
77
|
this.props.makeStyles?.()
|
|
76
78
|
}
|
|
@@ -82,6 +84,7 @@ class TreeNode extends Component<TreeBrowserNodeProps> {
|
|
|
82
84
|
handleRef = (el) => {
|
|
83
85
|
// @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
|
|
84
86
|
el && this.props.containerRef(el.parentElement)
|
|
87
|
+
this.ref = el
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
// @ts-expect-error ts-migrate(7030) FIXME: Not all code paths return a value.
|
|
@@ -79,6 +79,7 @@ class TreeBrowser extends Component<TreeBrowserProps> {
|
|
|
79
79
|
static Node = TreeNode
|
|
80
80
|
static Collection = TreeCollection
|
|
81
81
|
static Button = TreeButton
|
|
82
|
+
ref: Element | null = null
|
|
82
83
|
|
|
83
84
|
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'props' implicitly has an 'any' type.
|
|
84
85
|
constructor(props) {
|
|
@@ -385,7 +386,8 @@ class TreeBrowser extends Component<TreeBrowserProps> {
|
|
|
385
386
|
onKeyDown={this.handleKeyDown}
|
|
386
387
|
ref={(el) => {
|
|
387
388
|
// @ts-expect-error ts-migrate(2339) FIXME: Property '_root' does not exist on type 'TreeBrows... Remove this comment to see the full error message
|
|
388
|
-
this._root = el
|
|
389
|
+
this._root = el // TODO remove this and keep only 'ref' in V9
|
|
390
|
+
this.ref = el
|
|
389
391
|
}}
|
|
390
392
|
aria-label={this.props.treeLabel}
|
|
391
393
|
>
|