zhangyong
2023-08-22 1353e87cb21a4032d585d7404bae9042f2ebcf08
1
{"version":3,"file":"progress.mjs","sources":["../../../../../../packages/components/progress/src/progress.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes, 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 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: {\n    type: Boolean,\n    default: false,\n  },\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: {\n    type: Boolean,\n    default: false,\n  },\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\nexport type ProgressProps = ExtractPropTypes<typeof progressProps>\nexport type ProgressInstance = InstanceType<typeof Progress>\n"],"names":[],"mappings":";;;AACY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC;AAC3C,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,SAAS,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG;AAC9C,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,CAAC;AACnD,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OA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