UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 2.43 kB
{"version":3,"file":"avatar.mjs","sources":["../../../../../../packages/components/avatar/src/avatar.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isNumber,\n} from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\n\nimport type {\n CSSProperties,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n} from 'vue'\n\nexport const avatarProps = buildProps({\n /**\n * @description avatar size.\n */\n size: {\n type: [Number, String],\n values: componentSizes,\n default: '',\n validator: (val: unknown): val is number => isNumber(val),\n },\n /**\n * @description avatar shape.\n */\n shape: {\n type: String,\n values: ['circle', 'square'],\n default: 'circle',\n },\n /**\n * @description representation type to icon, more info on icon component.\n */\n icon: {\n type: iconPropType,\n },\n /**\n * @description the source of the image for an image avatar.\n */\n src: {\n type: String,\n default: '',\n },\n /**\n * @description native attribute `alt` of image avatar.\n */\n alt: String,\n /**\n * @description native attribute srcset of image avatar.\n */\n srcSet: String,\n /**\n * @description set how the image fit its container for an image avatar.\n */\n fit: {\n type: definePropType<CSSProperties['object-fit']>(String),\n default: 'cover',\n },\n} as const)\nexport type AvatarProps = ExtractPropTypes<typeof avatarProps>\nexport type AvatarPropsPublic = ExtractPublicPropTypes<typeof avatarProps>\n\nexport const avatarEmits = {\n error: (evt: Event) => evt instanceof Event,\n}\nexport type AvatarEmits = typeof avatarEmits\n"],"names":[],"mappings":";;;;;AAcO,MAAM,cAAc,UAAW,CAAA;AAAA,EAIpC,IAAM,EAAA;AAAA,IACJ,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,IACrB,MAAQ,EAAA,cAAA;AAAA,IACR,OAAS,EAAA,EAAA;AAAA,IACT,SAAW,EAAA,CAAC,GAAgC,KAAA,QAAA,CAAS,GAAG,CAAA;AAAA,GAC1D;AAAA,EAIA,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,MAAA,EAAQ,CAAC,QAAA,EAAU,QAAQ,CAAA;AAAA,IAC3B,OAAS,EAAA,QAAA;AAAA,GACX;AAAA,EAIA,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,YAAA;AAAA,GACR;AAAA,EAIA,GAAK,EAAA;AAAA,IACH,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,GAAK,EAAA,MAAA;AAAA,EAIL,MAAQ,EAAA,MAAA;AAAA,EAIR,GAAK,EAAA;AAAA,IACH,IAAA,EAAM,eAA4C,MAAM,CAAA;AAAA,IACxD,OAAS,EAAA,OAAA;AAAA,GACX;AACF,CAAU,EAAA;AAIH,MAAM,WAAc,GAAA;AAAA,EACzB,KAAA,EAAO,CAAC,GAAA,KAAe,GAAe,YAAA,KAAA;AACxC;;;;"}