szld-libs 0.0.36 → 0.0.37
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/style.css +1 -1
- package/dist/szld-components.es.js +80 -83
- package/dist/szld-components.umd.js +18 -18
- package/es/components/Upload/index.js +3 -8
- package/lib/components/Upload/index.js +3 -8
- package/package.json +1 -1
- package/es/components/Upload/index.css +0 -3
- package/lib/components/Upload/index.css +0 -3
|
@@ -5,10 +5,6 @@ import { FileSuffix } from "../../utils/filetype";
|
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { getFileSuffix, getBase64 } from "../../utils";
|
|
7
7
|
import ReactDOM from "react-dom";
|
|
8
|
-
const preview = "upload-module_preview_49f16";
|
|
9
|
-
const styles = {
|
|
10
|
-
preview
|
|
11
|
-
};
|
|
12
8
|
const defaultFileType = [FileSuffix.jpeg, FileSuffix.jpg, FileSuffix.png];
|
|
13
9
|
const UploadFile = (props) => {
|
|
14
10
|
const {
|
|
@@ -20,7 +16,7 @@ const UploadFile = (props) => {
|
|
|
20
16
|
uploadBtnName = "上传",
|
|
21
17
|
uploadHint = null
|
|
22
18
|
} = props;
|
|
23
|
-
const [
|
|
19
|
+
const [preview, setPreview] = useState(false);
|
|
24
20
|
const [previewSrc, setPreviewSrc] = useState("");
|
|
25
21
|
const uploadButton = () => {
|
|
26
22
|
if (listType !== "text") {
|
|
@@ -103,10 +99,10 @@ const UploadFile = (props) => {
|
|
|
103
99
|
children: fileList.length >= maxCount ? null : uploadButton()
|
|
104
100
|
}
|
|
105
101
|
),
|
|
106
|
-
/* @__PURE__ */ jsx(
|
|
102
|
+
preview && /* @__PURE__ */ jsx(
|
|
107
103
|
ImagePreview,
|
|
108
104
|
{
|
|
109
|
-
visible:
|
|
105
|
+
visible: preview,
|
|
110
106
|
src: previewSrc,
|
|
111
107
|
onVisibleChange: () => {
|
|
112
108
|
setPreview(false);
|
|
@@ -124,7 +120,6 @@ const ImagePreview = (props) => {
|
|
|
124
120
|
{
|
|
125
121
|
style: { display: "none" },
|
|
126
122
|
src,
|
|
127
|
-
rootClassName: styles.preview,
|
|
128
123
|
preview: {
|
|
129
124
|
visible,
|
|
130
125
|
src,
|
|
@@ -6,10 +6,6 @@ const filetype = require("../../utils/filetype");
|
|
|
6
6
|
const react = require("react");
|
|
7
7
|
const utils = require("../../utils");
|
|
8
8
|
const ReactDOM = require("react-dom");
|
|
9
|
-
const preview = "upload-module_preview_49f16";
|
|
10
|
-
const styles = {
|
|
11
|
-
preview
|
|
12
|
-
};
|
|
13
9
|
const defaultFileType = [filetype.FileSuffix.jpeg, filetype.FileSuffix.jpg, filetype.FileSuffix.png];
|
|
14
10
|
const UploadFile = (props) => {
|
|
15
11
|
const {
|
|
@@ -21,7 +17,7 @@ const UploadFile = (props) => {
|
|
|
21
17
|
uploadBtnName = "上传",
|
|
22
18
|
uploadHint = null
|
|
23
19
|
} = props;
|
|
24
|
-
const [
|
|
20
|
+
const [preview, setPreview] = react.useState(false);
|
|
25
21
|
const [previewSrc, setPreviewSrc] = react.useState("");
|
|
26
22
|
const uploadButton = () => {
|
|
27
23
|
if (listType !== "text") {
|
|
@@ -104,10 +100,10 @@ const UploadFile = (props) => {
|
|
|
104
100
|
children: fileList.length >= maxCount ? null : uploadButton()
|
|
105
101
|
}
|
|
106
102
|
),
|
|
107
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
+
preview && /* @__PURE__ */ jsxRuntime.jsx(
|
|
108
104
|
ImagePreview,
|
|
109
105
|
{
|
|
110
|
-
visible:
|
|
106
|
+
visible: preview,
|
|
111
107
|
src: previewSrc,
|
|
112
108
|
onVisibleChange: () => {
|
|
113
109
|
setPreview(false);
|
|
@@ -125,7 +121,6 @@ const ImagePreview = (props) => {
|
|
|
125
121
|
{
|
|
126
122
|
style: { display: "none" },
|
|
127
123
|
src,
|
|
128
|
-
rootClassName: styles.preview,
|
|
129
124
|
preview: {
|
|
130
125
|
visible,
|
|
131
126
|
src,
|
package/package.json
CHANGED