Skip to content

Commit

Permalink
feat: add start function to Statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
chaishi committed Nov 25, 2023
1 parent 10a2426 commit 608ab14
Show file tree
Hide file tree
Showing 25 changed files with 185 additions and 16 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
13 changes: 11 additions & 2 deletions packages/products/tdesign-miniprogram/src/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type OptionData = {
} & PlainObject;

export type TreeOptionData<T = string | number> = {
children?: Array<TreeOptionData<T>>;
children?: Array<TreeOptionData<T>> | boolean;
/** option label content */
label?: string | TNode;
/** option search text */
Expand All @@ -41,10 +41,15 @@ export type CSSSelector = string;
export interface KeysType {
value?: string;
label?: string;
disabled?: string;
}

export interface TreeKeysType extends KeysType {
children?: string;
}

export interface HTMLElementAttributes {
[css: string]: string;
[attribute: string]: string;
}

export interface TScroll {
Expand Down Expand Up @@ -87,3 +92,7 @@ export interface ScrollToElementParams {
time?: number;
behavior?: 'auto' | 'smooth';
}

export interface ComponentScrollToElementParams extends ScrollToElementParams {
key: string | number;
}
Empty file.
Empty file.
Empty file.
18 changes: 18 additions & 0 deletions packages/products/tdesign-miniprogram/src/statistic/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable */

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

export interface TdStatisticProps {}

/** 组件实例方法 */
export interface StatisticInstanceFunctions {
/**
* 设置数字滚动变化效果,从一个数字到另一个数字
*/
start: {
type: undefined;
value?: (from: number, to: number) => void;
};
}
15 changes: 12 additions & 3 deletions packages/products/tdesign-mobile-react/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ReactElement, ReactNode, CSSProperties, FormEvent, DragEvent, Synthetic
// TElement 表示 API 只接受传入组件
export type TElement<T = undefined> = T extends undefined ? ReactElement : (props: T) => ReactElement;
// 1. TNode = ReactNode; 2. TNode<T> = (props: T) => ReactNode
export type TNode<T = undefined> = T extends undefined ? ReactNode : (ReactNode | ((props: T) => ReactNode));
export type TNode<T = undefined> = T extends undefined ? ReactNode : ReactNode | ((props: T) => ReactNode);

export type AttachNodeReturnValue = HTMLElement | Element | Document;
export type AttachNode = CSSSelector | ((triggerNode?: HTMLElement) => AttachNodeReturnValue);
Expand Down Expand Up @@ -47,7 +47,7 @@ export type OptionData = {
} & PlainObject;

export type TreeOptionData<T = string | number> = {
children?: Array<TreeOptionData<T>>;
children?: Array<TreeOptionData<T>> | boolean;
/** option label content */
label?: string | TNode;
/** option search text */
Expand All @@ -71,10 +71,15 @@ export type CSSSelector = string;
export interface KeysType {
value?: string;
label?: string;
disabled?: string;
}

export interface TreeKeysType extends KeysType {
children?: string;
}

export interface HTMLElementAttributes {
[css: string]: string;
[attribute: string]: string;
}

export interface TScroll {
Expand Down Expand Up @@ -117,3 +122,7 @@ export interface ScrollToElementParams {
time?: number;
behavior?: 'auto' | 'smooth';
}

export interface ComponentScrollToElementParams extends ScrollToElementParams {
key: string | number;
}
Empty file.
Empty file.
15 changes: 15 additions & 0 deletions packages/products/tdesign-mobile-react/src/statistic/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable */

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

export interface TdStatisticProps {}

/** 组件实例方法 */
export interface StatisticInstanceFunctions {
/**
* 设置数字滚动变化效果,从一个数字到另一个数字
*/
start: (from: number, to: number) => void;
}
13 changes: 11 additions & 2 deletions packages/products/tdesign-mobile-vue/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export type OptionData = {
} & PlainObject;

export type TreeOptionData<T = string | number> = {
children?: Array<TreeOptionData<T>>;
children?: Array<TreeOptionData<T>> | boolean;
/** option label content */
label?: string | TNode;
/** option search text */
Expand All @@ -75,10 +75,15 @@ export type CSSSelector = string;
export interface KeysType {
value?: string;
label?: string;
disabled?: string;
}

export interface TreeKeysType extends KeysType {
children?: string;
}

export interface HTMLElementAttributes {
[css: string]: string;
[attribute: string]: string;
}

export interface TScroll {
Expand Down Expand Up @@ -121,3 +126,7 @@ export interface ScrollToElementParams {
time?: number;
behavior?: 'auto' | 'smooth';
}

export interface ComponentScrollToElementParams extends ScrollToElementParams {
key: string | number;
}
Empty file.
Empty file.
Empty file.
Empty file.
14 changes: 11 additions & 3 deletions packages/products/tdesign-react/src/statistic/statistic.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ className | String | - | 类名 | N
style | Object | - | 样式,Typescript:`React.CSSProperties` | N
animation | Object | - | Animation effect control, `duration` refers to the transition time of the animation `unit: millisecond`, `valueFrom` refers to the initial value of the animation. `{ duration, valueFrom }`。Typescript:`animation` `interface animation { duration: number; valueFrom: number; }`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/statistic/type.ts) | N
animationStart | Boolean | false | Whether to start animation | N
color | String | - | Color style, followed by TDesign style black, blue, red, orange, green.Can also be any RGB equivalent supported by [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value)。optionsblack/blue/red/orange/green | N
color | String | - | Color style, followed by TDesign style black, blue, red, orange, green.Can also be any RGB equivalent supported by [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value)。options: black/blue/red/orange/green | N
decimalPlaces | Number | - | Decimal places | N
extra | TNode | - | Additional display content。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
format | Function | - | Format numeric display value。Typescript:`(value: number) => number` | N
Expand All @@ -18,7 +18,15 @@ prefix | TNode | - | Prefix content, display priority is higher than trend。Typ
separator | String | , | The carry separator is displayed by default, and can be customized to other content. When `separator = ''` is set to an empty string/null/undefined, the separator is hidden | N
suffix | TNode | - | Suffix content, display priority is higher than trend。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
title | TNode | - | The title of Statistic。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
trend | String | - | trend。optionsincrease/decrease | N
trendPlacement | String | left | Position of trending placements。optionsleft/right | N
trend | String | - | trend。options: increase/decrease | N
trendPlacement | String | left | Position of trending placements。options: left/right | N
unit | TNode | - | Unit content。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
value | Number | - | The value of Statistic | N

### StatisticInstanceFunctions 组件实例方法

name | params | return | description
-- | -- | -- | --
className | String | - | 类名 | N
style | Object | - | 样式,Typescript:`React.CSSProperties` | N
start | `(from: number, to: number)` | \- | required。Digital scrolling change, from one number to another number
8 changes: 8 additions & 0 deletions packages/products/tdesign-react/src/statistic/statistic.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ trend | String | - | 趋势。可选项:increase/decrease | N
trendPlacement | String | left | 趋势展示位置。可选项:left/right | N
unit | TNode | - | 单位内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
value | Number | - | 数值显示的值 | N

### StatisticInstanceFunctions 组件实例方法

名称 | 参数 | 返回值 | 描述
-- | -- | -- | --
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
start | `(from: number, to: number)` | \- | 必需。设置数字滚动变化效果,从一个数字到另一个数字
8 changes: 8 additions & 0 deletions packages/products/tdesign-react/src/statistic/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ export interface TdStatisticProps {
value?: number;
}

/** 组件实例方法 */
export interface StatisticInstanceFunctions {
/**
* 设置数字滚动变化效果,从一个数字到另一个数字
*/
start: (from: number, to: number) => void;
}

export interface animation {
duration: number;
valueFrom: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name | type | default | description | required
-- | -- | -- | -- | --
animation | Object | - | Animation effect control, `duration` refers to the transition time of the animation `unit: millisecond`, `valueFrom` refers to the initial value of the animation. `{ duration, valueFrom }`。Typescript:`animation` `interface animation { duration: number; valueFrom: number; }`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/statistic/type.ts) | N
animationStart | Boolean | false | Whether to start animation | N
color | String | - | Color style, followed by TDesign style black, blue, red, orange, green.Can also be any RGB equivalent supported by [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value)。optionsblack/blue/red/orange/green | N
color | String | - | Color style, followed by TDesign style black, blue, red, orange, green.Can also be any RGB equivalent supported by [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value)。options: black/blue/red/orange/green | N
decimalPlaces | Number | - | Decimal places | N
extra | String / Slot / Function | - | Additional display content。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
format | Function | - | Format numeric display value。Typescript:`(value: number) => number` | N
Expand All @@ -16,7 +16,13 @@ prefix | String / Slot / Function | - | Prefix content, display priority is high
separator | String | , | The carry separator is displayed by default, and can be customized to other content. When `separator = ''` is set to an empty string/null/undefined, the separator is hidden | N
suffix | String / Slot / Function | - | Suffix content, display priority is higher than trend。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
title | String / Slot / Function | - | The title of Statistic。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
trend | String | - | trend。optionsincrease/decrease | N
trendPlacement | String | left | Position of trending placements。optionsleft/right | N
trend | String | - | trend。options: increase/decrease | N
trendPlacement | String | left | Position of trending placements。options: left/right | N
unit | String / Slot / Function | - | Unit content。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
value | Number | - | The value of Statistic | N

### StatisticInstanceFunctions 组件实例方法

name | params | return | description
-- | -- | -- | --
start | `(from: number, to: number)` | \- | required。Digital scrolling change, from one number to another number
6 changes: 6 additions & 0 deletions packages/products/tdesign-vue-next/src/statistic/statistic.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ trend | String | - | 趋势。可选项:increase/decrease | N
trendPlacement | String | left | 趋势展示位置。可选项:left/right | N
unit | String / Slot / Function | - | 单位内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
value | Number | - | 数值显示的值 | N

### StatisticInstanceFunctions 组件实例方法

名称 | 参数 | 返回值 | 描述
-- | -- | -- | --
start | `(from: number, to: number)` | \- | 必需。设置数字滚动变化效果,从一个数字到另一个数字
8 changes: 8 additions & 0 deletions packages/products/tdesign-vue-next/src/statistic/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ export interface TdStatisticProps {
value?: number;
}

/** 组件实例方法 */
export interface StatisticInstanceFunctions {
/**
* 设置数字滚动变化效果,从一个数字到另一个数字
*/
start: (from: number, to: number) => void;
}

export interface animation {
duration: number;
valueFrom: number;
Expand Down
12 changes: 9 additions & 3 deletions packages/products/tdesign-vue/src/statistic/statistic.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name | type | default | description | required
-- | -- | -- | -- | --
animation | Object | - | Animation effect control, `duration` refers to the transition time of the animation `unit: millisecond`, `valueFrom` refers to the initial value of the animation. `{ duration, valueFrom }`。Typescript:`animation` `interface animation { duration: number; valueFrom: number; }`[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/statistic/type.ts) | N
animationStart | Boolean | false | Whether to start animation | N
color | String | - | Color style, followed by TDesign style black, blue, red, orange, green.Can also be any RGB equivalent supported by [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value)。optionsblack/blue/red/orange/green | N
color | String | - | Color style, followed by TDesign style black, blue, red, orange, green.Can also be any RGB equivalent supported by [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value)。options: black/blue/red/orange/green | N
decimalPlaces | Number | - | Decimal places | N
extra | String / Slot / Function | - | Additional display content。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
format | Function | - | Format numeric display value。Typescript:`(value: number) => number` | N
Expand All @@ -16,7 +16,13 @@ prefix | String / Slot / Function | - | Prefix content, display priority is high
separator | String | , | The carry separator is displayed by default, and can be customized to other content. When `separator = ''` is set to an empty string/null/undefined, the separator is hidden | N
suffix | String / Slot / Function | - | Suffix content, display priority is higher than trend。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
title | String / Slot / Function | - | The title of Statistic。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
trend | String | - | trend。optionsincrease/decrease | N
trendPlacement | String | left | Position of trending placements。optionsleft/right | N
trend | String | - | trend。options: increase/decrease | N
trendPlacement | String | left | Position of trending placements。options: left/right | N
unit | String / Slot / Function | - | Unit content。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
value | Number | - | The value of Statistic | N

### StatisticInstanceFunctions 组件实例方法

name | params | return | description
-- | -- | -- | --
start | `(from: number, to: number)` | \- | required。Digital scrolling change, from one number to another number
6 changes: 6 additions & 0 deletions packages/products/tdesign-vue/src/statistic/statistic.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ trend | String | - | 趋势。可选项:increase/decrease | N
trendPlacement | String | left | 趋势展示位置。可选项:left/right | N
unit | String / Slot / Function | - | 单位内容。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
value | Number | - | 数值显示的值 | N

### StatisticInstanceFunctions 组件实例方法

名称 | 参数 | 返回值 | 描述
-- | -- | -- | --
start | `(from: number, to: number)` | \- | 必需。设置数字滚动变化效果,从一个数字到另一个数字
8 changes: 8 additions & 0 deletions packages/products/tdesign-vue/src/statistic/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ export interface TdStatisticProps {
value?: number;
}

/** 组件实例方法 */
export interface StatisticInstanceFunctions {
/**
* 设置数字滚动变化效果,从一个数字到另一个数字
*/
start: (from: number, to: number) => void;
}

export interface animation {
duration: number;
valueFrom: number;
Expand Down
45 changes: 45 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -88314,6 +88314,51 @@
"Number"
]
},
{
"id": 1700880500,
"platform_framework": [
"1",
"2",
"4",
"8",
"16",
"32",
"64"
],
"component": "Statistic",
"field_category": 4,
"field_name": "start",
"field_type": [],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "设置数字滚动变化效果,从一个数字到另一个数字",
"field_desc_en": "Digital scrolling change, from one number to another number",
"field_required": 1,
"event_input": "(from: number, to: number)",
"create_time": "2023-11-25 02:48:20",
"update_time": "2023-11-25 02:48:20",
"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": "Functions",
"platform_framework_text": [
"Vue(PC)",
"React(PC)",
"Angular(PC)",
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
"field_type_text": []
},
{
"id": 1254,
"platform_framework": [
Expand Down

0 comments on commit 608ab14

Please sign in to comment.