Skip to content

Commit

Permalink
docs(Indexes): generate api docs (#419)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
anlyyao and github-actions[bot] authored Sep 11, 2024
1 parent 067b85a commit 6ddba39
Show file tree
Hide file tree
Showing 14 changed files with 185 additions and 6 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name | type | default | description | required
-- | -- | -- | -- | --
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
index-list | Array | - | `0.32.0`。Typescript:`string [] \| number[]` | N
index-list | Array | - | `0.32.0`。Typescript:`Array<string \| number>` | N
list | Array | [] | `deprecated`。Typescript:`ListItem[] ` `interface ListItem { title: string; index: string; children: { title: string; [key: string]: any} [] }`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/indexes/type.ts) | N
sticky | Boolean | true | Typescript:`Boolean` | N
sticky-offset | Number | 0 | `1.0.0` | N
Expand All @@ -28,6 +28,7 @@ name | type | default | description | required
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
index | String / Number | - | \- | N

### IndexesAnchor External Classes

className | Description
Expand Down
3 changes: 2 additions & 1 deletion packages/products/tdesign-miniprogram/src/indexes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-- | -- | -- | -- | --
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
index-list | Array | - | `0.32.0`。索引字符列表。不传默认 `A-Z`。TS 类型:`string [] \| number[]` | N
index-list | Array | - | `0.32.0`。索引字符列表。不传默认 `A-Z`。TS 类型:`Array<string \| number>` | N
list | Array | [] | 已废弃。索引列表的列表数据。每个元素包含三个子元素,index(string):索引值,例如1,2,3,...或A,B,C等;title(string): 索引标题,可不填将默认设为索引值;children(Array<{title: string}>): 子元素列表,title为子元素的展示文案。TS 类型:`ListItem[] ` `interface ListItem { title: string; index: string; children: { title: string; [key: string]: any} [] }`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/indexes/type.ts) | N
sticky | Boolean | true | 索引是否吸顶,默认为true。TS 类型:`Boolean` | N
sticky-offset | Number | 0 | `1.0.0`。锚点吸顶时与顶部的距离 | N
Expand All @@ -28,6 +28,7 @@ select | `(index: string \| number)` | 点击侧边栏时触发事件
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
index | String / Number | - | 索引字符 | N

### IndexesAnchor External Classes

