speedybot / Exports / SpeedyCard
Class: SpeedyCard
Card Builder
This is a utility that makes it convenient to build + pass data to Adaptive Cards
Note: This extends Adaptive Card functionality to include "chips" which when tapped will trigger your text handling logic
You can add "pickers" for date, time, select (and multi-select)
Table of contents
Constructors
Properties
Methods
- addAction
- addBlock
- addButton
- addChip
- addChips
- addDeleteButton
- addHeader
- addImage
- addLink
- addLinkButton
- addMultiSelect
- addPickerDate
- addPickerDropdown
- addPickerTime
- addSingleSelect
- addSubcard
- addSubtitle
- addTable
- addText
- addTextInput
- addTextarea
- addTitle
- attachData
- build
- needsSubmit
- setBackgroundImage
- setSubmitButtonTitle
- survey
Constructors
constructor
• new SpeedyCard()
Defined in
Properties
tools
• tools: Object
Type declaration
Name | Type |
---|---|
checkColor | (candidate : string ) => BaseColors |
Defined in
Methods
addAction
▸ Private
addAction(a
): void
Parameters
Name | Type |
---|---|
a | any |
Returns
void
Defined in
addBlock
▸ addBlock(content
, config?
): SpeedyCard
Parameters
Name | Type |
---|---|
content | string | SpeedyCard |
config | Object |
config.backgroundColor? | ColorChoices |
config.separator? | boolean |
config.vertAlign? | VAlignChoices |
Returns
Defined in
addButton
▸ addButton(label
, id?
, attachedData?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
label | string | undefined |
id | string | "button_result" |
attachedData | string | { [key: string] : number | string | boolean ; } | {} |
Returns
Defined in
addChip
▸ addChip(payload
, id?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
payload | string | { title : string ; value? : string } | undefined |
id | string | CONSTANTS.CHIP_LABEL |
Returns
Defined in
addChips
▸ addChips(chips
, id?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
chips | (string | { title : string ; value? : string })[] | undefined |
id | string | CONSTANTS.CHIP_LABEL |
Returns
Defined in
addDeleteButton
▸ addDeleteButton(label?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
label | string | CONSTANTS.destroyLabel |
Returns
Defined in
addHeader
▸ addHeader(text
, config?
): SpeedyCard
Parameters
Name | Type |
---|---|
text | string |
config | HeaderConfig |
Returns
Defined in
addImage
▸ addImage(url
, config?
): SpeedyCard
Parameters
Name | Type |
---|---|
url | string |
config | Object |
config.align? | AlignmentChoices |
config.size? | SizeChoices |
config.targetURL? | string |
Returns
Defined in
addLink
▸ addLink(url
, label?
): SpeedyCard
Parameters
Name | Type |
---|---|
url | string |
label? | string |
Returns
Defined in
addLinkButton
▸ addLinkButton(url
, label?
): SpeedyCard
Parameters
Name | Type |
---|---|
url | string |
label? | string |
Returns
Defined in
addMultiSelect
▸ addMultiSelect(choices
, id?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
choices | (string | number )[] | { title : string ; value : string }[] | undefined |
id | string | "addMultiSelect_result" |
Returns
Defined in
addPickerDate
▸ addPickerDate(textLabel
, id?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
textLabel | string | undefined |
id | string | "addPickerDate_result" |
Returns
Defined in
addPickerDropdown
▸ addPickerDropdown(choices
, id?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
choices | (string | number | { title : string ; value : string | number })[] | undefined |
id | string | SpeedyCardId.dropdown |
Returns
Defined in
addPickerTime
▸ addPickerTime(textLabel
, id?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
textLabel | string | undefined |
id | string | "addPickerTime_result" |
Returns
Defined in
addSingleSelect
▸ addSingleSelect(choices
, id?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
choices | (string | number )[] | { title : string ; value : string }[] | undefined |
id | string | "addSingleSelectresult" |
Returns
Defined in
addSubcard
▸ addSubcard(card
, textLabel?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
card | Card | SpeedyCard | undefined |
textLabel | string | "" |
Returns
Defined in
addSubtitle
▸ addSubtitle(subTitle
): SpeedyCard
Parameters
Name | Type |
---|---|
subTitle | string |
Returns
Defined in
addTable
▸ addTable(input
, separator?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
input | (string | number )[][] | { [key: string] : string | number ; } | undefined |
separator | boolean | false |
Returns
Defined in
addText
▸ addText(text
, config?
): SpeedyCard
Parameters
Name | Type |
---|---|
text | string |
config | Object |
config.align? | AlignmentChoices |
config.backgroundColor? | ColorChoices |
config.bold? | boolean |
config.color? | ColorChoices |
config.size? | SizeChoices |
config.vertAlign? | VAlignChoices |
Returns
Defined in
addTextInput
▸ addTextInput(placeholder
, id?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
placeholder | string | undefined |
id | string | "addTextInput_result" |
Returns
Defined in
addTextarea
▸ addTextarea(placeholder
, id?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
placeholder | string | undefined |
id | string | "addTextarea_result" |
Returns
Defined in
addTitle
▸ addTitle(title
): SpeedyCard
Parameters
Name | Type |
---|---|
title | string |
Returns
Defined in
attachData
▸ attachData(payload
): SpeedyCard
Parameters
Name | Type |
---|---|
payload | AttachedData |
Returns
Defined in
build
▸ build(): any
Returns
any
Defined in
needsSubmit
▸ needsSubmit(): boolean
Returns
boolean
Defined in
setBackgroundImage
▸ setBackgroundImage(url
): SpeedyCard
Parameters
Name | Type |
---|---|
url | string |
Returns
Defined in
setSubmitButtonTitle
▸ setSubmitButtonTitle(label
): SpeedyCard
Parameters
Name | Type |
---|---|
label | string |
Returns
Defined in
survey
▸ survey(questions
, title?
): SpeedyCard
Parameters
Name | Type | Default value |
---|---|---|
questions | SurveyQuestion [] | undefined |
title | string | "📝 Survey" |