@apexcura/ui-components 0.0.13-Beta62 → 0.0.13-Beta64

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 CHANGED
@@ -793,8 +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 = Array.isArray(props.value) ? props.value : [];
797
- const newFileList = [...existingFiles];
796
+ const newFileList = [];
798
797
  for (let i = 0; i < fileList.length; i++) {
799
798
  const selectedFile = fileList[i];
800
799
  const isCorrectFile = ["image/png", "image/jpg", "image/jpeg"].includes(
@@ -826,14 +825,11 @@ var UploadElement = (props) => {
826
825
  reader.readAsDataURL(selectedFile);
827
826
  newFileList.push(newFile);
828
827
  }
829
- props.onChange && props.onChange({
830
- name: props.name,
831
- value: newFileList
832
- });
833
828
  };
834
829
  const uploadChange2 = ({ file, fileList }) => {
835
- const newFileList = fileList.filter((f) => f.name !== file.name);
836
- console.log("newFileList---------------", newFileList);
830
+ const existingFiles = Array.isArray(props.value) ? props.value : [];
831
+ const newFileList = [...existingFiles, ...fileList];
832
+ console.log(newFileList);
837
833
  props.onChange && props.onChange({
838
834
  name: props.name,
839
835
  value: newFileList
package/dist/index.mjs CHANGED
@@ -737,8 +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 = Array.isArray(props.value) ? props.value : [];
741
- const newFileList = [...existingFiles];
740
+ const newFileList = [];
742
741
  for (let i = 0; i < fileList.length; i++) {
743
742
  const selectedFile = fileList[i];
744
743
  const isCorrectFile = ["image/png", "image/jpg", "image/jpeg"].includes(
@@ -770,14 +769,11 @@ var UploadElement = (props) => {
770
769
  reader.readAsDataURL(selectedFile);
771
770
  newFileList.push(newFile);
772
771
  }
773
- props.onChange && props.onChange({
774
- name: props.name,
775
- value: newFileList
776
- });
777
772
  };
778
773
  const uploadChange2 = ({ file, fileList }) => {
779
- const newFileList = fileList.filter((f) => f.name !== file.name);
780
- console.log("newFileList---------------", newFileList);
774
+ const existingFiles = Array.isArray(props.value) ? props.value : [];
775
+ const newFileList = [...existingFiles, ...fileList];
776
+ console.log(newFileList);
781
777
  props.onChange && props.onChange({
782
778
  name: props.name,
783
779
  value: newFileList
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.13-Beta62",
3
+ "version": "0.0.13-Beta64",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",