@brightspace-ui/core 3.157.0 → 3.158.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.
- package/components/link/link-mixin.js +7 -7
- package/components/menu/menu-item-link.js +24 -5
- package/custom-elements.json +0 -37
- package/lang/haw.js +3 -3
- package/lang/mi.js +3 -3
- package/package.json +1 -1
@@ -21,11 +21,6 @@ export const LinkMixin = superclass => class extends LocalizeCoreElement(supercl
|
|
21
21
|
* @type {string}
|
22
22
|
*/
|
23
23
|
href: { type: String },
|
24
|
-
/**
|
25
|
-
* Label for the link
|
26
|
-
* @type {string}
|
27
|
-
*/
|
28
|
-
ariaLabel: { type: String, attribute: 'aria-label' },
|
29
24
|
/**
|
30
25
|
* Where to display the linked URL
|
31
26
|
* @type {string}
|
@@ -57,14 +52,19 @@ export const LinkMixin = superclass => class extends LocalizeCoreElement(supercl
|
|
57
52
|
`];
|
58
53
|
}
|
59
54
|
|
60
|
-
|
55
|
+
getNewWindowDescription(label) {
|
56
|
+
return label && this.target === '_blank' ? this.localize('components.link.open-in-new-window') : undefined;
|
57
|
+
}
|
58
|
+
|
59
|
+
_render(inner, { ariaLabel = undefined, rel = undefined, linkClasses = {}, tabindex = undefined } = {}) {
|
61
60
|
/*
|
62
61
|
* NOTICE:
|
63
62
|
* All html template whitespace within this component is critical to proper rendering and wrapping.
|
64
63
|
* Do not modify for readability!
|
65
64
|
*/
|
66
65
|
return html`<a
|
67
|
-
aria-label="${ifDefined(
|
66
|
+
aria-label="${ifDefined(ariaLabel)}"
|
67
|
+
aria-description="${ifDefined(this.getNewWindowDescription(ariaLabel))}"
|
68
68
|
class="${classMap(linkClasses)}"
|
69
69
|
download="${ifDefined(this.download)}"
|
70
70
|
href="${ifDefined(this.href)}"
|
@@ -2,10 +2,12 @@ import { css, html, LitElement } from 'lit';
|
|
2
2
|
import { getFlag } from '../../helpers/flags.js';
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
4
4
|
import { LinkMixin } from '../link/link-mixin.js';
|
5
|
+
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
5
6
|
import { MenuItemMixin } from './menu-item-mixin.js';
|
6
7
|
import { menuItemStyles } from './menu-item-styles.js';
|
7
8
|
|
8
9
|
const newWindowIconEnabled = getFlag('GAUD-8295-menu-item-link-new-window-icon', true);
|
10
|
+
|
9
11
|
const menuItemClickChangesEnabled = getFlag('GAUD-8369-menu-item-link-click-changes', true);
|
10
12
|
|
11
13
|
/**
|
@@ -13,11 +15,11 @@ const menuItemClickChangesEnabled = getFlag('GAUD-8369-menu-item-link-click-chan
|
|
13
15
|
* @fires click - Dispatched when the link is clicked
|
14
16
|
* @slot supporting - Allows supporting information to be displayed on the right-most side of the menu item
|
15
17
|
*/
|
16
|
-
class MenuItemLink extends (newWindowIconEnabled ? LinkMixin(MenuItemMixin(LitElement)) : MenuItemMixin(LitElement)) {
|
18
|
+
class MenuItemLink extends (newWindowIconEnabled ? LinkMixin(MenuItemMixin(LitElement)) : LocalizeCoreElement(MenuItemMixin(LitElement))) {
|
17
19
|
|
18
20
|
static get properties() {
|
19
|
-
|
20
|
-
return {
|
21
|
+
// remove this block when cleaning up GAUD-8295-menu-item-link-new-window-icon
|
22
|
+
if (!newWindowIconEnabled) return {
|
21
23
|
/**
|
22
24
|
* Prompts the user to save the linked URL instead of navigating to it.
|
23
25
|
* Must be to a resource on the same origin.
|
@@ -34,7 +36,12 @@ class MenuItemLink extends (newWindowIconEnabled ? LinkMixin(MenuItemMixin(LitEl
|
|
34
36
|
* Where to display the linked URL
|
35
37
|
* @type {string}
|
36
38
|
*/
|
37
|
-
target: { type: String }
|
39
|
+
target: { type: String },
|
40
|
+
_ariaDescription: { type: String, attribute: 'aria-description', reflect: true },
|
41
|
+
};
|
42
|
+
|
43
|
+
return {
|
44
|
+
_ariaDescription: { type: String, attribute: 'aria-description', reflect: true },
|
38
45
|
};
|
39
46
|
}
|
40
47
|
|
@@ -119,8 +126,20 @@ class MenuItemLink extends (newWindowIconEnabled ? LinkMixin(MenuItemMixin(LitEl
|
|
119
126
|
${this._renderNewWindowIcon()}
|
120
127
|
<div class="d2l-menu-item-supporting"><slot name="supporting"></slot></div>
|
121
128
|
`;
|
122
|
-
return this._render(inner, { rel: this.target ? 'noreferrer noopener' : undefined, tabindex: -1 });
|
129
|
+
return this._render(inner, { ariaLabel: this._ariaLabel, rel: this.target ? 'noreferrer noopener' : undefined, tabindex: -1 });
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
willUpdate(changedProperties) {
|
134
|
+
super.willUpdate(changedProperties);
|
135
|
+
if (newWindowIconEnabled && changedProperties.has('_ariaLabel') || changedProperties.has('target')) {
|
136
|
+
this._ariaDescription = this.getNewWindowDescription(this._ariaLabel);
|
137
|
+
}
|
138
|
+
}
|
123
139
|
|
140
|
+
// remove this function when cleaning up GAUD-8295-menu-item-link-new-window-icon
|
141
|
+
getNewWindowDescription(label) {
|
142
|
+
return label && this.target === '_blank' ? this.localize('components.link.open-in-new-window') : undefined;
|
124
143
|
}
|
125
144
|
|
126
145
|
// remove this function when cleaning up GAUD-8369-menu-item-link-click-changes
|
package/custom-elements.json
CHANGED
@@ -10540,43 +10540,6 @@
|
|
10540
10540
|
"name": "d2l-menu-item-link",
|
10541
10541
|
"path": "./components/menu/menu-item-link.js",
|
10542
10542
|
"description": "A menu item component used for navigating.",
|
10543
|
-
"attributes": [
|
10544
|
-
{
|
10545
|
-
"name": "download",
|
10546
|
-
"description": "Prompts the user to save the linked URL instead of navigating to it.\nMust be to a resource on the same origin.\nCan be used with or without a value, when set the value becomes the filename.",
|
10547
|
-
"type": "string"
|
10548
|
-
},
|
10549
|
-
{
|
10550
|
-
"name": "href",
|
10551
|
-
"description": "REQUIRED: The url the menu item link navigates to",
|
10552
|
-
"type": "string"
|
10553
|
-
},
|
10554
|
-
{
|
10555
|
-
"name": "target",
|
10556
|
-
"description": "Where to display the linked URL",
|
10557
|
-
"type": "string"
|
10558
|
-
}
|
10559
|
-
],
|
10560
|
-
"properties": [
|
10561
|
-
{
|
10562
|
-
"name": "download",
|
10563
|
-
"attribute": "download",
|
10564
|
-
"description": "Prompts the user to save the linked URL instead of navigating to it.\nMust be to a resource on the same origin.\nCan be used with or without a value, when set the value becomes the filename.",
|
10565
|
-
"type": "string"
|
10566
|
-
},
|
10567
|
-
{
|
10568
|
-
"name": "href",
|
10569
|
-
"attribute": "href",
|
10570
|
-
"description": "REQUIRED: The url the menu item link navigates to",
|
10571
|
-
"type": "string"
|
10572
|
-
},
|
10573
|
-
{
|
10574
|
-
"name": "target",
|
10575
|
-
"attribute": "target",
|
10576
|
-
"description": "Where to display the linked URL",
|
10577
|
-
"type": "string"
|
10578
|
-
}
|
10579
|
-
],
|
10580
10543
|
"events": [
|
10581
10544
|
{
|
10582
10545
|
"name": "click",
|
package/lang/haw.js
CHANGED
@@ -211,9 +211,9 @@ export default {
|
|
211
211
|
"components.tag-list.num-hidden": "+ {count} hou aku",
|
212
212
|
"components.tag-list.role-description":
|
213
213
|
`{count, plural,
|
214
|
-
=0 {
|
215
|
-
one {
|
216
|
-
other {
|
214
|
+
=0 {Papa inoa me 0 mau mea}
|
215
|
+
one {Papa inoa me {count} mau mea}
|
216
|
+
other {Papa inoa me {count} mau mea}
|
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/mi.js
CHANGED
@@ -211,9 +211,9 @@ export default {
|
|
211
211
|
"components.tag-list.num-hidden": "+ {count} anō",
|
212
212
|
"components.tag-list.role-description":
|
213
213
|
`{count, plural,
|
214
|
-
=0 {
|
215
|
-
one {
|
216
|
-
other {
|
214
|
+
=0 {Rarangi Tohu me nga mea 0}
|
215
|
+
one {Rarangi Tohu me nga mea {count}}
|
216
|
+
other {Rarangi Tohu me nga mea {count}}
|
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.158.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",
|