@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 • 10.1 kB
Source Map (JSON)
{"version":3,"sources":["../../src/containers/carousel.ts"],"names":["$Element"],"mappings":";;AA2CO,MAAM,iBAAiBA,OAA8B,CAAA;AAAA,EAC1D,IAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,aAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA,EAEA,eAAe,KAAwB,EAAA;AACrC,IAAM,KAAA,EAAA;AACN,IAAA,IAAA,CAAK,IAAO,GAAA,UAAA;AACZ,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AAAA;AACf,EAEA,YAAY,KAAwB,EAAA;AAClC,IAAO,MAAA,CAAA,MAAA,CAAO,MAAM,KAAK,CAAA;AACzB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,SAAA,CAAU,QAAQ,IAAM,EAAA;AACtB,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AACb,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,cAAc,KAAe,EAAA;AAC3B,IAAA,IAAA,CAAK,SAAY,GAAA,KAAA;AACjB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,iBAAA,CAAkB,QAAwC,OAAS,EAAA;AACjE,IAAA,IAAA,CAAK,aAAgB,GAAA,KAAA;AACrB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,YAAY,KAAwB,EAAA;AAClC,IAAK,IAAA,CAAA,KAAA,CAAM,IAAK,CAAA,GAAG,KAAK,CAAA;AACxB,IAAO,OAAA,IAAA;AAAA;AAEX;AAyEO,MAAM,qBAAqBA,OAAkC,CAAA;AAAA,EAClE,IAAA;AAAA;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A;AACT,EAEA,UAAU,KAAuB,EAAA;AAC/B,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AACb,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,sBAAsB,KAA0B,EAAA;AAC9C,IAAA,IAAA,CAAK,wBAA2B,GAAA,KAAA;AAChC,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,iBAAiB,KAAe,EAAA;AAC9B,IAAA,IAAA,CAAK,YAAe,GAAA,KAAA;AACpB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,cAAc,KAAiB,EAAA;AAC7B,IAAI,IAAA,CAAC,KAAK,OAAS,EAAA;AACjB,MAAA,IAAA,CAAK,UAAU,EAAC;AAAA;AAGlB,IAAK,IAAA,CAAA,OAAA,CAAQ,IAAK,CAAA,GAAG,KAAK,CAAA;AAC1B,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,YAAY,KAAkB,EAAA;AAC5B,IAAK,IAAA,CAAA,KAAA,CAAM,IAAK,CAAA,GAAG,KAAK,CAAA;AACxB,IAAO,OAAA,IAAA;AAAA;AAEX","file":"carousel.mjs","sourcesContent":["import { Action } from '../actions';\nimport { IElement, Element as $Element } from '../base';\nimport { VerticalAlignment } from '../common';\nimport { Element } from '../element';\nimport { Layout } from '../layouts';\nimport { IBackgroundImage } from '../medias';\n\nimport { ContainerStyle } from './container';\n\n/**\n * A carousel with sliding pages.\n */\nexport interface ICarousel extends IElement {\n type: 'Carousel';\n\n /**\n * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.\n */\n bleed?: boolean;\n\n /**\n * The minimum height, in pixels, of the container, in the <number>px format.\n * @example `<number>px`\n */\n minHeight?: string;\n\n /**\n * Controls the type of animation to use to navigate between pages.\n * @default `slide`\n */\n pageAnimation?: 'slide' | 'crossFade' | 'none';\n\n /**\n * The pages in the carousel.\n */\n pages: ICarouselPage[];\n}\n\nexport type CarouselOptions = Omit<ICarousel, 'type' | 'pages'>;\n\n/**\n * A carousel with sliding pages.\n */\nexport class Carousel extends $Element implements ICarousel {\n type: 'Carousel';\n\n /**\n * Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.\n */\n bleed?: boolean;\n\n /**\n * The minimum height, in pixels, of the container, in the <number>px format.\n * @example `<number>px`\n */\n minHeight?: string;\n\n /**\n * Controls the type of animation to use to navigate between pages.\n * @default `slide`\n */\n pageAnimation?: 'slide' | 'crossFade' | 'none';\n\n /**\n * The pages in the carousel.\n */\n pages: ICarouselPage[];\n\n constructor(...pages: ICarouselPage[]) {\n super();\n this.type = 'Carousel';\n this.pages = pages;\n }\n\n withOptions(value: CarouselOptions) {\n Object.assign(this, value);\n return this;\n }\n\n withBleed(value = true) {\n this.bleed = value;\n return this;\n }\n\n withMinHeight(value: string) {\n this.minHeight = value;\n return this;\n }\n\n withPageAnimation(value: 'slide' | 'crossFade' | 'none' = 'slide') {\n this.pageAnimation = value;\n return this;\n }\n\n addPages(...value: ICarouselPage[]) {\n this.pages.push(...value);\n return this;\n }\n}\n\n/**\n * A page inside a Carousel element.\n */\nexport interface ICarouselPage extends IElement {\n type: 'CarouselPage';\n\n /**\n * The card elements to render inside the `CarouselPage`.\n */\n items: Element[];\n\n /**\n * Specifies the background image. Acceptable formats are `PNG`, `JPEG`, and `GIF`\n */\n backgroundImage?: IBackgroundImage | string;\n\n /**\n * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See Container layouts for more details.\n */\n layouts?: Array<Layout>;\n\n /**\n * The maximum height, in pixels, of the container, in the <number>px format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed.\n * @example `<number>px`\n */\n maxHeight?: string;\n\n /**\n * The minimum height, in pixels, of the container, in the <number>px format.\n * @example `<number>px`\n */\n minHeight?: string;\n\n /**\n * Controls if the container should have rounded corners.\n * @default false\n */\n roundedCorners?: boolean;\n\n /**\n * Controls if the content of the card is to be rendered left-to-right or right-to-left.\n */\n rtl?: boolean;\n\n /**\n * Controls if a border should be displayed around the container.\n * @default false\n */\n showBorder?: boolean;\n\n /**\n * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.\n */\n style?: ContainerStyle;\n\n /**\n * Controls how the container's content should be vertically aligned.\n */\n verticalContentAlignment?: VerticalAlignment;\n\n /**\n * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.\n */\n selectAction?: Action;\n}\n\nexport type CarouselPageOptions = Omit<ICarouselPage, 'type' | 'items'>;\n\n/**\n * A page inside a Carousel element.\n */\nexport class CarouselPage extends $Element implements ICarouselPage {\n type: 'CarouselPage';\n\n /**\n * The card elements to render inside the `CarouselPage`.\n */\n items: Element[];\n\n /**\n * Specifies the background image. Acceptable formats are `PNG`, `JPEG`, and `GIF`\n */\n backgroundImage?: IBackgroundImage | string;\n\n /**\n * The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See Container layouts for more details.\n */\n layouts?: Array<Layout>;\n\n /**\n * The maximum height, in pixels, of the container, in the <number>px format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed.\n * @example `<number>px`\n */\n maxHeight?: string;\n\n /**\n * The minimum height, in pixels, of the container, in the <number>px format.\n * @example `<number>px`\n */\n minHeight?: string;\n\n /**\n * Controls if the container should have rounded corners.\n * @default false\n */\n roundedCorners?: boolean;\n\n /**\n * Controls if the content of the card is to be rendered left-to-right or right-to-left.\n */\n rtl?: boolean;\n\n /**\n * Controls if a border should be displayed around the container.\n * @default false\n */\n showBorder?: boolean;\n\n /**\n * The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.\n */\n style?: ContainerStyle;\n\n /**\n * Controls how the container's content should be vertically aligned.\n */\n verticalContentAlignment?: VerticalAlignment;\n\n /**\n * An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.\n */\n selectAction?: Action;\n\n constructor(...items: Element[]) {\n super();\n this.type = 'CarouselPage';\n this.items = items;\n }\n\n withOptions(value: CarouselPageOptions) {\n Object.assign(this, value);\n return this;\n }\n\n withBackgroundImage(value: IBackgroundImage | string) {\n this.backgroundImage = value;\n return this;\n }\n\n withMinHeight(value: string) {\n this.minHeight = value;\n return this;\n }\n\n withRoundedCorners(value = true) {\n this.roundedCorners = value;\n return this;\n }\n\n withRtl(value = true) {\n this.rtl = value;\n return this;\n }\n\n withShowBorder(value = true) {\n this.showBorder = value;\n return this;\n }\n\n withStyle(value: ContainerStyle) {\n this.style = value;\n return this;\n }\n\n withVeritcalAlignment(value: VerticalAlignment) {\n this.verticalContentAlignment = value;\n return this;\n }\n\n withSelectAction(value: Action) {\n this.selectAction = value;\n return this;\n }\n\n addLayouts(...value: Layout[]) {\n if (!this.layouts) {\n this.layouts = [];\n }\n\n this.layouts.push(...value);\n return this;\n }\n\n addCards(...value: Element[]) {\n this.items.push(...value);\n return this;\n }\n}\n"]}