@salesforcedevs/dx-components 0.43.2-alpha1 → 0.43.3-tree-selected-scroll
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/cardContent/cardContent.css +1 -1
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.html +0 -1
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.ts +1 -1
- package/src/modules/dx/section/section.css +1 -1
- package/src/modules/dx/section/section.ts +9 -9
- package/src/modules/dx/treeItem/treeItem.css +5 -0
- package/src/modules/dx/treeItem/treeItem.ts +18 -0
- package/src/modules/dx/vimeoPlayer/vimeoPlayer.html +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { LightningElement, api } from "lwc";
|
|
|
2
2
|
|
|
3
3
|
export default class CardVideoPreview extends LightningElement {
|
|
4
4
|
@api body?: string | null = null;
|
|
5
|
-
@api datetime
|
|
5
|
+
@api datetime!: string;
|
|
6
6
|
@api featured?: boolean = false;
|
|
7
7
|
@api href!: string;
|
|
8
8
|
@api imgAlt?: string;
|
|
@@ -3,16 +3,16 @@ import cx from "classnames";
|
|
|
3
3
|
import { toDxColor } from "utils/css";
|
|
4
4
|
|
|
5
5
|
export default class Section extends LightningElement {
|
|
6
|
-
@api backgroundColor
|
|
7
|
-
@api dark
|
|
6
|
+
@api backgroundColor?: string | null = "transparent";
|
|
7
|
+
@api dark?: boolean = false;
|
|
8
8
|
@api headingLevel: "1" | "2" | "3" | "4" | "5" = "3";
|
|
9
|
-
@api label?: string;
|
|
10
|
-
@api subtitle?: string;
|
|
11
|
-
@api textAlign
|
|
12
|
-
@api title?: string;
|
|
13
|
-
@api topGraphic
|
|
14
|
-
@api graphicOverlap
|
|
15
|
-
@api bottomGraphic
|
|
9
|
+
@api label?: string | null = null;
|
|
10
|
+
@api subtitle?: string | null = null;
|
|
11
|
+
@api textAlign?: "center" | "left" = "left";
|
|
12
|
+
@api title?: string | null = null;
|
|
13
|
+
@api topGraphic?: boolean = false;
|
|
14
|
+
@api graphicOverlap?: boolean = false;
|
|
15
|
+
@api bottomGraphic?: boolean = false;
|
|
16
16
|
|
|
17
17
|
private get style(): string {
|
|
18
18
|
return `--dx-c-section-background-color: ${toDxColor(
|
|
@@ -61,6 +61,24 @@ export default class TreeItem extends LightningElement {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
renderedCallback(): void {
|
|
65
|
+
/**
|
|
66
|
+
* This is to scroll to the selected element in the sidebar if it's not visible in the viewport
|
|
67
|
+
* Please refer https://stackoverflow.com/a/67433987/5059959 for reason of values given to scrollIntoView props
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
if (this.isSelected) {
|
|
71
|
+
const element = this.template.querySelector("dx-tree-tile");
|
|
72
|
+
if (element) {
|
|
73
|
+
element.scrollIntoView({
|
|
74
|
+
block: "nearest",
|
|
75
|
+
inline: "nearest",
|
|
76
|
+
behavior: "smooth"
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
64
82
|
private onIconClick(event: CustomEvent): void {
|
|
65
83
|
const isSelectAction = false;
|
|
66
84
|
this.doExpand(isSelectAction);
|