element-plus
Version:
A Component Library for Vue 3
1 lines • 2.28 kB
Source Map (JSON)
{"version":3,"file":"result.mjs","names":[],"sources":["../../../../../../packages/components/result/src/result.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport {\n CircleCheckFilled,\n CircleCloseFilled,\n InfoFilled,\n WarningFilled,\n} from '@element-plus/icons-vue'\n\nimport type { Component, ExtractPublicPropTypes } from 'vue'\nimport type Result from './result.vue'\n\nexport const IconMap = {\n primary: 'icon-primary',\n success: 'icon-success',\n warning: 'icon-warning',\n error: 'icon-error',\n info: 'icon-info',\n} as const\n\nexport const IconComponentMap: Record<\n (typeof IconMap)[keyof typeof IconMap],\n Component\n> = {\n [IconMap.primary]: InfoFilled,\n [IconMap.success]: CircleCheckFilled,\n [IconMap.warning]: WarningFilled,\n [IconMap.error]: CircleCloseFilled,\n [IconMap.info]: InfoFilled,\n}\n\nexport interface ResultProps {\n /**\n * @description title of result\n */\n title?: string\n /**\n * @description sub title of result\n */\n subTitle?: string\n /**\n * @description icon type of result\n */\n icon?: 'primary' | 'success' | 'warning' | 'info' | 'error'\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `ResultProps` instead.\n */\nexport const resultProps = buildProps({\n /**\n * @description title of result\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description sub title of result\n */\n subTitle: {\n type: String,\n default: '',\n },\n /**\n * @description icon type of result\n */\n icon: {\n type: String,\n values: ['primary', 'success', 'warning', 'info', 'error'],\n default: 'info',\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `ResultProps` instead.\n */\nexport type ResultPropsPublic = ExtractPublicPropTypes<typeof resultProps>\n\nexport type ResultInstance = InstanceType<typeof Result> & unknown\n"],"mappings":";;;;AAWA,MAAa,UAAU;CACrB,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;CACP,MAAM;CACP;AAED,MAAa,mBAGT;EACD,QAAQ,UAAU;EAClB,QAAQ,UAAU;EAClB,QAAQ,UAAU;EAClB,QAAQ,QAAQ;EAChB,QAAQ,OAAO;CACjB;;;;AAoBD,MAAa,cAAc,WAAW;CAIpC,OAAO;EACL,MAAM;EACN,SAAS;EACV;CAID,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,MAAM;EACJ,MAAM;EACN,QAAQ;GAAC;GAAW;GAAW;GAAW;GAAQ;GAAQ;EAC1D,SAAS;EACV;CACF,CAAU"}