Protected
bindProtected
componentOptional
configOptional instance-level configuration to override the global configuration
Protected
Optional
contentThe data bound to the Handlebars template.
Optional
dataThe data bound to the component.
Protected
defaultProtected
handlebarsThe Handlebars reference shared by all HawkSearch components.
Protected
configurationThe optional configuration object for this component.
The root element which should be used for querying any child elements. This resolves to this.shadowRoot
if the Shadow DOM is enabled, otherwise this
.
Protected
bindProtected
getProtected
interpolateReplaces placeholders in a given string with values from a data object.
The template string.
The object containing properties which will be bound to template
.
The template
string with all placeholders replaced by the values specified in values
.
Protected
onProtected
registerOptional method that can be overwritten to register Handlebars helper functions which can be accessed from the template. For more information, see Custom Helpers.
Binds contentModel to the Handlebars template and renders the resulting HTML content.
Protected
renderDetermines whether the data meets the necessary conditions to perform data binding and render content.
Whether the component should be rendered. If false
, the component will have empty contents and be set to display: none;
.
Protected
trigger
The Rating component is used to display a visual representation of ratings for a particular product.
Tag
The tag for this component is
<hawksearch-rating>
.Attributes
number
These attributes are used to position the tooltip based on the size and scroll position of the active window. The
hawksearch-tooltip
attribute should be present on an element containing both the element the tooltip is attached to (to display on hover) and the element containing the tooltip content, which should have ahawksearch-tooltip-content
attribute.Handlebars Helpers
number
number
This helper function returns the icon name to display for a given rating and star number (1-5)
Default Template
The following is the default Handlebars template for this component. To create a custom template, it is recommended to use this as a starting point.