Skip to content

Commit 39a8f73

Browse files
committed
docs(site): update docs
1 parent 3742198 commit 39a8f73

File tree

104 files changed

+4685
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+4685
-14
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
# Interface
2+
3+
```ts
4+
type DId = string | number;
5+
6+
type DSize = 'smaller' | 'larger';
7+
8+
type DLang = 'en-US' | 'zh-CN';
9+
10+
type DCloneHTMLElement<P = React.HTMLAttributes<HTMLElement>> = (el: React.ReactElement<P>) => React.ReactElement<P>;
11+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
# 接口
2+
3+
```ts
4+
type DId = string | number;
5+
6+
type DSize = 'smaller' | 'larger';
7+
8+
type DLang = 'en-US' | 'zh-CN';
9+
10+
type DCloneHTMLElement<P = React.HTMLAttributes<HTMLElement>> = (el: React.ReactElement<P>) => React.ReactElement<P>;
11+
```

packages/site/src/app/routes/docs/faq/FAQ.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,9 @@ We agree that `undefined` represents that the component is in an uncontrolled st
2020

2121
## What is the general null value of the controlled component
2222

23-
The null value of the controlled component is divided into the following situations:
23+
The null value of the controlled component is generally defined as `null`, please refer to the component API for the actual situation.
2424

25-
- String type: `''`
26-
- number: `null`
27-
- array: `[]`
28-
- Other: `null`
29-
30-
## How to modify `dayjs` configuration
25+
## How to modify dayjs configuration
3126

3227
First of all, we should ensure that the project is the only `dayjs` globally, so the `dayjs` of the component library is placed in `peerDependencies`.
3328

packages/site/src/app/routes/docs/faq/FAQ.zh-CN.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,9 @@
2020

2121
## 受控组件空值一般是什么
2222

23-
受控组件空值分为下面几种情况:
23+
受控组件空值一般定义为 `null`,实际情况请参考组件 API。
2424

25-
- 字符串类型:`''`
26-
- 数字: `null`
27-
- 数组: `[]`
28-
- 其它: `null`
29-
30-
## 如何修改 `dayjs` 配置
25+
## 如何修改 dayjs 配置
3126

3227
首先我们应该确保项目是全局唯一的 `dayjs`,所以组件库的 `dayjs` 是放在 `peerDependencies` 中。
3328

packages/ui/src/components/accordion/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,35 @@ aria: accordion
55
---
66

77
## API
8+
9+
### DAccordionProps
10+
11+
```tsx
12+
interface DAccordionItem<ID extends DId> {
13+
id: ID;
14+
title: React.ReactNode;
15+
region: React.ReactNode;
16+
arrow?: boolean | 'left';
17+
disabled?: boolean;
18+
}
19+
20+
interface DAccordionProps<ID extends DId, T extends DAccordionItem<ID>> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
21+
dList: T[];
22+
dActive?: ID | null | ID[];
23+
dActiveOne?: boolean;
24+
dArrow?: 'left' | 'right' | false;
25+
onActiveChange?: (id: any, item: any) => void;
26+
afterActiveChange?: (id: any, item: any, active: boolean) => void;
27+
}
28+
```
29+
30+
<!-- prettier-ignore-start -->
31+
| Property | Description | Default | Version |
32+
| --- | --- | --- | --- |
33+
| dList | List of data | - | |
34+
| dActive | Expanded item, controlled, defaults to `dActiveOne? null : []` | - | |
35+
| dActiveOne | Expand at most one item | `false` | |
36+
| dArrow | Expand icon position | `'right'` | |
37+
| onActiveChange | Callback for expanding/collapsing items | - | |
38+
| afterActiveChange | Callback when expand/collapse is complete | - | |
39+
<!-- prettier-ignore-end -->

packages/ui/src/components/accordion/README.zh-CN.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,35 @@ title: 手风琴
33
---
44

55
## API
6+
7+
### DAccordionProps
8+
9+
```tsx
10+
interface DAccordionItem<ID extends DId> {
11+
id: ID;
12+
title: React.ReactNode;
13+
region: React.ReactNode;
14+
arrow?: boolean | 'left';
15+
disabled?: boolean;
16+
}
17+
18+
interface DAccordionProps<ID extends DId, T extends DAccordionItem<ID>> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
19+
dList: T[];
20+
dActive?: ID | null | ID[];
21+
dActiveOne?: boolean;
22+
dArrow?: 'left' | 'right' | false;
23+
onActiveChange?: (id: any, item: any) => void;
24+
afterActiveChange?: (id: any, item: any, active: boolean) => void;
25+
}
26+
```
27+
28+
<!-- prettier-ignore-start -->
29+
| 属性 | 说明 | 默认值 | 版本 |
30+
| --- | --- | --- | --- |
31+
| dList | 数据列表 | - | |
32+
| dActive | 展开项目,受控,默认为 `dActiveOne ? null : []` | - | |
33+
| dActiveOne | 至多展开一项 | `false` | |
34+
| dArrow | 展开图标位置 | `'right'` | |
35+
| onActiveChange | 展开/折叠项目的回调 | - | |
36+
| afterActiveChange | 完成展开/折叠的回调 | - | |
37+
<!-- prettier-ignore-end -->

packages/ui/src/components/affix/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,22 @@ title: Affix
44
---
55

66
## API
7+
8+
### DAffixProps
9+
10+
```tsx
11+
interface DAffixProps {
12+
children: React.ReactElement;
13+
dTarget?: DRefExtra | false;
14+
dTop?: number | string;
15+
dZIndex?: number | string;
16+
}
17+
```
18+
19+
<!-- prettier-ignore-start -->
20+
| Property | Description | Default | Version |
21+
| --- | --- | --- | --- |
22+
| dTarget | Set the target element, `false` means the `parentElement` of the element, the default is the scroll container provided by the global configuration | - | |
23+
| dTop | The `top` value of the affix away from the target element | `0` | |
24+
| dZIndex | Set the `z-index` of the affix | - | |
25+
<!-- prettier-ignore-end -->

packages/ui/src/components/affix/README.zh-CN.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,22 @@ title: 固钉
33
---
44

55
## API
6+
7+
### DAffixProps
8+
9+
```tsx
10+
interface DAffixProps {
11+
children: React.ReactElement;
12+
dTarget?: DRefExtra | false;
13+
dTop?: number | string;
14+
dZIndex?: number | string;
15+
}
16+
```
17+
18+
<!-- prettier-ignore-start -->
19+
| 属性 | 说明 | 默认值 | 版本 |
20+
| --- | --- | --- | --- |
21+
| dTarget | 设置目标元素,`false` 表示元素的 `parentElement`,默认为全局配置提供的滚动容器 | - | |
22+
| dTop | 固钉距离目标元素的 `top`| `0` | |
23+
| dZIndex | 设置固钉的 `z-index` | - | |
24+
<!-- prettier-ignore-end -->

packages/ui/src/components/alert/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,31 @@ aria: alert
55
---
66

77
## API
8+
9+
### DAlertProps
10+
11+
```tsx
12+
interface DAlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
13+
dVisible?: boolean;
14+
dType?: 'success' | 'warning' | 'error' | 'info';
15+
dIcon?: React.ReactNode;
16+
dTitle: React.ReactNode;
17+
dDescription?: React.ReactNode;
18+
dActions?: React.ReactNode[];
19+
onClose?: () => void;
20+
afterVisibleChange?: (visible: boolean) => void;
21+
}
22+
```
23+
24+
<!-- prettier-ignore-start -->
25+
| Property | Description | Default | Version |
26+
| --- | --- | --- | --- |
27+
| dVisible | Visible, controlled, default `false` | - | |
28+
| dType | set type | - | |
29+
| dIcon | Settings icon | - | |
30+
| dTitle | set title | - | |
31+
| dDescription | set description | - | |
32+
| dActions | set button group, `'close'` means close button | `[]` | |
33+
| onClose | Callback to close the warning prompt | - | |
34+
| afterVisibleChange | Finished visible/hidden callback | - | |
35+
<!-- prettier-ignore-end -->

packages/ui/src/components/alert/README.zh-CN.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,31 @@ title: 警告提示
33
---
44

55
## API
6+
7+
### DAlertProps
8+
9+
```tsx
10+
interface DAlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
11+
dVisible?: boolean;
12+
dType?: 'success' | 'warning' | 'error' | 'info';
13+
dIcon?: React.ReactNode;
14+
dTitle: React.ReactNode;
15+
dDescription?: React.ReactNode;
16+
dActions?: React.ReactNode[];
17+
onClose?: () => void;
18+
afterVisibleChange?: (visible: boolean) => void;
19+
}
20+
```
21+
22+
<!-- prettier-ignore-start -->
23+
| 属性 | 说明 | 默认值 | 版本 |
24+
| --- | --- | --- | --- |
25+
| dVisible | 是否可见,受控,默认为 `false` | - | |
26+
| dType | 设置警告提示类型 | - | |
27+
| dIcon | 设置图标 | - | |
28+
| dTitle | 设置标题 | - | |
29+
| dDescription | 设置描述 | - | |
30+
| dActions | 设置按钮组,`'close'` 表示关闭按钮 | `[]` | |
31+
| onClose | 关闭警告提示的回调 | - | |
32+
| afterVisibleChange | 完成显/隐的回调 | - | |
33+
<!-- prettier-ignore-end -->

0 commit comments

Comments
 (0)