@salesforcedevs/dw-components 0.64.2 → 0.66.4

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/dw-components",
3
- "version": "0.64.2",
3
+ "version": "0.66.4",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -23,5 +23,5 @@
23
23
  "@types/lodash.orderby": "^4.6.7",
24
24
  "@types/lodash.uniqby": "^4.7.7"
25
25
  },
26
- "gitHead": "83352795bfa239002e9a56019761e74c542cf188"
26
+ "gitHead": "14d718be69bd8599b9ce3520a65dc8f0cb5f17de"
27
27
  }
@@ -17,13 +17,6 @@
17
17
  display: flex;
18
18
  }
19
19
 
20
- .filter-checkbox-group,
21
- .filter-button::part(container) {
22
- --dx-c-checkbox-text-transform: capitalize;
23
-
24
- text-transform: var(--dx-c-checkbox-text-transform);
25
- }
26
-
27
20
  .docs-action-bar .filters-container > *:not(:first-child),
28
21
  .docs-search-input {
29
22
  margin-left: var(--dx-g-spacing-sm);
@@ -503,8 +503,9 @@ export default abstract class DocsGrid extends LightningElement {
503
503
  const searchParams = qs.stringify(params);
504
504
 
505
505
  if (window.history.pushState) {
506
- const newurl = `${window.location.protocol}//${window.location.host}${window.location.pathname}?${searchParams}`;
507
- window.history.pushState({ path: newurl }, "", newurl);
506
+ const { protocol, host, pathname, hash } = window.location;
507
+ const path = `${protocol}//${host}${pathname}?${searchParams}${hash}`;
508
+ window.history.pushState({ path }, "", path);
508
509
  }
509
510
  }
510
511
 
@@ -52,6 +52,7 @@ dx-checkbox:last-of-type {
52
52
  cursor: pointer;
53
53
  }
54
54
 
55
+ .marketing-text,
55
56
  .legal-text {
56
57
  font-size: 14px;
57
58
  margin: 0 0 16px 0;
@@ -6,7 +6,7 @@
6
6
  >
7
7
  <slot name="form-heading">
8
8
  <h4 class="newsletter-form-heading dx-text-heading-8">
9
- Sign up now to receive the newsletter.
9
+ Sign up now to receive developer updates.
10
10
  </h4>
11
11
  </slot>
12
12
  <dx-input
@@ -52,13 +52,7 @@
52
52
  required="true"
53
53
  ></dx-select>
54
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>
55
+ <p class="marketing-text">{marketingText}</p>
62
56
  <p class="legal-text" lwc:dom="manual"></p>
63
57
  <template if:true={showLegalCheckbox}>
64
58
  <dx-checkbox
@@ -25,7 +25,6 @@ export default class Form extends LightningElement {
25
25
 
26
26
  private showLegalText: boolean = false;
27
27
  private showLegalCheckbox: boolean = false;
28
- private showMarketingCheckbox: boolean = false;
29
28
  private legalText: string = "";
30
29
  private marketingText: string | null = null;
31
30
  private hasRendered: boolean = false;
@@ -81,12 +80,14 @@ export default class Form extends LightningElement {
81
80
  e.preventDefault();
82
81
 
83
82
  const allFormElements = Array.from(
84
- this.template.querySelectorAll("dx-input, dx-select, dx-checkbox")
83
+ this.template.querySelectorAll<HTMLFormElement>(
84
+ "dx-input, dx-select, dx-checkbox"
85
+ )
85
86
  );
86
87
 
87
88
  const legalCheckboxElement = this.template.querySelector(
88
89
  "dx-checkbox.legal-checkbox"
89
- );
90
+ ) as HTMLFormElement;
90
91
 
91
92
  if (legalCheckboxElement) {
92
93
  allFormElements.push(legalCheckboxElement);
@@ -115,20 +116,13 @@ export default class Form extends LightningElement {
115
116
  }
116
117
 
117
118
  getFormData() {
118
- const marketingConsented = this.template.querySelector(
119
- "dx-checkbox.marketing-checkbox"
120
- )?.checked;
121
119
  const date = new Date().toISOString();
122
120
 
123
121
  return {
124
- InfoEmail: marketingConsented ? true : false,
122
+ InfoEmail: true,
125
123
  "First Name": this.firstName,
126
124
  "Last Name": this.lastName,
127
- Consent: marketingConsented
128
- ? "Explicit"
129
- : this.showMarketingCheckbox
130
- ? ""
131
- : "Implied",
125
+ Consent: "Implied",
132
126
  "Email Status Update": date,
133
127
  email: this.email,
134
128
  Country: this.country,
@@ -140,7 +134,9 @@ export default class Form extends LightningElement {
140
134
  async sendFormData() {
141
135
  const formData = this.getFormData();
142
136
  const errorMsg = "Error while subscribing to newsletter";
143
- const submitButtonEl = this.template.querySelector(".form-submit");
137
+ const submitButtonEl = this.template.querySelector(
138
+ ".form-submit"
139
+ ) as HTMLFormElement;
144
140
 
145
141
  submitButtonEl.setAttribute("disabled", "true");
146
142
  submitButtonEl.textContent = "...Processing request";
@@ -169,8 +165,10 @@ export default class Form extends LightningElement {
169
165
 
170
166
  window.location.assign("/newsletter/success");
171
167
  } catch (error) {
172
- submitButtonEl.setAttribute("disabled", "false");
173
- submitButtonEl.textContent = "Subscribe Now";
168
+ if (submitButtonEl) {
169
+ submitButtonEl.setAttribute("disabled", "false");
170
+ submitButtonEl.textContent = "Subscribe Now";
171
+ }
174
172
  console.error(error);
175
173
  }
176
174
  }
@@ -178,7 +176,7 @@ export default class Form extends LightningElement {
178
176
  handleConsent(countrySelectElement: any) {
179
177
  if (this.checkboxTextSet) {
180
178
  const countryOptions = countrySelectElement.options.find(
181
- (option) => option.value === countrySelectElement.value
179
+ (option: any) => option.value === countrySelectElement.value
182
180
  );
183
181
 
184
182
  this.setLegalAndMarketingData(countryOptions);
@@ -200,8 +198,7 @@ export default class Form extends LightningElement {
200
198
  // Toggle visibility of legal/marketing data
201
199
  this.toggleLegalAndMarketingVisibility(
202
200
  countryOptions.showLegalText,
203
- countryOptions.showLegalCheckbox,
204
- countryOptions.showMarketingCheckbox
201
+ countryOptions.showLegalCheckbox
205
202
  );
206
203
 
207
204
  // Grab the legal text paragraph element and set inner html (this is due to text having html elements in the string)
@@ -222,12 +219,10 @@ export default class Form extends LightningElement {
222
219
 
223
220
  toggleLegalAndMarketingVisibility(
224
221
  showLegalText: boolean,
225
- showLegalCheckbox: boolean,
226
- showMarketingCheckbox: boolean
222
+ showLegalCheckbox: boolean
227
223
  ) {
228
224
  this.showLegalText = showLegalText;
229
225
  this.showLegalCheckbox = showLegalCheckbox;
230
- this.showMarketingCheckbox = showMarketingCheckbox;
231
226
  }
232
227
 
233
228
  setInnerHtml(element: HTMLElement, value: string) {