ods-component-lib 1.18.99 → 1.18.102
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/components/antd/fileUpload/OdsFileUpload.d.ts +1 -2
- package/dist/components/antd/form/OdsBasicForm.d.ts +18 -0
- package/dist/components/antd/icon/OdsIcon.d.ts +10 -0
- package/dist/components/antd/modal/OdsAdvanceModal.d.ts +7 -0
- package/dist/components/antd/select/OdsCustomMultiSelect.d.ts +7 -0
- package/dist/components/antd/select/OdsMultiSelect.d.ts +9 -0
- package/dist/components/custom/OdsLogin.d.ts +8 -0
- package/dist/components/devextreme/DxDataPopupForm.d.ts +3 -0
- package/dist/components/devextreme/DynamicIcon.d.ts +5 -0
- package/dist/components/devextreme/OdsDataGridNew.d.ts +56 -0
- package/dist/components/devextreme/OdsProfDataGrid.d.ts +3 -0
- package/dist/components/devextreme/OdsRemoteDataGrid/OdsRemoteDataGrid.Functions.d.ts +2 -2
- package/dist/components/devextreme/treeview/DxTreeView.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +280 -40
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +282 -43
- package/dist/index.modern.js.map +1 -1
- package/dist/stories/OdsAdvanceModal/OdsAdvanceModal.stories.d.ts +42 -0
- package/dist/stories/OdsAdvanceModal/Samples/BasicOdsAdvanceModal.sample.d.ts +8 -0
- package/dist/stories/OdsCustomMultiSelect/OdsCustomMultiSelect.stories.d.ts +9 -0
- package/dist/stories/OdsCustomMultiSelect/Samples/Basic.Sample.d.ts +1 -0
- package/dist/stories/OdsCustomMultiSelect/Samples/ModeMultiple.Sample.d.ts +1 -0
- package/dist/stories/OdsFileUpload/OdsFileUpload.stories.d.ts +2 -13
- package/dist/stories/OdsModal/Samples/OdsModal.Sample.d.ts +1 -0
- package/dist/stories/OdsTimePicker/Samples/TimeRangePicker.d.ts +2 -0
- package/dist/utils/DynamicIcon.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare type FileUploadProps = {
|
|
3
3
|
image: any | null;
|
|
4
|
-
setFile?: (file: any) => void;
|
|
5
4
|
title: string;
|
|
6
5
|
sendDataToParent: (obj: any) => void;
|
|
7
6
|
allowDocumentUpload?: boolean;
|
|
8
7
|
multipleDoc?: boolean;
|
|
9
8
|
removeFile?: (file: any) => void;
|
|
10
9
|
};
|
|
11
|
-
declare
|
|
10
|
+
declare function OdsFileUpload(props: FileUploadProps): React.JSX.Element;
|
|
12
11
|
export default OdsFileUpload;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormProps, ButtonProps } from 'antd';
|
|
3
|
+
export interface IFormItemRuleProps {
|
|
4
|
+
required?: boolean;
|
|
5
|
+
message?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IFormItemProps {
|
|
8
|
+
label?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
formItemType: string;
|
|
11
|
+
rules?: IFormItemRuleProps[];
|
|
12
|
+
}
|
|
13
|
+
export interface IFormProps extends FormProps {
|
|
14
|
+
formItems: IFormItemProps[];
|
|
15
|
+
formButtons: ButtonProps[];
|
|
16
|
+
}
|
|
17
|
+
declare function OdsBasicForm(props: IFormProps): React.JSX.Element;
|
|
18
|
+
export default OdsBasicForm;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IconBaseProps } from "@ant-design/icons/lib/components/Icon";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface IconProps extends IconBaseProps {
|
|
4
|
+
type: string;
|
|
5
|
+
twoToneColor?: string;
|
|
6
|
+
iconComponent?: string;
|
|
7
|
+
iconSVCName?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function OdsIcon(props: IconProps): React.JSX.Element;
|
|
10
|
+
export default OdsIcon;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SelectProps } from "antd";
|
|
3
|
+
import { IOdsSelectOption } from "./OdsSelect.styled";
|
|
4
|
+
export interface OdsMultiSelectProps extends SelectProps {
|
|
5
|
+
selectAllText?: string | undefined;
|
|
6
|
+
dataSource: IOdsSelectOption[];
|
|
7
|
+
}
|
|
8
|
+
declare const OdsMultiSelect: (props: OdsMultiSelectProps) => React.JSX.Element;
|
|
9
|
+
export default OdsMultiSelect;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IDataGridOptions, IEditingProps, ISelectionProps, IButtonProps } from 'devextreme-react/data-grid';
|
|
3
|
+
import { ButtonType } from "antd/es/button/buttonHelpers";
|
|
4
|
+
interface IButtonGroup extends IButtonProps {
|
|
5
|
+
type?: ButtonType;
|
|
6
|
+
label?: string;
|
|
7
|
+
onclick?: React.MouseEventHandler<HTMLElement>;
|
|
8
|
+
actionPermission?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface IEditingoptions extends IEditingProps {
|
|
11
|
+
formItems?: any[];
|
|
12
|
+
title?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ISelectOptions extends ISelectionProps {
|
|
15
|
+
selectEnable: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface IOdsDataGridProps extends IDataGridOptions {
|
|
18
|
+
actionButtonGroup?: IButtonGroup[];
|
|
19
|
+
toolbarButtonGroup?: IButtonGroup[];
|
|
20
|
+
exportFileName?: string;
|
|
21
|
+
summaryTotalColumnName?: string;
|
|
22
|
+
storeState?: boolean;
|
|
23
|
+
summaryTotalDataCount?: number;
|
|
24
|
+
summaryTotalDataDisplayLabel?: string;
|
|
25
|
+
summaryTotalPagesize?: number;
|
|
26
|
+
editHintLabel?: string;
|
|
27
|
+
editButtonClick?: any;
|
|
28
|
+
deleteButtonClick?: any;
|
|
29
|
+
pageTitle?: string;
|
|
30
|
+
pageSize?: number;
|
|
31
|
+
pagingEnable?: boolean;
|
|
32
|
+
searchEnable?: boolean;
|
|
33
|
+
filterEnable?: boolean;
|
|
34
|
+
headerFilterEnable?: boolean;
|
|
35
|
+
columnChooserPositionDisabled?: boolean;
|
|
36
|
+
editEnable?: boolean;
|
|
37
|
+
popupTitle?: string;
|
|
38
|
+
scroll?: any;
|
|
39
|
+
exportEnable?: boolean;
|
|
40
|
+
customPopup?: boolean;
|
|
41
|
+
onExportingCustom?: any;
|
|
42
|
+
filterEnabledShow?: boolean;
|
|
43
|
+
scrolUseNative?: boolean;
|
|
44
|
+
formItems?: any[];
|
|
45
|
+
hintForDeleteButton?: string;
|
|
46
|
+
hintForEditButton?: string;
|
|
47
|
+
exportFormats?: string[];
|
|
48
|
+
actionPermission?: boolean;
|
|
49
|
+
columns: any[];
|
|
50
|
+
actionColumnEnable?: boolean;
|
|
51
|
+
edit?: IEditingoptions;
|
|
52
|
+
selectOptions?: ISelectOptions;
|
|
53
|
+
actionColumnCaption?: string;
|
|
54
|
+
}
|
|
55
|
+
declare function OdsDataGridNew(props: IOdsDataGridProps): React.JSX.Element;
|
|
56
|
+
export default OdsDataGridNew;
|
|
@@ -6,6 +6,6 @@ export declare const addNewFieldForFastUpdate: (data: any[]) => any[];
|
|
|
6
6
|
export declare const getRequestHeaders: (props: any) => Headers;
|
|
7
7
|
export declare const concatFilteredLabel: (result: string, totalloaded: number, filteredRowCount: number, filterApplied: boolean, props: any) => string;
|
|
8
8
|
export declare const showSummaryItems: (props: IOdsDataGridProps) => boolean;
|
|
9
|
-
export declare const getSummaryItems: (props: IOdsDataGridProps, columns: any[], grid: any) => ReactElement[];
|
|
10
|
-
export declare const getSummaryItem: (col: any, visibleIndex: number, summaryType: SummaryTypes, label?: string) => ReactElement;
|
|
9
|
+
export declare const getSummaryItems: (props: IOdsDataGridProps, columns: any[], grid: any, isMultiLevelColumn?: boolean) => ReactElement[];
|
|
10
|
+
export declare const getSummaryItem: (col: any, visibleIndex: number, summaryType: SummaryTypes, isMultiLevelColumn: boolean, label?: string) => ReactElement;
|
|
11
11
|
export declare const getMultiLevelColumns: (col: any) => any;
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ import OdsBadgeRibbon from "./components/antd/badge/OdsBadgeRibbon";
|
|
|
49
49
|
import OdsModal from "./components/antd/modal/OdsModal";
|
|
50
50
|
import OdsFilter from "./components/filter/OdsFilter";
|
|
51
51
|
import OdsFilterTagView from "./components/filter/OdsFilterTagView";
|
|
52
|
+
import OdsFileUpload from "./components/antd/fileUpload/OdsFileUpload";
|
|
52
53
|
export { OdsButton };
|
|
53
54
|
export { OdsInput };
|
|
54
55
|
export { OdsDropdownButton };
|
|
@@ -98,6 +99,7 @@ export { OdsBadgeRibbon };
|
|
|
98
99
|
export { OdsModal };
|
|
99
100
|
export { OdsFilter };
|
|
100
101
|
export { OdsFilterTagView };
|
|
102
|
+
export { OdsFileUpload };
|
|
101
103
|
export { OdsDataGrid };
|
|
102
104
|
export { OdsDisplayGrid };
|
|
103
105
|
export { OdsRemoteDataGrid } from "./components/devextreme/index";
|
package/dist/index.js
CHANGED
|
@@ -1718,6 +1718,228 @@ var OdsFilter = function OdsFilter(props) {
|
|
|
1718
1718
|
}, props.buttonApplyName))))));
|
|
1719
1719
|
};
|
|
1720
1720
|
|
|
1721
|
+
var Title$1 = antd.Typography.Title;
|
|
1722
|
+
function OdsFileUpload(props) {
|
|
1723
|
+
var image = props.image,
|
|
1724
|
+
removeFile = props.removeFile,
|
|
1725
|
+
title = props.title,
|
|
1726
|
+
sendDataToParent = props.sendDataToParent,
|
|
1727
|
+
_props$allowDocumentU = props.allowDocumentUpload,
|
|
1728
|
+
allowDocumentUpload = _props$allowDocumentU === void 0 ? false : _props$allowDocumentU,
|
|
1729
|
+
_props$multipleDoc = props.multipleDoc,
|
|
1730
|
+
multipleDoc = _props$multipleDoc === void 0 ? false : _props$multipleDoc;
|
|
1731
|
+
var _useState = React.useState(false),
|
|
1732
|
+
previewOpen = _useState[0],
|
|
1733
|
+
setPreviewOpen = _useState[1];
|
|
1734
|
+
var _useState2 = React.useState(null),
|
|
1735
|
+
previewImage = _useState2[0],
|
|
1736
|
+
setPreviewImage = _useState2[1];
|
|
1737
|
+
var _useState3 = React.useState([]),
|
|
1738
|
+
fileList = _useState3[0],
|
|
1739
|
+
setFileList = _useState3[1];
|
|
1740
|
+
var _useState4 = React.useState(""),
|
|
1741
|
+
previewFileName = _useState4[0],
|
|
1742
|
+
setPreviewFileName = _useState4[1];
|
|
1743
|
+
var getBase64 = function getBase64(img, callback) {
|
|
1744
|
+
var reader = new FileReader();
|
|
1745
|
+
reader.addEventListener('load', function () {
|
|
1746
|
+
return callback(reader.result);
|
|
1747
|
+
});
|
|
1748
|
+
if (img !== undefined) {
|
|
1749
|
+
reader.readAsDataURL(img);
|
|
1750
|
+
if (!multipleDoc) setPreviewFileName(img.name);
|
|
1751
|
+
}
|
|
1752
|
+
};
|
|
1753
|
+
var uploadProps = {
|
|
1754
|
+
name: 'file',
|
|
1755
|
+
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",
|
|
1756
|
+
multiple: multipleDoc,
|
|
1757
|
+
maxCount: multipleDoc ? 10 : 1,
|
|
1758
|
+
listType: 'picture-card',
|
|
1759
|
+
type: "select",
|
|
1760
|
+
onPreview: function onPreview(file) {
|
|
1761
|
+
if (multipleDoc) {
|
|
1762
|
+
var fileExtension = file.name != "" ? file.name.split('.').pop().toLowerCase() : file.url.split('.').pop().toLowerCase();
|
|
1763
|
+
if (fileExtension === "docx" || fileExtension === "xlsx") {
|
|
1764
|
+
downloadFile(file.url, file.thumbUrl, file.name);
|
|
1765
|
+
setPreviewOpen(false);
|
|
1766
|
+
return;
|
|
1767
|
+
}
|
|
1768
|
+
setPreviewFileName(file.name);
|
|
1769
|
+
}
|
|
1770
|
+
setPreviewImage(file.url || file.thumbUrl || '');
|
|
1771
|
+
handlePreview();
|
|
1772
|
+
},
|
|
1773
|
+
showUploadList: {
|
|
1774
|
+
showPreviewIcon: true,
|
|
1775
|
+
showRemoveIcon: true,
|
|
1776
|
+
showDownloadIcon: true
|
|
1777
|
+
},
|
|
1778
|
+
beforeUpload: function (file) {
|
|
1779
|
+
try {
|
|
1780
|
+
var fileType = 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"];
|
|
1781
|
+
var isFileSizeOk = file.size / (1024 * 1024) <= 1;
|
|
1782
|
+
var checkType = fileType.includes(file.type);
|
|
1783
|
+
if (!checkType) {
|
|
1784
|
+
return Promise.resolve(antd.Upload.LIST_IGNORE);
|
|
1785
|
+
}
|
|
1786
|
+
if (!isFileSizeOk) {
|
|
1787
|
+
return Promise.resolve(antd.Upload.LIST_IGNORE);
|
|
1788
|
+
}
|
|
1789
|
+
return Promise.resolve(false);
|
|
1790
|
+
} catch (e) {
|
|
1791
|
+
return Promise.reject(e);
|
|
1792
|
+
}
|
|
1793
|
+
},
|
|
1794
|
+
onChange: function onChange(info) {
|
|
1795
|
+
if (info.fileList) {
|
|
1796
|
+
var updatedFileList = info.fileList.map(function (file) {
|
|
1797
|
+
if (file.originFileObj) {
|
|
1798
|
+
getBase64(file.originFileObj, function (url) {
|
|
1799
|
+
sendDataToParent({
|
|
1800
|
+
base64: url,
|
|
1801
|
+
fileName: file.name,
|
|
1802
|
+
plainTextBase64: splitAtFirstComma(url)[1],
|
|
1803
|
+
id: file.uid
|
|
1804
|
+
});
|
|
1805
|
+
});
|
|
1806
|
+
}
|
|
1807
|
+
return file;
|
|
1808
|
+
});
|
|
1809
|
+
setFileList(updatedFileList);
|
|
1810
|
+
}
|
|
1811
|
+
},
|
|
1812
|
+
onRemove: function onRemove(file) {
|
|
1813
|
+
if (!multipleDoc) {
|
|
1814
|
+
setFileList(null);
|
|
1815
|
+
sendDataToParent({
|
|
1816
|
+
base64: null,
|
|
1817
|
+
fileName: null,
|
|
1818
|
+
plainTextBase64: null,
|
|
1819
|
+
id: null
|
|
1820
|
+
});
|
|
1821
|
+
return;
|
|
1822
|
+
}
|
|
1823
|
+
var updatedFileList = fileList.filter(function (item) {
|
|
1824
|
+
return item.uid !== file.uid;
|
|
1825
|
+
});
|
|
1826
|
+
setFileList(updatedFileList);
|
|
1827
|
+
removeFile(updatedFileList.map(function (file) {
|
|
1828
|
+
return file.uid;
|
|
1829
|
+
}));
|
|
1830
|
+
},
|
|
1831
|
+
onDownload: function onDownload(file) {
|
|
1832
|
+
downloadFile(file.url, file.thumbUrl, file.name);
|
|
1833
|
+
},
|
|
1834
|
+
fileList: fileList
|
|
1835
|
+
};
|
|
1836
|
+
function splitAtFirstComma(input) {
|
|
1837
|
+
var index = input.indexOf(',');
|
|
1838
|
+
if (index !== -1) {
|
|
1839
|
+
var firstPart = input.substring(0, index).trim();
|
|
1840
|
+
var secondPart = input.substring(index + 1).trim();
|
|
1841
|
+
return [firstPart, secondPart];
|
|
1842
|
+
} else {
|
|
1843
|
+
return [input, ''];
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
var handleCancel = function handleCancel() {
|
|
1847
|
+
return setPreviewOpen(false);
|
|
1848
|
+
};
|
|
1849
|
+
var handlePreview = function handlePreview() {
|
|
1850
|
+
setPreviewOpen(true);
|
|
1851
|
+
};
|
|
1852
|
+
React.useEffect(function () {
|
|
1853
|
+
if (image) {
|
|
1854
|
+
var formattedFiles = multipleDoc ? image.map(function (file) {
|
|
1855
|
+
return {
|
|
1856
|
+
uid: file.uid,
|
|
1857
|
+
name: file.filename,
|
|
1858
|
+
status: 'done',
|
|
1859
|
+
url: file.url
|
|
1860
|
+
};
|
|
1861
|
+
}) : [{
|
|
1862
|
+
uid: "1",
|
|
1863
|
+
name: "file",
|
|
1864
|
+
status: 'done',
|
|
1865
|
+
url: image
|
|
1866
|
+
}];
|
|
1867
|
+
setFileList(formattedFiles);
|
|
1868
|
+
}
|
|
1869
|
+
}, [image]);
|
|
1870
|
+
var renderPreviewContent = function renderPreviewContent(fileName, previewSrc) {
|
|
1871
|
+
if (previewSrc === null) {
|
|
1872
|
+
return "";
|
|
1873
|
+
}
|
|
1874
|
+
if (!multipleDoc) {
|
|
1875
|
+
return React__default.createElement("img", {
|
|
1876
|
+
alt: fileName == "" ? "file" : fileName,
|
|
1877
|
+
style: {
|
|
1878
|
+
width: '100%'
|
|
1879
|
+
},
|
|
1880
|
+
src: previewSrc
|
|
1881
|
+
});
|
|
1882
|
+
} else {
|
|
1883
|
+
var fileExtension = fileName != "" ? fileName.split('.').pop().toLowerCase() : previewSrc.split('.').pop().toLowerCase();
|
|
1884
|
+
if (fileExtension === "png" || fileExtension === "jpg" || fileExtension === "jpeg" || fileExtension === "svg") {
|
|
1885
|
+
return React__default.createElement("img", {
|
|
1886
|
+
alt: fileName == "" ? "file" : fileName,
|
|
1887
|
+
style: {
|
|
1888
|
+
width: '100%'
|
|
1889
|
+
},
|
|
1890
|
+
src: previewSrc
|
|
1891
|
+
});
|
|
1892
|
+
} else if (fileExtension === "pdf") {
|
|
1893
|
+
return React__default.createElement("embed", {
|
|
1894
|
+
src: previewSrc,
|
|
1895
|
+
type: "application/pdf",
|
|
1896
|
+
width: "100%",
|
|
1897
|
+
height: "800px"
|
|
1898
|
+
});
|
|
1899
|
+
} else {
|
|
1900
|
+
setPreviewOpen(false);
|
|
1901
|
+
return "";
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
};
|
|
1905
|
+
function downloadFile(url, thumbUrl, name) {
|
|
1906
|
+
var base64 = url || thumbUrl;
|
|
1907
|
+
var extension = name ? name.split('.').pop() : url.split('.').pop();
|
|
1908
|
+
var fileName = name || "download." + extension;
|
|
1909
|
+
fetch(base64).then(function (res) {
|
|
1910
|
+
return res.blob();
|
|
1911
|
+
}).then(function (blob) {
|
|
1912
|
+
var blobURL = window.URL.createObjectURL(blob);
|
|
1913
|
+
var link = document.createElement('a');
|
|
1914
|
+
link.href = blobURL;
|
|
1915
|
+
link.setAttribute('download', fileName);
|
|
1916
|
+
document.body.appendChild(link);
|
|
1917
|
+
link.click();
|
|
1918
|
+
document.body.removeChild(link);
|
|
1919
|
+
window.URL.revokeObjectURL(blobURL);
|
|
1920
|
+
})["catch"](function (err) {
|
|
1921
|
+
return console.error('Failed to download file:', err);
|
|
1922
|
+
});
|
|
1923
|
+
}
|
|
1924
|
+
return React__default.createElement("div", null, React__default.createElement(Title$1, {
|
|
1925
|
+
level: 5
|
|
1926
|
+
}, title), React__default.createElement(antd.Upload, Object.assign({}, uploadProps), (fileList === null || fileList === void 0 ? void 0 : fileList.length) < 10 && React__default.createElement("div", null, React__default.createElement(icons.PlusOutlined, null), React__default.createElement("div", {
|
|
1927
|
+
style: {
|
|
1928
|
+
marginTop: 8
|
|
1929
|
+
}
|
|
1930
|
+
}, "Upload"))), React__default.createElement(antd.Modal, {
|
|
1931
|
+
open: previewOpen,
|
|
1932
|
+
title: null,
|
|
1933
|
+
footer: null,
|
|
1934
|
+
onCancel: handleCancel,
|
|
1935
|
+
width: "100%"
|
|
1936
|
+
}, React__default.createElement("div", {
|
|
1937
|
+
style: {
|
|
1938
|
+
padding: '25px'
|
|
1939
|
+
}
|
|
1940
|
+
}, renderPreviewContent(previewFileName, previewImage))));
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1721
1943
|
// A type of promise-like that resolves synchronously and supports only one observer
|
|
1722
1944
|
|
|
1723
1945
|
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
|
@@ -33477,21 +33699,32 @@ var showSummaryItems = function showSummaryItems(props) {
|
|
|
33477
33699
|
var _props$customSummary, _props$customSummary2, _props$customSummary3, _props$customSummary4, _props$customSummary5;
|
|
33478
33700
|
return ((_props$customSummary = props.customSummary) === null || _props$customSummary === void 0 ? void 0 : _props$customSummary.showAvgInSummary) || ((_props$customSummary2 = props.customSummary) === null || _props$customSummary2 === void 0 ? void 0 : _props$customSummary2.showCountInSummary) || ((_props$customSummary3 = props.customSummary) === null || _props$customSummary3 === void 0 ? void 0 : _props$customSummary3.showMaxInSummary) || ((_props$customSummary4 = props.customSummary) === null || _props$customSummary4 === void 0 ? void 0 : _props$customSummary4.showMinInSummary) || ((_props$customSummary5 = props.customSummary) === null || _props$customSummary5 === void 0 ? void 0 : _props$customSummary5.showSumInSummary);
|
|
33479
33701
|
};
|
|
33480
|
-
var getSummaryItems = function getSummaryItems(props, columns, grid) {
|
|
33702
|
+
var getSummaryItems = function getSummaryItems(props, columns, grid, isMultiLevelColumn) {
|
|
33703
|
+
if (isMultiLevelColumn === void 0) {
|
|
33704
|
+
isMultiLevelColumn = false;
|
|
33705
|
+
}
|
|
33481
33706
|
var totalItems = [];
|
|
33482
33707
|
columns.map(function (col, _index) {
|
|
33483
|
-
|
|
33484
|
-
|
|
33485
|
-
|
|
33486
|
-
|
|
33487
|
-
|
|
33488
|
-
|
|
33489
|
-
|
|
33708
|
+
if (col.multiLevelColumns && col.multiLevelColumns.length > 0) {
|
|
33709
|
+
totalItems = [].concat(totalItems, getSummaryItems(props, col.multiLevelColumns, grid, true));
|
|
33710
|
+
} else {
|
|
33711
|
+
var _props$customSummary6, _props$customSummary7, _props$customSummary8, _props$customSummary9, _props$customSummary10, _props$customSummary11, _props$customSummary12, _props$customSummary13, _props$customSummary14, _props$customSummary15;
|
|
33712
|
+
var colOption = grid.columnOption(col.dataField);
|
|
33713
|
+
if (!colOption) {
|
|
33714
|
+
return col;
|
|
33715
|
+
}
|
|
33716
|
+
((_props$customSummary6 = props.customSummary) === null || _props$customSummary6 === void 0 ? void 0 : _props$customSummary6.showAvgInSummary) && totalItems.push(getSummaryItem(col, colOption.visibleIndex, "avg", isMultiLevelColumn, (_props$customSummary7 = props.customSummary) === null || _props$customSummary7 === void 0 ? void 0 : _props$customSummary7.summaryAvgLabel));
|
|
33717
|
+
((_props$customSummary8 = props.customSummary) === null || _props$customSummary8 === void 0 ? void 0 : _props$customSummary8.showCountInSummary) && totalItems.push(getSummaryItem(col, colOption.visibleIndex, "count", isMultiLevelColumn, (_props$customSummary9 = props.customSummary) === null || _props$customSummary9 === void 0 ? void 0 : _props$customSummary9.summaryCountLabel));
|
|
33718
|
+
((_props$customSummary10 = props.customSummary) === null || _props$customSummary10 === void 0 ? void 0 : _props$customSummary10.showMaxInSummary) && totalItems.push(getSummaryItem(col, colOption.visibleIndex, "max", isMultiLevelColumn, (_props$customSummary11 = props.customSummary) === null || _props$customSummary11 === void 0 ? void 0 : _props$customSummary11.summaryMaxLabel));
|
|
33719
|
+
((_props$customSummary12 = props.customSummary) === null || _props$customSummary12 === void 0 ? void 0 : _props$customSummary12.showMinInSummary) && totalItems.push(getSummaryItem(col, colOption.visibleIndex, "min", isMultiLevelColumn, (_props$customSummary13 = props.customSummary) === null || _props$customSummary13 === void 0 ? void 0 : _props$customSummary13.summaryMinLabel));
|
|
33720
|
+
((_props$customSummary14 = props.customSummary) === null || _props$customSummary14 === void 0 ? void 0 : _props$customSummary14.showSumInSummary) && totalItems.push(getSummaryItem(col, colOption.visibleIndex, "sum", isMultiLevelColumn, (_props$customSummary15 = props.customSummary) === null || _props$customSummary15 === void 0 ? void 0 : _props$customSummary15.summarySumLabel));
|
|
33721
|
+
}
|
|
33722
|
+
return col;
|
|
33490
33723
|
});
|
|
33491
33724
|
return totalItems;
|
|
33492
33725
|
};
|
|
33493
|
-
var getSummaryItem = function getSummaryItem(col, visibleIndex, summaryType, label) {
|
|
33494
|
-
if (visibleIndex == 0) {
|
|
33726
|
+
var getSummaryItem = function getSummaryItem(col, visibleIndex, summaryType, isMultiLevelColumn, label) {
|
|
33727
|
+
if (!isMultiLevelColumn && visibleIndex == 0) {
|
|
33495
33728
|
return React__default.createElement(DataGrid.TotalItem, {
|
|
33496
33729
|
column: col.dataField,
|
|
33497
33730
|
summaryType: "custom",
|
|
@@ -33560,39 +33793,42 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
33560
33793
|
var filterApplied = React.useRef(false);
|
|
33561
33794
|
var pkName = keyExpr && keyExpr.toString();
|
|
33562
33795
|
var fileName = props.exportFileName ? props.exportFileName + moment().format("YYYYMMDD") : "DatagridExportFile" + moment().format("YYYYMMDD");
|
|
33563
|
-
var _useState = React.useState(
|
|
33564
|
-
|
|
33565
|
-
|
|
33566
|
-
var _useState2 = React.useState(
|
|
33567
|
-
|
|
33568
|
-
|
|
33569
|
-
var _useState3 = React.useState(
|
|
33570
|
-
|
|
33571
|
-
|
|
33572
|
-
var _useState4 = React.useState(
|
|
33573
|
-
|
|
33574
|
-
|
|
33575
|
-
var _useState5 = React.useState(
|
|
33576
|
-
|
|
33577
|
-
|
|
33578
|
-
var _useState6 = React.useState(
|
|
33579
|
-
|
|
33580
|
-
|
|
33796
|
+
var _useState = React.useState(false),
|
|
33797
|
+
render = _useState[0],
|
|
33798
|
+
rerender = _useState[1];
|
|
33799
|
+
var _useState2 = React.useState(props.columns),
|
|
33800
|
+
gridColumns = _useState2[0],
|
|
33801
|
+
setGridColumns = _useState2[1];
|
|
33802
|
+
var _useState3 = React.useState(false),
|
|
33803
|
+
loading = _useState3[0],
|
|
33804
|
+
setLoading = _useState3[1];
|
|
33805
|
+
var _useState4 = React.useState([]),
|
|
33806
|
+
data = _useState4[0],
|
|
33807
|
+
setData = _useState4[1];
|
|
33808
|
+
var _useState5 = React.useState(0),
|
|
33809
|
+
filteredRowCount = _useState5[0],
|
|
33810
|
+
setFilteredRowCount = _useState5[1];
|
|
33811
|
+
var _useState6 = React.useState(false),
|
|
33812
|
+
isFastUpdateModalOpen = _useState6[0],
|
|
33813
|
+
setIsFastUpdateModalOpen = _useState6[1];
|
|
33581
33814
|
var _useState7 = React.useState([]),
|
|
33582
|
-
|
|
33583
|
-
|
|
33815
|
+
selectedCells = _useState7[0],
|
|
33816
|
+
setSelectedCells = _useState7[1];
|
|
33584
33817
|
var _useState8 = React.useState([]),
|
|
33585
|
-
|
|
33586
|
-
|
|
33587
|
-
var _useState9 = React.useState(
|
|
33588
|
-
|
|
33589
|
-
|
|
33818
|
+
hoveredCells = _useState8[0],
|
|
33819
|
+
setHoveredCells = _useState8[1];
|
|
33820
|
+
var _useState9 = React.useState([]),
|
|
33821
|
+
ctrlSelectedCells = _useState9[0],
|
|
33822
|
+
setCtrlSelectedCells = _useState9[1];
|
|
33590
33823
|
var _useState10 = React.useState(false),
|
|
33591
|
-
|
|
33592
|
-
|
|
33593
|
-
var _useState11 = React.useState(
|
|
33594
|
-
|
|
33595
|
-
|
|
33824
|
+
ctrlSelection = _useState10[0],
|
|
33825
|
+
setCtrlSelection = _useState10[1];
|
|
33826
|
+
var _useState11 = React.useState(false),
|
|
33827
|
+
contentReady = _useState11[0],
|
|
33828
|
+
setContentReady = _useState11[1];
|
|
33829
|
+
var _useState12 = React.useState(0),
|
|
33830
|
+
scrollPosition = _useState12[0],
|
|
33831
|
+
setScrollPosition = _useState12[1];
|
|
33596
33832
|
React.useEffect(function () {
|
|
33597
33833
|
constants.totalPageCount = 1;
|
|
33598
33834
|
constants.loadedPageCount = 1;
|
|
@@ -33629,6 +33865,9 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
33629
33865
|
setGridColumns(newColumns);
|
|
33630
33866
|
}
|
|
33631
33867
|
}, [props.columns]);
|
|
33868
|
+
React.useEffect(function () {
|
|
33869
|
+
rerender(!render);
|
|
33870
|
+
}, [gridColumns]);
|
|
33632
33871
|
React.useEffect(function () {
|
|
33633
33872
|
if (Array.isArray(props.dataSource)) {
|
|
33634
33873
|
setData(props.dataSource);
|
|
@@ -34587,6 +34826,7 @@ exports.OdsDisplayGrid = OdsDisplayGrid;
|
|
|
34587
34826
|
exports.OdsDivider = OdsDivider;
|
|
34588
34827
|
exports.OdsDropdown = OdsDropdown;
|
|
34589
34828
|
exports.OdsDropdownButton = OdsDropdownButton;
|
|
34829
|
+
exports.OdsFileUpload = OdsFileUpload;
|
|
34590
34830
|
exports.OdsFilter = OdsFilter;
|
|
34591
34831
|
exports.OdsFilterTagView = OdsFilterTagView;
|
|
34592
34832
|
exports.OdsImage = OdsImage;
|