@salesforcedevs/dx-components 0.53.7 → 0.53.10

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.53.7",
3
+ "version": "0.53.10",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -28,5 +28,5 @@
28
28
  "@types/lodash.get": "^4.4.6",
29
29
  "@types/vimeo__player": "^2.16.2"
30
30
  },
31
- "gitHead": "eca2efeba5b98d28ebf91bdd2c411c3995c49bdf"
31
+ "gitHead": "4c4e059fbd82f79db3c02c69e69d2fabc0035390"
32
32
  }
@@ -28,7 +28,7 @@ export default class CardCallout extends LightningElement {
28
28
  }
29
29
 
30
30
  private sendGtm(e: PointerEvent) {
31
- track(e.currentTarget, "select_content", {
31
+ track(e.currentTarget, "custEv_ctaLinkClick", {
32
32
  content_type: "callout",
33
33
  item_title: this.title,
34
34
  item_location: this.href
@@ -235,10 +235,6 @@ dx-filter-menu {
235
235
  margin-left: 62px;
236
236
  }
237
237
 
238
- .empty-state-container {
239
- height: 350px;
240
- }
241
-
242
238
  .results-heading {
243
239
  font-size: 32px;
244
240
  margin-top: 42px;
@@ -21,6 +21,7 @@
21
21
  >
22
22
  <template for:each={options} for:item="option">
23
23
  <dx-dropdown-option
24
+ suppress-gtm-nav-headings={suppressGtmNavHeadings}
24
25
  analytics-event={analyticsEvent}
25
26
  active={option.active}
26
27
  key-value={option.keyValue}
@@ -40,6 +41,7 @@
40
41
  <span class="menu_heading">{option.label}</span>
41
42
  <template for:each={option.options} for:item="suboption">
42
43
  <dx-dropdown-option
44
+ suppress-gtm-nav-headings={suppressGTMNavHeadings}
43
45
  analytics-event={analyticsEvent}
44
46
  active={suboption.active}
45
47
  key={suboption.id}
@@ -18,6 +18,7 @@ export default class Dropdown extends LightningElement {
18
18
  @api value: string | null = null; // "active option" id
19
19
  @api valuePath: string = "id"; // path to match for the active value (useful for url matching)
20
20
  @api stayOpenAfterChange?: boolean = false;
21
+ @api suppressGtmNavHeadings?: boolean = false;
21
22
 
22
23
  // props forwarded to popover:
23
24
  @api ariaLabel: string | null = null;
@@ -5,6 +5,7 @@ import { track } from "dx/instrumentation";
5
5
 
6
6
  export default class DropdownOption extends LightningElement {
7
7
  @api option!: Option;
8
+ @api suppressGtmNavHeadings: boolean = false;
8
9
  @api keyValue!: string;
9
10
  @api active: boolean = false;
10
11
  @api navItemLabel: String | null = null;
@@ -27,13 +28,7 @@ export default class DropdownOption extends LightningElement {
27
28
  new CustomEvent("select", { detail: this.keyValue })
28
29
  );
29
30
 
30
- const navHeading = this.navItemLabel || this.option.label || undefined;
31
- const navSubHeading =
32
- (this.navItemLabel ? this.option.label : undefined) || undefined;
33
-
34
31
  const payload: any = {
35
- navHeading,
36
- navSubHeading,
37
32
  clickText: this.keyValue || undefined,
38
33
  pageLocation: window.location.pathname || undefined,
39
34
  elementType: "dropdown",
@@ -43,6 +38,15 @@ export default class DropdownOption extends LightningElement {
43
38
  clickUrl: e.target?.href || undefined
44
39
  };
45
40
 
41
+ const navHeading = this.navItemLabel || this.option.label || undefined;
42
+ const navSubHeading =
43
+ (this.navItemLabel ? this.option.label : undefined) || undefined;
44
+
45
+ if (!this.suppressGtmNavHeadings) {
46
+ payload.navHeading = navHeading;
47
+ payload.navSubHeading = navSubHeading;
48
+ }
49
+
46
50
  if (this.analyticsEvent && e.currentTarget) {
47
51
  track(e.currentTarget, this.analyticsEvent, payload);
48
52
  }
@@ -1,31 +1,42 @@
1
1
  <template>
2
2
  <div class={classname} part="container">
3
- <div
4
- if:true={label}
5
- role={labelRole}
6
- aria-level={labelAriaLevel}
7
- class="label dx-text-heading-4"
8
- >
9
- {label}
10
- </div>
3
+ <template if:true={labelAsPrimaryHeading}>
4
+ <h1 if:true={label} class="label dx-text-heading-4">{label}</h1>
5
+ </template>
6
+ <template if:false={labelAsPrimaryHeading}>
7
+ <p if:true={label} class="label dx-text-heading-4">{label}</p>
8
+ </template>
11
9
  <div class="featured-content-main-content">
12
- <div
13
- role="heading"
14
- aria-level={titleAriaLevel}
15
- class="title dx-text-heading-2"
16
- >
17
- <a
18
- class="title-link"
19
- if:true={href}
20
- href={href}
21
- target={target}
22
- onmouseenter={setLinkHovered}
23
- onmouseleave={setLinkInactive}
24
- >
25
- {title}
26
- </a>
27
- <template if:false={href}>{title}</template>
28
- </div>
10
+ <template if:false={labelAsPrimaryHeading}>
11
+ <h1 class="title dx-text-heading-2">
12
+ <a
13
+ class="title-link"
14
+ if:true={href}
15
+ href={href}
16
+ target={target}
17
+ onmouseenter={setLinkHovered}
18
+ onmouseleave={setLinkInactive}
19
+ >
20
+ {title}
21
+ </a>
22
+ <template if:false={href}>{title}</template>
23
+ </h1>
24
+ </template>
25
+ <template if:true={labelAsPrimaryHeading}>
26
+ <h2 class="title dx-text-heading-2">
27
+ <a
28
+ class="title-link"
29
+ if:true={href}
30
+ href={href}
31
+ target={target}
32
+ onmouseenter={setLinkHovered}
33
+ onmouseleave={setLinkInactive}
34
+ >
35
+ {title}
36
+ </a>
37
+ <template if:false={href}>{title}</template>
38
+ </h2>
39
+ </template>
29
40
  <div class="authors" if:true={authors}>
30
41
  <template for:each={authors} for:item="author">
31
42
  <dx-image-and-label
@@ -73,18 +73,6 @@ export default class FeaturedContentHeader extends LightningElement {
73
73
  );
74
74
  }
75
75
 
76
- private get labelRole(): string | null {
77
- return this.labelAsPrimaryHeading ? "heading" : null;
78
- }
79
-
80
- private get labelAriaLevel(): string | null {
81
- return this.labelAsPrimaryHeading ? "1" : null;
82
- }
83
-
84
- private get titleAriaLevel(): string {
85
- return this.labelAsPrimaryHeading ? "2" : "1";
86
- }
87
-
88
76
  private setLinkHovered() {
89
77
  this.isLinkHovered = true;
90
78
  }