Skip to content

Commit 0ce47ed

Browse files
committed
更新多个组件文档,包括 CheckCard、ProFormDependency、EditableProTable、StatisticCard、StepsForm 等,优化文档结构,增强可读性,确保符合 Ant Design 设计规范,同时新增示例代码以展示基本用法。
1 parent 897a318 commit 0ce47ed

File tree

29 files changed

+3734
-572
lines changed

29 files changed

+3734
-572
lines changed

site/changelog.en-US.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,33 @@
33
## [3.0.0-beta.3] - 2025-01-XX
44

55
### 🚀 New Features
6+
67
- **ProComponents 3.0 Major Upgrade**: Completely restructured component library architecture
78
- **Remove Antd@4 Compatibility**: Focus on Antd@5 support, significantly reduce bundle size
89
- **Optimize Tree Shaking**: Solve the issue of ProForm default binding all components
910
- **Performance Optimization**: ProTable performance significantly improved, on par with Antd
1011

1112
### 🔧 Technical Improvements
13+
1214
- **Bundle Size Optimization**: Remove compatibility code, reduce at least 700k gzip size
1315
- **Code Refactoring**: Delete all `compareVersions` compatibility code
1416
- **CSS Optimization**: Remove `antd/lib/*/style` compatibility imports
1517
- **New Component Support**: Support Antd@5 new features like ColorPicker and Flex components
1618

1719
### 🐛 Bug Fixes
20+
1821
- Fix Helmet error when `pageTitleRender` returns non-string values in `useDocumentTitle`
1922
- Fix deprecated `--loglevel` option in Prettier configuration
2023
- Fix documentation path structure, unify component documentation organization
2124

2225
### 📦 Dependency Updates
26+
2327
- Upgrade to latest Antd@5 version
2428
- Remove all Antd@4 related dependencies
2529
- Update Prettier to latest version
2630

2731
### 📚 Documentation
32+
2833
- Reorganize component documentation structure with flat directory
2934
- Create complete Chinese and English documentation for all components
3035
- Add documentation writing guidelines
@@ -34,11 +39,13 @@
3439
## [3.0.0-beta.2] - 2024-XX-XX
3540

3641
### 🔧 Technical Improvements
42+
3743
- Continue optimizing bundle size and performance
3844
- Improve Tree Shaking functionality
3945
- Enhance component stability
4046

4147
### 🐛 Bug Fixes
48+
4249
- Fix known compatibility issues
4350
- Improve error handling mechanisms
4451

@@ -47,12 +54,14 @@
4754
## [3.0.0-beta.1] - 2024-XX-XX
4855

4956
### 🚀 Initial Release
57+
5058
- **ProComponents 3.0 First Beta Version**
5159
- Remove Antd@4 compatibility support
5260
- Restructure core component architecture
5361
- Optimize bundle size and performance
5462

5563
### ✨ Core Changes
64+
5665
- Focus on Antd@5 support
5766
- Delete all compatibility code
5867
- Redesign component APIs
@@ -65,17 +74,20 @@
6574
### Upgrading from 2.x to 3.0
6675

6776
#### Major Changes
77+
6878
1. **Remove Antd@4 Compatibility**: Ensure project uses Antd@5
6979
2. **Bundle Size Optimization**: Remove compatibility code, reduce bundle size
7080
3. **Tree Shaking**: Optimize on-demand loading, reduce unnecessary code
7181

7282
#### Upgrade Steps
83+
7384
1. Upgrade Antd to 5.x version
7485
2. Check and remove Antd@4 related compatibility code
7586
3. Update component import methods to leverage Tree Shaking
7687
4. Test all functionality to ensure compatibility
7788

7889
#### Breaking Changes
90+
7991
- No longer supports Antd@4
8092
- Some APIs may have changed
8193
- Certain compatibility configurations have been removed
@@ -84,12 +96,12 @@
8496

8597
## Version Support
8698

87-
| Version | Status | Support Period |
88-
|---------|--------|----------------|
89-
| 3.0.x | 🟢 Active Development | 2025+ |
99+
| Version | Status | Support Period |
100+
| ------- | --------------------- | -------------- |
101+
| 3.0.x | 🟢 Active Development | 2025+ |
90102

91103
---
92104

93105
## License
94106

95-
MIT License
107+
MIT License

site/changelog.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,33 @@
33
## [3.0.0-beta.3] - 2025-01-XX
44

55
### 🚀 新特性
6+
67
- **ProComponents 3.0 重大升级**: 完全重构的组件库架构
78
- **移除 Antd@4 兼容性**: 专注于 Antd@5 支持,大幅减少包大小
89
- **优化 Tree Shaking**: 解决 ProForm 默认绑定所有组件的问题
910
- **性能优化**: ProTable 性能大幅提升,与 Antd 看齐
1011

1112
### 🔧 技术改进
13+
1214
- **包大小优化**: 移除兼容性代码,减少至少 700k 的 gzip 大小
1315
- **代码重构**: 删除所有 `compareVersions` 兼容性代码
1416
- **CSS 优化**: 移除 `antd/lib/*/style` 的兼容性导入
1517
- **新组件支持**: 支持 Antd@5 的新特性,如 ColorPicker 和 Flex 组件
1618

