lu-lowcode-package-form 0.9.80 → 0.9.83

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lu-lowcode-package-form",
3
- "version": "0.9.80",
3
+ "version": "0.9.83",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^4.8.1",
6
6
  "@testing-library/jest-dom": "^5.17.0",
@@ -28,7 +28,7 @@ const TableCol = ({ children, width, ...props }) => {
28
28
  </div>
29
29
  }
30
30
 
31
- const Table = ({ children, onTableAddRow,onTableRemoveRow, ...props }) => {
31
+ const Table = ({ children, onTableAddRow,disabled,readonly,onTableRemoveRow, ...props }) => {
32
32
  const [init, setInit] = useState(false);
33
33
  const name = props.componentId || props.__id
34
34
  const childrenIds = React.Children.map(children, (child) => `${name}.${child.props.componentId || child.props.__id}`)
@@ -56,7 +56,7 @@ const Table = ({ children, onTableAddRow,onTableRemoveRow, ...props }) => {
56
56
  })}
57
57
  </TableCol>
58
58
  })}
59
- {!props?.readonly && <TableAction subTableHead={true} key={`row_${0}_action`} subTable={true} subTableIndex={0} label={"操作"}>
59
+ {disabled != true && readonly != true && <TableAction subTableHead={true} key={`row_${0}_action`} subTable={true} subTableIndex={0} label={"操作"}>
60
60
  </TableAction>}
61
61
  </div>}
62
62
  {fields.map((field, index) => (
@@ -95,7 +95,7 @@ const Table = ({ children, onTableAddRow,onTableRemoveRow, ...props }) => {
95
95
  </Form.Item>
96
96
  </TableCol>
97
97
  })}
98
- {!props?.readonly && <TableAction subTableHead={index == 0} key={`row_${index}_action`} subTable={true} subTableIndex={index} label={"操作"}>
98
+ {disabled != true && readonly != true && <TableAction subTableHead={index == 0} key={`row_${index}_action`} subTable={true} subTableIndex={index} label={"操作"}>
99
99
  <DeleteOutlined className="fcursor-pointer" onClick={() =>{
100
100
  remove(index)
101
101
  typeof onTableRemoveRow === "function" && onTableRemoveRow(childrenIds);
@@ -104,10 +104,10 @@ const Table = ({ children, onTableAddRow,onTableRemoveRow, ...props }) => {
104
104
  </div>
105
105
  ))}
106
106
  </div>
107
- <Button onClick={() => {
107
+ {disabled != true && readonly != true && <Button onClick={() => {
108
108
  add({ key: nanoid() })
109
109
  typeof onTableAddRow === "function" && onTableAddRow(childrenIds);
110
- }} className="fmy-2">新增一行</Button>
110
+ }} className="fmy-2">新增一行</Button>}
111
111
  </div>
112
112
  }}
113
113
  </Form.List>
@@ -4,7 +4,7 @@ import { BaseWrapper } from "../base.jsx"
4
4
  import { UploadOutlined } from "@ant-design/icons";
5
5
  import React, { useEffect, useState } from "react";
6
6
 
7
- const UploadFile = ({ value, maxCount, onChange, ...props }) => {
7
+ const UploadFile = ({ value, maxCount,multiple, onChange, ...props }) => {
8
8
  useEffect(() => {
9
9
  if (value) {
10
10
  if (typeof value == 'string') {
@@ -21,7 +21,8 @@ const UploadFile = ({ value, maxCount, onChange, ...props }) => {
21
21
  setFileList(value)
22
22
  }
23
23
  }, [value]);
24
- maxCount = maxCount || 9;
24
+ maxCount = maxCount || 99;
25
+ multiple = multiple || true;
25
26
  const [fileList, setFileList] = React.useState([]);
26
27
  const handleChange = ({ fileList: newFileList }) => {
27
28
  console.log("newFileList", newFileList)
@@ -46,6 +47,7 @@ const UploadFile = ({ value, maxCount, onChange, ...props }) => {
46
47
  <OriginalUpload {...props}
47
48
  listType="text"
48
49
  maxCount={maxCount}
50
+ multiple={multiple}
49
51
  onChange={handleChange}
50
52
  fileList={fileList}>
51
53
  {!props?.disabled && !props?.readonly && <div className=" fmin-w-36 fgap-1 frounded fborder-gray-300 fborder hover:fborder-[#3e92f8] hover:ftext-[#3e92f8] fcursor-pointer fh-8 fflex fitems-center fbg-white fjustify-center "><UploadOutlined />点击上传文件</div>}
@@ -4,7 +4,7 @@ import { BaseWrapper } from "../base.jsx"
4
4
  import { DeleteOutlined, EyeOutlined, PlusOutlined } from "@ant-design/icons";
5
5
  import React, { useEffect, useRef, useState, version } from "react";
6
6
 
7
- const UploadImage = ({ maxCount, value, onChange, ...props }) => {
7
+ const UploadImage = ({ maxCount, value, multiple, onChange, ...props }) => {
8
8
  // console.log("uploadimage props", props)
9
9
  useEffect(() => {
10
10
  if (value) {
@@ -31,7 +31,8 @@ const UploadImage = ({ maxCount, value, onChange, ...props }) => {
31
31
  setFileList(_fileList)
32
32
  }
33
33
  }, [value]);
34
- maxCount = maxCount || 9;
34
+ maxCount = maxCount || 99;
35
+ multiple = multiple || true;
35
36
  const [fileList, setFileList] = React.useState([]);
36
37
  const [previewImage, setPreviewImage] = useState('');
37
38
  const [previewImageIndex, setPreviewImageIndex] = useState(0);
@@ -147,6 +148,7 @@ const UploadImage = ({ maxCount, value, onChange, ...props }) => {
147
148
  listType="picture-card"
148
149
  fileList={fileList}
149
150
  maxCount={maxCount}
151
+ multiple={multiple}
150
152
  onPreview={handlePreview}
151
153
  onChange={handleChange}
152
154
  >