UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 5.02 kB
{"version":3,"file":"progress.mjs","names":[],"sources":["../../../../../../packages/components/progress/src/progress.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPublicPropTypes, SVGAttributes } from 'vue'\nimport type Progress from './progress.vue'\n\nexport type ProgressColor = { color: string; percentage: number }\nexport type ProgressFn = (percentage: number) => string\n\nexport interface ProgressProps {\n /**\n * @description type of progress bar\n */\n type?: 'line' | 'circle' | 'dashboard'\n /**\n * @description percentage, required\n */\n percentage?: number\n /**\n * @description the current status of progress bar\n */\n status?: '' | 'success' | 'exception' | 'warning'\n /**\n * @description set indeterminate progress\n */\n indeterminate?: boolean\n /**\n * @description control the animation duration of indeterminate progress or striped flow progress\n */\n duration?: number\n /**\n * @description the width of progress bar\n */\n strokeWidth?: number\n /**\n * @description butt/circle/dashboard type shape at the end path\n */\n strokeLinecap?: NonNullable<SVGAttributes['stroke-linecap']>\n /**\n * @description whether to place the percentage inside progress bar, only works when `type` is 'line'\n */\n textInside?: boolean\n /**\n * @description the canvas width of circle progress bar\n */\n width?: number\n /**\n * @description whether to show percentage\n */\n showText?: boolean\n /**\n * @description background color of progress bar. Overrides `status` prop\n */\n color?: string | ProgressColor[] | ProgressFn\n /**\n * @description stripe over the progress bar's color\n */\n striped?: boolean\n /**\n * @description get the stripes to flow\n */\n stripedFlow?: boolean\n /**\n * @description custom text format\n */\n format?: ProgressFn\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `ProgressProps` instead.\n */\nexport const progressProps = buildProps({\n /**\n * @description type of progress bar\n */\n type: {\n type: String,\n default: 'line',\n values: ['line', 'circle', 'dashboard'],\n },\n /**\n * @description percentage, required\n */\n percentage: {\n type: Number,\n default: 0,\n validator: (val: number): boolean => val >= 0 && val <= 100,\n },\n /**\n * @description the current status of progress bar\n */\n status: {\n type: String,\n default: '',\n values: ['', 'success', 'exception', 'warning'],\n },\n /**\n * @description set indeterminate progress\n */\n indeterminate: Boolean,\n /**\n * @description control the animation duration of indeterminate progress or striped flow progress\n */\n duration: {\n type: Number,\n default: 3,\n },\n /**\n * @description the width of progress bar\n */\n strokeWidth: {\n type: Number,\n default: 6,\n },\n /**\n * @description butt/circle/dashboard type shape at the end path\n */\n strokeLinecap: {\n type: definePropType<NonNullable<SVGAttributes['stroke-linecap']>>(String),\n default: 'round',\n },\n /**\n * @description whether to place the percentage inside progress bar, only works when `type` is 'line'\n */\n textInside: Boolean,\n /**\n * @description the canvas width of circle progress bar\n */\n width: {\n type: Number,\n default: 126,\n },\n /**\n * @description whether to show percentage\n */\n showText: {\n type: Boolean,\n default: true,\n },\n /**\n * @description background color of progress bar. Overrides `status` prop\n */\n color: {\n type: definePropType<string | ProgressColor[] | ProgressFn>([\n String,\n Array,\n Function,\n ]),\n default: '',\n },\n /**\n * @description stripe over the progress bar's color\n */\n striped: Boolean,\n /**\n * @description get the stripes to flow\n */\n stripedFlow: Boolean,\n /**\n * @description custom text format\n */\n format: {\n type: definePropType<ProgressFn>(Function),\n default: (percentage: number): string => `${percentage}%`,\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `ProgressProps` instead.\n */\nexport type ProgressPropsPublic = ExtractPublicPropTypes<typeof progressProps>\nexport type ProgressInstance = InstanceType<typeof Progress> & unknown\n"],"mappings":";;;;;;AAsEA,MAAa,gBAAgB,WAAW;CAItC,MAAM;EACJ,MAAM;EACN,SAAS;EACT,QAAQ;GAAC;GAAQ;GAAU;GAAY;EACxC;CAID,YAAY;EACV,MAAM;EACN,SAAS;EACT,YAAY,QAAyB,OAAO,KAAK,OAAO;EACzD;CAID,QAAQ;EACN,MAAM;EACN,SAAS;EACT,QAAQ;GAAC;GAAI;GAAW;GAAa;GAAU;EAChD;CAID,eAAe;CAIf,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,aAAa;EACX,MAAM;EACN,SAAS;EACV;CAID,eAAe;EACb,MAAM,eAA6D,OAAO;EAC1E,SAAS;EACV;CAID,YAAY;CAIZ,OAAO;EACL,MAAM;EACN,SAAS;EACV;CAID,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,OAAO;EACL,MAAM,eAAsD;GAC1D;GACA;GACA;GACD,CAAC;EACF,SAAS;EACV;CAID,SAAS;CAIT,aAAa;CAIb,QAAQ;EACN,MAAM,eAA2B,SAAS;EAC1C,UAAU,eAA+B,GAAG,WAAW;EACxD;CACF,CAAU"}