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

1 lines 2.21 kB
{"version":3,"sources":["../../src/containers/fact-set.ts"],"names":[],"mappings":";;AAmBO,MAAM,gBAAgB,OAA4B,CAAA;AAAA,EACvD,IAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA,EAEA,eAAe,KAAgB,EAAA;AAC7B,IAAM,KAAA,EAAA;AACN,IAAA,IAAA,CAAK,IAAO,GAAA,SAAA;AACZ,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AAAA;AACf,EAEA,YAAY,KAAuB,EAAA;AACjC,IAAO,MAAA,CAAA,MAAA,CAAO,MAAM,KAAK,CAAA;AACzB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,YAAY,KAAgB,EAAA;AAC1B,IAAK,IAAA,CAAA,KAAA,CAAM,IAAK,CAAA,GAAG,KAAK,CAAA;AACxB,IAAO,OAAA,IAAA;AAAA;AAEX;AAoBO,MAAM,IAAsB,CAAA;AAAA;AAAA;AAAA;AAAA,EAIjC,KAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA,EAEA,WAAA,CAAY,OAAe,KAAe,EAAA;AACxC,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AACb,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AAAA;AAEjB","file":"fact-set.mjs","sourcesContent":["import { IElement, Element } from '../base';\n\n/**\n * The `FactSet` element displays a series of facts (i.e. name/value pairs) in a tabular form.\n */\nexport interface IFactSet extends IElement {\n type: 'FactSet';\n\n /**\n * The array of `Fact`'s\n */\n facts: IFact[];\n}\n\nexport type FactSetOptions = Omit<IFactSet, 'type' | 'facts'>;\n\n/**\n * The `FactSet` element displays a series of facts (i.e. name/value pairs) in a tabular form.\n */\nexport class FactSet extends Element implements IFactSet {\n type: 'FactSet';\n\n /**\n * The array of `Fact`'s\n */\n facts: IFact[];\n\n constructor(...facts: IFact[]) {\n super();\n this.type = 'FactSet';\n this.facts = facts;\n }\n\n withOptions(value: FactSetOptions) {\n Object.assign(this, value);\n return this;\n }\n\n addFacts(...value: IFact[]) {\n this.facts.push(...value);\n return this;\n }\n}\n\n/**\n * Describes a `Fact` in a `FactSet` as a key/value pair.\n */\nexport interface IFact {\n /**\n * The title of the fact.\n */\n title: string;\n\n /**\n * The value of the fact.\n */\n value: string;\n}\n\n/**\n * Describes a `Fact` in a `FactSet` as a key/value pair.\n */\nexport class Fact implements IFact {\n /**\n * The title of the fact.\n */\n title: string;\n\n /**\n * The value of the fact.\n */\n value: string;\n\n constructor(title: string, value: string) {\n this.title = title;\n this.value = value;\n }\n}\n"]}