@brightspace-ui/core 1.213.1 → 1.216.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.
Files changed (76) hide show
  1. package/components/button/button-mixin.js +1 -1
  2. package/components/calendar/calendar.js +5 -5
  3. package/components/card/card-footer-link.js +2 -2
  4. package/components/card/card.js +1 -1
  5. package/components/demo/code-view.js +2 -2
  6. package/components/demo/demo-snippet.js +5 -2
  7. package/components/dialog/dialog-confirm.js +1 -0
  8. package/components/dialog/dialog-mixin.js +7 -2
  9. package/components/dropdown/dropdown-button-subtle.js +1 -1
  10. package/components/dropdown/dropdown-button.js +1 -1
  11. package/components/dropdown/dropdown-content-mixin.js +6 -6
  12. package/components/dropdown/dropdown-context-menu.js +1 -1
  13. package/components/dropdown/dropdown-menu.js +1 -0
  14. package/components/dropdown/dropdown-more.js +1 -1
  15. package/components/dropdown/dropdown-opener-mixin.js +1 -0
  16. package/components/dropdown/dropdown-tabs.js +1 -0
  17. package/components/dropdown/dropdown.js +1 -0
  18. package/components/expand-collapse/expand-collapse-content.js +4 -4
  19. package/components/filter/filter.js +5 -4
  20. package/components/focus-trap/focus-trap.js +6 -5
  21. package/components/form/demo/form-demo.js +1 -1
  22. package/components/form/demo/form-dialog-demo.js +4 -4
  23. package/components/form/demo/form-native-demo.js +1 -1
  24. package/components/form/form-element-mixin.js +12 -3
  25. package/components/form/form-errory-summary.js +2 -2
  26. package/components/form/form-native.js +1 -1
  27. package/components/form/form.js +1 -1
  28. package/components/hierarchical-view/hierarchical-view-mixin.js +7 -6
  29. package/components/html-block/demo/html-block.html +31 -0
  30. package/components/html-block/html-block.js +18 -7
  31. package/components/inputs/demo/input-radio-solo-test.js +1 -1
  32. package/components/inputs/demo/input-radio-spacer-test.js +1 -1
  33. package/components/inputs/demo/input-select-test.js +1 -1
  34. package/components/inputs/input-checkbox.js +1 -1
  35. package/components/inputs/input-date-range.js +4 -3
  36. package/components/inputs/input-date-time-range-to.js +1 -1
  37. package/components/inputs/input-date-time-range.js +4 -3
  38. package/components/inputs/input-date-time.js +6 -5
  39. package/components/inputs/input-date.js +3 -0
  40. package/components/inputs/input-number.js +2 -1
  41. package/components/inputs/input-percent.js +2 -1
  42. package/components/inputs/input-search.js +3 -3
  43. package/components/inputs/input-text.js +8 -8
  44. package/components/inputs/input-textarea.js +5 -5
  45. package/components/inputs/input-time-range.js +4 -4
  46. package/components/inputs/input-time.js +1 -1
  47. package/components/link/link.js +1 -1
  48. package/components/list/README.md +91 -59
  49. package/components/list/demo/list-drag-and-drop.js +25 -16
  50. package/components/list/list-header.js +1 -0
  51. package/components/list/list-item-button.js +1 -0
  52. package/components/list/list-item-checkbox-mixin.js +4 -2
  53. package/components/list/list-item-drag-drop-mixin.js +12 -6
  54. package/components/list/list-item-generic-layout.js +5 -4
  55. package/components/list/list-item-mixin.js +1 -0
  56. package/components/list/list-item.js +1 -0
  57. package/components/list/list.js +9 -4
  58. package/components/menu/demo/custom-view.js +1 -1
  59. package/components/menu/menu-item-link.js +1 -1
  60. package/components/menu/menu-item-mixin.js +1 -1
  61. package/components/menu/menu.js +2 -2
  62. package/components/overflow-group/overflow-group.js +1 -1
  63. package/components/scroll-wrapper/demo/scroll-wrapper-test.js +1 -1
  64. package/components/selection/selection-action.js +1 -1
  65. package/components/selection/selection-input.js +1 -1
  66. package/components/selection/selection-select-all.js +1 -1
  67. package/components/switch/switch-mixin.js +1 -1
  68. package/components/table/table-col-sort-button.js +1 -1
  69. package/components/tabs/tabs.js +20 -15
  70. package/components/tooltip/tooltip.js +1 -1
  71. package/custom-elements.json +97 -69
  72. package/directives/animate/animate.js +35 -18
  73. package/helpers/demo/announce-test.js +1 -0
  74. package/mixins/arrow-keys-mixin.js +3 -1
  75. package/package.json +1 -1
  76. package/templates/primary-secondary/primary-secondary.js +2 -1
@@ -374,34 +374,37 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
374
374
  }
375
375
 
376
376
  getTabListRect() {
377
+ if (!this.shadowRoot) return undefined;
377
378
  return this.shadowRoot.querySelector('.d2l-tabs-container-list').getBoundingClientRect();
378
379
  }
379
380
 
