@salesforcedevs/dx-components 1.40.0-docs-feedback → 1.40.0-docs-feedback-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.40.0-docs-feedback",
3
+ "version": "1.40.0-docs-feedback-1",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -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
- const href = this._treeNode?.link?.href;
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,8 +145,9 @@ export default class TreeItem extends LightningElement {
151
145
  this.preventDefaultLinkBehavior(event);
152
146
 
153
147
  /**
154
- * For Docs content-type only redirect, content-less parents to their first content child.
155
- * Let navigation handle selection and ancestor expansion to avoid flicker.
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
153
  this.sendGtm(event);
@@ -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) {
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
  }