@salesforcedevs/dw-components
Advanced tools
Comparing version 1.3.252 to 1.3.256
{ | ||
"name": "@salesforcedevs/dw-components", | ||
"version": "1.3.252", | ||
"version": "1.3.256", | ||
"description": "Lightning web components for https://developer.salesforce.com", | ||
@@ -27,3 +27,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "8379eb747571af22dfdfc3c440e8c23c85d1fe8b" | ||
"gitHead": "c0afc0d0174da7941a7955691f2cc0c0efe69620" | ||
} |
@@ -6,2 +6,3 @@ import { api, LightningElement } from "lwc"; | ||
import J2sCardSequenceStep from "dw/j2sCardSequenceStep"; | ||
import { AlertInfo } from "typings/custom"; | ||
@@ -22,4 +23,4 @@ const DRM_SUCCESS_STRING = "success"; | ||
notAvailableAlertInfo?: { | ||
title: string; | ||
body: string; | ||
default: AlertInfo; | ||
[key: string]: AlertInfo; | ||
}; | ||
@@ -26,0 +27,0 @@ participatingCountryCodes?: string[]; |
import { toJson } from "dxUtils/normalizers"; | ||
import { stateMap } from "dwUtils/forms"; | ||
import { DateTime } from "luxon"; | ||
import { api } from "lwc"; | ||
@@ -8,2 +9,6 @@ import debounce from "debounce"; | ||
const closingTimeUSCanada = DateTime.fromISO("2024-05-09", { | ||
zone: "America/Los_Angeles" | ||
}); | ||
// Hard-coding for now because we can't get information about an endpoint for this | ||
@@ -100,3 +105,2 @@ const tbidValidRoles = [ | ||
private participatingCountryCodes = ["US", "CA", "IN"]; | ||
private countriesWithReferralInput = ["IN"]; | ||
@@ -106,2 +110,9 @@ private requiredFormFields: HTMLElement[] = []; | ||
get participatingCountryCodes() { | ||
if (DateTime.local() >= closingTimeUSCanada) { | ||
return ["IN"]; | ||
} | ||
return ["US", "CA", "IN"]; | ||
} | ||
get isNotParticipatingCountry() { | ||
@@ -130,3 +141,5 @@ return !this.isParticipatingCountry(this.state.MailingCountry); | ||
get notAvailableAlertInfo() { | ||
return this.formMetadata.notAvailableAlertInfo; | ||
return this.formMetadata.notAvailableAlertInfo[ | ||
this.state.MailingCountry || "default" | ||
]; | ||
} | ||
@@ -260,6 +273,4 @@ | ||
const { target = {}, detail } = evt; | ||
const { | ||
name: targetName, | ||
required: isRequiredField | ||
} = target as HTMLInputElement; | ||
const { name: targetName, required: isRequiredField } = | ||
target as HTMLInputElement; | ||
const value = | ||
@@ -266,0 +277,0 @@ typeof detail === "string" |
502353
9225