380
381
  _animateTabAddition(tabInfo) {
381
- const tab = this.shadowRoot.querySelector(`d2l-tab-internal[controls-panel="${cssEscape(tabInfo.id)}"]`);
382
+ const tab = this.shadowRoot
383
+ && this.shadowRoot.querySelector(`d2l-tab-internal[controls-panel="${cssEscape(tabInfo.id)}"]`);
382
384
  return new Promise((resolve) => {
383
385
  const handleTransitionEnd = (e) => {
384
386
  if (e.propertyName !== 'max-width') return;
385
- tab.removeEventListener('transitionend', handleTransitionEnd);
387
+ if (tab) tab.removeEventListener('transitionend', handleTransitionEnd);
386
388
  resolve();
387
389
  };
388
- tab.addEventListener('transitionend', handleTransitionEnd);
390
+ if (tab) tab.addEventListener('transitionend', handleTransitionEnd);
389
391
  tabInfo.state = '';
390
392
  this.requestUpdate();
391
393
  });
392
394
  }
393
395
 
394
396
  _animateTabRemoval(tabInfo) {
395
- const tab = this.shadowRoot.querySelector(`d2l-tab-internal[controls-panel="${cssEscape(tabInfo.id)}"]`);
397
+ const tab = this.shadowRoot &&
398
+ this.shadowRoot.querySelector(`d2l-tab-internal[controls-panel="${cssEscape(tabInfo.id)}"]`);
396
399
  return new Promise((resolve) => {
397
400
  const handleTransitionEnd = (e) => {
398
401
  if (e.propertyName !== 'max-width') return;
399
- tab.removeEventListener('transitionend', handleTransitionEnd);
402
+ if (tab) tab.removeEventListener('transitionend', handleTransitionEnd);
400
403
  this._tabInfos.splice(this._tabInfos.findIndex(info => info.id === tabInfo.id), 1);
401
404
  this.requestUpdate();
402
405
  resolve();
403
406
  };
404
- tab.addEventListener('transitionend', handleTransitionEnd);
407
+ if (tab) tab.addEventListener('transitionend', handleTransitionEnd);
405
408
  });
406
409
  }
407
410
 
@@ -488,7 +491,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
488
491
  }
489
492
 
490
493
  async _focusSelected() {
491
- const selectedTab = this.shadowRoot.querySelector('d2l-tab-internal[aria-selected="true"]');
494
+ const selectedTab = this.shadowRoot && this.shadowRoot.querySelector('d2l-tab-internal[aria-selected="true"]');
492
495
  if (!selectedTab) return;
493
496
 
494
497
  const selectedTabInfo = this._getTabInfo(selectedTab.controlsPanel);
@@ -517,6 +520,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
517
520
  }
518
521
 
