@apexcura/ui-components 0.0.13-Beta47 → 0.0.13-Beta49
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.js +8 -6
- package/dist/index.mjs +8 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -794,7 +794,8 @@ var UploadElement = (props) => {
|
|
|
794
794
|
const uploadChange = (fileList) => {
|
|
795
795
|
console.log(fileList);
|
|
796
796
|
if (!fileList || fileList.length === 0) return;
|
|
797
|
-
const
|
|
797
|
+
const fileArray = Array.from(fileList);
|
|
798
|
+
const selectedFile = fileArray[0];
|
|
798
799
|
if (!selectedFile) return;
|
|
799
800
|
const isCorrectFile = ["image/png", "image/jpg", "image/jpeg"].includes(selectedFile.type);
|
|
800
801
|
if (!isCorrectFile) {
|
|
@@ -811,8 +812,8 @@ var UploadElement = (props) => {
|
|
|
811
812
|
status: "done",
|
|
812
813
|
type: selectedFile.type,
|
|
813
814
|
size: selectedFile.size,
|
|
814
|
-
url: URL.createObjectURL(selectedFile)
|
|
815
|
-
|
|
815
|
+
url: URL.createObjectURL(selectedFile),
|
|
816
|
+
originFileObj: selectedFile
|
|
816
817
|
};
|
|
817
818
|
const reader = new FileReader();
|
|
818
819
|
reader.onload = (e) => {
|
|
@@ -863,17 +864,18 @@ var UploadElement = (props) => {
|
|
|
863
864
|
accept: props.accept,
|
|
864
865
|
listType: props.list_type,
|
|
865
866
|
maxCount: props.max_count,
|
|
866
|
-
multiple:
|
|
867
|
+
multiple: true,
|
|
868
|
+
fileList: props.value,
|
|
867
869
|
onChange: uploadChange2,
|
|
868
870
|
onPreview: handlePreview,
|
|
869
871
|
showUploadList: true
|
|
870
872
|
},
|
|
871
873
|
props.list_type === "picture-card" && /* @__PURE__ */ import_react23.default.createElement("div", null, /* @__PURE__ */ import_react23.default.createElement(import_icons5.PlusOutlined, null), /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginTop: 8 } }, "Upload ", /* @__PURE__ */ import_react23.default.createElement("small", { className: "d-flex" }, "(Max:", props.max_count, ")"))),
|
|
872
|
-
props.list_type === "picture" && /* @__PURE__ */ import_react23.default.createElement(import_antd17.Button, { icon: /* @__PURE__ */ import_react23.default.createElement(import_icons5.UploadOutlined, null) }, props.
|
|
874
|
+
props.list_type === "picture" && /* @__PURE__ */ import_react23.default.createElement(import_antd17.Button, { icon: /* @__PURE__ */ import_react23.default.createElement(import_icons5.UploadOutlined, null) }, props.max_count ? `Upload (Max:${props.max_count})` : "Upload")
|
|
873
875
|
), props.errors && props.errors.length > 0 && props.errors.map((error, eKey) => /* @__PURE__ */ import_react23.default.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)), /* @__PURE__ */ import_react23.default.createElement(
|
|
874
876
|
import_antd17.Modal,
|
|
875
877
|
{
|
|
876
|
-
|
|
878
|
+
open: previewOpen,
|
|
877
879
|
width: "100%",
|
|
878
880
|
zIndex: 1025,
|
|
879
881
|
centered: true,
|
package/dist/index.mjs
CHANGED
|
@@ -738,7 +738,8 @@ var UploadElement = (props) => {
|
|
|
738
738
|
const uploadChange = (fileList) => {
|
|
739
739
|
console.log(fileList);
|
|
740
740
|
if (!fileList || fileList.length === 0) return;
|
|
741
|
-
const
|
|
741
|
+
const fileArray = Array.from(fileList);
|
|
742
|
+
const selectedFile = fileArray[0];
|
|
742
743
|
if (!selectedFile) return;
|
|
743
744
|
const isCorrectFile = ["image/png", "image/jpg", "image/jpeg"].includes(selectedFile.type);
|
|
744
745
|
if (!isCorrectFile) {
|
|
@@ -755,8 +756,8 @@ var UploadElement = (props) => {
|
|
|
755
756
|
status: "done",
|
|
756
757
|
type: selectedFile.type,
|
|
757
758
|
size: selectedFile.size,
|
|
758
|
-
url: URL.createObjectURL(selectedFile)
|
|
759
|
-
|
|
759
|
+
url: URL.createObjectURL(selectedFile),
|
|
760
|
+
originFileObj: selectedFile
|
|
760
761
|
};
|
|
761
762
|
const reader = new FileReader();
|
|
762
763
|
reader.onload = (e) => {
|
|
@@ -807,17 +808,18 @@ var UploadElement = (props) => {
|
|
|
807
808
|
accept: props.accept,
|
|
808
809
|
listType: props.list_type,
|
|
809
810
|
maxCount: props.max_count,
|
|
810
|
-
multiple:
|
|
811
|
+
multiple: true,
|
|
812
|
+
fileList: props.value,
|
|
811
813
|
onChange: uploadChange2,
|
|
812
814
|
onPreview: handlePreview,
|
|
813
815
|
showUploadList: true
|
|
814
816
|
},
|
|
815
817
|
props.list_type === "picture-card" && /* @__PURE__ */ React23.createElement("div", null, /* @__PURE__ */ React23.createElement(PlusOutlined2, null), /* @__PURE__ */ React23.createElement("div", { style: { marginTop: 8 } }, "Upload ", /* @__PURE__ */ React23.createElement("small", { className: "d-flex" }, "(Max:", props.max_count, ")"))),
|
|
816
|
-
props.list_type === "picture" && /* @__PURE__ */ React23.createElement(Button3, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, props.
|
|
818
|
+
props.list_type === "picture" && /* @__PURE__ */ React23.createElement(Button3, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, props.max_count ? `Upload (Max:${props.max_count})` : "Upload")
|
|
817
819
|
), props.errors && props.errors.length > 0 && props.errors.map((error, eKey) => /* @__PURE__ */ React23.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)), /* @__PURE__ */ React23.createElement(
|
|
818
820
|
Modal2,
|
|
819
821
|
{
|
|
820
|
-
|
|
822
|
+
open: previewOpen,
|
|
821
823
|
width: "100%",
|
|
822
824
|
zIndex: 1025,
|
|
823
825
|
centered: true,
|