-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/schema preview #694
Merged
Merged
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ac79b63
antd 4.0
9fdbad1
feature: schema preview & antd 4.0
9759796
webpack build
0390c33
bugfix:修复scss构建
b6fc0d6
bugfix:formily/antd依赖
0b32392
bugfix:merge master
e8db3b1
bugfix:Radio options prop
0ef4835
bugfix:Radio options prop
7343b96
feat(shared): support BigData (#708)
janryWang 2c71363
Update quick-start.md
janryWang eb4b4e3
fix(printer): fix print schema (#710)
janryWang 63121e4
fix(schema-renderer): fix linkages (#713)
janryWang e6be51c
fix(antd/next): fix layout can not pass FormItem attributes (#715)
janryWang 68e395f
feat(core): Support form state modified property (#717)
janryWang 6000f71
fix(core): fix typings (#718)
janryWang d8ad19c
fix(schema-renderer): fix datepicker showTime.defaultValue will throw…
janryWang 130feea
perf(core): fix nested path update performance (#722)
janryWang 8a2ae47
Merge branch 'feature/schema-preview' of github.com:alibaba/uform int…
janryWang 84e91ce
fix(schema-editor): fix ci && improve docs
janryWang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 35 additions & 3 deletions
38
packages/react-schema-editor/src/components/SchemaPreview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,43 @@ | ||
import * as React from 'react' | ||
import { ISchemaPreviewProps } from '../utils/types' | ||
import { SchemaForm } from '@formily/antd' | ||
import { | ||
SchemaForm, | ||
} from '@formily/react-schema-renderer' | ||
Input, | ||
Radio, | ||
Checkbox, | ||
Select, | ||
DatePicker, | ||
NumberPicker, | ||
TimePicker, | ||
Upload, | ||
Switch, | ||
Range, | ||
Transfer, | ||
Rating | ||
} from '@formily/antd-components'; | ||
|
||
const components = { | ||
Input, | ||
Radio: Radio.Group, | ||
Checkbox: Checkbox.Group, | ||
TextArea: Input.TextArea, | ||
NumberPicker, | ||
Select, | ||
Switch, | ||
DatePicker, | ||
DateRangePicker: DatePicker.RangePicker, | ||
YearPicker: DatePicker.YearPicker, | ||
MonthPicker: DatePicker.MonthPicker, | ||
WeekPicker: DatePicker.WeekPicker, | ||
TimePicker, | ||
Upload, | ||
Range, | ||
Rating, | ||
Transfer | ||
} | ||
|
||
export const SchemaPreview: React.FC<ISchemaPreviewProps> = ({ schema }) => { | ||
return <SchemaForm schema={schema}></SchemaForm> | ||
return <SchemaForm schema={schema} labelCol={5} wrapperCol={14} components={components}></SchemaForm> | ||
} | ||
|
||
SchemaPreview.displayName = 'SchemaPreview'; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为什么是 空格 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null或者空格都可以,上次解决antd4.0的样式兼容性问题改的