You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sortMethod(items,type,dir){// accepts 3 paramatersif(type==='name'){// check type nameitems.sort((a,b)=>{letcompare;switch(dir){// determine sort directioncase'up':
compare=a.title.toLowerCase()<b.title.toLowerCase();break;case'down':
compare=a.title.toLowerCase()>b.title.toLowerCase();break;default:
}switch(compare){// actual comparisoncasetrue:
return-1;casefalse:
return1;default:
return0;}});}returnitems;},
filterMethod(items,tags,search){// accepts 3 parametersletlist=items;if(search!==''){// filter for text searchlist=list.filter((item)=>item.title.toLowerCase().indexOf(search.toLowerCase())>-1,);}if(tags.includes('Filter')){// filter for tagslist=items.filter((item)=>item==='filter');}returnlist;},
Props
Props
Type
Description
Required
items
Array
List of items to search & filter from.
Yes
sortTypes
Array
List of types of sorting. Each sort comes with up and down direction
Yes
sortFunc
Function
Function for sorting with 3 paramters (items, tags, direction).
Yes
filterTypes
Array
List of types of filters. Can be grouped within an array to act as either/or. Otherwise, acts like and.
Yes
filterFunc
Function
Function for filtering with 3 paramters (items, tags, search).
delegatesData: {country: 'Name',_id: 'id',time_start: 90,/* Optional */time_left: 85,/* Optional */yield: 'Other Delegate ID or String',/* Optional */}
move method
moveMethod(index){// limit min-max values to only the total delegates lengthconsti=Math.min(Math.max(parseInt(index,10),0),delegatesData.length);display=i;},
Props
Prop
Default
Type
Description
Required?
delegates
null
Array
The object array of delegates.
Yes
active
0
Number
Index number of delegates marking which delegate is on the timer.
No
isActive
false
Boolean
Indicate a timer is running
No
actions
{}
Object
Object of actions for context menu; set key to false for disabled.
Yes
display
0
Number
Index number of delegates to show in the card stacks.
Yes
desc
''
String
Set custom description. Use value presence to dynamically update with the country's presence.
No
progress
0
Number/String
Set custom card progress. Use value presence to dynamically update with the country's presence.