@4site/engrid-scripts 0.23.2 → 0.23.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/dist/app.js CHANGED
@@ -74,6 +74,7 @@ export class App extends ENGrid {
74
74
  new ShowHideRadioCheckboxes("transaction.giveBySelect", "giveBySelect-");
75
75
  new ShowHideRadioCheckboxes("transaction.inmem", "inmem-");
76
76
  new ShowHideRadioCheckboxes("transaction.recurrpay", "recurrpay-");
77
+ new ShowHideRadioCheckboxes("transaction.shipenabled", "shipenabled-");
77
78
  // Automatically show/hide all radios
78
79
  let radioFields = [];
79
80
  const allRadios = document.querySelectorAll("input[type=radio]");
@@ -94,8 +94,20 @@ export class EmbeddedEcard {
94
94
  return iframe;
95
95
  }
96
96
  addEventListeners() {
97
+ var _a;
97
98
  const sendEcardCheckbox = document.getElementById("en__field_embedded-ecard");
98
- this.toggleEcardForm(sendEcardCheckbox.checked);
99
+ if (this.options.requireInMemCheckbox) {
100
+ const inMemoriamCheckbox = document.getElementById("en__field_transaction_inmem");
101
+ inMemoriamCheckbox === null || inMemoriamCheckbox === void 0 ? void 0 : inMemoriamCheckbox.addEventListener("change", (e) => {
102
+ const checkbox = e.target;
103
+ const _sendEcardCheckbox = document.getElementById("en__field_embedded-ecard");
104
+ this.toggleEcardForm(checkbox.checked && _sendEcardCheckbox.checked);
105
+ });
106
+ this.toggleEcardForm(((_a = inMemoriamCheckbox === null || inMemoriamCheckbox === void 0 ? void 0 : inMemoriamCheckbox.checked) !== null && _a !== void 0 ? _a : true) && sendEcardCheckbox.checked);
107
+ }
108
+ else {
109
+ this.toggleEcardForm(sendEcardCheckbox.checked);
110
+ }
99
111
  sendEcardCheckbox === null || sendEcardCheckbox === void 0 ? void 0 : sendEcardCheckbox.addEventListener("change", (e) => {
100
112
  const checkbox = e.target;
101
113
  this.toggleEcardForm(checkbox.checked);
@@ -4,5 +4,6 @@ export interface EmbeddedEcardOptions {
4
4
  checkboxText: string;
5
5
  anchor: string;
6
6
  placement: string;
7
+ requireInMemCheckbox: boolean;
7
8
  }
8
9
  export declare const EmbeddedEcardOptionsDefaults: EmbeddedEcardOptions;
@@ -4,4 +4,5 @@ export const EmbeddedEcardOptionsDefaults = {
4
4
  checkboxText: "Yes, I would like to send an ecard to announce my gift.",
5
5
  anchor: ".en__field--donationAmt",
6
6
  placement: "afterend",
7
+ requireInMemCheckbox: false,
7
8
  };
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const AppVersion = "0.23.2";
1
+ export declare const AppVersion = "0.23.4";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const AppVersion = "0.23.2";
1
+ export const AppVersion = "0.23.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4site/engrid-scripts",
3
- "version": "0.23.2",
3
+ "version": "0.23.4",
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": "7f5ab2b32142ec7a5885fea3354370a4bad06cce",
28
+ "gitHead": "4d66eb24160b1946e151ef2c6ee8a713e36e2800",
29
29
  "devDependencies": {
30
30
  "nodemon": "^2.0.20"
31
31
  }