@salesforcedevs/dx-components 1.3.196 → 1.3.198

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.196",
3
+ "version": "1.3.198",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -41,5 +41,5 @@
41
41
  "eventsourcemock": "^2.0.0",
42
42
  "luxon": "^3.1.0"
43
43
  },
44
- "gitHead": "3ca1796a050dd87c8083f73e41d8cb0cfb15328d"
44
+ "gitHead": "b3dd8e55be2d535c10e2ea0420c251d4ec975fdf"
45
45
  }
@@ -26,6 +26,9 @@ prism.languages.gtl = prism.languages.extend(
26
26
  prism.languages.handlebars
27
27
  );
28
28
 
29
+ // LWC
30
+ prism.languages.lwc = prism.languages.extend("jsx");
31
+
29
32
  // Used for remove enclosing <pre> tag's (if occurs)
30
33
  const preTagRegexp: RegExp = /^<pre.*?>(.*)<\/pre>$/is;
31
34
 
@@ -80,7 +83,8 @@ export default class CodeBlock extends LightningElement {
80
83
  { label: "DataWeave", id: "dataweave" },
81
84
  { label: "AMPScript", id: "ampscript" },
82
85
  { label: "SSJS", id: "ssjs" },
83
- { label: "GTL", id: "gtl" }
86
+ { label: "GTL", id: "gtl" },
87
+ { label: "LWC", id: "lwc" }
84
88
  ];
85
89
 
86
90
  connectedCallback() {
@@ -94,9 +98,10 @@ export default class CodeBlock extends LightningElement {
94
98
  set codeBlock(value: string) {
95
99
  this._codeBlockRendered = false;
96
100
  let match;
97
- this._codeBlock = ((match = preTagRegexp.exec(value.trim())) === null
98
- ? value.trim()
99
- : match[1]
101
+ this._codeBlock = (
102
+ (match = preTagRegexp.exec(value.trim())) === null
103
+ ? value.trim()
104
+ : match[1]
100
105
  ).trim();
101
106
  }
102
107
 
@@ -243,9 +248,8 @@ export default class CodeBlock extends LightningElement {
243
248
  });
244
249
 
245
250
  try {
246
- const snippetContainer: HTMLElement | null = this.template.querySelector(
247
- ".code-block-content"
248
- );
251
+ const snippetContainer: HTMLElement | null =
252
+ this.template.querySelector(".code-block-content");
249
253
  if (snippetContainer && snippetContainer.textContent) {
250
254
  await navigator.clipboard.writeText(
251
255
  snippetContainer.textContent
@@ -96,6 +96,12 @@
96
96
  );
97
97
  }
98
98
 
99
+ .cta-inline {
100
+ display: flex;
101
+ justify-content: space-between;
102
+ max-width: unset;
103
+ }
104
+
99
105
  /* sections with a swoop and center alignment should not left align as it encroaches on the graphic */
100
106
  .section.align-center.graphic-top .text {
101
107
  text-align: center;
@@ -2,7 +2,7 @@
2
2
  <div class={className} style={style} part="container">
3
3
  <svg
4
4
  class="background-graphic background-graphic-top"
5
- if:true={topGraphic}
5
+ lwc:if={topGraphic}
6
6
  preserveAspectRatio="none"
7
7
  width="1438px"
8
8
  height="83px"
@@ -26,21 +26,38 @@
26
26
  </g>
27
27
  </svg>
28
28
 
29
- <div part="text" class="text" if:true={hasText}>
30
- <span class="label dx-text-display-8" if:true={label}>{label}</span>
31
- <h2 class={headingClassName} if:true={title}>{title}</h2>
32
- <span class={subtitleClassName} if:true={subtitle}>{subtitle}</span>
33
- <dx-button
34
- class="cta"
35
- if:true={ctaLabel}
36
- href={ctaHref}
37
- variant={ctaBtnVariant}
38
- icon-symbol={ctaBtnSymbol}
39
- target={ctaBtnTarget}
40
- onclick={handleLabelClick}
41
- >
42
- {ctaLabel}
43
- </dx-button>
29
+ <div part="text" class="text" lwc:if={hasText}>
30
+ <span class="label dx-text-display-8" lwc:if={label}>{label}</span>
31
+ <h2 class={headingClassName} lwc:if={title}>
32
+ {title}
33
+ <template lwc:if={ctaBtnInline}>
34
+ <dx-button
35
+ class="cta"
36
+ lwc:if={ctaLabel}
37
+ href={ctaHref}
38
+ variant={ctaBtnVariant}
39
+ icon-symbol={ctaBtnSymbol}
40
+ target={ctaBtnTarget}
41
+ onclick={handleLabelClick}
42
+ >
43
+ {ctaLabel}
44
+ </dx-button>
45
+ </template>
46
+ </h2>
47
+ <span class={subtitleClassName} lwc:if={subtitle}>{subtitle}</span>
48
+ <template lwc:if={ctaNotInline}>
49
+ <dx-button
50
+ class="cta"
51
+ lwc:if={ctaLabel}
52
+ href={ctaHref}
53
+ variant={ctaBtnVariant}
54
+ icon-symbol={ctaBtnSymbol}
55
+ target={ctaBtnTarget}
56
+ onclick={handleLabelClick}
57
+ >
58
+ {ctaLabel}
59
+ </dx-button>
60
+ </template>
44
61
  </div>
45
62
  <div part="content" class="content">
46
63
  <slot></slot>
@@ -48,7 +65,7 @@
48
65
 
49
66
  <svg
50
67
  class="background-graphic background-graphic-bottom"
51
- if:true={bottomGraphic}
68
+ lwc:if={bottomGraphic}
52
69
  preserveAspectRatio="none"
53
70
  width="1438px"
54
71
  height="83px"
@@ -17,6 +17,7 @@ export default class Section extends LightningElement {
17
17
  @api ctaBtnVariant?: string;
18
18
  @api ctaBtnSymbol?: string;
19
19
  @api ctaBtnTarget?: string = "_self";
20
+ @api ctaBtnInline?: boolean = false;
20
21
  @api topGraphic: boolean = false;
21
22
  @api graphicOverlap: boolean = false;
22
23
  @api bottomGraphic: boolean = false;
@@ -43,13 +44,21 @@ export default class Section extends LightningElement {
43
44
  }
44
45
 
45
46
  private get headingClassName() {
46
- return cx("heading", `dx-text-display-${this.headingLevel}`);
47
+ return cx(
48
+ "heading",
49
+ `dx-text-display-${this.headingLevel}`,
50
+ this.ctaBtnInline && "cta-inline"
51
+ );
47
52
  }
48
53
 
49
54
  private get hasText(): boolean {
50
55
  return !!(this.title || this.label || this.subtitle);
51
56
  }
52
57
 
58
+ private get ctaNotInline(): boolean {
59
+ return !this.ctaBtnInline;
60
+ }
61
+
53
62
  private handleLabelClick(e: Event) {
54
63
  track(e.target!, "custEv_ctaLinkClick", {
55
64
  click_text: this.ctaLabel,