1719
### 🐛 修复
20+
1821
- 修复 `useDocumentTitle``pageTitleRender` 返回非字符串值时的 Helmet 错误
1922
- 修复 Prettier 配置中过时的 `--loglevel` 选项
2023
- 修复文档路径结构,统一组件文档组织方式
2124

2225
### 📦 依赖更新
26+
2327
- 升级到 Antd@5 最新版本
2428
- 移除所有 Antd@4 相关依赖
2529
- 更新 Prettier 到最新版本
2630

2731
### 📚 文档
32+
2833
- 重新组织组件文档结构,采用扁平化目录
2934
- 为所有组件创建完整的中英文文档
3035
- 添加文档编写指南
@@ -34,11 +39,13 @@
3439
## [3.0.0-beta.2] - 2024-XX-XX
3540

3641
### 🔧 技术改进
42+
3743
- 继续优化包大小和性能
3844
- 完善 Tree Shaking 功能
3945
- 增强组件稳定性
4046

4147
### 🐛 修复
48+
4249
- 修复已知的兼容性问题
4350
- 改进错误处理机制
4451

@@ -47,12 +54,14 @@
4754
## [3.0.0-beta.1] - 2024-XX-XX
4855

4956
### 🚀 初始版本
57+
5058
- **ProComponents 3.0 首个 Beta 版本**
5159
- 移除 Antd@4 兼容性支持
5260
- 重构核心组件架构
5361
- 优化包大小和性能
5462

5563
### ✨ 核心变更
64+
5665
- 专注于 Antd@5 支持
5766
- 删除所有兼容性代码
5867
- 重新设计组件 API
@@ -65,17 +74,20 @@
6574
### 从 2.x 升级到 3.0
6675

6776
#### 主要变更
77+
6878
1. **移除 Antd@4 兼容性**: 确保项目使用 Antd@5
6979
2. **包大小优化**: 移除兼容性代码,减少包大小
7080
3. **Tree Shaking**: 优化按需加载,减少不必要的代码
7181

7282
#### 升级步骤
83+
7384
1. 升级 Antd 到 5.x 版本
7485
2. 检查并移除 Antd@4 相关的兼容性代码
7586
3. 更新组件导入方式,利用 Tree Shaking
7687
4. 测试所有功能,确保兼容性
7788

7889
#### 破坏性变更
90+
7991
- 不再支持 Antd@4
8092
- 部分 API 可能发生变化
8193
- 某些兼容性配置被移除
@@ -84,9 +96,9 @@
8496

8597
## 版本支持
8698

87-
| 版本 | 状态 | 支持时间 |
88-
|------|------|----------|
89-
| 3.0.x | 🟢 活跃开发 | 2025+ |
99+
| 版本 | 状态 | 支持时间 |
100+
| ----- | ----------- | -------- |
101+
| 3.0.x | 🟢 活跃开发 | 2025+ |
90102

91103
---
92104

Lines changed: 123 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,140 @@
11
---
2-
title: CheckCard - Check Card
3-
order: 5
42
nav:
5-
title: Components
6-
order: 100
7-
path: /components
3+
title: Card
4+
group: Card
5+
title: CheckCard - Multi-select Card
6+
order: 1
7+
atomId: CheckCard
88
---
99

10-
# CheckCard - Check Card
10+
# CheckCard - Multi-select Card
1111

12-
## When to Use
12+
The CheckCard is a card that can contain various related descriptive information and can be selected. Features:
1313

14-
CheckCard - Check Card is a powerful component suitable for the following scenarios:
14+
- ① Can contain various related descriptive information, such as title, description, image, labels, etc.
15+
- ② Has a clear boundary.
16+
- ③ Has a clear selected state.
1517

16-
- Scenario description 1
17-
- Scenario description 2
18-
- Scenario description 3
18+
## When to use
1919

20-
## Code Examples
20+
- When you need to display multiple descriptive information of selected objects.
21+
- When the number of selected objects is not large.
22+
23+
## Code Demo
2124

2225
### Basic Usage
2326

