@apexcura/ui-components 0.0.13-Beta65 → 0.0.13-Beta66
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 +3 -25
- package/dist/index.mjs +4 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -793,7 +793,7 @@ var UploadElement = (props) => {
|
|
|
793
793
|
const [previewImage, setPreviewImage] = (0, import_react23.useState)(null);
|
|
794
794
|
const uploadChange = (fileList) => {
|
|
795
795
|
if (!fileList || fileList.length === 0) return;
|
|
796
|
-
const existingFiles =
|
|
796
|
+
const existingFiles = props.value;
|
|
797
797
|
const newFileList = [...existingFiles];
|
|
798
798
|
console.log(newFileList);
|
|
799
799
|
for (let i = 0; i < fileList.length; i++) {
|
|
@@ -832,19 +832,6 @@ var UploadElement = (props) => {
|
|
|
832
832
|
value: newFileList
|
|
833
833
|
});
|
|
834
834
|
};
|
|
835
|
-
const handlePreview = async (file) => {
|
|
836
|
-
if (!file.url && !file.preview) {
|
|
837
|
-
file.preview = await URL.createObjectURL(file.originFileObj);
|
|
838
|
-
}
|
|
839
|
-
setPreviewImage(file.url || file.preview);
|
|
840
|
-
setPreviewType(
|
|
841
|
-
file.type || file.name.substring(file.name.lastIndexOf(".") + 1)
|
|
842
|
-
);
|
|
843
|
-
setPreviewTitle(
|
|
844
|
-
file.name || (file.url || "").substring((file.url || "").lastIndexOf("/") + 1)
|
|
845
|
-
);
|
|
846
|
-
setPreviewOpen(true);
|
|
847
|
-
};
|
|
848
835
|
const handleCancel = () => {
|
|
849
836
|
setPreviewImage(null);
|
|
850
837
|
setPreviewType(null);
|
|
@@ -862,17 +849,8 @@ var UploadElement = (props) => {
|
|
|
862
849
|
}
|
|
863
850
|
)), /* @__PURE__ */ import_react23.default.createElement(
|
|
864
851
|
import_antd17.Upload,
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
listType: props.list_type,
|
|
868
|
-
maxCount: props.max_count,
|
|
869
|
-
multiple: true,
|
|
870
|
-
fileList: Array.isArray(props.value) ? props.value : [],
|
|
871
|
-
onPreview: handlePreview,
|
|
872
|
-
showUploadList: true
|
|
873
|
-
},
|
|
874
|
-
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, ")"))),
|
|
875
|
-
props.list_type === "picture" && /* @__PURE__ */ import_react23.default.createElement(import_antd17.Button, { icon: /* @__PURE__ */ import_react23.default.createElement(import_icons5.UploadOutlined, null) }, props.feildData.max_count ? `Upload (Max:${props.max_count})` : "Upload")
|
|
852
|
+
null,
|
|
853
|
+
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, ")")))
|
|
876
854
|
), props.errors && props.errors.length > 0 && props.errors.map(
|
|
877
855
|
(error, eKey) => /* @__PURE__ */ import_react23.default.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)
|
|
878
856
|
), /* @__PURE__ */ import_react23.default.createElement(
|
package/dist/index.mjs
CHANGED
|
@@ -728,7 +728,7 @@ var DateRangePickerElement = (props) => {
|
|
|
728
728
|
|
|
729
729
|
// src/Components/UploadElement.tsx
|
|
730
730
|
import React23, { useState as useState7 } from "react";
|
|
731
|
-
import { Upload,
|
|
731
|
+
import { Upload, Modal as Modal2, Tooltip } from "antd";
|
|
732
732
|
import { UploadOutlined, PlusOutlined as PlusOutlined2, CloseOutlined } from "@ant-design/icons";
|
|
733
733
|
var UploadElement = (props) => {
|
|
734
734
|
const [previewTitle, setPreviewTitle] = useState7(null);
|
|
@@ -737,7 +737,7 @@ var UploadElement = (props) => {
|
|
|
737
737
|
const [previewImage, setPreviewImage] = useState7(null);
|
|
738
738
|
const uploadChange = (fileList) => {
|
|
739
739
|
if (!fileList || fileList.length === 0) return;
|
|
740
|
-
const existingFiles =
|
|
740
|
+
const existingFiles = props.value;
|
|
741
741
|
const newFileList = [...existingFiles];
|
|
742
742
|
console.log(newFileList);
|
|
743
743
|
for (let i = 0; i < fileList.length; i++) {
|
|
@@ -776,19 +776,6 @@ var UploadElement = (props) => {
|
|
|
776
776
|
value: newFileList
|
|
777
777
|
});
|
|
778
778
|
};
|
|
779
|
-
const handlePreview = async (file) => {
|
|
780
|
-
if (!file.url && !file.preview) {
|
|
781
|
-
file.preview = await URL.createObjectURL(file.originFileObj);
|
|
782
|
-
}
|
|
783
|
-
setPreviewImage(file.url || file.preview);
|
|
784
|
-
setPreviewType(
|
|
785
|
-
file.type || file.name.substring(file.name.lastIndexOf(".") + 1)
|
|
786
|
-
);
|
|
787
|
-
setPreviewTitle(
|
|
788
|
-
file.name || (file.url || "").substring((file.url || "").lastIndexOf("/") + 1)
|
|
789
|
-
);
|
|
790
|
-
setPreviewOpen(true);
|
|
791
|
-
};
|
|
792
779
|
const handleCancel = () => {
|
|
793
780
|
setPreviewImage(null);
|
|
794
781
|
setPreviewType(null);
|
|
@@ -806,17 +793,8 @@ var UploadElement = (props) => {
|
|
|
806
793
|
}
|
|
807
794
|
)), /* @__PURE__ */ React23.createElement(
|
|
808
795
|
Upload,
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
listType: props.list_type,
|
|
812
|
-
maxCount: props.max_count,
|
|
813
|
-
multiple: true,
|
|
814
|
-
fileList: Array.isArray(props.value) ? props.value : [],
|
|
815
|
-
onPreview: handlePreview,
|
|
816
|
-
showUploadList: true
|
|
817
|
-
},
|
|
818
|
-
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, ")"))),
|
|
819
|
-
props.list_type === "picture" && /* @__PURE__ */ React23.createElement(Button3, { icon: /* @__PURE__ */ React23.createElement(UploadOutlined, null) }, props.feildData.max_count ? `Upload (Max:${props.max_count})` : "Upload")
|
|
796
|
+
null,
|
|
797
|
+
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, ")")))
|
|
820
798
|
), props.errors && props.errors.length > 0 && props.errors.map(
|
|
821
799
|
(error, eKey) => /* @__PURE__ */ React23.createElement("small", { key: eKey, className: "text-danger animated flash" }, error.message)
|
|
822
800
|
), /* @__PURE__ */ React23.createElement(
|