{"version":3,"file":"progress.mjs","sources":["../../../../../../../packages/components/progress/src/progress.ts"],"sourcesContent":["import { buildProps, definePropType } from '@hd-front-end/utils'\n\nimport type {\n  ExtractPropTypes,\n  SVGAttributes,\n  __ExtractPublicPropTypes,\n} 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: 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\nexport type ProgressProps = ExtractPropTypes<typeof progressProps>\nexport type ProgressPropsPublic = __ExtractPublicPropTypes<typeof progressProps>\nexport type ProgressInstance = InstanceType<typeof Progress> & unknown\n"],"names":[],"mappings":";;AAYO,MAAM,gBAAgB,UAAW,CAAA;AAAA,EAItC,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,MAAA;AAAA,IACT,MAAQ,EAAA,CAAC,MAAQ,EAAA,QAAA,EAAU,WAAW,CAAA;AAAA,GACxC;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,IACT,SAAW,EAAA,CAAC,GAAyB,KAAA,GAAA,IAAO,KAAK,GAAO,IAAA,GAAA;AAAA,GAC1D;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,IACT,MAAQ,EAAA,CAAC,EAAI,EAAA,SAAA,EAAW,aAAa,SAAS,CAAA;AAAA,GAChD;AAAA,EAIA,aAAe,EAAA,OAAA;AAAA,EAIf,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EAIA,WAAa,EAAA;AAAA,IACX,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EAIA,aAAe,EAAA;AAAA,IACb,IAAA,EAAM,eAA6D,MAAM,CAAA;AAAA,IACzE,OAAS,EAAA,OAAA;AAAA,GACX;AAAA,EAIA,UAAY,EAAA,OAAA;AAAA,EAIZ,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,GAAA;AAAA,GACX;AAAA,EAIA,QAAU,EAAA;AAAA,IAC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