@4site/engrid-scripts 0.19.14 → 0.19.18

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.
@@ -2,4 +2,5 @@ export declare class DataAttributes {
2
2
  private _country;
3
3
  constructor();
4
4
  private setDataAttributes;
5
+ private addFrequencyDataAttribute;
5
6
  }
@@ -133,5 +133,19 @@ export class DataAttributes {
133
133
  if (!CSS.supports("selector(:has(*))")) {
134
134
  ENGrid.setBodyData("css-has-selector", "false");
135
135
  }
136
+ if (ENGrid.getPageType() === "DONATION") {
137
+ this.addFrequencyDataAttribute();
138
+ }
139
+ }
140
+ // Add a data attribute to the body tag with how many visible frequency options there are
141
+ addFrequencyDataAttribute() {
142
+ const frequencyOptions = document.querySelectorAll(".en__field--recurrfreq .en__field__item label.en__field__label");
143
+ let visibleFrequencyOptions = 0;
144
+ frequencyOptions.forEach((option) => {
145
+ if (ENGrid.isVisible(option)) {
146
+ visibleFrequencyOptions++;
147
+ }
148
+ });
149
+ ENGrid.setBodyData("visible-frequency", visibleFrequencyOptions.toString());
136
150
  }
137
151
  }
@@ -18,8 +18,10 @@ export class InputPlaceholders {
18
18
  "input#en__field_supporter_emailAddress": "Email Address",
19
19
  "input#en__field_supporter_phoneNumber": "Phone Number (Optional)",
20
20
  ".en__mandatory input#en__field_supporter_phoneNumber": "Phone Number",
21
+ ".required-if-visible input#en__field_supporter_phoneNumber": "Phone Number",
21
22
  "input#en__field_supporter_phoneNumber2": "000-000-0000 (Optional)",
22
23
  ".en__mandatory input#en__field_supporter_phoneNumber2": "000-000-0000",
24
+ ".required-if-visible input#en__field_supporter_phoneNumber2": "000-000-0000",
23
25
  "input#en__field_supporter_country": "Country",
24
26
  "input#en__field_supporter_address1": "Street Address",
25
27
  "input#en__field_supporter_address2": "Apt., Ste., Bldg.",
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const AppVersion = "0.19.14";
1
+ export declare const AppVersion = "0.19.18";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const AppVersion = "0.19.14";
1
+ export const AppVersion = "0.19.18";
@@ -51,6 +51,7 @@ export class WelcomeBack {
51
51
  }
52
52
  shouldRun() {
53
53
  return (!!document.querySelector(".fast-personal-details") &&
54
+ ENGrid.getBodyData("embedded") !== "thank-you-page-donation" &&
54
55
  this.options !== false);
55
56
  }
56
57
  addWelcomeBack() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4site/engrid-scripts",
3
- "version": "0.19.14",
3
+ "version": "0.19.18",
4
4
  "description": "Scripts for the ENGRID Project",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "strongly-typed-events": "^2.0.9"
26
26
  },
27
27
  "homepage": "https://github.com/4site-interactive-studios/engrid#readme",
28
- "gitHead": "15f7f50a88b04c675f65c35e03cc663ba7110d4e",
28
+ "gitHead": "a1413fbe71a88aa0959bb8f07266c8998dcb0c1a",
29
29
  "devDependencies": {
30
30
  "nodemon": "^2.0.20"
31
31
  }