@brightspace-ui/core 3.151.3 → 3.151.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.
@@ -1,5 +1,8 @@
1
1
 
2
2
  import '../../button/button.js';
3
+ import '../../button/button-icon.js';
4
+ import '../../button/button-subtle.js';
5
+ import '../../selection/selection-action.js';
3
6
  import '../overflow-group.js';
4
7
  import { html, LitElement } from 'lit';
5
8
  import { LocalizeCoreElement } from '../../../helpers/localize-core-element.js';
@@ -15,7 +18,10 @@ class DemoOverflowGroup extends LocalizeCoreElement(LitElement) {
15
18
  <d2l-button>${this.localize('components.more-less.more')}</d2l-button>
16
19
  <d2l-button>${this.localize('components.more-less.less')}</d2l-button>
17
20
  <d2l-button> ${this.localize('components.more-less.more')}</d2l-button>
18
- <d2l-button> ${this.localize('components.more-less.less')}</d2l-button>
21
+ <button>${this.localize('components.more-less.less')}</button>
22
+ <d2l-button-icon icon="tier1:gear" text="${this.localize('components.more-less.more')}"></d2l-button-icon>
23
+ <d2l-button-subtle text="${this.localize('components.more-less.less')}"></d2l-button-subtle>
24
+ <d2l-selection-action icon="tier1:bookmark-hollow" text="${this.localize('components.more-less.more')}"></d2l-selection-action>
19
25
  </d2l-overflow-group>
20
26
  `;
21
27
  }
@@ -20,7 +20,18 @@ const OPENER_STYLE = {
20
20
  };
21
21
 
22
22
  function createMenuItem(node) {
23
- const childText = node.text || node.firstChild && (node.firstChild.label || node.firstChild.text || node.firstChild.textContent.trim());
23
+ let childText = node.text;
24
+ if (!childText) {
25
+ const childNode = Array.from(node.childNodes).find(childNode => {
26
+ if (childNode.nodeType === Node.COMMENT_NODE) return false;
27
+ if (childNode.nodeType === Node.TEXT_NODE && !childNode.textContent.trim()) return false;
28
+ return true;
29
+ });
30
+ if (childNode) {
31
+ childText = childNode.label || childNode.text || childNode.textContent.trim();
32
+ }
33
+ }
34
+
24
35
  const disabled = !!node.disabled;
25
36
  const handleItemSelect = () => {
26
37
  node.dispatchEvent(new CustomEvent('d2l-button-ghost-click'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.151.3",
3
+ "version": "3.151.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",