24-
```tsx
25-
import { CheckCard } from '@ant-design/pro-components';
27+
The most commonly used example of a card, including avatar, title, description, etc., and can be selected.
28+
29+
<code src="../../../demos/card/CheckCard/basic.tsx" ></code>
30+
31+
<code src="../../../demos/card/CheckCard/single.tsx" description="When there are multiple options, you can use the `CheckCard.Group` to group them. The default option card component is in single selection mode." thumbnail="https://gw.alipayobjects.com/zos/bmw-prod/be0fcade-afae-4e85-95ef-a3cc90f6d4b3/kc60kq47_w1362_h412.jpeg" ></code>
32+
33+
<code src="../../../demos/card/CheckCard/multiple.tsx" thumbnail="https://gw.alipayobjects.com/zos/bmw-prod/06963ad4-ba2b-4733-a1c5-778e7f696ac1/kc61xhvk_w1364_h280.jpeg" description="Set the `multiple` property of `CheckCard.Group` to enable multiple selection. Note that in multiple selection mode, the form item returns an array." ></code>
34+
35+
### Different Sizes
36+
37+
Configure the `size` property to change the size of the card. Currently available options are `large`, `default`, and `small`, with only the width being different.
38+
39+
<code src="../../../demos/card/CheckCard/size.tsx" ></code>
40+
41+
Of course, you can also customize the size of the card using the `style` or `className` properties.
42+
43+
### Custom Size
44+
45+
<code src="../../../demos/card/CheckCard/custom.tsx" ></code>
46+
47+
### Using in Form
48+
49+
CheckCard can be used together with form components. Here is an example.
50+
51+
<code src="../../../demos/card/CheckCard/form.tsx" oldtitle="CheckCard - Using in Form" thumbnail="https://gw.alipayobjects.com/zos/bmw-prod/c8fa2080-5a46-4f50-ae99-846b1804f56d/kc62b0ug_w1360_h656.jpeg" ></code>
52+
53+
### Composing Styles
54+
55+
The avatar, title, and description areas can be freely combined or presented separately. The component will adjust the alignment for you.
56+
57+
<code src="../../../demos/card/CheckCard/compose.tsx" ></code>
58+
59+
### Custom Avatar
60+
61+
You can customize the avatar area using the `avatar` property.
62+
63+
<code src="../../../demos/card/CheckCard/avatar.tsx" ></code>
64+
65+
### Custom Title
2666

27-
export default () => {
28-
return <CheckCard />;
29-
};
30-
```
67+
You can customize the title area using the `title` property.
68+
69+
<code src="../../../demos/card/CheckCard/title.tsx" ></code>
70+
71+
### Custom Description
72+
73+
The description area can be customized using the `description` property with a React node.
74+
75+
<code src="../../../demos/card/CheckCard/description.tsx" ></code>
76+
77+
### Default Checked
78+
79+
Set the `defaultChecked` property to `true` to specify that the option is checked by default.
80+
81+
<code src="../../../demos/card/CheckCard/defaultChecked.tsx" ></code>
82+
83+
### Action Area
84+
85+
Use the `extra` property to add an action area to the card.
86+
87+
<code src="../../../demos/card/CheckCard/extra.tsx" ></code>
88+
89+
### Loading State
90+
91+
Set the `loading` property to `true` to indicate that the content is still loading.
92+
93+
<code src="../../../demos/card/CheckCard/loading.tsx" ></code>
94+
95+
### Image Only Option
96+
97+
By only setting the `cover` property, you can create an image-only option.
98+
99+
<code src="../../../demos/card/CheckCard/image.tsx" ></code>
31100

32101
## API
33102

34-
| Parameter | Description | Type | Default |
35-
| --------- | -------------------- | -------- | ------- |
36-
| prop1 | Property description | `string` | - |
103+
### CheckCard
104+
105+
| Parameter | Description | Type | Default |
106+
| -------------- | ----------------------------------- | --------------------------------- | ----------- |
107+
| avatar | Avatar | `ReactNode` | - |
108+
| title | Title | `ReactNode` | - |
109+
| description | Description | `ReactNode` | - |
110+
| cover | Cover | `ReactNode` | - |
111+
| extra | Action area | `ReactNode` | - |
112+
| size | Size | `'large' \| 'default' \| 'small'` | `'default'` |
113+
| checked | Whether checked | `boolean` | - |
114+
| defaultChecked | Default checked state | `boolean` | `false` |
115+
| disabled | Whether disabled | `boolean` | `false` |
116+
| loading | Loading state | `boolean` | `false` |
117+
| onChange | Callback when checked state changes | `(checked: boolean) => void` | - |
118+
| onClick | Click callback | `(e: MouseEvent) => void` | - |
119+
120+
### CheckCard.Group
121+
122+
| Parameter | Description | Type | Default |
123+
| ------------ | ------------------------------- | ------------------------------------- | ------- |
124+
| multiple | Whether multiple selection | `boolean` | `false` |
125+
| value | Currently selected value | `string \| string[]` | - |
126+
| defaultValue | Default selected value | `string \| string[]` | - |
127+
| onChange | Callback when selection changes | `(value: string \| string[]) => void` | - |
128+
| options | Option configuration | `CheckCardOption[]` | - |
37129

38-
## Design Guidelines
130+
### CheckCardOption
39131

40-
CheckCard - Check Card follows Ant Design design guidelines, providing a consistent user experience.
132+
| Parameter | Description | Type | Default |
133+
| ----------- | ---------------- | ----------- | ------- |
134+
| title | Title | `ReactNode` | - |
135+
| description | Description | `ReactNode` | - |
136+
| avatar | Avatar | `ReactNode` | - |
137+
| cover | Cover | `ReactNode` | - |
138+
| extra | Action area | `ReactNode` | - |
139+
| value | Option value | `string` | - |
140+
| disabled | Whether disabled | `boolean` | `false` |

0 commit comments

Comments
 (0)