@brightspace-ui/core 3.180.0 → 3.181.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.
|
@@ -8,8 +8,6 @@ import { menuItemStyles } from './menu-item-styles.js';
|
|
|
8
8
|
|
|
9
9
|
const newWindowIconEnabled = getFlag('GAUD-8295-menu-item-link-new-window-icon', true);
|
|
10
10
|
|
|
11
|
-
const menuItemClickChangesEnabled = getFlag('GAUD-8369-menu-item-link-click-changes', true);
|
|
12
|
-
|
|
13
11
|
/**
|
|
14
12
|
* A menu item component used for navigating.
|
|
15
13
|
* @fires click - Dispatched when the link is clicked
|
|
@@ -105,7 +103,6 @@ class MenuItemLink extends (newWindowIconEnabled ? LinkMixin(MenuItemMixin(LitEl
|
|
|
105
103
|
|
|
106
104
|
firstUpdated() {
|
|
107
105
|
super.firstUpdated();
|
|
108
|
-
if (!menuItemClickChangesEnabled) this.addEventListener('click', this._onClick); // remove when cleaning up GAUD-8369-menu-item-link-click-changes
|
|
109
106
|
this.addEventListener('keydown', this._onKeyDown);
|
|
110
107
|
}
|
|
111
108
|
|
|
@@ -142,41 +139,9 @@ class MenuItemLink extends (newWindowIconEnabled ? LinkMixin(MenuItemMixin(LitEl
|
|
|
142
139
|
return label && this.target === '_blank' ? this.localize('components.link.open-in-new-window') : undefined;
|
|
143
140
|
}
|
|
144
141
|
|
|
145
|
-
// remove this function when cleaning up GAUD-8369-menu-item-link-click-changes
|
|
146
|
-
_getTarget() {
|
|
147
|
-
if (this.target && this.target !== '') {
|
|
148
|
-
return this.target;
|
|
149
|
-
}
|
|
150
|
-
let base = document.getElementsByTagName('base');
|
|
151
|
-
if (base && base.length > 0) {
|
|
152
|
-
base = base[0];
|
|
153
|
-
return base.getAttribute('target');
|
|
154
|
-
}
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// remove this function when cleaning up GAUD-8369-menu-item-link-click-changes
|
|
159
|
-
_onClick() {
|
|
160
|
-
if (this.shadowRoot) this.shadowRoot.querySelector('a').dispatchEvent(new CustomEvent('click'));
|
|
161
|
-
}
|
|
162
|
-
|
|
163
142
|
_onKeyDown(e) {
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
this.shadowRoot.querySelector('a').click();
|
|
167
|
-
}
|
|
168
|
-
} else { // remove this block when cleaning up GAUD-8369-menu-item-link-click-changes
|
|
169
|
-
super._onKeyDown(e);
|
|
170
|
-
if (e.keyCode === this.__keyCodes.ENTER || e.keyCode === this.__keyCodes.SPACE) {
|
|
171
|
-
const target = this._getTarget();
|
|
172
|
-
if (target === '_parent') {
|
|
173
|
-
window.parent.location.assign(this.href);
|
|
174
|
-
} else if (target === '_top') {
|
|
175
|
-
window.top.location.assign(this.href);
|
|
176
|
-
} else {
|
|
177
|
-
window.location.assign(this.href);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
143
|
+
if (e.keyCode === this.__keyCodes.ENTER || e.keyCode === this.__keyCodes.SPACE) {
|
|
144
|
+
this.shadowRoot.querySelector('a').click();
|
|
180
145
|
}
|
|
181
146
|
}
|
|
182
147
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { getFlag } from '../../helpers/flags.js';
|
|
2
1
|
import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
|
|
3
2
|
|
|
4
3
|
const defaultLines = 2;
|
|
5
|
-
const menuItemClickChangesEnabled = getFlag('GAUD-8369-menu-item-link-click-changes', true);
|
|
6
4
|
|
|
7
5
|
export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(superclass) {
|
|
8
6
|
|
|
@@ -156,11 +154,7 @@ export const MenuItemMixin = superclass => class extends PropertyRequiredMixin(s
|
|
|
156
154
|
}
|
|
157
155
|
|
|
158
156
|
__onClick(e) {
|
|
159
|
-
if (
|
|
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
|
-
}
|
|
157
|
+
if (!this._letClickPropagate) e.stopPropagation();
|
|
164
158
|
|
|
165
159
|
this.__action();
|
|
166
160
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.181.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",
|