ods-component-lib 1.18.185 → 1.18.188

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.
Files changed (24) hide show
  1. package/dist/App.d.ts +3 -0
  2. package/dist/components/antd/fileUpload/OdsFileUpload.d.ts +3 -0
  3. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/ContentHandlers.d.ts +14 -0
  4. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/EditorPreparedHandlers.d.ts +7 -0
  5. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/OnExportingHandlers.d.ts +19 -0
  6. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/OptionHandlers.d.ts +7 -0
  7. package/dist/components/devextreme/OdsInlineEditDataGrid/handlers/SummaryHandlers.d.ts +21 -0
  8. package/dist/components/devextreme/OdsInlineEditDataGrid/partials/ActionCellRender.d.ts +15 -0
  9. package/dist/components/devextreme/OdsInlineEditDataGrid/partials/EditingPartial.d.ts +9 -0
  10. package/dist/components/devextreme/OdsInlineEditDataGrid/partials/PageTitle.d.ts +8 -0
  11. package/dist/components/devextreme/OdsInlineEditDataGrid/utils.d.ts +19 -0
  12. package/dist/index.js +37 -28
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.modern.js +37 -28
  15. package/dist/index.modern.js.map +1 -1
  16. package/dist/index.umd.js +2 -0
  17. package/dist/index.umd.js.map +1 -0
  18. package/dist/stories/OdsFileUpload/OdsFileUpload.stories.d.ts +4 -0
  19. package/dist/stories/OdsFileUpload/Samples/DefaultFileListOdsFileUpload.Sample.d.ts +1 -0
  20. package/package.json +1 -1
  21. package/dist/stories/OdsPivotGrid/OdsPivotGrid.stories.d.ts +0 -15
  22. package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.Constants.d.ts +0 -2
  23. package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.MockData.d.ts +0 -7
  24. package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.Sample.d.ts +0 -1
@@ -1436,7 +1436,7 @@ function OdsDataGrid(props) {
1436
1436
  }))));
1437
1437
  }
1438
1438
 
1439
- var exportFormats$1 = ['xlsx'];
1439
+ var exportFormats$1 = ["xlsx"];
1440
1440
  function OdsDisplayGrid(props) {
1441
1441
  return grid(props);
1442
1442
  }
@@ -1455,17 +1455,17 @@ function grid(props) {
1455
1455
  };
1456
1456
  var fileName = props.exportFileName ? props.exportFileName + moment().format("YYYYMMDD") : "DatagridExportFile" + moment().format("YYYYMMDD");
1457
1457
  var onExporting = function onExporting(e) {
1458
- if (e.format === 'xlsx') {
1458
+ if (e.format === "xlsx") {
1459
1459
  var workbook = new Workbook();
1460
1460
  exportDataGrid({
1461
1461
  component: e.component,
1462
- worksheet: workbook.addWorksheet('Main sheet'),
1462
+ worksheet: workbook.addWorksheet("Main sheet"),
1463
1463
  autoFilterEnabled: true
1464
1464
  }).then(function () {
1465
1465
  workbook.xlsx.writeBuffer().then(function (buffer) {
1466
1466
  saveAs(new Blob([buffer], {
1467
- type: 'application/octet-stream'
1468
- }), fileName + '.xlsx');
1467
+ type: "application/octet-stream"
1468
+ }), fileName + ".xlsx");
1469
1469
  });
1470
1470
  });
1471
1471
  } else {
@@ -1475,7 +1475,7 @@ function grid(props) {
1475
1475
  component: e.component,
1476
1476
  indent: 5
1477
1477
  }).then(function () {
1478
- doc.save(fileName + '.pdf');
1478
+ doc.save(fileName + ".pdf");
1479
1479
  });
1480
1480
  }
1481
1481
  };
