UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 3.6 kB
{"version":3,"file":"badge.mjs","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"],"names":[],"mappings":";;AAkDO,MAAM,aAAa,UAAA,CAAW;AAAA;AAAA;AAAA;AAAA,EAInC,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,IACrB,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,GAAA,EAAK;AAAA,IACH,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,KAAA,EAAO,OAAA;AAAA;AAAA;AAAA;AAAA,EAIP,MAAA,EAAQ,OAAA;AAAA;AAAA;AAAA;AAAA,EAIR,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,MAAA;AAAA,IACN,QAAQ,CAAC,SAAA,EAAW,SAAA,EAAW,SAAA,EAAW,QAAQ,QAAQ,CAAA;AAAA,IAC1D,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,KAAA,EAAO,MAAA;AAAA;AAAA;AAAA;AAAA,EAIP,UAAA,EAAY;AAAA,IACV,MAAM,cAAA,CAA2B,CAAC,MAAA,EAAQ,MAAA,EAAQ,KAAK,CAAC;AAAA,GAC1D;AAAA;AAAA;AAAA;AAAA,EAIA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,eAAiC,KAAK,CAAA;AAAA,IAC5C,OAAA,EAAS,MAAM,CAAC,CAAA,EAAG,CAAC;AAAA,GACtB;AAAA;AAAA;AAAA;AAAA,EAIA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA;AAEV,CAAU;;;;"}