@salesforcedevs/dx-components 1.40.0-integration-alpha → 1.40.0-integration-alpha2
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 +1 -1
- package/src/modules/dx/treeItem/treeItem.css +5 -0
- package/src/modules/dx/treeItem/treeItem.html +2 -1
- package/src/modules/dx/treeItem/treeItem.ts +10 -0
- package/src/modules/dx/treeTile/treeTile.ts +5 -1
- package/src/modules/dxHelpers/commonTreeItem/commonTreeItem.css +4 -0
- package/src/modules/dxUtils/topicVersion/topicVersion.ts +12 -3
package/package.json
CHANGED
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
margin-right: var(--dx-g-spacing-lg);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
.tree-item-row-selected {
|
|
30
|
+
background: var(--dx-g-cloud-blue-vibrant-95);
|
|
31
|
+
box-shadow: inset var(--dx-g-spacing-xs) 0 0 0 var(--dx-g-blue-vibrant-40);
|
|
32
|
+
}
|
|
33
|
+
|
|
29
34
|
button {
|
|
30
35
|
width: 100%;
|
|
31
36
|
text-align: left;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class=
|
|
2
|
+
<div class={rowClass}>
|
|
3
3
|
<dx-tree-tile
|
|
4
4
|
href={href}
|
|
5
5
|
is-root={isRoot}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
is-expanded={isExpanded}
|
|
8
8
|
has-children={hasChildren}
|
|
9
9
|
is-selected={isSelected}
|
|
10
|
+
is-contained-selection={isContainedSelection}
|
|
10
11
|
oniconclick={onIconClick}
|
|
11
12
|
show-arrow={isParent}
|
|
12
13
|
target={target}
|
|
@@ -51,6 +51,16 @@ export default class TreeItem extends LightningElement {
|
|
|
51
51
|
return this._treeNode.key === this.selectedKey && !this.isExternalLink;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
private get rowClass(): string {
|
|
55
|
+
return this.isSelected && this.showVersionPicker
|
|
56
|
+
? "tree-item-row tree-item-row-selected"
|
|
57
|
+
: "tree-item-row";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private get isContainedSelection(): boolean {
|
|
61
|
+
return this.isSelected && this.showVersionPicker;
|
|
62
|
+
}
|
|
63
|
+
|
|
54
64
|
private get hasChildren(): boolean {
|
|
55
65
|
return !!(
|
|
56
66
|
this.treeNode &&
|
|
@@ -28,6 +28,7 @@ export default class TreeTile extends LightningElement {
|
|
|
28
28
|
@api isExpanded = false;
|
|
29
29
|
@api hasChildren = false;
|
|
30
30
|
@api isSelected = false;
|
|
31
|
+
@api isContainedSelection = false;
|
|
31
32
|
@api href!: string;
|
|
32
33
|
@api showArrow = false;
|
|
33
34
|
@api target!: string;
|
|
@@ -80,7 +81,10 @@ export default class TreeTile extends LightningElement {
|
|
|
80
81
|
"tile-root": this.isRoot,
|
|
81
82
|
"tile-with-children": !this.isRoot && this.hasChildren,
|
|
82
83
|
"tile-root-with-child": this.isRoot && this.showArrow,
|
|
83
|
-
"sidebar-item-selected":
|
|
84
|
+
"sidebar-item-selected":
|
|
85
|
+
this.isSelected && !this.isContainedSelection,
|
|
86
|
+
"sidebar-item-selected-text":
|
|
87
|
+
this.isSelected && this.isContainedSelection,
|
|
84
88
|
"tile-with-version-picker": this.hasVersionPicker
|
|
85
89
|
});
|
|
86
90
|
}
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
color: var(--dx-g-blue-vibrant-40) !important;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.sidebar-item-selected-text {
|
|
17
|
+
color: var(--dx-g-blue-vibrant-40) !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.sidebar-item {
|
|
17
21
|
padding: 6px var(--dx-g-spacing-lg) 6px
|
|
18
22
|
var(--dx-g-global-header-padding-horizontal);
|
|
@@ -21,6 +21,10 @@ export type VersionedNode = {
|
|
|
21
21
|
};
|
|
22
22
|
children?: VersionedNode[];
|
|
23
23
|
versions?: TopicVersionOption[];
|
|
24
|
+
/** Set on Redoc spec tiles after the docs layout decorates the TOC. */
|
|
25
|
+
showForwardArrow?: boolean;
|
|
26
|
+
/** Docs TOC topic type (`markdown` | `spec`). May be stripped after decoration. */
|
|
27
|
+
topicType?: string;
|
|
24
28
|
};
|
|
25
29
|
|
|
26
30
|
type VersionPathDelta = {
|
|
@@ -113,14 +117,19 @@ export function isParentOnlyTopic(node: VersionedNode | undefined): boolean {
|
|
|
113
117
|
return !ownHref && !!node.children?.length;
|
|
114
118
|
}
|
|
115
119
|
|
|
120
|
+
function isSpecNode(node: VersionedNode): boolean {
|
|
121
|
+
return node.showForwardArrow === true || node.topicType === "spec";
|
|
122
|
+
}
|
|
123
|
+
|
|
116
124
|
/**
|
|
117
|
-
* First descendant that has a page (own href/name).
|
|
118
|
-
*
|
|
125
|
+
* First descendant that has a markdown page (own href/name). Specs (Redoc)
|
|
126
|
+
* and external links are skipped so parent-only sections land on the first
|
|
127
|
+
* markdown topic even when a spec is authored first in the TOC.
|
|
119
128
|
*/
|
|
120
129
|
export function firstContentNode(
|
|
121
130
|
node: VersionedNode | undefined
|
|
122
131
|
): VersionedNode | undefined {
|
|
123
|
-
if (!node || node.link?.target === "_blank") {
|
|
132
|
+
if (!node || node.link?.target === "_blank" || isSpecNode(node)) {
|
|
124
133
|
return undefined;
|
|
125
134
|
}
|
|
126
135
|
if (node.link?.href || node.name) {
|