@brightspace-ui/core 3.156.3 → 3.157.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.
@@ -4,6 +4,12 @@
4
4
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
5
  <meta charset="UTF-8">
6
6
  <link rel="stylesheet" href="../../demo/styles.css" type="text/css">
7
+ <script type="module">
8
+ import { mockFlag } from '../../../helpers/flags.js';
9
+ const urlParams = new URLSearchParams(window.location.search);
10
+ mockFlag('GAUD-8295-menu-item-link-new-window-icon', urlParams.get('link-new-window-icon') === 'true');
11
+ mockFlag('GAUD-8369-menu-item-link-click-changes', urlParams.get('link-click-changes') === 'true');
12
+ </script>
7
13
  <script type="module">
8
14
  import '../../demo/demo-page.js';
9
15
  import './custom-menu-item.js';
@@ -200,5 +206,12 @@
200
206
  </template>
201
207
  </d2l-demo-snippet>
202
208
  </d2l-demo-page>
209
+
210
+ <script>
211
+ document.addEventListener('click', e => {
212
+ if (e.target.tagName !== 'D2L-MENU-ITEM-LINK') return;
213
+ console.log('Click event propagated up for router!', e.target);
214
+ });
215
+ </script>
203
216
  </body>
204
217
  </html>
@@ -6,6 +6,7 @@ import { MenuItemMixin } from './menu-item-mixin.js';
6
6
  import { menuItemStyles } from './menu-item-styles.js';
7
7
 
8
8
  const newWindowIconEnabled = getFlag('GAUD-8295-menu-item-link-new-window-icon', true);
9
+ const menuItemClickChangesEnabled = getFlag('GAUD-8369-menu-item-link-click-changes', true);
9
10
 
10
11
  /**
11
12
  * A menu item component used for navigating.
@@ -90,9 +91,14 @@ class MenuItemLink extends (newWindowIconEnabled ? LinkMixin(MenuItemMixin(LitEl
90
91
  ];
91
92
  }
92
93
 
94
+ constructor() {
95
+ super();
96
+ this._letClickPropagate = true;
97
+ }
98
+
93
99
  firstUpdated() {
94
100
  super.firstUpdated();
95
- this.addEventListener('click', this._onClick);
101
+ if (!menuItemClickChangesEnabled) this.addEventListener('click', this._onClick); // remove when cleaning up GAUD-8369-menu-item-link-click-changes
96
102
  this.addEventListener('keydown', this._onKeyDown);
97
103
  }
98
104
 
@@ -117,6 +123,7 @@ class MenuItemLink extends (newWindowIconEnabled ? LinkMixin(MenuItemMixin(LitEl
117
123
 
118
124
  }
119
125
 
126
+ // remove this function when cleaning up GAUD-8369-menu-item-link-click-changes
120
127
  _getTarget() {
121
128
  if (this.target && this.target !== '') {
122
129
  return this.target;
@@ -129,19 +136,27 @@ class MenuItemLink extends (newWindowIconEnabled ? LinkMixin(MenuItemMixin(LitEl
129
136
  return null;
130
137
  }
131
138
 
139
+ // remove this function when cleaning up GAUD-8369-menu-item-link-click-changes
132
140
  _onClick() {
133
141
  if (this.shadowRoot) this.shadowRoot.querySelector('a').dispatchEvent(new CustomEvent('click'));
134
142
  }
135
143
 
136
144
  _onKeyDown(e) {
137
- if (e.keyCode === this.__keyCodes.ENTER || e.keyCode === this.__keyCodes.SPACE) {
138
- const target = this._getTarget();
139
- if (target === '_parent') {
140
- window.parent.location.assign(this.href);
141
- } else if (target === '_top') {
142
- window.top.location.assign(this.href);
143
- } else {
144
- window.location.assign(this.href);
145
+ if (menuItemClickChangesEnabled) {
146
+ if (e.keyCode === this.__keyCodes.ENTER || e.keyCode === this.__keyCodes.SPACE) {
147
+ this.shadowRoot.querySelector('a').click();
148
+ }
149
+ } else { // remove this block when cleaning up GAUD-8369-menu-item-link-click-changes
150
+ super._onKeyDown(e);
151
+ if (e.keyCode === this.__keyCodes.ENTER || e.keyCode === this.__keyCodes.SPACE) {
152
+ const target = this._getTarget();
153
+ if (target === '_parent') {
154
+ window.parent.location.assign(this.href);
155
+ } else if (target === '_top') {
156
+ window.top.location.assign(this.href);
157
+ } else {
158
+ window.location.assign(this.href);
159
+ }
145
160
  }
146
161
  }
147
162
  }
@@ -1,6 +1,8 @@
1
+ import { getFlag } from '../../helpers/flags.js';
1
2
  import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
2
3
 
3
4
  const defaultLines = 2;
5
+ const menuItemClickChangesEnabled = getFlag('GAUD-8369-menu-item-link-click-changes', true);
4
6
 
5
7
  export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(superclass) {
6
8
 
@@ -54,7 +56,8 @@ export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(s
54
56
  */
