ods-component-lib 1.18.15 → 1.18.17

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.
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { IDataGridOptions, IButtonProps, ISelectionProps, IEditingProps, ISummaryProps } from 'devextreme-react/data-grid';
3
3
  interface IOdsDataGridProps extends IDataGridOptions {
4
- isApplyButtonClicked?: boolean;
5
4
  language: string;
6
5
  exportFileName: string;
7
6
  filterEnabledShow: boolean;
package/dist/index.js CHANGED
@@ -17176,6 +17176,11 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17176
17176
  setColumns(newColumns);
17177
17177
  }
17178
17178
  }, [props.columns]);
17179
+ React.useEffect(function () {
17180
+ if (Array.isArray(props.dataSource) && props.dataSource.length > 0) {
17181
+ setData(props.dataSource);
17182
+ }
17183
+ }, [props.dataSource]);
17179
17184
  React.useEffect(function () {
17180
17185
  localization.locale(localStorage.getItem("locale"));
17181
17186
  localization.loadMessages(JSON.parse(localStorage.getItem("localTranslation")));
@@ -17233,9 +17238,14 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17233
17238
  return _catch(function () {
17234
17239
  return Promise.resolve(fetch(apiUrl, requestOptions)).then(function (response) {
17235
17240
  return Promise.resolve(response.json()).then(function (newData) {
17236
- setData(function (prevData) {
17237
- return [].concat(prevData, newData.Data);
17238
- });
17241
+ if (loadedPageCount == 1) {
17242
+ setData(newData.Data);
17243
+ loadedPageCount = 1;
17244
+ } else if (totalPageCount >= loadedPageCount) {
17245
+ setData(function (prevData) {
17246
+ return [].concat(prevData, newData.Data);
17247
+ });
17248
+ }
17239
17249
  totalPageCount = newData.PageCount;
17240
17250
  totalRecordCount = newData.RowCount;
17241
17251
  });
@@ -17432,7 +17442,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17432
17442
  }, [data.length]);
17433
17443
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(DataGrid__default, {
17434
17444
  keyExpr: props.keyExpr,
17435
- dataSource: props.isServerSide ? data : props.dataSource,
17445
+ dataSource: data,
17436
17446
  showBorders: true,
17437
17447
  columnAutoWidth: false,
17438
17448
  onEditorPreparing: onEditorPreparing,