Constructor
new DCSignIn()
Example
Sample Usage -
Include the component in your template by adding <c-dc-sign-in> custom tag
<c-dc-sign-in checkout-api-url="URL"></c-dc-sign-in>
KEY INFO -
events fired : "vlocity-dc-checkout-success"
events registered :
| Event Name | Event source component | Callback Function | Description |
|--------------------------|-----------------------------|--------------------|--------------------------|
| vlocity-dc-sign-in | c-dc-check-out | doSignIn() | Event triggered to login |
Dependency - c-dc-sign-in is an independent component and has no dependency on any parent component.
Sample with slots -
<c-dc-sign-in>
<span slot="{slot_name}">
Custom HTML elements goes here
</span>
</c-dc-sign-in>
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
Methods
(static) checkValidationErrors()
Method to validate the form inputs.
(static) disconnectedCallback()
disconnectedCallback () is invoked when c-dc-sign-in is removed from the document’s DOM.
(async, static) doSignIn()
Method to do the login.
(async, static) doSignUp()
Method to do the sign-up.
(static) getSDKInstance()
Method to get digital commerce SDK instance.
(static) getValidEmail(String)
Method to check given input is valid email or not.
Parameters:
Name | Type | Description |
---|---|---|
String |
(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) handleSignUpFormChange(Object)
Method to handle sign-up form changes.
Parameters:
Name | Type | Description |
---|---|---|
Object |
event |
(static) loadTranslationLabels()
Method to load translation labels.
(static) routeToCheckout(Object)
Method to trigger pubsub event to the parent
Parameters:
Name | Type | Description |
---|---|---|
Object |
payload |
(static) signInGetInput()
Function to fetch the sign in user sdk call inputs
(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) signUpPreHook()
A custom function to be used by customers for customisation, any custom action prior to 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
(static) toggleSignInForm(Object)
Method to toggle sign-up / sign-in form layout
Parameters:
Name | Type | Description |
---|---|---|
Object |
event |