ods-component-lib 1.18.176 → 1.18.178

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.
@@ -8,9 +8,6 @@ declare type FileUploadProps = {
8
8
  multipleDoc?: boolean;
9
9
  removeFile?: (file: any) => void;
10
10
  customValidationMessages: IValidationMessageOptions;
11
- RemoveTitle?: string;
12
- RemoveOkText?: string;
13
- RemoveCancelText?: string;
14
11
  };
15
12
  interface IValidationMessageOptions {
16
13
  sizeValidationFailMessage?: string;
package/dist/index.js CHANGED
@@ -1753,10 +1753,7 @@ function OdsFileUpload(props) {
1753
1753
  allowDocumentUpload = _props$allowDocumentU === void 0 ? false : _props$allowDocumentU,
1754
1754
  _props$multipleDoc = props.multipleDoc,
1755
1755
  multipleDoc = _props$multipleDoc === void 0 ? false : _props$multipleDoc,
1756
- customValidationMessages = props.customValidationMessages,
1757
- RemoveTitle = props.RemoveTitle,
1758
- RemoveOkText = props.RemoveOkText,
1759
- RemoveCancelText = props.RemoveCancelText;
1756
+ customValidationMessages = props.customValidationMessages;
1760
1757
  var _useState = React.useState(false),
1761
1758
  previewOpen = _useState[0],
1762
1759
  setPreviewOpen = _useState[1];
@@ -1769,7 +1766,6 @@ function OdsFileUpload(props) {
1769
1766
  var _useState4 = React.useState(""),
1770
1767
  previewFileName = _useState4[0],
1771
1768
  setPreviewFileName = _useState4[1];
1772
- var confirm = antd.Modal.confirm;
1773
1769
  var getBase64 = function getBase64(img, callback) {
1774
1770
  var reader = new FileReader();
1775
1771
  reader.addEventListener('load', function () {
@@ -1852,31 +1848,23 @@ function OdsFileUpload(props) {
1852
1848
  }
1853
1849
  },
1854
1850
  onRemove: function onRemove(file) {
1855
- confirm({
1856
- title: RemoveTitle ? RemoveTitle : "The image will be deleted, do you confirm?",
1857
- okText: RemoveOkText ? RemoveOkText : "Ok",
1858
- cancelText: RemoveCancelText ? RemoveCancelText : "Cancel",
1859
- onOk: function onOk() {
1860
- if (!multipleDoc) {
1861
- setFileList(null);
1862
- sendDataToParent({
1863
- base64: null,
1864
- fileName: null,
1865
- plainTextBase64: null,
1866
- id: null
1867
- });
1868
- return;
1869
- }
1870
- var updatedFileList = fileList.filter(function (item) {
1871
- return item.uid !== file.uid;
1872
- });
1873
- setFileList(updatedFileList);
1874
- removeFile(updatedFileList.map(function (file) {
1875
- return file.uid;
1876
- }));
1877
- },
1878
- onCancel: function onCancel() {}
1851
+ if (!multipleDoc) {
1852
+ setFileList(null);
1853
+ sendDataToParent({
1854
+ base64: null,
1855
+ fileName: null,
1856
+ plainTextBase64: null,
1857
+ id: null
1858
+ });
1859
+ return;
1860
+ }
1861
+ var updatedFileList = fileList.filter(function (item) {
1862
+ return item.uid !== file.uid;
1879
1863
  });
1864
+ setFileList(updatedFileList);
1865
+ removeFile(updatedFileList.map(function (file) {
1866
+ return file.uid;
1867
+ }));
1880
1868
  },
1881
1869
  onDownload: function onDownload(file) {
1882
1870
  downloadFile(file.url, file.thumbUrl, file.name);