@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 • 5.78 kB
Source Map (JSON)
{"version":3,"sources":["../../src/layouts/flow.ts"],"names":[],"mappings":"AAmEO,MAAM,UAAkC,CAAA;AAAA,EAC7C,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,wBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAA;AAAA;AAAA;AAAA;AAAA,EAKA,WAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,sBAAA;AAAA,EAEA,WAAA,CAAY,OAA6B,GAAA,EAAI,EAAA;AAC3C,IAAA,IAAA,CAAK,IAAO,GAAA,aAAA;AACZ,IAAO,MAAA,CAAA,MAAA,CAAO,MAAM,OAAO,CAAA;AAAA;AAC7B,EAEA,OAAO,KAAK,OAA4B,EAAA;AACtC,IAAO,OAAA,IAAI,WAAW,OAAO,CAAA;AAAA;AAC/B,EAEA,kBAAkB,KAAgB,EAAA;AAChC,IAAA,IAAA,CAAK,aAAgB,GAAA,KAAA;AACrB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,wBAAwB,KAA4B,EAAA;AAClD,IAAA,IAAA,CAAK,wBAA2B,GAAA,KAAA;AAChC,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,YAAY,KAAuB,EAAA;AACjC,IAAA,IAAA,CAAK,OAAU,GAAA,KAAA;AACf,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,cAAc,KAAe,EAAA;AAC3B,IAAA,IAAA,CAAK,SAAY,GAAA,KAAA;AACjB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,iBAAiB,KAAe,EAAA;AAC9B,IAAA,IAAA,CAAK,YAAe,GAAA,KAAA;AACpB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,iBAAiB,KAAe,EAAA;AAC9B,IAAA,IAAA,CAAK,YAAe,GAAA,KAAA;AACpB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,eAAe,KAAgB,EAAA;AAC7B,IAAA,IAAA,CAAK,UAAa,GAAA,KAAA;AAClB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,gBAAgB,KAAoB,EAAA;AAClC,IAAA,IAAA,CAAK,WAAc,GAAA,KAAA;AACnB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,sBAAsB,KAA0B,EAAA;AAC9C,IAAA,IAAA,CAAK,sBAAyB,GAAA,KAAA;AAC9B,IAAO,OAAA,IAAA;AAAA;AAEX","file":"flow.mjs","sourcesContent":["import { HorizontalAlignment, Spacing, TargetWidth, VerticalAlignment } from '../common';\n\n/**\n * A layout that spreads elements horizontally and wraps them across multiple rows, as needed.\n */\nexport interface IFlowLayout {\n type: 'Layout.Flow';\n\n /**\n * The space between items.\n * @default `default`\n */\n columnSpacing?: Spacing;\n\n /**\n * Controls how the content of the container should be horizontally aligned.\n * @default `center`\n */\n horizontalItemsAlignment?: HorizontalAlignment;\n\n /**\n * Controls how item should fit inside the container.\n * @default `Fit`\n */\n itemFit?: 'Fit' | 'Fill';\n\n /**\n * The width, in pixels, of each item, in the <number>px format. Should not be used if maxItemWidth and/or minItemWidth are set.\n * @example '<number>px'\n */\n itemWidth?: string;\n\n /**\n * The maximum width, in pixels, of each item, in the <number>px format. Should not be used if itemWidth is set.\n * @example '<number>px'\n */\n maxItemWidth?: string;\n\n /**\n * The minimum width, in pixels, of each item, in the <number>px format. Should not be used if itemWidth is set.\n * @example '<number>px'\n */\n minItemWidth?: string;\n\n /**\n * The space between rows of items.\n * @default `default`\n */\n rowSpacing?: Spacing;\n\n /**\n * Controls for which card width the layout should be used.\n */\n targetWidth?: TargetWidth;\n\n /**\n * Controls how the content of the container should be vertically aligned.\n * @default `top`\n */\n verticalItemsAlignment?: VerticalAlignment;\n}\n\nexport type FlowLayoutOptions = Omit<IFlowLayout, 'type'>;\n\n/**\n * A layout that spreads elements horizontally and wraps them across multiple rows, as needed.\n */\nexport class FlowLayout implements IFlowLayout {\n type: 'Layout.Flow';\n\n /**\n * The space between items.\n * @default `default`\n */\n columnSpacing?: Spacing;\n\n /**\n * Controls how the content of the container should be horizontally aligned.\n * @default `center`\n */\n horizontalItemsAlignment?: HorizontalAlignment;\n\n /**\n * Controls how item should fit inside the container.\n * @default `Fit`\n */\n itemFit?: 'Fit' | 'Fill';\n\n /**\n * The width, in pixels, of each item, in the <number>px format. Should not be used if maxItemWidth and/or minItemWidth are set.\n * @example '<number>px'\n */\n itemWidth?: string;\n\n /**\n * The maximum width, in pixels, of each item, in the <number>px format. Should not be used if itemWidth is set.\n * @example '<number>px'\n */\n maxItemWidth?: string;\n\n /**\n * The minimum width, in pixels, of each item, in the <number>px format. Should not be used if itemWidth is set.\n * @example '<number>px'\n */\n minItemWidth?: string;\n\n /**\n * The space between rows of items.\n * @default `default`\n */\n rowSpacing?: Spacing;\n\n /**\n * Controls for which card width the layout should be used.\n */\n targetWidth?: TargetWidth;\n\n /**\n * Controls how the content of the container should be vertically aligned.\n * @default `top`\n */\n verticalItemsAlignment?: VerticalAlignment;\n\n constructor(options: FlowLayoutOptions = {}) {\n this.type = 'Layout.Flow';\n Object.assign(this, options);\n }\n\n static from(options: FlowLayoutOptions) {\n return new FlowLayout(options);\n }\n\n withColumnSpacing(value: Spacing) {\n this.columnSpacing = value;\n return this;\n }\n\n withHorizontalAlignment(value: HorizontalAlignment) {\n this.horizontalItemsAlignment = value;\n return this;\n }\n\n withItemFit(value: 'Fit' | 'Fill') {\n this.itemFit = value;\n return this;\n }\n\n withItemWidth(value: string) {\n this.itemWidth = value;\n return this;\n }\n\n withItemMinWidth(value: string) {\n this.minItemWidth = value;\n return this;\n }\n\n withItemMaxWidth(value: string) {\n this.maxItemWidth = value;\n return this;\n }\n\n withRowSpacing(value: Spacing) {\n this.rowSpacing = value;\n return this;\n }\n\n withTargetWidth(value: TargetWidth) {\n this.targetWidth = value;\n return this;\n }\n\n withVerticalAlignment(value: VerticalAlignment) {\n this.verticalItemsAlignment = value;\n return this;\n }\n}\n"]}