@microsoft/teams.cards
Version:
<p> <a href="https://www.npmjs.com/package/@microsoft/teams.cards" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.cards" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.cards?activeTab=code" ta
90 lines (88 loc) • 2.06 kB
JavaScript
'use strict';
class Action {
/**
* A unique identifier associated with this Action.
*/
id;
/**
* Label for button or link that represents this action.
*/
title;
/**
* Optional icon to be shown on the action in conjunction with the title. Supports data URI in version 1.2+
*/
iconUrl;
/**
* Controls the style of an Action, which influences how the action is displayed, spoken, etc.
*/
style;
/**
* Describes what to do when an unknown element is encountered or the requires of this or any children can’t be met.
*/
fallback;
/**
* Determines whether an action is displayed with a button or is moved to the overflow menu.
*/
mode;
/**
* Defines text that should be displayed to the end user as they hover the mouse over the action, and read when using narration software.
*/
tooltip;
/**
* Determines whether the action should be enabled.
*/
isEnabled;
/**
* A series of key/value pairs indicating features that the item requires with corresponding minimum version. When a feature is missing or of insufficient version, fallback is triggered.
*/
requires;
constructor(value = {}) {
Object.assign(this, value);
}
withId(value) {
this.id = value;
return this;
}
withTitle(value) {
this.title = value;
return this;
}
withIconUrl(value) {
this.iconUrl = value;
return this;
}
withStyle(value) {
this.style = value;
return this;
}
withFallback(value) {
this.fallback = value;
return this;
}
withMode(value) {
this.mode = value;
return this;
}
withTooltip(value) {
this.tooltip = value;
return this;
}
withEnabled(value = true) {
this.isEnabled = value;
return this;
}
withRequires(value) {
this.requires = value;
return this;
}
withRequire(key, value) {
if (!this.requires) {
this.requires = {};
}
this.requires[key] = value;
return this;
}
}
exports.Action = Action;
//# sourceMappingURL=base.js.map
//# sourceMappingURL=base.js.map