@brightspace-ui/core 3.21.0 → 3.21.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.
@@ -1030,6 +1030,9 @@ export const DropdownContentMixin = superclass => class extends LocalizeCoreElem
1030
1030
  leftOverride = `${Math.max(window.innerWidth - window.screen.width, 0)}px`;
1031
1031
  }
1032
1032
 
1033
+ if (minWidthOverride > maxWidthOverride) {
1034
+ minWidthOverride = maxWidthOverride;
1035
+ }
1033
1036
  const widthStyle = {
1034
1037
  maxWidth: maxWidthOverride,
1035
1038
  minWidth: minWidthOverride,
@@ -56,7 +56,8 @@ class MeterCircle extends MeterMixin(RtlMixin(LitElement)) {
56
56
  const dashOffset = 7 * Math.PI * 2 - 10; // approximation perimeter of circle divide by 3 subtract the rounded edges (5 pixels each)
57
57
 
58
58
  const primary = this._primary(this.value, this.max) || '';
59
- const secondary = this._secondary(this.value, this.max, this.text);
59
+ const primaryAria = this._primary(this.value, this.max, true) || '';
60
+ const secondaryAria = this._secondary(this.value, this.max, this.text, true);
60
61
  const textClasses = {
61
62
  'd2l-meter-circle-text-ltr': !this.percent,
62
63
  'd2l-body-standard': true,
@@ -64,7 +65,7 @@ class MeterCircle extends MeterMixin(RtlMixin(LitElement)) {
64
65
  };
65
66
 
66
67
  return html`
67
- <svg viewBox="0 0 48 48" shape-rendering="geometricPrecision" role="img" aria-label="${this._ariaLabel(primary, secondary)}">
68
+ <svg viewBox="0 0 48 48" shape-rendering="geometricPrecision" role="img" aria-label="${this._ariaLabel(primaryAria, secondaryAria)}">
68
69
  <circle class="d2l-meter-circle-full-bar" cx="24" cy="24" r="21"></circle>
69
70
  <circle
70
71
  class="d2l-meter-circle-progress-bar"
@@ -112,6 +112,8 @@ class MeterLinear extends MeterMixin(RtlMixin(LitElement)) {
112
112
  }
113
113
  const primary = this._primary(this.value, this.max);
114
114
  const secondary = this._secondary(this.value, this.max, this.text);
115
+ const primaryAria = this._primary(this.value, this.max, true);
116
+ const secondaryAria = this._secondary(this.value, this.max, this.text, true);
115
117
  const textClasses = {
116
118
  'd2l-meter-linear-text-space-between': !this.textInline && secondary !== this.text,
117
119
  'd2l-body-small': true,
@@ -126,7 +128,7 @@ class MeterLinear extends MeterMixin(RtlMixin(LitElement)) {
126
128
  return html `
127
129
  <div
128
130
  role="img"
129
- aria-label="${this._ariaLabel(primary, secondary)}">
131
+ aria-label="${this._ariaLabel(primaryAria, secondaryAria)}">
130
132
  <div class="d2l-meter-linear-full-bar">
131
133
  <div class="d2l-meter-linear-inner-bar" style="width:${percentage}%;"></div>
132
134
  </div>
@@ -40,26 +40,31 @@ export const MeterMixin = superclass => class extends LocalizeCoreElement(superc
40
40
  }
41
41
 
42
42
  _ariaLabel(primary, secondary) {
43
- const mainLabel = this.localize(`${this._namespace}.commaSeperatedAria`, 'term1', primary, 'term2', this.localize(`${this._namespace}.progressIndicator`));
44
- return secondary ? this.localize(`${this._namespace}.commaSeperatedAria`, 'term1', secondary, 'term2', mainLabel) : mainLabel;
43
+ // todo: these should be using CLDR data/patterns instead of translated message fragments
44
+ // example: https://www.unicode.org/cldr/cldr-aux/charts/37/summary/en.html#4480e9e541ba33de
45
+ const mainLabel = this.localize(`${this._namespace}.commaSeperatedAria`, { term1: primary, term2: this.localize(`${this._namespace}.progressIndicator`) });
46
+ return secondary ? this.localize(`${this._namespace}.commaSeperatedAria`, { term1: secondary, term2: mainLabel }) : mainLabel;
45
47
  }
46
48
 
47
- _primary(value, max) {
49
+ _primary(value, max, aria = false) {
48
50
  const percentage = max > 0 ? value / max : 0;
51
+ const key = aria ? 'fractionAria' : 'fraction';
49
52
 
50
53
  return this.percent
51
54
  ? formatPercent(percentage, { maximumFractionDigits: 0 })
52
- : this.localize(`${this._namespace}.fraction`, 'x', value, 'y', max);
55
+ : this.localize(`${this._namespace}.${key}`, { x: value, y: max });
53
56
  }
54
57
 
55
- _secondary(value, max, context) {
58
+ _secondary(value, max, context, aria = false) {
56
59
  if (!context) {
57
60
  return '';
58
61
  }
59
62
 
63
+ const key = aria ? 'fractionAria' : 'fraction';
64
+
60
65
  const percentage = this.max > 0 ? value / max : 0;
61
66
  context = context.replace('{%}', formatPercent(percentage, { maximumFractionDigits: 0 }));
62
- context = context.replace('{x/y}', this.localize(`${this._namespace}.fraction`, 'x', value, 'y', max));
67
+ context = context.replace('{x/y}', this.localize(`${this._namespace}.${key}`, { x: value, y: max }));
63
68
  context = context.replace('{x}', value);
64
69
  context = context.replace('{y}', max);
65
70
 
@@ -61,6 +61,8 @@ class MeterRadial extends MeterMixin(RtlMixin(LitElement)) {
61
61
  const progressFill = percent * lengthOfLine;
62
62
  const primary = this._primary(this.value, this.max);
63
63
  const secondary = this._secondary(this.value, this.max, this.text);
64
+ const primaryAria = this._primary(this.value, this.max, true) || '';
65
+ const secondaryAria = this._secondary(this.value, this.max, this.text, true) || '';
64
66
  const secondaryTextElement = this.text ? html`<div class="d2l-body-small d2l-meter-radial-text">${secondary}</div>` : nothing;
65
67
  const textClasses = {
66
68
  'd2l-meter-radial-text-ltr': !this.percent,
@@ -72,7 +74,7 @@ class MeterRadial extends MeterMixin(RtlMixin(LitElement)) {
72
74
  <div
73
75
  class="d2l-meter-radial"
74
76
  role="img"
75
- aria-label="${this._ariaLabel(primary, secondary)}">
77
+ aria-label="${this._ariaLabel(primaryAria, secondaryAria)}">
76
78
  <svg viewBox="0 0 84 46">
77
79
  <path class="d2l-meter-radial-full-bar" d="M5 40a37 35 0 0 1 74 0" />
78
80
  <path
package/lang/ar.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "العودة إلى القائمة السابقة. يتم عرض {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}، ‏{term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "مؤشر التقدم",
98
99
  "components.more-less.less": "أقل",
99
100
  "components.more-less.more": "المزيد",
package/lang/cy.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Dychwelyd i'r ddewislen flaenorol. Rydych chi'n edrych ar {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Dangosydd Cynnydd",
98
99
  "components.more-less.less": "llai",
99
100
  "components.more-less.more": "mwy",
package/lang/da.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Gå tilbage til forrige menu. Du ser på {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Statusindikator",
98
99
  "components.more-less.less": "færre",
99
100
  "components.more-less.more": "flere",
package/lang/de.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Zum vorherigen Menü zurückkehren. Sie betrachten gerade {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Fortschrittsanzeige",
98
99
  "components.more-less.less": "Weniger",
99
100
  "components.more-less.more": "mehr",
package/lang/en-gb.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Return to previous menu. You are viewing {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Progress Indicator",
98
99
  "components.more-less.less": "less",
99
100
  "components.more-less.more": "more",
package/lang/en.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Return to previous menu. You are viewing {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Progress Indicator",
98
99
  "components.more-less.less": "less",
99
100
  "components.more-less.more": "more",
package/lang/es-es.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Vuelva al menú anterior. Está en {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Indicador de progreso",
98
99
  "components.more-less.less": "menos",
99
100
  "components.more-less.more": "más",
package/lang/es.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Regresar al menú anterior. Está viendo {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Indicador de progreso",
98
99
  "components.more-less.less": "menos",
99
100
  "components.more-less.more": "más",
package/lang/fr-fr.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Revenir au menu précédent. Vous consultez {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Indicateur de progrès",
98
99
  "components.more-less.less": "moins",
99
100
  "components.more-less.more": "plus",
package/lang/fr.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Retour au menu précédent. Vous voyez actuellement {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Indicateur de progrès",
98
99
  "components.more-less.less": "moins",
99
100
  "components.more-less.more": "plus",
package/lang/hi.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "पिछले मेनू पर वापस जाएँ। आप {menuTitle} देख रहे हैं।",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "प्रगति संकेतक",
98
99
  "components.more-less.less": "कम",
99
100
  "components.more-less.more": "अधिक",
package/lang/ja.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "前のメニューに戻ります。{menuTitle} を表示しています。",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}、{term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "進捗状況インジケータ",
98
99
  "components.more-less.less": "減らす",
99
100
  "components.more-less.more": "増やす",
package/lang/ko.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "이전 메뉴로 돌아갑니다. {menuTitle}을(를) 보고 있습니다.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "진도 표시기",
98
99
  "components.more-less.less": "축소",
99
100
  "components.more-less.more": "더 보기",
package/lang/nl.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Keer terug naar het vorige menu. U bekijkt {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Voortgangsindicator",
98
99
  "components.more-less.less": "minder",
99
100
  "components.more-less.more": "meer",
package/lang/pt.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Voltar ao menu anterior. Você está visualizando {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Indicador de progresso",
98
99
  "components.more-less.less": "menos",
99
100
  "components.more-less.more": "mais",
package/lang/sv.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Återgå till föregående meny. Du visar {menuTitle}.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Förloppsindikator",
98
99
  "components.more-less.less": "mindre",
99
100
  "components.more-less.more": "mer",
package/lang/tr.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "Önceki menüye dönün. {menuTitle} başlığını görüntülüyorsunuz.",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}, {term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "Gelişim Göstergesi",
98
99
  "components.more-less.less": "daha az",
99
100
  "components.more-less.more": "daha fazla",
package/lang/zh-cn.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "返回至上级菜单。您正在浏览 {menuTitle}。",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1}、{term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "进度指示符",
98
99
  "components.more-less.less": "更少",
99
100
  "components.more-less.more": "更多",
package/lang/zh-tw.js CHANGED
@@ -94,6 +94,7 @@ export default {
94
94
  "components.menu-item-return.returnCurrentlyShowing": "返回上一個功能表。您正在檢視 {menuTitle}。",
95
95
  "components.meter-mixin.commaSeperatedAria": "{term1},{term2}",
96
96
  "components.meter-mixin.fraction": "{x}∕{y}",
97
+ "components.meter-mixin.fractionAria": "{x} out of {y}",
97
98
  "components.meter-mixin.progressIndicator": "進度指示器",
98
99
  "components.more-less.less": "較少",
99
100
  "components.more-less.more": "較多",
@@ -124,7 +124,7 @@ export const InteractiveMixin = superclass => class extends LocalizeCoreElement(
124
124
  }
125
125
 
126
126
  async _handleInteractiveKeyDown(e) {
127
- if (this._interactive && e.keyCode === 9) e.stopPropagation(); // tab
127
+ if (this._interactive && e.keyCode !== 27) e.stopPropagation(); // stop propagation for any key other than escape
128
128
  }
129
129
 
130
130
  _handleInteractiveToggleBlur() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.21.0",
3
+ "version": "3.21.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",