import snippets from './snippets'; export default { snippets, componentName: 'Progress', title: 'progress bar', category: 'Feedback', props: [ { name: 'type', title: { label: 'type', tip: 'type' }, propType: { type: 'oneOf', value: ['line', 'circle', 'dashboard'] }, setter: { componentName: 'RadioGroupSetter', props: { options: [ { title: 'linear', value: 'line' }, { title: 'round type', value: 'circle' }, { title: 'dash board', value: 'dashboard' }, ], }, }, defaultValue: 'line', }, { name: 'format', title: { label: 'content format', tip: 'content format' }, propType: 'func', }, { name: 'percent', title: { label: 'percentage', tip: 'percentage' }, propType: 'number', }, { name: 'showInfo', title: { label: 'display values or icons', tip: 'display values or icons' }, propType: 'bool', defaultValue: true, }, { name: 'status', title: { label: 'status', tip: 'status' }, propType: { type: 'oneOf', value: ['success', 'exception', 'normal', 'active'], }, }, { name: 'steps', title: { label: 'total steps', tip: 'The total number of steps in the progress bar' }, condition(target) { // 仅线型有效 return target.getProps().getPropValue('type') === 'line'; }, propType: 'number', }, { name: 'strokeLinecap', title: { label: 'progress bar style', tip: 'progress bar style' }, propType: { type: 'oneOf', value: ['round', 'square'], }, setter: { componentName: 'RadioGroupSetter', props: { options: [ { title: 'rounded corners', value: 'round' }, { title: 'direction', value: 'square' }, ], }, }, defaultValue: 'round', }, { name: 'strokeWidth', title: { label: 'line width', tip: 'line width' }, propType: 'number', }, { name: 'strokeColor', title: { label: 'progress bar color', tip: 'progress bar color' }, propType: 'string', condition(target) { // 仪表盘样式无效 return target.getProps().getPropValue('type') !== 'dashboard'; }, setter: 'ColorSetter', }, { name: 'trailColor', title: { label: 'trail color', tip: 'The color of unfinished segments', }, propType: 'string', setter: 'ColorSetter', }, { name: 'gapDegree', title: { label: 'notch angle', tip: 'The notch angle of the dashboard progress bar, which can range from 0 to 295', }, condition(target) { // Only the dashboard style is valid return target.getProps().getPropValue('type') === 'dashboard'; }, propType: 'number', defaultValue: 75, }, { name: 'gapPosition', title: { label: 'notch position', tip: 'dashboard progress bar notch position', }, condition(target) { // Only the dashboard style is valid return target.getProps().getPropValue('type') === 'dashboard'; }, propType: { type: 'oneOf', value: ['top', 'bottom', 'left', 'right'], }, defaultValue: 'bottom', }, ], configure: { supports: { style: true } }, };