lu-lowcode-package-form 0.7.1 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +73 -70
- package/dist/index.es.js +9302 -9319
- package/index.html +13 -0
- package/package.json +5 -4
- package/src/{App.js → App.jsx} +6 -4
- package/src/components/field/select/tree-select.jsx +1 -1
- package/src/components/form-container/index.jsx +6 -5
- package/src/components/index.jsx +1 -1
- package/src/main.jsx +10 -0
- package/vite.config.js +1 -0
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite + React</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lu-lowcode-package-form",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@ant-design/icons": "^5.3.7",
|
|
6
6
|
"@testing-library/jest-dom": "^5.17.0",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"main": "dist/index.cjs.js",
|
|
13
13
|
"module": "dist/index.es.js",
|
|
14
14
|
"scripts": {
|
|
15
|
-
"start": "
|
|
15
|
+
"start": "vite",
|
|
16
16
|
"build": "vite build",
|
|
17
17
|
"test": "react-scripts test",
|
|
18
18
|
"eject": "react-scripts eject"
|
|
@@ -44,13 +44,14 @@
|
|
|
44
44
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
45
45
|
"@babel/preset-env": "^7.24.7",
|
|
46
46
|
"@babel/preset-react": "^7.24.7",
|
|
47
|
+
"@hot-loader/react-dom": "^17.0.2",
|
|
47
48
|
"@rollup/plugin-babel": "^6.0.4",
|
|
48
49
|
"@vitejs/plugin-react": "^4.3.1",
|
|
49
50
|
"autoprefixer": "^10.4.19",
|
|
50
51
|
"babel-loader": "^9.1.3",
|
|
51
52
|
"postcss": "^8.4.38",
|
|
52
|
-
"react": "^
|
|
53
|
-
"react-dom": "^
|
|
53
|
+
"react": "^18.2.0",
|
|
54
|
+
"react-dom": "^18.2.0",
|
|
54
55
|
"react-scripts": "5.0.1",
|
|
55
56
|
"tailwindcss": "^3.4.4",
|
|
56
57
|
"vite": "^5.2.13",
|
package/src/{App.js → App.jsx}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContainer, Field } from './components';
|
|
1
|
+
import { FormContainer, Field,FormContainerWrapper } from './components';
|
|
2
2
|
import './App.css';
|
|
3
3
|
import { Button } from 'antd';
|
|
4
4
|
|
|
@@ -23,14 +23,14 @@ function App() {
|
|
|
23
23
|
|
|
24
24
|
<div className="App flex flex-col items-center">
|
|
25
25
|
<div className='w-[960px] rounded bg-slate-100 flex flex-col items-center pb-10'>
|
|
26
|
-
<
|
|
26
|
+
<FormContainerWrapper cols={1} className="" >
|
|
27
27
|
<Field.Input label="分组名" __id="title" />
|
|
28
|
-
|
|
28
|
+
<Field.TreeSelect label="分组名" __id="title11"></Field.TreeSelect>
|
|
29
29
|
<Field.CodeMachine label="角色编号" prompt="" __id="code" />
|
|
30
30
|
<Field.Input label="角色名称" __id="name" />
|
|
31
31
|
<Field.CheckboxTree label="角色权限" __id="permissions" addRoot={false} treeData={treeData} />
|
|
32
32
|
<Field.TextArea label="备注" __id="remark" />
|
|
33
|
-
</
|
|
33
|
+
</FormContainerWrapper>
|
|
34
34
|
<Button type="primary">Button</Button>
|
|
35
35
|
</div>
|
|
36
36
|
|
|
@@ -39,3 +39,5 @@ function App() {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export default App;
|
|
42
|
+
|
|
43
|
+
export {FormContainer, Field ,FormContainerWrapper} from './components'
|
|
@@ -34,7 +34,7 @@ const TreeSelect = ({ request, title, disabledValue, callError, ...props }) => {
|
|
|
34
34
|
}
|
|
35
35
|
return (
|
|
36
36
|
<BaseWrapper {...props}>
|
|
37
|
-
{firstLoad && <OriginalTreeSelect {...props} treeData={treeData} treeDefaultExpandAll />}
|
|
37
|
+
{firstLoad && <OriginalTreeSelect {...props} treeData={treeData} treeDefaultExpandAll style={{ width: '100%' }} />}
|
|
38
38
|
</BaseWrapper>
|
|
39
39
|
)
|
|
40
40
|
}
|
|
@@ -187,7 +187,6 @@ const FormContainer = forwardRef(({ cols, children }, ref) => {
|
|
|
187
187
|
)
|
|
188
188
|
});
|
|
189
189
|
|
|
190
|
-
export default FormContainer;
|
|
191
190
|
|
|
192
191
|
/**
|
|
193
192
|
* 简单包装,不做任何处理
|
|
@@ -199,9 +198,11 @@ export function withWrap(Comp) {
|
|
|
199
198
|
});
|
|
200
199
|
}
|
|
201
200
|
|
|
202
|
-
const FormContainerClass = () => {
|
|
203
|
-
const { forwardedRef, ...otherProps } =
|
|
204
|
-
return <
|
|
201
|
+
const FormContainerClass = (props) => {
|
|
202
|
+
const { forwardedRef, ...otherProps } = props;
|
|
203
|
+
return <FormContainer {...otherProps} ref={forwardedRef} />
|
|
205
204
|
}
|
|
206
205
|
|
|
207
|
-
|
|
206
|
+
const FormContainerWrapper = withWrap(FormContainerClass);
|
|
207
|
+
|
|
208
|
+
export { FormContainer, FormContainerWrapper }
|
package/src/components/index.jsx
CHANGED
|
@@ -2,7 +2,7 @@ import { Input, TextArea, Password, Search ,CodeMachine} from './field/input/ind
|
|
|
2
2
|
import '../App.css';
|
|
3
3
|
import { TreeSelect, Select } from './field/select/index.jsx'
|
|
4
4
|
import Custom from './field/custom/index.jsx'
|
|
5
|
-
import {
|
|
5
|
+
import { FormContainer, FormContainerWrapper } from './form-container/index.jsx'
|
|
6
6
|
import { Checkbox ,CheckboxTree } from './field/checkbox/index.jsx'
|
|
7
7
|
import { default as RadioGrop } from './field/radio/index.jsx'
|
|
8
8
|
const Field = {
|
package/src/main.jsx
ADDED