@brightspace-ui/core 2.118.3 → 2.118.4

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,7 +87,7 @@ The collapsible panel is a container that can show or hide additional content. I
87
87
 
88
88
  ## Collapsible Panel [d2l-collapsible-panel]
89
89
 
90
- The `d2l-collapsible-panel` element is a container that provides specific layout slots such as `header`, `summary`, `actions`, and a default slot for the expanded content.
90
+ The `d2l-collapsible-panel` element is a container that provides specific layout slots such as `before`, `header`, `summary`, `actions`, and a default slot for the expanded content.
91
91
 
92
92
  <!-- docs: demo live name:d2l-collapsible-panel -->
93
93
  ```html
@@ -205,7 +205,7 @@ Use an inline collapsible panel to progressively disclose sections of a complex
205
205
  ## Summary Items [d2l-collapsible-panel-summary-item]
206
206
  An optional summary can help the user understand what’s inside the collapsible panel without having to expand it. This can be helpful if the user needs more than the heading to explain what’s inside.
207
207
 
208
- <!-- docs: demo -->
208
+ <!-- docs: demo live name:d2l-collapsible-panel-summary-item -->
209
209
  ```html
210
210
  <script type="module">
211
211
  import '@brightspace-ui/core/components/collapsible-panel/collapsible-panel.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.118.3",
3
+ "version": "2.118.4",
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",
@@ -24,7 +24,9 @@ const keyCodes = Object.freeze({
24
24
  LEFT: 37,
25
25
  UP: 38,
26
26
  RIGHT: 39,
27
- DOWN: 40
27
+ DOWN: 40,
28
+ ENTER: 13,
29
+ SPACE: 32
28
30
  });
29
31
 
30
32
  function isMobile() {
@@ -303,27 +305,36 @@ class MobileKeyboardResizer extends Resizer {
303
305
  if (!this.isMobile) {
304
306
  return;
305
307
  }
306
- if (e.keyCode !== keyCodes.UP && e.keyCode !== keyCodes.DOWN) {
308
+ if (e.keyCode !== keyCodes.UP && e.keyCode !== keyCodes.DOWN && e.keyCode !== keyCodes.ENTER && e.keyCode !== keyCodes.SPACE) {
307
309
  return;
308
310
  }
309
311
  let secondaryHeight;
310
- if (this.panelSize === 0) {
311
- if (e.keyCode === keyCodes.UP) {
312
- secondaryHeight = this.contentBounds.minHeight;
312
+ if (e.keyCode === keyCodes.ENTER || e.keyCode === keyCodes.SPACE) {
313
+ if (this.panelSize === 0) {
314
+ secondaryHeight = this._restoreSize || this.contentBounds.minHeight;
313
315
  } else {
316
+ this._restoreSize = this.panelSize;
314
317
  secondaryHeight = 0;
315
318
  }
316
319
  } else {
317
- const delta = (this.contentBounds.maxHeight - this.contentBounds.minHeight) / (this._steps - 1);
318
- const direction = e.keyCode === keyCodes.UP ? 1 : -1;
319
- const desiredHeight = this.panelSize + delta * direction;
320
- const desiredSteppedHeight = this.contentBounds.minHeight + delta * Math.round((desiredHeight - this.contentBounds.minHeight) / delta);
321
-
322
- const actualSecondaryHeight = this.clampHeight(desiredSteppedHeight);
323
- if (desiredSteppedHeight < actualSecondaryHeight) {
324
- secondaryHeight = 0;
320
+ if (this.panelSize === 0) {
321
+ if (e.keyCode === keyCodes.UP) {
322
+ secondaryHeight = this.contentBounds.minHeight;
323
+ } else {
324
+ secondaryHeight = 0;
325
+ }
325
326
  } else {
326
- secondaryHeight = actualSecondaryHeight;
327
+ const delta = (this.contentBounds.maxHeight - this.contentBounds.minHeight) / (this._steps - 1);
328
+ const direction = e.keyCode === keyCodes.UP ? 1 : -1;
329
+ const desiredHeight = this.panelSize + delta * direction;
330
+ const desiredSteppedHeight = this.contentBounds.minHeight + delta * Math.round((desiredHeight - this.contentBounds.minHeight) / delta);
331
+
332
+ const actualSecondaryHeight = this.clampHeight(desiredSteppedHeight);
333
+ if (desiredSteppedHeight < actualSecondaryHeight) {
334
+ secondaryHeight = 0;
335
+ } else {
336
+ secondaryHeight = actualSecondaryHeight;
337
+ }
327
338
  }
328
339
  }
329
340
  this.dispatchResize(secondaryHeight, true);