{item.children}
+ ) : (
+
+
+
+valueType 是 ProComponents 的灵魂,ProComponents 会根据 valueType 来映射成不同的表单项。以下是支持的常见表单项:
+
+| valueType | 说明 |
+| --------------- | ---------------------------- |
+| `password` | 密码输入框 |
+| `money` | 金额输入框 |
+| `textarea` | 文本域 |
+| `date` | 日期 |
+| `dateTime` | 日期时间 |
+| `dateWeek` | 周 |
+| `dateMonth` | 月 |
+| `dateQuarter` | 季度输入 |
+| `dateYear` | 年份输入 |
+| `dateRange` | 日期区间 |
+| `dateTimeRange` | 日期时间区间 |
+| `time` | 时间 |
+| `timeRange` | 时间区间 |
+| `text` | 文本框 |
+| `select` | 下拉框 |
+| `treeSelect` | 树形下拉框 |
+| `checkbox` | 多选框 |
+| `rate` | 星级组件 |
+| `radio` | 单选框 |
+| `radioButton` | 按钮单选框 |
+| `progress` | 进度条 |
+| `percent` | 百分比组件 |
+| `digit` | 数字输入框 |
+| `second` | 秒格式化 |
+| `avatar` | 头像 |
+| `code` | 代码框 |
+| `switch` | 开关 |
+| `fromNow` | 相对于当前时间 |
+| `image` | 图片 |
+| `jsonCode` | 代码框,但是带了 json 格式化 |
+| `color` | 颜色选择器 |
+| `cascader` | 级联选择器 |
+
+这里 demo 可以来了解一下各个 valueType 的展示效果。
+
+### 传入 function
+
+只有一个值并不能表现很多类型,`progress` 就是一个很好的例子。所以我们支持传入一个 function。你可以这样使用:
+
+```tsx | pure
+const columns = {
+ title: '进度',
+ key: 'progress',
+ dataIndex: 'progress',
+ valueType: (item: T) => ({
+ type: 'progress',
+ status: item.status !== 'error' ? 'active' : 'exception',
+ }),
+};
+```
+
+### 支持的返回值
+
+#### progress
+
+```js
+return {
+ type: 'progress',
+ status: 'success' | 'exception' | 'normal' | 'active',
+};
+```
+
+#### money
+
+```js
+return { type: 'money', locale: 'en-Us' };
+```
+
+#### percent
+
+```js
+return { type: 'percent', showSymbol: true | false, precision: 2 };
+```
+
+如果我们带的 valueType 不能满足需求,我们可以用自定义 valueType 来自定义业务组件。
+
+### 自定义 valueType
+
+
+
+### valueEnum
+
+valueEnum 需要传入一个枚举,ProTable 会自动根据值获取响应的枚举,并且在 form 中生成一个下拉框。看起来是这样的:
+
+```ts | pure
+const valueEnum = {
+ open: {
+ text: '未解决',
+ status: 'Error',
+ },
+ closed: {
+ text: '已解决',
+ status: 'Success',
+ },
+};
+
+// 也可以设置为一个function
+const valueEnum = (row) =>
+ row.isMe
+ ? {
+ open: {
+ text: '未解决',
+ status: 'Error',
+ },
+ closed: {
+ text: '已解决',
+ status: 'Success',
+ },
+ }
+ : {
+ open: {
+ text: '等待解决',
+ status: 'Error',
+ },
+ closed: {
+ text: '已回应',
+ status: 'Success',
+ },
+ };
+```
+
+> 这里值得注意的是在 form 中并没有 row,所以 row 的值为 null,你可以根据这个来判断要在 form 中显示什么选项。
+
+当前列值的枚举
+
+```typescript | pure
+interface IValueEnum {
+ [key: string]:
+ | ReactNode
+ | {
+ text: ReactNode;
+ status: 'Success' | 'Error' | 'Processing' | 'Warning' | 'Default';
+ };
+}
+```
+
+## 远程数据
+
+支持组件 `Select`, `TreeSelect`, `Cascader`, `Checkbox`, `Radio`, `RadioButton`
+
+支持参数 `request`,`params`,`fieldProps.options`, `valueEnum` 来支持远程数据,这几个属性分别有不同的用法。
+
+### `valueEnum`
+
+valueEnum 是最基础的用法, 它支持传入一个 [`Object`](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object) 或者是 [`Map`](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map),相比于 options 支持更加丰富的定义,比如在表格中常见的各种 [badge](https://ant.design/components/badge-cn/#Badge)。
+
+```tsx | pure
+const valueEnum = {
+ all: { text: '全部', status: 'Default' },
+ open: {
+ text: '未解决',
+ status: 'Error',
+ },
+ closed: {
+ text: '已解决',
+ status: 'Success',
+ },
+};
+```
+
+```tsx | pure
+import { ProFormSelect } from '@ant-design/pro-components';
+
+const valueEnum = {
+ all: { text: '全部', status: 'Default' },
+ open: {
+ text: '未解决',
+ status: 'Error',
+ },
+ closed: {
+ text: '已解决',
+ status: 'Success',
+ },
+};
+
+export default () => (
+
-
-### API
+
valueType 是 ProComponents 的灵魂,ProComponents 会根据 valueType 来映射成不同的表单项。以下是支持的常见表单项:
@@ -165,7 +158,7 @@ valueType 是 ProComponents 的灵魂,ProComponents 会根据 valueType 来映
只有一个值并不能表现很多类型,`progress` 就是一个很好的例子。所以我们支持传入一个 function。你可以这样使用:
-```tsx |pure
+```tsx | pure
const columns = {
title: '进度',
key: 'progress',
@@ -204,7 +197,7 @@ return { type: 'percent', showSymbol: true | false, precision: 2 };
### 自定义 valueType
-
+
### valueEnum
diff --git a/docs/demos/valueType.tsx b/docs/components/valueType.tsx
similarity index 100%
rename from docs/demos/valueType.tsx
rename to docs/components/valueType.tsx
diff --git a/docs/docs/faq.en-US.md b/docs/docs/faq.en-US.md
new file mode 100644
index 000000000000..86bded81dd84
--- /dev/null
+++ b/docs/docs/faq.en-US.md
@@ -0,0 +1,47 @@
+---
+title: FAQ
+order: 3
+
+nav:
+ title: FAQ
+ path: /docs
+---
+
+## FAQ
+
+以下整理了一些 ProComponents 社区常见的问题和官方答复,在提问之前建议找找有没有类似的问题。此外我们也维护了一个反馈较多 [how to use 标签](https://github.com/ant-design/pro-components/issues?q=is%3Aissue+label%3A%22%F0%9F%A4%B7%F0%9F%8F%BC+How+to+use%22+) 亦可参考。
+
+### ProTable request 返回的数据格式可以自定义吗?
+
+不行的,你可以在 request 中转化一下,或者写个拦截器。
+
+[示例](https://beta-pro.ant.design/docs/request-cn)
+
+### 如何隐藏 ProTable 生成的搜索的 label?
+
+columns 的 title 支持 function 的,你可以这样写
+
+```typescript
+title: (_, type) => {
+ if (type === 'table') {
+ return '标题';
+ }
+ return null;
+};
+```
+
+### 我没法安装 `ProComponents` 和 `ProComponents` 的依赖,顺便提一句,我在中国大陆。
+
+那啥,试试 [cnpm](http://npm.taobao.org/)和[yarn](https://www.npmjs.com/package/yarn)。
+
+### `Form` 当中 `initialValues`
+
+`ProComponents` 底层也是封装的 [antd](https://ant.design/index-cn) ,所以用法也是和 [antd](https://ant.design/index-cn) 相同。注意 `initialValues` 不能被 `setState` 动态更新,你需要用 `setFieldsValue` 来更新。 `initialValues` 只在 `form` 初始化时生效且只生效一次,如果你需要异步加载推荐使用 `request`,或者 `initialValues ? : null`
+
+## 错误和警告
+
+这里是一些你在使用 ProComponents 的过程中可能会遇到的错误和警告,但是其中一些并不是 ProComponents 的 bug。
+
+### Cannot read property 'Provider' of undefined
+
+请确保 antd 的版本 >= `4.11.1`
diff --git a/docs/faq.md b/docs/docs/faq.md
similarity index 99%
rename from docs/faq.md
rename to docs/docs/faq.md
index cb2fb0c7789e..86bded81dd84 100644
--- a/docs/faq.md
+++ b/docs/docs/faq.md
@@ -1,8 +1,7 @@
---
title: FAQ
order: 3
-group:
- path: /
+
nav:
title: FAQ
path: /docs
diff --git a/docs/getting-started.en-US.md b/docs/docs/index.en-US.md
similarity index 99%
rename from docs/getting-started.en-US.md
rename to docs/docs/index.en-US.md
index 13fe4fc0cf6c..daca5c080f4c 100644
--- a/docs/getting-started.en-US.md
+++ b/docs/docs/index.en-US.md
@@ -1,8 +1,7 @@
---
title: Quick Start
order: 2
-group:
- path: /
+
nav:
title: Documentation
path: /docs
diff --git a/docs/getting-started.md b/docs/docs/index.md
similarity index 99%
rename from docs/getting-started.md
rename to docs/docs/index.md
index e21bfbc3d1a6..bbbe41fdcb93 100644
--- a/docs/getting-started.md
+++ b/docs/docs/index.md
@@ -1,8 +1,7 @@
---
title: 快速开始
order: 2
-group:
- path: /
+
nav:
title: 文档
path: /docs
diff --git a/docs/intro.en-US.md b/docs/docs/intro.en-US.md
similarity index 99%
rename from docs/intro.en-US.md
rename to docs/docs/intro.en-US.md
index 865d5ce498fe..6daa85c3021d 100644
--- a/docs/intro.en-US.md
+++ b/docs/docs/intro.en-US.md
@@ -1,8 +1,7 @@
---
title: Introduction
order: 1
-group:
- path: /
+
nav:
title: Documentation
order: 1
diff --git a/docs/intro.md b/docs/docs/intro.md
similarity index 99%
rename from docs/intro.md
rename to docs/docs/intro.md
index ca37be3bcdbb..515b4c766747 100644
--- a/docs/intro.md
+++ b/docs/docs/intro.md
@@ -1,8 +1,7 @@
---
title: 简介
order: 1
-group:
- path: /
+
nav:
title: 文档
order: 1
diff --git a/docs/index.en-US.md b/docs/index.en-US.md
index 9328786d1c54..8d557820f4d8 100644
--- a/docs/index.en-US.md
+++ b/docs/index.en-US.md
@@ -1,33 +1,36 @@
---
-title: ProComponents - page-like components
-order: 10
-sidebar: false
+title: ProComponents - Front-end components at page level
hero:
title: ProComponents
- desc: 🏆 Make middle and back-end development easier
+ description: 🏆 Make the development of middle and back office easier
actions:
- - text: 🏮🏮 Quick Start →
- link: /docs/getting-started
+ - text: 🏮🏮 Introduction →
+ link: /en-US/docs
features:
- - icon: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/q48YQ5X4ytAAAAAAAAAAAAAAAFl94AQBr
- title: easy to use
- desc: It has its own encapsulation on Ant Design, which is easier to use
- - icon: https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg
+ - avatar: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/q48YQ5X4ytAAAAAAAAAAAAAAFl94AQBr
+ title: Easy to use
+ description: It has its own packaging on Ant Design, which is easier to use
+
+ - avatar: https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg
title: Ant Design
- desc: In the same vein as the Ant Design design system, it seamlessly connects to antd projects
- - icon: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/UKqDTIp55HYAAAAAAAAAAAAAFl94AQBr
+ description: It is in the same line with Ant Design design system and seamlessly connects with ant project
+
+ - avatar: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/UKqDTIp55HYAAAAAAAAAAAAAFl94AQBr
title: Internationalization
- desc: Provide complete internationalization and connect with Ant Design system
- - icon: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Y_NMQKxw7OgAAAAAAAAAAAAAFl94AQBr
- title: Default style
- desc: The style is in the same line as antd, no need to change, it is natural
- - icon: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/U3XjS5IA1tUAAAAAAAAAAAAAFl94AQBr
- title: Default Behavior
- desc: less code, less bugs
- - icon: https://gw.alipayobjects.com/zos/antfincdn/Eb8IHpb9jE/Typescript_logo_2020.svg
+ description: Provide complete internationalization and connect with Ant Design system
+
+ - avatar: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Y_NMQKxw7OgAAAAAAAAAAAAAFl94AQBr
+ title: Preset Style
+ description: The style and style are in one continuous line with ant d, without magic modification, and naturally
+
+ - avatar: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/U3XjS5IA1tUAAAAAAAAAAAAAFl94AQBr
+ title: Preset behavior
+ description: Less code, fewer bugs
+
+ - avatar: https://gw.alipayobjects.com/zos/antfincdn/Eb8IHpb9jE/Typescript_logo_2020.svg
title: TypeScript
- desc: Developed with TypeScript, provides a complete type definition file
+ description: Use TypeScript development to provide a complete type definition file
footer: Open-source MIT Licensed | © 2017-present
---
diff --git a/docs/index.md b/docs/index.md
index ab60b214c3fd..4ed37470fd0c 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -1,33 +1,36 @@
---
title: ProComponents - 页面级别的前端组件
-order: 10
-sidebar: false
hero:
title: ProComponents
- desc: 🏆 让中后台开发更简单
+ description: 🏆 让中后台开发更简单
actions:
- text: 🏮🏮 快速开始 →
link: /docs/getting-started
features:
- - icon: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/q48YQ5X4ytAAAAAAAAAAAAAAFl94AQBr
+ - avatar: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/q48YQ5X4ytAAAAAAAAAAAAAAFl94AQBr
title: 简单易用
- desc: 在 Ant Design 上进行了自己的封装,更加易用
- - icon: https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg
+ description: 在 Ant Design 上进行了自己的封装,更加易用
+
+ - avatar: https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg
title: Ant Design
- desc: 与 Ant Design 设计体系一脉相承,无缝对接 antd 项目
- - icon: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/UKqDTIp55HYAAAAAAAAAAAAAFl94AQBr
+ description: 与 Ant Design 设计体系一脉相承,无缝对接 antd 项目
+
+ - avatar: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/UKqDTIp55HYAAAAAAAAAAAAAFl94AQBr
title: 国际化
- desc: 提供完备的国际化,与 Ant Design 体系打通
- - icon: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Y_NMQKxw7OgAAAAAAAAAAAAAFl94AQBr
+ description: 提供完备的国际化,与 Ant Design 体系打通
+
+ - avatar: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Y_NMQKxw7OgAAAAAAAAAAAAAFl94AQBr
title: 预设样式
- desc: 样式风格与 antd 一脉相承,无需魔改,浑然天成
- - icon: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/U3XjS5IA1tUAAAAAAAAAAAAAFl94AQBr
+ description: 样式风格与 antd 一脉相承,无需魔改,浑然天成
+
+ - avatar: https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/U3XjS5IA1tUAAAAAAAAAAAAAFl94AQBr
title: 预设行为
- desc: 更少的代码,更少的 Bug
- - icon: https://gw.alipayobjects.com/zos/antfincdn/Eb8IHpb9jE/Typescript_logo_2020.svg
+ description: 更少的代码,更少的 Bug
+
+ - avatar: https://gw.alipayobjects.com/zos/antfincdn/Eb8IHpb9jE/Typescript_logo_2020.svg
title: TypeScript
- desc: 使用 TypeScript 开发,提供完整的类型定义文件
+ description: 使用 TypeScript 开发,提供完整的类型定义文件
footer: Open-source MIT Licensed | © 2017-present
---
diff --git a/docs/playground/curd.playground.md b/docs/playground/index.en-US.md
similarity index 97%
rename from docs/playground/curd.playground.md
rename to docs/playground/index.en-US.md
index e778b68ee548..6c06b068b0ec 100644
--- a/docs/playground/curd.playground.md
+++ b/docs/playground/index.en-US.md
@@ -3,8 +3,6 @@ title: CRUD
nav:
title: Playground
path: /playground
-group:
- path: /
---
# CRUD
diff --git a/docs/playground/index.md b/docs/playground/index.md
new file mode 100644
index 000000000000..6c06b068b0ec
--- /dev/null
+++ b/docs/playground/index.md
@@ -0,0 +1,14 @@
+---
+title: CRUD
+nav:
+ title: Playground
+ path: /playground
+---
+
+# CRUD
+
+ProTable,ProDescriptions,ProForm 都是基于 ProField 来进行封装。ProTable 和 ProDescriptions 根据 valueType 来渲染不同的 ProField,Form 则是通过不同的 FormField 来实现封装。
+
+使用同样的底层实现为 ProTable,ProDescriptions,ProForm 打通带来了便利。ProForm 可以很方便的实现只读模式,ProTable 可以快速实现查询表单和可编辑表格。ProDescriptions 可以实现节点编辑,以下有个例子可以切换三个组件。
+
+
diff --git a/docs/playground/pro-descriptions.playground.md b/docs/playground/pro-descriptions.en-US.md
similarity index 93%
rename from docs/playground/pro-descriptions.playground.md
rename to docs/playground/pro-descriptions.en-US.md
index b5e971985a01..f0367da7aa81 100644
--- a/docs/playground/pro-descriptions.playground.md
+++ b/docs/playground/pro-descriptions.en-US.md
@@ -3,8 +3,6 @@ title: ProDescriptions
nav:
title: Playground
path: /playground
-group:
- path: /
---
# ProDescriptions Playground
diff --git a/docs/playground/pro-descriptions.md b/docs/playground/pro-descriptions.md
new file mode 100644
index 000000000000..f0367da7aa81
--- /dev/null
+++ b/docs/playground/pro-descriptions.md
@@ -0,0 +1,10 @@
+---
+title: ProDescriptions
+nav:
+ title: Playground
+ path: /playground
+---
+
+# ProDescriptions Playground
+
+
diff --git a/docs/playground/pro-form.playground.md b/docs/playground/pro-form.en-US.md
similarity index 96%
rename from docs/playground/pro-form.playground.md
rename to docs/playground/pro-form.en-US.md
index a9bad12c4510..6eeba3e9bc21 100644
--- a/docs/playground/pro-form.playground.md
+++ b/docs/playground/pro-form.en-US.md
@@ -3,8 +3,6 @@ title: ProForm
nav:
title: Playground
path: /playground
-group:
- path: /
---
# Form Playground
diff --git a/docs/playground/pro-form.md b/docs/playground/pro-form.md
new file mode 100644
index 000000000000..6eeba3e9bc21
--- /dev/null
+++ b/docs/playground/pro-form.md
@@ -0,0 +1,18 @@
+---
+title: ProForm
+nav:
+ title: Playground
+ path: /playground
+---
+
+# Form Playground
+
+## Form 的 layout 切换
+
+ProForm 的主要功能是预设了很多 layout,如果需要切换只需要改变外面包裹的 Layout 即可,以下是个 demo。
+
+
+
+## FormList
+
+
diff --git a/docs/playground/pro-layout.playground.md b/docs/playground/pro-layout.en-US.md
similarity index 95%
rename from docs/playground/pro-layout.playground.md
rename to docs/playground/pro-layout.en-US.md
index 6ad8d6d59544..7e3e3e0316eb 100644
--- a/docs/playground/pro-layout.playground.md
+++ b/docs/playground/pro-layout.en-US.md
@@ -3,8 +3,6 @@ title: ProLayout
nav:
title: Playground
path: /playground
-group:
- path: /
---
# Layout Playground
diff --git a/docs/playground/pro-layout.md b/docs/playground/pro-layout.md
new file mode 100644
index 000000000000..7e3e3e0316eb
--- /dev/null
+++ b/docs/playground/pro-layout.md
@@ -0,0 +1,16 @@
+---
+title: ProLayout
+nav:
+ title: Playground
+ path: /playground
+---
+
+# Layout Playground
+
+## Layout 自定义
+
+
+
+## 水印自定义
+
+
diff --git a/docs/playground/pro-table.playground.md b/docs/playground/pro-table.en-US.md
similarity index 93%
rename from docs/playground/pro-table.playground.md
rename to docs/playground/pro-table.en-US.md
index d137f13b99f8..c3dd31068e4f 100644
--- a/docs/playground/pro-table.playground.md
+++ b/docs/playground/pro-table.en-US.md
@@ -3,8 +3,6 @@ title: ProTable
nav:
title: Playground
path: /playground
-group:
- path: /
---
# ProTable Playground
diff --git a/docs/playground/pro-table.md b/docs/playground/pro-table.md
new file mode 100644
index 000000000000..c3dd31068e4f
--- /dev/null
+++ b/docs/playground/pro-table.md
@@ -0,0 +1,10 @@
+---
+title: ProTable
+nav:
+ title: Playground
+ path: /playground
+---
+
+# ProTable Playground
+
+
diff --git a/jest.config.js b/jest.config.js
index d8e0f53ad121..74a3e14ea76e 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -30,8 +30,9 @@ module.exports = {
cacheDirectory: './.jest/cache',
transformIgnorePatterns: [`/node_modules/(?!${[].join('|')})`],
unmockedModulePathPatterns: ['node_modules/react/'],
- testURL:
- 'http://localhost?navTheme=realDark&layout=mix&colorPrimary=techBlue&splitMenus=false&fixedHeader=true',
+ testEnvironmentOptions: {
+ url: 'http://localhost?navTheme=realDark&layout=mix&colorPrimary=techBlue&splitMenus=false&fixedHeader=true',
+ },
verbose: true,
setupFiles: ['./tests/setupTests.js'],
globals: {
diff --git a/package.json b/package.json
index b30ea9dec8fa..ac15f828d915 100644
--- a/package.json
+++ b/package.json
@@ -6,10 +6,10 @@
],
"scripts": {
"bootstrap": "node ./scripts/bootstrap.js",
- "build": "npm run version && npm run build-components && webpack",
- "build-components": "cross-env BUILD_TYPE=es father-build && cross-env BUILD_TYPE=lib father-build",
+ "build": "npm run version && npm run build-components",
+ "build-components": "ls -l && pnpm --filter \"./packages/**/**\" build",
"changelog": "node ./scripts/changelogs.js",
- "check-deps": "npm run sync:tnpm && node ./scripts/checkDeps.js && npm run sync:tnpm",
+ "check-deps": "node ./scripts/checkDeps.js",
"checkPublish": "npm run sync:tnpm && node ./scripts/checkPublish.js && npm run sync:tnpm",
"createRelease": "node ./scripts/createRelease.js",
"deploy": "cross-env SITE_DEPLOY='TRUE' npm run site && gh-pages -d ./dist",
@@ -27,7 +27,6 @@
"tsc": "tsc --noEmit",
"tsc:duplicate": "tsc -p ./tests/tsconfig.duplicate.json",
"update:deps": "yarn upgrade-interactive --latest",
- "webpack": "npm run version && npm run build && webpack",
"publishOnly": "node ./scripts/release.js --publishOnly",
"version": "node ./scripts/gen_version.js"
},
@@ -48,15 +47,19 @@
},
"devDependencies": {
"@ant-design/antd-theme-variable": "^1.0.0",
- "@ant-design/cssinjs": "^1.0.0",
+ "@ant-design/cssinjs": "^1.5.6",
"@ant-design/icons": "^4.6.2",
"@babel/core": "^7.16.0",
+ "@babel/parser": "^7.20.15",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/preset-env": "^7.16.4",
"@babel/preset-react": "^7.16.0",
"@babel/preset-typescript": "^7.8.3",
+ "@babel/traverse": "^7.20.13",
"@emotion/babel-plugin": "^11.7.2",
"@emotion/css": "^11.9.0",
+ "@emotion/serialize": "^1.1.1",
+ "@floating-ui/react": "^0.19.1",
"@octokit/core": "^3.2.5",
"@octokit/rest": "^18.12.0",
"@testing-library/dom": "^8.11.3",
@@ -64,13 +67,18 @@
"@testing-library/react": "^13.0.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.0.0",
+ "@types/chroma-js": "^2.1.4",
"@types/classnames": "^2.2.7",
+ "@types/glob": "^8.0.1",
"@types/history": "^4.7.7",
"@types/jest": "^27.0.3",
+ "@types/lodash": "^4.14.191",
"@types/lodash.merge": "^4.6.7",
"@types/memoize-one": "^5.1.2",
"@types/mockjs": "^1.0.3",
"@types/node": "^14.0.26",
+ "@types/react": "^18.0.27",
+ "@types/react-dom": "^18.0.10",
"@types/react-helmet": "^6.0.0",
"@types/react-intl": "^3.0.0",
"@types/react-responsive": "^8.0.1",
@@ -81,40 +89,41 @@
"@umijs/doctor": "^1.0.5",
"@umijs/fabric": "^3.0.0",
"@umijs/plugin-analytics": "^0.2.2",
- "@umijs/plugin-esbuild": "^1.1.0",
- "@umijs/ssr-darkreader": "^4.9.44",
"@umijs/test": "^3.2.10",
"@umijs/test-utils": "^3.2.10",
- "@umijs/utils": "^3.2.11",
+ "@umijs/utils": "^4.0.0",
+ "animated-scroll-to": "^2.3.0",
"antd": "^5.0.0",
- "babel-jest": "^27.3.1",
- "babel-loader": "^8.2.2",
+ "antd-style": "alpha",
+ "babel-loader": "^9.1.2",
"babel-types": "^6.26.0",
- "body-parser": "^1.18.2",
"chalk": "^4.1.0",
- "cheerio": "^1.0.0-rc.12",
+ "chroma-js": "^2.4.2",
+ "copy-to-clipboard": "^3.3.3",
"cross-env": "^7.0.2",
- "css-loader": "^5.0.2",
- "css-minimizer-webpack-plugin": "^1.2.0",
"dayjs": "^1.11.4",
- "dumi": "^1.1.46",
+ "dumi": "^2.1.3",
"esbuild": "^0.15.12",
"esbuild-jest": "^0.5.0",
"eslint": "^7.2.0",
+ "execa": "^5.0.0",
"express": "^4.18.1",
- "father-build": "^1.18.1",
+ "fast-deep-equal": "^3.1.3",
+ "father": "^4.1.3",
"gh-pages": "^3.1.0",
+ "glob": "^8.1.0",
"identity-obj-proxy": "^3.0.0",
"inquirer": "^8.0.0",
- "jest": "^27.3.1",
+ "jest": "^29.0.0",
"jest-canvas-mock": "^2.3.1",
+ "jest-environment-jsdom": "^29.4.1",
"jest-fetch-mock": "^3.0.3",
"jsdom": "^19.0.0",
"lerna": "^3.20.2",
"lerna-changelog": "^1.0.1",
- "less-loader": "^8.0.0",
+ "less": "3.13.1",
"lint-staged": "^10.0.2",
- "mini-css-extract-plugin": "^1.3.8",
+ "lodash": "^4.17.21",
"mockdate": "^3.0.2",
"mockjs": "^1.1.0",
"np": "^6.1.0",
@@ -128,30 +137,33 @@
"prettier-plugin-organize-imports": "^2.3.4",
"prettier-plugin-packagejson": "^2.2.18",
"pretty-quick": "^3.0.1",
- "progress-bar-webpack-plugin": "^2.1.0",
"query-string": "^6.13.6",
+ "rc-field-form": "^1.27.3",
"rc-resize-observer": "^1.0.0",
+ "rc-steps": "^6.0.0",
+ "rc-table": "^7.30.3",
+ "rc-util": "^5.27.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-helmet-async": "^1.0.9",
+ "react-layout-kit": "^1.4.0",
"react-lazyload": "^3.2.0",
"react-markdown": "^4.3.0",
"react-sortable-hoc": "^2.0.0",
- "react-test-renderer": "^18.0.0",
+ "react-syntax-highlighter": "^15.5.0",
"slash2": "^2.0.0",
"style-loader": "^2.0.0",
"stylelint": "^13.0.0",
"timezone-mock": "^1.3.4",
"typescript": "^4.5",
"typescript-transform-paths": "^3.3.1",
- "umi": "^3.4.24",
+ "umi": "^4.0.0",
"umi-request": "^1.3.5",
- "webpack": "^5.38.1",
- "webpack-bundle-analyzer": "^4.4.0",
- "webpack-cli": "^4.7.0",
+ "use-merge-value": "^1.0.2",
"write-pkg": "^4.0.0",
"xhr-mock": "^2.5.1",
- "yorkie": "^2.0.0"
+ "yorkie": "^2.0.0",
+ "zustand": "^4.3.2"
},
"gitHooks": {
"pre-commit": "pretty-quick --staged",
diff --git a/packages/card/.fatherrc.ts b/packages/card/.fatherrc.ts
new file mode 100644
index 000000000000..3305dd5a74a7
--- /dev/null
+++ b/packages/card/.fatherrc.ts
@@ -0,0 +1,5 @@
+import { defineConfig } from 'father';
+
+export default defineConfig({
+ extends: '../../.fatherrc.base.ts',
+});
diff --git a/packages/card/package.json b/packages/card/package.json
index dffdf44eeeb3..e00310ab9919 100644
--- a/packages/card/package.json
+++ b/packages/card/package.json
@@ -24,6 +24,9 @@
"es",
"dist"
],
+ "scripts": {
+ "build": "father build"
+ },
"browserslist": [
"last 2 versions",
"Firefox ESR",
diff --git a/packages/card/src/components/Actions/style.ts b/packages/card/src/components/Actions/style.ts
index 4389f64e6396..b71ff34f2135 100644
--- a/packages/card/src/components/Actions/style.ts
+++ b/packages/card/src/components/Actions/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
import { ConfigProvider } from 'antd';
import { useContext } from 'react';
diff --git a/packages/card/src/components/Card/style.ts b/packages/card/src/components/Card/style.ts
index fba5dfe086a7..36453bb92892 100644
--- a/packages/card/src/components/Card/style.ts
+++ b/packages/card/src/components/Card/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { resetComponent, useStyle as useAntdStyle } from '@ant-design/pro-utils';
interface ProCardToken extends ProAliasToken {
diff --git a/packages/card/src/components/CheckCard/demos/avatar.tsx b/packages/card/src/components/CheckCard/demos/avatar.tsx
index ee1aba097aa8..6291faa4bfa5 100644
--- a/packages/card/src/components/CheckCard/demos/avatar.tsx
+++ b/packages/card/src/components/CheckCard/demos/avatar.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 自定义头像
- */
-
import { UserOutlined } from '@ant-design/icons';
import { CheckCard } from '@ant-design/pro-components';
import { Avatar } from 'antd';
diff --git a/packages/card/src/components/CheckCard/demos/compose.tsx b/packages/card/src/components/CheckCard/demos/compose.tsx
index dca83bf76aa0..5e45dfee6190 100644
--- a/packages/card/src/components/CheckCard/demos/compose.tsx
+++ b/packages/card/src/components/CheckCard/demos/compose.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 组合样式
- */
-
import { CheckCard } from '@ant-design/pro-components';
export default () => (
diff --git a/packages/card/src/components/CheckCard/demos/custom.tsx b/packages/card/src/components/CheckCard/demos/custom.tsx
index 67f3b9c6db20..c2377744aa6d 100644
--- a/packages/card/src/components/CheckCard/demos/custom.tsx
+++ b/packages/card/src/components/CheckCard/demos/custom.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 自定义尺寸
- */
-
import { CheckCard } from '@ant-design/pro-components';
export default () => (
diff --git a/packages/card/src/components/CheckCard/demos/defaultChecked.tsx b/packages/card/src/components/CheckCard/demos/defaultChecked.tsx
index 4df2a29c98ca..e467d0d33056 100644
--- a/packages/card/src/components/CheckCard/demos/defaultChecked.tsx
+++ b/packages/card/src/components/CheckCard/demos/defaultChecked.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 默认选中
- */
-
import { CheckCard } from '@ant-design/pro-components';
export default () => (
diff --git a/packages/card/src/components/CheckCard/demos/description.tsx b/packages/card/src/components/CheckCard/demos/description.tsx
index 657393d577b8..cbf3e4d57b63 100644
--- a/packages/card/src/components/CheckCard/demos/description.tsx
+++ b/packages/card/src/components/CheckCard/demos/description.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 自定义描述
- */
-
import { CheckCard } from '@ant-design/pro-components';
import { Typography } from 'antd';
diff --git a/packages/card/src/components/CheckCard/demos/disabled.tsx b/packages/card/src/components/CheckCard/demos/disabled.tsx
index e8960581c3c9..f8f3ae9f3c60 100644
--- a/packages/card/src/components/CheckCard/demos/disabled.tsx
+++ b/packages/card/src/components/CheckCard/demos/disabled.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 选项不可用
- */
-
import { CheckCard } from '@ant-design/pro-components';
export default () => (
diff --git a/packages/card/src/components/CheckCard/demos/extra.tsx b/packages/card/src/components/CheckCard/demos/extra.tsx
index d03cfa6c094d..b0eddba9eeac 100644
--- a/packages/card/src/components/CheckCard/demos/extra.tsx
+++ b/packages/card/src/components/CheckCard/demos/extra.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 操作栏
- */
-
import { EllipsisOutlined } from '@ant-design/icons';
import { CheckCard } from '@ant-design/pro-components';
import { Dropdown, message } from 'antd';
diff --git a/packages/card/src/components/CheckCard/demos/form.tsx b/packages/card/src/components/CheckCard/demos/form.tsx
index 0fd2cb9882e2..5143c5c91819 100644
--- a/packages/card/src/components/CheckCard/demos/form.tsx
+++ b/packages/card/src/components/CheckCard/demos/form.tsx
@@ -1,8 +1,3 @@
-/**
- * title: 表单中使用
- */
-
-/* eslint-disable no-console */
import { CheckCard } from '@ant-design/pro-components';
import { Avatar, Button, Form } from 'antd';
diff --git a/packages/card/src/components/CheckCard/demos/grid.tsx b/packages/card/src/components/CheckCard/demos/grid.tsx
index 084917aebba6..08eb0a73c251 100644
--- a/packages/card/src/components/CheckCard/demos/grid.tsx
+++ b/packages/card/src/components/CheckCard/demos/grid.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 布局
- */
-
import { CheckCard } from '@ant-design/pro-components';
import { Col, Row } from 'antd';
diff --git a/packages/card/src/components/CheckCard/demos/group.tsx b/packages/card/src/components/CheckCard/demos/group.tsx
index e2ab89b6e13a..ca3dad5513ab 100644
--- a/packages/card/src/components/CheckCard/demos/group.tsx
+++ b/packages/card/src/components/CheckCard/demos/group.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 选项列表
- */
-
import { CheckCard } from '@ant-design/pro-components';
export default () => (
diff --git a/packages/card/src/components/CheckCard/demos/image.tsx b/packages/card/src/components/CheckCard/demos/image.tsx
index 83242d75f856..a98e7d7b5121 100644
--- a/packages/card/src/components/CheckCard/demos/image.tsx
+++ b/packages/card/src/components/CheckCard/demos/image.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 纯图片选项
- */
-
import { CheckCard } from '@ant-design/pro-components';
export default () => (
diff --git a/packages/card/src/components/CheckCard/demos/list.tsx b/packages/card/src/components/CheckCard/demos/list.tsx
index dbb43314b43a..b364dab0f111 100644
--- a/packages/card/src/components/CheckCard/demos/list.tsx
+++ b/packages/card/src/components/CheckCard/demos/list.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 应用列表示例
- */
-
import { CheckCard } from '@ant-design/pro-components';
import { Avatar } from 'antd';
diff --git a/packages/card/src/components/CheckCard/demos/loading.tsx b/packages/card/src/components/CheckCard/demos/loading.tsx
index 7366d54faf8f..d31d0c3cb97c 100644
--- a/packages/card/src/components/CheckCard/demos/loading.tsx
+++ b/packages/card/src/components/CheckCard/demos/loading.tsx
@@ -1,7 +1,3 @@
-/**
- * title: 组件 Loading
- */
-
import { CheckCard } from '@ant-design/pro-components';
export default () =>
+
+
+
+
+
+### 不同尺寸
+
+配置 `size` 尺寸大小,当前可选 `large`,`default`,`small`,不同尺寸仅宽度不同。
+
+
+
+当然你也可以通过 `style` 或 `className` 自定义卡片大小。
+
+### 自定义尺寸
+
+
+
+### 表单中使用
+
+CheckCard 可以和表单组件一起使用,这里给出演示示例。
+
+
+
+### 组合样式
+
+头像,标题,描述区域可以自由组合或者单独呈现,组件会为你调整为最合适的对齐方式。
+
+
+
+### 自定义头像
+
+你可以通过 `avatar` 属性自定义头像区域。
+
+
+
+### 自定义标题
+
+你可以通过 `title` 属性自定义标题区域。
+
+
+
+### 自定义描述
+
+描述区域可通过 `description` 自定义 React 节点。
+
+
+
+### 默认选中
+
+通过配置 `defaultChecked` 属性为 `true` 来配置选项默认被选中。
+
+
+
+### 操作栏
+
+配置 `extra` 为卡片添加操作栏。
+
+
+
+### 组件 Loading
+
+通过配置 `loading` 属性为 `true` 来配置内容在加载中。
+
+
+
+### 纯图片选项
+
+通过仅仅配置 `cover` 属性可以让你的选项成为一个纯图片选项。
+
+
+
+### 选项不可用
+
+通过配置 `disabled` 属性配置选项不可用。
+
+
+
+### 选项列表
+
+`CheckCard.Group` 支持通过 `options` 属性配置化来列表展示多个选项。
+
+
+
+### 应用列表示例
+
+这里展示在实际 AiDesk 中图像算法选择的使用示例。
+
+
+
+### 布局
+
+`CheckCard.Group` 内嵌 `CheckCard` 并与 `Grid` 组件一起使用,可以实现更灵活的布局。
+
+
+
+## API
+
+### CheckCard
+
+| 参数 | 说明 | 类型 | 默认值 | 版本 |
+| --- | --- | --- | --- | --- |
+| checked | 指定当前是否选中 | boolean | false |
+| bordered | 是否显示边框 | boolean | true | 1.20.0 |
+| value | 选项值 | string | - |
+| defaultChecked | 初始是否选中 | boolean | false |
+| disabled | 失效状态 | boolean | false |
+| size | 选择框大小,可选 `large` `small` | string | `default` | |
+| onChange | 变化时回调函数 | Function(checked) | - |
+| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
+| title | 标题 | string \| ReactNode | - |
+| description | 描述 | ReactNode | - |
+| avatar | 选项元素的图片地址 | link \| ReactNode | - |
+| extra | 动作区域 | 卡片右上角的操作区域 | - |
+| cover | 卡片背景图片, 注意使用该选项后`title`,`description`和`avatar`失效 | ReactNode | - |
+
+### CheckCard.Group
+
+| 参数 | 说明 | 类型 | 默认值 | 版本 |
+| --- | --- | --- | --- | --- |
+| multiple | 多选 | boolean | false |
+| bordered | 是否显示边框 | boolean | true | 1.20.0 |
+| defaultValue | 默认选中的选项 | string \| string\[] | - |
+| disabled | 整组失效 | boolean | false |
+| loading | 当卡片组内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
+| options | 指定可选项 | string\[] \| Array<{ title: ReactNode, value: string, description?: ReactNode, avatar?: link or ReactNode, cover?:ReactNode, disabled?: boolean }> | \[] |
+| value | 指定选中的选项 | string \| string\[] | - |
+| size | 选择框大小,可选 `large` `small` | string | `default` | |
+| onChange | 变化时回调函数 | Function(checkedValue) | - |
diff --git a/packages/card/src/components/CheckCard/index.md b/packages/card/src/components/CheckCard/index.md
index 75bef936cc26..d83a0dd6e415 100644
--- a/packages/card/src/components/CheckCard/index.md
+++ b/packages/card/src/components/CheckCard/index.md
@@ -1,11 +1,6 @@
---
title: CheckCard - 多选卡片
order: 1
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# CheckCard 多选卡片
@@ -29,17 +24,9 @@ nav:
-### 单选模式
+
-在多个选项存在的情况下可通过 `CheckCard.Group` 分组,默认选项卡组件为单选模式。
-
-
-
-### 多选模式
-
-通过设置 `CheckCard.Group` 的 `multiple` 属性配置多选,注意多选模式下表单项返回值为数组。
-
-
+
### 不同尺寸
@@ -57,7 +44,7 @@ nav:
CheckCard 可以和表单组件一起使用,这里给出演示示例。
-
+
### 组合样式
diff --git a/packages/card/src/components/CheckCard/style.ts b/packages/card/src/components/CheckCard/style.ts
index 215bd509a8f5..9f379547cf84 100644
--- a/packages/card/src/components/CheckCard/style.ts
+++ b/packages/card/src/components/CheckCard/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
export interface ProListToken extends ProAliasToken {
diff --git a/packages/card/src/components/Divider/style.ts b/packages/card/src/components/Divider/style.ts
index d18a2d23c2f2..d46632b3b74a 100644
--- a/packages/card/src/components/Divider/style.ts
+++ b/packages/card/src/components/Divider/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
interface ProCardDividerToken extends ProAliasToken {
diff --git a/packages/card/src/components/Loading/style.ts b/packages/card/src/components/Loading/style.ts
index 38ff4ef36827..20ec27a997d5 100644
--- a/packages/card/src/components/Loading/style.ts
+++ b/packages/card/src/components/Loading/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
export interface ProToken extends ProAliasToken {
diff --git a/packages/card/src/components/Operation/style.ts b/packages/card/src/components/Operation/style.ts
index 69c3f728d05c..912c660e9f1d 100644
--- a/packages/card/src/components/Operation/style.ts
+++ b/packages/card/src/components/Operation/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
export interface ProToken extends ProAliasToken {
diff --git a/packages/card/src/components/Statistic/style.ts b/packages/card/src/components/Statistic/style.ts
index 387da706c3f5..e84afcc02915 100644
--- a/packages/card/src/components/Statistic/style.ts
+++ b/packages/card/src/components/Statistic/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
export interface ProListToken extends ProAliasToken {
diff --git a/packages/card/src/components/StatisticCard/index.en-US.md b/packages/card/src/components/StatisticCard/index.en-US.md
new file mode 100644
index 000000000000..9ac275d0e0b4
--- /dev/null
+++ b/packages/card/src/components/StatisticCard/index.en-US.md
@@ -0,0 +1,151 @@
+---
+title: StatisticCard - 指标卡
+order: 1
+---
+
+# StatisticCard 指标卡
+
+指标卡结合统计数值用于展示某主题的核心指标,结合 [Ant Design Charts](https://charts.ant.design/) 图表库丰富数值内容,满足大多数数值展示的场景。
+
+> 注意 demo 中的所有图表示例可以到 charts 的官网中找到,这里不再给出实际代码示例,仅以图片进行代替,所以相关交互是没有的。
+
+> 若有内容撑开卡片的情况请设置内容宽度为 100% 或设置定宽。
+
+## 何时使用
+
+- 1)在页面内的重要位置,展示重要信息;
+- 2)在概览页面展示系统功能。
+
+## 代码演示
+
+### 基本使用
+
+使用数值统计配置 `statistic` 和 `chart` 完成基本的指标卡。
+
+
+
+### 只有图表
+
+当图表单独展示在卡片中时。
+
+
+
+### 额外指标
+
+- `footer` 用于设置额外的指标展示区域。
+- 你可以设置 `Statistic` 组件的布局方式`layout` 为 `horizontal` 来展示横向指标。
+
+### 总分/主次关系
+
+
+
+### 总分/业绩目标
+
+
+
+### 分组指标
+
+你可以嵌套指标卡组件来将指标分组, 以及 `Divider` 子组件来分隔这些指标。
+
+### 分组指标带图表
+
+
+
+### 公式计算指标
+
+`Operation` 可以接受子元素,借此可以实现各种各样的公式计算指标。
+
+
+
+### 状态展示
+
+你可以给每个数值统计配置 `status` 展示其状态。
+
+
+
+### 图标展示
+
+你可以给每个数值统计配置 `icon` 展示其图标。
+
+
+
+### 卡片布局
+
+配合 `ProCard` 的卡片切分能力可以实现复杂的卡片布局。
+
+
+
+### 图表在右
+
+配置 `chartPlacement` 为 `right` 可以指定图表在数值统计的右边。默认为上下结构。
+
+
+
+### 图表在左
+
+配置 `chartPlacement` 为 `left` 可以指定图表在数值统计的左边。
+
+
+
+### 指标页签联动
+
+结合 `Statistic` 可以实现带指标统计的页签。
+
+
+
+### 环比趋势
+
+你可以使用 `Statistic` 组件配置布局 `layout` 为 `inline` 以及 `trend` 来展示环比趋势。
+
+
+
+## API
+
+### StatisticCard
+
+| 参数 | 说明 | 类型 | 默认值 |
+| --- | --- | --- | --- |
+| title | 卡片标题 | `string\|ReactNode` | - |
+| extra | 卡片右上角的操作区域 | `string\|ReactNode` | - |
+| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
+| bordered | 是否有边框 | boolean | true |
+| chart | 图表卡片 | ReactNode | - |
+| statistic | 数值统计配置,布局默认为 `vertical` | 参数见下 Statistic | - |
+| chartPlacement | 图表位置,相对于 statistic 的位置 | `left \| right \| bottom` | - |
+| footer | 额外指标展示 | `ReactNode` | - |
+
+更多参考 `ProCard`,支持 `ProCard` 的所有 API。
+
+### Statistic
+
+| 参数 | 说明 | 类型 | 默认值 |
+| --- | --- | --- | --- |
+| prefix | 设置数值的前缀 | string \| ReactNode | - |
+| suffix | 设置数值的后缀 | string \| ReactNode | - |
+| title | 数值的标题 | string \| ReactNode | - |
+| tip | 标题提示 | string\| ReactNode | - |
+| value | 数值内容 | string \| number | - |
+| icon | 图标 | ReactNode | - |
+| status | 设置状态点, 同 Badge 组件 | `Enum{ 'success', 'processing, 'default', 'error', 'warning' }` | - |
+| valueStyle | 设置数值的样式 | style | - |
+| description | 描述性标签 | React.ReactNode \| () => React.ReactNode | - |
+| layout | 布局 | `horizontal \| vertical \| inline` | `inline` |
+| trend | 趋势 | `up \| down \|` | - |
+
+更多 API 参考 [Statistic](https://ant.design/components/statistic-cn/),支持 `Statistic` 的所有 API。
+
+### Divider
+
+用于在将数值统计进行分组时进行分隔。
+
+| 参数 | 说明 | 类型 | 默认值 |
+| ---- | -------- | ------------------------ | ------ |
+| type | 分隔类型 | `horizontal \| vertical` | - |
+
+### Operation
+
+用于操作符渲染。
+
+### Group
+
+属性同 `StatisticCard`,会取消卡片内容边距,用于将多个卡片进行分组。
diff --git a/packages/card/src/components/StatisticCard/index.md b/packages/card/src/components/StatisticCard/index.md
index 03c1a540fe6e..9ac275d0e0b4 100644
--- a/packages/card/src/components/StatisticCard/index.md
+++ b/packages/card/src/components/StatisticCard/index.md
@@ -1,11 +1,6 @@
---
title: StatisticCard - 指标卡
order: 1
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# StatisticCard 指标卡
@@ -27,13 +22,13 @@ nav:
使用数值统计配置 `statistic` 和 `chart` 完成基本的指标卡。
-
+
### 只有图表
当图表单独展示在卡片中时。
-
+
### 额外指标
@@ -42,11 +37,11 @@ nav:
### 总分/主次关系
-
+
### 总分/业绩目标
-
+
### 分组指标
@@ -54,55 +49,55 @@ nav:
### 分组指标带图表
-
+
### 公式计算指标
`Operation` 可以接受子元素,借此可以实现各种各样的公式计算指标。
-
+
### 状态展示
你可以给每个数值统计配置 `status` 展示其状态。
-
+
### 图标展示
你可以给每个数值统计配置 `icon` 展示其图标。
-
+
### 卡片布局
配合 `ProCard` 的卡片切分能力可以实现复杂的卡片布局。
-
+
### 图表在右
配置 `chartPlacement` 为 `right` 可以指定图表在数值统计的右边。默认为上下结构。
-
+
### 图表在左
配置 `chartPlacement` 为 `left` 可以指定图表在数值统计的左边。
-
+
### 指标页签联动
结合 `Statistic` 可以实现带指标统计的页签。
-
+
### 环比趋势
你可以使用 `Statistic` 组件配置布局 `layout` 为 `inline` 以及 `trend` 来展示环比趋势。
-
+
## API
diff --git a/packages/card/src/components/StatisticCard/style.ts b/packages/card/src/components/StatisticCard/style.ts
index f453b86e5594..d656bdb938f5 100644
--- a/packages/card/src/components/StatisticCard/style.ts
+++ b/packages/card/src/components/StatisticCard/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
export interface ProListToken extends ProAliasToken {
diff --git a/packages/card/src/components/TabPane/index.tsx b/packages/card/src/components/TabPane/index.tsx
index 1ee793021614..3a73b0c43953 100644
--- a/packages/card/src/components/TabPane/index.tsx
+++ b/packages/card/src/components/TabPane/index.tsx
@@ -85,7 +85,7 @@ const TabPane: React.FC
+
### Grid layout
When nesting child cards, the component will automatically switch to `flex` flex box layout, you can set `direction` to `column` to specify the flex direction, you can also configure the `ghost` property to `true` to remove Background color and padding facilitate in-page layout.
-
+
### Responsive
`colSpan` supports [Grid Responsive Layout](https://ant.design/components/grid-cn/#components-grid-demo-responsive) defined by antd. There are six preset response sizes: `xs` `sm` `md` `lg` `xl` `xxl`. If you want to support responsiveness, you can write `{ xs: 4, sm: 8, md: 10, lg: 12 }`.
-
+
### Card segmentation
@@ -48,114 +45,114 @@ In layout mode, by configuring `split`, you can easily split the card, and you c
- The content `padding` of the parent card will be set to 0 when splitting.
- `border-radius` of subcards will be set to 0 when splitting.
-
+
### Left and right columns
Through the card segmentation ability, we can easily achieve the effect of left and right columns, which is very suitable for the structure of the list on the left and the details on the right.
-
+
### Complex segmentation
Through the card segmentation capability, we can achieve more complex data presentation forms.
-
+
### Grid interval
The grid often needs to cooperate with the interval. You can use the `gutter` property. We recommend using `(16+8n)px` as the grid interval (n is a natural number). If you want to support responsiveness, you can write it as `{ xs: 8, sm: 16, md: 24, lg: 32 }`. If vertical spacing is required, it can be written in array form `[horizontal spacing, vertical spacing][16, { xs: 8, sm: 16, md: 24, lg: 32 }]`.
-
+
### Multi-Line Cards
The default card layout does not wrap, you can configure `wrap` to `true` to enable line wrapping between multiple cards, which is suitable for multiple card layouts.
-
+
### group display
You can nest card components to group content, and `Divider` subcomponents to separate those content.
-
+
### Title with dividing line
When adding a divider it automatically increases the height of the header to separate it from the content area.
-
+
### Collapsible
- You can use `collapsible` to configure whether the card is collapsible or not, and configure whether the card is collapsed by default through the `defaultCollapsed` property.
- Or you can customize it by controlling the `collapsed` property.
-
+
### Deck expansion
With the `ghost` ghost mode and collapsible ability, the card deck can be expanded.
-
+
### Content centered
Configure the `layout` property to `center` to control the vertical centering of the content. When setting the centering, the content part is converted to a `flex` layout. You can use `direction` to control the `flex` direction.
-
+
### Loading
Configure the `loading` property to `true` to control the loading of the card. You can also pass the DOM to `loading` to customize the loading display.
-
+
### Action items
Configure the `actions` property to configure card actions.
-
+
### Untitled
The header is automatically hidden when there is no content.
-
+
### with border
Configure the `bordered` property to control whether the card is bordered.
-
+
### floating effect
-
+
### bookmark
Configure the `tabs` property with the `ProCard.TabPane` subcomponent to configure the tab bar of the card.
-
+
### Card Tab
Set the `type` of `tab` to `card` to configure card-style tabs.
-
+
### Internal Cards
Can be placed inside a card to display information in a multi-level structure.
-
+
### Vertical step example
The `Steps` component is combined with the `ProCard` component to complete the vertical step example.
-
+
## API
diff --git a/packages/card/src/card.md b/packages/card/src/components/card.md
similarity index 71%
rename from packages/card/src/card.md
rename to packages/card/src/components/card.md
index 0cc7a12e79ab..613c5bd848b0 100644
--- a/packages/card/src/card.md
+++ b/packages/card/src/components/card.md
@@ -1,10 +1,5 @@
---
title: ProCard - 高级卡片
-nav:
- title: 组件
- path: /components
-group:
- path: /
---
# ProCard - 高级卡片
@@ -23,23 +18,11 @@ group:
## 代码演示
-### 基础卡片
+
-当单独使用时 `ProCard` 就是一个普通的卡片。
+
-
-
-### 栅格布局
-
-当嵌套子卡片时, 组件会自动切换为 `flex` 弹性盒布局,你可以将 `direction`设置为`column`来指定 Flex 方向,你还可以通过配置 `ghost` 属性为 `true` 来去掉背景色和 padding 方便页内布局。
-
-
-
-### 响应式
-
-`colSpan` 支持 antd 定义的[栅格式响应布局](https://ant.design/components/grid-cn/#components-grid-demo-responsive)。预设六个响应尺寸:`xs` `sm` `md` `lg` `xl` `xxl`。如果要支持响应式,可以写成 `{ xs: 4, sm: 8, md: 10, lg: 12 }`。
-
-
+
### 卡片切分
@@ -48,114 +31,112 @@ group:
- 切分时父卡片的内容 `padding` 会被设置为 0。
- 切分时子卡片的 `border-radius`会被设置为 0。
-
+
### 左右分栏
通过卡片切分能力我们很容易实现左右分栏的效果,很适合左侧是列表,右侧是详情的结构。
-
+
### 复杂切分
通过卡片切分能力我们可以实现更加复杂的数据展现形式。
-
+
### 栅格间隔
栅格常常需要和间隔进行配合,你可以使用 `gutter` 属性,我们推荐使用 `(16+8n)px` 作为栅格间隔(n 是自然数),如果要支持响应式,可以写成 `{ xs: 8, sm: 16, md: 24, lg: 32 }`。如果需要垂直间距,可以写成数组形式 `[水平间距, 垂直间距][16, { xs: 8, sm: 16, md: 24, lg: 32 }]`。
-
+
### 多行卡片
默认卡片布局不可换行,你可以配置 `wrap` 为 `true` 来让多个卡片之间可以换行,适用于多个卡片排版的情况。
-
+
### 分组展示
你可以嵌套卡片组件来将内容分组, 以及 `Divider` 子组件来分隔这些内容。
-
+
### 标题带分割线
当添加分隔线时会自动增加标题的高度与内容区域分开。
-
+
### 可折叠
- 你可以使用 `collapsible` 来配置卡片是否可折叠,通过 `defaultCollapsed` 属性配置是否默认折叠。
- 或者你可以通过 `collapsed` 属性受控进行自定义。
-
+
### 卡片组展开
配合 `ghost`幽灵模式和可折叠能力可以实现卡片组展开。
-
+
### 内容居中
配置 `layout` 属性为 `center` 控制内容垂直居中,设置居中时内容部分转为 `flex` 布局,可以使用 `direction` 控制 `flex` 方向。
-
+
### 加载中
配置 `loading`属性为`true`控制卡片加载中,也可以传入 DOM 给`loading`来自定义 loading 展示。
-
+
### 操作项
配置 `actions` 属性来配置卡片操作项。
-
+
### 无标题
头部没有内容时会自动隐藏。
-
+
### 带边框
配置 `bordered` 属性控制是否卡片带边框。
-
-
-### 浮出效果
+
-
+
### 页签
配置 `tabs` 属性配合 `ProCard.TabPane` 子组件可以配置卡片的标签栏。
-
+
### 卡片式页签
配置 `tab` 的 `type` 为 `card` 来配置卡片式页签。
-
+
### 内部卡片
可以放在卡片内部,展示多层级结构的信息。
-
+
### 竖向步骤示例
`Steps` 组件结合 `ProCard` 组件完成竖向步骤示例。
-
+
## API
diff --git a/packages/components/.fatherrc.ts b/packages/components/.fatherrc.ts
new file mode 100644
index 000000000000..5fd9ba42c432
--- /dev/null
+++ b/packages/components/.fatherrc.ts
@@ -0,0 +1,9 @@
+import { defineConfig } from 'father';
+
+export default defineConfig({
+ extends: '../../.fatherrc.base.ts',
+ umd: {
+ name: 'ProComponents',
+ output: 'dist',
+ },
+});
diff --git a/packages/components/package.json b/packages/components/package.json
index 5fd3f3d564b8..868fda59bd6e 100644
--- a/packages/components/package.json
+++ b/packages/components/package.json
@@ -25,6 +25,9 @@
"lib",
"es"
],
+ "scripts": {
+ "build": "father build"
+ },
"browserslist": [
"last 2 versions",
"Firefox ESR",
diff --git a/packages/components/src/index.tsx b/packages/components/src/index.tsx
index 840b13689190..1fba8fb4c04c 100644
--- a/packages/components/src/index.tsx
+++ b/packages/components/src/index.tsx
@@ -3,11 +3,11 @@ export * from '@ant-design/pro-descriptions';
export * from '@ant-design/pro-field';
export * from '@ant-design/pro-form';
export * from '@ant-design/pro-layout';
-export * from '@ant-design/pro-list';
export * from '@ant-design/pro-provider';
export * from '@ant-design/pro-skeleton';
export * from '@ant-design/pro-table';
export * from '@ant-design/pro-utils';
+export * from '@ant-design/pro-list';
// @ts-ignore
export * from './version';
diff --git a/packages/descriptions/.fatherrc.ts b/packages/descriptions/.fatherrc.ts
new file mode 100644
index 000000000000..3305dd5a74a7
--- /dev/null
+++ b/packages/descriptions/.fatherrc.ts
@@ -0,0 +1,5 @@
+import { defineConfig } from 'father';
+
+export default defineConfig({
+ extends: '../../.fatherrc.base.ts',
+});
diff --git a/packages/descriptions/package.json b/packages/descriptions/package.json
index d4fe0545407e..5399c0112de5 100644
--- a/packages/descriptions/package.json
+++ b/packages/descriptions/package.json
@@ -24,6 +24,9 @@
"dist",
"lib"
],
+ "scripts": {
+ "build": "father build"
+ },
"browserslist": [
"last 2 versions",
"Firefox ESR",
diff --git a/packages/descriptions/src/descriptions.en-US.md b/packages/descriptions/src/components/descriptions.en-US.md
similarity index 92%
rename from packages/descriptions/src/descriptions.en-US.md
rename to packages/descriptions/src/components/descriptions.en-US.md
index c3b2dd10848b..d9a17cc80368 100644
--- a/packages/descriptions/src/descriptions.en-US.md
+++ b/packages/descriptions/src/components/descriptions.en-US.md
@@ -1,11 +1,7 @@
---
title: ProDescriptions
-legacy: /descriptions
-group:
- path: /
nav:
- title: Components
- path: /components
+ title: ProDescriptions - 高级定义列表
order: 1
---
@@ -55,37 +51,37 @@ interface RequestData {
### Basic usage
-
+
### Request data remotely
Display the definition list by requesting interface data
-
+
### columns configuration
Display the definition list by requesting interface data and columns
-
+
### format configuration
Format the date according to format
-
+
### dataSource configuration data
ProDescriptions supports the same dataSource as Table
-
+
### Editable definition list
API is the same as ProTable
-
+
## API
@@ -120,7 +116,7 @@ API is the same as ProTable
| onSave | Triggered when a row is saved | `(key: Key, row: T,originRow:T,newLine?:newLineConfig) => Promise
+
### 数组类型 dataIndex
-
+
### 格式化配置
根据配置格式化日期
-
+
### 远程请求数据
通过请求接口数据来展示定义列表
-
+
### columns 配置
通过请求接口数据和 columns 来展示定义列表
-
+
### dataSource 配置数据
ProDescriptions 支持了和 Table 相同的 dataSource
-
+
### 可编辑的定义列表
API 与 ProTable 相同
-
+
## API
@@ -127,7 +122,7 @@ API 与 ProTable 相同
| deleteText | 删除一行的文字 | `React.ReactNode` | `删除` |
| onCancel | 取消编辑一行时触发 | `(key: Key, row: T,originRow:T,newLine?:newLineConfig) => Promise
+
-
+
-
+
-
+
-
+
-
+
## API
diff --git a/packages/field/src/demos/base.tsx b/packages/field/src/demos/base.tsx
index 1b31cffd7df4..a3b992eb7f2d 100644
--- a/packages/field/src/demos/base.tsx
+++ b/packages/field/src/demos/base.tsx
@@ -1,5 +1,5 @@
import type { ProFieldFCMode } from '@ant-design/pro-components';
-import Field from '@ant-design/pro-field';
+import { ProField } from '@ant-design/pro-components';
import { Descriptions, Radio, Space, Switch } from 'antd';
import dayjs from 'dayjs';
import { useState } from 'react';
@@ -21,20 +21,20 @@ export default () => {
+
### Get form dependency values
@@ -53,4 +51,4 @@ The following examples demonstrate the order in which dependencies are evaluated
- `ignoreFormListField` of `
+
diff --git a/packages/form/src/components/Dependency/index.md b/packages/form/src/components/Dependency/index.md
index 0b488850da6c..f048e31b1694 100644
--- a/packages/form/src/components/Dependency/index.md
+++ b/packages/form/src/components/Dependency/index.md
@@ -1,11 +1,6 @@
---
title: ProFormDependency - 数据联动
order: 1
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# 数据联动
diff --git a/packages/form/src/components/Digit/index.tsx b/packages/form/src/components/Digit/index.tsx
index 89973abb2b02..a30decc2ccc1 100644
--- a/packages/form/src/components/Digit/index.tsx
+++ b/packages/form/src/components/Digit/index.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import type { ProFormFieldItemProps } from '../../typing';
import ProFormField from '../Field';
-export type ProFormDigitProps = ProFormFieldItemProps
+
### Date form
-
+
### Upload form
-
+
### Structured data
-
+
### Read-only for form field
diff --git a/packages/form/src/components/FieldSet/index.md b/packages/form/src/components/FieldSet/index.md
index 33dffec879ee..507bcc2a3bf2 100644
--- a/packages/form/src/components/FieldSet/index.md
+++ b/packages/form/src/components/FieldSet/index.md
@@ -1,11 +1,6 @@
---
title: ProFormFields - 表单项
order: 1
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# ProFormFields 表单项
diff --git a/packages/form/src/components/Group/index.en-US.md b/packages/form/src/components/Group/index.en-US.md
index 2907bce505a2..1eb42a328392 100644
--- a/packages/form/src/components/Group/index.en-US.md
+++ b/packages/form/src/components/Group/index.en-US.md
@@ -1,11 +1,9 @@
---
title: Structured data
order: 1
-group:
- path: /
+
nav:
title: Components
- path: /components
---
# ProFormFields
diff --git a/packages/form/src/components/Group/index.md b/packages/form/src/components/Group/index.md
index 9506b55cabda..476ec8796029 100644
--- a/packages/form/src/components/Group/index.md
+++ b/packages/form/src/components/Group/index.md
@@ -1,11 +1,6 @@
---
title: ProFormList - 数据结构化
order: 1
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# 数据结构化
diff --git a/packages/form/src/components/Group/style.ts b/packages/form/src/components/Group/style.ts
index b33754bed25f..0cf154955985 100644
--- a/packages/form/src/components/Group/style.ts
+++ b/packages/form/src/components/Group/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
export interface ProToken extends ProAliasToken {
diff --git a/packages/form/src/components/List/style.ts b/packages/form/src/components/List/style.ts
index 84e543aaceb6..7afdac214111 100644
--- a/packages/form/src/components/List/style.ts
+++ b/packages/form/src/components/List/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
export interface ProToken extends ProAliasToken {
diff --git a/packages/form/src/components/LoginForm/index.en-US.md b/packages/form/src/components/LoginForm/index.en-US.md
index 2f630ba0f573..3d7d78ddd009 100644
--- a/packages/form/src/components/LoginForm/index.en-US.md
+++ b/packages/form/src/components/LoginForm/index.en-US.md
@@ -1,11 +1,9 @@
---
title: LoginForm/Page
Order: 2
-group:
- Path: /
+
navigation:
Title: Components
- path: /components
---
# LoginForm/Page
@@ -14,11 +12,11 @@ LoginForm and LoginFormPage are variants of ProForm. They are specially implemen
## Login form
-
+
## page level LoginForm
-
+
### LoginForm
diff --git a/packages/form/src/components/LoginForm/index.md b/packages/form/src/components/LoginForm/index.md
index b4d18656a470..4375be15c578 100644
--- a/packages/form/src/components/LoginForm/index.md
+++ b/packages/form/src/components/LoginForm/index.md
@@ -1,11 +1,6 @@
---
title: LoginForm/Page - 登录表单
order: 2
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# 登录表单
diff --git a/packages/form/src/components/ModalForm/index.en-US.md b/packages/form/src/components/ModalForm/index.en-US.md
index 872ec99b261b..4a9dae238a6b 100644
--- a/packages/form/src/components/ModalForm/index.en-US.md
+++ b/packages/form/src/components/ModalForm/index.en-US.md
@@ -1,10 +1,8 @@
---
title: Modal/DrawerForm
-group:
- path: /
+
nav:
title: Components
- path: /components
---
# Modal/DrawerForm - Floating Forms
@@ -15,27 +13,27 @@ ModalForm and DrawerForm both provide triggers to reduce state usage, if you nee
## Modal Forms
-
+
## Drawer Forms
-
+
## Nested Drawer Forms
-
+
## Custom Modal Forms' Button
-
+
## Use open and onOpenChange
-
+
## Reset Form
-
+
## API
diff --git a/packages/form/src/components/ModalForm/index.md b/packages/form/src/components/ModalForm/index.md
index 916701cd1512..995c5d796734 100644
--- a/packages/form/src/components/ModalForm/index.md
+++ b/packages/form/src/components/ModalForm/index.md
@@ -1,11 +1,6 @@
---
title: Modal/Drawer - 浮层表单
order: 2
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# 浮层表单
diff --git a/packages/form/src/components/Money/index.tsx b/packages/form/src/components/Money/index.tsx
index c204098be054..b3937d126bf0 100644
--- a/packages/form/src/components/Money/index.tsx
+++ b/packages/form/src/components/Money/index.tsx
@@ -5,12 +5,12 @@ import type { ProFormFieldItemProps } from '../../typing';
import ProFormField from '../Field';
export type ProFormMoneyProps = ProFormFieldItemProps<
- Omit
+
+### 文字水印
+
+通过 `content` 指定文字水印内容。
+
+
+
+### 多行文字水印
+
+通过 `content`设置 字符串数组 指定多行文字水印内容。
+
+
+
+### 图片水印
+
+通过 `image` 指定图片地址。为保证图片高清且不被拉伸,请传入水印图片的宽高 width 和 height, 并上传至少两倍的宽高的 logo 图片地址。
+
+
+
+### 自定义配置
+
+这里给出一些通用配置项。如需进一步配置请联系我们。
+
+
+
+## API
+
+### 基础参数
+
+| 参数 | 说明 | 类型 | 默认值 | 版本 |
+| --- | --- | --- | --- | --- |
+| width | 水印的宽度 | number | 120 | 2.2.0 |
+| height | 水印的高度 | number | 64 | 2.2.0 |
+| rotate | 水印绘制时,旋转的角度,单位 ° | number | -22 | 2.2.0 |
+| image | 图片源,建议导出 2 倍或 3 倍图,优先使用图片渲染水印 | `string` | - | 2.2.0 |
+| zIndex | 追加的水印元素的 z-index | number | 9 | 2.2.0 |
+| content | 水印文字内容 | `string` \| `string[]` | - | 2.2.0 |
+| fontColor | 水印文字颜色 | `string` | `rgba(0,0,0,.15)` | 2.2.0 |
+| fontSize | 文字大小 | `string` \| `number` | 16 | 2.2.0 |
+
+### 高级参数
+
+| 参数 | 说明 | 类型 | 默认值 | 版本 |
+| --- | --- | --- | --- | --- |
+| markStyle | 水印层的样式 | React.CSSProperties | - | 2.3.0 |
+| markClassName | 水印层的类名 | string | - | 2.3.0 |
+| gapX | 水印之间的水平间距 | number | 212 | 2.4.0 |
+| gapY | 水印之间的垂直间距 | number | 222 | 2.4.0 |
+| offsetLeft | 水印在 canvas 画布上绘制的水平偏移量, 正常情况下,水印绘制在中间位置, 即 `offsetTop = gapX / 2` | number | `offsetTop = gapX / 2` | 2.4.0 |
+| offsetTop | 水印在 canvas 画布上绘制的垂直偏移量,正常情况下,水印绘制在中间位置, 即 `offsetTop = gapY / 2` | number | `offsetTop = gapY / 2` | 2.4.0 |
+
+### 水印 API 可视化
+
+```jsx | inline
+import react from 'react';
+
+export default () => (
+
+
### Load menu from server
@@ -70,57 +68,57 @@ ProLayout provides a powerful menu, but this necessarily encapsulates a lot of b
The main APIs used to load menu from the server are `menuDataRender` and `menuRender`, `menuDataRender` controls the current menu data and `menuRender` controls the menu's dom node.
-
+
### Load the menu from the server and use the icon
Here is mainly a demo where we need to prepare an enumeration for icon rendering, which can significantly reduce the size of the package
-
+
### Customize the content of the menu
With `menuItemRender`, `subMenuItemRender`, `title`, `logo`, `menuHeaderRender` you can customize the menu style very easily. If you are really not satisfied, you can use `menuRender` to fully customize it.
-
+
### Custom footer
ProLayout does not provide footer by default, if you want to have the same style as Pro official website, you need to introduce a footer by yourself.
-
+
This is used to show various applications of ProLayout, if you think your usage can help others, feel free to PR.
### Search menu
-
+
### Multiple routes correspond to one menu item
-
+
### Open all menus by default
-
+
### Using IconFont
-
+
### ghost mode
PageContainer configuration `ghost` can switch the page header to transparent mode.
-
+
### Nested Layout
-
+
### Customized collapsed
-
+
## API
@@ -328,7 +326,7 @@ export interface Route {
path: string;
children: Array<{
exact?: boolean;
- icon: string;
+ emoji: string;
name: string;
path: string;
// Optional secondary menu
diff --git a/packages/layout/src/layout.md b/packages/layout/src/components/layout.md
similarity index 84%
rename from packages/layout/src/layout.md
rename to packages/layout/src/components/layout.md
index f5ffdde4c4fe..d1e34596b4c6 100644
--- a/packages/layout/src/layout.md
+++ b/packages/layout/src/components/layout.md
@@ -1,12 +1,6 @@
---
title: ProLayout - 高级布局
order: 0
-legacy: /layout
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# ProLayout - 高级布局
@@ -19,69 +13,37 @@ ProLayout 可以提供一个标准又不失灵活的中后台标准布局,同
## 代码演示
-### 基础使用
+
-
+
-### 通过 token 修改样式
+
-
+
-### 黑色主题
+
-
+
-### 侧栏导航
+
-
+
-### 混合导航
+
-
+
-### 顶部导航
+
-
+
-### 定制侧栏宽度
+
-
+
-### 页脚工具栏和全局公告
+
-
-
-### 收起时展示 title
-
-
-
-### 不分组菜单样式
-
-
-
-### 经典导航样式
-
-
-
-### 通过调整页面背景内容调整整体氛围
-
-
-
-### 定制菜单样式
-
-
-
-### 通过设置页背景和卡片样式简化界面层次
-
-
-
-### 自定侧栏菜单下方区域
-
-
-
-### 菜单展开-站点地图
-
-
+
### 从服务器加载 menu
@@ -89,91 +51,69 @@ ProLayout 提供了强大的菜单功能,但是这样必然会封装很多行
从服务器加载 menu 主要使用的 API 是 `menuDataRender` 和 `menuRender`,`menuDataRender`可以控制当前的菜单数据,`menuRender`可以控制菜单的 dom 节点。
-
+
### 从服务器加载 menu 并且使用 icon
这里主要是一个演示,我们需要准备一个枚举来进行 icon 的渲染,可以显著的减少打包的大小
-
+
### 自定义 menu 的内容
通过 `menuItemRender`, `subMenuItemRender`,`title`,`logo`,`menuHeaderRender` 可以非常方便的自定义 menu 的样式。如果实在是不满意,可以使用 `menuRender` 完全的自定义。
-
+
### 自定义页脚
ProLayout 默认不提供页脚,要是和 Pro 官网相同的样式,需要自己引入一下页脚。
-
+
这里用于展示 ProLayout 的各种应用,如果你觉得你的用法能帮助到别人,欢迎 PR。
-### 搜索菜单
-
-
-
-### 多个路由对应一个菜单项
+
-
+
### 默认打开所有菜单
menu 配置 `defaultOpenAll` 可以默认打开所有菜单
-
+
### 总是打开所有菜单
折叠按钮反复切换后 `defaultOpenAll` 将失效,menu 配置 `ignoreFlatMenu` 可以忽略手动折叠过的菜单,实现总是默认打开所有菜单。因为计算时机在组件渲染前,所以异步菜单不生效。
-
+
-### 使用 IconFont
-
-
+
### 吸顶 header
PageContainer 配置 `fixedHeader` 可以将吸顶 header。
-
-
-### 嵌套布局
-
-
+
-### 自定义的 collapsed
+
-
+
-### 面包屑显示在顶部
+
-
+
-### 多级站点导航
-
-
-
-### 沉浸式导航
-
-
+
### 跨站点导航 - simple 分组
-
-
-### 跨站点导航 - 分组
-
-
-
-### layout 自带了错误处理功能,防止白屏
+> 使用默认卡片展示,请确保每一项都有 desc,且值为真;使用分组展示,请确保每一项都有 children,且长度大于 0;
-
+
-
+
## API
@@ -405,7 +345,7 @@ export interface Route {
path: string;
children: Array<{
exact?: boolean;
- icon: string;
+ emoji: string;
name: string;
path: string;
// 可选二级菜单
diff --git a/packages/layout/src/style/index.ts b/packages/layout/src/style/index.ts
index cfa1c2f155e8..8d9472ae4dcd 100644
--- a/packages/layout/src/style/index.ts
+++ b/packages/layout/src/style/index.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
import { version } from 'antd';
diff --git a/packages/layout/src/typing.ts b/packages/layout/src/typing.ts
index 3f8f2c02c8be..acb0ed35802b 100644
--- a/packages/layout/src/typing.ts
+++ b/packages/layout/src/typing.ts
@@ -1,21 +1,9 @@
-import type * as H from 'history';
import type React from 'react';
export interface StaticContext {
statusCode?: number | undefined;
}
-export interface BasicRouteProps<
- Params extends { [K in keyof Params]?: string } = Record
+
### Edit list
-
+
### Support for expanded lists
-
+
### Supports checked list
-
+
### Query list
-
+
### List with filters and asynchronous requests
-
+
### Size and dividing line
-
+
### Vertical style
-
+
### some preset modes
-
+
### page turn
-
+
### Card List
-
+
##API
diff --git a/packages/list/src/list.md b/packages/list/src/components/list.md
similarity index 78%
rename from packages/list/src/list.md
rename to packages/list/src/components/list.md
index d03e012436f3..3823d125a597 100644
--- a/packages/list/src/list.md
+++ b/packages/list/src/components/list.md
@@ -1,11 +1,6 @@
---
title: ProList - 高级列表
order: 12
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# ProList - 高级列表
@@ -18,51 +13,51 @@ nav:
### 基本使用
-
+
### 编辑列表
-
+
### 带工具栏的列表
-
+
### 支持展开的列表
-
+
### 支持选中的列表
-
+
### 查询列表
-
+
### 带筛选和异步请求的列表
-
+
### 大小和分割线
-
+
### 竖排样式
-
+
### 一些预设的模式
-
+
### 翻页
-
+
### 卡片列表
-
+
## API
diff --git a/packages/list/src/index.tsx b/packages/list/src/index.tsx
index 2661458d7038..3fa3b7862dcc 100644
--- a/packages/list/src/index.tsx
+++ b/packages/list/src/index.tsx
@@ -10,6 +10,8 @@ import type { ItemProps } from './Item';
import ListView from './ListView';
import { useStyle } from './style/index';
import { ProConfigProvider } from '@ant-design/pro-provider';
+
+// 兼容性代码
import 'antd/es/list/style';
export type AntdListProps
+
-
+
### Results page
-
+
### Details page
-
+
## API
diff --git a/packages/skeleton/src/skeleton.md b/packages/skeleton/src/components/skeleton.md
similarity index 74%
rename from packages/skeleton/src/skeleton.md
rename to packages/skeleton/src/components/skeleton.md
index 9dd97cce4e0c..da8544c1feac 100644
--- a/packages/skeleton/src/skeleton.md
+++ b/packages/skeleton/src/components/skeleton.md
@@ -1,10 +1,5 @@
---
title: ProSkeleton - 骨架屏
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# ProSkeleton - 骨架屏
@@ -23,19 +18,13 @@ return
-
+
-
+
-### 结果页
-
-
-
-### 详情页
-
-
+
## API
diff --git a/packages/skeleton/src/index.tsx b/packages/skeleton/src/index.tsx
index 9d1713b13dfe..053cf82b57b6 100644
--- a/packages/skeleton/src/index.tsx
+++ b/packages/skeleton/src/index.tsx
@@ -1,19 +1,19 @@
import 'antd/es/skeleton/style';
import React from 'react';
-import type { DescriptionsPageSkeletonProps } from './component/Descriptions';
+import type { DescriptionsPageSkeletonProps } from './components/Descriptions';
import DescriptionsPageSkeleton, {
DescriptionsSkeleton,
TableItemSkeleton,
TableSkeleton,
-} from './component/Descriptions';
-import type { ListPageSkeletonProps } from './component/List';
+} from './components/Descriptions';
+import type { ListPageSkeletonProps } from './components/List';
import ListPageSkeleton, {
ListSkeleton,
ListSkeletonItem,
ListToolbarSkeleton,
PageHeaderSkeleton,
-} from './component/List';
-import ResultPageSkeleton from './component/Result';
+} from './components/List';
+import ResultPageSkeleton from './components/Result';
const ProSkeleton: React.FC<
ListPageSkeletonProps &
diff --git a/packages/table/.fatherrc.ts b/packages/table/.fatherrc.ts
new file mode 100644
index 000000000000..3305dd5a74a7
--- /dev/null
+++ b/packages/table/.fatherrc.ts
@@ -0,0 +1,5 @@
+import { defineConfig } from 'father';
+
+export default defineConfig({
+ extends: '../../.fatherrc.base.ts',
+});
diff --git a/packages/table/package.json b/packages/table/package.json
index 8e57c202864e..d158b828f2b1 100644
--- a/packages/table/package.json
+++ b/packages/table/package.json
@@ -30,6 +30,9 @@
"> 1%",
"ie >= 11"
],
+ "scripts": {
+ "build": "father build"
+ },
"dependencies": {
"@ant-design/icons": "^4.1.0",
"@ant-design/pro-card": "2.1.10",
diff --git a/packages/table/src/Table.tsx b/packages/table/src/Table.tsx
index 8dd894a4cb69..2dcfef3b4bab 100644
--- a/packages/table/src/Table.tsx
+++ b/packages/table/src/Table.tsx
@@ -393,7 +393,7 @@ const ProTable =
+
### Drag and drop to sort and edit the table
-
+
## API
diff --git a/packages/table/src/components/DragSortTable/index.md b/packages/table/src/components/DragSortTable/index.md
index b6d413df79d3..1a0433511ab8 100644
--- a/packages/table/src/components/DragSortTable/index.md
+++ b/packages/table/src/components/DragSortTable/index.md
@@ -1,10 +1,5 @@
---
title: DragSortTable - 拖动排序表格
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# DragSortTable - 拖动排序表格
diff --git a/packages/table/src/components/DragSortTable/style.ts b/packages/table/src/components/DragSortTable/style.ts
index e3e146eb9418..c17260288fad 100644
--- a/packages/table/src/components/DragSortTable/style.ts
+++ b/packages/table/src/components/DragSortTable/style.ts
@@ -1,4 +1,4 @@
-import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-utils';
+import type { GenerateStyle, ProAliasToken } from '@ant-design/pro-provider';
import { useStyle as useAntdStyle } from '@ant-design/pro-provider';
export interface ProListToken extends ProAliasToken {
diff --git a/packages/table/src/components/EditableTable/index.en-US.md b/packages/table/src/components/EditableTable/index.en-US.md
index 7995876ef1d4..66aaea2e268d 100644
--- a/packages/table/src/components/EditableTable/index.en-US.md
+++ b/packages/table/src/components/EditableTable/index.en-US.md
@@ -1,10 +1,8 @@
---
title: EditableProTable
-group:
- path: /
+
nav:
title: Components
- path: /components
---
# EditableProTable - Editable Tables
@@ -15,19 +13,19 @@ EditableProTable is essentially the same as ProTable, with a few presets added t
### Editable forms
-
+
### Link with content outside the edit form
-
+
### Custom Editable Tables
-
+
### Live Saved Editable Forms
-
+
## API
@@ -37,7 +35,7 @@ EditableProTable is essentially the same as ProTable, with a few presets added t
| `onChange` | The dataSource is triggered when the table is modified, both deletion and modification. | `(value:T[])=>void` | `undefined` |
| `recordCreatorProps` | Configuration related to creating a new row of data | [RecordCreatorProps](#recordcreator) & [ButtonProps](
+
-
+
### Downgrade to a normal table
-
+
### Lightweight filter replacement query form
-
+
### Forms without ToolBar
-
+
### Nested tables
-
+
### Left and right structure
-
+
### Batch manipulation of tables
-
+
### Manipulating query forms with formRef
-
+
### RTL (النسخة العربية)
RTL means right-to-left.
-
+
### Controlled table settings columns
You can hide some columns by default, but in the action column you can select
-
+
### Tables polling network data
-
+
### Search form customization
@@ -111,27 +109,27 @@ The definition of `renderFormItem`, the exact value of which can be seen by open
) => JSX.Element | false | null;
```
-
+
### Form action customization
-
+
### Toolbar Customization
Configure toolbar rendering using the `toolbar` property extension.
-
+
### Required Inquiry Form
Try to use initialValue to solve the problem, required fields are more frustrating
-
+
### Form body customization
-
+
### Internationalization-related configuration
@@ -187,31 +185,31 @@ import { ConfigProvider } from '@ant-design/pro-provide';
;
```
-
+
### Table using self-contained keyWords search
-
+
### Value type examples
#### valueType - Date class
-
+
#### valueType - numeric class
-
+
#### valueType - Style Classes
-
+
#### valueType - Selection Classes
-
+
-
+
## API
@@ -287,7 +285,7 @@ ProTable puts a layer of wrapping on top of antd's Table, supports some presets,
| toolbar | Transparent transmission of `ListToolBar` configuration items | [ListToolBarProps](#listtoolbarprops) | - |
| tableExtraRender | The main function of the custom table | `(props: ProTableProps
+
-
+
-
+
-
+
-
+
#### ListToolBarProps
diff --git a/packages/table/src/table.md b/packages/table/src/components/table.md
similarity index 81%
rename from packages/table/src/table.md
rename to packages/table/src/components/table.md
index d7d76c9fb004..629396317a1c 100644
--- a/packages/table/src/table.md
+++ b/packages/table/src/components/table.md
@@ -2,11 +2,6 @@
title: ProTable - 高级表格
order: 0
legacy: /table
-group:
- path: /
-nav:
- title: 组件
- path: /components
---
# ProTable - 高级表格
@@ -28,73 +23,51 @@ ProTable 的诞生是为了解决项目中需要写很多 table 的样板代码
### 查询表格
-
+
-### 黑色主紧凑主题
+
-
+
-
+
-### 查询(无按钮)表格
+
-
+
-
+
-### 无查询表单
-
-
-
-### 轻量筛选替换查询表单
-
-
-
-### 无 ToolBar 的表格
-
-
+
### 必填的查询表单
尽量使用 initialValue 来解决问题,必填项挫败感比较强
-
-
-### 嵌套表格
-
-
-
-### 左右结构
+
-
+
-### 表格批量操作
+
-
+
-### 通过 formRef 来操作查询表单
-
-
+
### RTL (النسخة العربية)
RTL means right-to-left.
-
+
### 受控的表格设置栏
可以默认隐藏某些栏,但是在操作栏中可以选择
-
-
-### 表格轮询
+
-
+
-### dateFormatter - 日期格式化
-
-
+
### 搜索表单自定义
@@ -140,7 +113,7 @@ renderFormItem: (_, { type, defaultRender, formItemProps, fieldProps, ...rest },
) => JSX.Element | false | null;
```
-
+
#### FAQ
@@ -158,25 +131,21 @@ renderFormItem: (_, { type, defaultRender, formItemProps, fieldProps, ...rest },
因为 ProTable 子组件会转为受控模式。因而 defaultValue 不会生效。你需要在 Form 上通过 initialValues 设置默认值。
-### 表单操作自定义
-
-
+
### Toolbar 自定义
使用 `toolbar`属性扩展配置工具栏渲染。
-
+
-### 表格主体自定义
-
-
+
### 卡片表格
有些业务有自己的定制逻辑,可以不完全遵循 ProTable 的设计规则,但可以利用 ProTable 的 API 实现。如通过 `cardProps` 配置卡片属性,通过 `headTitle` 配置行动点在左侧。
-
+
### 国际化相关的配置
@@ -233,39 +202,39 @@ import { ConfigProvider } from '@ant-design/pro-provide';
;
```
-
-
-### 使用自带 keyWords 搜索的 table
+
-
+
### 值类型示例
#### valueType - 日期类
-
+
#### valueType - 数字类
-
+
#### valueType - 样式类
-
+
#### valueType - 选择类
-
+
+
+#### 自定义 valueType
-
+
### 自定义错误边界
-
+
-
+
-
+
## API
@@ -343,7 +312,7 @@ ProTable 在 antd 的 Table 上进行了一层封装,支持了一些预设,
| toolbar | 透传 `ListToolBar` 配置项 | [ListToolBarProps](#listtoolbarprops) | - |
| tableExtraRender | 自定义表格的主体函数 | `(props: ProTableProps
+
-
+
-
+
-
+
-
+
#### ListToolBarProps
@@ -590,4 +559,4 @@ SearchProps 为 antd 的 [Input.Search](https://ant.design/components/input-cn/#
| name | 内容 | `ReactNode` | - |
| (...Menu.Item) | antd 的 [Menu.Item](https://ant.design/components/menu-cn/#Menu.Item) | Menu.Item | - |
-
+
diff --git a/packages/table/src/demos/split.less b/packages/table/src/demos/split.less
deleted file mode 100644
index 00228ee5d3c8..000000000000
--- a/packages/table/src/demos/split.less
+++ /dev/null
@@ -1,3 +0,0 @@
-.split-row-select-active {
- background-color: #e6f7ff;
-}
diff --git a/packages/table/src/demos/split.tsx b/packages/table/src/demos/split.tsx
index 1d2ab79b3152..bcbe09b02e58 100644
--- a/packages/table/src/demos/split.tsx
+++ b/packages/table/src/demos/split.tsx
@@ -3,8 +3,6 @@ import { ProCard, ProTable } from '@ant-design/pro-components';
import type { BadgeProps } from 'antd';
import { Badge, Button } from 'antd';
import React, { useEffect, useState } from 'react';
-// @ts-ignore
-import styles from './split.less';
type TableListItem = {
createdAtRange?: number[];
@@ -104,7 +102,7 @@ type IPListProps = {
};
const IPList: React.FC