ods-component-lib 1.18.2 → 1.18.4
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 +73 -69
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +73 -69
- 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, {
|
|
@@ -16558,17 +16556,18 @@ 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) {
|
|
16566
16564
|
totalPageCount = 1;
|
|
16567
16565
|
loadedPageCount = 1;
|
|
16568
16566
|
totalRecordCount = 0;
|
|
16567
|
+
setData([]);
|
|
16569
16568
|
fetchData();
|
|
16570
16569
|
}
|
|
16571
|
-
}, [props.isApplyButtonClicked]);
|
|
16570
|
+
}, [props.isApplyButtonClicked, props.axiosRequest.requestData]);
|
|
16572
16571
|
React.useEffect(function () {
|
|
16573
16572
|
localization.locale(localStorage.getItem("locale"));
|
|
16574
16573
|
localization.loadMessages(JSON.parse(localStorage.getItem("localTranslation")));
|
|
@@ -16578,10 +16577,13 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16578
16577
|
props.actionButtonGroup.push({
|
|
16579
16578
|
icon: 'kebabMenu',
|
|
16580
16579
|
visible: true,
|
|
16581
|
-
disabled: false
|
|
16580
|
+
disabled: false,
|
|
16581
|
+
onclick: openActionKebab
|
|
16582
16582
|
});
|
|
16583
16583
|
}
|
|
16584
|
+
console.log(props.actionButtonGroup);
|
|
16584
16585
|
}, [props.actionButtonGroup]);
|
|
16586
|
+
var openActionKebab = function openActionKebab() {};
|
|
16585
16587
|
var handleRef = function handleRef(instance) {
|
|
16586
16588
|
if (instance) {
|
|
16587
16589
|
gridRef.current = instance;
|
|
@@ -16589,35 +16591,44 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16589
16591
|
};
|
|
16590
16592
|
var fetchData = function fetchData() {
|
|
16591
16593
|
try {
|
|
16592
|
-
|
|
16593
|
-
|
|
16594
|
-
|
|
16595
|
-
|
|
16596
|
-
|
|
16597
|
-
|
|
16598
|
-
|
|
16599
|
-
|
|
16600
|
-
|
|
16601
|
-
|
|
16602
|
-
|
|
16603
|
-
|
|
16604
|
-
|
|
16605
|
-
|
|
16594
|
+
setIsLoading(true);
|
|
16595
|
+
var _temp2 = function () {
|
|
16596
|
+
if (props.isServerSide) {
|
|
16597
|
+
var apiUrl = props.axiosRequest.environmentUrl + "" + props.axiosRequest.apiUrl;
|
|
16598
|
+
if (props.axiosRequest.requestData.PaginatedRequest !== undefined) {
|
|
16599
|
+
props.axiosRequest.requestData.PaginatedRequest.PageNumber = loadedPageCount;
|
|
16600
|
+
props.axiosRequest.requestData.PaginatedRequest.PageSize = props.pageSize;
|
|
16601
|
+
}
|
|
16602
|
+
if (props.axiosRequest.requestQueryString !== undefined) {
|
|
16603
|
+
apiUrl = apiUrl + "?" + props.axiosRequest.requestQueryString;
|
|
16604
|
+
}
|
|
16605
|
+
var requestOptions = {
|
|
16606
|
+
method: props.axiosRequest.requestType,
|
|
16607
|
+
headers: headers,
|
|
16608
|
+
body: JSON.stringify(props.axiosRequest.requestData)
|
|
16609
|
+
};
|
|
16610
|
+
var _temp = _finallyRethrows(function () {
|
|
16611
|
+
return _catch(function () {
|
|
16612
|
+
return Promise.resolve(fetch(apiUrl, requestOptions)).then(function (response) {
|
|
16613
|
+
return Promise.resolve(response.json()).then(function (newData) {
|
|
16614
|
+
setData(function (prevData) {
|
|
16615
|
+
return [].concat(prevData, newData.Data);
|
|
16616
|
+
});
|
|
16617
|
+
totalPageCount = newData.PageCount;
|
|
16618
|
+
totalRecordCount = newData.RowCount;
|
|
16619
|
+
});
|
|
16606
16620
|
});
|
|
16607
|
-
|
|
16608
|
-
|
|
16609
|
-
setIsLoading(false);
|
|
16621
|
+
}, function (error) {
|
|
16622
|
+
console.error('Error fetching data:', error);
|
|
16610
16623
|
});
|
|
16624
|
+
}, function (_wasThrown, _result) {
|
|
16625
|
+
if (_wasThrown) throw _result;
|
|
16626
|
+
return _result;
|
|
16611
16627
|
});
|
|
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);
|
|
16628
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
16629
|
+
}
|
|
16630
|
+
}();
|
|
16631
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
16621
16632
|
} catch (e) {
|
|
16622
16633
|
return Promise.reject(e);
|
|
16623
16634
|
}
|
|
@@ -16628,10 +16639,8 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16628
16639
|
if (dxScrollable != null) {
|
|
16629
16640
|
dxScrollable.off("scroll");
|
|
16630
16641
|
dxScrollable.on("scroll", function (args) {
|
|
16631
|
-
if (args.reachedBottom
|
|
16632
|
-
|
|
16633
|
-
getServerSide("reachedBottom");
|
|
16634
|
-
}
|
|
16642
|
+
if (args.reachedBottom) {
|
|
16643
|
+
getServerSide("reachedBottom");
|
|
16635
16644
|
}
|
|
16636
16645
|
});
|
|
16637
16646
|
}
|
|
@@ -16639,14 +16648,16 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16639
16648
|
};
|
|
16640
16649
|
var onEditorPreparing = function onEditorPreparing(e) {
|
|
16641
16650
|
if (e.row !== undefined && e.parentType === 'dataRow') {
|
|
16642
|
-
|
|
16643
|
-
|
|
16644
|
-
|
|
16645
|
-
|
|
16646
|
-
|
|
16647
|
-
|
|
16648
|
-
|
|
16649
|
-
|
|
16651
|
+
if (props.isServerSide) {
|
|
16652
|
+
var disableScrolling = function disableScrolling() {
|
|
16653
|
+
gridRef.current.instance.option('scrolling.mode', 'none');
|
|
16654
|
+
};
|
|
16655
|
+
var enableScrolling = function enableScrolling() {
|
|
16656
|
+
gridRef.current.instance.option('scrolling.mode', 'virtual');
|
|
16657
|
+
};
|
|
16658
|
+
e.editorOptions.onFocusIn = disableScrolling;
|
|
16659
|
+
e.editorOptions.onFocusOut = enableScrolling;
|
|
16660
|
+
}
|
|
16650
16661
|
}
|
|
16651
16662
|
};
|
|
16652
16663
|
var getServerSide = function getServerSide(type) {
|
|
@@ -16732,21 +16743,9 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16732
16743
|
}
|
|
16733
16744
|
return result;
|
|
16734
16745
|
};
|
|
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
|
-
},
|
|
16746
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(DataGrid__default, {
|
|
16748
16747
|
keyExpr: props.keyExpr,
|
|
16749
|
-
dataSource: data,
|
|
16748
|
+
dataSource: props.isServerSide ? data : props.dataSource,
|
|
16750
16749
|
onContentReady: onContentReady,
|
|
16751
16750
|
showBorders: true,
|
|
16752
16751
|
columnAutoWidth: false,
|
|
@@ -16754,7 +16753,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16754
16753
|
onSaving: props.onSaving,
|
|
16755
16754
|
ref: handleRef,
|
|
16756
16755
|
onExporting: onExporting,
|
|
16757
|
-
height: window.innerHeight -
|
|
16756
|
+
height: props.height == undefined ? window.innerHeight - 164 : props.height,
|
|
16758
16757
|
allowColumnResizing: true,
|
|
16759
16758
|
columnResizingMode: "nextColumn",
|
|
16760
16759
|
onRowClick: props.onRowClick,
|
|
@@ -16769,6 +16768,8 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16769
16768
|
enabled: false
|
|
16770
16769
|
},
|
|
16771
16770
|
repaintChangesOnly: true,
|
|
16771
|
+
focusedRowEnabled: false,
|
|
16772
|
+
filterSyncEnabled: true,
|
|
16772
16773
|
wordWrapEnabled: props.wordWrapEnabled ? props.wordWrapEnabled : false,
|
|
16773
16774
|
columnFixing: {
|
|
16774
16775
|
enabled: true
|
|
@@ -16793,7 +16794,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16793
16794
|
dataField: "Actions",
|
|
16794
16795
|
fixed: true,
|
|
16795
16796
|
allowSorting: false,
|
|
16796
|
-
caption:
|
|
16797
|
+
caption: "Actions",
|
|
16797
16798
|
type: "buttons",
|
|
16798
16799
|
showInColumnChooser: false
|
|
16799
16800
|
}, props.actionButtonGroup && Array.isArray(props.actionButtonGroup) && props.actionButtonGroup.map(function (buttonItem) {
|
|
@@ -16828,7 +16829,15 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16828
16829
|
dataField: subItem.dataField
|
|
16829
16830
|
});
|
|
16830
16831
|
}));
|
|
16831
|
-
})))), React__default.createElement(DataGrid.
|
|
16832
|
+
})))), React__default.createElement(DataGrid.Paging, {
|
|
16833
|
+
defaultPageSize: props.pageSize
|
|
16834
|
+
}), props.pagingEnable && React__default.createElement(DataGrid.Pager, {
|
|
16835
|
+
visible: false,
|
|
16836
|
+
displayMode: "full",
|
|
16837
|
+
showPageSizeSelector: false,
|
|
16838
|
+
showNavigationButtons: false,
|
|
16839
|
+
showInfo: false
|
|
16840
|
+
}), React__default.createElement(DataGrid.Scrolling, {
|
|
16832
16841
|
showScrollbar: "always",
|
|
16833
16842
|
scrollByContent: true,
|
|
16834
16843
|
scrollByThumb: true,
|
|
@@ -16853,12 +16862,6 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16853
16862
|
}), ((_props$selectOptions = props.selectOptions) === null || _props$selectOptions === void 0 ? void 0 : _props$selectOptions.selectEnable) && React__default.createElement(DataGrid.Selection, {
|
|
16854
16863
|
mode: (_props$selectOptions$ = (_props$selectOptions2 = props.selectOptions) === null || _props$selectOptions2 === void 0 ? void 0 : _props$selectOptions2.mode) != null ? _props$selectOptions$ : "multiple",
|
|
16855
16864
|
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
16865
|
}), React__default.createElement(DataGrid.ColumnChooser, {
|
|
16863
16866
|
enabled: true,
|
|
16864
16867
|
mode: "select"
|
|
@@ -16919,8 +16922,9 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
16919
16922
|
type: "custom",
|
|
16920
16923
|
customLoad: customLoad,
|
|
16921
16924
|
customSave: customSave
|
|
16922
|
-
})))
|
|
16925
|
+
})));
|
|
16923
16926
|
};
|
|
16927
|
+
var OdsRemoteDataGrid$1 = React__default.memo(OdsRemoteDataGrid);
|
|
16924
16928
|
|
|
16925
16929
|
exports.DxTreeList = DxTreeList;
|
|
16926
16930
|
exports.DxTreeView = DxTreeView;
|
|
@@ -16961,7 +16965,7 @@ exports.OdsRadio = OdsRadio;
|
|
|
16961
16965
|
exports.OdsRadioGroup = OdsRadioGroup;
|
|
16962
16966
|
exports.OdsRangeTimepicker = OdsRangeTimepicker;
|
|
16963
16967
|
exports.OdsRate = OdsRate;
|
|
16964
|
-
exports.OdsRemoteDataGrid = OdsRemoteDataGrid;
|
|
16968
|
+
exports.OdsRemoteDataGrid = OdsRemoteDataGrid$1;
|
|
16965
16969
|
exports.OdsSearch = OdsSearch;
|
|
16966
16970
|
exports.OdsSelect = OdsSelect;
|
|
16967
16971
|
exports.OdsSelectableTable = OdsSelectableTable;
|