Image Slider

Definition

<cst-img-slider>
<sub-theme/>
<sub-font/>
<sub-style/>
<sub-access/>
<sub-item/>
<sub-item/>
<sub-options />
<sub-help-icon/>
<sub-feature-flag/>
</cst-img-slider>

OR

<cst-element name="img-slider" schema="" schema-prop=""/>

Example

<cst-img-slider id="" >
<sub-theme name="" clr-var1="" clr-var2=""/>
<sub-font name="" font-var1="" font-var2=""/>
<sub-style name="" width="" height=""/>
<sub-access can-view="" can-modify=""/>
<sub-item text="" sub-text="" img-url="" link=""/>
<sub-item text="" sub-text="" img-url="" link=""/>
<sub-options items-prop="" item-text-prop="" item-sub-text-prop=""
item-img-url-prop="" item-link-prop="" navigation-type=""/>
<sub-help-icon name="" position="" title="" link="">
<sub-feature-flag is-aspect-ratio="">
</cst-img-slider>

Attributes

AttributeValueDescription
idstring typeIdentifier for component.
disabledboolean typeSpecifies if component should be disabled.(aurelia ext attribute)
classcst-marquee
Specifies class to be applied(Multiple classes can be given with space).

sub-theme

object typeSpecifies theme to be used for component.

sub-font

object typeSpecifies fonts to be used for component.

sub-style

object typeSpecifies style to be applied to component.

sub-options

object typeSpecifies the options of the component.

sub-help-icon

object typeSpecifies help icon to be displayed.

sub-feature-flag

objectSpecifies what features to enable/disable.
otherany typeAny other info.
schemaobject type Specifies JSON schema.
schema-propstring typeSpecifies property to be used to pick schema.

Sub element attributes

sub-theme

PropertyValueDescription
nameprimary(default)/secondary/customName of the theme.
clr-labelstring typeIf custom then specific/ named color variables

sub-font

PropertyValueDescription
nameroboto (default)/customName of the font
font-textstring typeIf custom then specific/ named font variables.
font-labelstring type
font-errorstring type

sub-style

PropertyValueDescription
namename of the styleName of design to be used.
widthpercentage/pixels/string(x-small,small,medium,large,x-large)Gives width/any other prop value

sub-options

PropertyValueDescription
items-propstring typeProperty of item array
item-text-propstring typeProperty of item's text, display as big title.
item-sub-text-propstring typeProperty of item's sub text, display normal text.
item-img-url-propstring typeProperty of item's image path.
item-link-propstring typeProperty of item's link click to redirect on particular link.
navigation-typestring type(below-image, over-image, as-side-image)Property to display navigation type of slider.

sub-help-icon

PropertyValueDescription
namestring typeIcon name.
positionleft/rightPosition of the icon.
titlestring typeIcon tooltip
linkstring typeLink to be opened on click.

sub-feature-flag

PropertyValueDescription
is-aspect-ratioboolean typeSpecifies the aspect ratio of the slider images

Schema Examples

Full schema

Fetch appropriate based on schemaProp

let schema = {
type: "object",
required: ["slider"], //= required
properties: {
slider: {
type: "string",
title:"Slider Images",//= label
cstAttr: {
raw:{ //loop & add to element
disabled : true,
class:'outline cst-class1'
},
subStyle:{ //loop & add to element style
name: '', // Default star
width:'',
height:'',
fontSize:''
},
subOptions:{
itemsProp: '',
itemTextProp: '',
itemSubTextProp: '',
itemLinkProp: '',
itemImgUrlProp: ''
},
subHelpIcon: {
name: '',
position: '',
title:'',
link:''
},
subFeatureFlag: {
isAspectRatio: false
},
subTheme:{
name:'',
clrLabel:''
},
subFont:{
name:'',
fontText:'',
fontLabel:'',
fontError:''
},
itemsSource: '', //to check in page object
itemsSourceAPI: '',
}
}
}
}
let schemaProp = 'slider';
let finalSchema = schemaProp ? schema.properties[schemaProp] : schema;
let data = [
{
text: '',
subText: '',
imgUrl: '',
link: ''
}
]

Exact schema

let schema = {
type: "string",
title: "Slider", //= label
cstAttr: {
}
}
let schemaProp = '';
let finalSchema = schemaProp ? schema.properties[schemaProp] : schema;

Nested object

Nested object schemaProp

let schema = {};
let schemaProp = 'EMDDetails.slider';
var finalSchema = schema;
let schemaPropSplits = schemaProp.split('.');
for(let prop of schemaPropSplits){
finalSchema = finalSchema.properties[schemaProp];
}

Material Measurement Guidelines

Events

AttributeDescription
onplayclickFires when the play button click.
onpauseclickFires when the pause button click.
onnextclickFires when the next button click.
onpreviousclickFires when the previous button click.
onhoverFires when the element's value hover.
onhoverleaveFires when the element's value hover leave.
oninvalidScript to be run when an element is invalid.

Event Method signature

method(parentRefObj, evtObj, elm, others)

Parameters description

ParameterValueDescription
parentRefObj
parentRefObj = {
parentContext,
loopParentContext,
doubleLoopParentContext
}
Parent Context references
evtObjobjectEvent object
elmobjectElement value
othersanyOther value

OverRidable Classes

  • cst-ovr-img-slider
  • cst-ovr-img-slider-txt
  • cst-ovr-img-slider-sub-txt
  • cst-ovr-img-slider-image

Unit Test Screenshots

Responsiveness Test Screenshots

Design Images

Demo link

Features

  • Display image slider as per given style