@salesforcedevs/dx-components 1.19.3-layoutfix-alpha1 → 1.19.4-test

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,13 +1,11 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.19.3-layoutfix-alpha1",
3
+ "version": "1.19.4-test",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
7
- "node": "20.x"
8
- },
9
- "publishConfig": {
10
- "access": "public"
7
+ "node": "20.x",
8
+ "yarn": "1.22.19"
11
9
  },
12
10
  "dependencies": {
13
11
  "@coveo/headless": "3.22.2",
@@ -44,6 +42,7 @@
44
42
  "luxon": "3.4.4"
45
43
  },
46
44
  "volta": {
47
- "node": "20.19.0"
45
+ "node": "20.19.0",
46
+ "yarn": "1.22.19"
48
47
  }
49
48
  }
@@ -25,12 +25,28 @@
25
25
  margin-bottom: var(--dx-g-spacing-md);
26
26
  }
27
27
 
28
+ .toc-content-header[show-shadow="true"] {
29
+ width: 132px;
30
+ box-shadow: 0 4px 4px -2px var(--dx-g-gray-90);
31
+ }
32
+
33
+ .toc-content-header[show-shadow="true"] .toc_title {
34
+ margin-bottom: var(--dx-g-spacing-sm);
35
+ }
36
+
37
+ .toc-items {
38
+ max-height: 760px;
39
+ overflow-y: auto;
40
+ padding-bottom: 80px;
41
+ }
42
+
28
43
  .dx-text-display-8 {
29
44
  padding-top: var(--dx-g-spacing-sm);
30
45
  transition: var(--dx-g-transition-hue-1x);
31
46
  }
32
47
 
33
48
  .content-button {
49
+ display: block;
34
50
  line-height: var(--dx-g-text-lg);
35
51
  color: var(--dx-g-blue-vibrant-20);
36
52
  font-family: var(--dx-g-font-sans);
@@ -1,19 +1,23 @@
1
1
  <template>
2
2
  <div class="toc" role="navigation">
3
3
  <div class="toc toc_content">
4
- <h2 class="dx-text-display-8 toc_title">{header}</h2>
5
- <template for:each={options} for:item="option">
6
- <a
7
- href={option.anchor}
8
- class={option.className}
9
- onclick={onClick}
10
- contentid={option.id}
11
- data-text={option.label}
12
- key={option.id}
13
- >
14
- {option.label}
15
- </a>
16
- </template>
4
+ <div class="toc-content-header" show-shadow={showBoxShadow}>
5
+ <h2 class="dx-text-display-8 toc_title">{header}</h2>
6
+ </div>
7
+ <div class="toc-items" onscroll={handleScroll}>
8
+ <template for:each={options} for:item="option">
9
+ <a
10
+ href={option.anchor}
11
+ class={option.className}
12
+ onclick={onClick}
13
+ contentid={option.id}
14
+ data-text={option.label}
15
+ key={option.id}
16
+ >
17
+ {option.label}
18
+ </a>
19
+ </template>
20
+ </div>
17
21
  </div>
18
22
  </div>
19
23
  <div>
@@ -3,8 +3,13 @@ import cx from "classnames";
3
3
  import { ContentElement } from "typings/custom";
4
4
  import { toJson } from "dxUtils/normalizers";
5
5
  import { track as sendGtm } from "dxUtils/analytics";
6
+ import { SidebarBase } from "dxBaseElements/sidebarBase";
6
7
 
7
8
  export default class Toc extends LightningElement {
9
+ showBoxShadow: boolean = false;
10
+ private scrolling: boolean = false;
11
+ handleScroll: (e: any) => void = () => {};
12
+
8
13
  @api header!: string;
9
14
 
10
15
  @api
@@ -38,6 +43,10 @@ export default class Toc extends LightningElement {
38
43
 
39
44
  @track _options!: Array<ContentElement>;
40
45
 
46
+ connectedCallback() {
47
+ this.handleScroll = SidebarBase.prototype.handleScroll.bind(this);
48
+ }
49
+
41
50
  private onClick(e: Event) {
42
51
  const target = e.currentTarget as HTMLElement;
43
52
  const id = target.getAttribute("contentid");