ods-component-lib 1.18.17 → 1.18.18

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.
@@ -17124,7 +17124,6 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17124
17124
  isLoading = _useState2[0],
17125
17125
  setIsLoading = _useState2[1];
17126
17126
  var fileName = props.exportFileName ? props.exportFileName + moment().format("YYYYMMDD") : "DatagridExportFile" + moment().format("YYYYMMDD");
17127
- var gridRef = useRef(null);
17128
17127
  var _useState3 = useState(0),
17129
17128
  filteredRowCount = _useState3[0];
17130
17129
  var _useState4 = useState(props.columns),
@@ -17141,6 +17140,11 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17141
17140
  'Authorization': 'Bearer ' + (props.axiosRequest ? props.axiosRequest.token : ""),
17142
17141
  "Accept-Language": props.language != "" ? props.language : 'EN'
17143
17142
  });
17143
+ useEffect(function () {
17144
+ totalPageCount = 1;
17145
+ loadedPageCount = 1;
17146
+ totalRecordCount = 0;
17147
+ }, [props.dataGridRef.current]);
17144
17148
  useEffect(function () {
17145
17149
  var _props$axiosRequest;
17146
17150
  if (props.axiosRequest !== undefined && Object.keys((_props$axiosRequest = props.axiosRequest) === null || _props$axiosRequest === void 0 ? void 0 : _props$axiosRequest.requestData).length > 0) {
@@ -17179,9 +17183,6 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17179
17183
  useEffect(function () {
17180
17184
  locale(localStorage.getItem("locale"));
17181
17185
  loadMessages(JSON.parse(localStorage.getItem("localTranslation")));
17182
- if (gridRef.current) {
17183
- gridRef.current.instance.updateDimensions();
17184
- }
17185
17186
  }, []);
17186
17187
  var actionButtons = useMemo(function () {
17187
17188
  if (props.actionButtonGroup) {
@@ -17205,11 +17206,6 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17205
17206
  return [];
17206
17207
  }
17207
17208
  }, [props.actionButtonGroup]);
17208
- var handleRef = function handleRef(instance) {
17209
- if (instance) {
17210
- gridRef.current = instance;
17211
- }
17212
- };
17213
17209
  var fetchData = useCallback(function () {
17214
17210
  try {
17215
17211
  if (props.axiosRequest == undefined) return Promise.resolve();
@@ -17264,14 +17260,17 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17264
17260
  if (e.row !== undefined && e.parentType === 'dataRow') {
17265
17261
  if (props.isServerSide) {
17266
17262
  var disableScrolling = function disableScrolling() {
17267
- gridRef.current.instance.option('scrolling.mode', 'none');
17263
+ props.dataGridRef.current.instance.option('scrolling.mode', 'none');
17268
17264
  };
17269
17265
  var enableScrolling = function enableScrolling() {
17270
- gridRef.current.instance.option('scrolling.mode', 'virtual');
17266
+ props.dataGridRef.current.instance.option('scrolling.mode', 'virtual');
17271
17267
  };
17272
17268
  e.editorOptions.onFocusIn = disableScrolling;
17273
17269
  e.editorOptions.onFocusOut = enableScrolling;
17274
17270
  }
17271
+ if (props.onEditorPreparing) {
17272
+ props.onEditorPreparing(e);
17273
+ }
17275
17274
  }
17276
17275
  if (e.editorOptions && e.rowType === 'data' && e.parentType === 'dataRow') {
17277
17276
  e.editorOptions.onValueChanged = function (args) {
@@ -17370,7 +17369,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17370
17369
  }, []);
17371
17370
  var renderTotal = useCallback(function () {
17372
17371
  var totalloaded = 0;
17373
- if (data.length < 50) {
17372
+ if (data.length < 50 || !props.isServerSide || loadedPageCount == totalPageCount) {
17374
17373
  totalloaded = data.length;
17375
17374
  } else {
17376
17375
  totalloaded = loadedPageCount * props.pageSize;
@@ -17378,6 +17377,8 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17378
17377
  var result = "";
17379
17378
  if (filteredRowCount > 0) {
17380
17379
  result = "" + totalloaded + props.customSummary.summaryFilteredDataLabel + (totalRecordCount > 0 ? totalloaded + " " + props.customSummary.summaryLoadedDataLabel + ("- " + totalRecordCount) + props.customSummary.summaryTotalDataLabel : " ");
17380
+ } else if (!props.isServerSide && totalloaded > 0) {
17381
+ result = totalloaded + " " + props.customSummary.summaryLoadedDataLabel + ("- " + totalloaded) + props.customSummary.summaryTotalDataLabel;
17381
17382
  } else {
17382
17383
  result = totalRecordCount > 0 ? totalloaded + " " + props.customSummary.summaryLoadedDataLabel + ("- " + totalRecordCount) + props.customSummary.summaryTotalDataLabel : "";
17383
17384
  }
@@ -17441,7 +17442,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17441
17442
  showBorders: true,
17442
17443
  columnAutoWidth: false,
17443
17444
  onEditorPreparing: onEditorPreparing,
17444
- ref: handleRef,
17445
+ ref: props.dataGridRef,
17445
17446
  onExporting: onExporting,
17446
17447
  height: props.height == undefined ? window.innerHeight - 164 : props.height,
17447
17448
  allowColumnResizing: true,
@@ -17466,7 +17467,9 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
17466
17467
  },
17467
17468
  onSelectionChanged: props.onSelectionChanged,
17468
17469
  noDataText: props.noDataText,
17469
- onSaved: props.onSaved
17470
+ onSaved: props.onSaved,
17471
+ onSaving: props.onSaving,
17472
+ onEditCanceling: props.onEditCanceling
17470
17473
  }, columns.map(function (col) {
17471
17474
  return React.createElement(Column, Object.assign({
17472
17475
  key: col.dataField