@brightspace-ui/core 3.127.0 → 3.127.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.
@@ -6,6 +6,7 @@ import { heading1Styles, heading2Styles, heading3Styles, heading4Styles } from '
6
6
  import { classMap } from 'lit/directives/class-map.js';
7
7
  import { EventSubscriberController } from '../../controllers/subscriber/subscriberControllers.js';
8
8
  import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
9
+ import { getComposedActiveElement } from '../../helpers/focus.js';
9
10
  import { ifDefined } from 'lit/directives/if-defined.js';
10
11
  import { isComposedAncestor } from '../../helpers/dom.js';
11
12
  import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
@@ -27,6 +28,21 @@ const normalizeHeadingLevel = (number) => {
27
28
 
28
29
  const defaultHeading = 3;
29
30
 
31
+ let tabPressed = false;
32
+ let tabListenerAdded = false;
33
+ function addTabListener() {
34
+ if (tabListenerAdded) return;
35
+ tabListenerAdded = true;
36
+ document.addEventListener('keydown', e => {
37
+ if (e.keyCode !== 9) return;
38
+ tabPressed = true;
39
+ });
40
+ document.addEventListener('keyup', e => {
41
+ if (e.keyCode !== 9) return;
42
+ tabPressed = false;
43
+ });
44
+ }
45
+
30
46
  /**
31
47
  * A container with a title that can be expanded/collapsed to show/hide content.
32
48
  * @slot before - Slot for content to be placed at the left side of the header, aligned with the title and header slot
@@ -85,7 +101,6 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
85
101
  * @type {boolean}
86
102
  */
87
103
  noSticky: { attribute: 'no-sticky', type: Boolean },
88
- _clicked: { state: true },
89
104
  _focused: { state: true },
90
105
  _hasBefore: { state: true },
91
106
  _hasSummary: { state: true },
@@ -323,7 +338,6 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
323
338
  this.paddingType = 'default';
324
339
  this.type = 'default';
325
340
  this.noSticky = false;
326
- this._clicked = false;
327
341
  this._focused = false;
328
342
  this._group = undefined;
329
343
  this._groupSubscription = new EventSubscriberController(this, 'collapsible-panel-group', {
@@ -341,6 +355,11 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
341
355
  return '.d2l-collapsible-panel-opener';
342
356
  }
343
357
 
358
+ connectedCallback() {
359
+ super.connectedCallback();
360
+ addTabListener();
361
+ }
362
+
344
363
  disconnectedCallback() {
345
364
  super.disconnectedCallback();
346
365
  if (this._intersectionObserver) this._intersectionObserver.disconnect();
@@ -349,7 +368,7 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
349
368
  render() {
350
369
  const classes = {
351
370
  'd2l-collapsible-panel': true,
352
- 'focused': this._focused && !this._clicked,
371
+ 'focused': this._focused,
353
372
  'has-summary': this._hasSummary,
354
373
  'has-before': this._hasBefore,
355
374
  'scrolled': this._scrolled,
@@ -425,7 +444,6 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
425
444
  }
426
445
 
427
446
  _handlePanelClick(e) {
428
- this._clicked = e.detail && e.detail > 0; // detect if click event is from a mouse
429
447
  const content = this.shadowRoot.querySelector('.d2l-collapsible-panel-content');
430
448
  if (e.target !== content && !isComposedAncestor(content, e.target)) this._toggleExpand();
431
449
  }
@@ -436,11 +454,15 @@ class CollapsiblePanel extends SkeletonMixin(FocusMixin(RtlMixin(LitElement))) {
436
454
  }
437
455
 
438
456
  _onBlur() {
439
- this._focused = false;
440
- this._clicked = false;
457
+ setTimeout(() => {
458
+ // don't remove focus if the button still ends up in focus
459
+ if (getComposedActiveElement() === this.shadowRoot.querySelector('button')) return;
460
+ this._focused = false;
461
+ }, 10);
441
462
  }
442
463
 
443
464
  _onFocus() {
465
+ if (!tabPressed) return;
444
466
  this._focused = true;
445
467
  }
446
468
 
package/lang/pt.js CHANGED
@@ -50,14 +50,14 @@ export default {
50
50
  "components.input-color.backgroundColor": "Cor do Plano de fundo",
51
51
  "components.input-color.foregroundColor": "Cor do Primeiro plano",
52
52
  "components.input-color.none": "Nenhum",
53
- "components.input-date-range.endDate": "Data final",
53
+ "components.input-date-range.endDate": "Data Final",
54
54
  "components.input-date-range.errorBadInput": "{startLabel} precisa ser anterior a {endLabel}",
55
55
  "components.input-date-range.interactive-label": "Entrada do intervalo de datas",
56
- "components.input-date-range.startDate": "Data de início",
57
- "components.input-date-time-range-to.to": "a",
58
- "components.input-date-time-range.endDate": "Data final",
56
+ "components.input-date-range.startDate": "Data de Início",
57
+ "components.input-date-time-range-to.to": "para",
58
+ "components.input-date-time-range.endDate": "Data Final",
59
59
  "components.input-date-time-range.errorBadInput": "{startLabel} precisa ser anterior a {endLabel}",
60
- "components.input-date-time-range.startDate": "Data de início",
60
+ "components.input-date-time-range.startDate": "Data de Início",
61
61
  "components.input-date-time.date": "Data",
62
62
  "components.input-date-time.errorMaxDateOnly": "A data deve ser anterior ou igual a {maxDate}",
63
63
  "components.input-date-time.errorMinDateOnly": "A data deve ser igual ou posterior a {minDate}",
@@ -107,14 +107,14 @@ export default {
107
107
  "components.more-less.more": "mais",
108
108
  "components.object-property-list.item-placeholder-text": "Item de espaço reservado",
109
109
  "components.overflow-group.moreActions": "Mais ações",
110
- "components.pager-load-more.action": "Carregar mais",
110
+ "components.pager-load-more.action": "Carregar Mais",
111
111
  "components.pager-load-more.action-with-page-size": "Carregar mais {count}",
112
112
  "components.pageable.info": "{count, plural, one {{countFormatted} item} other {{countFormatted} itens}}",
113
113
  "components.pageable.info-with-total": "{totalCount, plural, one {{countFormatted} de {totalCountFormatted} item} other {{countFormatted} de {totalCountFormatted} itens}}",
114
114
  "components.pager-load-more.status-loading": "Carregando mais itens",
115
115
  "components.selection.action-max-hint": "{count, plural, one {Desativado quando mais de {countFormatted} item é selecionado} other {Desativado quando mais de {countFormatted} itens são selecionados}}",
116
116
  "components.selection.action-required-hint": "Selecione um item para realizar esta ação",
117
- "components.selection.select-all": "Selecionar tudo",
117
+ "components.selection.select-all": "Selecionar Tudo",
118
118
  "components.selection.select-all-items": "Selecione todos os {count} itens",
119
119
  "components.selection.selected": "{count} selecionados",
120
120
  "components.selection.selected-plus": "Mais de {count} selecionados",
@@ -129,20 +129,20 @@ export default {
129
129
  "components.table-controls.label": "Ações para a tabela",
130
130
  "components.tabs.next": "Ir para frente",
131
131
  "components.tabs.previous": "Ir para trás",
132
- "components.tag-list.clear": "Clique em, pressione Backspace ou pressione a tecla Delete para remover o item {value}",
132
+ "components.tag-list.clear": "Clique, pressione a tecla Backspace ou a tecla Delete para remover o item {value}",
133
133
  "components.tag-list.clear-all": "Limpar tudo",
134
- "components.tag-list.cleared-all": "Todos os itens da lista de marcas foram removidos",
135
- "components.tag-list.cleared-item": "Item {value} da lista de marcas removido",
134
+ "components.tag-list.cleared-all": "Todos os itens da lista de etiquetas foram removidos",
135
+ "components.tag-list.cleared-item": "Item {value} da lista de etiquetas removido",
136
136
  "components.tag-list.interactive-label": "Lista de marcas, {count} itens",
137
137
  "components.tag-list.num-hidden": "+ {count} mais",
138
138
  "components.tag-list.role-description": "Lista de marcas",
139
139
  "components.tag-list.show-less": "Mostrar menos",
140
- "components.tag-list.show-more-description": "Selecione para mostrar itens ocultos da lista de marcas",
140
+ "components.tag-list.show-more-description": "Selecione para mostrar itens ocultos da lista de etiquetas",
141
141
  "components.tag-list-item.role-description": "Marca",
142
142
  "components.tag-list-item.tooltip-arrow-keys": "Teclas de seta",
143
- "components.tag-list-item.tooltip-arrow-keys-desc": "Mover entre marcas",
144
- "components.tag-list-item.tooltip-delete-key": "Retroceder/Excluir",
145
- "components.tag-list-item.tooltip-delete-key-desc": "Excluir a marca de foco",
143
+ "components.tag-list-item.tooltip-arrow-keys-desc": "Mover entre etiquetas",
144
+ "components.tag-list-item.tooltip-delete-key": "Backspace/Delete",
145
+ "components.tag-list-item.tooltip-delete-key-desc": "Excluir a etiqueta de foco",
146
146
  "components.tag-list-item.tooltip-title": "Controles do teclado",
147
147
  "templates.primary-secondary.divider": "Divisor do painel secundário",
148
148
  "templates.primary-secondary.secondary-panel": "Painel secundário"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.127.0",
3
+ "version": "3.127.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",