@salesforcedevs/dx-components 1.3.210-lnb17-alpha → 1.3.210-lnb19-alpha

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.3.210-lnb17-alpha",
3
+ "version": "1.3.210-lnb19-alpha",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -15,9 +15,7 @@ dx-empty-state {
15
15
 
16
16
  .sidebar-content {
17
17
  overflow-y: auto;
18
- padding-bottom: var(--dx-g-spacing-md);
19
- margin-bottom: var(--dx-g-spacing-2xl);
20
- padding-top: var(--dx-g-spacing-sm);
18
+ padding: var(--dx-g-spacing-sm) 0 var(--dx-g-spacing-md);
21
19
  }
22
20
 
23
21
  .loading-skeleton {
@@ -58,7 +56,7 @@ dx-empty-state {
58
56
  .results-heading {
59
57
  --dx-g-text-body-color: var(--sds-g-gray-14);
60
58
 
61
- padding-bottom: var(--dx-g-spacing-sm);
59
+ margin-bottom: var(--dx-g-spacing-sm);
62
60
  font-weight: var(--dx-g-font-bold);
63
61
  }
64
62
 
@@ -1,4 +1,4 @@
1
- import { LightningElement, api, track } from "lwc";
1
+ import { LightningElement, api } from "lwc";
2
2
  import type { OptionWithLink } from "typings/custom";
3
3
  import { toJson } from "dxUtils/normalizers";
4
4
 
@@ -14,6 +14,8 @@ export class SidebarBase extends LightningElement {
14
14
  mobile: boolean = true;
15
15
  expanded: boolean = true;
16
16
  _value?: string = undefined;
17
+ showBoxShadow: boolean = false;
18
+ private scrolling: boolean = false;
17
19
 
18
20
  @api langValuePath: string = "id";
19
21
  @api language!: string;
@@ -47,16 +49,26 @@ export class SidebarBase extends LightningElement {
47
49
  return this._sidebarContent;
48
50
  }
49
51
 
50
- @track showBoxShadow = false;
51
-
52
- handleScroll(scrollEvent) {
52
+ /**
53
+ * This method is to handle the scroll event for LNB and show box shadow
54
+ * @param scrollEvent
55
+ */
56
+ handleScroll(scrollEvent: any) {
53
57
  const lnb = scrollEvent.target;
54
58
 
55
- // Check if lnb is scrolled
56
- if (lnb.scrollTop > 0 && lnb.scrollHeight > lnb.clientHeight) {
57
- this.showBoxShadow = true;
58
- } else {
59
- this.showBoxShadow = false;
59
+ if (!this.scrolling) {
60
+ this.scrolling = true;
61
+ // Set a timeout to handle scroll event after a delay
62
+ setTimeout(() => {
63
+ // Check if lnb is scrolled
64
+ if (lnb.scrollTop > 0 && lnb.scrollHeight > lnb.clientHeight) {
65
+ this.showBoxShadow = true;
66
+ } else {
67
+ this.showBoxShadow = false;
68
+ }
69
+ // Reset scrolling back to false after handling the scroll
70
+ this.scrolling = false;
71
+ }, 200);
60
72
  }
61
73
  }
62
74
 
@@ -27,8 +27,7 @@
27
27
  }
28
28
 
29
29
  .padding-horizontal {
30
- padding-left: var(--dx-g-spacing-2xl);
31
- padding-right: var(--dx-g-spacing-lg);
30
+ padding: 0 var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-2xl);
32
31
  border-bottom: 1px solid var(--dx-g-gray-90);
33
32
  }
34
33
 
@@ -141,6 +140,7 @@
141
140
  border-right: 1px solid var(--dx-g-gray-90);
142
141
  height: var(--dx-g-spacing-2xl);
143
142
  align-items: center;
143
+ margin-top: var(--dx-g-spacing-2xl);
144
144
  }
145
145
 
146
146
  @media screen and (max-width: 1279px) {
@@ -18,10 +18,7 @@
18
18
  }
19
19
 
20
20
  .sidebar-item:focus-visible {
21
- padding-left: 0;
22
- margin-left: var(--dx-g-spacing-2xl);
23
- padding-right: 0;
24
- margin-right: var(--dx-g-spacing-lg);
21
+ margin: 0 calc(var(--dx-g-spacing-2xs) + 1px);
25
22
  outline: 2px solid var(--dx-g-blue-vibrant-40);
26
23
  border-radius: 2px;
27
24
  }