@@ -1494,7 +1494,8 @@ function grid(props) {
1494
1494
  showBorders: true,
1495
1495
  onExporting: onExporting,
1496
1496
  onSelectionChanged: props.onSelectionChanged,
1497
- width: "100%"
1497
+ width: "100%",
1498
+ height: props.height ? props.height : null
1498
1499
  }, React.createElement(Paging, {
1499
1500
  enabled: true,
1500
1501
  defaultPageSize: props.pageSize
@@ -1733,6 +1734,7 @@ function OdsFileUpload(props) {
1733
1734
  RemoveTitle = props.RemoveTitle,
1734
1735
  RemoveOkText = props.RemoveOkText,
1735
1736
  RemoveCancelText = props.RemoveCancelText;
1737
+ var confirm = Modal.confirm;
1736
1738
  var _useState = useState(false),
1737
1739
  previewOpen = _useState[0],
1738
1740
  setPreviewOpen = _useState[1];
@@ -1745,10 +1747,17 @@ function OdsFileUpload(props) {
1745
1747
  var _useState4 = useState(""),
1746
1748
  previewFileName = _useState4[0],
1747
1749
  setPreviewFileName = _useState4[1];
1748
- var confirm = Modal.confirm;
1750
+ useEffect(function () {
1751
+ var _props$defaultFileLis;
1752
+ if (((_props$defaultFileLis = props.defaultFileList) === null || _props$defaultFileLis === void 0 ? void 0 : _props$defaultFileLis.length) > 0) {
1753
+ setFileList(function (prev) {
1754
+ return [].concat(props.defaultFileList, prev);
1755
+ });
1756
+ }
1757
+ }, [props.defaultFileList, setFileList]);
1749
1758
  var getBase64 = function getBase64(img, callback) {
1750
1759
  var reader = new FileReader();
1751
- reader.addEventListener('load', function () {
1760
+ reader.addEventListener("load", function () {
1752
1761
  return callback(reader.result);
1753
1762
  });
1754
1763
  if (img !== undefined) {
@@ -1757,15 +1766,15 @@ function OdsFileUpload(props) {
1757
1766
  }
1758
1767
  };
1759
1768
  var uploadProps = {
1760
- name: 'file',
1769
+ name: "file",
1761
1770
  accept: allowDocumentUpload ? "image/png,image/jpg,image/jpeg,image/svg+xml,application/pdf,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" : "image/png,image/jpg,image/jpeg,image/svg+xml",
1762
1771
  multiple: multipleDoc,
1763
1772
  maxCount: multipleDoc ? 10 : 1,
1764
- listType: 'picture-card',
1773
+ listType: "picture-card",
1765
1774
  type: "select",
1766
1775
  onPreview: function onPreview(file) {
1767
1776
  if (multipleDoc) {
1768
- var fileExtension = file.name != "" ? file.name.split('.').pop().toLowerCase() : file.url.split('.').pop().toLowerCase();
1777
+ var fileExtension = file.name != "" ? file.name.split(".").pop().toLowerCase() : file.url.split(".").pop().toLowerCase();
1769
1778
  if (fileExtension === "docx" || fileExtension === "xlsx") {
1770
1779
  downloadFile(file.url, file.thumbUrl, file.name);
1771
1780
  setPreviewOpen(false);
@@ -1773,13 +1782,13 @@ function OdsFileUpload(props) {
1773
1782
  }
1774
1783
  setPreviewFileName(file.name);
1775
1784
  }
1776
- setPreviewImage(file.url || file.thumbUrl || '');
1785
+ setPreviewImage(file.url || file.thumbUrl || "");
1777
1786
  handlePreview();
1778
1787
  },
1779
- showUploadList: {
1780
- showPreviewIcon: true,
1788
+ showUploadList: props.showUploadList || {
1781
1789
  showRemoveIcon: true,
1782
- showDownloadIcon: true
1790
+ showDownloadIcon: true,
1791
+ showPreviewIcon: true
1783
1792
  },
1784
1793
  beforeUpload: function (file) {
1785
1794
  try {
@@ -1861,13 +1870,13 @@ function OdsFileUpload(props) {
1861
1870
  fileList: fileList
1862
1871
  };
1863
1872
  function splitAtFirstComma(input) {
1864
- var index = input.indexOf(',');
1873
+ var index = input.indexOf(",");
1865
1874
  if (index !== -1) {
1866
1875
  var firstPart = input.substring(0, index).trim();
1867
1876
  var secondPart = input.substring(index + 1).trim();
1868
1877
  return [firstPart, secondPart];
1869
1878
  } else {
1870
- return [input, ''];
1879
+ return [input, ""];
1871
1880
  }
1872
1881
  }
1873
1882
  var handleCancel = function handleCancel() {
@@ -1882,13 +1891,13 @@ function OdsFileUpload(props) {
1882
1891
  return {
1883
1892
  uid: file.uid,
1884
1893
  name: file.filename,
1885
- status: 'done',
1894
+ status: "done",
1886
1895
  url: file.url
1887
1896
  };
1888
1897
  }) : [{
1889
1898
  uid: "1",
1890
1899
  name: "file",
1891
- status: 'done',
1900
+ status: "done",
1892
1901
  url: image
1893
1902
  }];
1894
1903
  setFileList(formattedFiles);
@@ -1902,17 +1911,17 @@ function OdsFileUpload(props) {
1902
1911
  return React.createElement("img", {
1903
1912
  alt: fileName == "" ? "file" : fileName,
1904
1913
  style: {
1905
- width: '100%'
1914
+ width: "100%"
1906
1915
  },
1907
1916
  src: previewSrc
1908
1917
  });
1909
1918
  } else {
1910
- var fileExtension = fileName != "" ? fileName.split('.').pop().toLowerCase() : previewSrc.split('.').pop().toLowerCase();
1919
+ var fileExtension = fileName != "" ? fileName.split(".").pop().toLowerCase() : previewSrc.split(".").pop().toLowerCase();
1911
1920
  if (fileExtension === "png" || fileExtension === "jpg" || fileExtension === "jpeg" || fileExtension === "svg") {
1912
1921
  return React.createElement("img", {
1913
1922
  alt: fileName == "" ? "file" : fileName,
1914
1923
  style: {
1915
- width: '100%'
1924
+ width: "100%"
1916
1925
  },
1917
1926
  src: previewSrc
1918
1927
  });
@@ -1931,21 +1940,21 @@ function OdsFileUpload(props) {
1931
1940
  };
1932
1941
  function downloadFile(url, thumbUrl, name) {
1933
1942
  var base64 = url || thumbUrl;
1934
- var extension = name ? name.split('.').pop() : url.split('.').pop();
1943
+ var extension = name ? name.split(".").pop() : url.split(".").pop();
1935
1944
  var fileName = name || "download." + extension;
1936
1945
  fetch(base64).then(function (res) {
1937
1946
  return res.blob();
1938
1947
  }).then(function (blob) {
1939
1948
  var blobURL = window.URL.createObjectURL(blob);
1940
- var link = document.createElement('a');
1949
+ var link = document.createElement("a");
1941
1950
  link.href = blobURL;
1942
- link.setAttribute('download', fileName);
1951
+ link.setAttribute("download", fileName);
1943
1952
  document.body.appendChild(link);
1944
1953
  link.click();
1945
1954
  document.body.removeChild(link);
1946
1955
  window.URL.revokeObjectURL(blobURL);
1947
1956
  })["catch"](function (err) {
1948
- return console.error('Failed to download file:', err);
1957
+ return console.error("Failed to download file:", err);
1949
1958
  });
1950
1959
  }
1951
1960
  return React.createElement("div", null, React.createElement(Text, {
@@ -1964,7 +1973,7 @@ function OdsFileUpload(props) {
1964
1973
  width: "100%"
1965
1974
  }, React.createElement("div", {
1966
1975
  style: {
1967
- padding: '25px'
1976
+ padding: "25px"
1968
1977
  }
1969
1978
  }, renderPreviewContent(previewFileName, previewImage))));
1970
1979
  }