@salesforcedevs/dx-components 1.3.196 → 1.3.198-alpha.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": "1.3.
|
|
3
|
+
"version": "1.3.198-alpha.10",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -40,6 +40,5 @@
|
|
|
40
40
|
"@types/vimeo__player": "^2.16.2",
|
|
41
41
|
"eventsourcemock": "^2.0.0",
|
|
42
42
|
"luxon": "^3.1.0"
|
|
43
|
-
}
|
|
44
|
-
"gitHead": "3ca1796a050dd87c8083f73e41d8cb0cfb15328d"
|
|
43
|
+
}
|
|
45
44
|
}
|
|
@@ -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 = (
|
|
98
|
-
|
|
99
|
-
|
|
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 =
|
|
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
|
|
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
|
|
30
|
-
<span class="label dx-text-display-8" if
|
|
31
|
-
<h2 class={headingClassName} if
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
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(
|
|
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,
|
package/LICENSE
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
-
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
-
|
|
10
|
-
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
-
|
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|