@brightspace-ui/core 3.203.1 → 3.204.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.
@@ -16,6 +16,11 @@ class ButtonCopy extends FocusMixin(LocalizeCoreElement(LitElement)) {
16
16
  * @type {boolean}
17
17
  */
18
18
  disabled: { type: Boolean, reflect: true },
19
+ /**
20
+ * Description of the content being copied to clipboard
21
+ * @type {string}
22
+ */
23
+ text: { type: String },
19
24
  _iconCheckTimeoutId: { state: true },
20
25
  _toastState: { state: true }
21
26
  };
@@ -43,7 +48,11 @@ class ButtonCopy extends FocusMixin(LocalizeCoreElement(LitElement)) {
43
48
 
44
49
  render() {
45
50
  return html`
46
- <d2l-button-icon ?disabled="${this.disabled}" icon="${this._iconCheckTimeoutId ? 'tier1:check' : 'tier1:copy'}" text="${this.localize('intl-common:actions:copy')}" @click="${this.#handleClick}"></d2l-button-icon>
51
+ <d2l-button-icon
52
+ ?disabled="${this.disabled}"
53
+ icon="${this._iconCheckTimeoutId ? 'tier1:check' : 'tier1:copy'}"
54
+ text="${this.text ?? this.localize('intl-common:actions:copy')}"
55
+ @click="${this.#handleClick}"></d2l-button-icon>
47
56
  <d2l-alert-toast
48
57
  @d2l-alert-toast-close="${this.#handleToastClose}"
49
58
  ?open="${this._toastState}"
@@ -54,6 +54,22 @@
54
54
  </template>
55
55
  </d2l-demo-snippet>
56
56
 
57
+ <h2>Text</h2>
58
+
59
+ <d2l-demo-snippet>
60
+ <template>
61
+ <span>Donuts are yummmmmy!</span>
62
+ <d2l-button-copy text="Donuts are yummmmmy!"></d2l-button-copy>
63
+ <script>
64
+ (demo => {
65
+ demo.querySelector('d2l-button-copy').addEventListener('click', async(e) => {
66
+ console.log('Copied', await e.detail.writeTextToClipboard(demo.querySelector('span').textContent));
67
+ });
68
+ })(document.currentScript.parentNode);
69
+ </script>
70
+ </template>
71
+ </d2l-demo-snippet>
72
+
57
73
  </d2l-demo-page>
58
74
 
59
75
  </body>
@@ -1,7 +1,6 @@
1
1
  import { css, html, LitElement } from 'lit';
2
2
  import { findComposedAncestor, isComposedAncestor } from '../../helpers/dom.js';
3
3
  import { getComposedActiveElement, getFirstFocusableDescendant, getFocusableDescendants, getLastFocusableDescendant, getNextFocusable, getPreviousFocusable } from '../../helpers/focus.js';
4
- import { getFlag } from '../../helpers/flags.js';
5
4
  import { isInteractiveDescendant } from '../../mixins/interactive/interactive-mixin.js';
6
5
 
7
6
  const keyCodes = {
@@ -17,8 +16,6 @@ const keyCodes = {
17
16
  UP: 38
18
17
  };
19
18
 
20
- const listItemUpButtonFixFlag = getFlag('GAUD-8229-list-up-button-fix', true);
21
-
22
19
  function isRtl() {
23
20
  return document.documentElement.getAttribute('dir') === 'rtl';
24
21
  }
@@ -491,27 +488,16 @@ class ListItemGenericLayout extends LitElement {
491
488
  do {
492
489
  // this check needs to account for standard list-items as well as custom
493
490
  nestedList = previousElement.querySelector('[slot="nested"]') || previousElement.shadowRoot.querySelector('d2l-list');
494
- if (listItemUpButtonFixFlag) {
495
- // if there is nested list and nested list content is accessible
496
- if (nestedList && (!previousElement.expandable || (previousElement.expandable && previousElement.expanded))) {
497
- const nestedListItems = [...nestedList.children].filter(node => node.role === 'row');
498
- if (nestedListItems.length) {
499
- previousElement = nestedListItems[nestedListItems.length - 1];
500
- } else {
501
- break;
502
- }
491
+ // if there is nested list and nested list content is accessible
492
+ if (nestedList && (!previousElement.expandable || (previousElement.expandable && previousElement.expanded))) {
493
+ const nestedListItems = [...nestedList.children].filter(node => node.role === 'row');
494
+ if (nestedListItems.length) {
495
+ previousElement = nestedListItems[nestedListItems.length - 1];
503
496
  } else {
504
497
  break;
505
498
  }
506
499
  } else {
507
- if (nestedList) {
508
- const nestedListItems = [...nestedList.children].filter(node => node.role === 'row');
509
- if (nestedListItems.length) {
510
- previousElement = nestedListItems[nestedListItems.length - 1];
511
- } else {
512
- break;
513
- }
514
- }
500
+ break;
515
501
  }
516
502
  } while (nestedList);
517
503
  return previousElement;
@@ -400,6 +400,11 @@
400
400
  "path": "./components/button/button-copy.js",
401
401
  "description": "A button component that copies to the clipboard.",
402
402
  "attributes": [
403
+ {
404
+ "name": "text",
405
+ "description": "Description of the content being copied to clipboard",
406
+ "type": "string"
407
+ },
403
408
  {
404
409
  "name": "disabled",
405
410
  "description": "Disables the button",
@@ -408,6 +413,12 @@
408
413
  }
409
414
  ],
410
415
  "properties": [
416
+ {
417
+ "name": "text",
418
+ "attribute": "text",
419
+ "description": "Description of the content being copied to clipboard",
420
+ "type": "string"
421
+ },
411
422
  {
412
423
  "name": "disabled",
413
424
  "attribute": "disabled",
package/lang/ar.js CHANGED
@@ -238,9 +238,12 @@ export default {
238
238
  "components.tag-list-item.tooltip-title": "عناصر التحكم في لوحة المفاتيح",
239
239
  "components.view-switcher.role-description":
240
240
  `{count, plural,
241
- =0 {View Switcher with 0 items}
242
- one {View Switcher with {count} item}
243
- other {View Switcher with {count} items}
241
+ =0 {مبدّل العرض يتضمن 0 عنصر}
242
+ =2 {مبدّل العرض يتضمن {count} عنصرين}
243
+ one {مبدّل العرض يتضمن {count} عنصر}
244
+ few {مبدّل العرض يتضمن {count} عناصر}
245
+ many {مبدّل العرض يتضمن {count} عنصر}
246
+ other {مبدّل العرض يتضمن {count} عنصر}
244
247
  }`,
245
248
  "templates.primary-secondary.divider": "فاصل اللوحة الثانوية",
246
249
  "templates.primary-secondary.secondary-panel": "اللوحة الثانوية"
package/lang/cy.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Rheolyddion Bysellfwrdd",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {Newidydd Gwedd gyda 0 eitem}
238
+ one {Newidydd Gwedd gyda {count} eitem}
239
+ other {Newidydd Gwedd gyda {count} eitem}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Rhannwr panel eilaidd",
242
242
  "templates.primary-secondary.secondary-panel": "Panel eilaidd"
package/lang/da.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Kontrolelementer på tastaturet",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {Vis skift med 0 elementer}
238
+ one {Vis skift med {count} element}
239
+ other {Vis skift med {count} elementer}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Sekundær panelskillelinje",
242
242
  "templates.primary-secondary.secondary-panel": "Sekundært panel"
package/lang/de.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Tastatursteuerung",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {Ansichtswechsel mit 0 Elementen}
238
+ one {Ansichtswechsel mit {count} Element}
239
+ other {Ansichtswechsel mit {count} Elementen}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Sekundäre Bereichstrennung",
242
242
  "templates.primary-secondary.secondary-panel": "Sekundärer Bereich"
package/lang/es-es.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Controles del teclado",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {Cambio de vista con 0 elementos}
238
+ one {Cambio de vista con {count} elemento}
239
+ other {Cambio de vista con {count} elementos}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Divisor de panel secundario",
242
242
  "templates.primary-secondary.secondary-panel": "Panel secundario"
package/lang/es.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Controles del teclado",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {Selector de vistas con 0 elementos}
238
+ one {Selector de vistas con {count} elemento}
239
+ other {Selector de vistas con {count} elementos}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Divisor de panel secundario",
242
242
  "templates.primary-secondary.secondary-panel": "Panel secundario"
package/lang/fr-fr.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Commandes du clavier",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {Sélecteur de vue comportant 0 élément}
238
+ one {Sélecteur de vue comportant {count} élément}
239
+ other {Sélecteur de vue comportant {count} éléments}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Séparateur de panneau secondaire",
242
242
  "templates.primary-secondary.secondary-panel": "Panneau secondaire"
package/lang/fr.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Commandes du clavier",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {sélecteur de vue avec 0 élément}
238
+ one {sélecteur de vue avec {count} élément}
239
+ other {sélecteur de vue avec {count} éléments}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Séparateur de panneau secondaire",
242
242
  "templates.primary-secondary.secondary-panel": "Panneau secondaire"
package/lang/haw.js CHANGED
@@ -234,9 +234,8 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Nā Mana Keyboard",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ one {Nānā i ka mea hoʻololi me {count} nā mea}
238
+ other {Nānā i ka mea hoʻololi me {count} nā mea}
240
239
  }`,
241
240
  "templates.primary-secondary.divider": "Mea hoʻokaʻawale papa lua",
242
241
  "templates.primary-secondary.secondary-panel": "Pane lua"
package/lang/hi.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "कीबोर्ड कंट्रोल",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {0 आइटम के साथ स्विचर को देखें}
238
+ one {{count} आइटम के साथ स्विचर को देखें}
239
+ other {{count} आइटम के साथ स्विचर को देखें}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "सेकेंडरी पैनल डिवाइडर",
242
242
  "templates.primary-secondary.secondary-panel": "सेकेंडरी पैनल"
package/lang/ja.js CHANGED
@@ -224,8 +224,8 @@ export default {
224
224
  "components.tag-list-item.tooltip-title": "キーボードコントロール",
225
225
  "components.view-switcher.role-description":
226
226
  `{count, plural,
227
- =0 {View Switcher with 0 items}
228
- other {View Switcher with {count} items}
227
+ =0 {表示切り替えに 0 項目}
228
+ other {表示切り替えに {count} 項目}
229
229
  }`,
230
230
  "templates.primary-secondary.divider": "セカンダリパネルディバイダ",
231
231
  "templates.primary-secondary.secondary-panel": "セカンダリパネル"
package/lang/ko.js CHANGED
@@ -224,8 +224,8 @@ export default {
224
224
  "components.tag-list-item.tooltip-title": "키보드 컨트롤",
225
225
  "components.view-switcher.role-description":
226
226
  `{count, plural,
227
- =0 {View Switcher with 0 items}
228
- other {View Switcher with {count} items}
227
+ =0 {0개의 항목이 있는 보기 전환기}
228
+ other {{count}개의 항목이 있는 보기 전환기}
229
229
  }`,
230
230
  "templates.primary-secondary.divider": "보조 패널 디바이더",
231
231
  "templates.primary-secondary.secondary-panel": "보조 패널"
package/lang/mi.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Ngā Mana Papapātuhi",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {Tirohia te Whakawhiti me te 0 taonga}
238
+ one {Tirohanga Whakawhiti me {count} taonga}
239
+ other {Tirohanga Whakawhiti me {count} taonga}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Kaiwehe paepae tuarua",
242
242
  "templates.primary-secondary.secondary-panel": "Pae tuarua"
package/lang/nl.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Bedieningselementen op het toetsenbord",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {Weergaveschakelaar met 0 items}
238
+ one {Weergaveschakelaar met {count} item}
239
+ other {Weergaveschakelaar met {count} items}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Scheidingslijn secundair venster",
242
242
  "templates.primary-secondary.secondary-panel": "Secundair venster"
package/lang/pt.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Controles do teclado",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {Alternador de visualização com 0 itens}
238
+ one {Alternador de visualização com {count} item}
239
+ other {Alternador de visualização com {count} itens}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Divisor do painel secundário",
242
242
  "templates.primary-secondary.secondary-panel": "Painel secundário"
package/lang/sv.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Tangentbordskontroller",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {Visa växlare med 0 objekt}
238
+ one {Visa växlare med {count} objekt}
239
+ other {Visa växlare med {count} objekt}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "Avgränsare för sekundär panel",
242
242
  "templates.primary-secondary.secondary-panel": "Sekundär panel"
package/lang/th.js CHANGED
@@ -225,8 +225,8 @@ export default {
225
225
  "components.tag-list-item.tooltip-title": "การควบคุมแป้นพิมพ์",
226
226
  "components.view-switcher.role-description":
227
227
  `{count, plural,
228
- =0 {View Switcher with 0 items}
229
- other {View Switcher with {count} items}
228
+ =0 {ดู Switcher ที่มี 0 รายการ}
229
+ other {ดู Switcher ที่มี {count} รายการ}
230
230
  }`,
231
231
  "templates.primary-secondary.divider": "ตัวแบ่งบานหน้าต่างรอง",
232
232
  "templates.primary-secondary.secondary-panel": "บานหน้าต่างรอง"
package/lang/tr.js CHANGED
@@ -234,9 +234,9 @@ export default {
234
234
  "components.tag-list-item.tooltip-title": "Klavye Kontrolleri",
235
235
  "components.view-switcher.role-description":
236
236
  `{count, plural,
237
- =0 {View Switcher with 0 items}
238
- one {View Switcher with {count} item}
239
- other {View Switcher with {count} items}
237
+ =0 {0 öğeli Değiştiriciyi görüntüle}
238
+ one {{count} öğeli Değiştiriciyi görüntüle}
239
+ other {{count} öğeli Değiştiriciyi görüntüle}
240
240
  }`,
241
241
  "templates.primary-secondary.divider": "İkincil panel ayırıcı",
242
242
  "templates.primary-secondary.secondary-panel": "İkincil panel"
package/lang/vi.js CHANGED
@@ -225,8 +225,8 @@ export default {
225
225
  "components.tag-list-item.tooltip-title": "Các điều khiển bàn phím",
226
226
  "components.view-switcher.role-description":
227
227
  `{count, plural,
228
- =0 {View Switcher with 0 items}
229
- other {View Switcher with {count} items}
228
+ =0 {Xem Trình chuyển đổi với 0 mục}
229
+ other {Xem Trình chuyển đổi với {count} mục}
230
230
  }`,
231
231
  "templates.primary-secondary.divider": "Bộ phân cách bảng phụ",
232
232
  "templates.primary-secondary.secondary-panel": "Bảng phụ"
package/lang/zh-cn.js CHANGED
@@ -224,8 +224,8 @@ export default {
224
224
  "components.tag-list-item.tooltip-title": "键盘控制",
225
225
  "components.view-switcher.role-description":
226
226
  `{count, plural,
227
- =0 {View Switcher with 0 items}
228
- other {View Switcher with {count} items}
227
+ =0 {包含 0 个项目的视图切换开关}
228
+ other {包含 {count} 个项目的视图切换开关}
229
229
  }`,
230
230
  "templates.primary-secondary.divider": "辅助面板分隔条",
231
231
  "templates.primary-secondary.secondary-panel": "辅助面板"
package/lang/zh-tw.js CHANGED
@@ -225,8 +225,8 @@ export default {
225
225
  "components.tag-list-item.tooltip-title": "鍵盤控制項",
226
226
  "components.view-switcher.role-description":
227
227
  `{count, plural,
228
- =0 {View Switcher with 0 items}
229
- other {View Switcher with {count} items}
228
+ =0 {檢視有 0 個項目的切換器}
229
+ other {檢視有 {count} 個項目的切換器}
230
230
  }`,
231
231
  "templates.primary-secondary.divider": "次要面板分隔線",
232
232
  "templates.primary-secondary.secondary-panel": "次要面板"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.203.1",
3
+ "version": "3.204.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",