Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add progress files #214

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
:: BASE_DOC ::

## API

### Progress Props

name | type | default | description | required
-- | -- | -- | -- | --
color | String / Object / Array | '' | Typescript:`string \| Array<string> \| Record<string, string>` | N
label | String / Boolean / Slot / Function | true | Typescript:`string \| boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
percentage | Number | 0 | \- | N
size | String / Number | 'medium' | \- | N
status | String | - | options: success/error/warning/active。Typescript:`StatusEnum` `type StatusEnum = 'success' \| 'error' \| 'warning' \| 'active'`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
strokeWidth | String / Number | - | \- | N
theme | String | line | options: line/plump/circle。Typescript:`ThemeEnum` `type ThemeEnum = 'line' \| 'plump' \| 'circle'`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
trackColor | String | '' | \- | N
fixedWidth | Boolean | false | \- | N
17 changes: 17 additions & 0 deletions packages/products/tdesign-vue-next/src/progress/progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
:: BASE_DOC ::

## API

### Progress Props

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
color | String / Object / Array | '' | 进度条颜色。示例:'#ED7B2F' 或 'orange' 或 `['#f00', '#0ff', '#f0f']` 或 `{ '0%': '#f00', '100%': '#0ff' }` 或 `{ from: '#000', to: '#000' }` 等。TS 类型:`string \| Array<string> \| Record<string, string>` | N
label | String / Boolean / Slot / Function | true | 进度百分比,可自定义。TS 类型:`string \| boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
percentage | Number | 0 | 进度条百分比 | N
size | String / Number | 'medium' | 进度条尺寸,示例:small/medium/large/240。small 值为 72; medium 值为 112;large 值为 160 | N
status | String | - | 进度条状态。可选项:success/error/warning/active。TS 类型:`StatusEnum` `type StatusEnum = 'success' \| 'error' \| 'warning' \| 'active'`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
strokeWidth | String / Number | - | 进度条线宽。宽度数值不能超过 size 的一半,否则不能输出环形进度 | N
theme | String | line | 进度条风格。值为 line,标签(label)显示在进度条右侧;值为 plump,标签(label)显示在进度条里面;值为 circle,标签(label)显示在进度条正中间。可选项:line/plump/circle。TS 类型:`ThemeEnum` `type ThemeEnum = 'line' \| 'plump' \| 'circle'`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
trackColor | String | '' | 进度条未完成部分颜色 | N
fixedWidth | Boolean | false | 固定进度条宽度,不受百分比文案影响 | N
62 changes: 62 additions & 0 deletions packages/products/tdesign-vue-next/src/progress/props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* eslint-disable */

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdProgressProps } from './type';
import { PropType } from 'vue';

export default {
/** 进度条颜色。示例:'#ED7B2F' 或 'orange' 或 `['#f00', '#0ff', '#f0f']` 或 `{ '0%': '#f00', '100%': '#0ff' }` 或 `{ from: '#000', to: '#000' }` 等 */
color: {
type: [String, Object, Array] as PropType<TdProgressProps['color']>,
default: '' as TdProgressProps['color'],
},
/** 进度百分比,可自定义 */
label: {
type: [String, Boolean, Function] as PropType<TdProgressProps['label']>,
default: true as TdProgressProps['label'],
},
/** 进度条百分比 */
percentage: {
type: Number,
default: 0,
},
/** 进度条尺寸,示例:small/medium/large/240。small 值为 72; medium 值为 112;large 值为 160 */
size: {
type: [String, Number] as PropType<TdProgressProps['size']>,
default: 'medium' as TdProgressProps['size'],
},
/** 进度条状态 */
status: {
type: String as PropType<TdProgressProps['status']>,
validator(val: TdProgressProps['status']): boolean {
if (!val) return true;
return ['success', 'error', 'warning', 'active'].includes(val);
},
},
/** 进度条线宽。宽度数值不能超过 size 的一半,否则不能输出环形进度 */
strokeWidth: {
type: [String, Number] as PropType<TdProgressProps['strokeWidth']>,
},
/** 进度条风格。值为 line,标签(label)显示在进度条右侧;值为 plump,标签(label)显示在进度条里面;值为 circle,标签(label)显示在进度条正中间 */
theme: {
type: String as PropType<TdProgressProps['theme']>,
default: 'line' as TdProgressProps['theme'],
validator(val: TdProgressProps['theme']): boolean {
if (!val) return true;
return ['line', 'plump', 'circle'].includes(val);
},
},
/** 进度条未完成部分颜色 */
trackColor: {
type: String,
default: '',
},
/** 固定进度条宽度,不受百分比文案影响 */
fixedWidth: {
type: Boolean,
default: false,
},
};
57 changes: 57 additions & 0 deletions packages/products/tdesign-vue-next/src/progress/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* eslint-disable */

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TNode } from '../common';

export interface TdProgressProps {
/**
* 进度条颜色。示例:'#ED7B2F' 或 'orange' 或 `['#f00', '#0ff', '#f0f']` 或 `{ '0%': '#f00', '100%': '#0ff' }` 或 `{ from: '#000', to: '#000' }` 等
* @default ''
*/
color?: string | Array<string> | Record<string, string>;
/**
* 进度百分比,可自定义
* @default true
*/
label?: string | boolean | TNode;
/**
* 进度条百分比
* @default 0
*/
percentage?: number;
/**
* 进度条尺寸,示例:small/medium/large/240。small 值为 72; medium 值为 112;large 值为 160
* @default 'medium'
*/
size?: string | number;
/**
* 进度条状态
*/
status?: StatusEnum;
/**
* 进度条线宽。宽度数值不能超过 size 的一半,否则不能输出环形进度
*/
strokeWidth?: string | number;
/**
* 进度条风格。值为 line,标签(label)显示在进度条右侧;值为 plump,标签(label)显示在进度条里面;值为 circle,标签(label)显示在进度条正中间
* @default line
*/
theme?: ThemeEnum;
/**
* 进度条未完成部分颜色
* @default ''
*/
trackColor?: string;
/**
* 固定进度条宽度,不受百分比文案影响
* @default false
*/
fixedWidth?: boolean;
}

export type StatusEnum = 'success' | 'error' | 'warning' | 'active';

export type ThemeEnum = 'line' | 'plump' | 'circle';
37 changes: 37 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -73711,6 +73711,43 @@
"Array"
]
},
{
"id": 1702001811,
"platform_framework": [
"1"
],
"component": "Progress",
"field_category": 1,
"field_name": "fixedWidth",
"field_type": [
"4"
],
"field_default_value": "false",
"field_enum": "",
"field_desc_zh": "固定进度条宽度,不受百分比文案影响",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2023-12-08 02:16:51",
"update_time": "2023-12-08 02:16:51",
"event_output": null,
"custom_field_type": null,
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(PC)"
],
"field_type_text": [
"Boolean"
]
},
{
"id": 923,
"platform_framework": [
Expand Down