类名 | 描述
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-miniprogram/src/indexes/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface TdIndexesProps {
*/
indexList?: {
type: ArrayConstructor;
value?: string[] | number[];
value?: Array<string | number>;
};
/**
* 索引是否吸顶,默认为true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdIndexesProps } from './type';

export const indexesDefaultProps: TdIndexesProps = { sticky: true, stickyOffset: 0 };
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
:: BASE_DOC ::

## API


### Indexes Props

name | type | default | description | required
-- | -- | -- | -- | --
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
indexList | Array | - | Typescript:`Array<string \| number>` | N
list | Array | [] | `deprecated`。Typescript:`ListItem[] ` `interface ListItem { title: string; index: string; children: { title: string; [key: string]: any} [] }`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/indexes/type.ts) | N
sticky | Boolean | true | Typescript:`Boolean` | N
stickyOffset | Number | 0 | \- | N
onChange | Function | | Typescript:`(index: string \| number) => void`<br/> | N
onSelect | Function | | Typescript:`(index: string \| number) => void`<br/> | N


### IndexesAnchor Props

name | type | default | description | required
-- | -- | -- | -- | --
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
index | String / Number | - | \- | N
26 changes: 26 additions & 0 deletions packages/products/tdesign-mobile-react/src/indexes/indexes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
:: BASE_DOC ::

## API


### Indexes Props

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
indexList | Array | - | 索引字符列表。不传默认 `A-Z`。TS 类型:`Array<string \| number>` | N
list | Array | [] | 已废弃。索引列表的列表数据。每个元素包含三个子元素,index(string):索引值,例如1,2,3,...或A,B,C等;title(string): 索引标题,可不填将默认设为索引值;children(Array<{title: string}>): 子元素列表,title为子元素的展示文案。TS 类型:`ListItem[] ` `interface ListItem { title: string; index: string; children: { title: string; [key: string]: any} [] }`[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/indexes/type.ts) | N
sticky | Boolean | true | 索引是否吸顶,默认为true。TS 类型:`Boolean` | N
stickyOffset | Number | 0 | 锚点吸顶时与顶部的距离 | N
onChange | Function | | TS 类型:`(index: string \| number) => void`<br/>索引发生变更时触发事件 | N
onSelect | Function | | TS 类型:`(index: string \| number) => void`<br/>点击侧边栏时触发事件 | N


### IndexesAnchor Props

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
index | String / Number | - | 索引字符 | N
37 changes: 37 additions & 0 deletions packages/products/tdesign-mobile-react/src/indexes/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* eslint-disable */

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

export interface TdIndexesProps {
/**
* 索引字符列表。不传默认 `A-Z`
*/
indexList?: Array<string | number>;
/**
* 索引是否吸顶,默认为true
* @default true
*/
sticky?: Boolean;
/**
* 锚点吸顶时与顶部的距离
* @default 0
*/
stickyOffset?: number;
/**
* 索引发生变更时触发事件
*/
onChange?: (index: string | number) => void;
/**
* 点击侧边栏时触发事件
*/
onSelect?: (index: string | number) => void;
}

export interface TdIndexesAnchorProps {
/**
* 索引字符
*/
index?: string | number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable */

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

import { TdIndexesAnchorProps } from '../indexes/type';
import { PropType } from 'vue';

export default {
/** 索引字符 */
index: {
type: [String, Number] as PropType<TdIndexesAnchorProps['index']>,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

name | type | default | description | required
-- | -- | -- | -- | --
indexList | Array | - | Typescript:`string [] \| number[]` | N
indexList | Array | - | Typescript:`Array<string \| number>` | N
sticky | Boolean | true | Typescript:`Boolean` | N
stickyOffset | Number | 0 | \- | N
onChange | Function | | Typescript:`(index: string \| number) => void`<br/> | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
indexList | Array | - | 索引字符列表。不传默认 `A-Z`。TS 类型:`string [] \| number[]` | N
indexList | Array | - | 索引字符列表。不传默认 `A-Z`。TS 类型:`Array<string \| number>` | N
sticky | Boolean | true | 索引是否吸顶,默认为true。TS 类型:`Boolean` | N
stickyOffset | Number | 0 | 锚点吸顶时与顶部的距离 | N
onChange | Function | | TS 类型:`(index: string \| number) => void`<br/>索引发生变更时触发事件 | N
Expand Down
29 changes: 29 additions & 0 deletions packages/products/tdesign-mobile-vue/src/indexes/props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* eslint-disable */

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

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

export default {
/** 索引字符列表。不传默认 `A-Z` */
indexList: {
type: Array as PropType<TdIndexesProps['indexList']>,
},
/** 索引是否吸顶,默认为true */
sticky: {
type: Boolean,
default: true,
},
/** 锚点吸顶时与顶部的距离 */
stickyOffset: {
type: Number,
default: 0,
},
/** 索引发生变更时触发事件 */
onChange: Function as PropType<TdIndexesProps['onChange']>,
/** 点击侧边栏时触发事件 */
onSelect: Function as PropType<TdIndexesProps['onSelect']>,
};
37 changes: 37 additions & 0 deletions packages/products/tdesign-mobile-vue/src/indexes/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* eslint-disable */

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

export interface TdIndexesProps {
/**
* 索引字符列表。不传默认 `A-Z`
*/
indexList?: Array<string | number>;
/**
* 索引是否吸顶,默认为true
* @default true
*/
sticky?: Boolean;
/**
* 锚点吸顶时与顶部的距离
* @default 0
*/
stickyOffset?: number;
/**
* 索引发生变更时触发事件
*/
onChange?: (index: string | number) => void;
/**
* 点击侧边栏时触发事件
*/
onSelect?: (index: string | number) => void;
}

export interface TdIndexesAnchorProps {
/**
* 索引字符
*/
index?: string | number;
}
2 changes: 1 addition & 1 deletion packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -62059,7 +62059,7 @@
"create_time": "2022-12-22 09:18:18",
"update_time": "2022-12-22 09:18:18",
"event_output": null,
"custom_field_type": "string [] | number[]",
"custom_field_type": "Array<string | number>",
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
Expand Down

0 comments on commit 6ddba39

Please sign in to comment.