@salesforcedevs/dx-components 1.40.0-docs-feedback → 1.40.0-docs-feedback-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.
package/package.json
CHANGED
|
@@ -65,7 +65,8 @@ export class TreeHandler {
|
|
|
65
65
|
isChildrenLoading: node.isChildrenLoading || false,
|
|
66
66
|
link: node.link,
|
|
67
67
|
method: node.method,
|
|
68
|
-
showForwardArrow: node.showForwardArrow
|
|
68
|
+
showForwardArrow: node.showForwardArrow,
|
|
69
|
+
redirectToChild: node.redirectToChild
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
const mapItem = { node: convertedNode, parent };
|
|
@@ -50,13 +50,7 @@ export default class TreeItem extends LightningElement {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
private get isContentlessParent(): boolean {
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
this.isParent &&
|
|
56
|
-
!!href &&
|
|
57
|
-
!this.isExternalLink &&
|
|
58
|
-
href !== this._treeNode.name
|
|
59
|
-
);
|
|
53
|
+
return this.isParent && !!this._treeNode?.redirectToChild;
|
|
60
54
|
}
|
|
61
55
|
|
|
62
56
|
private get showChildren(): boolean {
|
|
@@ -151,12 +145,15 @@ export default class TreeItem extends LightningElement {
|
|
|
151
145
|
this.preventDefaultLinkBehavior(event);
|
|
152
146
|
|
|
153
147
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
148
|
+
* A content-less parent is redirected to its first content child, so it
|
|
149
|
+
* navigates like a normal link. Navigation handles selection and
|
|
150
|
+
* ancestor expansion, avoiding flicker caused by manual toggling.
|
|
156
151
|
*/
|
|
157
152
|
if (this.isContentlessParent) {
|
|
158
|
-
this.
|
|
159
|
-
|
|
153
|
+
if (this._treeNode.link?.href) {
|
|
154
|
+
this.sendGtm(event);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
160
157
|
}
|
|
161
158
|
|
|
162
159
|
if (this.isParent) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a href={href} class={tileClass} target={target}>
|
|
2
|
+
<a href={href} class={tileClass} target={target} aria-label={linkAriaLabel}>
|
|
3
3
|
<div class="flex indentation" role="heading" aria-level={tileAriaLevel}>
|
|
4
4
|
<div class="flex tile-expand-icon tile-icon" if:true={showArrow}>
|
|
5
5
|
<dx-icon
|
|
@@ -37,6 +37,21 @@ export default class TreeTile extends LightningElement {
|
|
|
37
37
|
return this.treeNode.level + 2;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Accessible name for the link. If a parent redirects to its first child,
|
|
42
|
+
* include both the parent and child labels so the destination is clear to
|
|
43
|
+
* screen reader users (WCAG 2.4.4)
|
|
44
|
+
*/
|
|
45
|
+
get linkAriaLabel(): string | null {
|
|
46
|
+
if (!this.treeNode.redirectToChild || !this.treeNode.link?.href) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const destinationLabel = this.treeNode.children?.[0]?.label;
|
|
50
|
+
return destinationLabel
|
|
51
|
+
? `${this.treeNode.label}, opens ${destinationLabel}`
|
|
52
|
+
: null;
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
private get iconSize() {
|
|
41
56
|
return "xsmall";
|
|
42
57
|
}
|