Skip to content

Commit

Permalink
refactor(element): refactor FormDialog/FormDrawer & refactor componen…
Browse files Browse the repository at this point in the history
…t export type (#1892)

* fix(element): fix element demand import

* refactor(element): refactor FormDialog/FormDrawer

* refactor(element): refactor componet export type
  • Loading branch information
muuyao authored Jul 28, 2021
1 parent c136e34 commit cc3cb36
Show file tree
Hide file tree
Showing 122 changed files with 1,494 additions and 1,621 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ import {
Submit,
Input,
ArrayCards,
ArrayCardsRemove,
ArrayCardsMoveDown,
ArrayCardsMoveUp,
ArrayCardsAddition,
ArrayCardsIndex,
} from '@formily/element'
import { Button } from 'element-ui'
Expand All @@ -27,11 +22,6 @@ const SchemaField = createSchemaField({
FormItem,
Input,
ArrayCards,
ArrayCardsRemove,
ArrayCardsMoveDown,
ArrayCardsMoveUp,
ArrayCardsAddition,
ArrayCardsIndex,
},
})
Expand Down Expand Up @@ -59,7 +49,7 @@ export default {
properties: {
index: {
type: 'void',
'x-component': 'ArrayCardsIndex',
'x-component': 'ArrayCards.Index',
},
aa: {
type: 'string',
Expand Down Expand Up @@ -96,23 +86,23 @@ export default {
},
remove: {
type: 'void',
'x-component': 'ArrayCardsRemove',
'x-component': 'ArrayCards.Remove',
},
moveUp: {
type: 'void',
'x-component': 'ArrayCardsMoveUp',
'x-component': 'ArrayCards.MoveUp',
},
moveDown: {
type: 'void',
'x-component': 'ArrayCardsMoveDown',
'x-component': 'ArrayCards.MoveDown',
},
},
},
properties: {
addition: {
type: 'void',
title: '添加条目',
'x-component': 'ArrayCardsAddition',
'x-component': 'ArrayCards.Addition',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}"
>
<SchemaObjectField>
<SchemaVoidField x-component="ArrayCardsIndex" />
<SchemaVoidField x-component="ArrayCards.Index" />
<SchemaStringField
name="aa"
x-decorator="FormItem"
Expand Down Expand Up @@ -42,11 +42,11 @@
required
x-component="Input"
/>
<SchemaVoidField x-component="ArrayCardsRemove" />
<SchemaVoidField x-component="ArrayCardsMoveUp" />
<SchemaVoidField x-component="ArrayCardsMoveDown" />
<SchemaVoidField x-component="ArrayCards.Remove" />
<SchemaVoidField x-component="ArrayCards.MoveUp" />
<SchemaVoidField x-component="ArrayCards.MoveDown" />
</SchemaObjectField>
<SchemaVoidField x-component="ArrayCardsAddition" title="添加条目" />
<SchemaVoidField x-component="ArrayCards.Addition" title="添加条目" />
</SchemaArrayField>
</SchemaField>
<Submit @submit="log">提交</Submit>
Expand All @@ -62,11 +62,6 @@ import {
Submit,
Input,
ArrayCards,
ArrayCardsRemove,
ArrayCardsMoveDown,
ArrayCardsMoveUp,
ArrayCardsAddition,
ArrayCardsIndex,
} from '@formily/element'
import { Button } from 'element-ui'
Expand All @@ -75,11 +70,6 @@ const SchemaField = createSchemaField({
FormItem,
Input,
ArrayCards,
ArrayCardsRemove,
ArrayCardsMoveDown,
ArrayCardsMoveUp,
ArrayCardsAddition,
ArrayCardsIndex,
},
})
Expand Down
30 changes: 10 additions & 20 deletions packages/element/docs/demos/guide/array-cards/json-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ import {
Submit,
Input,
ArrayCards,
ArrayCardsRemove,
ArrayCardsMoveDown,
ArrayCardsMoveUp,
ArrayCardsAddition,
ArrayCardsIndex,
} from '@formily/element'
import { Button } from 'element-ui'
Expand All @@ -27,11 +22,6 @@ const SchemaField = createSchemaField({
FormItem,
Input,
ArrayCards,
ArrayCardsRemove,
ArrayCardsMoveDown,
ArrayCardsMoveUp,
ArrayCardsAddition,
ArrayCardsIndex,
},
})
Expand Down Expand Up @@ -62,7 +52,7 @@ export default {
properties: {
index: {
type: 'void',
'x-component': 'ArrayCardsIndex',
'x-component': 'ArrayCards.Index',
},
input: {
type: 'string',
Expand All @@ -73,23 +63,23 @@ export default {
},
remove: {
type: 'void',
'x-component': 'ArrayCardsRemove',
'x-component': 'ArrayCards.Remove',
},
moveUp: {
type: 'void',
'x-component': 'ArrayCardsMoveUp',
'x-component': 'ArrayCards.MoveUp',
},
moveDown: {
type: 'void',
'x-component': 'ArrayCardsMoveDown',
'x-component': 'ArrayCards.MoveDown',
},
},
},
properties: {
addition: {
type: 'void',
title: '添加条目',
'x-component': 'ArrayCardsAddition',
'x-component': 'ArrayCards.Addition',
},
},
},
Expand All @@ -106,7 +96,7 @@ export default {
properties: {
index: {
type: 'void',
'x-component': 'ArrayCardsIndex',
'x-component': 'ArrayCards.Index',
},
input: {
type: 'string',
Expand All @@ -117,23 +107,23 @@ export default {
},
remove: {
type: 'void',
'x-component': 'ArrayCardsRemove',
'x-component': 'ArrayCards.Remove',
},
moveUp: {
type: 'void',
'x-component': 'ArrayCardsMoveUp',
'x-component': 'ArrayCards.MoveUp',
},
moveDown: {
type: 'void',
'x-component': 'ArrayCardsMoveDown',
'x-component': 'ArrayCards.MoveDown',
},
},
},
properties: {
addition: {
type: 'void',
title: '添加条目',
'x-component': 'ArrayCardsAddition',
'x-component': 'ArrayCards.Addition',
},
},
},
Expand Down
30 changes: 10 additions & 20 deletions packages/element/docs/demos/guide/array-cards/markup-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
}"
>
<SchemaVoidField>
<SchemaVoidField x-component="ArrayCardsIndex" />
<SchemaVoidField x-component="ArrayCards.Index" />
<SchemaStringField
name="input"
x-decorator="FormItem"
title="Input"
required
x-component="Input"
/>
<SchemaVoidField x-component="ArrayCardsRemove" />
<SchemaVoidField x-component="ArrayCardsMoveUp" />
<SchemaVoidField x-component="ArrayCardsMoveDown" />
<SchemaVoidField x-component="ArrayCards.Remove" />
<SchemaVoidField x-component="ArrayCards.MoveUp" />
<SchemaVoidField x-component="ArrayCards.MoveDown" />
</SchemaVoidField>
<SchemaVoidField x-component="ArrayCardsAddition" title="添加条目" />
<SchemaVoidField x-component="ArrayCards.Addition" title="添加条目" />
</SchemaArrayField>
<SchemaArrayField
name="array"
Expand All @@ -35,19 +35,19 @@
}"
>
<SchemaObjectField>
<SchemaVoidField x-component="ArrayCardsIndex" />
<SchemaVoidField x-component="ArrayCards.Index" />
<SchemaStringField
name="input"
x-decorator="FormItem"
title="Input"
required
x-component="Input"
/>
<SchemaVoidField x-component="ArrayCardsRemove" />
<SchemaVoidField x-component="ArrayCardsMoveUp" />
<SchemaVoidField x-component="ArrayCardsMoveDown" />
<SchemaVoidField x-component="ArrayCards.Remove" />
<SchemaVoidField x-component="ArrayCards.MoveUp" />
<SchemaVoidField x-component="ArrayCards.MoveDown" />
</SchemaObjectField>
<SchemaVoidField x-component="ArrayCardsAddition" title="添加条目" />
<SchemaVoidField x-component="ArrayCards.Addition" title="添加条目" />
</SchemaArrayField>
</SchemaField>
<Submit @submit="log">提交</Submit>
Expand All @@ -63,11 +63,6 @@ import {
Submit,
Input,
ArrayCards,
ArrayCardsRemove,
ArrayCardsMoveDown,
ArrayCardsMoveUp,
ArrayCardsAddition,
ArrayCardsIndex,
} from '@formily/element'
import { Button } from 'element-ui'
Expand All @@ -76,11 +71,6 @@ const SchemaField = createSchemaField({
FormItem,
Input,
ArrayCards,
ArrayCardsRemove,
ArrayCardsMoveDown,
ArrayCardsMoveUp,
ArrayCardsAddition,
ArrayCardsIndex,
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ import {
Submit,
Input,
ArrayCollapse,
ArrayCollapseItem,
ArrayCollapseRemove,
ArrayCollapseMoveDown,
ArrayCollapseMoveUp,
ArrayCollapseAddition,
ArrayCollapseIndex,
} from '@formily/element'
import { Button } from 'element-ui'
Expand All @@ -28,12 +22,6 @@ const SchemaField = createSchemaField({
FormItem,
Input,
ArrayCollapse,
ArrayCollapseItem,
ArrayCollapseRemove,
ArrayCollapseMoveDown,
ArrayCollapseMoveUp,
ArrayCollapseAddition,
ArrayCollapseIndex,
},
})
Expand All @@ -58,14 +46,14 @@ export default {
title: '对象数组',
items: {
type: 'object',
'x-component': 'ArrayCollapseItem',
'x-component': 'ArrayCollapse.Item',
'x-component-props': {
header: '对象数组',
},
properties: {
index: {
type: 'void',
'x-component': 'ArrayCollapseIndex',
'x-component': 'ArrayCollapse.Index',
},
aa: {
type: 'string',
Expand Down Expand Up @@ -102,23 +90,23 @@ export default {
},
remove: {
type: 'void',
'x-component': 'ArrayCollapseRemove',
'x-component': 'ArrayCollapse.Remove',
},
moveUp: {
type: 'void',
'x-component': 'ArrayCollapseMoveUp',
'x-component': 'ArrayCollapse.MoveUp',
},
moveDown: {
type: 'void',
'x-component': 'ArrayCollapseMoveDown',
'x-component': 'ArrayCollapse.MoveDown',
},
},
},
properties: {
addition: {
type: 'void',
title: '添加条目',
'x-component': 'ArrayCollapseAddition',
'x-component': 'ArrayCollapse.Addition',
},
},
},
Expand Down
Loading

0 comments on commit cc3cb36

Please sign in to comment.