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/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.1",
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": "react-scripts 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": "^17.0.1",
53
- "react-dom": "^17.0.1",
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",
@@ -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
- <FormContainer cols={1} className="" >
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
- </FormContainer>
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 } = this.props;
204
- return <FormContainerWrapper {...otherProps} ref={forwardedRef} />
201
+ const FormContainerClass = (props) => {
202
+ const { forwardedRef, ...otherProps } = props;
203
+ return <FormContainer {...otherProps} ref={forwardedRef} />
205
204
  }
206
205
 
207
- export const FormContainerWrapper = withWrap(FormContainerClass);
206
+ const FormContainerWrapper = withWrap(FormContainerClass);
207
+
208
+ export { FormContainer, FormContainerWrapper }
@@ -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 { default as FormContainer, FormContainerWrapper } from './form-container/index.jsx'
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
@@ -0,0 +1,10 @@
1
+ import React from 'react'
2
+ import ReactDOM from 'react-dom/client'
3
+ import App from './App.jsx'
4
+ import './index.css'
5
+
6
+ ReactDOM.createRoot(document.getElementById('root')).render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>,
10
+ )
package/vite.config.js CHANGED
@@ -5,6 +5,7 @@ import autoprefixer from 'autoprefixer'
5
5
  import babel from '@rollup/plugin-babel';
6
6
 
7
7
  export default defineConfig({
8
+
8
9
  build: {
9
10
  lib: {
10
11
  entry: 'src/components/index.jsx', // 入口文件