@salesforcedevs/dw-components 1.3.180-canary.0 → 1.3.180-canary.1

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": "1.3.180-canary.0",
3
+ "version": "1.3.180-canary.1",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -16,8 +16,8 @@
16
16
  has-already-registered={hasAlreadyRegistered}
17
17
  is-loading={isLoading}
18
18
  oncountrychange={handleCountryChange}
19
- ongetstarted={handleGetStarted}
20
19
  onformsubmit={handleFormSubmit}
20
+ ongetstarted={handleGetStarted}
21
21
  recaptcha-token={recaptchaToken}
22
22
  selected-country={selectedCountry}
23
23
  step-datum={stepDatum}
@@ -47,7 +47,7 @@
47
47
  <dx-button
48
48
  if:true={showPrimaryAction}
49
49
  class="primary-action"
50
- disabled={isJ2sFormInvalid}
50
+ disabled={isPrimaryActionDisabled}
51
51
  href={primaryActionLink}
52
52
  icon-sprite={stepDatum.primaryAction.iconSprite}
53
53
  icon-symbol={stepDatum.primaryAction.iconSymbol}
@@ -21,7 +21,7 @@ export default class J2sCardSequenceStep extends LightningElement {
21
21
  )?.notifySubmitFailure(formFailureData);
22
22
  }
23
23
 
24
- private _isJ2sFormInvalid = false;
24
+ private isJ2sFormInvalid = false;
25
25
 
26
26
  private get stepClassName() {
27
27
  return this.stepIndex === 2 && this.selectedCountry === "IN"
@@ -29,15 +29,12 @@ export default class J2sCardSequenceStep extends LightningElement {
29
29
  : "";
30
30
  }
31
31
 
32
- private get isJ2sFormInvalid() {
32
+ private get isPrimaryActionDisabled() {
33
33
  return (
34
- this.hasAlreadyRegistered ||
35
- (this.stepIndex === 1 && this._isJ2sFormInvalid)
34
+ this.stepIndex === 1 &&
35
+ (this.hasAlreadyRegistered || this.isJ2sFormInvalid)
36
36
  );
37
37
  }
38
- private set isJ2sFormInvalid(value: boolean) {
39
- this._isJ2sFormInvalid = value;
40
- }
41
38
 
42
39
  private get primaryActionLink() {
43
40
  const { link } = this.stepDatum.primaryAction;
@@ -54,10 +51,9 @@ export default class J2sCardSequenceStep extends LightningElement {
54
51
  }
55
52
 
56
53
  private get primaryActionVariant() {
57
- if (this.stepIndex === 1 && this.isJ2sFormInvalid) {
58
- return "custom"; // override for disabled button styling
59
- }
60
- return this.stepDatum.primaryAction.variant;
54
+ return this.isPrimaryActionDisabled
55
+ ? "custom"
56
+ : this.stepDatum.primaryAction.variant;
61
57
  }
62
58
 
63
59
  private get primaryActionLinkTarget() {
@@ -85,7 +81,7 @@ export default class J2sCardSequenceStep extends LightningElement {
85
81
 
86
82
  if (this.stepIndex === 0) {
87
83
  this.dispatchEvent(new CustomEvent("getstarted"));
88
- } else if (this.stepIndex === 1 && !this.isJ2sFormInvalid) {
84
+ } else if (this.stepIndex === 1) {
89
85
  const j2sFormEl = this.template.querySelector(
90
86
  "dw-j2s-form"
91
87
  ) as unknown as J2sForm;