forked from alibaba/x-render
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27c4119
commit d6da931
Showing
82 changed files
with
280 additions
and
108 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,6 @@ | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
|
||
// 通用的配置,可以在每个package里写 fatherrc.js 来覆盖 | ||
export default { | ||
entry: ['src/index.js', 'src/antd.js', 'src/fusion.js'], | ||
esm: 'rollup', | ||
cjs: 'babel', | ||
extraRollupPlugins: [ | ||
commonjs({ | ||
include: 'node_modules/**', | ||
}), | ||
], | ||
extraBabelPlugins: [ | ||
[ | ||
'import', | ||
{ | ||
libraryName: 'antd', | ||
libraryDirectory: 'lib', | ||
style: 'css', | ||
}, | ||
'antd', | ||
], | ||
[ | ||
'import', | ||
{ | ||
libraryName: '@alifd/next', | ||
libraryDirectory: 'lib', | ||
}, | ||
'@alifd/next', | ||
], | ||
[ | ||
'import', | ||
{ | ||
libraryName: '@ant-design/icons', | ||
libraryDirectory: 'lib/icons', | ||
camel2DashComponentName: false, | ||
}, | ||
'@ant-design/icons', | ||
], | ||
], | ||
disableTypeCheck: false, // 如果出了问题,这个可以改成true | ||
cjs: { type: 'babel', lazy: true }, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ package.json | |
.umi | ||
.umi-production | ||
.umi-test | ||
/packages/*/node_modules | ||
/node_modules |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
order: 1 | ||
title: test | ||
nav: | ||
order: 1 | ||
title: 教程 | ||
--- | ||
|
||
```jsx | ||
import React from 'react'; | ||
import FR from '../demo/FR2/index.jsx'; | ||
import json from '../demo/new-feature/test.json'; | ||
|
||
export default () => <FR schema={json} />; | ||
``` | ||
|
||
```jsx | ||
import React from 'react'; | ||
import A from '@formrender/tester'; | ||
|
||
export default () => <A />; | ||
``` | ||
|
||
```jsx | ||
import React, { useState } from 'react'; | ||
import FR from 'form-render/lib/antd'; | ||
import A from '@formrender/tester'; | ||
|
||
export default () => { | ||
const [data, setData] = useState(); | ||
|
||
const submit = () => { | ||
alert(JSON.stringify(data, null, 2)); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<FR | ||
formData={data} | ||
onChange={setData} | ||
widgets={{ test: A }} | ||
schema={{ | ||
type: 'object', | ||
'ui:displayType': 'row', | ||
properties: { | ||
string: { | ||
title: '字符串', | ||
type: 'string', | ||
'ui:widget': 'test', | ||
}, | ||
select: { | ||
title: '单选', | ||
type: 'string', | ||
enum: ['a', 'b', 'c'], | ||
enumNames: ['选项1', '选项2', '选项3'], | ||
}, | ||
}, | ||
}} | ||
/> | ||
<button onClick={submit}>haha</button> | ||
</div> | ||
); | ||
}; | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"packages": ["packages/*"], | ||
"version": "independent", | ||
"npmClient": "yarn", | ||
"useWorkspaces": true | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
|
||
export default { | ||
entry: ['src/index.js', 'src/antd.js', 'src/fusion.js'], | ||
esm: 'rollup', | ||
cjs: 'babel', | ||
extraRollupPlugins: [ | ||
commonjs({ | ||
include: 'node_modules/**', | ||
}), | ||
], | ||
extraBabelPlugins: [ | ||
[ | ||
'import', | ||
{ | ||
libraryName: 'antd', | ||
libraryDirectory: 'lib', | ||
style: 'css', | ||
}, | ||
'antd', | ||
], | ||
[ | ||
'import', | ||
{ | ||
libraryName: '@alifd/next', | ||
libraryDirectory: 'lib', | ||
}, | ||
'@alifd/next', | ||
], | ||
[ | ||
'import', | ||
{ | ||
libraryName: '@ant-design/icons', | ||
libraryDirectory: 'lib/icons', | ||
camel2DashComponentName: false, | ||
}, | ||
'@ant-design/icons', | ||
], | ||
], | ||
}; |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"name": "form-render", | ||
"version": "0.9.2", | ||
"description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成", | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:alibaba/form-render.git" | ||
}, | ||
"keywords": [ | ||
"FormRender", | ||
"Render", | ||
"React", | ||
"Json Schema", | ||
"Ant Design", | ||
"Fusion Design" | ||
], | ||
"contributors": [ | ||
{ | ||
"name": "Tw93", | ||
"email": "tw93@qq.com" | ||
}, | ||
{ | ||
"name": "mankaiviky", | ||
"email": "mankaiviky@163.com" | ||
}, | ||
{ | ||
"name": "FateRiddle", | ||
"email": "fateriddle@gmail.com" | ||
} | ||
], | ||
"scripts": { | ||
"build": "father-build", | ||
"prepare": "npm run build", | ||
"postpublish": "git push --tags", | ||
"beta": "npm publish --tag beta", | ||
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"", | ||
"test": "umi-test", | ||
"test:coverage": "umi-test --coverage" | ||
}, | ||
"main": "lib/index.js", | ||
"module": "dist/index.esm.js", | ||
"gitHooks": { | ||
"pre-commit": "lint-staged" | ||
}, | ||
"lint-staged": { | ||
"*.{js,jsx,less,md,json}": [ | ||
"prettier --write" | ||
], | ||
"*.ts?(x)": [ | ||
"prettier --parser=typescript --write" | ||
] | ||
}, | ||
"dependencies": { | ||
"@ant-design/icons": "^4.0.2", | ||
"color": "^3.1.2", | ||
"lodash.debounce": "^4.0.8", | ||
"moment": "^2.24.0", | ||
"pope": "^2.0.2", | ||
"prop-types": "^15.x", | ||
"rc-color-picker": "^1.2.6", | ||
"react-sortable-hoc": "^1.6.1", | ||
"validator": "^10.7.1" | ||
}, | ||
"peerDependencies": { | ||
"@alifd/next": "^1.x", | ||
"antd": "^4.x", | ||
"react": "^16.8.0 || ^17.0.0", | ||
"react-dom": "^16.8.0 || ^17.0.0" | ||
}, | ||
"devDependencies": { | ||
"deep-equal": "^2.0.3" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.