ods-component-lib 1.18.94 → 1.18.96
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.
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { TransferDirection as AntTransferDirection } from 'antd/es/transfer';
|
|
3
|
+
import 'devextreme/dist/css/dx.light.css';
|
|
4
|
+
import './styles.css';
|
|
5
|
+
export interface Column {
|
|
6
|
+
title: string;
|
|
7
|
+
dataIndex: string;
|
|
8
|
+
key?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare type TransferDirection = AntTransferDirection;
|
|
11
|
+
interface IAxiosProps {
|
|
12
|
+
token: string;
|
|
13
|
+
requestData?: any;
|
|
14
|
+
apiUrl: string;
|
|
15
|
+
environmentUrl: string;
|
|
16
|
+
requestQueryString?: any;
|
|
17
|
+
requestType: string;
|
|
18
|
+
}
|
|
19
|
+
interface ISummaryRowOptions {
|
|
20
|
+
summaryLoadedDataLabel?: string;
|
|
21
|
+
summaryTotalDataLabel?: string;
|
|
22
|
+
summaryFilteredDataLabel?: string;
|
|
23
|
+
summaryTotalCount?: number;
|
|
24
|
+
summaryTotalPageCountLabel?: string;
|
|
25
|
+
summarySumLabel?: string;
|
|
26
|
+
summaryAvgLabel?: string;
|
|
27
|
+
summaryMinLabel?: string;
|
|
28
|
+
summaryMaxLabel?: string;
|
|
29
|
+
summaryCountLabel?: string;
|
|
30
|
+
}
|
|
31
|
+
interface OdsTransferProps<RecordType = any> {
|
|
32
|
+
dataSource?: RecordType[];
|
|
33
|
+
language: string;
|
|
34
|
+
pagingEnable?: boolean;
|
|
35
|
+
pageSize?: number;
|
|
36
|
+
isServerSide: boolean;
|
|
37
|
+
axiosRequest?: IAxiosProps;
|
|
38
|
+
customSummary?: ISummaryRowOptions;
|
|
39
|
+
dataGridPageName?: string;
|
|
40
|
+
columns: any[];
|
|
41
|
+
pageTitle?: string;
|
|
42
|
+
keyExpr: string;
|
|
43
|
+
noDataText: string;
|
|
44
|
+
defaultPageSize: number;
|
|
45
|
+
targetKeys?: string[];
|
|
46
|
+
setTargetKeys?: (keys: string[]) => void;
|
|
47
|
+
}
|
|
48
|
+
declare const OdsTransfer: React.FC<OdsTransferProps>;
|
|
49
|
+
export default OdsTransfer;
|
package/dist/index.js
CHANGED
|
@@ -33556,40 +33556,42 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
33556
33556
|
var _AntForm$useForm = antd.Form.useForm(),
|
|
33557
33557
|
fastUpdateForm = _AntForm$useForm[0];
|
|
33558
33558
|
var gridRef = React.useRef(null);
|
|
33559
|
-
var columns = React.useRef(props.columns);
|
|
33560
33559
|
var filterApplied = React.useRef(false);
|
|
33561
33560
|
var pkName = keyExpr && keyExpr.toString();
|
|
33562
33561
|
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
|
-
|
|
33562
|
+
var _useState = React.useState(props.columns),
|
|
33563
|
+
gridColumns = _useState[0],
|
|
33564
|
+
setGridColumns = _useState[1];
|
|
33565
|
+
var _useState2 = React.useState(false),
|
|
33566
|
+
loading = _useState2[0],
|
|
33567
|
+
setLoading = _useState2[1];
|
|
33568
|
+
var _useState3 = React.useState([]),
|
|
33569
|
+
data = _useState3[0],
|
|
33570
|
+
setData = _useState3[1];
|
|
33571
|
+
var _useState4 = React.useState(0),
|
|
33572
|
+
filteredRowCount = _useState4[0],
|
|
33573
|
+
setFilteredRowCount = _useState4[1];
|
|
33574
|
+
var _useState5 = React.useState(false),
|
|
33575
|
+
isFastUpdateModalOpen = _useState5[0],
|
|
33576
|
+
setIsFastUpdateModalOpen = _useState5[1];
|
|
33578
33577
|
var _useState6 = React.useState([]),
|
|
33579
|
-
|
|
33580
|
-
|
|
33578
|
+
selectedCells = _useState6[0],
|
|
33579
|
+
setSelectedCells = _useState6[1];
|
|
33581
33580
|
var _useState7 = React.useState([]),
|
|
33582
|
-
|
|
33583
|
-
|
|
33584
|
-
var _useState8 = React.useState(
|
|
33585
|
-
|
|
33586
|
-
|
|
33581
|
+
hoveredCells = _useState7[0],
|
|
33582
|
+
setHoveredCells = _useState7[1];
|
|
33583
|
+
var _useState8 = React.useState([]),
|
|
33584
|
+
ctrlSelectedCells = _useState8[0],
|
|
33585
|
+
setCtrlSelectedCells = _useState8[1];
|
|
33587
33586
|
var _useState9 = React.useState(false),
|
|
33588
|
-
|
|
33589
|
-
|
|
33590
|
-
var _useState10 = React.useState(
|
|
33591
|
-
|
|
33592
|
-
|
|
33587
|
+
ctrlSelection = _useState9[0],
|
|
33588
|
+
setCtrlSelection = _useState9[1];
|
|
33589
|
+
var _useState10 = React.useState(false),
|
|
33590
|
+
contentReady = _useState10[0],
|
|
33591
|
+
setContentReady = _useState10[1];
|
|
33592
|
+
var _useState11 = React.useState(0),
|
|
33593
|
+
scrollPosition = _useState11[0],
|
|
33594
|
+
setScrollPosition = _useState11[1];
|
|
33593
33595
|
React.useEffect(function () {
|
|
33594
33596
|
constants.totalPageCount = 1;
|
|
33595
33597
|
constants.loadedPageCount = 1;
|
|
@@ -33606,8 +33608,8 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
33606
33608
|
}
|
|
33607
33609
|
}, [(_props$axiosRequest4 = props.axiosRequest) === null || _props$axiosRequest4 === void 0 ? void 0 : _props$axiosRequest4.requestData, (_props$axiosRequest5 = props.axiosRequest) === null || _props$axiosRequest5 === void 0 ? void 0 : _props$axiosRequest5.requestQueryString]);
|
|
33608
33610
|
React.useEffect(function () {
|
|
33609
|
-
if (
|
|
33610
|
-
var newColumns =
|
|
33611
|
+
if (gridColumns !== undefined && gridColumns.length > 0) {
|
|
33612
|
+
var newColumns = gridColumns.map(function (colItem) {
|
|
33611
33613
|
if (colItem.tooltip !== undefined && colItem.tooltip.enable) {
|
|
33612
33614
|
var headerCellRenderr = function headerCellRenderr() {
|
|
33613
33615
|
return React__default.createElement("div", null, React__default.createElement("span", null, colItem.caption), React__default.createElement(antd.Tooltip, {
|
|
@@ -33623,7 +33625,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
33623
33625
|
if (props.isServerSide) colItem.calculateSortValue = String("dummyFieldForPreventClientSideSorting");
|
|
33624
33626
|
return colItem;
|
|
33625
33627
|
});
|
|
33626
|
-
|
|
33628
|
+
setGridColumns(newColumns);
|
|
33627
33629
|
}
|
|
33628
33630
|
}, [props.columns]);
|
|
33629
33631
|
React.useEffect(function () {
|
|
@@ -33947,7 +33949,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
33947
33949
|
caption: filterItem.key
|
|
33948
33950
|
};
|
|
33949
33951
|
});
|
|
33950
|
-
var newColumns = [].concat(
|
|
33952
|
+
var newColumns = [].concat(gridColumns, newColumnFromFilterData);
|
|
33951
33953
|
e.component.beginUpdate();
|
|
33952
33954
|
e.component.option("columns", newColumns);
|
|
33953
33955
|
e.component.endUpdate();
|
|
@@ -34424,7 +34426,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
34424
34426
|
onCellPrepared: onCustomCellPrepared,
|
|
34425
34427
|
onOptionChanged: props.onOptionChanged,
|
|
34426
34428
|
onToolbarPreparing: props.onToolbarPreparing || onToolbarPreparing
|
|
34427
|
-
},
|
|
34429
|
+
}, gridColumns.map(function (col) {
|
|
34428
34430
|
return React__default.createElement(DataGrid.Column, Object.assign({
|
|
34429
34431
|
key: col.dataField
|
|
34430
34432
|
}, col, {
|
|
@@ -34551,10 +34553,10 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
34551
34553
|
}, fastUpdateButtonText != null ? fastUpdateButtonText : "Fast Update"))), React__default.createElement(DataGrid.Summary, {
|
|
34552
34554
|
calculateCustomSummary: renderTotal
|
|
34553
34555
|
}, React__default.createElement(DataGrid.TotalItem, {
|
|
34554
|
-
column:
|
|
34556
|
+
column: gridColumns[0].dataField,
|
|
34555
34557
|
summaryType: "custom",
|
|
34556
34558
|
displayFormat: renderTotal()
|
|
34557
|
-
}), gridRef.current && showSummaryItems(props) && getSummaryItems(props,
|
|
34559
|
+
}), gridRef.current && showSummaryItems(props) && getSummaryItems(props, gridColumns, gridRef.current.instance).map(function (item, _index) {
|
|
34558
34560
|
return item;
|
|
34559
34561
|
})), React__default.createElement(DataGrid.StateStoring, {
|
|
34560
34562
|
enabled: true,
|