519
522
  _getPanel(id) {
523
+ if (!this.shadowRoot) return;
520
524
  // use simple selector for slot (Edge)
521
525
  const slot = this.shadowRoot.querySelector('.d2l-panels-container').querySelector('slot');
522
526
  const panels = this._getPanels(slot);
@@ -702,7 +706,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
702
706
  await this._scrollToPosition(newTranslationValue);
703
707
  await this._updateScrollVisibility(newMeasures);
704
708
 
705
- if (!isOverflowingNext) {
709
+ if (!isOverflowingNext && this.shadowRoot) {
706
710
  this.shadowRoot.querySelector('.d2l-tabs-scroll-previous-container button').focus();
707
711
  }
708
712
 
@@ -735,7 +739,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
735
739
  await this._scrollToPosition(newTranslationValue);
736
740
  await this._updateScrollVisibility(newMeasures);
737
741
 
738
- if (!isOverflowingPrevious) {
742
+ if (!isOverflowingPrevious && this.shadowRoot) {
739
743
  this.shadowRoot.querySelector('.d2l-tabs-scroll-next-container button').focus();
740
744
  }
741
745
 
@@ -777,7 +781,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
777
781
  }
778
782
 
779
783
  this._translationValue = translationValue;
780
- if (reduceMotion) return this.updateComplete;
784
+ if (!this.shadowRoot || reduceMotion) return this.updateComplete;
781
785
 
782
786
  return new Promise((resolve) => {
783
787
  const tabList = this.shadowRoot.querySelector('.d2l-tabs-container-list');
@@ -805,13 +809,13 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
805
809
  expandedPromise = this.updateComplete;
806
810
  } else {
807
811
  expandedPromise = new Promise((resolve) => {
808
- const tabsContainer = this.shadowRoot.querySelector('.d2l-tabs-container');
812
+ const tabsContainer = this.shadowRoot && this.shadowRoot.querySelector('.d2l-tabs-container');
809
813
  const handleTransitionEnd = (e) => {
810
814
  if (e.propertyName !== 'max-width') return;
811
- tabsContainer.removeEventListener('transitionend', handleTransitionEnd);
815
+ if (tabsContainer) tabsContainer.removeEventListener('transitionend', handleTransitionEnd);
812
816
  resolve();
813
817
  };
814
- tabsContainer.addEventListener('transitionend', handleTransitionEnd);
818
+ if (tabsContainer) tabsContainer.addEventListener('transitionend', handleTransitionEnd);
815
819
  this._scrollCollapsed = false;
816
820
  this._maxWidth = measures.totalTabsWidth + 50;
817
821
  });
@@ -828,7 +832,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
828
832
  if (!this._allowScrollPrevious) {
829
833
  this._focusSelected();
830
834
  } else {
831
- this.shadowRoot.querySelector('.d2l-tabs-scroll-previous-container button').focus();
835
+ if (this.shadowRoot) this.shadowRoot.querySelector('.d2l-tabs-scroll-previous-container button').focus();
832
836
  }
833
837
  }
834
838
 
@@ -838,6 +842,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
838
842
 
839
843
  _updateMeasures() {
840
844
  let totalTabsWidth = 0;
845
+ if (!this.shadowRoot) return;
841
846
  const tabs = [...this.shadowRoot.querySelectorAll('d2l-tab-internal')];
842
847
 
843
848
  const tabRects = tabs.map((tab) => {
@@ -894,7 +899,7 @@ class Tabs extends LocalizeCoreElement(ArrowKeysMixin(RtlMixin(FocusVisiblePolyf
894
899
  // don't animate the tabs list visibility if it's the inital render
895
900
  if (reduceMotion || !this._initialized) {
896
901
  this._state = 'hidden';
897
- } else {
902
+ } else if (this.shadowRoot) {
898
903
  const layout = this.shadowRoot.querySelector('.d2l-tabs-layout');
899
904
  const handleTransitionEnd = (e) => {
900
905
  if (e.propertyName !== 'max-height') return;
@@ -715,7 +715,7 @@ class Tooltip extends RtlMixin(LitElement) {
715
715
  }
716
716
 
717
717
  _getContent() {
718
- return this.shadowRoot.querySelector('.d2l-tooltip-content');
718
+ return this.shadowRoot && this.shadowRoot.querySelector('.d2l-tooltip-content');
719
719
  }
720
720
 
721
721
  _isAboveOrBelow() {
@@ -3378,6 +3378,12 @@
3378
3378
  "path": "./components/html-block/html-block.js",
3379
3379
  "description": "A component for displaying user-authored HTML.",
3380
3380
  "attributes": [
3381
+ {
3382
+ "name": "compact",
3383
+ "description": "Whether compact styles should be applied",
3384
+ "type": "Boolean",
3385
+ "default": "false"
3386
+ },
3381
3387
  {
3382
3388
  "name": "no-deferred-rendering",
3383
3389
  "description": "Whether to disable deferred rendering of the user-authored HTML. Do *not* set this\nunless your HTML relies on script executions that may break upon stamping.",
@@ -3386,6 +3392,13 @@
3386
3392
  }
3387
3393
  ],
3388
3394
  "properties": [
3395
+ {
3396
+ "name": "compact",
3397
+ "attribute": "compact",
3398
+ "description": "Whether compact styles should be applied",
3399
+ "type": "Boolean",
3400
+ "default": "false"
3401
+ },
3389
3402
  {
3390
3403
  "name": "noDeferredRendering",
3391
3404
  "attribute": "no-deferred-rendering",
@@ -6260,7 +6273,7 @@
6260
6273
  {
6261
6274
  "name": "items",
6262
6275
  "type": "array",
6263
- "default": "[{\"key\":\"1\",\"primaryText\":\"Introductory Earth Sciences\",\"supportingText\":\"This course explores the geological processes of the Earth's interior and surface. These include volcanism, earthquakes, mountain building, glaciation and weathering.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/63b162ab-b582-4bf9-8c1d-1dad04714121/tile-high-density-max-size.jpg\",\"items\":[{\"key\":\"1-1\",\"primaryText\":\"Glaciation\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]},{\"key\":\"1-2\",\"primaryText\":\"Weathering\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]},{\"key\":\"1-3\",\"primaryText\":\"Volcanism\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]}]},{\"key\":\"2\",\"primaryText\":\"Flow and Transport Through Fractured Rocks\",\"supportingText\":\"Fractures are ubiquitous in geologic media and important in disciplines such as physical and contaminant hydrogeology, geotechnical engineering, civil and environmental engineering, petroleum engineering among other areas.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/e5fd575a-bc14-4a80-89e1-46f349a76178/tile-high-density-max-size.jpg\",\"items\":[{\"key\":\"2-1\",\"primaryText\":\"Contaminant Transport\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]},{\"key\":\"2-2\",\"primaryText\":\"Modelling Flow in Fractured Media\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]}]},{\"key\":\"3\",\"primaryText\":\"Applied Wetland Science\",\"supportingText\":\"Advanced concepts on wetland ecosystems in the context of regional and global earth systems processes such as carbon and nitrogen cycling and climate change, applications of wetland paleoecology, use of isotopes and other geochemical tools in wetland science, and wetland engineering in landscape rehabilitation and ecotechnology.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg\",\"items\":[{\"key\":\"3-1\",\"primaryText\":\"Carbon & Nitrogen Cycling\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]},{\"key\":\"3-2\",\"primaryText\":\"Wetland Engineering\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]}]}]"
6276
+ "default": "[{\"key\":\"1\",\"primaryText\":\"Introductory Earth Sciences\",\"supportingText\":\"This course explores the geological processes of the Earth's interior and surface. These include volcanism, earthquakes, mountain building, glaciation and weathering.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/63b162ab-b582-4bf9-8c1d-1dad04714121/tile-high-density-max-size.jpg\",\"dropNested\":true,\"items\":[{\"key\":\"1-1\",\"primaryText\":\"Glaciation\",\"supportingText\":\"Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/bf648978-6637-4fdc-815b-81572c436c0e/tile-high-density-max-size.jpg\",\"dropNested\":true,\"items\":[]},{\"key\":\"1-2\",\"primaryText\":\"Weathering\",\"supportingText\":\"Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/50f91ba6-7c25-482a-bd71-1c4b7c8d2154/tile-high-density-min-size.jpg\",\"dropNested\":true,\"items\":[]},{\"key\":\"1-3\",\"primaryText\":\"Volcanism\",\"supportingText\":\"Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/5eb2371d-6099-4c8d-8aad-075f357012a2/tile-high-density-min-size.jpg\",\"dropNested\":true,\"items\":[]}]},{\"key\":\"2\",\"primaryText\":\"Flow and Transport Through Fractured Rocks\",\"supportingText\":\"Fractures are ubiquitous in geologic media and important in disciplines such as physical and contaminant hydrogeology, geotechnical engineering, civil and environmental engineering, petroleum engineering among other areas.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/e5fd575a-bc14-4a80-89e1-46f349a76178/tile-high-density-max-size.jpg\",\"items\":[{\"key\":\"2-1\",\"primaryText\":\"Contaminant Transport\",\"supportingText\":\"No Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/824fffa1-86a6-4489-84ba-91edfbc1dcc4/tile-high-density-min-size.jpg\",\"dropNested\":false,\"items\":[]},{\"key\":\"2-2\",\"primaryText\":\"Modelling Flow in Fractured Media\",\"supportingText\":\"No Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/e18c92a4-b996-444f-84b5-988874feccac/tile-high-density-min-size.jpg\",\"dropNested\":false,\"items\":[]}]},{\"key\":\"3\",\"primaryText\":\"Applied Wetland Science\",\"supportingText\":\"Advanced concepts on wetland ecosystems in the context of regional and global earth systems processes such as carbon and nitrogen cycling and climate change, applications of wetland paleoecology, use of isotopes and other geochemical tools in wetland science, and wetland engineering in landscape rehabilitation and ecotechnology.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg\",\"items\":[{\"key\":\"3-1\",\"primaryText\":\"Carbon & Nitrogen Cycling\",\"supportingText\":\"Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/623b420b-a305-4762-8af8-598f0e72e956/tile-high-density-min-size.jpg\",\"dropNested\":true,\"items\":[]},{\"key\":\"3-2\",\"primaryText\":\"Wetland Engineering\",\"supportingText\":\"Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/26102577-8f2a-4e24-84b5-19d76decbc7a/tile-high-density-min-size.jpg\",\"dropNested\":true,\"items\":[]}]}]"
6264
6277
  }
6265
6278
  ],
6266
6279
  "properties": [
@@ -6268,7 +6281,7 @@
6268
6281
  "name": "items",
6269
6282
  "attribute": "items",
6270
6283
  "type": "array",
6271
- "default": "[{\"key\":\"1\",\"primaryText\":\"Introductory Earth Sciences\",\"supportingText\":\"This course explores the geological processes of the Earth's interior and surface. These include volcanism, earthquakes, mountain building, glaciation and weathering.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/63b162ab-b582-4bf9-8c1d-1dad04714121/tile-high-density-max-size.jpg\",\"items\":[{\"key\":\"1-1\",\"primaryText\":\"Glaciation\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]},{\"key\":\"1-2\",\"primaryText\":\"Weathering\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]},{\"key\":\"1-3\",\"primaryText\":\"Volcanism\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]}]},{\"key\":\"2\",\"primaryText\":\"Flow and Transport Through Fractured Rocks\",\"supportingText\":\"Fractures are ubiquitous in geologic media and important in disciplines such as physical and contaminant hydrogeology, geotechnical engineering, civil and environmental engineering, petroleum engineering among other areas.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/e5fd575a-bc14-4a80-89e1-46f349a76178/tile-high-density-max-size.jpg\",\"items\":[{\"key\":\"2-1\",\"primaryText\":\"Contaminant Transport\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]},{\"key\":\"2-2\",\"primaryText\":\"Modelling Flow in Fractured Media\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]}]},{\"key\":\"3\",\"primaryText\":\"Applied Wetland Science\",\"supportingText\":\"Advanced concepts on wetland ecosystems in the context of regional and global earth systems processes such as carbon and nitrogen cycling and climate change, applications of wetland paleoecology, use of isotopes and other geochemical tools in wetland science, and wetland engineering in landscape rehabilitation and ecotechnology.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg\",\"items\":[{\"key\":\"3-1\",\"primaryText\":\"Carbon & Nitrogen Cycling\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]},{\"key\":\"3-2\",\"primaryText\":\"Wetland Engineering\",\"supportingText\":\"Supporting Info\",\"imgSrc\":\"\",\"items\":[]}]}]"
6284
+ "default": "[{\"key\":\"1\",\"primaryText\":\"Introductory Earth Sciences\",\"supportingText\":\"This course explores the geological processes of the Earth's interior and surface. These include volcanism, earthquakes, mountain building, glaciation and weathering.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/63b162ab-b582-4bf9-8c1d-1dad04714121/tile-high-density-max-size.jpg\",\"dropNested\":true,\"items\":[{\"key\":\"1-1\",\"primaryText\":\"Glaciation\",\"supportingText\":\"Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/bf648978-6637-4fdc-815b-81572c436c0e/tile-high-density-max-size.jpg\",\"dropNested\":true,\"items\":[]},{\"key\":\"1-2\",\"primaryText\":\"Weathering\",\"supportingText\":\"Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/50f91ba6-7c25-482a-bd71-1c4b7c8d2154/tile-high-density-min-size.jpg\",\"dropNested\":true,\"items\":[]},{\"key\":\"1-3\",\"primaryText\":\"Volcanism\",\"supportingText\":\"Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/5eb2371d-6099-4c8d-8aad-075f357012a2/tile-high-density-min-size.jpg\",\"dropNested\":true,\"items\":[]}]},{\"key\":\"2\",\"primaryText\":\"Flow and Transport Through Fractured Rocks\",\"supportingText\":\"Fractures are ubiquitous in geologic media and important in disciplines such as physical and contaminant hydrogeology, geotechnical engineering, civil and environmental engineering, petroleum engineering among other areas.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/e5fd575a-bc14-4a80-89e1-46f349a76178/tile-high-density-max-size.jpg\",\"items\":[{\"key\":\"2-1\",\"primaryText\":\"Contaminant Transport\",\"supportingText\":\"No Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/824fffa1-86a6-4489-84ba-91edfbc1dcc4/tile-high-density-min-size.jpg\",\"dropNested\":false,\"items\":[]},{\"key\":\"2-2\",\"primaryText\":\"Modelling Flow in Fractured Media\",\"supportingText\":\"No Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/e18c92a4-b996-444f-84b5-988874feccac/tile-high-density-min-size.jpg\",\"dropNested\":false,\"items\":[]}]},{\"key\":\"3\",\"primaryText\":\"Applied Wetland Science\",\"supportingText\":\"Advanced concepts on wetland ecosystems in the context of regional and global earth systems processes such as carbon and nitrogen cycling and climate change, applications of wetland paleoecology, use of isotopes and other geochemical tools in wetland science, and wetland engineering in landscape rehabilitation and ecotechnology.\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg\",\"items\":[{\"key\":\"3-1\",\"primaryText\":\"Carbon & Nitrogen Cycling\",\"supportingText\":\"Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/623b420b-a305-4762-8af8-598f0e72e956/tile-high-density-min-size.jpg\",\"dropNested\":true,\"items\":[]},{\"key\":\"3-2\",\"primaryText\":\"Wetland Engineering\",\"supportingText\":\"Nesting Allowed\",\"imgSrc\":\"https://s.brightspace.com/course-images/images/26102577-8f2a-4e24-84b5-19d76decbc7a/tile-high-density-min-size.jpg\",\"dropNested\":true,\"items\":[]}]}]"
6272
6285
  }
6273
6286
  ]
6274
6287
  },
@@ -6306,23 +6319,24 @@
6306
6319
  },
6307
6320
  {
6308
6321
  "name": "drop-nested",
6309
- "description": "**Drag & drop:** Whether the items can be dropped as nested children",
6322
+ "description": "**Drag & drop:** Whether nested items can be dropped on this item",
6310
6323
  "type": "boolean",
6311
6324
  "default": "false"
6312
6325
  },
6313
- {
6314
- "name": "disabled",
6315
- "description": "**Selection:** Disables the input",
6316
- "type": "boolean"
6317
- },
6318
6326
  {
6319
6327
  "name": "key",
6320
6328
  "description": "Value to identify item if selectable",
6321
6329
  "type": "string"
6322
6330
  },
6331
+ {
6332
+ "name": "disabled",
6333
+ "description": "**Selection:** Disables the input",
6334
+ "type": "boolean",
6335
+ "default": "false"
6336
+ },
6323
6337
  {
6324
6338
  "name": "selectable",
6325
- "description": "**Selection:** Indicates a input should be rendered for selecting the item",
6339
+ "description": "**Selection:** Indicates an input should be rendered for selecting the item",
6326
6340
  "type": "boolean",
6327
6341
  "default": "true"
6328
6342
  },
@@ -6386,26 +6400,27 @@
6386
6400
  {
6387
6401
  "name": "dropNested",
6388
6402
  "attribute": "drop-nested",
6389
- "description": "**Drag & drop:** Whether the items can be dropped as nested children",
6403
+ "description": "**Drag & drop:** Whether nested items can be dropped on this item",
6390
6404
  "type": "boolean",
6391
6405
  "default": "false"
6392
6406
  },
6393
- {
6394
- "name": "disabled",
6395
- "attribute": "disabled",
6396
- "description": "**Selection:** Disables the input",
6397
- "type": "boolean"
6398
- },
6399
6407
  {
6400
6408
  "name": "key",
6401
6409
  "attribute": "key",
6402
6410
  "description": "Value to identify item if selectable",
6403
6411
  "type": "string"
6404
6412
  },
6413
+ {
6414
+ "name": "disabled",
6415
+ "attribute": "disabled",
6416
+ "description": "**Selection:** Disables the input",
6417
+ "type": "boolean",
6418
+ "default": "false"
6419
+ },
6405
6420
  {
6406
6421
  "name": "selectable",
6407
6422
  "attribute": "selectable",
6408
- "description": "**Selection:** Indicates a input should be rendered for selecting the item",
6423
+ "description": "**Selection:** Indicates an input should be rendered for selecting the item",
6409
6424
  "type": "boolean",
6410
6425
  "default": "true"
6411
6426
  },
@@ -6449,9 +6464,6 @@
6449
6464
  "name": "d2l-list-item-position-change",
6450
6465
  "description": "Dispatched when a draggable list item's position changes in the list. See [Event Details: d2l-list-item-position-change](#event-details%3A-d2l-list-item-position-change)."
6451
6466
  },
6452
- {
6453
- "name": "d2l-list-items-move"
6454
- },
6455
6467
  {
6456
6468
  "name": "d2l-list-item-selected",
6457
6469
  "description": "Dispatched when the component item is selected"
@@ -6478,6 +6490,12 @@
6478
6490
  "type": "boolean",
6479
6491
  "default": "false"
6480
6492
  }
6493
+ ],
6494
+ "slots": [
6495
+ {
6496
+ "name": "",
6497
+ "description": "Responsive container using `d2l-overflow-group` for `d2l-selection-action` elements"
6498
+ }
6481
6499
  ]
6482
6500
  },
6483
6501
  {
@@ -6515,24 +6533,26 @@
6515
6533
  },
6516
6534
  {
6517
6535
  "name": "drop-nested",
6518
- "description": "**Drag & drop:** Whether the items can be dropped as nested children",
6536
+ "description": "**Drag & drop:** Whether nested items can be dropped on this item",
6519
6537
  "type": "boolean",
6520
6538
  "default": "false"
6521
6539
  },
6522
- {
6523
- "name": "disabled",
6524
- "description": "**Selection:** Disables the input",
6525
- "type": "boolean"
6526
- },
6527
6540
  {
6528
6541
  "name": "key",
6529
6542
  "description": "Value to identify item if selectable",
6530
6543
  "type": "string"
6531
6544
  },
6545
+ {
6546
+ "name": "disabled",
6547
+ "description": "**Selection:** Disables the input",
6548
+ "type": "boolean",
6549
+ "default": "false"
6550
+ },
6532
6551
  {
6533
6552
  "name": "selectable",
6534
- "description": "**Selection:** Indicates a input should be rendered for selecting the item",
6535
- "type": "boolean"
6553
+ "description": "**Selection:** Indicates an input should be rendered for selecting the item",
6554
+ "type": "boolean",
6555
+ "default": "false"
6536
6556
  },
6537
6557
  {
6538
6558
  "name": "selected",
@@ -6594,27 +6614,29 @@
6594
6614
  {
6595
6615
  "name": "dropNested",
6596
6616
  "attribute": "drop-nested",
6597
- "description": "**Drag & drop:** Whether the items can be dropped as nested children",
6617
+ "description": "**Drag & drop:** Whether nested items can be dropped on this item",
6598
6618
  "type": "boolean",
6599
6619
  "default": "false"
6600
6620
  },
6601
- {
6602
- "name": "disabled",
6603
- "attribute": "disabled",
6604
- "description": "**Selection:** Disables the input",
6605
- "type": "boolean"
6606
- },
6607
6621
  {
6608
6622
  "name": "key",
6609
6623
  "attribute": "key",
6610
6624
  "description": "Value to identify item if selectable",
6611
6625
  "type": "string"
6612
6626
  },
6627
+ {
6628
+ "name": "disabled",
6629
+ "attribute": "disabled",
6630
+ "description": "**Selection:** Disables the input",
6631
+ "type": "boolean",
6632
+ "default": "false"
6633
+ },
6613
6634
  {
6614
6635
  "name": "selectable",
6615
6636
  "attribute": "selectable",
6616
- "description": "**Selection:** Indicates a input should be rendered for selecting the item",
6617
- "type": "boolean"
6637
+ "description": "**Selection:** Indicates an input should be rendered for selecting the item",
6638
+ "type": "boolean",
6639
+ "default": "false"
6618
6640
  },
6619
6641
  {
6620
6642
  "name": "selected",
@@ -6660,9 +6682,6 @@
6660
6682
  "name": "d2l-list-item-position-change",
6661
6683
  "description": "Dispatched when a draggable list item's position changes in the list. See [Event Details: d2l-list-item-position-change](#event-details%3A-d2l-list-item-position-change)."
6662
6684
  },
6663
- {
6664
- "name": "d2l-list-items-move"
6665
- },
6666
6685
  {
6667
6686
  "name": "d2l-list-item-selected",
6668
6687
  "description": "Dispatched when the component item is selected"
@@ -6680,6 +6699,10 @@
6680
6699
  {
6681
6700
  "name": "actions",
6682
6701
  "description": "Actions (e.g., button icons) associated with the listen item located at the right of the item"
6702
+ },
6703
+ {
6704
+ "name": "nested",
6705
+ "description": "Nested d2l-list element"
6683
6706
  }
6684
6707
  ]
6685
6708
  },
@@ -6850,24 +6873,26 @@
6850
6873
  },
6851
6874
  {
6852
6875
  "name": "drop-nested",
6853
- "description": "**Drag & drop:** Whether the items can be dropped as nested children",
6876
+ "description": "**Drag & drop:** Whether nested items can be dropped on this item",
6854
6877
  "type": "boolean",
6855
6878
  "default": "false"
6856
6879
  },
6857
- {
6858
- "name": "disabled",
6859
- "description": "**Selection:** Disables the input",
6860
- "type": "boolean"
6861
- },
6862
6880
  {
6863
6881
  "name": "key",
6864
6882
  "description": "Value to identify item if selectable",
6865
6883
  "type": "string"
6866
6884
  },
6885
+ {
6886
+ "name": "disabled",
6887
+ "description": "**Selection:** Disables the input",
6888
+ "type": "boolean",
6889
+ "default": "false"
6890
+ },
6867
6891
  {
6868
6892
  "name": "selectable",
6869
- "description": "**Selection:** Indicates a input should be rendered for selecting the item",
6870
- "type": "boolean"
6893
+ "description": "**Selection:** Indicates an input should be rendered for selecting the item",
6894
+ "type": "boolean",
6895
+ "default": "false"
6871
6896
  },
6872
6897
  {
6873
6898
  "name": "selected",
@@ -6941,27 +6966,29 @@
6941
6966
  {
6942
6967
  "name": "dropNested",
6943
6968
  "attribute": "drop-nested",
6944
- "description": "**Drag & drop:** Whether the items can be dropped as nested children",
6969
+ "description": "**Drag & drop:** Whether nested items can be dropped on this item",
6945
6970
  "type": "boolean",
6946
6971
  "default": "false"
6947
6972
  },
6948
- {
6949
- "name": "disabled",
6950
- "attribute": "disabled",
6951
- "description": "**Selection:** Disables the input",
6952
- "type": "boolean"
6953
- },
6954
6973
  {
6955
6974
  "name": "key",
6956
6975
  "attribute": "key",
6957
6976
  "description": "Value to identify item if selectable",
6958
6977
  "type": "string"
6959
6978
  },
6979
+ {
6980
+ "name": "disabled",
6981
+ "attribute": "disabled",
6982
+ "description": "**Selection:** Disables the input",
6983
+ "type": "boolean",
6984
+ "default": "false"
6985
+ },
6960
6986
  {
6961
6987
  "name": "selectable",
6962
6988
  "attribute": "selectable",
6963
- "description": "**Selection:** Indicates a input should be rendered for selecting the item",
6964
- "type": "boolean"
6989
+ "description": "**Selection:** Indicates an input should be rendered for selecting the item",
6990
+ "type": "boolean",
6991
+ "default": "false"
6965
6992
  },
6966
6993
  {
6967
6994
  "name": "selected",
@@ -7007,9 +7034,6 @@
7007
7034
  "name": "d2l-list-item-position-change",
7008
7035
  "description": "Dispatched when a draggable list item's position changes in the list. See [Event Details: d2l-list-item-position-change](#event-details%3A-d2l-list-item-position-change)."
7009
7036
  },
7010
- {
7011
- "name": "d2l-list-items-move"
7012
- },
7013
7037
  {
7014
7038
  "name": "d2l-list-item-selected",
7015
7039
  "description": "Dispatched when the component item is selected"
@@ -7027,6 +7051,10 @@
7027
7051
  {
7028
7052
  "name": "actions",
7029
7053
  "description": "Actions (e.g., button icons) associated with the listen item located at the right of the item"
7054
+ },
7055
+ {
7056
+ "name": "nested",
7057
+ "description": "Nested d2l-list element"
7030
7058
  }
7031
7059
  ]
7032
7060
  },
@@ -7041,12 +7069,6 @@
7041
7069
  "type": "'all'|'between'|'none'",
7042
7070
  "default": "\"\\\"all\\\"\""
7043
7071
  },
7044
- {
7045
- "name": "drag-multiple",
7046
- "description": "Whether to the user can drag multiple items",
7047
- "type": "boolean",
7048
- "default": "false"
7049
- },
7050
7072
  {
7051
7073
  "name": "extend-separators",
7052
7074
  "description": "Whether to extend the separators beyond the content's edge",
@@ -7076,8 +7098,6 @@
7076
7098
  },
7077
7099
  {
7078
7100
  "name": "dragMultiple",
7079
- "attribute": "drag-multiple",
7080
- "description": "Whether to the user can drag multiple items",
7081
7101
  "type": "boolean",
7082
7102
  "default": "false"
7083
7103
  },
@@ -7104,6 +7124,10 @@
7104
7124
  }
7105
7125
  ],
7106
7126
  "events": [
7127
+ {
7128
+ "name": "d2l-list-items-move",
7129
+ "description": "Dispatched when one or more items are moved. See [Event Details: d2l-list-items-move](#event-details%3A-%40d2l-list-items-move)."
7130
+ },
7107
7131
  {
7108
7132
  "name": "d2l-list-selection-changes",
7109
7133
  "description": "Dispatched once for a set of selection state changes (ex. select-all); event detail includes an array of objects where each object contains the `key` and `selected` state for each changed item"
@@ -7116,7 +7140,11 @@
7116
7140
  "slots": [
7117
7141
  {
7118
7142
  "name": "",
7119
- "description": "List content (e.g., `listitem`s)"
7143
+ "description": "Slot for list items (ex. `d2l-list-item`, `d2l-list-item-button`, or custom items)"
7144
+ },
7145
+ {
7146
+ "name": "header",
7147
+ "description": "Slot for `d2l-list-header` to be rendered above the list"
7120
7148
  }
7121
7149
  ]
7122
7150
  },
@@ -1,6 +1,8 @@
1
- import { directive, PropertyPart } from 'lit-html';
1
+ import { directive, PartType } from 'lit-html/directive.js';
2
2
  import { getComposedActiveElement, getNextFocusable } from '../../helpers/focus.js';
3
+ import { AsyncDirective } from 'lit-html/async-directive.js';
3
4
  import { isComposedAncestor } from '../../helpers/dom.js';
5
+ import { noChange } from 'lit-html';
4
6
 
5
7
  const stateMap = new WeakMap();
6
8
  const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
@@ -10,15 +12,13 @@ const moveYValue = 20;
10
12
 
11
13
  class AnimationState {
12
14
 
13
- constructor(propertyPart) {
14
-
15
- if (!(propertyPart instanceof PropertyPart) || propertyPart.committer.name !== 'animate') {
16
- throw new Error('animation directives must be used with "animate" property');
15
+ constructor(partInfo) {
16
+ if (!(partInfo.type === PartType.PROPERTY) || partInfo.name !== 'animate') {
17
+ throw new Error('animate directives must be used with "animate" property');
17
18
  }
18
-
19
19
  this.id = 0;
20
20
  this.clone = null;
21
- this.elem = propertyPart.committer.element;
21
+ this.elem = partInfo.element;
22
22
  this.state = 'unknown';
23
23
  this.styleAttr = null;
24
24
  this.styleAttrUse = false;
@@ -289,20 +289,37 @@ class AnimationState {
289
289
 
290
290
  }
291
291
 
292
- async function helper(part, action, opts) {
293
- let state = stateMap.get(part);
294
- if (state === undefined) {
295
- state = new AnimationState(part);
296
- stateMap.set(part, state);
292
+ class Hide extends AsyncDirective {
293
+ render() {
294
+ return noChange;
297
295
  }
298
- opts = opts || {};
299
- if (action === 'show') {
300
- state.show(opts);
301
- } else if (action === 'hide') {
296
+ update(part, [opts]) {
297
+ opts = opts || {};
298
+ let state = stateMap.get(part.element);
299
+ if (state === undefined) {
300
+ state = new AnimationState(part);
301
+ stateMap.set(part.element, state);
302
+ }
302
303
  state.hide(opts);
304
+ return this.render();
303
305
  }
304
306
  }
305
307
 
306
- export const hide = directive((opts) => async(part) => helper(part, 'hide', opts));
308
+ class Show extends AsyncDirective {
309
+ render() {
310
+ return noChange;
311
+ }
312
+ update(part, [opts]) {
313
+ opts = opts || {};
314
+ let state = stateMap.get(part.element);
315
+ if (state === undefined) {
316
+ state = new AnimationState(part);
317
+ stateMap.set(part.element, state);
318
+ }
319
+ state.show(opts);
320
+ return this.render();
321
+ }
322
+ }
307
323
 
308
- export const show = directive((opts) => async(part) => helper(part, 'show', opts));
324
+ export const hide = directive(Hide);
325
+ export const show = directive(Show);
@@ -25,6 +25,7 @@ class AnnounceTest extends LitElement {
25
25
  }
26
26
 
27
27
  _handleAnnounce() {
28
+ if (!this.shadowRoot) return;
28
29
  const value1 = this.shadowRoot.querySelector('#msg1').value;
29
30
  if (value1.length > 0) announce(value1);
30
31
  const value2 = this.shadowRoot.querySelector('#msg2').value;
@@ -37,7 +37,9 @@ export const ArrowKeysMixin = superclass => class extends superclass {
37
37
  }
38
38
 
39
39
  async arrowKeysFocusablesProvider() {
40
- return [...this.shadowRoot.querySelectorAll('.d2l-arrowkeys-focusable')];
40
+ return this.shadowRoot ?
41
+ [...this.shadowRoot.querySelectorAll('.d2l-arrowkeys-focusable')]
42
+ : [];
41
43
  }
42
44
 
43
45
  async _focus(elem) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "1.213.1",
3
+ "version": "1.216.0",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",
@@ -1014,6 +1014,7 @@ class TemplatePrimarySecondary extends FocusVisiblePolyfillMixin(RtlMixin(Locali
1014
1014
  }
1015
1015
 
1016
1016
  _computeContentBounds(contentRect) {
1017
+ if (!this.shadowRoot) return;
1017
1018
  const divider = this.shadowRoot.querySelector('.d2l-template-primary-secondary-divider');
1018
1019
  const desktopDividerSize = divider.offsetWidth;
1019
1020
  const mobileDividerSize = divider.offsetHeight;
@@ -1057,7 +1058,7 @@ class TemplatePrimarySecondary extends FocusVisiblePolyfillMixin(RtlMixin(Locali
1057
1058
  } else {
1058
1059
  if (this._isMobile) {
1059
1060
  this._size = this._contentBounds.minHeight;
1060
- } else {
1061
+ } else if (this.shadowRoot) {
1061
1062
  const divider = this.shadowRoot.querySelector('.d2l-template-primary-secondary-divider');
1062
1063
  const desktopDividerSize = contentRect.width - divider.offsetWidth;
1063
1064
  this._size = Math.max(desktopMinSize, desktopDividerSize * (1 / 3));