@instructure/ui-tree-browser 8.12.1-snapshot.51 → 8.13.0

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 CHANGED
@@ -3,6 +3,12 @@
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.13.0](https://github.com/instructure/instructure-ui/compare/v8.12.0...v8.13.0) (2021-12-01)
7
+
8
+ ### Features
9
+
10
+ - add 'sortOrder' property to TreeBrowser component ([e669e54](https://github.com/instructure/instructure-ui/pull/776/commits/e669e5405864b26c6f98b378e11cef6603fcca58))
11
+
6
12
  # [8.12.0](https://github.com/instructure/instructure-ui/compare/v8.11.1...v8.12.0) (2021-11-17)
7
13
 
8
14
  **Note:** Version bump only for package @instructure/ui-tree-browser
@@ -263,7 +263,7 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
263
263
 
264
264
  getSubCollections(collection) {
265
265
  const collections = [].concat(collection.collections || []);
266
- return collections.map(id => this.getCollectionProps(this.props.collections[id])).filter(collection => collection != null);
266
+ return collections.map(id => this.getCollectionProps(this.props.collections[id])).filter(collection => collection != null).sort(this.props.sortOrder);
267
267
  }
268
268
 
269
269
  getItems(collection) {
@@ -272,7 +272,7 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
272
272
  return items.map(id => {
273
273
  return { ...this.props.items[id]
274
274
  };
275
- }).filter(item => item != null);
275
+ }).filter(item => item != null).sort(this.props.sortOrder);
276
276
  } else {
277
277
  return [];
278
278
  }
@@ -298,7 +298,7 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
298
298
  }
299
299
 
