diff --git a/.eslintrc b/.eslintrc
index 72b7088..ba0b49f 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -5,7 +5,7 @@
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
- "prettier/@typescript-eslint"
+ "prettier"
],
"globals": {
"sleep": true,
diff --git a/.markdownlint.json b/.markdownlint.json
new file mode 100644
index 0000000..958784c
--- /dev/null
+++ b/.markdownlint.json
@@ -0,0 +1,5 @@
+{
+ "default": true,
+ "MD033": false,
+ "MD013": false
+}
diff --git a/.umirc.js b/.umirc.js
deleted file mode 100644
index 29241dd..0000000
--- a/.umirc.js
+++ /dev/null
@@ -1,82 +0,0 @@
-import { resolve } from 'path'
-export default {
- mode: 'site',
- logo: '//img.alicdn.com/imgextra/i2/O1CN01Kq3OHU1fph6LGqjIz_!!6000000004056-55-tps-1141-150.svg',
- title: 'Ant Design',
- hash: true,
- favicon:
- '//img.alicdn.com/imgextra/i3/O1CN01XtT3Tv1Wd1b5hNVKy_!!6000000002810-55-tps-360-360.svg',
- outputPath: './doc-site',
- locales: [
- ['en-US', 'English'],
- ['zh-CN', '中文'],
- ],
- navs: {
- 'zh-CN': [
- {
- title: 'Ant Design',
- path: '/zh-CN/components',
- },
- {
- title: '主站',
- path: 'https://formilyjs.org',
- },
- {
- title: 'GITHUB',
- path: 'https://github.com/alibaba/formily',
- },
- ],
- 'en-US': [
- {
- title: 'Ant Design',
- path: '/components',
- },
- {
- title: 'Home Site',
- path: 'https://formilyjs.org',
- },
- {
- title: 'GITHUB',
- path: 'https://github.com/alibaba/formily',
- },
- ],
- },
- links: [
- {
- rel: 'stylesheet',
- href: 'https://unpkg.com/antd/dist/antd.css',
- },
- ],
- styles: [
- `.__dumi-default-navbar-logo{
- background-size: 140px!important;
- background-position: center left!important;
- background-repeat: no-repeat!important;
- padding-left: 150px!important;/*可根据title的宽度调整*/
- font-size: 22px!important;
- color: #000!important;
- font-weight: lighter!important;
- }
- .__dumi-default-navbar{
- padding: 0 28px !important;
- }
- .__dumi-default-layout-hero{
- background-image: url(//img.alicdn.com/imgextra/i4/O1CN01ZcvS4e26XMsdsCkf9_!!6000000007671-2-tps-6001-4001.png);
- background-size: cover;
- background-repeat: no-repeat;
- padding: 120px 0 !important;
- }
- .__dumi-default-layout-hero h1{
- color:#45124e !important;
- font-size:80px !important;
- padding-bottom: 30px !important;
- }
- .__dumi-default-dark-switch {
- display:none
- }
- nav a{
- text-decoration: none !important;
- }
- `,
- ],
-}
diff --git a/.umirc.ts b/.umirc.ts
new file mode 100644
index 0000000..5d80963
--- /dev/null
+++ b/.umirc.ts
@@ -0,0 +1,164 @@
+export default {
+ mode: 'site',
+ logo: '//img.alicdn.com/imgextra/i2/O1CN01Kq3OHU1fph6LGqjIz_!!6000000004056-55-tps-1141-150.svg',
+ title: 'Ant Design V5',
+ hash: true,
+ favicon:
+ '//img.alicdn.com/imgextra/i3/O1CN01XtT3Tv1Wd1b5hNVKy_!!6000000002810-55-tps-360-360.svg',
+ outputPath: './doc-site',
+ locales: [
+ ['en-US', 'English'],
+ ['zh-CN', '中文'],
+ ],
+ navs: {
+ 'zh-CN': [
+ {
+ title: 'Ant Design V5',
+ path: '/zh-CN/components',
+ },
+ {
+ title: '主站',
+ path: 'https://v2.formilyjs.org/',
+ },
+ {
+ title: 'GITHUB',
+ path: 'https://github.com/formilyjs/antd',
+ },
+ ],
+ 'en-US': [
+ {
+ title: 'Ant Design V5',
+ path: '/components',
+ },
+ {
+ title: 'Home Site',
+ path: 'https://formilyjs.org',
+ },
+ {
+ title: 'GITHUB',
+ path: 'https://github.com/alibaba/formily',
+ },
+ ],
+ },
+
+ headScripts: [
+ `
+ function loadAd(){
+ var header = document.querySelector('.__dumi-default-layout-content .markdown h1')
+ if(header && !header.querySelector('#_carbonads_js')){
+ var script = document.createElement('script')
+ script.src = '//cdn.carbonads.com/carbon.js?serve=CEAICK3M&placement=formilyjsorg'
+ script.id = '_carbonads_js'
+ script.classList.add('head-ad')
+ header.appendChild(script)
+ }
+ }
+ var request = null
+ var observer = new MutationObserver(function(){
+ cancelIdleCallback(request)
+ request = requestIdleCallback(loadAd)
+ })
+ document.addEventListener('DOMContentLoaded',function(){
+ loadAd()
+ observer.observe(
+ document.body,
+ {
+ childList:true,
+ subtree:true
+ }
+ )
+ })
+ `,
+ ],
+ styles: [
+ `.__dumi-default-navbar-logo{
+ height: 60px !important;
+ width: 150px !important;
+ padding-left:0 !important;
+ color: transparent !important;
+ }
+ .__dumi-default-navbar{
+ padding: 0 28px !important;
+ }
+ .__dumi-default-layout-hero{
+ background-image: url(//img.alicdn.com/imgextra/i4/O1CN01ZcvS4e26XMsdsCkf9_!!6000000007671-2-tps-6001-4001.png);
+ background-size: cover;
+ background-repeat: no-repeat;
+ padding: 120px 0 !important;
+ }
+ .__dumi-default-layout-hero h1{
+ color:#45124e !important;
+ font-size:80px !important;
+ padding-bottom: 30px !important;
+ }
+ .__dumi-default-dark-switch {
+ display:none
+ }
+ nav a{
+ text-decoration: none !important;
+ }
+ #carbonads * {
+ margin: initial;
+ padding: initial;
+ }
+ #carbonads {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
+ Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial,
+ sans-serif;
+ }
+ #carbonads {
+ display: flex;
+ max-width: 330px;
+ background-color: hsl(0, 0%, 98%);
+ box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1);
+ z-index: 100;
+ float:right;
+ }
+ #carbonads a {
+ color: inherit;
+ text-decoration: none;
+ }
+ #carbonads a:hover {
+ color: inherit;
+ }
+ #carbonads span {
+ position: relative;
+ display: block;
+ overflow: hidden;
+ }
+ #carbonads .carbon-wrap {
+ display: flex;
+ }
+ #carbonads .carbon-img {
+ display: block;
+ margin: 0;
+ line-height: 1;
+ }
+ #carbonads .carbon-img img {
+ display: block;
+ }
+ #carbonads .carbon-text {
+ font-size: 13px;
+ padding: 10px;
+ margin-bottom: 16px;
+ line-height: 1.5;
+ text-align: left;
+ }
+ #carbonads .carbon-poweredby {
+ display: block;
+ padding: 6px 8px;
+ background: #f1f1f2;
+ text-align: center;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ font-weight: 600;
+ font-size: 8px;
+ line-height: 1;
+ border-top-left-radius: 3px;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ }
+ `,
+ ],
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..ad92582
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "editor.formatOnSave": true
+}
diff --git a/README.md b/README.md
index 4cc5dc7..d7ba574 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+# formily antd repository
+
English | [简体中文](./README.zh-CN.md)
@@ -35,7 +37,7 @@ The Awesome Components Library with Formily & Ant Design.
## WebSite
-https://antd.formilyjs.org
+
## Community
diff --git a/docs/components/ArrayCards.md b/docs/components/ArrayCards.md
index 9426855..f9da793 100644
--- a/docs/components/ArrayCards.md
+++ b/docs/components/ArrayCards.md
@@ -51,6 +51,7 @@ export default () => {
x-component="Input"
/>
+
@@ -436,9 +437,9 @@ export default () => {
## API
-### ArrayCards
+### ArrayCards API
-Reference https://ant.design/components/card-cn/
+Reference
### ArrayCards.Addition
@@ -452,7 +453,22 @@ Extended attributes
| method | `'push' \|'unshift'` | add method | `'push'` |
| defaultValue | `any` | Default value | |
-Other references https://ant.design/components/button-cn/
+Other references
+
+Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
+
+### ArrayCards.Copy
+
+> Copy button
+
+Extended attributes
+
+| Property name | Type | Description | Default value |
+| ------------- | -------------------- | ----------- | ------------- |
+| title | ReactText | Copywriting | |
+| method | `'push' \|'unshift'` | Copy method | `'push'` |
+
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -464,7 +480,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -476,7 +492,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -488,7 +504,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
diff --git a/docs/components/ArrayCards.zh-CN.md b/docs/components/ArrayCards.zh-CN.md
index 25862f3..0be323e 100644
--- a/docs/components/ArrayCards.zh-CN.md
+++ b/docs/components/ArrayCards.zh-CN.md
@@ -51,6 +51,7 @@ export default () => {
x-component="Input"
/>
+
@@ -436,9 +437,9 @@ export default () => {
## API
-### ArrayCards
+### ArrayCards API
-参考 https://ant.design/components/card-cn/
+参考
### ArrayCards.Addition
@@ -452,7 +453,22 @@ export default () => {
| method | `'push' \| 'unshift'` | 添加方式 | `'push'` |
| defaultValue | `any` | 默认值 | |
-其余参考 https://ant.design/components/button-cn/
+其余参考
+
+注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
+
+### ArrayCards.Copy
+
+> 复制按钮
+
+扩展属性
+
+| 属性名 | 类型 | 描述 | 默认值 |
+| ------ | --------------------- | -------- | -------- |
+| title | ReactText | 文案 | |
+| method | `'push' \| 'unshift'` | 添加方式 | `'push'` |
+
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -464,7 +480,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -476,7 +492,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -488,7 +504,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
diff --git a/docs/components/ArrayCollapse.md b/docs/components/ArrayCollapse.md
index c5ed0e2..713da7b 100644
--- a/docs/components/ArrayCollapse.md
+++ b/docs/components/ArrayCollapse.md
@@ -556,13 +556,13 @@ export default () => {
## API
-### ArrayCollapse
+### ArrayCollapse API
-Reference https://ant.design/components/collapse-cn/
+Reference
### ArrayCollapse.CollapsePanel
-Reference https://ant.design/components/collapse-cn/
+Reference
### ArrayCollapse.Addition
@@ -576,7 +576,7 @@ Extended attributes
| method | `'push' \|'unshift'` | add method | `'push'` |
| defaultValue | `any` | Default value | |
-Other references https://ant.design/components/button-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -588,7 +588,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -600,7 +600,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -612,7 +612,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
diff --git a/docs/components/ArrayCollapse.zh-CN.md b/docs/components/ArrayCollapse.zh-CN.md
index f2e21e8..669922a 100644
--- a/docs/components/ArrayCollapse.zh-CN.md
+++ b/docs/components/ArrayCollapse.zh-CN.md
@@ -556,13 +556,13 @@ export default () => {
## API
-### ArrayCollapse
+### ArrayCollapse API
-参考 https://ant.design/components/collapse-cn/
+参考
### ArrayCollapse.CollapsePanel
-参考 https://ant.design/components/collapse-cn/
+参考
### ArrayCollapse.Addition
@@ -576,7 +576,7 @@ export default () => {
| method | `'push' \| 'unshift'` | 添加方式 | `'push'` |
| defaultValue | `any` | 默认值 | |
-其余参考 https://ant.design/components/button-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -588,7 +588,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -600,7 +600,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -612,7 +612,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
diff --git a/docs/components/ArrayItems.md b/docs/components/ArrayItems.md
index ba20455..49d04ee 100644
--- a/docs/components/ArrayItems.md
+++ b/docs/components/ArrayItems.md
@@ -61,6 +61,10 @@ export default () => {
x-decorator="FormItem"
x-component="ArrayItems.Remove"
/>
+
{
## API
-### ArrayItems
+### ArrayItems API
Inherit HTMLDivElement Props
@@ -716,7 +720,7 @@ Extended attributes
> Drag handle
-Reference https://ant.design/components/icon-cn/
+Reference
### ArrayItems.Addition
@@ -730,11 +734,26 @@ Extended attributes
| method | `'push' \|'unshift'` | add method | `'push'` |
| defaultValue | `any` | Default value | |
-Other references https://ant.design/components/button-cn/
+Other references
+
+Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
+
+### ArrayItems.Copy
+
+> Copy button
+
+Extended attributes
+
+| Property name | Type | Description | Default value |
+| ------------- | -------------------- | ----------- | ------------- |
+| title | ReactText | Copywriting | |
+| method | `'push' \|'unshift'` | Copy method | `'push'` |
+
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
-### ArrayItems.Remove
+### ArrayItems.RemoveØ
> Delete button
@@ -742,7 +761,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -754,7 +773,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -766,7 +785,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
diff --git a/docs/components/ArrayItems.zh-CN.md b/docs/components/ArrayItems.zh-CN.md
index b5cdc68..7057fc4 100644
--- a/docs/components/ArrayItems.zh-CN.md
+++ b/docs/components/ArrayItems.zh-CN.md
@@ -61,6 +61,10 @@ export default () => {
x-decorator="FormItem"
x-component="ArrayItems.Remove"
/>
+
{
x-decorator="FormItem"
x-component="ArrayItems.Remove"
/>
+
{
## API
-### ArrayItems
+### ArrayItems API
继承 HTMLDivElement Props
@@ -713,11 +721,11 @@ export default () => {
> 拖拽手柄
-参考 https://ant.design/components/icon-cn/
+参考
### ArrayItems.Addition
-> 添加按钮
+> 添加按钮 Ø
扩展属性
@@ -727,7 +735,22 @@ export default () => {
| method | `'push' \| 'unshift'` | 添加方式 | `'push'` |
| defaultValue | `any` | 默认值 | |
-其余参考 https://ant.design/components/button-cn/
+其余参考
+
+注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
+
+### ArrayItems.Copy
+
+> 复制按钮
+
+扩展属性
+
+| 属性名 | 类型 | 描述 | 默认值 |
+| ------ | --------------------- | -------- | -------- |
+| title | ReactText | 文案 | |
+| method | `'push' \| 'unshift'` | 添加方式 | `'push'` |
+
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -739,7 +762,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -751,7 +774,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -763,7 +786,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
diff --git a/docs/components/ArrayTable.md b/docs/components/ArrayTable.md
index 3acf4dd..368f736 100644
--- a/docs/components/ArrayTable.md
+++ b/docs/components/ArrayTable.md
@@ -654,23 +654,23 @@ export default () => {
## API
-### ArrayTable
+### ArrayTable API
> Form Components
-Reference https://ant.design/components/table-cn/
+Reference
### ArrayTable.Column
> Table Column
-Reference https://ant.design/components/table-cn/
+Reference
### ArrayTable.SortHandle
> Drag handle
-Reference https://ant.design/components/icon-cn/
+Reference
### ArrayTable.Addition
@@ -684,7 +684,7 @@ Extended attributes
| method | `'push' \|'unshift'` | add method | `'push'` |
| defaultValue | `any` | Default value | |
-Other references https://ant.design/components/button-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -696,7 +696,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -708,7 +708,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
@@ -720,7 +720,7 @@ Note: The title attribute can receive the title mapping in the Field model, that
| ------------- | --------- | ----------- | ------------- |
| title | ReactText | Copywriting | |
-Other references https://ant.design/components/icon-cn/
+Other references
Note: The title attribute can receive the title mapping in the Field model, that is, uploading the title in the Field is also effective
diff --git a/docs/components/ArrayTable.zh-CN.md b/docs/components/ArrayTable.zh-CN.md
index 4b23165..5e5bdac 100644
--- a/docs/components/ArrayTable.zh-CN.md
+++ b/docs/components/ArrayTable.zh-CN.md
@@ -654,23 +654,23 @@ export default () => {
## API
-### ArrayTable
+### ArrayTable API
> 表格组件
-参考 https://ant.design/components/table-cn/
+参考
### ArrayTable.Column
> 表格列
-参考 https://ant.design/components/table-cn/
+参考
### ArrayTable.SortHandle
> 拖拽手柄
-参考 https://ant.design/components/icon-cn/
+参考
### ArrayTable.Addition
@@ -684,7 +684,7 @@ export default () => {
| method | `'push' \| 'unshift'` | 添加方式 | `'push'` |
| defaultValue | `any` | 默认值 | |
-其余参考 https://ant.design/components/button-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -696,7 +696,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -708,7 +708,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
@@ -720,7 +720,7 @@ export default () => {
| ------ | --------- | ---- | ------ |
| title | ReactText | 文案 | |
-其余参考 https://ant.design/components/icon-cn/
+其余参考
注意:title 属性可以接收 Field 模型中的 title 映射,也就是在 Field 上传 title 也是生效的
diff --git a/docs/components/ArrayTabs.md b/docs/components/ArrayTabs.md
index d0d01c6..8228122 100644
--- a/docs/components/ArrayTabs.md
+++ b/docs/components/ArrayTabs.md
@@ -161,6 +161,6 @@ export default () => {
## API
-### ArrayTabs
+### ArrayTabs API
-Reference https://ant.design/components/tabs-cn/
+Reference
diff --git a/docs/components/ArrayTabs.zh-CN.md b/docs/components/ArrayTabs.zh-CN.md
index ed5d9cc..28aa0c6 100644
--- a/docs/components/ArrayTabs.zh-CN.md
+++ b/docs/components/ArrayTabs.zh-CN.md
@@ -161,6 +161,6 @@ export default () => {
## API
-### ArrayTabs
+### ArrayTabs API
-参考 https://ant.design/components/tabs-cn/
+参考
diff --git a/docs/components/Cascader.md b/docs/components/Cascader.md
index b34ecc4..d9f6a84 100644
--- a/docs/components/Cascader.md
+++ b/docs/components/Cascader.md
@@ -4,242 +4,16 @@
## Markup Schema example
-```tsx
-import React from 'react'
-import { Cascader, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm, onFieldReact, FormPathPattern } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-import { action } from '@formily/reactive'
-
-const SchemaField = createSchemaField({
- components: {
- Cascader,
- FormItem,
- },
-})
-
-const useAddress = (pattern: FormPathPattern) => {
- const transform = (data = {}) => {
- return Object.entries(data).reduce((buf, [key, value]) => {
- if (typeof value === 'string')
- return buf.concat({
- label: value,
- value: key,
- })
- const { name, code, cities, districts } = value
- const _cities = transform(cities)
- const _districts = transform(districts)
- return buf.concat({
- label: name,
- value: code,
- children: _cities.length
- ? _cities
- : _districts.length
- ? _districts
- : undefined,
- })
- }, [])
- }
- onFieldReact(pattern, (field) => {
- field.loading = true
- fetch('//unpkg.com/china-location/dist/location.json')
- .then((res) => res.json())
- .then(
- action.bound((data) => {
- field.dataSource = transform(data)
- field.loading = false
- })
- )
- })
-}
-
-const form = createForm({
- effects: () => {
- useAddress('address')
- },
-})
-
-export default () => (
-
-
-
-
-
- Submit
-
-
-)
-```
+
## JSON Schema case
-```tsx
-import React from 'react'
-import { Cascader, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-import { action } from '@formily/reactive'
-
-const SchemaField = createSchemaField({
- components: {
- Cascader,
- FormItem,
- },
-})
-
-const transformAddress = (data = {}) => {
- return Object.entries(data).reduce((buf, [key, value]) => {
- if (typeof value === 'string')
- return buf.concat({
- label: value,
- value: key,
- })
- const { name, code, cities, districts } = value
- const _cities = transformAddress(cities)
- const _districts = transformAddress(districts)
- return buf.concat({
- label: name,
- value: code,
- children: _cities.length
- ? _cities
- : _districts.length
- ? _districts
- : undefined,
- })
- }, [])
-}
-
-const useAsyncDataSource =
- (url: string, transform: (data: any) => any) => (field) => {
- field.loading = true
- fetch(url)
- .then((res) => res.json())
- .then(
- action.bound((data) => {
- field.dataSource = transform(data)
- field.loading = false
- })
- )
- }
-
-const form = createForm()
-
-const schema = {
- type: 'object',
- properties: {
- address: {
- type: 'string',
- title: 'Address Selection',
- 'x-decorator': 'FormItem',
- 'x-component': 'Cascader',
- 'x-component-props': {
- style: {
- width: 240,
- },
- },
- 'x-reactions': [
- '{{useAsyncDataSource("//unpkg.com/china-location/dist/location.json",transformAddress)}}',
- ],
- },
- },
-}
-
-export default () => (
-
-
-
- Submit
-
-
-)
-```
+
## Pure JSX case
-```tsx
-import React from 'react'
-import { Cascader, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm, onFieldReact, FormPathPattern } from '@formily/core'
-import { FormProvider, Field } from '@formily/react'
-import { action } from '@formily/reactive'
-
-const useAddress = (pattern: FormPathPattern) => {
- const transform = (data = {}) => {
- return Object.entries(data).reduce((buf, [key, value]) => {
- if (typeof value === 'string')
- return buf.concat({
- label: value,
- value: key,
- })
- const { name, code, cities, districts } = value
- const _cities = transform(cities)
- const _districts = transform(districts)
- return buf.concat({
- label: name,
- value: code,
- children: _cities.length
- ? _cities
- : _districts.length
- ? _districts
- : undefined,
- })
- }, [])
- }
- onFieldReact(pattern, (field) => {
- field.loading = true
- fetch('//unpkg.com/china-location/dist/location.json')
- .then((res) => res.json())
- .then(
- action.bound((data) => {
- field.dataSource = transform(data)
- field.loading = false
- })
- )
- })
-}
-
-const form = createForm({
- effects: () => {
- useAddress('address')
- },
-})
-
-export default () => (
-
-
-
- Submit
-
-
-)
-```
+
## API
-Reference https://ant.design/components/cascader-cn/
+Reference
diff --git a/docs/components/Cascader.zh-CN.md b/docs/components/Cascader.zh-CN.md
index c0e5892..50f4520 100644
--- a/docs/components/Cascader.zh-CN.md
+++ b/docs/components/Cascader.zh-CN.md
@@ -4,242 +4,16 @@
## Markup Schema 案例
-```tsx
-import React from 'react'
-import { Cascader, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm, onFieldReact, FormPathPattern } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-import { action } from '@formily/reactive'
-
-const SchemaField = createSchemaField({
- components: {
- Cascader,
- FormItem,
- },
-})
-
-const useAddress = (pattern: FormPathPattern) => {
- const transform = (data = {}) => {
- return Object.entries(data).reduce((buf, [key, value]) => {
- if (typeof value === 'string')
- return buf.concat({
- label: value,
- value: key,
- })
- const { name, code, cities, districts } = value
- const _cities = transform(cities)
- const _districts = transform(districts)
- return buf.concat({
- label: name,
- value: code,
- children: _cities.length
- ? _cities
- : _districts.length
- ? _districts
- : undefined,
- })
- }, [])
- }
- onFieldReact(pattern, (field) => {
- field.loading = true
- fetch('//unpkg.com/china-location/dist/location.json')
- .then((res) => res.json())
- .then(
- action.bound((data) => {
- field.dataSource = transform(data)
- field.loading = false
- })
- )
- })
-}
-
-const form = createForm({
- effects: () => {
- useAddress('address')
- },
-})
-
-export default () => (
-
-
-
-
-
- 提交
-
-
-)
-```
+
## JSON Schema 案例
-```tsx
-import React from 'react'
-import { Cascader, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-import { action } from '@formily/reactive'
-
-const SchemaField = createSchemaField({
- components: {
- Cascader,
- FormItem,
- },
-})
-
-const transformAddress = (data = {}) => {
- return Object.entries(data).reduce((buf, [key, value]) => {
- if (typeof value === 'string')
- return buf.concat({
- label: value,
- value: key,
- })
- const { name, code, cities, districts } = value
- const _cities = transformAddress(cities)
- const _districts = transformAddress(districts)
- return buf.concat({
- label: name,
- value: code,
- children: _cities.length
- ? _cities
- : _districts.length
- ? _districts
- : undefined,
- })
- }, [])
-}
-
-const useAsyncDataSource =
- (url: string, transform: (data: any) => any) => (field) => {
- field.loading = true
- fetch(url)
- .then((res) => res.json())
- .then(
- action.bound((data) => {
- field.dataSource = transform(data)
- field.loading = false
- })
- )
- }
-
-const form = createForm()
-
-const schema = {
- type: 'object',
- properties: {
- address: {
- type: 'string',
- title: '地址选择',
- 'x-decorator': 'FormItem',
- 'x-component': 'Cascader',
- 'x-component-props': {
- style: {
- width: 240,
- },
- },
- 'x-reactions': [
- '{{useAsyncDataSource("//unpkg.com/china-location/dist/location.json",transformAddress)}}',
- ],
- },
- },
-}
-
-export default () => (
-
-
-
- 提交
-
-
-)
-```
+
## 纯 JSX 案例
-```tsx
-import React from 'react'
-import { Cascader, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm, onFieldReact, FormPathPattern } from '@formily/core'
-import { FormProvider, Field } from '@formily/react'
-import { action } from '@formily/reactive'
-
-const useAddress = (pattern: FormPathPattern) => {
- const transform = (data = {}) => {
- return Object.entries(data).reduce((buf, [key, value]) => {
- if (typeof value === 'string')
- return buf.concat({
- label: value,
- value: key,
- })
- const { name, code, cities, districts } = value
- const _cities = transform(cities)
- const _districts = transform(districts)
- return buf.concat({
- label: name,
- value: code,
- children: _cities.length
- ? _cities
- : _districts.length
- ? _districts
- : undefined,
- })
- }, [])
- }
- onFieldReact(pattern, (field) => {
- field.loading = true
- fetch('//unpkg.com/china-location/dist/location.json')
- .then((res) => res.json())
- .then(
- action.bound((data) => {
- field.dataSource = transform(data)
- field.loading = false
- })
- )
- })
-}
-
-const form = createForm({
- effects: () => {
- useAddress('address')
- },
-})
-
-export default () => (
-
-
-
- 提交
-
-
-)
-```
+
## API
-参考 https://ant.design/components/cascader-cn/
+参考
diff --git a/docs/components/Checkbox.md b/docs/components/Checkbox.md
index bb01044..52a3698 100644
--- a/docs/components/Checkbox.md
+++ b/docs/components/Checkbox.md
@@ -4,150 +4,16 @@
## Markup Schema example
-```tsx
-import React from 'react'
-import { Checkbox, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- Checkbox,
- FormItem,
- },
-})
-
-const form = createForm()
-
-export default () => (
-
-
-
-
-
-
- Submit
-
-
-)
-```
+
## JSON Schema case
-```tsx
-import React from 'react'
-import { Checkbox, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- Checkbox,
- FormItem,
- },
-})
-
-const form = createForm()
-
-const schema = {
- type: 'object',
- properties: {
- single: {
- type: 'boolean',
- title: 'Are you sure?',
- 'x-decorator': 'FormItem',
- 'x-component': 'Checkbox',
- },
- multiple: {
- type: 'array',
- title: 'Check',
- enum: [
- {
- label: 'Option 1',
- value: 1,
- },
- {
- label: 'Option 2',
- value: 2,
- },
- ],
- 'x-decorator': 'FormItem',
- 'x-component': 'Checkbox.Group',
- },
- },
-}
-
-export default () => (
-
-
-
- Submit
-
-
-)
-```
+
## Pure JSX case
-```tsx
-import React from 'react'
-import { Checkbox, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, Field } from '@formily/react'
-
-const form = createForm()
-
-export default () => (
-
-
-
-
- Submit
-
-
-)
-```
+
## API
-Reference https://ant.design/components/checkbox-cn/
+Reference
diff --git a/docs/components/Checkbox.zh-CN.md b/docs/components/Checkbox.zh-CN.md
index 93fcb1e..d215c3c 100644
--- a/docs/components/Checkbox.zh-CN.md
+++ b/docs/components/Checkbox.zh-CN.md
@@ -4,150 +4,16 @@
## Markup Schema 案例
-```tsx
-import React from 'react'
-import { Checkbox, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- Checkbox,
- FormItem,
- },
-})
-
-const form = createForm()
-
-export default () => (
-
-
-
-
-
-
- 提交
-
-
-)
-```
+
## JSON Schema 案例
-```tsx
-import React from 'react'
-import { Checkbox, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- Checkbox,
- FormItem,
- },
-})
-
-const form = createForm()
-
-const schema = {
- type: 'object',
- properties: {
- single: {
- type: 'boolean',
- title: '是否确认',
- 'x-decorator': 'FormItem',
- 'x-component': 'Checkbox',
- },
- multiple: {
- type: 'array',
- title: '复选',
- enum: [
- {
- label: '选项1',
- value: 1,
- },
- {
- label: '选项2',
- value: 2,
- },
- ],
- 'x-decorator': 'FormItem',
- 'x-component': 'Checkbox.Group',
- },
- },
-}
-
-export default () => (
-
-
-
- 提交
-
-
-)
-```
+
## 纯 JSX 案例
-```tsx
-import React from 'react'
-import { Checkbox, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, Field } from '@formily/react'
-
-const form = createForm()
-
-export default () => (
-
-
-
-
- 提交
-
-
-)
-```
+
## API
-参考 https://ant.design/components/checkbox-cn/
+参考
diff --git a/docs/components/DatePicker.md b/docs/components/DatePicker.md
index aa8aae5..b1de1d7 100644
--- a/docs/components/DatePicker.md
+++ b/docs/components/DatePicker.md
@@ -4,349 +4,16 @@
## Markup Schema example
-```tsx
-import React from 'react'
-import { DatePicker, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- DatePicker,
- FormItem,
- },
-})
-
-const form = createForm()
-
-export default () => (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Submit
-
-
-)
-```
+
## JSON Schema case
-```tsx
-import React from 'react'
-import { DatePicker, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- DatePicker,
- FormItem,
- },
-})
-
-const form = createForm()
-
-const schema = {
- type: 'object',
- properties: {
- date: {
- title: 'Normal date',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- type: 'string',
- },
- week: {
- title: 'Week Selection',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- 'x-component-props': {
- picker: 'week',
- },
- type: 'string',
- },
- month: {
- title: 'Month Selection',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- 'x-component-props': {
- picker: 'month',
- },
- type: 'string',
- },
- quarter: {
- title: 'Fiscal Year Selection',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- 'x-component-props': {
- picker: 'quarter',
- },
- type: 'string',
- },
- year: {
- title: 'Year selection',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- 'x-component-props': {
- picker: 'year',
- },
- type: 'string',
- },
- '[startDate,endDate]': {
- title: 'Date range',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker.RangePicker',
- 'x-component-props': {
- showTime: true,
- },
- type: 'string',
- },
- range_week: {
- title: 'Week range selection',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker.RangePicker',
- 'x-component-props': {
- picker: 'week',
- },
- type: 'string',
- },
- range_month: {
- title: 'Month Range Selection',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker.RangePicker',
- 'x-component-props': {
- picker: 'month',
- },
- type: 'string',
- },
- range_quarter: {
- title: 'Financial year range selection',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker.RangePicker',
- 'x-component-props': {
- picker: 'quarter',
- },
- type: 'string',
- },
- range_year: {
- name: 'range_year',
- title: 'Year range selection',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker.RangePicker',
- 'x-component-props': {
- picker: 'year',
- },
- type: 'string',
- },
- },
-}
-
-export default () => (
-
-
-
- Submit
-
-
-)
-```
+
## Pure JSX case
-```tsx
-import React from 'react'
-import { DatePicker, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, Field } from '@formily/react'
-
-const form = createForm()
-
-export default () => (
-
-
-
-
-
-
-
-
-
-
-
- Submit
-
-
-)
-```
+
## API
-Reference https://ant.design/components/date-picker-cn/
+Reference
diff --git a/docs/components/DatePicker.zh-CN.md b/docs/components/DatePicker.zh-CN.md
index 4bacca6..17b86ac 100644
--- a/docs/components/DatePicker.zh-CN.md
+++ b/docs/components/DatePicker.zh-CN.md
@@ -4,349 +4,16 @@
## Markup Schema 案例
-```tsx
-import React from 'react'
-import { DatePicker, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- DatePicker,
- FormItem,
- },
-})
-
-const form = createForm()
-
-export default () => (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 提交
-
-
-)
-```
+
## JSON Schema 案例
-```tsx
-import React from 'react'
-import { DatePicker, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- DatePicker,
- FormItem,
- },
-})
-
-const form = createForm()
-
-const schema = {
- type: 'object',
- properties: {
- date: {
- title: '普通日期',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- type: 'string',
- },
- week: {
- title: '周选择',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- 'x-component-props': {
- picker: 'week',
- },
- type: 'string',
- },
- month: {
- title: '月选择',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- 'x-component-props': {
- picker: 'month',
- },
- type: 'string',
- },
- quarter: {
- title: '财年选择',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- 'x-component-props': {
- picker: 'quarter',
- },
- type: 'string',
- },
- year: {
- title: '年选择',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- 'x-component-props': {
- picker: 'year',
- },
- type: 'string',
- },
- '[startDate,endDate]': {
- title: '日期范围',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker.RangePicker',
- 'x-component-props': {
- showTime: true,
- },
- type: 'string',
- },
- range_week: {
- title: '周范围选择',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker.RangePicker',
- 'x-component-props': {
- picker: 'week',
- },
- type: 'string',
- },
- range_month: {
- title: '月范围选择',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker.RangePicker',
- 'x-component-props': {
- picker: 'month',
- },
- type: 'string',
- },
- range_quarter: {
- title: '财年范围选择',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker.RangePicker',
- 'x-component-props': {
- picker: 'quarter',
- },
- type: 'string',
- },
- range_year: {
- name: 'range_year',
- title: '年范围选择',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker.RangePicker',
- 'x-component-props': {
- picker: 'year',
- },
- type: 'string',
- },
- },
-}
-
-export default () => (
-
-
-
- 提交
-
-
-)
-```
+
## 纯 JSX 案例
-```tsx
-import React from 'react'
-import { DatePicker, FormItem, FormButtonGroup, Submit } from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, Field } from '@formily/react'
-
-const form = createForm()
-
-export default () => (
-
-
-
-
-
-
-
-
-
-
-
- 提交
-
-
-)
-```
+
## API
-参考 https://ant.design/components/date-picker-cn/
+参考
diff --git a/docs/components/Editable.md b/docs/components/Editable.md
index 3873753..74ae7b2 100644
--- a/docs/components/Editable.md
+++ b/docs/components/Editable.md
@@ -6,282 +6,26 @@
## Markup Schema example
-```tsx
-import React from 'react'
-import {
- Input,
- DatePicker,
- Editable,
- FormItem,
- FormButtonGroup,
- Submit,
-} from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- DatePicker,
- Editable,
- Input,
- FormItem,
- },
-})
-
-const form = createForm()
-
-export default () => (
-
-
-
-
- {
- field.title = field.query('.void.date2').get('value') || field.title
- }}
- >
-
-
-
- {
- field.title = field.value?.date || field.title
- }}
- >
-
-
-
-
-
- Submit
-
-
-)
-```
+
## JSON Schema case
-```tsx
-import React from 'react'
-import {
- Input,
- DatePicker,
- Editable,
- FormItem,
- FormButtonGroup,
- Submit,
-} from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- DatePicker,
- Editable,
- Input,
- FormItem,
- },
-})
-
-const form = createForm()
-
-const schema = {
- type: 'object',
- properties: {
- date: {
- type: 'string',
- title: 'Date',
- 'x-decorator': 'Editable',
- 'x-component': 'DatePicker',
- },
- input: {
- type: 'string',
- title: 'input box',
- 'x-decorator': 'Editable',
- 'x-component': 'Input',
- },
- void: {
- type: 'void',
- title: 'Virtual Node Container',
- 'x-component': 'Editable.Popover',
- 'x-reactions':
- "{{(field) => field.title = field.query('.void.date2').get('value') || field.title}}",
- properties: {
- date2: {
- type: 'string',
- title: 'Date',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- },
- input2: {
- type: 'string',
- title: 'input box',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- },
- },
- },
- iobject: {
- type: 'object',
- title: 'Object node container',
- 'x-component': 'Editable.Popover',
- 'x-reactions':
- '{{(field) => field.title = field.value && field.value.date || field.title}}',
- properties: {
- date: {
- type: 'string',
- title: 'Date',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- },
- input: {
- type: 'string',
- title: 'input box',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- },
- },
- },
- },
-}
-
-export default () => (
-
-
-
- Submit
-
-
-)
-```
+
## Pure JSX case
-```tsx
-import React from 'react'
-import {
- Input,
- DatePicker,
- Editable,
- FormItem,
- FormButtonGroup,
- Submit,
-} from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, Field, VoidField, ObjectField } from '@formily/react'
-
-const form = createForm()
-
-export default () => (
-
-
-
- {
- field.title = field.query('.void.date2').get('value') || field.title
- }}
- component={[Editable.Popover]}
- >
-
-
-
- {
- field.title = field.value?.date || field.title
- }}
- component={[Editable.Popover]}
- >
-
-
-
-
-
- Submit
-
-
-)
-```
+
## API
-### Editable
+### Editable API
> Inline editing
-Refer to the FormItem property in https://ant.design/components/form-cn/
+Refer to the FormItem property in
### Editable.Popover
> Floating layer editing
-Reference https://ant.design/components/popover-cn/
+Reference
diff --git a/docs/components/Editable.zh-CN.md b/docs/components/Editable.zh-CN.md
index 21ed6bf..4cd13b8 100644
--- a/docs/components/Editable.zh-CN.md
+++ b/docs/components/Editable.zh-CN.md
@@ -6,282 +6,26 @@
## Markup Schema 案例
-```tsx
-import React from 'react'
-import {
- Input,
- DatePicker,
- Editable,
- FormItem,
- FormButtonGroup,
- Submit,
-} from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- DatePicker,
- Editable,
- Input,
- FormItem,
- },
-})
-
-const form = createForm()
-
-export default () => (
-
-
-
-
- {
- field.title = field.query('.void.date2').get('value') || field.title
- }}
- >
-
-
-
- {
- field.title = field.value?.date || field.title
- }}
- >
-
-
-
-
-
- 提交
-
-
-)
-```
+
## JSON Schema 案例
-```tsx
-import React from 'react'
-import {
- Input,
- DatePicker,
- Editable,
- FormItem,
- FormButtonGroup,
- Submit,
-} from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, createSchemaField } from '@formily/react'
-
-const SchemaField = createSchemaField({
- components: {
- DatePicker,
- Editable,
- Input,
- FormItem,
- },
-})
-
-const form = createForm()
-
-const schema = {
- type: 'object',
- properties: {
- date: {
- type: 'string',
- title: '日期',
- 'x-decorator': 'Editable',
- 'x-component': 'DatePicker',
- },
- input: {
- type: 'string',
- title: '输入框',
- 'x-decorator': 'Editable',
- 'x-component': 'Input',
- },
- void: {
- type: 'void',
- title: '虚拟节点容器',
- 'x-component': 'Editable.Popover',
- 'x-reactions':
- "{{(field) => field.title = field.query('.void.date2').get('value') || field.title}}",
- properties: {
- date2: {
- type: 'string',
- title: '日期',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- },
- input2: {
- type: 'string',
- title: '输入框',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- },
- },
- },
- iobject: {
- type: 'object',
- title: '对象节点容器',
- 'x-component': 'Editable.Popover',
- 'x-reactions':
- '{{(field) => field.title = field.value && field.value.date || field.title}}',
- properties: {
- date: {
- type: 'string',
- title: '日期',
- 'x-decorator': 'FormItem',
- 'x-component': 'DatePicker',
- },
- input: {
- type: 'string',
- title: '输入框',
- 'x-decorator': 'FormItem',
- 'x-component': 'Input',
- },
- },
- },
- },
-}
-
-export default () => (
-
-
-
- 提交
-
-
-)
-```
+
## 纯 JSX 案例
-```tsx
-import React from 'react'
-import {
- Input,
- DatePicker,
- Editable,
- FormItem,
- FormButtonGroup,
- Submit,
-} from '@formily/antd'
-import { createForm } from '@formily/core'
-import { FormProvider, Field, VoidField, ObjectField } from '@formily/react'
-
-const form = createForm()
-
-export default () => (
-
-
-
- {
- field.title = field.query('.void.date2').get('value') || field.title
- }}
- component={[Editable.Popover]}
- >
-
-
-
- {
- field.title = field.value?.date || field.title
- }}
- component={[Editable.Popover]}
- >
-
-
-
-
-
- 提交
-
-
-)
-```
+
## API
-### Editable
+### Editable API
> 内联编辑
-参考 https://ant.design/components/form-cn/ 中的 FormItem 属性
+参考 中的 FormItem 属性
### Editable.Popover
> 浮层编辑
-参考 https://ant.design/components/popover-cn/
+参考
diff --git a/docs/components/Form.md b/docs/components/Form.md
index 675e4f2..3f4485c 100644
--- a/docs/components/Form.md
+++ b/docs/components/Form.md
@@ -4,79 +4,7 @@
## Use Cases
-```tsx
-import React from 'react'
-import {
- Input,
- Select,
- Form,
- FormItem,
- FormGrid,
- FormButtonGroup,
- Submit,
-} from '@formily/antd'
-import { createForm } from '@formily/core'
-import { Field } from '@formily/react'
-
-const form = createForm()
-
-export default () => (
-
-)
-```
+
Note: To realize the carriage return submission, we cannot pass the onSubmit event to it when using the Submit component, otherwise the carriage return submission will become invalid. The purpose of this is to prevent users from writing onSubmit event listeners in multiple places at the same time, and processing logic If they are inconsistent, it is difficult to locate the problem when submitting.
diff --git a/docs/components/Form.zh-CN.md b/docs/components/Form.zh-CN.md
index d3d3d2a..d570756 100644
--- a/docs/components/Form.zh-CN.md
+++ b/docs/components/Form.zh-CN.md
@@ -4,79 +4,7 @@
## 使用案例
-```tsx
-import React from 'react'
-import {
- Input,
- Select,
- Form,
- FormItem,
- FormGrid,
- FormButtonGroup,
- Submit,
-} from '@formily/antd'
-import { createForm } from '@formily/core'
-import { Field } from '@formily/react'
-
-const form = createForm()
-
-export default () => (
-
-)
-```
+
注意:想要实现回车提交,我们在使用Submit组件的时候不能给其传onSubmit事件,否则回车提交会失效,这样做的目的是为了防止用户同时在多处写onSubmit事件监听器,处理逻辑不一致的话,提交时很难定位问题。
diff --git a/docs/components/FormButtonGroup.md b/docs/components/FormButtonGroup.md
index e3fb258..ced3bf9 100644
--- a/docs/components/FormButtonGroup.md
+++ b/docs/components/FormButtonGroup.md
@@ -289,7 +289,7 @@ export default () => {
## API
-### FormButtonGroup
+### FormButtonGroup API
> This component is mainly used to handle the button group gap
diff --git a/docs/components/FormButtonGroup.zh-CN.md b/docs/components/FormButtonGroup.zh-CN.md
index 8773fba..95094d9 100644
--- a/docs/components/FormButtonGroup.zh-CN.md
+++ b/docs/components/FormButtonGroup.zh-CN.md
@@ -289,7 +289,7 @@ export default () => {
## API
-### FormButtonGroup
+### FormButtonGroup API
> 该组件主要用来处理按钮组间隙
diff --git a/docs/components/FormCollapse.md b/docs/components/FormCollapse.md
index 127bba0..febcdc0 100644
--- a/docs/components/FormCollapse.md
+++ b/docs/components/FormCollapse.md
@@ -232,17 +232,17 @@ export default () => {
## API
-### FormCollapse
+### FormCollapse API
| Property name | Type | Description | Default value |
| ------------- | ------------- | --------------------------------------------------------------- | ------------- |
| formCollapse | IFormCollapse | Pass in the model created by createFormCollapse/useFormCollapse | |
-Other references https://ant.design/components/collapse-cn/
+Other references
### FormCollapse.CollapsePanel
-Reference https://ant.design/components/collapse-cn/
+Reference
### FormCollapse.createFormCollapse
diff --git a/docs/components/FormCollapse.zh-CN.md b/docs/components/FormCollapse.zh-CN.md
index 2e4b3c9..bd8b18c 100644
--- a/docs/components/FormCollapse.zh-CN.md
+++ b/docs/components/FormCollapse.zh-CN.md
@@ -232,17 +232,17 @@ export default () => {
## API
-### FormCollapse
+### FormCollapse API
| 属性名 | 类型 | 描述 | 默认值 |
| ------------ | ------------- | ---------------------------------------------------------- | ------ |
| formCollapse | IFormCollapse | 传入通过 createFormCollapse/useFormCollapse 创建出来的模型 | |
-其余参考 https://ant.design/components/collapse-cn/
+其余参考
### FormCollapse.CollapsePanel
-参考 https://ant.design/components/collapse-cn/
+参考
### FormCollapse.createFormCollapse
diff --git a/docs/components/FormDialog.md b/docs/components/FormDialog.md
index 9dccb2c..d328ea4 100644
--- a/docs/components/FormDialog.md
+++ b/docs/components/FormDialog.md
@@ -21,7 +21,7 @@ export default () => {
return (