Files
element-plus/packages/components/statistic/src/statistic.ts
yuhengshen cfc661c626 feat(types): [components] add public prop types (#21222)
* feat(types): [utils] add ExtractPublicPropTypes type

* feat(types): [components] add props public type

* chore(types): use type-only import for Prop from 'vue'

Co-authored-by: Noblet Ouways <91417411+Dsaquel@users.noreply.github.com>

---------

Co-authored-by: Noblet Ouways <91417411+Dsaquel@users.noreply.github.com>
2025-07-07 00:51:32 +08:00

70 lines
1.4 KiB
TypeScript

import { buildProps, definePropType } from '@element-plus/utils'
import type {
ExtractPropTypes,
StyleValue,
__ExtractPublicPropTypes,
} from 'vue'
import type { Dayjs } from 'dayjs'
import type Statistic from './statistic.vue'
export const statisticProps = buildProps({
/**
* @description Setting the decimal point
*/
decimalSeparator: {
type: String,
default: '.',
},
/**
* @description Sets the thousandth identifier
*/
groupSeparator: {
type: String,
default: ',',
},
/**
* @description numerical precision
*/
precision: {
type: Number,
default: 0,
},
/**
* @description Custom numerical presentation
*/
formatter: Function,
/**
* @description Numerical content
*/
value: {
type: definePropType<number | Dayjs>([Number, Object]),
default: 0,
},
/**
* @description Sets the prefix of a number
*/
prefix: String,
/**
* @description Sets the suffix of a number
*/
suffix: String,
/**
* @description Numeric titles
*/
title: String,
/**
* @description Styles numeric values
*/
valueStyle: {
type: definePropType<StyleValue>([String, Object, Array]),
},
} as const)
export type StatisticProps = ExtractPropTypes<typeof statisticProps>
export type StatisticPropsPublic = __ExtractPublicPropTypes<
typeof statisticProps
>
export type StatisticInstance = InstanceType<typeof Statistic> & unknown