@brightspace-ui/core 3.307.1 → 3.307.2

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.
@@ -87,11 +87,11 @@ class PanelStateController {
87
87
  if (storeState) this.#storePanelState(key);
88
88
  }
89
89
 
90
- setCollapsed(key, collapsed) {
90
+ setCollapsed(key, collapsed, { animate = true } = {}) {
91
91
  const panel = this.#panels[key];
92
92
  panel.collapsed = collapsed;
93
93
  panel.dragSize = null;
94
- panel.animate = true;
94
+ panel.animate = animate;
95
95
  this.#host.requestUpdate();
96
96
  this.#storePanelState(key);
97
97
  }
@@ -542,7 +542,9 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
542
542
 
543
543
  #handleDividerResize(e) {
544
544
  const panelKey = e.target.dataset.panelKey;
545
- this._panelState.resize(panelKey, e.detail.requestedSize, { animate: true, storeState: true });
545
+ // Do not animate if dragging past closed size
546
+ const animate = this._panelState.getSize(panelKey) > DIVIDER_GUTTER_WIDTH;
547
+ this._panelState.resize(panelKey, e.detail.requestedSize, { animate, storeState: true });
546
548
  };
547
549
 
548
550
  #handleDividerResizeLive(e) {
@@ -552,8 +554,10 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
552
554
 
553
555
  #handleDividerToggle(e) {
554
556
  const panelKey = e.target.dataset.panelKey;
555
- const collapsed = !this._panelState.getCollapsed(panelKey);
556
- this._panelState.setCollapsed(panelKey, collapsed);
557
+ const collapsed = this._panelState.getCollapsed(panelKey);
558
+ // Do not animate if dragged to fully closed
559
+ const animate = collapsed || this._panelState.getSize(panelKey) > DIVIDER_GUTTER_WIDTH;
560
+ this._panelState.setCollapsed(panelKey, !collapsed, { animate });
557
561
  };
558
562
 
559
563
  #handleScrimClick() {
@@ -578,13 +582,9 @@ class Page extends ProviderMixin(LocalizeCoreElement(LitElement)) {
578
582
  }
579
583
 
580
584
  #renderDivider(panelKey, label, panelPosition) {
581
- const classes = {
582
- 'divider': true,
583
- 'animate': this._panelState.getAnimate(panelKey)
584
- };
585
585
  return html`
586
586
  <d2l-page-divider-internal
587
- class="${classMap(classes)}"
587
+ class="divider"
588
588
  data-panel-key="${panelKey}"
589
589
  label="${label}"
590
590
  ?collapsed="${this._panelState.getCollapsed(panelKey)}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.307.1",
3
+ "version": "3.307.2",
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",