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.86 kB
{"version":3,"sources":["../../src/containers/image-set.ts"],"names":[],"mappings":";;AAgCO,MAAM,iBAAiB,OAA6B,CAAA;AAAA,EACzD,IAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,MAAA;AAAA,EAEA,eAAe,MAAkB,EAAA;AAC/B,IAAM,KAAA,EAAA;AACN,IAAA,IAAA,CAAK,IAAO,GAAA,UAAA;AACZ,IAAA,IAAA,CAAK,MAAS,GAAA,MAAA;AAAA;AAChB,EAEA,YAAY,KAAwB,EAAA;AAClC,IAAO,MAAA,CAAA,MAAA,CAAO,MAAM,KAAK,CAAA;AACzB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,UAAU,KAAuC,EAAA;AAC/C,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AACb,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,cAAc,KAA+C,EAAA;AAC3D,IAAA,IAAA,CAAK,SAAY,GAAA,KAAA;AACjB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,aAAa,KAAiB,EAAA;AAC5B,IAAK,IAAA,CAAA,MAAA,CAAO,IAAK,CAAA,GAAG,KAAK,CAAA;AACzB,IAAO,OAAA,IAAA;AAAA;AAEX","file":"image-set.mjs","sourcesContent":["import { IElement, Element } from '../base';\nimport { IImage, ImageSize } from '../medias';\n\n/**\n * The `ImageSet` element displays a collection of `Image`'s similar to a gallery. Acceptable formats are `PNG`, `JPEG`, and `GIF`.\n */\nexport interface IImageSet extends IElement {\n type: 'ImageSet';\n\n /**\n * Controls how the images are displayed.\n */\n style?: 'default' | 'stacked' | 'grid';\n\n /**\n * Controls the approximate size of each image. The physical dimensions will vary per host.\n * Auto and stretch are not supported for `ImageSet`. The size will default to medium if\n * those values are set.\n */\n imageSize?: Exclude<ImageSize, 'auto' | 'stretch'>;\n\n /**\n * The array of `Image`'s to show.\n */\n images: IImage[];\n}\n\nexport type ImageSetOptions = Omit<IImageSet, 'type' | 'images'>;\n\n/**\n * The `ImageSet` element displays a collection of `Image`'s similar to a gallery. Acceptable formats are `PNG`, `JPEG`, and `GIF`.\n */\nexport class ImageSet extends Element implements IImageSet {\n type: 'ImageSet';\n\n /**\n * Controls how the images are displayed.\n */\n style?: 'default' | 'stacked' | 'grid';\n\n /**\n * Controls the approximate size of each image. The physical dimensions will vary per host.\n * Auto and stretch are not supported for `ImageSet`. The size will default to medium if\n * those values are set.\n */\n imageSize?: Exclude<ImageSize, 'auto' | 'stretch'>;\n\n /**\n * The array of `Image`'s to show.\n */\n images: IImage[];\n\n constructor(...images: IImage[]) {\n super();\n this.type = 'ImageSet';\n this.images = images;\n }\n\n withOptions(value: ImageSetOptions) {\n Object.assign(this, value);\n return this;\n }\n\n withStyle(value: 'default' | 'stacked' | 'grid') {\n this.style = value;\n return this;\n }\n\n withImageSize(value: Exclude<ImageSize, 'auto' | 'stretch'>) {\n this.imageSize = value;\n return this;\n }\n\n addImages(...value: IImage[]) {\n this.images.push(...value);\n return this;\n }\n}\n"]}