@4site/engrid-scripts 0.21.3 → 0.21.5

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.
@@ -1,4 +1,5 @@
1
1
  export declare class DebugHiddenFields {
2
2
  private logger;
3
+ private ignoreFields;
3
4
  constructor();
4
5
  }
@@ -3,6 +3,7 @@ import { EngridLogger } from ".";
3
3
  export class DebugHiddenFields {
4
4
  constructor() {
5
5
  this.logger = new EngridLogger("Debug hidden fields", "#f0f0f0", "#ff0000", "🫣");
6
+ this.ignoreFields = ["transaction.paycurrency"];
6
7
  // Query all hidden input elements within the specified selectors
7
8
  const fields = document.querySelectorAll(".en__component--row [type='hidden'][class*='en_'], .engrid-added-input[type='hidden']");
8
9
  // Check if there are any hidden fields
@@ -15,6 +16,11 @@ export class DebugHiddenFields {
15
16
  .join(", ")}`);
16
17
  // Iterate through each hidden input element
17
18
  fields.forEach((el) => {
19
+ // Check if the field name is in the ignore list
20
+ if (this.ignoreFields.includes(el.name)) {
21
+ this.logger.log(`Ignoring field: ${el.name} because it is in the ignore list`);
22
+ return;
23
+ }
18
24
  // Change the input type to 'text' and add the required classes
19
25
  el.type = "text";
20
26
  el.classList.add("en__field__input", "en__field__input--text");
package/dist/engrid.js CHANGED
@@ -192,6 +192,7 @@ export class ENGrid {
192
192
  static getPageType() {
193
193
  if ("pageJson" in window && "pageType" in window.pageJson) {
194
194
  switch (window.pageJson.pageType) {
195
+ case "p2pdonation":
195
196
  case "donation":
196
197
  case "premiumgift":
197
198
  return "DONATION";
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const AppVersion = "0.21.3";
1
+ export declare const AppVersion = "0.21.5";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const AppVersion = "0.21.3";
1
+ export const AppVersion = "0.21.5";
package/dist/vgs.js CHANGED
@@ -224,9 +224,9 @@ export class VGS {
224
224
  this.paymentTypeField.value.toLowerCase() === "visa" ||
225
225
  this.paymentTypeField.value.toLowerCase() === "vi") {
226
226
  const cardContainer = document.querySelector(".en__field--vgs.en__field--ccnumber");
227
- const cardEmpty = cardContainer.querySelector(".vgs-collect-container__empty");
227
+ const cardEmpty = cardContainer === null || cardContainer === void 0 ? void 0 : cardContainer.querySelector(".vgs-collect-container__empty");
228
228
  const cvvContainer = document.querySelector(".en__field--vgs.en__field--ccvv");
229
- const cvvEmpty = cvvContainer.querySelector(".vgs-collect-container__empty");
229
+ const cvvEmpty = cvvContainer === null || cvvContainer === void 0 ? void 0 : cvvContainer.querySelector(".vgs-collect-container__empty");
230
230
  if (cardContainer && cardEmpty) {
231
231
  window.setTimeout(() => {
232
232
  ENGrid.setError(cardContainer, "Please enter a valid card number");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4site/engrid-scripts",
3
- "version": "0.21.3",
3
+ "version": "0.21.5",
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": "b08a21c0b98b990da83331fd9cb01480a7c6f349",
28
+ "gitHead": "2c89d4c70658b490c060ab0db3a6a244f9611ec9",
29
29
  "devDependencies": {
30
30
  "nodemon": "^2.0.20"
31
31
  }