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 5.27 kB
{"version":3,"sources":["../../src/actions/base.ts"],"names":[],"mappings":"AA+CO,MAAM,MAA0B,CAAA;AAAA;AAAA;AAAA;AAAA,EAIrC,EAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA;AAAA;AAAA;AAAA,EAKA,OAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA;AAAA;AAAA;AAAA;AAAA,EAKA,QAAA;AAAA;AAAA;AAAA;AAAA,EAKA,IAAA;AAAA;AAAA;AAAA;AAAA,EAKA,OAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,QAAA;AAAA,EAEA,WAAA,CAAY,KAAiB,GAAA,EAAI,EAAA;AAC/B,IAAO,MAAA,CAAA,MAAA,CAAO,MAAM,KAAK,CAAA;AAAA;AAC3B,EAEA,OAAO,KAAe,EAAA;AACpB,IAAA,IAAA,CAAK,EAAK,GAAA,KAAA;AACV,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,UAAU,KAAe,EAAA;AACvB,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AACb,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,YAAY,KAAe,EAAA;AACzB,IAAA,IAAA,CAAK,OAAU,GAAA,KAAA;AACf,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,UAAU,KAA+C,EAAA;AACvD,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AACb,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,aAAa,KAAyB,EAAA;AACpC,IAAA,IAAA,CAAK,QAAW,GAAA,KAAA;AAChB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,SAAS,KAAgC,EAAA;AACvC,IAAA,IAAA,CAAK,IAAO,GAAA,KAAA;AACZ,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,YAAY,KAAe,EAAA;AACzB,IAAA,IAAA,CAAK,OAAU,GAAA,KAAA;AACf,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,WAAA,CAAY,QAAQ,IAAM,EAAA;AACxB,IAAA,IAAA,CAAK,SAAY,GAAA,KAAA;AACjB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,aAAa,KAA+B,EAAA;AAC1C,IAAA,IAAA,CAAK,QAAW,GAAA,KAAA;AAChB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,WAAA,CAAY,KAAa,KAAe,EAAA;AACtC,IAAI,IAAA,CAAC,KAAK,QAAU,EAAA;AAClB,MAAA,IAAA,CAAK,WAAW,EAAC;AAAA;AAGnB,IAAK,IAAA,CAAA,QAAA,CAAS,GAAG,CAAI,GAAA,KAAA;AACrB,IAAO,OAAA,IAAA;AAAA;AAEX","file":"base.mjs","sourcesContent":["export interface IAction {\n /**\n * A unique identifier associated with this Action.\n */\n id?: string;\n\n /**\n * Label for button or link that represents this action.\n */\n title?: string;\n\n /**\n * Optional icon to be shown on the action in conjunction with the title. Supports data URI in version 1.2+\n */\n iconUrl?: string;\n\n /**\n * Controls the style of an Action, which influences how the action is displayed, spoken, etc.\n */\n style?: 'default' | 'positive' | 'destructive';\n\n /**\n * Describes what to do when an unknown element is encountered or the requires of this or any children can’t be met.\n */\n fallback?: IAction | string;\n\n /**\n * Determines whether an action is displayed with a button or is moved to the overflow menu.\n */\n mode?: 'primary' | 'secondary';\n\n /**\n * Defines text that should be displayed to the end user as they hover the mouse over the action, and read when using narration software.\n */\n tooltip?: string;\n\n /**\n * Determines whether the action should be enabled.\n */\n isEnabled?: boolean;\n\n /**\n * A series of key/value pairs indicating features that the item requires with corresponding minimum version. When a feature is missing or of insufficient version, fallback is triggered.\n */\n requires?: Record<string, string>;\n}\n\nexport class Action implements IAction {\n /**\n * A unique identifier associated with this Action.\n */\n id?: string;\n\n /**\n * Label for button or link that represents this action.\n */\n title?: string;\n\n /**\n * Optional icon to be shown on the action in conjunction with the title. Supports data URI in version 1.2+\n */\n iconUrl?: string;\n\n /**\n * Controls the style of an Action, which influences how the action is displayed, spoken, etc.\n */\n style?: 'default' | 'positive' | 'destructive';\n\n /**\n * Describes what to do when an unknown element is encountered or the requires of this or any children can’t be met.\n */\n fallback?: IAction | string;\n\n /**\n * Determines whether an action is displayed with a button or is moved to the overflow menu.\n */\n mode?: 'primary' | 'secondary';\n\n /**\n * Defines text that should be displayed to the end user as they hover the mouse over the action, and read when using narration software.\n */\n tooltip?: string;\n\n /**\n * Determines whether the action should be enabled.\n */\n isEnabled?: boolean;\n\n /**\n * A series of key/value pairs indicating features that the item requires with corresponding minimum version. When a feature is missing or of insufficient version, fallback is triggered.\n */\n requires?: Record<string, string>;\n\n constructor(value: IAction = {}) {\n Object.assign(this, value);\n }\n\n withId(value: string) {\n this.id = value;\n return this;\n }\n\n withTitle(value: string) {\n this.title = value;\n return this;\n }\n\n withIconUrl(value: string) {\n this.iconUrl = value;\n return this;\n }\n\n withStyle(value: 'default' | 'positive' | 'destructive') {\n this.style = value;\n return this;\n }\n\n withFallback(value: IAction | string) {\n this.fallback = value;\n return this;\n }\n\n withMode(value: 'primary' | 'secondary') {\n this.mode = value;\n return this;\n }\n\n withTooltip(value: string) {\n this.tooltip = value;\n return this;\n }\n\n withEnabled(value = true) {\n this.isEnabled = value;\n return this;\n }\n\n withRequires(value: Record<string, string>) {\n this.requires = value;\n return this;\n }\n\n withRequire(key: string, value: string) {\n if (!this.requires) {\n this.requires = {};\n }\n\n this.requires[key] = value;\n return this;\n }\n}\n"]}