VlocityDCOfferAttributeConfig

VlocityDCOfferAttributeConfig

vlocity-dc-offer-attribute-config is a web component for displaying attribute values and allows the user to choose only one of a predefined set of options.

Features
1.Display attribute value
2.Allow user to choose only one of a predefined set of options

Constructor

new VlocityDCOfferAttributeConfig()

Properties:
Name Type Description
offerAttribute Array.<OfferAttributeObject> attrbutes of an offer.
Properties
Name Type Description
attributeId String indicates attribute id.
inputType String indicates input type.
label String indicates color label.
multiselect String
userValues String
values Array.<OfferAttributeValueObject>
Properties
Name Type Description
value String attribute value.
disabled String is attribute disabled.
readonly String indicates if attribute is read only.
Example
Sample Usage -

Include the component in your template simply by adding vlocity-dc-offer-attribute-config custom tag

<vlocity-dc-offer-attribute-config .offerAttribute="${offerAttributes}"></vlocity-dc-offer-attribute-config>

  | Attribute Name    | Type Expected                                                                   | Required |
  |-------------------|---------------------------------------------------------------------------------|----------|
  | offerAttribute    | It expects value in OfferAttributeObject format                                 | required |

 --------------------------------------------------------------------------------------------------------------------------------------

 KEY INFO -

 events fired :
               | Event Name                       | Description                                     |
               |----------------------------------|-------------------------------------------------|
               | vlocity-dc-configure-offer       | Event triggered when Addon button is clicked    |

 events registered : none

 Dependency - vlocity-dc-offer-attribute-config is a component that is commnoly used as a child of vlocity-dc-offer-config-details
 but it can also be used as an independent component.

               | Parent Component                  | Expected Child Component  |
               |-----------------------------------|---------------------------|
               | vlocity-dc-offer-config-details   | none                      |

Sample with slots -

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

List of available slots -

| Slot names                  | Dynamic     | Description                 | Impact                             |
|-----------------------------|-------------|------------------------------------------------------------------|
| dc-offer-attribute-wrapper  | -           | Wrapper for component       | Will replace complete template DOM |

Extends

  • LitElement

Members

(static, readonly) properties

Properties that will be available in the binding system
Properties:
Name Type Description
colorAttributes configAttributes configurable attribute object of an offer

Methods

(static) connectedCallback()

Invoked when vlocity-dc-offer-attribute-config component is added to the document’s DOM.

(static) selectProductConfig(selectedAttrValue, isReadOnly)

This function is called on change of selected attribute.
Parameters:
Name Type Description
selectedAttrValue string selected attribute value
isReadOnly Boolean attribute read only flag