55
57
  description: { type: String },
56
58
  _ariaDisabled: { type: String, attribute: 'aria-disabled', reflect: true },
57
- _ariaLabel: { type: String, attribute: 'aria-label', reflect: true }
59
+ _ariaLabel: { type: String, attribute: 'aria-label', reflect: true },
60
+ _letClickPropagate: { state: true }
58
61
  };
59
62
  }
60
63
 
@@ -74,6 +77,7 @@ export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(s
74
77
  this.role = 'menuitem';
75
78
  /** @ignore */
76
79
  this.tabindex = -1;
80
+ this._letClickPropagate = false;
77
81
  }
78
82
 
79
83
  firstUpdated(changedProperties) {
@@ -82,7 +86,7 @@ export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(s
82
86
  this.addEventListener('click', this.__onClick);
83
87
  this.addEventListener('d2l-hierarchical-view-hide-complete', this.__onHideComplete);
84
88
  this.addEventListener('dom-change', this.__onDomChange);
85
- this.addEventListener('keydown', this.__onKeyDown);
89
+ this.addEventListener('keydown', this._onKeyDown);
86
90
 
87
91
  this.__initializeItem();
88
92
 
@@ -152,7 +156,12 @@ export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(s
152
156
  }
153
157
 
154
158
  __onClick(e) {
155
- e.stopPropagation();
159
+ if (menuItemClickChangesEnabled) {
160
+ if (!this._letClickPropagate) e.stopPropagation();
161
+ } else { // remove this block when cleaning up GAUD-8369-menu-item-link-click-changes
162
+ e.stopPropagation();
163
+ }
164
+
156
165
  this.__action();
157
166
  }
158
167
 
@@ -171,7 +180,12 @@ export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(s
171
180
  this.setAttribute('tabindex', '0');
172
181
  }
173
182
 
174
- __onKeyDown(e) {
183
+ _onHidden() {
184
+ /** Dispatched when the visibility of the menu item changes */
185
+ this.dispatchEvent(new CustomEvent('d2l-menu-item-visibility-change', { bubbles: true, composed: true }));
186
+ }
187
+
188
+ _onKeyDown(e) {
175
189
  if (e.target !== this) {
176
190
  return;
177
191
  }
@@ -188,9 +202,4 @@ export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(s
188
202
  }
189
203
  }
190
204
 
191
- _onHidden() {
192
- /** Dispatched when the visibility of the menu item changes */
193
- this.dispatchEvent(new CustomEvent('d2l-menu-item-visibility-change', { bubbles: true, composed: true }));
194
- }
195
-
196
205
  };
package/lang/ar.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "زيادة {count} إضافي",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {قائمة العلامات بها 0 عناصر}
215
+ one {قائمة العلامات بها {count} عنصر}
216
+ other {قائمة العلامات بها {count} من العناصر}
217
217
  }`,
218
218
  "components.tag-list.show-less": "إظهار أقل",
219
219
  "components.tag-list.show-more-description": "حدد لإظهار عناصر قائمة العلامات المخفية",
package/lang/cy.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+ {count} yn rhagor",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {Rhestr Tagiau gyda 0 eitem}
215
+ one {Rhestr Tagiau gyda {count} eitem}
216
+ other {Rhestr Tagiau gyda {count} eitem}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Dangos Llai",
219
219
  "components.tag-list.show-more-description": "Dewis i ddangos eitemau rhestr tag cudd",
package/lang/da.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+ {count} mere",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {Tagliste med 0 elementer}
215
+ one {Tagliste med {count} element}
216
+ other {Tagliste med {count} elementer}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Vis færre",
219
219
  "components.tag-list.show-more-description": "Vælg for at få vist skjulte taglisteelementer",
package/lang/de.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+ {count} weitere",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {Tag-Liste mit 0 Elementen}
215
+ one {Tag-Liste mit {count} Element}
216
+ other {Tag-Liste mit {count} Elementen}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Weniger anzeigen",
219
219
  "components.tag-list.show-more-description": "Wählen Sie diese Option, um ausgeblendete Elemente der Tag-Liste anzuzeigen",
package/lang/es-es.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+ {count} más",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {Lista de etiquetas con 0 elementos}
215
+ one {Lista de etiquetas con {count} elemento}
216
+ other {Lista de etiquetas con {count} elementos}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Mostrar menos",
219
219
  "components.tag-list.show-more-description": "Seleccione esta opción para mostrar los elementos ocultos de la lista de etiquetas",
package/lang/es.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+ {count} más",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {Lista de etiquetas con 0 elementos}
215
+ one {Lista de etiquetas con {count} elemento}
216
+ other {Lista de etiquetas con {count} elementos}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Mostrar menos",
219
219
  "components.tag-list.show-more-description": "Seleccione para mostrar los elementos ocultos de la lista de etiquetas",
package/lang/fr-fr.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "{count} de plus",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {Liste d’étiquettes comportant 0 élément}
215
+ one {Liste d’étiquettes comportant {count} élément}
216
+ other {Liste d’étiquettes comportant {count} éléments}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Afficher moins",
219
219
  "components.tag-list.show-more-description": "Sélectionnez cette option pour afficher les éléments de la liste d’étiquettes masquées",
package/lang/fr.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+ {count} de plus",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {Liste de balises avec 0 élément}
215
+ one {Liste de balises avec {count} élément}
216
+ other {Liste de balises avec {count} éléments}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Afficher moins",
219
219
  "components.tag-list.show-more-description": "Sélectionnez cette option pour afficher les éléments de la liste des balises cachées",
package/lang/haw.js CHANGED
@@ -212,8 +212,8 @@ export default {
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
214
  =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
215
+ one {Tag List with {count}i mea}
216
+ other {Tag List with {count}a ʻē aʻe}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Hōʻike liʻiliʻi",
219
219
  "components.tag-list.show-more-description": "E koho e hōʻike i nā mea papa inoa inoa huna",
package/lang/hi.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+ {count} और",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {0 आइटम के साथ सूची टैग करें}
215
+ one {{count} आइटम के साथ सूची टैग करें}
216
+ other {{count} आइटम के साथ सूची टैग करें}
217
217
  }`,
218
218
  "components.tag-list.show-less": "कम दिखाएँ",
219
219
  "components.tag-list.show-more-description": "छिपे हुए टैग लिस्ट आइटम दिखाने के लिए चुनें",
package/lang/ja.js CHANGED
@@ -203,8 +203,8 @@ export default {
203
203
  "components.tag-list.num-hidden": "+ {count} 件追加",
204
204
  "components.tag-list.role-description":
205
205
  `{count, plural,
206
- =0 {Tag List with 0 items}
207
- other {Tag List with {count} items}
206
+ =0 {0 項目のタグリスト}
207
+ other {{count} 項目のタグリスト}
208
208
  }`,
209
209
  "components.tag-list.show-less": "少なく表示",
210
210
  "components.tag-list.show-more-description": "選択すると、非表示のタグリスト項目が表示されます",
package/lang/ko.js CHANGED
@@ -203,8 +203,8 @@ export default {
203
203
  "components.tag-list.num-hidden": "{count}개 더",
204
204
  "components.tag-list.role-description":
205
205
  `{count, plural,
206
- =0 {Tag List with 0 items}
207
- other {Tag List with {count} items}
206
+ =0 {0개의 항목이 있는 태그 목록}
207
+ other {{count}개의 항목이 있는 태그 목록}
208
208
  }`,
209
209
  "components.tag-list.show-less": "간단히 표시",
210
210
  "components.tag-list.show-more-description": "숨겨진 태그 목록 항목을 표시하려면 선택합니다",
package/lang/mi.js CHANGED
@@ -212,8 +212,8 @@ export default {
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
214
  =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
215
+ one {Tag List with {count}ahi te mea}
216
+ other {Tag List with {count}ētahi atu tūemi}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Whakaaturia mai kia iti iho",
219
219
  "components.tag-list.show-more-description": "Tīpakohia hei whakaatu i ngā tūemi rārangi tūtohu hunahuna",
package/lang/nl.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+ {count} extra",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {Taglijst met 0 items}
215
+ one {Taglijst met {count} item}
216
+ other {Taglijst met {count} items}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Minder weergeven",
219
219
  "components.tag-list.show-more-description": "Selecteer deze optie om verborgen items op labellijsten weer te geven",
package/lang/pt.js CHANGED
@@ -173,7 +173,7 @@ export default {
173
173
  "components.selection.selected-plus": "Mais de {count} selecionados",
174
174
  "components.selection-controls.label": "Ações para seleção",
175
175
  "components.sort.label": "Classificar",
176
- "components.sort.text": "Classificação: {selectedItemText}",
176
+ "components.sort.text": "Classificar: {selectedItemText}",
177
177
  "components.switch.conditions": "As condições devem ser atendidas",
178
178
  "components.switch.hidden": "Oculto",
179
179
  "components.switch.visible": "Visível",
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+ {count} mais",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {Lista de etiquetas com 0 item}
215
+ one {Lista de etiquetas com {count} item}
216
+ other {Lista de etiquetas com {count} itens}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Mostrar menos",
219
219
  "components.tag-list.show-more-description": "Selecione para mostrar itens ocultos da lista de etiquetas",
package/lang/sv.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+ {count} till",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {Tagglista med 0 objekt}
215
+ one {Tagglista med {count} objekt}
216
+ other {Tagglista med {count} objekt}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Visa färre",
219
219
  "components.tag-list.show-more-description": "Välj för att visa dolda tagglistobjekt",
package/lang/tr.js CHANGED
@@ -211,9 +211,9 @@ export default {
211
211
  "components.tag-list.num-hidden": "+{count} tane daha",
212
212
  "components.tag-list.role-description":
213
213
  `{count, plural,
214
- =0 {Tag List with 0 items}
215
- one {Tag List with {count} item}
216
- other {Tag List with {count} items}
214
+ =0 {0 öğeli Etiket Listesi}
215
+ one {{count} öğeli Etiket Listesi}
216
+ other {{count} öğeli Etiket Listesi}
217
217
  }`,
218
218
  "components.tag-list.show-less": "Daha Azını Göster",
219
219
  "components.tag-list.show-more-description": "Gizli etiket listesi öğelerini göstermek için seçin",
package/lang/zh-cn.js CHANGED
@@ -203,8 +203,8 @@ export default {
203
203
  "components.tag-list.num-hidden": "+ {count} 个",
204
204
  "components.tag-list.role-description":
205
205
  `{count, plural,
206
- =0 {Tag List with 0 items}
207
- other {Tag List with {count} items}
206
+ =0 {包含 0 个项目的标签列表}
207
+ other {包含 {count} 个项目的标签列表}
208
208
  }`,
209
209
  "components.tag-list.show-less": "显示更少",
210
210
  "components.tag-list.show-more-description": "选择以显示隐藏的标签列表项目",
package/lang/zh-tw.js CHANGED
@@ -204,8 +204,8 @@ export default {
204
204
  "components.tag-list.num-hidden": "還有 {count} 個",
205
205
  "components.tag-list.role-description":
206
206
  `{count, plural,
207
- =0 {Tag List with 0 items}
208
- other {Tag List with {count} items}
207
+ =0 {標記列表包含 0 個項目}
208
+ other {標記列表包含 {count} 個項目}
209
209
  }`,
210
210
  "components.tag-list.show-less": "顯示更少",
211
211
  "components.tag-list.show-more-description": "選取以顯示隱藏的標記清單項目",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.156.3",
3
+ "version": "3.157.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",