@salesforcedevs/dx-components 0.53.11 → 0.54.0-alpha03
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/lwc.config.json +24 -26
- package/package.json +3 -6
- package/src/assets/svg/sidebar-item-loading.svg +2 -8
- package/src/modules/dx/banner/banner.css +2 -2
- package/src/modules/dx/breadcrumbs/breadcrumbs.css +2 -2
- package/src/modules/dx/breadcrumbs/breadcrumbs.ts +1 -1
- package/src/modules/dx/button/button.css +1 -1
- package/src/modules/dx/cardBlogPost/cardBlogPost.css +1 -1
- package/src/modules/dx/cardCallout/cardCallout.css +3 -3
- package/src/modules/dx/cardCallout/cardCallout.ts +5 -5
- package/src/modules/dx/cardContent/cardContent.css +3 -3
- package/src/modules/dx/cardContent/cardContent.ts +2 -2
- package/src/modules/dx/cardDemo/cardDemo.css +1 -1
- package/src/modules/dx/cardDocs/cardDocs.css +3 -3
- package/src/modules/dx/cardDocs/cardDocs.ts +1 -1
- package/src/modules/dx/cardEvent/cardEvent.css +3 -3
- package/src/modules/dx/cardExpanded/cardExpanded.css +1 -1
- package/src/modules/dx/cardExpanded/cardExpanded.ts +1 -1
- package/src/modules/dx/cardMinimal/cardMinimal.css +2 -2
- package/src/modules/dx/cardMinimal/cardMinimal.ts +1 -1
- package/src/modules/dx/cardNews/cardNews.css +3 -3
- package/src/modules/dx/cardNews/cardNews.ts +2 -2
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.css +3 -3
- package/src/modules/dx/cardSmall/cardSmall.css +3 -3
- package/src/modules/dx/cardSmall/cardSmall.ts +1 -1
- package/src/modules/dx/cardTitle/cardTitle.css +2 -2
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.css +1 -1
- package/src/modules/dx/cardTrial/cardTrial.css +3 -3
- package/src/modules/dx/cardTrial/cardTrial.ts +1 -1
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.css +1 -1
- package/src/modules/dx/checkbox/checkbox.css +2 -2
- package/src/modules/dx/checkboxGroup/checkboxGroup.css +1 -1
- package/src/modules/dx/checkboxGroup/checkboxGroup.ts +1 -1
- package/src/modules/dx/codeBlock/codeBlock.css +2 -2
- package/src/modules/dx/codeBlock/codeBlock.ts +2 -2
- package/src/modules/dx/dropdown/dropdown.css +1 -1
- package/src/modules/dx/dropdown/dropdown.ts +2 -2
- package/src/modules/dx/dropdownOption/dropdownOption.css +1 -1
- package/src/modules/dx/dropdownOption/dropdownOption.ts +1 -1
- package/src/modules/dx/emptyState/emptyState.css +2 -2
- package/src/modules/dx/feature/feature.css +2 -2
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +4 -4
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +2 -2
- package/src/modules/dx/featuresList/featuresList.css +2 -2
- package/src/modules/dx/featuresList/featuresList.ts +1 -1
- package/src/modules/dx/filterMenu/filterMenu.css +1 -1
- package/src/modules/dx/footer/footer.css +2 -2
- package/src/modules/dx/footer/footer.ts +2 -2
- package/src/modules/dx/footerOption/footerOption.ts +1 -1
- package/src/modules/dx/formattedDateTime/formattedDateTime.ts +5 -0
- package/src/modules/dx/groupText/groupText.css +2 -2
- package/src/modules/dx/groupText/groupText.ts +3 -3
- package/src/modules/dx/header/header.css +1 -1
- package/src/modules/dx/header/header.ts +2 -2
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.css +1 -1
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +1 -1
- package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.ts +1 -1
- package/src/modules/dx/headerNav/headerNav.css +1 -1
- package/src/modules/dx/headerSearch/headerSearch.css +1 -1
- package/src/modules/dx/headerSearch/headerSearch.ts +1 -1
- package/src/modules/dx/helmet/helmet.css +2 -2
- package/src/modules/dx/hr/hr.css +2 -2
- package/src/modules/dx/icon/icon.css +1 -1
- package/src/modules/dx/icon/icon.ts +1 -1
- package/src/modules/dx/iconBadge/iconBadge.css +1 -1
- package/src/modules/dx/iconBadge/iconBadge.ts +1 -1
- package/src/modules/dx/imageAndLabel/imageAndLabel.css +3 -3
- package/src/modules/dx/input/input.css +2 -2
- package/src/modules/dx/input/input.ts +1 -1
- package/src/modules/dx/logo/logo.css +2 -2
- package/src/modules/dx/modalDrawer/modalDrawer.ts +1 -1
- package/src/modules/dx/pagination/pagination.css +1 -1
- package/src/modules/dx/pagination/pagination.ts +1 -1
- package/src/modules/dx/podcastHost/podcastHost.css +2 -2
- package/src/modules/dx/popover/popover.css +1 -1
- package/src/modules/dx/popover/popover.ts +1 -1
- package/src/modules/dx/radioGroup/radioGroup.css +1 -1
- package/src/modules/dx/radioGroup/radioGroup.ts +1 -1
- package/src/modules/dx/section/section.css +2 -2
- package/src/modules/dx/section/section.ts +1 -1
- package/src/modules/dx/select/select.css +1 -1
- package/src/modules/dx/select/select.ts +1 -1
- package/src/modules/dx/sidebar/sidebar.css +2 -2
- package/src/modules/dx/sidebar/sidebar.ts +4 -4
- package/src/modules/dx/sidebarOld/sidebarOld.css +2 -2
- package/src/modules/dx/sidebarOld/sidebarOld.ts +3 -3
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +3 -3
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.css +3 -3
- package/src/modules/dx/skipNavLink/skipNavLink.css +1 -1
- package/src/modules/dx/socials/socials.ts +1 -1
- package/src/modules/dx/tab/tab.css +1 -1
- package/src/modules/dx/tab/tab.ts +2 -2
- package/src/modules/dx/toc/toc.css +2 -2
- package/src/modules/dx/toc/toc.ts +1 -1
- package/src/modules/dx/topics/topics.ts +1 -1
- package/src/modules/dx/tree/tree.css +1 -1
- package/src/modules/dx/tree/tree.ts +1 -1
- package/src/modules/dx/treeItem/treeItem.css +6 -1
- package/src/modules/dx/treeItem/treeItem.ts +2 -2
- package/src/modules/dx/treeTile/treeTile.css +2 -2
- package/src/modules/dx/typeBadge/typeBadge.css +1 -1
- package/src/modules/dx/typeBadge/typeBadge.ts +1 -1
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.ts +1 -1
- package/src/modules/dx/vimeoPlayer/vimeoPlayer.css +1 -1
- package/src/modules/{base-elements → dxBaseElements}/archiveCard/archiveCard.ts +0 -0
- package/src/modules/{base-elements → dxBaseElements}/headerBase/headerBase.ts +2 -2
- package/src/modules/{base-elements → dxBaseElements}/matchMediaElement/matchMediaElement.ts +1 -1
- package/src/modules/{base-elements → dxBaseElements}/sidebarBase/sidebarBase.ts +0 -0
- package/src/modules/{helpers → dxHelpers}/animations/animations.css +0 -0
- package/src/modules/{helpers → dxHelpers}/button/button.css +0 -0
- package/src/modules/{helpers → dxHelpers}/card/card.css +1 -1
- package/src/modules/{helpers → dxHelpers}/code/code.css +0 -0
- package/src/modules/{helpers → dxHelpers}/commonHeader/commonHeader.css +2 -2
- package/src/modules/{helpers → dxHelpers}/reset/reset.css +0 -0
- package/src/modules/{helpers → dxHelpers}/sidebar/sidebar.css +0 -0
- package/src/modules/{helpers → dxHelpers}/slds/slds.css +0 -0
- package/src/modules/{helpers → dxHelpers}/table/table.css +0 -0
- package/src/modules/{helpers → dxHelpers}/text/text.css +0 -0
- package/src/modules/dxUtils/analytics/analytics.ts +24 -0
- package/src/modules/{utils → dxUtils}/browser/browser.ts +0 -0
- package/src/modules/{utils → dxUtils}/constants/breakpoints.ts +0 -0
- package/src/modules/{utils → dxUtils}/constants/constants.ts +0 -0
- package/src/modules/{utils → dxUtils}/coveo/coveo.ts +0 -0
- package/src/modules/{utils → dxUtils}/css/css.ts +0 -0
- package/src/modules/{utils → dxUtils}/dates/dates.ts +0 -0
- package/src/modules/{utils → dxUtils}/devices/devices.ts +0 -0
- package/src/modules/{utils → dxUtils}/highlight/highlight.ts +1 -1
- package/src/modules/{utils → dxUtils}/normalizers/normalizers.ts +9 -21
- package/src/modules/{utils → dxUtils}/options/options.ts +0 -0
- package/src/modules/{utils → dxUtils}/prismjs/prismjs.html +0 -0
- package/src/modules/{utils → dxUtils}/prismjs/prismjs.ts +0 -0
- package/src/modules/{utils → dxUtils}/queryCoordinator/queryCoordinator.ts +0 -0
- package/src/modules/{utils → dxUtils}/recentSearches/recentSearches.ts +0 -0
- package/src/modules/{utils → dxUtils}/regexps/regexps.ts +0 -0
- package/src/modules/{utils → dxUtils}/seo/seo.ts +0 -0
- package/src/modules/{utils → dxUtils}/slot/slot.ts +0 -0
- package/src/modules/{utils → dxUtils}/wordpress/wordpress.ts +0 -0
- package/LICENSE +0 -12
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.css +0 -3
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.html +0 -16
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.ts +0 -29
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.css +0 -3
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.html +0 -12
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +0 -29
- package/src/modules/dx/contentArchive/contentArchive.css +0 -242
- package/src/modules/dx/contentArchive/contentArchive.html +0 -337
- package/src/modules/dx/contentArchive/contentArchive.ts +0 -457
- package/src/modules/dx/contentArchive/contentArchive.types.ts +0 -6
- package/src/modules/dx/instrumentation/instrumentation.html +0 -1
- package/src/modules/dx/instrumentation/instrumentation.ts +0 -116
- package/src/modules/dx/newsletterForm/newsletterForm.css +0 -73
- package/src/modules/dx/newsletterForm/newsletterForm.html +0 -73
- package/src/modules/dx/newsletterForm/newsletterForm.ts +0 -238
- package/src/modules/dx/podcastSubscription/podcastSubscription.css +0 -91
- package/src/modules/dx/podcastSubscription/podcastSubscription.html +0 -24
- package/src/modules/dx/podcastSubscription/podcastSubscription.ts +0 -52
- package/src/modules/dx/searchResults/coveo.css +0 -18989
- package/src/modules/dx/searchResults/searchResults.css +0 -387
- package/src/modules/dx/searchResults/searchResults.html +0 -104
- package/src/modules/dx/searchResults/searchResults.ts +0 -186
- package/src/modules/dx/slackCta/slackCta.css +0 -47
- package/src/modules/dx/slackCta/slackCta.html +0 -17
- package/src/modules/dx/slackCta/slackCta.ts +0 -12
- package/src/modules/utils/contentArchive/altData.js +0 -3
- package/src/modules/utils/contentArchive/contentArchive.ts +0 -163
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<form
|
|
3
|
-
onsubmit={handleSubmit}
|
|
4
|
-
onchange={handleChange}
|
|
5
|
-
onkeydown={handleKeyDown}
|
|
6
|
-
>
|
|
7
|
-
<slot name="form-heading">
|
|
8
|
-
<h4 class="newsletter-form-heading dx-text-heading-8">
|
|
9
|
-
Sign up now to receive the newsletter.
|
|
10
|
-
</h4>
|
|
11
|
-
</slot>
|
|
12
|
-
<dx-input
|
|
13
|
-
name="fname"
|
|
14
|
-
value={firstName}
|
|
15
|
-
placeholder="Your first name"
|
|
16
|
-
label="First Name"
|
|
17
|
-
onchange={handleChange}
|
|
18
|
-
missing-error-message="Enter your first name"
|
|
19
|
-
validity-on-blur="true"
|
|
20
|
-
required="true"
|
|
21
|
-
></dx-input>
|
|
22
|
-
<dx-input
|
|
23
|
-
name="lname"
|
|
24
|
-
value={lastName}
|
|
25
|
-
placeholder="Your last name"
|
|
26
|
-
label="Last Name"
|
|
27
|
-
onchange={handleChange}
|
|
28
|
-
missing-error-message="Enter your last name"
|
|
29
|
-
validity-on-blur="true"
|
|
30
|
-
required="true"
|
|
31
|
-
></dx-input>
|
|
32
|
-
<dx-input
|
|
33
|
-
name="email"
|
|
34
|
-
type="email"
|
|
35
|
-
value={email}
|
|
36
|
-
placeholder="Your email address"
|
|
37
|
-
label="Email"
|
|
38
|
-
onchange={handleChange}
|
|
39
|
-
missing-error-message="Enter your email address"
|
|
40
|
-
validity-on-blur="true"
|
|
41
|
-
required="true"
|
|
42
|
-
></dx-input>
|
|
43
|
-
<dx-select
|
|
44
|
-
name="country"
|
|
45
|
-
class="country-select"
|
|
46
|
-
label="Country/Region"
|
|
47
|
-
onchange={handleChange}
|
|
48
|
-
placeholder="Select your Country/Region"
|
|
49
|
-
message-when-value-missing="Select your country/region"
|
|
50
|
-
json-options={countries}
|
|
51
|
-
value={country}
|
|
52
|
-
required="true"
|
|
53
|
-
></dx-select>
|
|
54
|
-
<template if:true={checkboxTextSet}>
|
|
55
|
-
<template if:true={showMarketingCheckbox}>
|
|
56
|
-
<dx-checkbox
|
|
57
|
-
class="marketing-checkbox"
|
|
58
|
-
value={marketingText}
|
|
59
|
-
label={marketingText}
|
|
60
|
-
></dx-checkbox>
|
|
61
|
-
</template>
|
|
62
|
-
<p class="legal-text" lwc:dom="manual"></p>
|
|
63
|
-
<template if:true={showLegalCheckbox}>
|
|
64
|
-
<dx-checkbox
|
|
65
|
-
class="legal-checkbox"
|
|
66
|
-
value={legalText}
|
|
67
|
-
required="true"
|
|
68
|
-
></dx-checkbox>
|
|
69
|
-
</template>
|
|
70
|
-
</template>
|
|
71
|
-
<button class="form-submit" type="submit">Subscribe Now</button>
|
|
72
|
-
</form>
|
|
73
|
-
</template>
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import { LightningElement, api } from "lwc";
|
|
2
|
-
import { track } from "dx/instrumentation";
|
|
3
|
-
import { CountryOptions, CheckboxTextSet } from "typings/custom";
|
|
4
|
-
|
|
5
|
-
const ANALYTICS_INFO = {
|
|
6
|
-
itemTitle: "newsletter sign up submit",
|
|
7
|
-
formName: "newsletter",
|
|
8
|
-
formType: "newsletter",
|
|
9
|
-
method: "email",
|
|
10
|
-
destinationType: "internal",
|
|
11
|
-
clickText: "Subscribe Now",
|
|
12
|
-
clickUrl: "/newsletter/success",
|
|
13
|
-
elementType: "button",
|
|
14
|
-
ctaClick: true
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default class Form extends LightningElement {
|
|
18
|
-
@api checkboxTextSet: string = "";
|
|
19
|
-
@api countries: string = "";
|
|
20
|
-
|
|
21
|
-
private firstName: string = "";
|
|
22
|
-
private lastName: string = "";
|
|
23
|
-
private email: string = "";
|
|
24
|
-
private country: string = "";
|
|
25
|
-
|
|
26
|
-
private showLegalText: boolean = false;
|
|
27
|
-
private showLegalCheckbox: boolean = false;
|
|
28
|
-
private showMarketingCheckbox: boolean = false;
|
|
29
|
-
private legalText: string = "";
|
|
30
|
-
private marketingText: string | null = null;
|
|
31
|
-
private hasRendered: boolean = false;
|
|
32
|
-
|
|
33
|
-
renderedCallback() {
|
|
34
|
-
if (!this.hasRendered) {
|
|
35
|
-
// Focus the first input in the form
|
|
36
|
-
this.template.querySelector("dx-input")?.focus();
|
|
37
|
-
|
|
38
|
-
this.setInitialEmail();
|
|
39
|
-
this.hasRendered = true;
|
|
40
|
-
} else if (this.hasRendered && this.showLegalCheckbox) {
|
|
41
|
-
// Grab the legal checkbox and append the legal text as innerHTML (text has anchor links in it)
|
|
42
|
-
const legalCheckboxElement = this.template.querySelector(
|
|
43
|
-
"dx-checkbox.legal-checkbox"
|
|
44
|
-
);
|
|
45
|
-
const legalCheckboxSpan = document.createElement("span");
|
|
46
|
-
this.setInnerHtml(legalCheckboxSpan, this.legalText);
|
|
47
|
-
|
|
48
|
-
if (legalCheckboxElement) {
|
|
49
|
-
legalCheckboxElement.appendChild(legalCheckboxSpan);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
handleKeyDown(e: KeyboardEvent) {
|
|
55
|
-
if (e.key === "Enter") {
|
|
56
|
-
this.handleSubmit(e);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
handleChange(e: any) {
|
|
61
|
-
switch (e.target.name) {
|
|
62
|
-
case "fname":
|
|
63
|
-
this.firstName = e.target.value;
|
|
64
|
-
break;
|
|
65
|
-
case "lname":
|
|
66
|
-
this.lastName = e.target.value;
|
|
67
|
-
break;
|
|
68
|
-
case "email":
|
|
69
|
-
this.email = e.target.value;
|
|
70
|
-
break;
|
|
71
|
-
case "country":
|
|
72
|
-
this.country = e.target.value;
|
|
73
|
-
this.handleConsent(e.target);
|
|
74
|
-
break;
|
|
75
|
-
default:
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
handleSubmit(e: Event) {
|
|
81
|
-
e.preventDefault();
|
|
82
|
-
|
|
83
|
-
const allFormElements = Array.from(
|
|
84
|
-
this.template.querySelectorAll("dx-input, dx-select, dx-checkbox")
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const legalCheckboxElement = this.template.querySelector(
|
|
88
|
-
"dx-checkbox.legal-checkbox"
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
if (legalCheckboxElement) {
|
|
92
|
-
allFormElements.push(legalCheckboxElement);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const passed = !allFormElements
|
|
96
|
-
.map((formElement) => formElement.reportValidity())
|
|
97
|
-
.includes(false);
|
|
98
|
-
|
|
99
|
-
// All fields passed validation
|
|
100
|
-
if (passed) {
|
|
101
|
-
this.sendFormData();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
setInitialEmail() {
|
|
106
|
-
// Set email if provided in the query param
|
|
107
|
-
const queryString = window.location.search;
|
|
108
|
-
const urlParams = new URLSearchParams(queryString);
|
|
109
|
-
|
|
110
|
-
const subscriberEmail = urlParams.get("subscriberEmail");
|
|
111
|
-
|
|
112
|
-
if (subscriberEmail) {
|
|
113
|
-
this.email = subscriberEmail;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
getFormData() {
|
|
118
|
-
const marketingConsented = this.template.querySelector(
|
|
119
|
-
"dx-checkbox.marketing-checkbox"
|
|
120
|
-
)?.checked;
|
|
121
|
-
const date = new Date().toISOString();
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
InfoEmail: marketingConsented ? true : false,
|
|
125
|
-
"First Name": this.firstName,
|
|
126
|
-
"Last Name": this.lastName,
|
|
127
|
-
Consent: marketingConsented
|
|
128
|
-
? "Explicit"
|
|
129
|
-
: this.showMarketingCheckbox
|
|
130
|
-
? ""
|
|
131
|
-
: "Implied",
|
|
132
|
-
"Email Status Update": date,
|
|
133
|
-
email: this.email,
|
|
134
|
-
Country: this.country,
|
|
135
|
-
"Privacy Policy": true,
|
|
136
|
-
referrer: "footer"
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
async sendFormData() {
|
|
141
|
-
const formData = this.getFormData();
|
|
142
|
-
const errorMsg = "Error while subscribing to newsletter";
|
|
143
|
-
const submitButtonEl = this.template.querySelector(".form-submit");
|
|
144
|
-
|
|
145
|
-
submitButtonEl.setAttribute("disabled", "true");
|
|
146
|
-
submitButtonEl.textContent = "...Processing request";
|
|
147
|
-
|
|
148
|
-
try {
|
|
149
|
-
const res = await fetch("/pages/pardot/footer_optin", {
|
|
150
|
-
method: "POST",
|
|
151
|
-
headers: {
|
|
152
|
-
"Content-Type": "application/json"
|
|
153
|
-
},
|
|
154
|
-
body: JSON.stringify(formData)
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
if (!res.ok) {
|
|
158
|
-
throw new Error(errorMsg);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
const data = await res.json();
|
|
162
|
-
|
|
163
|
-
if (!data.success) {
|
|
164
|
-
throw new Error(errorMsg);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// GTM event
|
|
168
|
-
track(submitButtonEl, "custEv_formCompletion", ANALYTICS_INFO);
|
|
169
|
-
|
|
170
|
-
window.location.assign("/newsletter/success");
|
|
171
|
-
} catch (error) {
|
|
172
|
-
submitButtonEl.setAttribute("disabled", "false");
|
|
173
|
-
submitButtonEl.textContent = "Subscribe Now";
|
|
174
|
-
console.error(error);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
handleConsent(countrySelectElement: any) {
|
|
179
|
-
if (this.checkboxTextSet) {
|
|
180
|
-
const countryOptions = countrySelectElement.jsonOptions.find(
|
|
181
|
-
(jsonOption) => jsonOption.value === countrySelectElement.value
|
|
182
|
-
);
|
|
183
|
-
|
|
184
|
-
this.setLegalAndMarketingData(countryOptions);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
setLegalAndMarketingData(countryOptions: CountryOptions) {
|
|
189
|
-
// Parse the text sets for the checkbox info
|
|
190
|
-
const parsedCheckboxTextSet = JSON.parse(this.checkboxTextSet);
|
|
191
|
-
|
|
192
|
-
// Check for alternate text set or set to default
|
|
193
|
-
const checkboxTextSet = countryOptions.checkboxTextSet
|
|
194
|
-
? parsedCheckboxTextSet[countryOptions.checkboxTextSet]
|
|
195
|
-
: parsedCheckboxTextSet.default;
|
|
196
|
-
|
|
197
|
-
// Set the checkbox text
|
|
198
|
-
this.setCheckboxTextSet(checkboxTextSet);
|
|
199
|
-
|
|
200
|
-
// Toggle visibility of legal/marketing data
|
|
201
|
-
this.toggleLegalAndMarketingVisibility(
|
|
202
|
-
countryOptions.showLegalText,
|
|
203
|
-
countryOptions.showLegalCheckbox,
|
|
204
|
-
countryOptions.showMarketingCheckbox
|
|
205
|
-
);
|
|
206
|
-
|
|
207
|
-
// Grab the legal text paragraph element and set inner html (this is due to text having html elements in the string)
|
|
208
|
-
const legalTextElement = this.template.querySelector(".legal-text");
|
|
209
|
-
|
|
210
|
-
if (legalTextElement && this.showLegalText) {
|
|
211
|
-
this.setInnerHtml(legalTextElement, this.legalText);
|
|
212
|
-
} else if (legalTextElement && !this.showLegalText) {
|
|
213
|
-
// Clear legal text
|
|
214
|
-
this.setInnerHtml(legalTextElement, "");
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
setCheckboxTextSet(checkboxTextSet: CheckboxTextSet) {
|
|
219
|
-
this.legalText = checkboxTextSet.legalText;
|
|
220
|
-
this.marketingText = checkboxTextSet.marketingText;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
toggleLegalAndMarketingVisibility(
|
|
224
|
-
showLegalText: boolean,
|
|
225
|
-
showLegalCheckbox: boolean,
|
|
226
|
-
showMarketingCheckbox: boolean
|
|
227
|
-
) {
|
|
228
|
-
this.showLegalText = showLegalText;
|
|
229
|
-
this.showLegalCheckbox = showLegalCheckbox;
|
|
230
|
-
this.showMarketingCheckbox = showMarketingCheckbox;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
setInnerHtml(element: HTMLElement, value: string) {
|
|
234
|
-
// disable lwc warning because text received from json has HTML
|
|
235
|
-
// eslint-disable-next-line @lwc/lwc/no-inner-html
|
|
236
|
-
element.innerHTML = value;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
@import "helpers/reset";
|
|
2
|
-
@import "helpers/text";
|
|
3
|
-
|
|
4
|
-
.container {
|
|
5
|
-
background-repeat: no-repeat;
|
|
6
|
-
background-position: center;
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
flex-wrap: wrap;
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
text-align: center;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@media screen and (max-width: 768px) {
|
|
16
|
-
.container {
|
|
17
|
-
background-image: url("/assets/svg/podcast-subscription-clouds-small.svg");
|
|
18
|
-
background-size: auto 200px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.dx-text-heading-4 {
|
|
22
|
-
max-width: 28ex;
|
|
23
|
-
font-size: var(--dx-g-text-lg);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.badges {
|
|
27
|
-
margin: 8px auto 6px auto;
|
|
28
|
-
text-align: center;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.badges a {
|
|
32
|
-
display: inline-block;
|
|
33
|
-
margin: 4px auto;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.badges img {
|
|
37
|
-
width: 164px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.secondary-links {
|
|
41
|
-
display: none;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.or-wherever {
|
|
45
|
-
margin-top: 2px;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@media screen and (min-width: 768px) {
|
|
50
|
-
.container {
|
|
51
|
-
background-image: url("/assets/svg/podcast-subscription-clouds.svg");
|
|
52
|
-
min-height: 230px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.badges {
|
|
56
|
-
display: flex;
|
|
57
|
-
flex-direction: row;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.badges a {
|
|
61
|
-
display: inline-block;
|
|
62
|
-
margin: 22px 13px 8px 13px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.badges img {
|
|
66
|
-
height: 40px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.or-wherever {
|
|
70
|
-
display: none;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.secondary-links {
|
|
74
|
-
display: flex;
|
|
75
|
-
flex-direction: row;
|
|
76
|
-
justify-content: space-between;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.secondary-links li {
|
|
80
|
-
margin: 9px 6px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.secondary-links a {
|
|
84
|
-
color: var(--dx-g-blue-vibrant-50);
|
|
85
|
-
text-decoration: none;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.secondary-links a:hover {
|
|
89
|
-
text-decoration: underline;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="container">
|
|
3
|
-
<h2 class="dx-text-heading-4">
|
|
4
|
-
Tune in to the Salesforce Developers Podcast
|
|
5
|
-
</h2>
|
|
6
|
-
<ul class="badges">
|
|
7
|
-
<template for:each={badgeLinks} for:item="badgeLink">
|
|
8
|
-
<li key={badgeLink.href}>
|
|
9
|
-
<a href={badgeLink.href}>
|
|
10
|
-
<img src={badgeLink.imgSrc} alt={badgeLink.imgAlt} />
|
|
11
|
-
</a>
|
|
12
|
-
</li>
|
|
13
|
-
</template>
|
|
14
|
-
</ul>
|
|
15
|
-
<p class="or-wherever">Or wherever you listen to podcasts!</p>
|
|
16
|
-
<ul class="secondary-links">
|
|
17
|
-
<template for:each={secondaryLinks} for:item="secondaryLink">
|
|
18
|
-
<li key={secondaryLink.href}>
|
|
19
|
-
<a href={secondaryLink.href}>{secondaryLink.text}</a>
|
|
20
|
-
</li>
|
|
21
|
-
</template>
|
|
22
|
-
</ul>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { LightningElement } from "lwc";
|
|
2
|
-
|
|
3
|
-
export default class PodcastSubscription extends LightningElement {
|
|
4
|
-
badgeLinks = [
|
|
5
|
-
{
|
|
6
|
-
href: "https://podcasts.apple.com/us/podcast/salesforce-developer-podcast/id1482325260",
|
|
7
|
-
imgAlt: "Listen on Apple Podcasts",
|
|
8
|
-
imgSrc: "/assets/svg/podcasts-subscription-apple.svg"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
href: "https://www.google.com/podcasts?feed=aHR0cHM6Ly9zYWxlc2ZvcmNlZGV2cG9kY2FzdC5saWJzeW4uY29tL3Jzcw%3D%3D",
|
|
12
|
-
imgAlt: "Listen on Google Podcasts",
|
|
13
|
-
imgSrc: "/assets/svg/podcasts-subscription-google.svg"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
imgSrc: "/assets/svg/podcasts-subscription-spotify.svg",
|
|
17
|
-
imgAlt: "Listen on Spotify",
|
|
18
|
-
href: "https://open.spotify.com/show/75y378cB3FM6RQ8MGUDJ5M"
|
|
19
|
-
}
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
secondaryLinks = [
|
|
23
|
-
{
|
|
24
|
-
href: "https://app.stitcher.com/browse/feed/470480/details",
|
|
25
|
-
text: "Stitcher"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
href: "https://www.amazon.com/Emerald-City-Productions-Salesforce-Developer/dp/B082PPXMLN/",
|
|
29
|
-
text: "Alexa"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
href: "https://www.pandora.com/podcast/salesforce-developer-podcast/PC:34746",
|
|
33
|
-
text: "Pandora"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
href: "https://www.iheart.com/podcast/263-salesforce-developer-podca-56252827",
|
|
37
|
-
text: "iHeartRadio"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
href: "https://tunein.com/podcasts/Technology-Podcasts/Salesforce-Developer-Podcast-p1255006/",
|
|
41
|
-
text: "Tune-in"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
href: "https://player.fm/series/salesforce-developer-podcast",
|
|
45
|
-
text: "PlayerFM"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
href: "https://dev.to/salesforce_developers_podcast",
|
|
49
|
-
text: "dev.to"
|
|
50
|
-
}
|
|
51
|
-
];
|
|
52
|
-
}
|