@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "0.43.2-alpha1",
3
+ "version": "0.43.3-tree-selected-scroll",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -26,7 +26,7 @@
26
26
 
27
27
  /* mobile responsiveness */
28
28
 
29
- @media screen and (max-width: 768px) {
29
+ @media screen and (max-width: 1024px) {
30
30
  .card-content:not(.dx-card-base_featured) {
31
31
  flex-direction: row;
32
32
  }
@@ -16,7 +16,6 @@
16
16
  slot="image-badge"
17
17
  ></dx-icon-badge>
18
18
  <dx-formatted-date-time
19
- if:true={datetime}
20
19
  slot="datetime"
21
20
  day="2-digit"
22
21
  month="long"
@@ -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?: string;
5
+ @api datetime!: string;
6
6
  @api featured?: boolean = false;
7
7
  @api href!: string;
8
8
  @api imgAlt?: string;
@@ -69,7 +69,7 @@
69
69
  margin-bottom: var(--dx-g-spacing-md);
70
70
  }
71
71
 
72
- .text > .label:not(:last-child) {
72
+ .text > .label {
73
73
  margin-bottom: var(--dx-g-spacing-lg);
74
74
  }
75
75
 
@@ -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: string = "transparent";
7
- @api dark: boolean = false;
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: "center" | "left" = "left";
12
- @api title?: string;
13
- @api topGraphic: boolean = false;
14
- @api graphicOverlap: boolean = false;
15
- @api bottomGraphic: boolean = false;
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(
@@ -4,6 +4,11 @@
4
4
  display: block;
5
5
  }
6
6
 
7
+ /* This is to scroll to some more space in the bottom so that user will see some more available items in the bottom */
8
+ dx-tree-tile {
9
+ scroll-margin-bottom: 90px;
10
+ }
11
+
7
12
  button {
8
13
  width: 100%;
9
14
  text-align: left;
@@ -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);
@@ -1,3 +1,3 @@
1
1
  <template>
2
- <div class="video-container" lwc:dom="manual"></div>
2
+ <div class="video-container"></div>
3
3
  </template>