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

55 lines (53 loc) 1.07 kB
import { InputElement } from './base'; class ToggleInput extends InputElement { type; /** * Title for the toggle */ title; /** * The initial selected value. If you want the toggle to be initially on, set this to the value of valueOn‘s value. */ value; /** * The value when toggle is off */ valueOff; /** * The value when toggle is on */ valueOn; /** * If `true`, allow text to wrap. Otherwise, text is clipped. */ wrap; constructor(title, options = {}) { super(); this.type = "Input.Toggle"; this.title = title; this.withOptions(options); } withOptions(value) { Object.assign(this, value); return this; } withValue(value) { this.value = value; return this; } withValueOff(value) { this.valueOff = value; return this; } withValueOn(value) { this.valueOn = value; return this; } withWrap(value = true) { this.wrap = value; return this; } } export { ToggleInput }; //# sourceMappingURL=toggle.mjs.map //# sourceMappingURL=toggle.mjs.map