300
300
  renderRoot() {
301
- return this.collections.map((collection, i) => jsx(TreeCollection, Object.assign({
301
+ return this.collections.sort(this.props.sortOrder).map((collection, i) => jsx(TreeCollection, Object.assign({
302
302
  key: i
303
303
  }, pickProps(omitProps(this.props), TreeCollection.allowedProps), this.getCollectionProps(collection), {
304
304
  selection: this.state.selection,
@@ -339,7 +339,10 @@ let TreeBrowser = (_dec = withStyle(generateStyles, generateComponentTheme), _de
339
339
  selectionType: 'none',
340
340
  onItemClick: function (item) {},
341
341
  onCollectionClick: function (id, collection) {},
342
- onCollectionToggle: function (collection) {}
342
+ onCollectionToggle: function (collection) {},
343
+ sortOrder: function (obj1, obj2) {
344
+ return 0;
345
+ }
343
346
  }, _class2.Node = TreeNode, _class2.Collection = TreeCollection, _class2.Button = TreeButton, _temp)) || _class) || _class);
344
347
  export default TreeBrowser;
345
348
  export { TreeBrowser };
@@ -93,7 +93,12 @@ const propTypes = {
93
93
  * An optional label to assist visually impaired users
94
94
  */
95
95
  treeLabel: PropTypes.string,
96
- renderContent: PropTypes.func
96
+ renderContent: PropTypes.func,
97
+
98
+ /**
99
+ * An optional compare function to specify order of the collections and the items
100
+ */
101
+ sortOrder: PropTypes.func
97
102
  };
98
- const allowedProps = ['collections', 'items', 'rootId', 'expanded', 'defaultExpanded', 'selectionType', 'size', 'variant', 'collectionIcon', 'collectionIconExpanded', 'itemIcon', 'getItemProps', 'getCollectionProps', 'showRootCollection', 'onCollectionClick', 'onCollectionToggle', 'onItemClick', 'treeLabel', 'renderContent'];
103
+ const allowedProps = ['collections', 'items', 'rootId', 'expanded', 'defaultExpanded', 'selectionType', 'size', 'variant', 'collectionIcon', 'collectionIconExpanded', 'itemIcon', 'getItemProps', 'getCollectionProps', 'showRootCollection', 'onCollectionClick', 'onCollectionToggle', 'onItemClick', 'treeLabel', 'renderContent', 'sortOrder'];
99
104
  export { propTypes, allowedProps };
@@ -262,7 +262,7 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
262
262
 
263
263
  getSubCollections(collection) {
264
264
  const collections = [].concat(collection.collections || []);
265
- return collections.map(id => this.getCollectionProps(this.props.collections[id])).filter(collection => collection != null);
265
+ return collections.map(id => this.getCollectionProps(this.props.collections[id])).filter(collection => collection != null).sort(this.props.sortOrder);
266
266
  }
267
267
 
268
268
  getItems(collection) {
@@ -271,7 +271,7 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
271
271
  return items.map(id => {
272
272
  return { ...this.props.items[id]
273
273
  };
274
- }).filter(item => item != null);
274
+ }).filter(item => item != null).sort(this.props.sortOrder);
275
275
  } else {
276
276
  return [];
277
277
  }
@@ -297,7 +297,7 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
297
297
  }
298
298
 
299
299
  renderRoot() {
300
- return this.collections.map((collection, i) => (0, _emotion.jsx)(_TreeCollection.TreeCollection, Object.assign({
300
+ return this.collections.sort(this.props.sortOrder).map((collection, i) => (0, _emotion.jsx)(_TreeCollection.TreeCollection, Object.assign({
301
301
  key: i
302
302
  }, (0, _pickProps.pickProps)((0, _omitProps.omitProps)(this.props), _TreeCollection.TreeCollection.allowedProps), this.getCollectionProps(collection), {
303
303
  selection: this.state.selection,
@@ -338,7 +338,10 @@ let TreeBrowser = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
338
338
  selectionType: 'none',
339
339
  onItemClick: function (item) {},
340
340
  onCollectionClick: function (id, collection) {},
341
- onCollectionToggle: function (collection) {}
341
+ onCollectionToggle: function (collection) {},
342
+ sortOrder: function (obj1, obj2) {
343
+ return 0;
344
+ }
342
345
  }, _class2.Node = _TreeNode.TreeNode, _class2.Collection = _TreeCollection.TreeCollection, _class2.Button = _TreeButton.TreeButton, _temp)) || _class) || _class);
343
346
  exports.TreeBrowser = TreeBrowser;
344
347
  var _default = TreeBrowser;
@@ -104,8 +104,13 @@ const propTypes = {
104
104
  * An optional label to assist visually impaired users
105
105
  */
106
106
  treeLabel: _propTypes.default.string,
107
- renderContent: _propTypes.default.func
107
+ renderContent: _propTypes.default.func,
108
+
109
+ /**
110
+ * An optional compare function to specify order of the collections and the items
111
+ */
112
+ sortOrder: _propTypes.default.func
108
113
  };
109
114
  exports.propTypes = propTypes;
110
- const allowedProps = ['collections', 'items', 'rootId', 'expanded', 'defaultExpanded', 'selectionType', 'size', 'variant', 'collectionIcon', 'collectionIconExpanded', 'itemIcon', 'getItemProps', 'getCollectionProps', 'showRootCollection', 'onCollectionClick', 'onCollectionToggle', 'onItemClick', 'treeLabel', 'renderContent'];
115
+ const allowedProps = ['collections', 'items', 'rootId', 'expanded', 'defaultExpanded', 'selectionType', 'size', 'variant', 'collectionIcon', 'collectionIconExpanded', 'itemIcon', 'getItemProps', 'getCollectionProps', 'showRootCollection', 'onCollectionClick', 'onCollectionToggle', 'onItemClick', 'treeLabel', 'renderContent', 'sortOrder'];
111
116
  exports.allowedProps = allowedProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-tree-browser",
3
- "version": "8.12.1-snapshot.51+4d3697334",
3
+ "version": "8.13.0",
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.12.1-snapshot.51+4d3697334",
28
- "@instructure/ui-color-utils": "8.12.1-snapshot.51+4d3697334",
29
- "@instructure/ui-test-locator": "8.12.1-snapshot.51+4d3697334",
30
- "@instructure/ui-test-utils": "8.12.1-snapshot.51+4d3697334",
31
- "@instructure/ui-themes": "8.12.1-snapshot.51+4d3697334"
27
+ "@instructure/ui-babel-preset": "8.13.0",
28
+ "@instructure/ui-color-utils": "8.13.0",
29
+ "@instructure/ui-test-locator": "8.13.0",
30
+ "@instructure/ui-test-utils": "8.13.0",
31
+ "@instructure/ui-themes": "8.13.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.13.10",
35
- "@instructure/emotion": "8.12.1-snapshot.51+4d3697334",
36
- "@instructure/shared-types": "8.12.1-snapshot.51+4d3697334",
37
- "@instructure/ui-icons": "8.12.1-snapshot.51+4d3697334",
38
- "@instructure/ui-img": "8.12.1-snapshot.51+4d3697334",
39
- "@instructure/ui-prop-types": "8.12.1-snapshot.51+4d3697334",
40
- "@instructure/ui-react-utils": "8.12.1-snapshot.51+4d3697334",
41
- "@instructure/ui-testable": "8.12.1-snapshot.51+4d3697334",
42
- "@instructure/ui-utils": "8.12.1-snapshot.51+4d3697334",
35
+ "@instructure/emotion": "8.13.0",
36
+ "@instructure/shared-types": "8.13.0",
37
+ "@instructure/ui-icons": "8.13.0",
38
+ "@instructure/ui-img": "8.13.0",
39
+ "@instructure/ui-prop-types": "8.13.0",
40
+ "@instructure/ui-react-utils": "8.13.0",
41
+ "@instructure/ui-testable": "8.13.0",
42
+ "@instructure/ui-utils": "8.13.0",
43
43
  "keycode": "^2",
44
44
  "prop-types": "^15"
45
45
  },
@@ -49,6 +49,5 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "sideEffects": false,
53
- "gitHead": "4d369733414715a70bae0628378e8d82214eab3e"
52
+ "sideEffects": false
54
53
  }
@@ -381,6 +381,80 @@ class Example extends React.Component {
381
381
  render(<Example/>)
382
382
  ```
383
383
 
384
+ ### Change the order of appearance of items and collection
385
+
386
+ By default, the order of collections and items depend on the order of `collections` and `items` array. We can override it by providing a `sortOrder` comparison function.
387
+
388
+ ---
389
+
390
+ **NOTE**
391
+
392
+ This works with all collections and items of the TreeBrowser.
393
+
394
+ ---
395
+
396
+ ```js
397
+ ---
398
+ example: true
399
+ render: false
400
+ ---
401
+ class Example extends React.Component {
402
+ constructor (props) {
403
+ super(props)
404
+ this.state = {
405
+ size: 'medium',
406
+ sorted: false
407
+ }
408
+ }
409
+ toogleSort = (event)=>{ this.setState({sorted:!this.state.sorted}) }
410
+ render () {
411
+ return (
412
+ <>
413
+ <View display="block" margin="none none medium">
414
+ <FormFieldGroup description="Turn of/off sorting">
415
+ <Checkbox
416
+ checked={this.state.sorted}
417
+ label="Sort"
418
+ onChange={this.toogleSort}
419
+ />
420
+ </FormFieldGroup>
421
+ </View>
422
+
423
+ <TreeBrowser
424
+ size={this.state.size}
425
+ collections={{
426
+ 1: {
427
+ id: 1,
428
+ name: "Assignments",
429
+ collections: [3,2],
430
+ items: [3],
431
+ descriptor: "Class Assignments"
432
+ },
433
+ 2: { id: 2, name: "English Assignments", collections: [4], items: [] },
434
+ 3: { id: 3, name: "Math Assignments", collections: [5], items: [2,1] },
435
+ 4: { id: 4, name: "Reading Assignments", collections: [], items: [4] },
436
+ 5: { id: 5, name: "Advanced Math Assignments", items: [5]}
437
+ }}
438
+ items={{
439
+ 1: { id: 1, name: "Addition Worksheet" },
440
+ 2: { id: 2, name: "Subtraction Worksheet" },
441
+ 3: { id: 3, name: "General Questions" },
442
+ 4: { id: 4, name: "Vogon Poetry" },
443
+ 5: { id: 5, name: "Bistromath", descriptor: "Explain the Bistromathic Drive" }
444
+ }}
445
+ defaultExpanded={[1, 3]}
446
+ rootId={1}
447
+ sortOrder={this.state.sorted? (a,b)=>{return(a.name).localeCompare(b.name)}: (a,b)=>{return 0} }
448
+ />
449
+ </>
450
+ )
451
+ }
452
+ }
453
+
454
+ render(<Example/>)
455
+
456
+ ```
457
+
384
458
  ### showRootCollection
385
459
 
386
460
  The `showRootCollection` prop sets whether the root collection (specified in `rootId` prop) is displayed or to begin with its immediate sub-collections and items instead. It defaults to `true`.
@@ -73,7 +73,11 @@ class TreeBrowser extends Component<TreeBrowserProps> {
73
73
  // @ts-expect-error ts-migrate(6133) FIXME: 'id' is declared but its value is never read.
74
74
  onCollectionClick: function (id, collection) {},
75
75
  // @ts-expect-error ts-migrate(6133) FIXME: 'collection' is declared but its value is never re... Remove this comment to see the full error message
76
- onCollectionToggle: function (collection) {}
76
+ onCollectionToggle: function (collection) {},
77
+ // @ts-expect-error ts-migrate(6133) FIXME: 'foo' and 'bar' are declared but their values are never read.
78
+ sortOrder: function (obj1, obj2) {
79
+ return 0
80
+ }
77
81
  }
78
82
 
79
83
  static Node = TreeNode
@@ -309,6 +313,7 @@ class TreeBrowser extends Component<TreeBrowserProps> {
309
313
  return collections
310
314
  .map((id) => this.getCollectionProps(this.props.collections[id]))
311
315
  .filter((collection) => collection != null)
316
+ .sort(this.props.sortOrder)
312
317
  }
313
318
 
314
319
  // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'collection' implicitly has an 'any' typ... Remove this comment to see the full error message
@@ -321,6 +326,7 @@ class TreeBrowser extends Component<TreeBrowserProps> {
321
326
  return { ...this.props.items[id] }
322
327
  })
323
328
  .filter((item) => item != null)
329
+ .sort(this.props.sortOrder)
324
330
  } else {
325
331
  return []
326
332
  }
@@ -359,7 +365,7 @@ class TreeBrowser extends Component<TreeBrowserProps> {
359
365
  }
360
366
 
361
367
  renderRoot() {
362
- return this.collections.map((collection, i) => (
368
+ return this.collections.sort(this.props.sortOrder).map((collection, i) => (
363
369
  <TreeCollection
364
370
  key={i}
365
371
  // @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
@@ -52,6 +52,7 @@ type TreeBrowserOwnProps = {
52
52
  onItemClick?: (...args: any[]) => any
53
53
  treeLabel?: string
54
54
  renderContent?: (...args: any[]) => any
55
+ sortOrder?: (obj1: any, obj2: any) => number
55
56
  }
56
57
 
57
58
  type PropKeys = keyof TreeBrowserOwnProps
@@ -134,7 +135,11 @@ const propTypes: PropValidators<PropKeys> = {
134
135
  * An optional label to assist visually impaired users
135
136
  */
136
137
  treeLabel: PropTypes.string,
137
- renderContent: PropTypes.func
138
+ renderContent: PropTypes.func,
139
+ /**
140
+ * An optional compare function to specify order of the collections and the items
141
+ */
142
+ sortOrder: PropTypes.func
138
143
  }
139
144
 
140
145
  const allowedProps: AllowedPropKeys = [
@@ -156,7 +161,8 @@ const allowedProps: AllowedPropKeys = [
156
161
  'onCollectionToggle',
157
162
  'onItemClick',
158
163
  'treeLabel',
159
- 'renderContent'
164
+ 'renderContent',
165
+ 'sortOrder'
160
166
  ]
161
167
 
162
168
  export type { TreeBrowserProps, TreeBrowserStyle }
@@ -33,6 +33,7 @@ declare class TreeBrowser extends Component<TreeBrowserProps> {
33
33
  onItemClick?: ((...args: any[]) => any) | undefined;
34
34
  treeLabel?: string | undefined;
35
35
  renderContent?: ((...args: any[]) => any) | undefined;
36
+ sortOrder?: ((obj1: any, obj2: any) => number) | undefined;
36
37
  })[];
37
38
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
38
39
  collections: any;
@@ -54,6 +55,7 @@ declare class TreeBrowser extends Component<TreeBrowserProps> {
54
55
  onItemClick?: ((...args: any[]) => any) | undefined;
55
56
  treeLabel?: string | undefined;
56
57
  renderContent?: ((...args: any[]) => any) | undefined;
58
+ sortOrder?: ((obj1: any, obj2: any) => number) | undefined;
57
59
  }>;
58
60
  static defaultProps: {
59
61
  size: string;
@@ -69,6 +71,7 @@ declare class TreeBrowser extends Component<TreeBrowserProps> {
69
71
  onItemClick: (item: any) => void;
70
72
  onCollectionClick: (id: any, collection: any) => void;
71
73
  onCollectionToggle: (collection: any) => void;
74
+ sortOrder: (obj1: any, obj2: any) => number;
72
75
  };
73
76
  static Node: typeof TreeNode;
74
77
  static Collection: typeof TreeCollection;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TreeBrowser/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AAEf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAIxE,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG/C;;;;GAIG;A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;IAoBf,SAAS,CAAC,OAAO,KAAA;IAUjB,sBAAsB,CAAC,OAAO,KAAA,EAAE,IAAI,KAAA;IAgBpC,gBAAgB,CAAC,IAAI,KAAA;IAarB,qBAAqB,CAAC,IAAI,KAAA;IAS1B,gBAAgB,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA;IAc5B,iBAAiB,CAAC,UAAU,KAAA;IAU5B,QAAQ,CAAC,UAAU,KAAA;IAgBnB,cAAc,+BAOb;IAGD,kBAAkB,CAAC,UAAU,KAAA;IAgB7B,gBAAgB,CAAC,QAAQ,KAAA,EAAE,EAAE,KAAA;IAK7B,UAAU;IAoBV,MAAM;CAmBP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -21,6 +21,7 @@ declare type TreeBrowserOwnProps = {
21
21
  onItemClick?: (...args: any[]) => any;
22
22
  treeLabel?: string;
23
23
  renderContent?: (...args: any[]) => any;
24
+ sortOrder?: (obj1: any, obj2: any) => number;
24
25
  };
25
26
  declare type PropKeys = keyof TreeBrowserOwnProps;
26
27
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/TreeBrowser/props.ts"],"names":[],"mappings":";AA4BA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,GAAG,CAAA;IAChB,KAAK,EAAE,GAAG,CAAA;IACV,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,eAAe,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IACrC,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACjC,I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T 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.