UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 3.1 kB
{"version":3,"file":"badge.mjs","names":[],"sources":["../../../../../../packages/components/badge/src/badge.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPublicPropTypes, StyleValue } from 'vue'\n\nexport interface BadgeProps {\n /**\n * @description display value.\n */\n value?: string | number\n /**\n * @description maximum value, shows `{max}+` when exceeded. Only works if value is a number.\n */\n max?: number\n /**\n * @description if a little dot is displayed.\n */\n isDot?: boolean\n /**\n * @description hidden badge.\n */\n hidden?: boolean\n /**\n * @description badge type.\n */\n type?: 'primary' | 'success' | 'warning' | 'info' | 'danger'\n /**\n * @description whether to show badge when value is zero.\n */\n showZero?: boolean\n /**\n * @description customize dot background color\n */\n color?: string\n /**\n * @description CSS style of badge\n */\n badgeStyle?: StyleValue\n /**\n * @description set offset of the badge\n */\n offset?: [number, number]\n /**\n * @description custom class name of badge\n */\n badgeClass?: string\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `BadgeProps` instead.\n */\nexport const badgeProps = buildProps({\n /**\n * @description display value.\n */\n value: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description maximum value, shows `{max}+` when exceeded. Only works if value is a number.\n */\n max: {\n type: Number,\n default: 99,\n },\n /**\n * @description if a little dot is displayed.\n */\n isDot: Boolean,\n /**\n * @description hidden badge.\n */\n hidden: Boolean,\n /**\n * @description badge type.\n */\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'info', 'danger'],\n default: 'danger',\n },\n /**\n * @description whether to show badge when value is zero.\n */\n showZero: {\n type: Boolean,\n default: true,\n },\n /**\n * @description customize dot background color\n */\n color: String,\n /**\n * @description CSS style of badge\n */\n badgeStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n },\n /**\n * @description set offset of the badge\n */\n offset: {\n type: definePropType<[number, number]>(Array),\n default: () => [0, 0],\n },\n /**\n * @description custom class name of badge\n */\n badgeClass: {\n type: String,\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `BadgeProps` instead.\n */\nexport type BadgePropsPublic = ExtractPublicPropTypes<typeof badgeProps>\n"],"mappings":";;;;;;AAkDA,MAAa,aAAa,WAAW;CAInC,OAAO;EACL,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;CAID,KAAK;EACH,MAAM;EACN,SAAS;EACV;CAID,OAAO;CAIP,QAAQ;CAIR,MAAM;EACJ,MAAM;EACN,QAAQ;GAAC;GAAW;GAAW;GAAW;GAAQ;GAAS;EAC3D,SAAS;EACV;CAID,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,OAAO;CAIP,YAAY,EACV,MAAM,eAA2B;EAAC;EAAQ;EAAQ;EAAM,CAAC,EAC1D;CAID,QAAQ;EACN,MAAM,eAAiC,MAAM;EAC7C,eAAe,CAAC,GAAG,EAAE;EACtB;CAID,YAAY,EACV,MAAM,QACP;CACF,CAAU"}