UNPKG

@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

61 lines (59 loc) 1.69 kB
import { Element } from '../base'; class InputElement extends Element { /** * Error message to display when entered input is invalid */ errorMessage; /** * Whether or not this input is required */ isRequired; /** * Label for this input */ label; /** * [SUPPORTED ONLY IN JAVASCRIPT SDK] Determines the position of the label. It can take 'inline' and 'above' values. By default, the label is placed 'above' when label position is not specified. */ labelPosition; /** * [SUPPORTED ONLY IN JAVASCRIPT SDK] Determines the width of the label in percent like 40 or a specific pixel width like ‘40px’ when label is placed inline with the input. labelWidth would be ignored when the label is displayed above the input. */ labelWidth; /** * [SUPPORTED ONLY IN JAVASCRIPT SDK] Style hint for input fields. Allows input fields to appear as read-only but when user clicks/focuses on the field, it allows them to update those fields. */ inputStyle; constructor(options = {}) { super(options); } withError(value) { this.errorMessage = value; return this; } withRequired(value = true) { this.isRequired = value; return this; } withLabel(value, position, width) { this.label = value; this.labelPosition = position; this.labelWidth = width; return this; } withLabelPosition(value) { this.labelPosition = value; return this; } withLabelWidth(value) { this.labelWidth = value; return this; } withInputStyle(value) { this.inputStyle = value; return this; } } export { InputElement }; //# sourceMappingURL=base.mjs.map //# sourceMappingURL=base.mjs.map