Block Group

  • Graphics Link

Definition

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

OR

<cst-element name="block-group" schema="" schema-prop="" value=""/>

Example

<cst-block-group id="" value="">
<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="" id="" icon-name="" lr-icons=""/>
<sub-item text="" id="" icon-name="" lr-icons=""/>
<sub-options items-prop="" item-text-prop="" item-id-prop=""
item-icon-name-prop="" lr-icons-prop="" />
<sub-help-icon name="" position="" title="" link="">
<sub-feature-flag allow-icon="">
</cst-block-group>

Attributes

AttributeValueDescription
idstring typeIdentifier for component.
valuestring typeSpecifies the selected item's id for component.(two way bind attribute)
requiredboolean typeSpecifies if field must be required.
disabledboolean typeSpecifies if component should be disabled.(aurelia ext attribute)
classcst-block-group
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-id-propstring typeProperty of item's id.
item-text-propstring typeProperty of item's text, display as label.
item-icon-propstring typeProperty of item's icon which will displays at top center of the component
item-lr-icons-propstring typeDisplays the icons near to the item text

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
allow-iconboolean typeSpecifies to display icon as per selected value if allow-range = false

Schema Examples

Full schema

Fetch appropriate based on schemaProp

let schema = {
type: "object",
required: ["feedbackId"], //= required
properties: {
feedbackId: {
type: "string",
title:"Rate Us",//= label
cstAttr: {
raw:{ //loop & add to element
disabled : true,
class:'outline cst-class1',
required: true
},
subStyle:{ //loop & add to element style
name: '',
width:'',
height:'',
fontSize:''
},
subOptions:{
itemsProp: '',
itemIdProp: '',
itemTextProp: '',
// Display icon at top center,
// if allow icon is true, it will display only icons
itemIconProp: '',
// Display icon near to item text
itemLrIconsProp: ''
},
subHelpIcon: {
name: '',
position: '',
title:'',
link:''
},
subFeatureFlag: {
allowIcon: '',
isDisplayLabel: ''
},
subTheme:{
name:'',
clrLabel:''
},
subFont:{
name:'',
fontText:'',
fontLabel:'',
fontError:''
},
itemsSource: '', //to check in page object
itemsSourceAPI: '',
}
}
}
}
let schemaProp = 'feedbackId';
let value = '200';
let finalSchema = schemaProp ? schema.properties[schemaProp] : schema;
let data = [
{
text: '', // label of the component
items: [
{
id: '',
text: '',
disabled: '',// To disabled particular item
iconName: '', // Display at top of the text
lrIcons:[ // Left Right icon array
{
name:'',
position:'',
title:''
}
]
}
]
}
]

Exact schema

let schema = {
type: "number",
title: "Rate Us", //= label
cstAttr: {
}
}
let schemaProp = '';
let value = '200';
let finalSchema = schemaProp ? schema.properties[schemaProp] : schema;

Nested object

Nested object schemaProp

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

Material Measurement Guidelines

Events

AttributeDescription
onclickFires when the element's value click.
oninvalidScript to be run when an element is invalid.
onresetFires when reset button is clicked.
onvalidateCustom validate hook, must return error message else considered valid; will be called onchange.

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

Features

  • Displays blocks with text or icons or both.
  • On item click value will be change.
  • If allow-icon is true, it will display only icons and the text will be the title.