@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
76 lines (73 loc) • 1.63 kB
JavaScript
'use strict';
var base = require('./base');
class TextInput extends base.InputElement {
type;
/**
* If `true`, allow multiple lines of input.
*/
isMultiline;
/**
* Hint of maximum length characters to collect (may be ignored by some clients).
*/
maxLength;
/**
* Description of the input desired. Displayed when no text has been input.
*/
placeholder;
/**
* Regular expression indicating the required format of this text input.
*/
regex;
/**
* Style hint for text input.
*/
style;
/**
* The inline action for the input. Typically displayed to the right of the input. It is strongly recommended to provide an icon on the action (which will be displayed instead of the title of the action).
*/
inlineAction;
/**
* The initial value for this field.
*/
value;
constructor(options = {}) {
super();
this.type = "Input.Text";
this.withOptions(options);
}
withOptions(value) {
Object.assign(this, value);
return this;
}
withMultiLine(value = true) {
this.isMultiline = value;
return this;
}
withMaxLength(value) {
this.maxLength = value;
return this;
}
withPlaceholder(value) {
this.placeholder = value;
return this;
}
withRegex(value) {
this.regex = value;
return this;
}
withStyle(value) {
this.style = value;
return this;
}
withInlineAction(value) {
this.inlineAction = value;
return this;
}
withValue(value) {
this.value = value;
return this;
}
}
exports.TextInput = TextInput;
//# sourceMappingURL=text.js.map
//# sourceMappingURL=text.js.map