VlocityDCSignin

VlocityDCSignin

VlocityDCSignin is the component for sign-in or sign-up.

DCSignIn methods
1. handleSignUpFormChange - Method to handle signup input fields onchange event.
2. handleSignInFormChange - Method to handle signin input fields onchange event.
3. getValidEmail - Method to check given email is valid or not.
4. checkValidationErrors - Method to check form input values are valid or not.
5. doSignIn - Method to call SDK method for signIn.
6. routeToCheckout - Method to fire event to the parent.
7. doSignUp - Method to call SDK method for signup.
8. signUpGetInput - filling the input payload for the SDK call.
9. signUpPreHook - prehook of SDK call.
10. signUpPostHook - posthook of SDK call.
11. signInGetInput - filling the input payload for the SDK call.
12. signInPreHook - prehook of SDK call.
13. signInPostHook - posthook of SDK call.
14. handleSignUpFailure - handle SDK failures.
15. handleLoginFailure - handle SDK failures.
16. signInProcessResponse - process signIn SDK call response.
17. signUpProcessResponse - process signUp SDK call response.
18. signInPreSDKCalls - function is used to do any changes prior to sdk calls.
19. signUpPreSDKCalls - function is used to do any changes prior to sdk calls.
20. signInSDKCall - function is used to do actual sdk calls.
21. signUpSDKCall - function is used to do actual sdk calls.
Features
1. Login/signup.

Constructor

new VlocityDCSignin()

Example
Sample Usage -

Include the component in your template by adding <vlocity-dc-signin> custom tag
   
<vlocity-dc-signin></vlocity-dc-signin>

KEY INFO -

 events fired : "vlocity-dc-checkout-success"

 events registered :
    | Event Name               | Event source component      | Callback Function  | Description              |
    |--------------------------|-----------------------------|--------------------|--------------------------|
    | vlocity-dc-sign-in       | vlocity-dc-checkout         | doSignIn()          | Event triggered to login |

 Dependency - vlocity-dc-signin is an independent component and has no dependency on any parent component.

Sample with slots -

<vlocity-dc-signin>
   <span slot="{slot_name}">
     Custom HTML elements goes here
   </span>
</vlocity-dc-signin>

List of available slots -

| Slot names             | Dynamic     | Description                     | Impact                       |
|------------------------|-------------|---------------------------------|------------------------------|
| dc-login-radio-toggle  | -           | Wrapper for login radio buttons | Replaces login radio buttons |
| dc-sign-up             | -           | Wrapper for sign-up form        | Replaces sign-up form        |
| dc-sign-up             | -           | Wrapper for sign-in form        | Replaces sign-in form        |

Extends

  • LitElement

Methods

(static) checkValidationErrors()

Method to validate the form inputs.

(async, static) doSignIn()

Method to do the login.

(async, static) doSignUp()

Method to do the sign-up.

(static) getValidEmail(String)

Method to check given input is valid email or not.
Parameters:
Name Type Description
String email

(static) handleLoginFailure()

A custom function to be used by customers for handling api failures

(static) handleSignInFormChange(Object)

Method to handle sign-in form changes.
Parameters:
Name Type Description
Object event

(static) handleSignUpFailure()

A custom function to be used by customers for handling api failures

(static) signInPostHook()

A custom function to be used by customers for customisation, any custom action after fetch offers call can be written here

(static) signInPreHook()

A custom function to be used by customers for customisation, any custom action prior to fetch offers call can be written here

(static) signInPreSDKCalls()

This function is used to do any changes prior to sdk calls

(static) signInProcessResponse(response)

This function is used to process signIn response
Parameters:
Name Type Description
response object Response Object from SDK call.

(static) signInSDKCall()

This function is used to do actual sdk calls

(static) signUpGetInput()

Function to fetch the sign in user sdk call inputs

(static) signUpPostHook()

A custom function to be used by customers for customisation, any custom action after fetch offers call can be written here

(static) signUpPreSDKCalls()

This function is used to do any changes prior to sdk calls

(static) signUpProcessResponse(response)

This function is used to process signUp response
Parameters:
Name Type Description
response object Response Object from SDK call.

(static) signUpSDKCall()

This function is used to do actual sdk calls