@apexcura/ui-components 0.0.16-Beta70 → 0.0.16-Beta72

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
@@ -1138,13 +1138,21 @@ var FileUpload = (props) => {
1138
1138
  setFiles((prevFileList) => [...prevFileList, newFile]);
1139
1139
  if (props.onChange) {
1140
1140
  props.onChange({
1141
- name: props.name,
1142
- value: newFile
1141
+ files: [...files, newFile]
1143
1142
  });
1144
1143
  }
1145
1144
  });
1146
1145
  return false;
1147
1146
  };
1147
+ const handleRemove = (file) => {
1148
+ const updatedFiles = files.filter((f) => f.uid !== file.uid);
1149
+ setFiles(updatedFiles);
1150
+ if (props.onChange) {
1151
+ props.onChange({
1152
+ files: updatedFiles
1153
+ });
1154
+ }
1155
+ };
1148
1156
  const customRequest = (options) => {
1149
1157
  const { onSuccess } = options;
1150
1158
  setTimeout(() => {
@@ -1163,6 +1171,7 @@ var FileUpload = (props) => {
1163
1171
  multiple: props.multiple,
1164
1172
  fileList: files,
1165
1173
  beforeUpload,
1174
+ onRemove: handleRemove,
1166
1175
  showUploadList: true,
1167
1176
  customRequest
1168
1177
  },
package/dist/index.mjs CHANGED
@@ -1066,13 +1066,21 @@ var FileUpload = (props) => {
1066
1066
  setFiles((prevFileList) => [...prevFileList, newFile]);
1067
1067
  if (props.onChange) {
1068
1068
  props.onChange({
1069
- name: props.name,
1070
- value: newFile
1069
+ files: [...files, newFile]
1071
1070
  });
1072
1071
  }
1073
1072
  });
1074
1073
  return false;
1075
1074
  };
1075
+ const handleRemove = (file) => {
1076
+ const updatedFiles = files.filter((f) => f.uid !== file.uid);
1077
+ setFiles(updatedFiles);
1078
+ if (props.onChange) {
1079
+ props.onChange({
1080
+ files: updatedFiles
1081
+ });
1082
+ }
1083
+ };
1076
1084
  const customRequest = (options) => {
1077
1085
  const { onSuccess } = options;
1078
1086
  setTimeout(() => {
@@ -1091,6 +1099,7 @@ var FileUpload = (props) => {
1091
1099
  multiple: props.multiple,
1092
1100
  fileList: files,
1093
1101
  beforeUpload,
1102
+ onRemove: handleRemove,
1094
1103
  showUploadList: true,
1095
1104
  customRequest
1096
1105
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.16-Beta70",
3
+ "version": "0.0.16-Beta72",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",