@brightspace-ui/core 3.102.0 → 3.102.1

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.
@@ -91,23 +91,27 @@ export const MenuItemMixin = superclass => class extends superclass {
91
91
 
92
92
  updated(changedProperties) {
93
93
  super.updated(changedProperties);
94
-
95
- changedProperties.forEach((oldValue, propName) => {
96
- if (propName === 'hidden') {
97
- this._onHidden();
98
- } else if (propName === 'disabled') {
99
- this._ariaDisabled = this.disabled ? 'true' : 'false';
100
- } else if (propName === 'text' || propName === 'description') {
101
- this._ariaLabel = this.description || this.text;
102
- }
103
- });
94
+ if (changedProperties.has('hidden')) this._onHidden();
104
95
  }
105
96
 
106
97
  willUpdate(changedProperties) {
107
98
  super.willUpdate(changedProperties);
108
- if (changedProperties.has('lines') && !(changedProperties.get('lines') === undefined && this.lines === defaultLines)) {
109
- this.style.setProperty('--d2l-menu-item-lines', this.lines);
110
- }
99
+ changedProperties.forEach((oldValue, propName) => {
100
+ switch (propName) {
101
+ case 'text':
102
+ case 'description':
103
+ this._ariaLabel = this.description || this.text;
104
+ break;
105
+ case 'disabled':
106
+ this._ariaDisabled = this.disabled ? 'true' : 'false';
107
+ break;
108
+ case 'lines':
109
+ if (!(changedProperties.get('lines') === undefined && this.lines === defaultLines)) {
110
+ this.style.setProperty('--d2l-menu-item-lines', this.lines);
111
+ }
112
+ break;
113
+ }
114
+ });
111
115
  }
112
116
 
113
117
  __action() {
@@ -39,9 +39,9 @@ class MenuItemReturn extends RtlMixin(LocalizeCoreElement(MenuItemMixin(LitEleme
39
39
  ];
40
40
  }
41
41
 
42
- firstUpdated() {
43
- super.firstUpdated();
44
- this.setAttribute('aria-label', this.localize('components.menu-item-return.return'));
42
+ constructor() {
43
+ super();
44
+ this.text = null;
45
45
  }
46
46
 
47
47
  render() {
@@ -51,14 +51,15 @@ class MenuItemReturn extends RtlMixin(LocalizeCoreElement(MenuItemMixin(LitEleme
51
51
  `;
52
52
  }
53
53
 
54
- updated(changedProperties) {
55
- super.updated(changedProperties);
56
-
57
- changedProperties.forEach((oldValue, propName) => {
58
- if (propName === 'text') {
54
+ willUpdate(changedProperties) {
55
+ super.willUpdate(changedProperties);
56
+ if (changedProperties.has('text')) {
57
+ if (this.text) {
59
58
  this.setAttribute('aria-label', this.localize('components.menu-item-return.returnCurrentlyShowing', 'menuTitle', this.text));
59
+ } else {
60
+ this.setAttribute('aria-label', this.localize('components.menu-item-return.return'));
60
61
  }
61
- });
62
+ }
62
63
  }
63
64
 
64
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.102.0",
3
+ "version": "3.102.1",
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",