hongluan-ui
Version:
Hongluan Component Library for Vue 3
1 lines • 2.29 kB
Source Map (JSON)
{"version":3,"file":"badge2.mjs","sources":["../../../../../../packages/components/badge/src/badge.ts"],"sourcesContent":["import { isValidComponentType } from '@hongluan-ui/utils'\n\nimport type { ComponentType } from '@hongluan-ui/constants'\nimport type { ExtractPropTypes, PropType, StyleValue } from 'vue'\n\nexport type BadgePosition = 'lt' | 'rt' | 'lb' | 'rb'\n\nexport const badgeProps = {\n /**\n * @description display value.\n */\n value: {\n type: [String, Number] as PropType<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 position: String as PropType<BadgePosition>,\n offset: Array as PropType<string[]>,\n /**\n * @description if a little dot is displayed.\n */\n dot: Boolean,\n round: Boolean,\n hidden: Boolean,\n /**\n * @description badge type.\n */\n type: {\n type: String as PropType<ComponentType>,\n validator: isValidComponentType,\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 background color of the Badge\n */\n color: String,\n /**\n * @description custom class name of badge\n */\n badgeClass: {\n type: String,\n },\n /**\n * @description CSS style of badge\n */\n badgeStyle: {\n type: [String, Object, Array] as PropType<StyleValue>,\n },\n\n}\n\nexport type BadgeProps = ExtractPropTypes<typeof badgeProps>\n"],"names":[],"mappings":";;;AACY,MAAC,UAAU,GAAG;AAC1B,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE,MAAM;AAClB,EAAE,MAAM,EAAE,KAAK;AACf,EAAE,GAAG,EAAE,OAAO;AACd,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,SAAS,EAAE,oBAAoB;AACnC,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;AACjC,GAAG;AACH;;;;"}