Chips/Breadcrumb

Definition

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

OR

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

Example

<cst-chips 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-label text="" position=""/>
<sub-item text="" id=""/>
<sub-item text="" id=""/>
<sub-lr-icon name="" position="" title="" link=""/>
<sub-lr-icon name="" position="" title="" link=""/>
<sub-options items-prop="" item-text-prop="" item-id-prop="" />
<sub-help-icon name="" position="" title="" link="">
<sub-feature-flag is-breadcrumb="" is-collapsed="" is-fieldset="">
</cst-chips>

Attributes

AttributeValueDescription
idstring typeIdentifier for component.
valuenumber typeActive chips id from the chips list
disabledboolean typeSpecifies if component should be disabled.(aurelia ext attribute)
classcst-mat-filled (default if material design)
cst-mat-outlined
cst-mat-shaped-filled
cst-mat-shaped-outlined
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-label

object typeSpecifies label to be displayed.

sub-lr-icons

array typeSpecifies icons to be displayed.

sub-options

object typeSpecifies options of the components.

sub-help-icon

object typeSpecifies help icon to be displayed.

sub-feature-flag

objectSpecifies what features to enable/disable.
otherany typeAny other info.
schemaobject typeSpecifies 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
namematerial/skeuomorphic/material-breadcrumb-chevronName of design to be used.
widthpercentage/pixels/string(x-small,small,medium,large,x-large)Gives width/any other prop value

sub-label

PropertyValueDescription
textstring typeLabel text.
positionleft/top/center(default)Position of the label.

sub-lr-icons

(a.k.a left right icons)

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

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 in list.

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-breadcrumbboolean typeSeparated chips by specific icon
is-collapsedboolean typeDisplay first and last item of chips list. In between display dots(...). Click on center dots, display all the chips items
is-fieldsetboolean typeSpecifies to display title as fieldset

Schema Examples

Full schema

Fetch appropriate based on schemaProp

let schema = {
type: "object",
required: ["breadcrumbId"], //= required
properties: {
breadcrumbId: {
type: "number",
title:"Path",//= label
cstAttr: {
raw:{ //loop & add to element
disabled : true,
class:'outline cst-class1'
},
subStyle:{ //loop & add to element style
name: '',
width:'',
height:'',
fontSize:''
},
subLabel:{
position:'',
text:''
},
subLrIcons:[{
name:'',
position:'',
title:''
}],
subOptions:{
itemsProp: '',
itemIdProp: '',
itemTextProp: '',
itemLrIconsProp: ''
},
subHelpIcon: {
name: '',
position: '',
title:'',
link:''
},
subFeatureFlag: {
isBreadcrumb: true
},
subTheme:{
name:'',
clrLabel:''
},
subFont:{
name:'',
fontText:'',
fontLabel:'',
fontError:''
},
itemsSource: '', //to check in page object
itemsSourceAPI: '',
}
}
}
}
let schemaProp = 'breadcrumbId';
let value = 200;
let finalSchema = schemaProp ? schema.properties[schemaProp] : schema;
let data = [
{
text: '',// If no id or value, it will be as group title.
// If id and value is there, it will be the item
items: [
{
id: '',
text: '',
disabled: '',// To disabled particular item
lrIcons:[ // Left Right icon array
{
name:'',
position:'',
title:''
}
]
items: [
{
id: '',
text: '',
disabled: '',
lrIcons:[
{
name:'',
position:'',
title:''
}
]
}
]
}
]
}
]

Exact schema

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

Nested object

Nested object schemaProp

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

Material Measurement Guidelines

Without Icon

  • min-width = as per content or design
  • height = 32px
  • space from left and right = 12px
  • border = 1px

SPECS WITHOUT ICON

Without Icon

  • min-width = as per content or design
  • height = 32px
  • space between sides and icon = 4px
  • space between icon and title = 8px
  • border = 1px

SPECS WITH ICON

Events

AttributeDescription
onclickFires when the item clicked(for menu item click).
oninvalidScript to be run when an element is invalid.
onresetFires when reset button is clicked.

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

  • Display chips with cross icon
  • Click on cross icon, chips will be delete from list
  • isBreadcrumb = true, Chips will display as breadcrumb and separated with specific icon
  • Click on breadcrumb item, clickCallback will trigger