ods-component-lib 1.18.2 → 1.18.3
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/OdsRemoteDataGrid.d.ts +12 -8
- package/dist/index.css +2 -84
- package/dist/index.js +71 -68
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +71 -68
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IDataGridOptions, IButtonProps, ISelectionProps, IEditingProps } from 'devextreme-react/data-grid';
|
|
3
3
|
interface IOdsDataGridProps extends IDataGridOptions {
|
|
4
|
-
token?: string;
|
|
5
4
|
isApplyButtonClicked?: boolean;
|
|
6
5
|
language: string;
|
|
7
|
-
requestData?: any;
|
|
8
|
-
apiUrl?: string;
|
|
9
6
|
exportFileName: string;
|
|
10
7
|
filterEnabledShow: boolean;
|
|
11
8
|
pageTitle?: string;
|
|
12
9
|
toolbarButtonGroup?: IButtonGroup[];
|
|
13
10
|
actionButtonGroup?: IButtonGroup[];
|
|
14
|
-
key: string;
|
|
15
11
|
columns: any[];
|
|
16
|
-
pageSize
|
|
12
|
+
pageSize?: number;
|
|
17
13
|
actionColumnEnable: boolean;
|
|
18
14
|
selectOptions?: ISelectOptions;
|
|
19
15
|
columnChooserPositionDisabled?: boolean;
|
|
20
16
|
pagingEnable?: boolean;
|
|
21
17
|
edit?: IEditingoptions;
|
|
22
18
|
isServerSide: boolean;
|
|
23
|
-
|
|
19
|
+
axiosRequest?: IAxiosProps;
|
|
20
|
+
}
|
|
21
|
+
interface IAxiosProps {
|
|
22
|
+
token: string;
|
|
23
|
+
requestData?: any;
|
|
24
|
+
apiUrl: string;
|
|
25
|
+
environmentUrl: string;
|
|
26
|
+
requestQueryString?: string;
|
|
27
|
+
requestType: string;
|
|
24
28
|
}
|
|
25
29
|
interface IEditingoptions extends IEditingProps {
|
|
26
30
|
formItems?: any[];
|
|
@@ -35,5 +39,5 @@ interface IButtonGroup extends IButtonProps {
|
|
|
35
39
|
onclick?: React.MouseEventHandler<HTMLElement>;
|
|
36
40
|
actionPermission?: boolean;
|
|
37
41
|
}
|
|
38
|
-
declare const
|
|
39
|
-
export default
|
|
42
|
+
declare const _default: React.MemoExoticComponent<(props: IOdsDataGridProps) => React.JSX.Element>;
|
|
43
|
+
export default _default;
|
package/dist/index.css
CHANGED
|
@@ -1,87 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
:root {
|
|
3
|
-
--colorText: #000000E0;
|
|
4
|
-
--controlItemBgActive:#E6F4FF
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
tr._2CvVM._3udtX._32nFu{
|
|
8
|
-
background: var(--controlItemBgActive, #E6F4FF) !important;
|
|
9
|
-
display: flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
flex: 1 0 0;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
._2jY0l {
|
|
15
|
-
padding-top: 10px !important;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
._36VXO {
|
|
19
|
-
width: 100%;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
div._1veiV {
|
|
23
|
-
max-width: 100% !important;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
tr:first-child {
|
|
27
|
-
background-color: #E6F4FF !important; /* Replace with your desired background color */
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
._q4jkZ > ._1UPzZ, ._q4jkZ > ._1XbNt {
|
|
32
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
._q4jkZ ._1UPzZ, ._1GEDH + ._1UPzZ, ._1UPzZ._4V16J {
|
|
36
|
-
border-top: 1px solid rgba(0, 0, 0, 0.06);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
._q4jkZ > ._1GEDH, ._q4jkZ > ._1UPzZ, ._q4jkZ > ._1XbNt {
|
|
40
|
-
border-left: 1px solid rgba(0, 0, 0, 0.06);
|
|
41
|
-
border-right: 1px solid rgba(0, 0, 0, 0.06);
|
|
42
|
-
border-radius: 5px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
._q4jkZ > ._3mbXf, ._q4jkZ > ._1GEDH {
|
|
46
|
-
border-top: 1px solid rgba(0, 0, 0, 0.06);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
._1GEDH ._2NiLf ._2CvVM > td {
|
|
50
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
51
|
-
/* border-right: 1px solid rgba(0, 108, 198, 1); */
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
._36VXO ._3udtX > td {
|
|
55
|
-
border-left: 1px solid rgba(0, 0, 0, 0.06);
|
|
56
|
-
border-right: 1px solid rgba(0, 0, 0, 0.06);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
._1GEDH {
|
|
60
|
-
border-bottom: none;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
._1GEDH {
|
|
64
|
-
color: #000000E0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
._pljbP {
|
|
68
|
-
border-radius: 6px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
._3nKdN, ._23Fql {
|
|
72
|
-
background-color: #E6F4FF;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
._1hTxK._3umXw {
|
|
76
|
-
background-color: #E6F4FF;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
._3XxAq{
|
|
80
|
-
max-width: 230px;
|
|
81
|
-
min-width: 230px;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
2
|
|
|
86
3
|
._q4jkZ > ._1UPzZ, ._q4jkZ > ._1XbNt {
|
|
87
4
|
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
@@ -192,9 +109,10 @@ tr._2CvVM._3Xrp3._19iuB._3udtX {
|
|
|
192
109
|
}
|
|
193
110
|
|
|
194
111
|
._36VXO._8U8_Y._q4jkZ {
|
|
195
|
-
border-radius: 16px;
|
|
112
|
+
border-radius: 16px ;
|
|
196
113
|
}
|
|
197
114
|
|
|
115
|
+
|
|
198
116
|
._3mbXf {
|
|
199
117
|
border-radius: 6px;
|
|
200
118
|
}
|
package/dist/index.js
CHANGED
|
@@ -16487,8 +16487,6 @@ function OdsDataGridNew(props) {
|
|
|
16487
16487
|
}, buttonGroupItem.label));
|
|
16488
16488
|
}), React__default.createElement(DataGrid.Item, {
|
|
16489
16489
|
name: "searchPanel"
|
|
16490
|
-
}), React__default.createElement(DataGrid.Item, {
|
|
16491
|
-
name: "applyFilterButton"
|
|
16492
16490
|
}), React__default.createElement(DataGrid.Item, {
|
|
16493
16491
|
name: "columnChooserButton"
|
|
16494
16492
|
}), React__default.createElement(DataGrid.Item, {
|
|
@@ -16544,7 +16542,7 @@ var totalPageCount = 1;
|
|
|
16544
16542
|
var loadedPageCount = 1;
|
|
16545
16543
|
var totalRecordCount = 0;
|
|
16546
16544
|
var useToken$1 = antd.theme.useToken;
|
|
16547
|
-
var
|
|
16545
|
+
var DataGridEesCopy = function DataGridEesCopy(props) {
|
|
16548
16546
|
var _props$selectOptions, _props$selectOptions$, _props$selectOptions2, _props$selectOptions$2, _props$selectOptions3;
|
|
16549
16547
|
var _useToken = useToken$1(),
|
|
16550
16548
|
token = _useToken.token;
|
|
@@ -16558,8 +16556,8 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16558
16556
|
var gridRef = React.useRef(null);
|
|
16559
16557
|
var headers = new Headers({
|
|
16560
16558
|
'Content-Type': 'application/json',
|
|
16561
|
-
'Authorization': 'Bearer ' + props.token,
|
|
16562
|
-
"Accept-Language": props.language
|
|
16559
|
+
'Authorization': 'Bearer ' + (props.axiosRequest ? props.axiosRequest.token : ""),
|
|
16560
|
+
"Accept-Language": props.language != "" ? props.language : 'EN'
|
|
16563
16561
|
});
|
|
16564
16562
|
React.useEffect(function () {
|
|
16565
16563
|
if (props.isApplyButtonClicked) {
|
|
@@ -16578,10 +16576,13 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16578
16576
|
props.actionButtonGroup.push({
|
|
16579
16577
|
icon: 'kebabMenu',
|
|
16580
16578
|
visible: true,
|
|
16581
|
-
disabled: false
|
|
16579
|
+
disabled: false,
|
|
16580
|
+
onclick: openActionKebab
|
|
16582
16581
|
});
|
|
16583
16582
|
}
|
|
16583
|
+
console.log(props.actionButtonGroup);
|
|
16584
16584
|
}, [props.actionButtonGroup]);
|
|
16585
|
+
var openActionKebab = function openActionKebab() {};
|
|
16585
16586
|
var handleRef = function handleRef(instance) {
|
|
16586
16587
|
if (instance) {
|
|
16587
16588
|
gridRef.current = instance;
|
|
@@ -16589,35 +16590,44 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16589
16590
|
};
|
|
16590
16591
|
var fetchData = function fetchData() {
|
|
16591
16592
|
try {
|
|
16592
|
-
|
|
16593
|
-
|
|
16594
|
-
|
|
16595
|
-
|
|
16596
|
-
|
|
16597
|
-
|
|
16598
|
-
|
|
16599
|
-
|
|
16600
|
-
|
|
16601
|
-
|
|
16602
|
-
|
|
16603
|
-
|
|
16604
|
-
|
|
16605
|
-
|
|
16593
|
+
setIsLoading(true);
|
|
16594
|
+
var _temp2 = function () {
|
|
16595
|
+
if (props.isServerSide) {
|
|
16596
|
+
var apiUrl = props.axiosRequest.environmentUrl + "" + props.axiosRequest.apiUrl;
|
|
16597
|
+
if (props.axiosRequest.requestData.PaginatedRequest !== undefined) {
|
|
16598
|
+
props.axiosRequest.requestData.PaginatedRequest.PageNumber = loadedPageCount;
|
|
16599
|
+
props.axiosRequest.requestData.PaginatedRequest.PageSize = props.pageSize;
|
|
16600
|
+
}
|
|
16601
|
+
if (props.axiosRequest.requestQueryString !== undefined) {
|
|
16602
|
+
apiUrl = apiUrl + "?" + props.axiosRequest.requestQueryString;
|
|
16603
|
+
}
|
|
16604
|
+
var requestOptions = {
|
|
16605
|
+
method: props.axiosRequest.requestType,
|
|
16606
|
+
headers: headers,
|
|
16607
|
+
body: JSON.stringify(props.axiosRequest.requestData)
|
|
16608
|
+
};
|
|
16609
|
+
var _temp = _finallyRethrows(function () {
|
|
16610
|
+
return _catch(function () {
|
|
16611
|
+
return Promise.resolve(fetch(apiUrl, requestOptions)).then(function (response) {
|
|
16612
|
+
return Promise.resolve(response.json()).then(function (newData) {
|
|
16613
|
+
setData(function (prevData) {
|
|
16614
|
+
return [].concat(prevData, newData.Data);
|
|
16615
|
+
});
|
|
16616
|
+
totalPageCount = newData.PageCount;
|
|
16617
|
+
totalRecordCount = newData.RowCount;
|
|
16618
|
+
});
|
|
16606
16619
|
});
|
|
16607
|
-
|
|
16608
|
-
|
|
16609
|
-
setIsLoading(false);
|
|
16620
|
+
}, function (error) {
|
|
16621
|
+
console.error('Error fetching data:', error);
|
|
16610
16622
|
});
|
|
16623
|
+
}, function (_wasThrown, _result) {
|
|
16624
|
+
if (_wasThrown) throw _result;
|
|
16625
|
+
return _result;
|
|
16611
16626
|
});
|
|
16612
|
-
|
|
16613
|
-
|
|
16614
|
-
|
|
16615
|
-
|
|
16616
|
-
setIsLoading(false);
|
|
16617
|
-
if (_wasThrown) throw _result;
|
|
16618
|
-
return _result;
|
|
16619
|
-
});
|
|
16620
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
16627
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
16628
|
+
}
|
|
16629
|
+
}();
|
|
16630
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
16621
16631
|
} catch (e) {
|
|
16622
16632
|
return Promise.reject(e);
|
|
16623
16633
|
}
|
|
@@ -16628,10 +16638,8 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16628
16638
|
if (dxScrollable != null) {
|
|
16629
16639
|
dxScrollable.off("scroll");
|
|
16630
16640
|
dxScrollable.on("scroll", function (args) {
|
|
16631
|
-
if (args.reachedBottom
|
|
16632
|
-
|
|
16633
|
-
getServerSide("reachedBottom");
|
|
16634
|
-
}
|
|
16641
|
+
if (args.reachedBottom) {
|
|
16642
|
+
getServerSide("reachedBottom");
|
|
16635
16643
|
}
|
|
16636
16644
|
});
|
|
16637
16645
|
}
|
|
@@ -16639,14 +16647,16 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16639
16647
|
};
|
|
16640
16648
|
var onEditorPreparing = function onEditorPreparing(e) {
|
|
16641
16649
|
if (e.row !== undefined && e.parentType === 'dataRow') {
|
|
16642
|
-
|
|
16643
|
-
|
|
16644
|
-
|
|
16645
|
-
|
|
16646
|
-
|
|
16647
|
-
|
|
16648
|
-
|
|
16649
|
-
|
|
16650
|
+
if (props.isServerSide) {
|
|
16651
|
+
var disableScrolling = function disableScrolling() {
|
|
16652
|
+
gridRef.current.instance.option('scrolling.mode', 'none');
|
|
16653
|
+
};
|
|
16654
|
+
var enableScrolling = function enableScrolling() {
|
|
16655
|
+
gridRef.current.instance.option('scrolling.mode', 'virtual');
|
|
16656
|
+
};
|
|
16657
|
+
e.editorOptions.onFocusIn = disableScrolling;
|
|
16658
|
+
e.editorOptions.onFocusOut = enableScrolling;
|
|
16659
|
+
}
|
|
16650
16660
|
}
|
|
16651
16661
|
};
|
|
16652
16662
|
var getServerSide = function getServerSide(type) {
|
|
@@ -16732,21 +16742,9 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16732
16742
|
}
|
|
16733
16743
|
return result;
|
|
16734
16744
|
};
|
|
16735
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(
|
|
16736
|
-
className: "odsDatagrid",
|
|
16737
|
-
style: {
|
|
16738
|
-
width: "100%",
|
|
16739
|
-
overflowX: 'hidden',
|
|
16740
|
-
overflowY: "hidden",
|
|
16741
|
-
marginTop: "10px",
|
|
16742
|
-
backgroundColor: token.colorBgContainer
|
|
16743
|
-
}
|
|
16744
|
-
}, React__default.createElement(DataGrid__default, {
|
|
16745
|
-
style: {
|
|
16746
|
-
borderRadius: token.borderRadiusLG * 2
|
|
16747
|
-
},
|
|
16745
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(DataGrid__default, {
|
|
16748
16746
|
keyExpr: props.keyExpr,
|
|
16749
|
-
dataSource: data,
|
|
16747
|
+
dataSource: props.isServerSide ? data : props.dataSource,
|
|
16750
16748
|
onContentReady: onContentReady,
|
|
16751
16749
|
showBorders: true,
|
|
16752
16750
|
columnAutoWidth: false,
|
|
@@ -16754,7 +16752,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16754
16752
|
onSaving: props.onSaving,
|
|
16755
16753
|
ref: handleRef,
|
|
16756
16754
|
onExporting: onExporting,
|
|
16757
|
-
height: window.innerHeight -
|
|
16755
|
+
height: props.height == undefined ? window.innerHeight - 164 : props.height,
|
|
16758
16756
|
allowColumnResizing: true,
|
|
16759
16757
|
columnResizingMode: "nextColumn",
|
|
16760
16758
|
onRowClick: props.onRowClick,
|
|
@@ -16769,6 +16767,8 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16769
16767
|
enabled: false
|
|
16770
16768
|
},
|
|
16771
16769
|
repaintChangesOnly: true,
|
|
16770
|
+
focusedRowEnabled: false,
|
|
16771
|
+
filterSyncEnabled: true,
|
|
16772
16772
|
wordWrapEnabled: props.wordWrapEnabled ? props.wordWrapEnabled : false,
|
|
16773
16773
|
columnFixing: {
|
|
16774
16774
|
enabled: true
|
|
@@ -16793,7 +16793,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16793
16793
|
dataField: "Actions",
|
|
16794
16794
|
fixed: true,
|
|
16795
16795
|
allowSorting: false,
|
|
16796
|
-
caption:
|
|
16796
|
+
caption: "Actions",
|
|
16797
16797
|
type: "buttons",
|
|
16798
16798
|
showInColumnChooser: false
|
|
16799
16799
|
}, props.actionButtonGroup && Array.isArray(props.actionButtonGroup) && props.actionButtonGroup.map(function (buttonItem) {
|
|
@@ -16828,7 +16828,15 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16828
16828
|
dataField: subItem.dataField
|
|
16829
16829
|
});
|
|
16830
16830
|
}));
|
|
16831
|
-
})))), React__default.createElement(DataGrid.
|
|
16831
|
+
})))), React__default.createElement(DataGrid.Paging, {
|
|
16832
|
+
defaultPageSize: props.pageSize
|
|
16833
|
+
}), props.pagingEnable && React__default.createElement(DataGrid.Pager, {
|
|
16834
|
+
visible: false,
|
|
16835
|
+
displayMode: "full",
|
|
16836
|
+
showPageSizeSelector: false,
|
|
16837
|
+
showNavigationButtons: false,
|
|
16838
|
+
showInfo: false
|
|
16839
|
+
}), React__default.createElement(DataGrid.Scrolling, {
|
|
16832
16840
|
showScrollbar: "always",
|
|
16833
16841
|
scrollByContent: true,
|
|
16834
16842
|
scrollByThumb: true,
|
|
@@ -16853,12 +16861,6 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16853
16861
|
}), ((_props$selectOptions = props.selectOptions) === null || _props$selectOptions === void 0 ? void 0 : _props$selectOptions.selectEnable) && React__default.createElement(DataGrid.Selection, {
|
|
16854
16862
|
mode: (_props$selectOptions$ = (_props$selectOptions2 = props.selectOptions) === null || _props$selectOptions2 === void 0 ? void 0 : _props$selectOptions2.mode) != null ? _props$selectOptions$ : "multiple",
|
|
16855
16863
|
deferred: (_props$selectOptions$2 = (_props$selectOptions3 = props.selectOptions) === null || _props$selectOptions3 === void 0 ? void 0 : _props$selectOptions3.deferred) != null ? _props$selectOptions$2 : true
|
|
16856
|
-
}), props.pagingEnable && React__default.createElement(DataGrid.Pager, {
|
|
16857
|
-
visible: false,
|
|
16858
|
-
displayMode: "full",
|
|
16859
|
-
showPageSizeSelector: false,
|
|
16860
|
-
showNavigationButtons: false,
|
|
16861
|
-
showInfo: false
|
|
16862
16864
|
}), React__default.createElement(DataGrid.ColumnChooser, {
|
|
16863
16865
|
enabled: true,
|
|
16864
16866
|
mode: "select"
|
|
@@ -16919,8 +16921,9 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16919
16921
|
type: "custom",
|
|
16920
16922
|
customLoad: customLoad,
|
|
16921
16923
|
customSave: customSave
|
|
16922
|
-
})))
|
|
16924
|
+
})));
|
|
16923
16925
|
};
|
|
16926
|
+
var OdsRemoteDataGrid = React__default.memo(DataGridEesCopy);
|
|
16924
16927
|
|
|
16925
16928
|
exports.DxTreeList = DxTreeList;
|
|
16926
16929
|
exports.DxTreeView = DxTreeView;
|