Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
actionsOrientation: Orientation.Vertical,
actionAlignment: ActionAlignment.Stretch
},
adaptiveCard: {
allowCustomStyle: false
},
imageSet: {
imageSize: Size.Medium,
maxImageHeight: 100
},
factSet: {
title: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Bolder,
wrap: true,
maxWidth: 150,
},
value: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Default,
wrap: true,
},
spacing: 5
}
});
}
}
actionsOrientation: Orientation.Vertical,
actionAlignment: ActionAlignment.Stretch
},
adaptiveCard: {
allowCustomStyle: false
},
imageSet: {
imageSize: Size.Medium,
maxImageHeight: 100
},
factSet: {
title: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Bolder,
wrap: true,
maxWidth: 150,
},
value: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Default,
wrap: true,
},
spacing: 10
}
});
}
}
actionsOrientation: Orientation.Horizontal,
actionAlignment: ActionAlignment.Left
},
adaptiveCard: {
allowCustomStyle: false
},
imageSet: {
imageSize: Size.Medium,
maxImageHeight: 100
},
factSet: {
title: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Bolder,
wrap: true,
maxWidth: 150
},
value: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Default,
wrap: true
},
spacing: 10
}
});
}
}
receiptCardBuilder.addTextBlock(item.price, { horizontalAlignment: HorizontalAlignment.Right }, columns2[2]);
} else {
const columns3 = receiptCardBuilder.addColumnSet([75, 25]);
receiptCardBuilder.addTextBlock(item.title, { size: TextSize.Medium, weight: TextWeight.Bolder, wrap: true }, columns3[0]);
receiptCardBuilder.addTextBlock(item.subtitle, { size: TextSize.Medium, wrap: true }, columns3[0]);
receiptCardBuilder.addTextBlock(item.price, { horizontalAlignment: HorizontalAlignment.Right }, columns3[1]);
}
});
if (exists(attachment.content.vat)) {
const vatCol = receiptCardBuilder.addColumnSet([75, 25]);
receiptCardBuilder.addTextBlock(props.format.strings.receiptVat, { size: TextSize.Medium, weight: TextWeight.Bolder }, vatCol[0]);
receiptCardBuilder.addTextBlock(attachment.content.vat, { horizontalAlignment: HorizontalAlignment.Right }, vatCol[1]);
}
if (exists(attachment.content.tax)) {
const taxCol = receiptCardBuilder.addColumnSet([75, 25]);
receiptCardBuilder.addTextBlock(props.format.strings.receiptTax, { size: TextSize.Medium, weight: TextWeight.Bolder }, taxCol[0]);
receiptCardBuilder.addTextBlock(attachment.content.tax, { horizontalAlignment: HorizontalAlignment.Right }, taxCol[1]);
}
if (exists(attachment.content.total)) {
const totalCol = receiptCardBuilder.addColumnSet([75, 25]);
receiptCardBuilder.addTextBlock(props.format.strings.receiptTotal, { size: TextSize.Medium, weight: TextWeight.Bolder }, totalCol[0]);
receiptCardBuilder.addTextBlock(attachment.content.total, { horizontalAlignment: HorizontalAlignment.Right, size: TextSize.Medium, weight: TextWeight.Bolder }, totalCol[1]);
}
receiptCardBuilder.addButtons(attachment.content.buttons);
return (
);
case "application/vnd.microsoft.card.adaptive":
if (!attachment.content)
return null;
return (
actionsOrientation: Orientation.Horizontal,
actionAlignment: ActionAlignment.Left
},
adaptiveCard: {
allowCustomStyle: false
},
imageSet: {
imageSize: Size.Medium,
maxImageHeight: 100
},
factSet: {
title: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Bolder,
wrap: true,
maxWidth: 150,
},
value: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Default,
wrap: true,
},
spacing: 20
}
});
}
}
onClick={ onCardAction(attachment.content.tap) }
onImageLoad={ props.onImageLoad }
/>
);
case 'application/vnd.microsoft.card.thumbnail':
if (!attachment.content) {
return null;
}
const thumbnailCardBuilder = new CardBuilder.AdaptiveCardBuilder();
if (attachment.content.images && attachment.content.images.length > 0) {
const columns = thumbnailCardBuilder.addColumnSet([75, 25]);
thumbnailCardBuilder.addTextBlock(attachment.content.title, { size: TextSize.Medium, weight: TextWeight.Bolder }, columns[0]);
thumbnailCardBuilder.addTextBlock(attachment.content.subtitle, { isSubtle: true, wrap: true }, columns[0]);
thumbnailCardBuilder.addImage(attachment.content.images[0].url, columns[1], attachment.content.images[0].tap);
thumbnailCardBuilder.addTextBlock(attachment.content.text, { wrap: true });
thumbnailCardBuilder.addButtons(attachment.content.buttons);
} else {
thumbnailCardBuilder.addCommon(attachment.content);
}
return (
actionsOrientation: Orientation.Horizontal,
actionAlignment: ActionAlignment.Left
},
adaptiveCard: {
allowCustomStyle: false
},
imageSet: {
imageSize: Size.Medium,
maxImageHeight: 100
},
factSet: {
title: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Bolder,
wrap: true,
maxWidth: 150
},
value: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Default,
wrap: true
},
spacing: 10
}
});
}
}
actionsOrientation: Orientation.Horizontal,
actionAlignment: ActionAlignment.Left,
},
adaptiveCard: {
allowCustomStyle: false,
},
imageSet: {
imageSize: Size.Medium,
maxImageHeight: 100,
},
factSet: {
title: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Bolder,
wrap: true,
maxWidth: 150,
},
value: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Default,
wrap: true,
},
spacing: 10,
},
});
}
}
actionsOrientation: Orientation.Vertical,
actionAlignment: ActionAlignment.Stretch
},
adaptiveCard: {
allowCustomStyle: false
},
imageSet: {
imageSize: Size.Medium,
maxImageHeight: 100
},
factSet: {
title: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Bolder,
wrap: true,
maxWidth: 150,
},
value: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Default,
wrap: true,
},
spacing: 10
}
});
}
}
actionsOrientation: Orientation.Horizontal,
actionAlignment: ActionAlignment.Left
},
adaptiveCard: {
allowCustomStyle: false
},
imageSet: {
imageSize: Size.Medium,
maxImageHeight: 100
},
factSet: {
title: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Bolder,
wrap: true,
maxWidth: 150
},
value: {
color: TextColor.Default,
size: TextSize.Default,
isSubtle: false,
weight: TextWeight.Default,
wrap: true
},
spacing: 10
}
});
}
}