ods-component-lib 1.18.102 → 1.18.103
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/devextreme/OdsBasicDataGrid/OdsBasicDataGrid.Constant.d.ts +17 -0
- package/dist/components/devextreme/OdsBasicDataGrid/OdsBasicDataGrid.Constants.d.ts +17 -0
- package/dist/components/devextreme/OdsBasicDataGrid/OdsBasicDataGrid.Functions.d.ts +11 -0
- package/dist/components/devextreme/OdsBasicDataGrid/OdsBasicDataGrid.Types.d.ts +99 -0
- package/dist/components/devextreme/OdsBasicDataGrid/OdsBasicDataGrid.d.ts +5 -0
- package/dist/index.css +23 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1162 -36
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1163 -38
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/antd/form/OdsBasicForm.d.ts +0 -18
- package/dist/components/antd/icon/OdsIcon.d.ts +0 -10
- package/dist/components/antd/modal/OdsAdvanceModal.d.ts +0 -7
- package/dist/components/antd/select/OdsCustomMultiSelect.d.ts +0 -7
- package/dist/components/antd/select/OdsMultiSelect.d.ts +0 -9
- package/dist/components/custom/OdsLogin.d.ts +0 -8
- package/dist/components/devextreme/DxDataPopupForm.d.ts +0 -3
- package/dist/components/devextreme/DynamicIcon.d.ts +0 -5
- package/dist/components/devextreme/OdsDataGridNew.d.ts +0 -56
- package/dist/components/devextreme/OdsProfDataGrid.d.ts +0 -3
- package/dist/components/devextreme/treeview/DxTreeView.d.ts +0 -3
- package/dist/stories/OdsAdvanceModal/OdsAdvanceModal.stories.d.ts +0 -42
- package/dist/stories/OdsAdvanceModal/Samples/BasicOdsAdvanceModal.sample.d.ts +0 -8
- package/dist/stories/OdsCustomMultiSelect/OdsCustomMultiSelect.stories.d.ts +0 -9
- package/dist/stories/OdsCustomMultiSelect/Samples/Basic.Sample.d.ts +0 -1
- package/dist/stories/OdsCustomMultiSelect/Samples/ModeMultiple.Sample.d.ts +0 -1
- package/dist/stories/OdsModal/Samples/OdsModal.Sample.d.ts +0 -1
- package/dist/stories/OdsTimePicker/Samples/TimeRangePicker.d.ts +0 -2
- package/dist/utils/DynamicIcon.d.ts +0 -5
package/dist/index.js
CHANGED
|
@@ -33633,27 +33633,6 @@ var queryString = {
|
|
|
33633
33633
|
stringify: stringify
|
|
33634
33634
|
};
|
|
33635
33635
|
|
|
33636
|
-
var iconComponents = {
|
|
33637
|
-
edit: outline.EditIcon,
|
|
33638
|
-
"delete": outline.Trash1Icon,
|
|
33639
|
-
copy: outline.CopyIcon,
|
|
33640
|
-
discount: outline.DiscountIcon,
|
|
33641
|
-
kebabMenu: outline.KebabMenuIcon,
|
|
33642
|
-
refresh: outline.RefreshIcon,
|
|
33643
|
-
unmap: outline.LinkBreakIcon,
|
|
33644
|
-
save: outline.FloppyDiskIcon,
|
|
33645
|
-
cancel: outline.Loop1Icon,
|
|
33646
|
-
discount2Icon: outline.Discount2Icon
|
|
33647
|
-
};
|
|
33648
|
-
var DynamicIcon = function DynamicIcon(_ref) {
|
|
33649
|
-
var iconName = _ref.iconName;
|
|
33650
|
-
var IconComponent = iconComponents[iconName];
|
|
33651
|
-
if (!IconComponent) {
|
|
33652
|
-
return null;
|
|
33653
|
-
}
|
|
33654
|
-
return React__default.createElement(IconComponent, null);
|
|
33655
|
-
};
|
|
33656
|
-
|
|
33657
33636
|
var _excluded$4 = ["children", "visible"];
|
|
33658
33637
|
function OdsDataGrdiRowButton(_ref) {
|
|
33659
33638
|
var children = _ref.children,
|
|
@@ -33770,7 +33749,7 @@ var onCancelEditEvent = new CustomEvent("cancelEdit", {
|
|
|
33770
33749
|
});
|
|
33771
33750
|
|
|
33772
33751
|
var useToken$2 = antd.theme.useToken;
|
|
33773
|
-
var
|
|
33752
|
+
var OdsBasicDataGrid = function OdsBasicDataGrid(props) {
|
|
33774
33753
|
var _props$axiosRequest4, _props$axiosRequest5, _props$axiosRequest6, _props$axiosRequest7, _props$axiosRequest8, _props$axiosRequest9, _props$axiosRequest10, _props$axiosRequest11, _props$selectOptions, _props$selectOptions$, _props$selectOptions2, _props$selectOptions$2, _props$selectOptions3;
|
|
33775
33754
|
var keyExpr = props.keyExpr,
|
|
33776
33755
|
hasFastUpdate = props.hasFastUpdate,
|
|
@@ -33888,7 +33867,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
33888
33867
|
if (contentReady) checkSortingPropertyForInitilaize();
|
|
33889
33868
|
}, [contentReady]);
|
|
33890
33869
|
React.useEffect(function () {
|
|
33891
|
-
var cssRules = "\n
|
|
33870
|
+
var cssRules = "\n .data-exists .dx-datagrid-borders > .dx-datagrid-filter-panel,\n .data-exists .dx-datagrid-borders > .dx-datagrid-headers {\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n padding-right: 0px !important;\n }\n \n .data-exists .dx-datagrid-headers .dx-datagrid-content {\n margin-bottom: -1px;\n padding-right: 17px !important;\n }\n ";
|
|
33892
33871
|
var styleSheet = document.createElement("style");
|
|
33893
33872
|
styleSheet.type = "text/css";
|
|
33894
33873
|
styleSheet.innerText = cssRules;
|
|
@@ -34309,9 +34288,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
34309
34288
|
function actionCellRender(cellData, props) {
|
|
34310
34289
|
var kebabMenuButtons = props.actionButtonGroup && props.actionButtonGroup.length >= 2 && !props.edit ? props.actionButtonGroup.slice(2).map(function (button) {
|
|
34311
34290
|
return {
|
|
34312
|
-
icon:
|
|
34313
|
-
iconName: button.icon
|
|
34314
|
-
}),
|
|
34291
|
+
icon: button.icon,
|
|
34315
34292
|
onClick: function onClick(event) {
|
|
34316
34293
|
var customEvent = {
|
|
34317
34294
|
column: cellData.column,
|
|
@@ -34340,9 +34317,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
34340
34317
|
size: "small",
|
|
34341
34318
|
type: "text",
|
|
34342
34319
|
disabled: buttonItem.actionPermission === undefined ? false : !buttonItem.actionPermission,
|
|
34343
|
-
icon:
|
|
34344
|
-
iconName: buttonItem.icon
|
|
34345
|
-
}),
|
|
34320
|
+
icon: buttonItem.icon,
|
|
34346
34321
|
onClick: function onClick(event) {
|
|
34347
34322
|
var customEvent = {
|
|
34348
34323
|
column: cellData.column,
|
|
@@ -34372,9 +34347,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
34372
34347
|
size: "small",
|
|
34373
34348
|
type: "text",
|
|
34374
34349
|
disabled: buttonItem.actionPermission === undefined ? false : !buttonItem.actionPermission,
|
|
34375
|
-
icon:
|
|
34376
|
-
iconName: buttonItem.icon
|
|
34377
|
-
}),
|
|
34350
|
+
icon: buttonItem.icon,
|
|
34378
34351
|
onClick: function onClick(event) {
|
|
34379
34352
|
if (buttonItem.onClick) {
|
|
34380
34353
|
var customEvent = {
|
|
@@ -34397,9 +34370,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
34397
34370
|
menuItems: kebabMenuButtons
|
|
34398
34371
|
}, React__default.createElement(OdsDataGrdiRowButton, {
|
|
34399
34372
|
type: "text",
|
|
34400
|
-
icon: React__default.createElement(
|
|
34401
|
-
iconName: "kebabMenu"
|
|
34402
|
-
})
|
|
34373
|
+
icon: React__default.createElement(outline.KebabMenuIcon, null)
|
|
34403
34374
|
})));
|
|
34404
34375
|
}
|
|
34405
34376
|
return React__default.createElement(React__default.Fragment, null, buttonElements);
|
|
@@ -34572,7 +34543,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
34572
34543
|
};
|
|
34573
34544
|
var detailGrid = function detailGrid(_ref) {
|
|
34574
34545
|
var data = _ref.data;
|
|
34575
|
-
return React__default.createElement(
|
|
34546
|
+
return React__default.createElement(OdsBasicDataGrid, Object.assign({}, props, {
|
|
34576
34547
|
showMasterDetail: false,
|
|
34577
34548
|
columns: props.detailGridColums,
|
|
34578
34549
|
dataSource: props.detailData[data.key.ID]
|
|
@@ -34806,12 +34777,1167 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
34806
34777
|
})));
|
|
34807
34778
|
};
|
|
34808
34779
|
|
|
34780
|
+
var iconComponents = {
|
|
34781
|
+
edit: outline.EditIcon,
|
|
34782
|
+
"delete": outline.Trash1Icon,
|
|
34783
|
+
copy: outline.CopyIcon,
|
|
34784
|
+
discount: outline.DiscountIcon,
|
|
34785
|
+
kebabMenu: outline.KebabMenuIcon,
|
|
34786
|
+
refresh: outline.RefreshIcon,
|
|
34787
|
+
unmap: outline.LinkBreakIcon,
|
|
34788
|
+
save: outline.FloppyDiskIcon,
|
|
34789
|
+
cancel: outline.Loop1Icon,
|
|
34790
|
+
discount2Icon: outline.Discount2Icon
|
|
34791
|
+
};
|
|
34792
|
+
var DynamicIcon = function DynamicIcon(_ref) {
|
|
34793
|
+
var iconName = _ref.iconName;
|
|
34794
|
+
var IconComponent = iconComponents[iconName];
|
|
34795
|
+
if (!IconComponent) {
|
|
34796
|
+
return null;
|
|
34797
|
+
}
|
|
34798
|
+
return React__default.createElement(IconComponent, null);
|
|
34799
|
+
};
|
|
34800
|
+
|
|
34801
|
+
var checkCellSelectionConstraints$1 = function checkCellSelectionConstraints(e) {
|
|
34802
|
+
return e.rowType == "data" && e.columnIndex > -1 && e.rowIndex > -1;
|
|
34803
|
+
};
|
|
34804
|
+
var cellAlreadySelected$1 = function cellAlreadySelected(pkValue, dataField, cellInfos) {
|
|
34805
|
+
return cellInfos.some(function (cell) {
|
|
34806
|
+
return cell.pkValue == pkValue && cell.dataField == dataField;
|
|
34807
|
+
});
|
|
34808
|
+
};
|
|
34809
|
+
var getRequestHeaders$1 = function getRequestHeaders(props) {
|
|
34810
|
+
return new Headers({
|
|
34811
|
+
"Content-Type": "application/json",
|
|
34812
|
+
Authorization: "Bearer " + (props.axiosRequest ? props.axiosRequest.token : ""),
|
|
34813
|
+
"Accept-Language": props.language != "" ? props.language : "EN"
|
|
34814
|
+
});
|
|
34815
|
+
};
|
|
34816
|
+
var concatFilteredLabel$1 = function concatFilteredLabel(result, totalloaded, filteredRowCount, filterApplied, props) {
|
|
34817
|
+
if (filteredRowCount > 0 && totalloaded !== filteredRowCount && filterApplied) {
|
|
34818
|
+
var filteredLabel = filteredRowCount + " " + props.customSummary.summaryFilteredDataLabel + "- ";
|
|
34819
|
+
result = filteredLabel + " " + result + " ";
|
|
34820
|
+
}
|
|
34821
|
+
return result;
|
|
34822
|
+
};
|
|
34823
|
+
var showSummaryItems$1 = function showSummaryItems(props) {
|
|
34824
|
+
var _props$customSummary, _props$customSummary2, _props$customSummary3, _props$customSummary4, _props$customSummary5;
|
|
34825
|
+
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);
|
|
34826
|
+
};
|
|
34827
|
+
var getSummaryItems$1 = function getSummaryItems(props, columns, grid, isMultiLevelColumn) {
|
|
34828
|
+
if (isMultiLevelColumn === void 0) {
|
|
34829
|
+
isMultiLevelColumn = false;
|
|
34830
|
+
}
|
|
34831
|
+
var totalItems = [];
|
|
34832
|
+
columns.map(function (col, _index) {
|
|
34833
|
+
if (col.multiLevelColumns && col.multiLevelColumns.length > 0) {
|
|
34834
|
+
totalItems = [].concat(totalItems, getSummaryItems(props, col.multiLevelColumns, grid, true));
|
|
34835
|
+
} else {
|
|
34836
|
+
var _props$customSummary6, _props$customSummary7, _props$customSummary8, _props$customSummary9, _props$customSummary10, _props$customSummary11, _props$customSummary12, _props$customSummary13, _props$customSummary14, _props$customSummary15;
|
|
34837
|
+
var colOption = grid.columnOption(col.dataField);
|
|
34838
|
+
if (!colOption) {
|
|
34839
|
+
return col;
|
|
34840
|
+
}
|
|
34841
|
+
((_props$customSummary6 = props.customSummary) === null || _props$customSummary6 === void 0 ? void 0 : _props$customSummary6.showAvgInSummary) && totalItems.push(getSummaryItem$1(col, colOption.visibleIndex, "avg", isMultiLevelColumn, (_props$customSummary7 = props.customSummary) === null || _props$customSummary7 === void 0 ? void 0 : _props$customSummary7.summaryAvgLabel));
|
|
34842
|
+
((_props$customSummary8 = props.customSummary) === null || _props$customSummary8 === void 0 ? void 0 : _props$customSummary8.showCountInSummary) && totalItems.push(getSummaryItem$1(col, colOption.visibleIndex, "count", isMultiLevelColumn, (_props$customSummary9 = props.customSummary) === null || _props$customSummary9 === void 0 ? void 0 : _props$customSummary9.summaryCountLabel));
|
|
34843
|
+
((_props$customSummary10 = props.customSummary) === null || _props$customSummary10 === void 0 ? void 0 : _props$customSummary10.showMaxInSummary) && totalItems.push(getSummaryItem$1(col, colOption.visibleIndex, "max", isMultiLevelColumn, (_props$customSummary11 = props.customSummary) === null || _props$customSummary11 === void 0 ? void 0 : _props$customSummary11.summaryMaxLabel));
|
|
34844
|
+
((_props$customSummary12 = props.customSummary) === null || _props$customSummary12 === void 0 ? void 0 : _props$customSummary12.showMinInSummary) && totalItems.push(getSummaryItem$1(col, colOption.visibleIndex, "min", isMultiLevelColumn, (_props$customSummary13 = props.customSummary) === null || _props$customSummary13 === void 0 ? void 0 : _props$customSummary13.summaryMinLabel));
|
|
34845
|
+
((_props$customSummary14 = props.customSummary) === null || _props$customSummary14 === void 0 ? void 0 : _props$customSummary14.showSumInSummary) && totalItems.push(getSummaryItem$1(col, colOption.visibleIndex, "sum", isMultiLevelColumn, (_props$customSummary15 = props.customSummary) === null || _props$customSummary15 === void 0 ? void 0 : _props$customSummary15.summarySumLabel));
|
|
34846
|
+
}
|
|
34847
|
+
return col;
|
|
34848
|
+
});
|
|
34849
|
+
return totalItems;
|
|
34850
|
+
};
|
|
34851
|
+
var getSummaryItem$1 = function getSummaryItem(col, visibleIndex, summaryType, isMultiLevelColumn, label) {
|
|
34852
|
+
if (!isMultiLevelColumn && visibleIndex == 0) {
|
|
34853
|
+
return React__default.createElement(DataGrid.TotalItem, {
|
|
34854
|
+
column: col.dataField,
|
|
34855
|
+
summaryType: "custom",
|
|
34856
|
+
cssClass: "grid-summary-row-label",
|
|
34857
|
+
customizeText: function customizeText(_itemInfo) {
|
|
34858
|
+
return label;
|
|
34859
|
+
}
|
|
34860
|
+
});
|
|
34861
|
+
}
|
|
34862
|
+
if (col.dataType != "number") {
|
|
34863
|
+
return React__default.createElement("div", null);
|
|
34864
|
+
}
|
|
34865
|
+
return React__default.createElement(DataGrid.TotalItem, {
|
|
34866
|
+
column: col.dataField,
|
|
34867
|
+
summaryType: summaryType,
|
|
34868
|
+
cssClass: "grid-summary-row-data",
|
|
34869
|
+
customizeText: function customizeText(itemInfo) {
|
|
34870
|
+
return Number(itemInfo.value).toFixed(2);
|
|
34871
|
+
}
|
|
34872
|
+
});
|
|
34873
|
+
};
|
|
34874
|
+
var getMultiLevelColumns$1 = function getMultiLevelColumns(col) {
|
|
34875
|
+
return col.multiLevelColumns && col.multiLevelColumns.map(function (colItem) {
|
|
34876
|
+
return React__default.createElement(DataGrid.Column, Object.assign({
|
|
34877
|
+
width: 80
|
|
34878
|
+
}, colItem), getMultiLevelColumns(colItem));
|
|
34879
|
+
});
|
|
34880
|
+
};
|
|
34881
|
+
|
|
34882
|
+
var constants$1 = {
|
|
34883
|
+
totalPageCount: 1,
|
|
34884
|
+
loadedPageCount: 1,
|
|
34885
|
+
totalRecordCount: 0,
|
|
34886
|
+
exportFormats: ["xlsx"],
|
|
34887
|
+
selectedCellBgColor: "#c1f9b8",
|
|
34888
|
+
allowedDataTypesForMultiCellEditing: ["number"]
|
|
34889
|
+
};
|
|
34890
|
+
var onCancelEditEvent$1 = new CustomEvent("cancelEdit", {
|
|
34891
|
+
bubbles: true,
|
|
34892
|
+
detail: {
|
|
34893
|
+
rowData: null
|
|
34894
|
+
}
|
|
34895
|
+
});
|
|
34896
|
+
|
|
34897
|
+
var useToken$3 = antd.theme.useToken;
|
|
34898
|
+
var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
34899
|
+
var _props$axiosRequest4, _props$axiosRequest5, _props$axiosRequest6, _props$axiosRequest7, _props$axiosRequest8, _props$axiosRequest9, _props$axiosRequest10, _props$axiosRequest11, _props$selectOptions, _props$selectOptions$, _props$selectOptions2, _props$selectOptions$2, _props$selectOptions3;
|
|
34900
|
+
var keyExpr = props.keyExpr,
|
|
34901
|
+
hasFastUpdate = props.hasFastUpdate,
|
|
34902
|
+
fastUpdateButtonText = props.fastUpdateButtonText,
|
|
34903
|
+
fastUpdateModalTitle = props.fastUpdateModalTitle,
|
|
34904
|
+
fastUpdateModalCancelText = props.fastUpdateModalCancelText,
|
|
34905
|
+
fastUpdateModalSaveText = props.fastUpdateModalSaveText,
|
|
34906
|
+
fastUpdateFormRequiredFieldMessage = props.fastUpdateFormRequiredFieldMessage,
|
|
34907
|
+
onCellClick = props.onCellClick,
|
|
34908
|
+
onCellHoverChanged = props.onCellHoverChanged,
|
|
34909
|
+
onFastUpdateButtonClick = props.onFastUpdateButtonClick,
|
|
34910
|
+
onFastUpdateFinish = props.onFastUpdateFinish,
|
|
34911
|
+
onFastUpdateCancel = props.onFastUpdateCancel,
|
|
34912
|
+
onFastUpdateFailed = props.onFastUpdateFailed;
|
|
34913
|
+
var _useToken = useToken$3(),
|
|
34914
|
+
token = _useToken.token;
|
|
34915
|
+
var _AntForm$useForm = antd.Form.useForm(),
|
|
34916
|
+
fastUpdateForm = _AntForm$useForm[0];
|
|
34917
|
+
var gridRef = React.useRef(null);
|
|
34918
|
+
var filterApplied = React.useRef(false);
|
|
34919
|
+
var pkName = keyExpr && keyExpr.toString();
|
|
34920
|
+
var fileName = props.exportFileName ? props.exportFileName + moment().format("YYYYMMDD") : "DatagridExportFile" + moment().format("YYYYMMDD");
|
|
34921
|
+
var _useState = React.useState(false),
|
|
34922
|
+
render = _useState[0],
|
|
34923
|
+
rerender = _useState[1];
|
|
34924
|
+
var _useState2 = React.useState(props.columns),
|
|
34925
|
+
gridColumns = _useState2[0],
|
|
34926
|
+
setGridColumns = _useState2[1];
|
|
34927
|
+
var _useState3 = React.useState(false),
|
|
34928
|
+
loading = _useState3[0],
|
|
34929
|
+
setLoading = _useState3[1];
|
|
34930
|
+
var _useState4 = React.useState([]),
|
|
34931
|
+
data = _useState4[0],
|
|
34932
|
+
setData = _useState4[1];
|
|
34933
|
+
var _useState5 = React.useState(0),
|
|
34934
|
+
filteredRowCount = _useState5[0],
|
|
34935
|
+
setFilteredRowCount = _useState5[1];
|
|
34936
|
+
var _useState6 = React.useState(false),
|
|
34937
|
+
isFastUpdateModalOpen = _useState6[0],
|
|
34938
|
+
setIsFastUpdateModalOpen = _useState6[1];
|
|
34939
|
+
var _useState7 = React.useState([]),
|
|
34940
|
+
selectedCells = _useState7[0],
|
|
34941
|
+
setSelectedCells = _useState7[1];
|
|
34942
|
+
var _useState8 = React.useState([]),
|
|
34943
|
+
hoveredCells = _useState8[0],
|
|
34944
|
+
setHoveredCells = _useState8[1];
|
|
34945
|
+
var _useState9 = React.useState([]),
|
|
34946
|
+
ctrlSelectedCells = _useState9[0],
|
|
34947
|
+
setCtrlSelectedCells = _useState9[1];
|
|
34948
|
+
var _useState10 = React.useState(false),
|
|
34949
|
+
ctrlSelection = _useState10[0],
|
|
34950
|
+
setCtrlSelection = _useState10[1];
|
|
34951
|
+
var _useState11 = React.useState(false),
|
|
34952
|
+
contentReady = _useState11[0],
|
|
34953
|
+
setContentReady = _useState11[1];
|
|
34954
|
+
var _useState12 = React.useState(0),
|
|
34955
|
+
scrollPosition = _useState12[0],
|
|
34956
|
+
setScrollPosition = _useState12[1];
|
|
34957
|
+
React.useEffect(function () {
|
|
34958
|
+
constants$1.totalPageCount = 1;
|
|
34959
|
+
constants$1.loadedPageCount = 1;
|
|
34960
|
+
constants$1.totalRecordCount = 0;
|
|
34961
|
+
}, [props.dataGridPageName]);
|
|
34962
|
+
React.useEffect(function () {
|
|
34963
|
+
var _props$axiosRequest, _props$axiosRequest2, _props$axiosRequest3;
|
|
34964
|
+
if (props.axiosRequest !== undefined && ((_props$axiosRequest = props.axiosRequest) !== null && _props$axiosRequest !== void 0 && _props$axiosRequest.requestData && Object.keys((_props$axiosRequest2 = props.axiosRequest) === null || _props$axiosRequest2 === void 0 ? void 0 : _props$axiosRequest2.requestData).length > 0 || (_props$axiosRequest3 = props.axiosRequest) !== null && _props$axiosRequest3 !== void 0 && _props$axiosRequest3.requestQueryString)) {
|
|
34965
|
+
constants$1.totalPageCount = 1;
|
|
34966
|
+
constants$1.loadedPageCount = 1;
|
|
34967
|
+
constants$1.totalRecordCount = 0;
|
|
34968
|
+
setData([]);
|
|
34969
|
+
fetchData();
|
|
34970
|
+
}
|
|
34971
|
+
}, [(_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]);
|
|
34972
|
+
React.useEffect(function () {
|
|
34973
|
+
if (props.columns !== undefined && props.columns.length > 0) {
|
|
34974
|
+
var newColumns = props.columns.map(function (colItem) {
|
|
34975
|
+
if (colItem.tooltip !== undefined && colItem.tooltip.enable) {
|
|
34976
|
+
var headerCellRenderr = function headerCellRenderr() {
|
|
34977
|
+
return React__default.createElement("div", null, React__default.createElement("span", null, colItem.caption), React__default.createElement(antd.Tooltip, {
|
|
34978
|
+
title: colItem.tooltip.title
|
|
34979
|
+
}, React__default.createElement(icons.InfoCircleOutlined, {
|
|
34980
|
+
style: {
|
|
34981
|
+
marginLeft: 5
|
|
34982
|
+
}
|
|
34983
|
+
})));
|
|
34984
|
+
};
|
|
34985
|
+
colItem.headerCellRender = headerCellRenderr;
|
|
34986
|
+
}
|
|
34987
|
+
if (props.isServerSide) colItem.calculateSortValue = String("dummyFieldForPreventClientSideSorting");
|
|
34988
|
+
return colItem;
|
|
34989
|
+
});
|
|
34990
|
+
setGridColumns(newColumns);
|
|
34991
|
+
}
|
|
34992
|
+
}, [props.columns]);
|
|
34993
|
+
React.useEffect(function () {
|
|
34994
|
+
rerender(!render);
|
|
34995
|
+
}, [gridColumns]);
|
|
34996
|
+
React.useEffect(function () {
|
|
34997
|
+
if (Array.isArray(props.dataSource)) {
|
|
34998
|
+
setData(props.dataSource);
|
|
34999
|
+
}
|
|
35000
|
+
}, [props.dataSource]);
|
|
35001
|
+
React.useEffect(function () {
|
|
35002
|
+
localization.locale(localStorage.getItem("locale"));
|
|
35003
|
+
localization.loadMessages(JSON.parse(localStorage.getItem("localTranslation")));
|
|
35004
|
+
if (gridRef.current) {
|
|
35005
|
+
gridRef.current.instance.updateDimensions();
|
|
35006
|
+
}
|
|
35007
|
+
hasFastUpdate && document.addEventListener("keydown", keydownEvent);
|
|
35008
|
+
return function () {
|
|
35009
|
+
hasFastUpdate && document.removeEventListener("keydown", keydownEvent);
|
|
35010
|
+
};
|
|
35011
|
+
}, []);
|
|
35012
|
+
React.useEffect(function () {
|
|
35013
|
+
if (contentReady) checkSortingPropertyForInitilaize();
|
|
35014
|
+
}, [contentReady]);
|
|
35015
|
+
React.useEffect(function () {
|
|
35016
|
+
var cssRules = "\n .data-exists .dx-datagrid-borders > .dx-datagrid-filter-panel,\n .data-exists .dx-datagrid-borders > .dx-datagrid-headers {\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n padding-right: 0px !important;\n }\n \n .data-exists .dx-datagrid-headers .dx-datagrid-content {\n margin-bottom: -1px;\n padding-right: 17px !important;\n }\n ";
|
|
35017
|
+
var styleSheet = document.createElement("style");
|
|
35018
|
+
styleSheet.type = "text/css";
|
|
35019
|
+
styleSheet.innerText = cssRules;
|
|
35020
|
+
document.head.appendChild(styleSheet);
|
|
35021
|
+
var checkData = function checkData() {
|
|
35022
|
+
if (gridRef.current) {
|
|
35023
|
+
var _dataGridInstance = gridRef.current.instance;
|
|
35024
|
+
var dataExists = data.length >= 15;
|
|
35025
|
+
var gridElement = _dataGridInstance.element();
|
|
35026
|
+
if (dataExists) {
|
|
35027
|
+
gridElement.classList.add("data-exists");
|
|
35028
|
+
} else {
|
|
35029
|
+
gridElement.classList.remove("data-exists");
|
|
35030
|
+
}
|
|
35031
|
+
}
|
|
35032
|
+
};
|
|
35033
|
+
var dataGridInstance = gridRef.current.instance;
|
|
35034
|
+
dataGridInstance.on("dataChanged", checkData);
|
|
35035
|
+
checkData();
|
|
35036
|
+
return function () {
|
|
35037
|
+
document.head.removeChild(styleSheet);
|
|
35038
|
+
dataGridInstance.off("dataChanged", checkData);
|
|
35039
|
+
};
|
|
35040
|
+
}, [data]);
|
|
35041
|
+
var checkSortingPropertyForInitilaize = function checkSortingPropertyForInitilaize() {
|
|
35042
|
+
var onOptionChanged = props.onOptionChanged;
|
|
35043
|
+
if (onOptionChanged) {
|
|
35044
|
+
var dataGridInstance = gridRef.current.instance;
|
|
35045
|
+
var sortingState = dataGridInstance.getVisibleColumns().filter(function (p) {
|
|
35046
|
+
return !p.command;
|
|
35047
|
+
}).map(function (column, index) {
|
|
35048
|
+
return {
|
|
35049
|
+
index: index,
|
|
35050
|
+
dataField: column.dataField,
|
|
35051
|
+
sortOrder: column.sortOrder
|
|
35052
|
+
};
|
|
35053
|
+
});
|
|
35054
|
+
var sortedColumn = sortingState.find(function (column) {
|
|
35055
|
+
return column.sortOrder !== undefined;
|
|
35056
|
+
});
|
|
35057
|
+
if (sortedColumn) {
|
|
35058
|
+
if (sortedColumn.sortOrder) {
|
|
35059
|
+
dataGridInstance.option("columns[" + sortedColumn.index + "].sortOrder", sortedColumn.sortOrder);
|
|
35060
|
+
var fullName = "columns[" + sortedColumn.index + "].sortOrder";
|
|
35061
|
+
var gridEvent = {
|
|
35062
|
+
component: dataGridInstance,
|
|
35063
|
+
fullName: fullName,
|
|
35064
|
+
name: "optionChanged",
|
|
35065
|
+
value: sortedColumn.sortOrder,
|
|
35066
|
+
previousValue: null,
|
|
35067
|
+
element: null
|
|
35068
|
+
};
|
|
35069
|
+
onOptionChanged(gridEvent);
|
|
35070
|
+
}
|
|
35071
|
+
}
|
|
35072
|
+
}
|
|
35073
|
+
};
|
|
35074
|
+
var checkRequestDataHasOnlySortingProperty = function checkRequestDataHasOnlySortingProperty(obj) {
|
|
35075
|
+
var keys = Object.keys(obj);
|
|
35076
|
+
return keys.length === 1 && keys[0] === "Sorting";
|
|
35077
|
+
};
|
|
35078
|
+
React.useEffect(function () {
|
|
35079
|
+
var gridElement = gridRef.current.instance.element();
|
|
35080
|
+
gridElement.scrollTop = scrollPosition;
|
|
35081
|
+
document.querySelectorAll(".dx-scrollable-container").forEach(function (container) {
|
|
35082
|
+
container.addEventListener("scrollend", handleScroll);
|
|
35083
|
+
});
|
|
35084
|
+
return function () {
|
|
35085
|
+
document.querySelectorAll(".dx-scrollable-container").forEach(function (container) {
|
|
35086
|
+
container.removeEventListener("scrollend", handleScroll);
|
|
35087
|
+
});
|
|
35088
|
+
};
|
|
35089
|
+
}, [data.length]);
|
|
35090
|
+
var keydownEvent = function keydownEvent(e) {
|
|
35091
|
+
switch (e.key) {
|
|
35092
|
+
case "Escape":
|
|
35093
|
+
{
|
|
35094
|
+
clearSelectedCells();
|
|
35095
|
+
}
|
|
35096
|
+
break;
|
|
35097
|
+
}
|
|
35098
|
+
};
|
|
35099
|
+
var clearSelectedCells = function clearSelectedCells() {
|
|
35100
|
+
setSelectedCells([]);
|
|
35101
|
+
};
|
|
35102
|
+
var singleSelect = function singleSelect(pkValue, dataField) {
|
|
35103
|
+
runSetSelectedCells([{
|
|
35104
|
+
dataField: dataField,
|
|
35105
|
+
pkValue: pkValue
|
|
35106
|
+
}]);
|
|
35107
|
+
};
|
|
35108
|
+
var multipleSelect = function multipleSelect(cells) {
|
|
35109
|
+
if (cells.length == 0) {
|
|
35110
|
+
return;
|
|
35111
|
+
}
|
|
35112
|
+
var _cells = [];
|
|
35113
|
+
var _loop = function _loop() {
|
|
35114
|
+
var element = cells[index];
|
|
35115
|
+
if (!_cells.some(function (cell) {
|
|
35116
|
+
return cell.colIndex == element.colIndex && cell.rowIndex == element.rowIndex;
|
|
35117
|
+
})) {
|
|
35118
|
+
_cells.push({
|
|
35119
|
+
colIndex: element.colIndex,
|
|
35120
|
+
rowIndex: element.rowIndex
|
|
35121
|
+
});
|
|
35122
|
+
}
|
|
35123
|
+
};
|
|
35124
|
+
for (var index = 0; index < cells.length; index++) {
|
|
35125
|
+
_loop();
|
|
35126
|
+
}
|
|
35127
|
+
var result = [];
|
|
35128
|
+
var maxColIndex = Math.max.apply(null, _cells.map(function (item) {
|
|
35129
|
+
return item.colIndex;
|
|
35130
|
+
}));
|
|
35131
|
+
var minColIndex = Math.min.apply(null, _cells.map(function (item) {
|
|
35132
|
+
return item.colIndex;
|
|
35133
|
+
}));
|
|
35134
|
+
var maxRowIndex = Math.max.apply(null, _cells.map(function (item) {
|
|
35135
|
+
return item.rowIndex;
|
|
35136
|
+
}));
|
|
35137
|
+
var minRowIndex = Math.min.apply(null, _cells.map(function (item) {
|
|
35138
|
+
return item.rowIndex;
|
|
35139
|
+
}));
|
|
35140
|
+
for (var rowIndex = minRowIndex; rowIndex <= maxRowIndex; rowIndex++) {
|
|
35141
|
+
var _loop2 = function _loop2() {
|
|
35142
|
+
var _column = gridRef.current.instance.columnOption(colIndex);
|
|
35143
|
+
if (constants$1.allowedDataTypesForMultiCellEditing.some(function (item) {
|
|
35144
|
+
return item.toLocaleLowerCase() == _column.dataType.toLocaleLowerCase();
|
|
35145
|
+
})) {
|
|
35146
|
+
result.push({
|
|
35147
|
+
dataField: _column.dataField,
|
|
35148
|
+
pkValue: gridRef.current.instance.cellValue(rowIndex, pkName)
|
|
35149
|
+
});
|
|
35150
|
+
}
|
|
35151
|
+
};
|
|
35152
|
+
for (var colIndex = minColIndex; colIndex <= maxColIndex; colIndex++) {
|
|
35153
|
+
_loop2();
|
|
35154
|
+
}
|
|
35155
|
+
}
|
|
35156
|
+
runSetSelectedCells(result);
|
|
35157
|
+
setHoveredCells([]);
|
|
35158
|
+
setCtrlSelectedCells([]);
|
|
35159
|
+
};
|
|
35160
|
+
var runSetSelectedCells = function runSetSelectedCells(value) {
|
|
35161
|
+
var removeDuplicates = function removeDuplicates(oldValues) {
|
|
35162
|
+
var result = [];
|
|
35163
|
+
var _loop3 = function _loop3() {
|
|
35164
|
+
var element = value[index];
|
|
35165
|
+
if (element.pkValue && !oldValues.some(function (cell) {
|
|
35166
|
+
return cell.dataField == element.dataField && cell.pkValue == element.pkValue;
|
|
35167
|
+
})) {
|
|
35168
|
+
result.push({
|
|
35169
|
+
dataField: element.dataField,
|
|
35170
|
+
pkValue: element.pkValue
|
|
35171
|
+
});
|
|
35172
|
+
}
|
|
35173
|
+
};
|
|
35174
|
+
for (var index = 0; index < value.length; index++) {
|
|
35175
|
+
_loop3();
|
|
35176
|
+
}
|
|
35177
|
+
return result;
|
|
35178
|
+
};
|
|
35179
|
+
setSelectedCells(function (prev) {
|
|
35180
|
+
return [].concat(prev, removeDuplicates(prev));
|
|
35181
|
+
});
|
|
35182
|
+
};
|
|
35183
|
+
var removeSelectedCell = function removeSelectedCell(rowIndex, colIndex) {
|
|
35184
|
+
var dataField = gridRef.current.instance.columnOption(colIndex).dataField;
|
|
35185
|
+
var pkValue = gridRef.current.instance.cellValue(rowIndex, pkName);
|
|
35186
|
+
setSelectedCells(function (prev) {
|
|
35187
|
+
return prev.filter(function (cell) {
|
|
35188
|
+
return !(cell.dataField == dataField && cell.pkValue == pkValue);
|
|
35189
|
+
});
|
|
35190
|
+
});
|
|
35191
|
+
};
|
|
35192
|
+
var closeModal = function closeModal() {
|
|
35193
|
+
setIsFastUpdateModalOpen(false);
|
|
35194
|
+
clearSelectedCells();
|
|
35195
|
+
fastUpdateForm.resetFields();
|
|
35196
|
+
};
|
|
35197
|
+
var actionButtons = React.useMemo(function () {
|
|
35198
|
+
if (props.actionButtonGroup) {
|
|
35199
|
+
if (props.actionButtonGroup.length >= 2 && !props.edit) {
|
|
35200
|
+
return props.actionButtonGroup.slice(0, 2);
|
|
35201
|
+
} else {
|
|
35202
|
+
return props.actionButtonGroup;
|
|
35203
|
+
}
|
|
35204
|
+
} else {
|
|
35205
|
+
return [];
|
|
35206
|
+
}
|
|
35207
|
+
}, [props.actionButtonGroup]);
|
|
35208
|
+
var fetchData = React.useCallback(function () {
|
|
35209
|
+
try {
|
|
35210
|
+
if (props.axiosRequest == undefined) return Promise.resolve();
|
|
35211
|
+
return Promise.resolve(function () {
|
|
35212
|
+
if (props.isServerSide) {
|
|
35213
|
+
var _props$axiosRequest$r;
|
|
35214
|
+
if (props.axiosRequest.requestData && checkRequestDataHasOnlySortingProperty(props.axiosRequest.requestData)) return;
|
|
35215
|
+
var apiUrl = props.axiosRequest.environmentUrl + "" + props.axiosRequest.apiUrl;
|
|
35216
|
+
if (((_props$axiosRequest$r = props.axiosRequest.requestData) === null || _props$axiosRequest$r === void 0 ? void 0 : _props$axiosRequest$r.PaginatedRequest) !== undefined) {
|
|
35217
|
+
props.axiosRequest.requestData.PaginatedRequest.PageNumber = constants$1.loadedPageCount;
|
|
35218
|
+
props.axiosRequest.requestData.PaginatedRequest.PageSize = props.pageSize;
|
|
35219
|
+
}
|
|
35220
|
+
if (props.axiosRequest.requestQueryString !== undefined) {
|
|
35221
|
+
props.axiosRequest.requestQueryString.maxResultCount = props.pageSize;
|
|
35222
|
+
if (constants$1.loadedPageCount > 1 && constants$1.totalPageCount >= constants$1.loadedPageCount) {
|
|
35223
|
+
props.axiosRequest.requestQueryString.skipCount = ((constants$1.loadedPageCount - 1) * props.pageSize).toString();
|
|
35224
|
+
}
|
|
35225
|
+
var query = queryString.stringify(props.axiosRequest.requestQueryString);
|
|
35226
|
+
apiUrl = apiUrl + "?" + query;
|
|
35227
|
+
}
|
|
35228
|
+
var requestOptions = {
|
|
35229
|
+
method: props.axiosRequest.requestType,
|
|
35230
|
+
headers: getRequestHeaders$1(props),
|
|
35231
|
+
body: JSON.stringify(props.axiosRequest.requestData)
|
|
35232
|
+
};
|
|
35233
|
+
var _temp = _finallyRethrows(function () {
|
|
35234
|
+
return _catch(function () {
|
|
35235
|
+
setLoading(true);
|
|
35236
|
+
return Promise.resolve(fetch(apiUrl, requestOptions)).then(function (response) {
|
|
35237
|
+
return Promise.resolve(response.json()).then(function (newData) {
|
|
35238
|
+
if (constants$1.loadedPageCount == 1) {
|
|
35239
|
+
setData(newData.Data ? newData.Data : newData);
|
|
35240
|
+
constants$1.loadedPageCount = 1;
|
|
35241
|
+
} else if (constants$1.totalPageCount >= constants$1.loadedPageCount) {
|
|
35242
|
+
var newArray = newData.Data ? newData.Data : newData;
|
|
35243
|
+
setData(function (prevData) {
|
|
35244
|
+
return [].concat(prevData, newArray);
|
|
35245
|
+
});
|
|
35246
|
+
}
|
|
35247
|
+
getTotalCount(response, newData);
|
|
35248
|
+
});
|
|
35249
|
+
});
|
|
35250
|
+
}, function (error) {
|
|
35251
|
+
console.error("Error fetching data:", error);
|
|
35252
|
+
setLoading(false);
|
|
35253
|
+
});
|
|
35254
|
+
}, function (_wasThrown, _result) {
|
|
35255
|
+
if (_wasThrown) throw _result;
|
|
35256
|
+
return _result;
|
|
35257
|
+
});
|
|
35258
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
35259
|
+
}
|
|
35260
|
+
}());
|
|
35261
|
+
} catch (e) {
|
|
35262
|
+
return Promise.reject(e);
|
|
35263
|
+
}
|
|
35264
|
+
}, [(_props$axiosRequest6 = props.axiosRequest) === null || _props$axiosRequest6 === void 0 ? void 0 : _props$axiosRequest6.requestData, (_props$axiosRequest7 = props.axiosRequest) === null || _props$axiosRequest7 === void 0 ? void 0 : _props$axiosRequest7.apiUrl, (_props$axiosRequest8 = props.axiosRequest) === null || _props$axiosRequest8 === void 0 ? void 0 : _props$axiosRequest8.environmentUrl, (_props$axiosRequest9 = props.axiosRequest) === null || _props$axiosRequest9 === void 0 ? void 0 : _props$axiosRequest9.requestQueryString, (_props$axiosRequest10 = props.axiosRequest) === null || _props$axiosRequest10 === void 0 ? void 0 : _props$axiosRequest10.requestType, props.pageSize, props.isServerSide]);
|
|
35265
|
+
var getTotalCount = function getTotalCount(response, data) {
|
|
35266
|
+
if (data !== null && data !== void 0 && data.PageCount || data !== null && data !== void 0 && data.RowCount) {
|
|
35267
|
+
constants$1.totalPageCount = data.PageCount;
|
|
35268
|
+
constants$1.totalRecordCount = data.RowCount;
|
|
35269
|
+
} else {
|
|
35270
|
+
var totalCount;
|
|
35271
|
+
if (response) totalCount = response.headers.get("x-total-count");
|
|
35272
|
+
if (totalCount == null) totalCount = data === null || data === void 0 ? void 0 : data.rowCount;
|
|
35273
|
+
if (totalCount == null) totalCount = data === null || data === void 0 ? void 0 : data.length;
|
|
35274
|
+
constants$1.totalRecordCount = parseInt(totalCount, 10) || 0;
|
|
35275
|
+
constants$1.totalPageCount = Math.ceil(constants$1.totalRecordCount / props.pageSize);
|
|
35276
|
+
}
|
|
35277
|
+
setLoading(false);
|
|
35278
|
+
};
|
|
35279
|
+
var onEditorPreparing = React.useCallback(function (e) {
|
|
35280
|
+
if (e.row !== undefined && e.parentType === "dataRow") {
|
|
35281
|
+
if (props.handleEditorPreparing) {
|
|
35282
|
+
props.handleEditorPreparing(e);
|
|
35283
|
+
}
|
|
35284
|
+
}
|
|
35285
|
+
if (e.editorOptions && e.rowType === "data" && e.parentType === "dataRow") {
|
|
35286
|
+
e.editorOptions.onValueChanged = function (args) {
|
|
35287
|
+
if (args.event && args.event.type === "cancel") e.cellElement.dispatchEvent(onCancelEditEvent$1);
|
|
35288
|
+
};
|
|
35289
|
+
}
|
|
35290
|
+
}, [props.isServerSide]);
|
|
35291
|
+
var getServerSide = React.useCallback(function (type) {
|
|
35292
|
+
try {
|
|
35293
|
+
return Promise.resolve(function () {
|
|
35294
|
+
if (type === "reachedBottom") {
|
|
35295
|
+
return function () {
|
|
35296
|
+
if (constants$1.totalPageCount <= constants$1.loadedPageCount) {} else {
|
|
35297
|
+
constants$1.loadedPageCount = constants$1.loadedPageCount + 1;
|
|
35298
|
+
return Promise.resolve(fetchData()).then(function () {});
|
|
35299
|
+
}
|
|
35300
|
+
}();
|
|
35301
|
+
}
|
|
35302
|
+
}());
|
|
35303
|
+
} catch (e) {
|
|
35304
|
+
return Promise.reject(e);
|
|
35305
|
+
}
|
|
35306
|
+
}, [constants$1.totalPageCount]);
|
|
35307
|
+
var onExporting = React.useCallback(function (e) {
|
|
35308
|
+
if (e.format === "xlsx") {
|
|
35309
|
+
var workbook = new exceljs.Workbook();
|
|
35310
|
+
if (props.filterData != null) {
|
|
35311
|
+
var newColumnFromFilterData = props.filterData.map(function (filterItem) {
|
|
35312
|
+
return {
|
|
35313
|
+
dataField: filterItem.key,
|
|
35314
|
+
caption: filterItem.key
|
|
35315
|
+
};
|
|
35316
|
+
});
|
|
35317
|
+
var newColumns = [].concat(gridColumns, newColumnFromFilterData);
|
|
35318
|
+
e.component.beginUpdate();
|
|
35319
|
+
e.component.option("columns", newColumns);
|
|
35320
|
+
e.component.endUpdate();
|
|
35321
|
+
}
|
|
35322
|
+
excel_exporter.exportDataGrid({
|
|
35323
|
+
component: e.component,
|
|
35324
|
+
worksheet: workbook.addWorksheet("Main sheet"),
|
|
35325
|
+
autoFilterEnabled: true,
|
|
35326
|
+
customizeCell: function customizeCell(options) {
|
|
35327
|
+
var gridCell = options.gridCell,
|
|
35328
|
+
excelCell = options.excelCell;
|
|
35329
|
+
if (gridCell.column.dataType === "datetime" && gridCell.value) {
|
|
35330
|
+
var _gridCell$column$calc, _gridCell$column$meta;
|
|
35331
|
+
if (((_gridCell$column$calc = gridCell.column.calculateFilterExpression) === null || _gridCell$column$calc === void 0 ? void 0 : _gridCell$column$calc.name) === "calculateFilterExpressionForColumn" && (_gridCell$column$meta = gridCell.column["meta"]) !== null && _gridCell$column$meta !== void 0 && _gridCell$column$meta.hasCustomCellRenderer) {
|
|
35332
|
+
var date = moment(gridCell.value);
|
|
35333
|
+
var offsetMinutes = date.utcOffset();
|
|
35334
|
+
var sign = offsetMinutes >= 0 ? "+" : "-";
|
|
35335
|
+
var hours = Math.floor(Math.abs(offsetMinutes) / 60);
|
|
35336
|
+
var minutes = Math.abs(offsetMinutes) % 60;
|
|
35337
|
+
var formattedOffset = "(UTC" + sign + hours.toString().padStart(2, "0") + ":" + minutes.toString().padStart(2, "0") + ")";
|
|
35338
|
+
var formattedDate = date.format("DD.MM.YYYY HH:mm") + " " + formattedOffset;
|
|
35339
|
+
excelCell.value = formattedDate;
|
|
35340
|
+
}
|
|
35341
|
+
}
|
|
35342
|
+
if (gridCell.rowType !== "header" && props.filterData != null) {
|
|
35343
|
+
var matchingItem = props.filterData.find(function (item) {
|
|
35344
|
+
return item.key === gridCell.column.dataField;
|
|
35345
|
+
});
|
|
35346
|
+
if (matchingItem) {
|
|
35347
|
+
excelCell.value = matchingItem.value;
|
|
35348
|
+
}
|
|
35349
|
+
}
|
|
35350
|
+
}
|
|
35351
|
+
}).then(function () {
|
|
35352
|
+
workbook.xlsx.writeBuffer().then(function (buffer) {
|
|
35353
|
+
fileSaverEs.saveAs(new Blob([buffer], {
|
|
35354
|
+
type: "application/octet-stream"
|
|
35355
|
+
}), fileName + ".xlsx");
|
|
35356
|
+
});
|
|
35357
|
+
});
|
|
35358
|
+
} else {
|
|
35359
|
+
var doc = new jsPDF();
|
|
35360
|
+
pdf_exporter.exportDataGrid({
|
|
35361
|
+
jsPDFDocument: doc,
|
|
35362
|
+
component: e.component,
|
|
35363
|
+
indent: 5
|
|
35364
|
+
}).then(function () {
|
|
35365
|
+
doc.save(fileName + ".pdf");
|
|
35366
|
+
});
|
|
35367
|
+
}
|
|
35368
|
+
}, [fileName, props.filterData]);
|
|
35369
|
+
var customLoad = React.useCallback(function () {
|
|
35370
|
+
var state = JSON.parse(localStorage.getItem(props.exportFileName + "Storage"));
|
|
35371
|
+
if (localStorage.getItem(props.exportFileName + "Storage")) {
|
|
35372
|
+
state.selectedRowKeys = [];
|
|
35373
|
+
if (props.filterEnabledShow) state.filterPanel = {
|
|
35374
|
+
filterEnabled: false
|
|
35375
|
+
};else state.filterPanel = {
|
|
35376
|
+
filterEnabled: true
|
|
35377
|
+
};
|
|
35378
|
+
}
|
|
35379
|
+
return state;
|
|
35380
|
+
}, [props.filterEnabledShow]);
|
|
35381
|
+
var customSave = React.useCallback(function (state) {
|
|
35382
|
+
state.selectedRowKeys = [];
|
|
35383
|
+
if (props.filterEnabledShow) state.filterPanel = {
|
|
35384
|
+
filterEnabled: false
|
|
35385
|
+
};else state.filterPanel = {
|
|
35386
|
+
filterEnabled: true
|
|
35387
|
+
};
|
|
35388
|
+
if (data.length === 0) {
|
|
35389
|
+
if (!state.filterValue && state.filterValue !== null) {
|
|
35390
|
+
state.filterValue = null;
|
|
35391
|
+
}
|
|
35392
|
+
}
|
|
35393
|
+
localStorage.setItem(props.exportFileName + "Storage", JSON.stringify(state));
|
|
35394
|
+
}, [props.filterEnabledShow]);
|
|
35395
|
+
var onEditorPrepared = React.useCallback(function (info) {
|
|
35396
|
+
if (info.parentType === "filterRow" && info.editorName === "dxSelectBox" && info.dataField === "IsActive") {
|
|
35397
|
+
if (info.dataSource != null && info.dataSource.length > 0) {
|
|
35398
|
+
info.showAllText = info.dataSource.find(function (i) {
|
|
35399
|
+
return i.value === null;
|
|
35400
|
+
}).label;
|
|
35401
|
+
info.trueText = info.dataSource.find(function (i) {
|
|
35402
|
+
return i.value === true;
|
|
35403
|
+
}).label;
|
|
35404
|
+
info.falseText = info.dataSource.find(function (i) {
|
|
35405
|
+
return i.value === false;
|
|
35406
|
+
}).label;
|
|
35407
|
+
}
|
|
35408
|
+
}
|
|
35409
|
+
}, []);
|
|
35410
|
+
var renderTotal = React.useCallback(function () {
|
|
35411
|
+
var _props$customSummary3;
|
|
35412
|
+
var result = "";
|
|
35413
|
+
var totalloaded = 0;
|
|
35414
|
+
if (data.length < 50 || !props.isServerSide || constants$1.loadedPageCount == constants$1.totalPageCount) {
|
|
35415
|
+
totalloaded = data.length;
|
|
35416
|
+
} else {
|
|
35417
|
+
totalloaded = constants$1.loadedPageCount * props.pageSize;
|
|
35418
|
+
}
|
|
35419
|
+
if (props.isServerSide) {
|
|
35420
|
+
var _props$customSummary, _props$customSummary2;
|
|
35421
|
+
result = constants$1.totalRecordCount > 0 ? totalloaded + " " + ((_props$customSummary = props.customSummary) === null || _props$customSummary === void 0 ? void 0 : _props$customSummary.summaryLoadedDataLabel) + ("- " + constants$1.totalRecordCount) + ((_props$customSummary2 = props.customSummary) === null || _props$customSummary2 === void 0 ? void 0 : _props$customSummary2.summaryTotalDataLabel) : "";
|
|
35422
|
+
result = concatFilteredLabel$1(result, totalloaded, filteredRowCount, filterApplied.current, props);
|
|
35423
|
+
}
|
|
35424
|
+
if (((_props$customSummary3 = props.customSummary) === null || _props$customSummary3 === void 0 ? void 0 : _props$customSummary3.summaryTotalCount) !== undefined && !props.isServerSide) {
|
|
35425
|
+
result = props.customSummary.summaryTotalDataLabel + " : " + props.customSummary.summaryTotalCount;
|
|
35426
|
+
result = concatFilteredLabel$1(result, totalloaded, filteredRowCount, filterApplied.current, props);
|
|
35427
|
+
}
|
|
35428
|
+
if (constants$1.totalPageCount > 1) {
|
|
35429
|
+
var _props$customSummary4;
|
|
35430
|
+
result = result + " - " + ((_props$customSummary4 = props.customSummary) === null || _props$customSummary4 === void 0 ? void 0 : _props$customSummary4.summaryTotalPageCountLabel) + " " + constants$1.loadedPageCount + " / " + constants$1.totalPageCount;
|
|
35431
|
+
}
|
|
35432
|
+
return result;
|
|
35433
|
+
}, [data, filteredRowCount, constants$1.loadedPageCount, props.pageSize, constants$1.totalRecordCount, filterApplied.current]);
|
|
35434
|
+
function actionCellRender(cellData, props) {
|
|
35435
|
+
var kebabMenuButtons = props.actionButtonGroup && props.actionButtonGroup.length >= 2 && !props.edit ? props.actionButtonGroup.slice(2).map(function (button) {
|
|
35436
|
+
return {
|
|
35437
|
+
icon: React__default.createElement(DynamicIcon, {
|
|
35438
|
+
iconName: button.icon
|
|
35439
|
+
}),
|
|
35440
|
+
onClick: function onClick(event) {
|
|
35441
|
+
var customEvent = {
|
|
35442
|
+
column: cellData.column,
|
|
35443
|
+
component: cellData.component,
|
|
35444
|
+
element: cellData.element,
|
|
35445
|
+
event: event,
|
|
35446
|
+
model: cellData.data,
|
|
35447
|
+
row: cellData.row
|
|
35448
|
+
};
|
|
35449
|
+
button.onClick(customEvent);
|
|
35450
|
+
}
|
|
35451
|
+
};
|
|
35452
|
+
}) : [];
|
|
35453
|
+
var buttonElements = [];
|
|
35454
|
+
{
|
|
35455
|
+
!props.edit && actionButtons.forEach(function (buttonItem, index) {
|
|
35456
|
+
var isVisible = typeof buttonItem.visible === "function" ? buttonItem.visible({
|
|
35457
|
+
column: cellData.column,
|
|
35458
|
+
component: cellData.component,
|
|
35459
|
+
row: cellData.row
|
|
35460
|
+
}) : buttonItem.visible;
|
|
35461
|
+
buttonElements.push(React__default.createElement(OdsDataGrdiRowButton, {
|
|
35462
|
+
key: "action-button-" + index,
|
|
35463
|
+
hint: buttonItem.hint,
|
|
35464
|
+
visible: isVisible,
|
|
35465
|
+
size: "small",
|
|
35466
|
+
type: "text",
|
|
35467
|
+
disabled: buttonItem.actionPermission === undefined ? false : !buttonItem.actionPermission,
|
|
35468
|
+
icon: React__default.createElement(DynamicIcon, {
|
|
35469
|
+
iconName: buttonItem.icon
|
|
35470
|
+
}),
|
|
35471
|
+
onClick: function onClick(event) {
|
|
35472
|
+
var customEvent = {
|
|
35473
|
+
column: cellData.column,
|
|
35474
|
+
component: cellData.component,
|
|
35475
|
+
element: cellData.element,
|
|
35476
|
+
event: event,
|
|
35477
|
+
model: cellData.data,
|
|
35478
|
+
row: cellData.row
|
|
35479
|
+
};
|
|
35480
|
+
buttonItem.onClick(customEvent);
|
|
35481
|
+
}
|
|
35482
|
+
}));
|
|
35483
|
+
});
|
|
35484
|
+
}
|
|
35485
|
+
{
|
|
35486
|
+
props.edit && actionButtons.forEach(function (buttonItem, index) {
|
|
35487
|
+
var isVisible = typeof buttonItem.visible === "function" ? buttonItem.visible({
|
|
35488
|
+
column: cellData.column,
|
|
35489
|
+
component: cellData.component,
|
|
35490
|
+
row: cellData.row
|
|
35491
|
+
}) : buttonItem.visible;
|
|
35492
|
+
buttonElements.push(React__default.createElement(OdsDataGrdiRowButton, {
|
|
35493
|
+
key: "action-button-" + index,
|
|
35494
|
+
name: buttonItem.name,
|
|
35495
|
+
hint: buttonItem.hint,
|
|
35496
|
+
visible: isVisible,
|
|
35497
|
+
size: "small",
|
|
35498
|
+
type: "text",
|
|
35499
|
+
disabled: buttonItem.actionPermission === undefined ? false : !buttonItem.actionPermission,
|
|
35500
|
+
icon: React__default.createElement(DynamicIcon, {
|
|
35501
|
+
iconName: buttonItem.icon
|
|
35502
|
+
}),
|
|
35503
|
+
onClick: function onClick(event) {
|
|
35504
|
+
if (buttonItem.onClick) {
|
|
35505
|
+
var customEvent = {
|
|
35506
|
+
column: cellData.column,
|
|
35507
|
+
component: cellData.component,
|
|
35508
|
+
element: cellData.element,
|
|
35509
|
+
event: event,
|
|
35510
|
+
model: cellData.data,
|
|
35511
|
+
row: cellData.row
|
|
35512
|
+
};
|
|
35513
|
+
buttonItem.onClick(customEvent);
|
|
35514
|
+
}
|
|
35515
|
+
}
|
|
35516
|
+
}));
|
|
35517
|
+
});
|
|
35518
|
+
}
|
|
35519
|
+
if (kebabMenuButtons.length > 0) {
|
|
35520
|
+
buttonElements.push(React__default.createElement(OdsDropdown, {
|
|
35521
|
+
key: "dropdown-" + (cellData.rowIndex || cellData.data.ID),
|
|
35522
|
+
menuItems: kebabMenuButtons
|
|
35523
|
+
}, React__default.createElement(OdsDataGrdiRowButton, {
|
|
35524
|
+
type: "text",
|
|
35525
|
+
icon: React__default.createElement(DynamicIcon, {
|
|
35526
|
+
iconName: "kebabMenu"
|
|
35527
|
+
})
|
|
35528
|
+
})));
|
|
35529
|
+
}
|
|
35530
|
+
return React__default.createElement(React__default.Fragment, null, buttonElements);
|
|
35531
|
+
}
|
|
35532
|
+
var onScrollEnd = React.useCallback(function () {
|
|
35533
|
+
getServerSide("reachedBottom");
|
|
35534
|
+
}, [(_props$axiosRequest11 = props.axiosRequest) === null || _props$axiosRequest11 === void 0 ? void 0 : _props$axiosRequest11.requestData, getServerSide]);
|
|
35535
|
+
var handleScroll = function handleScroll(e) {
|
|
35536
|
+
var run = debounce_1(function (e) {
|
|
35537
|
+
var _scrollable$scrollTop, _scrollable$clientHei, _scrollable$scrollHei;
|
|
35538
|
+
var scrollable = e.target;
|
|
35539
|
+
var top = (_scrollable$scrollTop = scrollable === null || scrollable === void 0 ? void 0 : scrollable.scrollTop) != null ? _scrollable$scrollTop : 0;
|
|
35540
|
+
var height = (_scrollable$clientHei = scrollable === null || scrollable === void 0 ? void 0 : scrollable.clientHeight) != null ? _scrollable$clientHei : 0;
|
|
35541
|
+
var scrollHeight = (_scrollable$scrollHei = scrollable === null || scrollable === void 0 ? void 0 : scrollable.scrollHeight) != null ? _scrollable$scrollHei : 0;
|
|
35542
|
+
var maxHeight = Math.max(top, height, scrollHeight) - 1;
|
|
35543
|
+
if (scrollHeight <= height) return;
|
|
35544
|
+
var reachedBottom = Math.ceil(top + height) >= maxHeight;
|
|
35545
|
+
var lastScrollTop = 0;
|
|
35546
|
+
if (top < lastScrollTop) return;
|
|
35547
|
+
lastScrollTop = top <= 0 ? 0 : top;
|
|
35548
|
+
if (reachedBottom) onScrollEnd();
|
|
35549
|
+
setScrollPosition(top);
|
|
35550
|
+
}, 200);
|
|
35551
|
+
run(e);
|
|
35552
|
+
};
|
|
35553
|
+
var handleContentReady = function handleContentReady(e) {
|
|
35554
|
+
var dataGridInstance = e.component;
|
|
35555
|
+
var filteredDataCount = dataGridInstance.totalCount();
|
|
35556
|
+
if (filterApplied.current && filteredDataCount > 0) {
|
|
35557
|
+
setFilteredRowCount(filteredDataCount);
|
|
35558
|
+
} else {
|
|
35559
|
+
setFilteredRowCount(0);
|
|
35560
|
+
}
|
|
35561
|
+
if (!contentReady) setContentReady(true);
|
|
35562
|
+
};
|
|
35563
|
+
var onFilterValueChange = function onFilterValueChange(e) {
|
|
35564
|
+
if (e !== null) filterApplied.current = true;else {
|
|
35565
|
+
filterApplied.current = false;
|
|
35566
|
+
setFilteredRowCount(0);
|
|
35567
|
+
}
|
|
35568
|
+
};
|
|
35569
|
+
var onCustomCellClick = function onCustomCellClick(e) {
|
|
35570
|
+
e.cellElement.style.backgroundColor = "transparent";
|
|
35571
|
+
if (hasFastUpdate) {
|
|
35572
|
+
if (checkCellSelectionConstraints$1(e) && constants$1.allowedDataTypesForMultiCellEditing.some(function (item) {
|
|
35573
|
+
return item.toLocaleLowerCase() == e.column.dataType.toLocaleLowerCase();
|
|
35574
|
+
})) {
|
|
35575
|
+
if (!e.event.ctrlKey) {
|
|
35576
|
+
if (cellAlreadySelected$1(e.data[pkName], e.column.dataField, selectedCells)) {
|
|
35577
|
+
removeSelectedCell(e.rowIndex, e.columnIndex);
|
|
35578
|
+
} else {
|
|
35579
|
+
singleSelect(e.data[pkName], e.column.dataField);
|
|
35580
|
+
}
|
|
35581
|
+
} else {
|
|
35582
|
+
var selectedCell = {
|
|
35583
|
+
colIndex: e.columnIndex,
|
|
35584
|
+
rowIndex: e.rowIndex
|
|
35585
|
+
};
|
|
35586
|
+
if (ctrlSelection) {
|
|
35587
|
+
multipleSelect([].concat(ctrlSelectedCells, [selectedCell]));
|
|
35588
|
+
} else {
|
|
35589
|
+
setCtrlSelectedCells(function (prev) {
|
|
35590
|
+
return [].concat(prev, [selectedCell]);
|
|
35591
|
+
});
|
|
35592
|
+
}
|
|
35593
|
+
setCtrlSelection(function (prev) {
|
|
35594
|
+
return !prev;
|
|
35595
|
+
});
|
|
35596
|
+
}
|
|
35597
|
+
}
|
|
35598
|
+
}
|
|
35599
|
+
onCellClick && onCellClick(e);
|
|
35600
|
+
};
|
|
35601
|
+
var onCustomCellHoverChanged = function onCustomCellHoverChanged(e) {
|
|
35602
|
+
if (hasFastUpdate) {
|
|
35603
|
+
if (!e.event.ctrlKey && !ctrlSelection) {
|
|
35604
|
+
if (checkCellSelectionConstraints$1(e)) {
|
|
35605
|
+
if (e.event.buttons === 1) {
|
|
35606
|
+
setHoveredCells(function (prev) {
|
|
35607
|
+
return [].concat(prev, [{
|
|
35608
|
+
colIndex: e.columnIndex,
|
|
35609
|
+
rowIndex: e.rowIndex
|
|
35610
|
+
}]);
|
|
35611
|
+
});
|
|
35612
|
+
} else {
|
|
35613
|
+
multipleSelect(hoveredCells);
|
|
35614
|
+
}
|
|
35615
|
+
} else if (e.rowType != "data") {
|
|
35616
|
+
multipleSelect(hoveredCells);
|
|
35617
|
+
}
|
|
35618
|
+
}
|
|
35619
|
+
}
|
|
35620
|
+
onCellHoverChanged && onCellHoverChanged(e);
|
|
35621
|
+
};
|
|
35622
|
+
var onCustomFastUpdateButtonClick = function onCustomFastUpdateButtonClick(e) {
|
|
35623
|
+
if (selectedCells.length > 0) {
|
|
35624
|
+
setIsFastUpdateModalOpen(true);
|
|
35625
|
+
}
|
|
35626
|
+
onFastUpdateButtonClick && onFastUpdateButtonClick(e);
|
|
35627
|
+
};
|
|
35628
|
+
var onFastUpdateModalCancel = function onFastUpdateModalCancel(_e) {
|
|
35629
|
+
closeModal();
|
|
35630
|
+
onFastUpdateCancel && onFastUpdateCancel();
|
|
35631
|
+
};
|
|
35632
|
+
var onFastUpdateFormFinish = function onFastUpdateFormFinish(values) {
|
|
35633
|
+
onFastUpdateFinish && onFastUpdateFinish(values, selectedCells);
|
|
35634
|
+
closeModal();
|
|
35635
|
+
};
|
|
35636
|
+
var onFastUpdateFormFinishFailed = function onFastUpdateFormFinishFailed(errorInfo) {
|
|
35637
|
+
onFastUpdateFailed && onFastUpdateFailed(errorInfo);
|
|
35638
|
+
};
|
|
35639
|
+
var onClickFastUpdateFormCancel = function onClickFastUpdateFormCancel(_e) {
|
|
35640
|
+
closeModal();
|
|
35641
|
+
onFastUpdateCancel && onFastUpdateCancel();
|
|
35642
|
+
};
|
|
35643
|
+
var onCustomCellPrepared = function onCustomCellPrepared(e) {
|
|
35644
|
+
var _props$edit, _props$edit2;
|
|
35645
|
+
if (hasFastUpdate) {
|
|
35646
|
+
if (e.rowType === "data" && e.column.allowEditing && constants$1.allowedDataTypesForMultiCellEditing.some(function (item) {
|
|
35647
|
+
return item.toLocaleLowerCase() == e.column.dataType.toLocaleLowerCase();
|
|
35648
|
+
})) {
|
|
35649
|
+
if (selectedCells.some(function (cell) {
|
|
35650
|
+
return cell.pkValue == e.data[pkName] && cell.dataField == e.column.dataField;
|
|
35651
|
+
})) {
|
|
35652
|
+
e.cellElement.classList.add("grid-cell-selected");
|
|
35653
|
+
}
|
|
35654
|
+
}
|
|
35655
|
+
}
|
|
35656
|
+
if (((_props$edit = props.edit) === null || _props$edit === void 0 ? void 0 : _props$edit.mode) == "cell" && (_props$edit2 = props.edit) !== null && _props$edit2 !== void 0 && _props$edit2.allowUpdating && e.rowType == "data" && !e.column.allowEditing) {
|
|
35657
|
+
e.cellElement.classList.add("grid-cell-disable-colored");
|
|
35658
|
+
}
|
|
35659
|
+
};
|
|
35660
|
+
var onToolbarPreparing = function onToolbarPreparing(e) {
|
|
35661
|
+
if (props.toolbarButtonGroup && props.toolbarButtonGroup.length > 0) {
|
|
35662
|
+
e.toolbarOptions.items.unshift({
|
|
35663
|
+
location: "before",
|
|
35664
|
+
template: function template(_, __, container) {
|
|
35665
|
+
var wrapper = document.createElement("div");
|
|
35666
|
+
container.appendChild(wrapper);
|
|
35667
|
+
reactDom.render(React__default.createElement(React__default.StrictMode, null, props.toolbarButtonGroup && Array.isArray(props.toolbarButtonGroup) && props.toolbarButtonGroup.map(function (buttonGroupItem, index) {
|
|
35668
|
+
return React__default.createElement(OdsButton, {
|
|
35669
|
+
key: index,
|
|
35670
|
+
style: {
|
|
35671
|
+
marginLeft: token.margin
|
|
35672
|
+
},
|
|
35673
|
+
type: buttonGroupItem.type,
|
|
35674
|
+
onClick: buttonGroupItem.onClick
|
|
35675
|
+
}, buttonGroupItem.label);
|
|
35676
|
+
})), wrapper);
|
|
35677
|
+
}
|
|
35678
|
+
});
|
|
35679
|
+
}
|
|
35680
|
+
e.toolbarOptions.items.unshift({
|
|
35681
|
+
location: "before",
|
|
35682
|
+
cssClass: "toolbarTitleItem",
|
|
35683
|
+
template: function template(_, __, container) {
|
|
35684
|
+
var wrapper = document.createElement("div");
|
|
35685
|
+
container.appendChild(wrapper);
|
|
35686
|
+
reactDom.render(React__default.createElement(React__default.StrictMode, null, React__default.createElement(OdsTitle, {
|
|
35687
|
+
level: 5,
|
|
35688
|
+
style: {
|
|
35689
|
+
display: "flex",
|
|
35690
|
+
alignItems: "center",
|
|
35691
|
+
alignSelf: "stretch",
|
|
35692
|
+
margin: 0
|
|
35693
|
+
}
|
|
35694
|
+
}, props.pageTitle)), wrapper);
|
|
35695
|
+
}
|
|
35696
|
+
});
|
|
35697
|
+
};
|
|
35698
|
+
var detailGrid = function detailGrid(_ref) {
|
|
35699
|
+
var data = _ref.data;
|
|
35700
|
+
return React__default.createElement(OdsRemoteDataGrid, Object.assign({}, props, {
|
|
35701
|
+
showMasterDetail: false,
|
|
35702
|
+
columns: props.detailGridColums,
|
|
35703
|
+
dataSource: props.detailData[data.key.ID]
|
|
35704
|
+
}));
|
|
35705
|
+
};
|
|
35706
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(antd.Modal, {
|
|
35707
|
+
title: fastUpdateModalTitle != null ? fastUpdateModalTitle : "Fast Update",
|
|
35708
|
+
open: isFastUpdateModalOpen,
|
|
35709
|
+
onCancel: onFastUpdateModalCancel,
|
|
35710
|
+
footer: [],
|
|
35711
|
+
maskClosable: true,
|
|
35712
|
+
width: 300
|
|
35713
|
+
}, React__default.createElement(antd.Form, {
|
|
35714
|
+
key: "form-fastupdate",
|
|
35715
|
+
form: fastUpdateForm,
|
|
35716
|
+
style: {
|
|
35717
|
+
maxWidth: "100%"
|
|
35718
|
+
},
|
|
35719
|
+
layout: "vertical",
|
|
35720
|
+
onFinish: onFastUpdateFormFinish,
|
|
35721
|
+
onFinishFailed: onFastUpdateFormFinishFailed
|
|
35722
|
+
}, constants$1.allowedDataTypesForMultiCellEditing.map(function (item) {
|
|
35723
|
+
switch (item) {
|
|
35724
|
+
case "number":
|
|
35725
|
+
return React__default.createElement(antd.Form.Item, {
|
|
35726
|
+
name: "number",
|
|
35727
|
+
label: "",
|
|
35728
|
+
rules: [{
|
|
35729
|
+
required: true,
|
|
35730
|
+
message: fastUpdateFormRequiredFieldMessage != null ? fastUpdateFormRequiredFieldMessage : "Required field"
|
|
35731
|
+
}]
|
|
35732
|
+
}, React__default.createElement(OdsInputNumber, {
|
|
35733
|
+
key: "odsinputnumber-fastupdate",
|
|
35734
|
+
style: {
|
|
35735
|
+
width: "100%"
|
|
35736
|
+
},
|
|
35737
|
+
min: 0
|
|
35738
|
+
}));
|
|
35739
|
+
default:
|
|
35740
|
+
return React__default.createElement("div", null);
|
|
35741
|
+
}
|
|
35742
|
+
}), React__default.createElement(antd.Row, {
|
|
35743
|
+
style: {
|
|
35744
|
+
justifyContent: "end",
|
|
35745
|
+
gap: token.marginSM
|
|
35746
|
+
}
|
|
35747
|
+
}, React__default.createElement(antd.Col, null, React__default.createElement(OdsButton, {
|
|
35748
|
+
key: "back",
|
|
35749
|
+
onClick: onClickFastUpdateFormCancel
|
|
35750
|
+
}, " ", fastUpdateModalCancelText != null ? fastUpdateModalCancelText : "Cancel")), React__default.createElement(antd.Col, null, React__default.createElement(OdsButton, {
|
|
35751
|
+
htmlType: "submit",
|
|
35752
|
+
type: "primary"
|
|
35753
|
+
}, " ", fastUpdateModalSaveText != null ? fastUpdateModalSaveText : "Save"))))), React__default.createElement(DataGrid__default, {
|
|
35754
|
+
keyExpr: keyExpr,
|
|
35755
|
+
dataSource: data,
|
|
35756
|
+
showBorders: true,
|
|
35757
|
+
columnAutoWidth: false,
|
|
35758
|
+
ref: gridRef,
|
|
35759
|
+
height: props.height == undefined ? window.innerHeight - 164 : props.height,
|
|
35760
|
+
allowColumnResizing: true,
|
|
35761
|
+
columnResizingMode: "nextColumn",
|
|
35762
|
+
showRowLines: true,
|
|
35763
|
+
allowColumnReordering: true,
|
|
35764
|
+
scrolling: {
|
|
35765
|
+
useNative: true
|
|
35766
|
+
},
|
|
35767
|
+
remoteOperations: false,
|
|
35768
|
+
paging: {
|
|
35769
|
+
enabled: false
|
|
35770
|
+
},
|
|
35771
|
+
repaintChangesOnly: true,
|
|
35772
|
+
focusedRowEnabled: false,
|
|
35773
|
+
filterSyncEnabled: true,
|
|
35774
|
+
wordWrapEnabled: props.wordWrapEnabled ? props.wordWrapEnabled : false,
|
|
35775
|
+
columnFixing: {
|
|
35776
|
+
enabled: true
|
|
35777
|
+
},
|
|
35778
|
+
noDataText: props.noDataText,
|
|
35779
|
+
onEditorPreparing: onEditorPreparing,
|
|
35780
|
+
onExporting: onExporting,
|
|
35781
|
+
onRowClick: props.onRowClick,
|
|
35782
|
+
onEditorPrepared: onEditorPrepared,
|
|
35783
|
+
onSelectionChanged: props.onSelectionChanged,
|
|
35784
|
+
onSaved: props.onSaved,
|
|
35785
|
+
onSaving: props.onSaving,
|
|
35786
|
+
onEditCanceling: props.onEditCanceling,
|
|
35787
|
+
onContentReady: handleContentReady,
|
|
35788
|
+
onFilterValueChange: onFilterValueChange,
|
|
35789
|
+
onCellClick: onCustomCellClick,
|
|
35790
|
+
onCellHoverChanged: onCustomCellHoverChanged,
|
|
35791
|
+
onCellPrepared: onCustomCellPrepared,
|
|
35792
|
+
onOptionChanged: props.onOptionChanged,
|
|
35793
|
+
onToolbarPreparing: props.onToolbarPreparing || onToolbarPreparing
|
|
35794
|
+
}, gridColumns.map(function (col) {
|
|
35795
|
+
return React__default.createElement(DataGrid.Column, Object.assign({
|
|
35796
|
+
key: col.dataField
|
|
35797
|
+
}, col, {
|
|
35798
|
+
minWidth: 50,
|
|
35799
|
+
cssClass: col.cssClass + " " + (hasFastUpdate ? "grid-cell-disable-text-selection" : "")
|
|
35800
|
+
}), col.lookUp && React__default.createElement(devextremeReact.Lookup, Object.assign({}, col.lookUp)), col.dataField === "IsActive" && React__default.createElement(DataGrid.HeaderFilter, {
|
|
35801
|
+
dataSource: [{
|
|
35802
|
+
text: "Active",
|
|
35803
|
+
value: true
|
|
35804
|
+
}, {
|
|
35805
|
+
text: "Passive",
|
|
35806
|
+
value: false
|
|
35807
|
+
}]
|
|
35808
|
+
}), col.useDynamicHeaderFilter && React__default.createElement(DataGrid.HeaderFilter, {
|
|
35809
|
+
allowSearch: true,
|
|
35810
|
+
dataSource: [{
|
|
35811
|
+
text: "(Blanks)",
|
|
35812
|
+
value: null
|
|
35813
|
+
}].concat(data && data.length > 0 ? data.filter(function (item) {
|
|
35814
|
+
return item[col.dataField] !== null && item[col.dataField] !== undefined && item[col.dataField] !== "";
|
|
35815
|
+
}).map(function (item) {
|
|
35816
|
+
return {
|
|
35817
|
+
text: item[col.dataField].toString(),
|
|
35818
|
+
value: item[col.dataField]
|
|
35819
|
+
};
|
|
35820
|
+
}) : [])
|
|
35821
|
+
}), getMultiLevelColumns$1(col));
|
|
35822
|
+
}), props.actionColumnEnable !== undefined && props.actionColumnEnable === true && React__default.createElement(DataGrid.Column, {
|
|
35823
|
+
dataField: "Actions",
|
|
35824
|
+
fixed: true,
|
|
35825
|
+
allowSorting: false,
|
|
35826
|
+
caption: props.actionButtonGroupCaption,
|
|
35827
|
+
type: "buttons",
|
|
35828
|
+
showInColumnChooser: false,
|
|
35829
|
+
cellRender: function cellRender(cellData) {
|
|
35830
|
+
return actionCellRender(cellData, props);
|
|
35831
|
+
}
|
|
35832
|
+
}), props.showMasterDetail && React__default.createElement(DataGrid.MasterDetail, {
|
|
35833
|
+
enabled: true,
|
|
35834
|
+
component: detailGrid
|
|
35835
|
+
}), props.edit && React__default.createElement(DataGrid.Editing, {
|
|
35836
|
+
mode: props.edit.mode,
|
|
35837
|
+
allowUpdating: props.edit.allowUpdating,
|
|
35838
|
+
allowDeleting: props.edit.allowDeleting,
|
|
35839
|
+
allowAdding: props.edit.allowAdding,
|
|
35840
|
+
useIcons: true
|
|
35841
|
+
}, props.edit.mode === "popup" && React__default.createElement("div", null, React__default.createElement(DataGrid.Popup, {
|
|
35842
|
+
showTitle: true,
|
|
35843
|
+
width: 700,
|
|
35844
|
+
height: 300,
|
|
35845
|
+
showCloseButton: false
|
|
35846
|
+
}), React__default.createElement(DataGrid.Form, null, props.edit.formItems && props.edit.formItems.map(function (formItem) {
|
|
35847
|
+
return React__default.createElement(form.Item, {
|
|
35848
|
+
itemType: formItem.itemType,
|
|
35849
|
+
colCount: formItem.colCount,
|
|
35850
|
+
colSpan: formItem.colSpan
|
|
35851
|
+
}, formItem.items.map(function (subItem) {
|
|
35852
|
+
return React__default.createElement(form.Item, {
|
|
35853
|
+
key: subItem.dataField,
|
|
35854
|
+
dataField: subItem.dataField
|
|
35855
|
+
});
|
|
35856
|
+
}));
|
|
35857
|
+
})))), React__default.createElement(DataGrid.Paging, {
|
|
35858
|
+
defaultPageSize: props.pageSize
|
|
35859
|
+
}), props.pagingEnable && React__default.createElement(DataGrid.Pager, {
|
|
35860
|
+
visible: false,
|
|
35861
|
+
displayMode: "full",
|
|
35862
|
+
showPageSizeSelector: false,
|
|
35863
|
+
showNavigationButtons: false,
|
|
35864
|
+
showInfo: false
|
|
35865
|
+
}), React__default.createElement(DataGrid.Scrolling, {
|
|
35866
|
+
showScrollbar: "always",
|
|
35867
|
+
scrollByContent: true,
|
|
35868
|
+
scrollByThumb: true,
|
|
35869
|
+
mode: "virtual",
|
|
35870
|
+
rowRenderingMode: "virtual"
|
|
35871
|
+
}), loading && React__default.createElement(DataGrid.LoadPanel, {
|
|
35872
|
+
enabled: true,
|
|
35873
|
+
shadingColor: "rgba(0,0,0,0.4)"
|
|
35874
|
+
}), React__default.createElement(DataGrid.SearchPanel, {
|
|
35875
|
+
visible: true
|
|
35876
|
+
}), React__default.createElement(DataGrid.FilterRow, {
|
|
35877
|
+
visible: props.isFilterRow != undefined ? props.isFilterRow : true
|
|
35878
|
+
}), React__default.createElement(DataGrid.FilterPanel, {
|
|
35879
|
+
visible: true
|
|
35880
|
+
}), React__default.createElement(DataGrid.HeaderFilter, {
|
|
35881
|
+
visible: true
|
|
35882
|
+
}), React__default.createElement(DataGrid.Sorting, {
|
|
35883
|
+
mode: "multiple"
|
|
35884
|
+
}), React__default.createElement(DataGrid.Export, {
|
|
35885
|
+
enabled: true,
|
|
35886
|
+
allowExportSelectedData: true,
|
|
35887
|
+
formats: constants$1.exportFormats
|
|
35888
|
+
}), ((_props$selectOptions = props.selectOptions) === null || _props$selectOptions === void 0 ? void 0 : _props$selectOptions.selectEnable) && React__default.createElement(DataGrid.Selection, {
|
|
35889
|
+
mode: (_props$selectOptions$ = (_props$selectOptions2 = props.selectOptions) === null || _props$selectOptions2 === void 0 ? void 0 : _props$selectOptions2.mode) != null ? _props$selectOptions$ : "multiple",
|
|
35890
|
+
deferred: (_props$selectOptions$2 = (_props$selectOptions3 = props.selectOptions) === null || _props$selectOptions3 === void 0 ? void 0 : _props$selectOptions3.deferred) != null ? _props$selectOptions$2 : true
|
|
35891
|
+
}), React__default.createElement(DataGrid.ColumnChooser, {
|
|
35892
|
+
enabled: true,
|
|
35893
|
+
mode: "select"
|
|
35894
|
+
}, !props.columnChooserPositionDisabled && React__default.createElement(DataGrid.Position, {
|
|
35895
|
+
my: "right top",
|
|
35896
|
+
at: "right bottom",
|
|
35897
|
+
of: document.querySelector("." + props.dataGridPageName) ? "." + props.dataGridPageName + " .dx-datagrid-column-chooser-button" : ".dx-datagrid-column-chooser-button"
|
|
35898
|
+
}), React__default.createElement(DataGrid.ColumnChooserSearch, {
|
|
35899
|
+
enabled: true,
|
|
35900
|
+
editorOptions: {
|
|
35901
|
+
placeholder: ""
|
|
35902
|
+
}
|
|
35903
|
+
}), React__default.createElement(DataGrid.ColumnChooserSelection, {
|
|
35904
|
+
allowSelectAll: true,
|
|
35905
|
+
selectByClick: true,
|
|
35906
|
+
recursive: true
|
|
35907
|
+
})), React__default.createElement(DataGrid.Toolbar, null, React__default.createElement(DataGrid.Item, {
|
|
35908
|
+
name: "searchPanel"
|
|
35909
|
+
}), React__default.createElement(DataGrid.Item, {
|
|
35910
|
+
name: "columnChooserButton",
|
|
35911
|
+
cssClass: "toolbarPanelItems"
|
|
35912
|
+
}), React__default.createElement(DataGrid.Item, {
|
|
35913
|
+
name: "exportButton",
|
|
35914
|
+
cssClass: "toolbarPanelItems"
|
|
35915
|
+
}), hasFastUpdate && React__default.createElement(DataGrid.Item, null, React__default.createElement(OdsButton, {
|
|
35916
|
+
key: "odsbutton-fastupdate",
|
|
35917
|
+
onClick: onCustomFastUpdateButtonClick
|
|
35918
|
+
}, fastUpdateButtonText != null ? fastUpdateButtonText : "Fast Update"))), React__default.createElement(DataGrid.Summary, {
|
|
35919
|
+
calculateCustomSummary: renderTotal
|
|
35920
|
+
}, React__default.createElement(DataGrid.TotalItem, {
|
|
35921
|
+
column: gridColumns[0].dataField,
|
|
35922
|
+
summaryType: "custom",
|
|
35923
|
+
displayFormat: renderTotal()
|
|
35924
|
+
}), gridRef.current && showSummaryItems$1(props) && getSummaryItems$1(props, gridColumns, gridRef.current.instance).map(function (item, _index) {
|
|
35925
|
+
return item;
|
|
35926
|
+
})), React__default.createElement(DataGrid.StateStoring, {
|
|
35927
|
+
enabled: true,
|
|
35928
|
+
type: "custom",
|
|
35929
|
+
customLoad: customLoad,
|
|
35930
|
+
customSave: customSave
|
|
35931
|
+
})));
|
|
35932
|
+
};
|
|
35933
|
+
|
|
34809
35934
|
exports.DxTreeList = DxTreeList;
|
|
34810
35935
|
exports.OdsAlert = OdsAlert;
|
|
34811
35936
|
exports.OdsAutoComplete = OdsAutoComplete;
|
|
34812
35937
|
exports.OdsBadge = OdsBadge;
|
|
34813
35938
|
exports.OdsBadgeRibbon = OdsBadgeRibbon;
|
|
34814
35939
|
exports.OdsBannerAlert = OdsBannerAlert;
|
|
35940
|
+
exports.OdsBasicDataGrid = OdsBasicDataGrid;
|
|
34815
35941
|
exports.OdsBasicTable = OdsBasicTable;
|
|
34816
35942
|
exports.OdsButton = OdsButton;
|
|
34817
35943
|
exports.OdsCalendar = OdsCalendar;
|