@progress/kendo-react-grid 5.11.1-dev.202302071533 → 5.11.1-dev.202302131506

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/es/Grid.d.ts CHANGED
@@ -170,7 +170,6 @@ export declare class Grid extends React.Component<GridProps, {}> {
170
170
  private forceUpdateTimeout;
171
171
  private isRtl;
172
172
  private _gridId;
173
- private _prevTotal;
174
173
  private get _header();
175
174
  constructor(props: GridProps);
176
175
  /**
@@ -231,6 +230,7 @@ export declare class Grid extends React.Component<GridProps, {}> {
231
230
  private columnToGroup;
232
231
  private resetTableWidth;
233
232
  private onResize;
233
+ private reInitVirtualization;
234
234
  private flatData;
235
235
  private rowHeightService;
236
236
  private childrenToArray;
package/dist/es/Grid.js CHANGED
@@ -116,7 +116,6 @@ var Grid = /** @class */ (function (_super) {
116
116
  _this.forceUpdateTimeout = undefined;
117
117
  _this.isRtl = false;
118
118
  _this._gridId = guid();
119
- _this._prevTotal = undefined;
120
119
  /**
121
120
  * Method to allow the scroll to be set to a specific row index.
122
121
  *
@@ -173,11 +172,7 @@ var Grid = /** @class */ (function (_super) {
173
172
  return false;
174
173
  };
175
174
  _this.initializeVirtualization = function (total, groupable) {
176
- if (_this.props.total !== _this._prevTotal || (_this.props.scrollable === 'virtual') !== _this.vs.scrollableVirtual) {
177
- _this.vs.reset();
178
- var VS = _this.getVirtualScroll(_this.props);
179
- _this.vs = new VS(groupable || _this.props.rowHeight === undefined || _this.props.rowHeight === 0);
180
- }
175
+ _this.reInitVirtualization(_this.props.scrollable === 'virtual', _this.props.total, _this.props.filter, _this.props.group, _this.props.sort, groupable || _this.props.rowHeight === undefined || _this.props.rowHeight === 0);
181
176
  _this.vs.fixedScroll = _this.props.fixedScroll || false;
182
177
  _this.vs.PageChange = _this.pageChange;
183
178
  _this.vs.realSkip = _this.props.skip || 0;
@@ -307,7 +302,7 @@ var Grid = /** @class */ (function (_super) {
307
302
  _this.pageChange({ skip: event.skip, take: event.take }, event.syntheticEvent);
308
303
  };
309
304
  _this.sortChange = function (sort, syntheticEvent) {
310
- _this.raiseDataEvent(_this.props.onSortChange, { sort: sort }, { sort: sort }, syntheticEvent);
305
+ _this.raiseDataEvent(_this.props.onSortChange, { sort: sort }, __assign({ sort: sort }, (_this.props.scrollable === 'virtual' ? { skip: 0 } : {})), syntheticEvent);
311
306
  };
312
307
  _this.filterChange = function (filter, syntheticEvent) {
313
308
  _this.raiseDataEvent(_this.props.onFilterChange, { filter: filter }, { filter: filter || undefined, skip: 0 }, syntheticEvent);
@@ -333,6 +328,11 @@ var Grid = /** @class */ (function (_super) {
333
328
  });
334
329
  }
335
330
  };
331
+ _this.reInitVirtualization = memoizeOne(function (_vScrolling, _total, _filter, _group, _sort, useCached) {
332
+ _this.vs.reset();
333
+ var VS = _this.getVirtualScroll(_this.props);
334
+ _this.vs = new VS(useCached);
335
+ });
336
336
  _this.flatData = memoizeOne(function (propsData, groupingFooter, skip, group, expandField, _filter, _sort) {
337
337
  var flattedData = [];
338
338
  var resolvedGroupsCount = flatData(flattedData, propsData, groupingFooter, { index: skip }, group !== undefined, expandField);
@@ -499,7 +499,6 @@ var Grid = /** @class */ (function (_super) {
499
499
  setScrollbarWidth();
500
500
  var rtl = isRtl(this.element);
501
501
  this.isRtl = rtl;
502
- this._prevTotal = this.props.total;
503
502
  tableKeyboardNavigation.onComponentDidMount({
504
503
  scope: this.element || undefined,
505
504
  contextStateRef: this.contextStateRef,
@@ -525,7 +524,6 @@ var Grid = /** @class */ (function (_super) {
525
524
  */
526
525
  Grid.prototype.componentDidUpdate = function () {
527
526
  setScrollbarWidth();
528
- this._prevTotal = this.props.total;
529
527
  if (this.vs.tableTransform && this.vs.table) {
530
528
  this.vs.table.style.transform = this.vs.tableTransform;
531
529
  this.vs.tableTransform = '';
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-grid',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1675783223,
8
+ publishDate: 1676299603,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
11
11
  };
@@ -170,7 +170,6 @@ export declare class Grid extends React.Component<GridProps, {}> {
170
170
  private forceUpdateTimeout;
171
171
  private isRtl;
172
172
  private _gridId;
173
- private _prevTotal;
174
173
  private get _header();
175
174
  constructor(props: GridProps);
176
175
  /**
@@ -231,6 +230,7 @@ export declare class Grid extends React.Component<GridProps, {}> {
231
230
  private columnToGroup;
232
231
  private resetTableWidth;
233
232
  private onResize;
233
+ private reInitVirtualization;
234
234
  private flatData;
235
235
  private rowHeightService;
236
236
  private childrenToArray;
package/dist/npm/Grid.js CHANGED
@@ -119,7 +119,6 @@ var Grid = /** @class */ (function (_super) {
119
119
  _this.forceUpdateTimeout = undefined;
120
120
  _this.isRtl = false;
121
121
  _this._gridId = (0, kendo_react_common_1.guid)();
122
- _this._prevTotal = undefined;
123
122
  /**
124
123
  * Method to allow the scroll to be set to a specific row index.
125
124
  *
@@ -176,11 +175,7 @@ var Grid = /** @class */ (function (_super) {
176
175
  return false;
177
176
  };
178
177
  _this.initializeVirtualization = function (total, groupable) {
179
- if (_this.props.total !== _this._prevTotal || (_this.props.scrollable === 'virtual') !== _this.vs.scrollableVirtual) {
180
- _this.vs.reset();
181
- var VS = _this.getVirtualScroll(_this.props);
182
- _this.vs = new VS(groupable || _this.props.rowHeight === undefined || _this.props.rowHeight === 0);
183
- }
178
+ _this.reInitVirtualization(_this.props.scrollable === 'virtual', _this.props.total, _this.props.filter, _this.props.group, _this.props.sort, groupable || _this.props.rowHeight === undefined || _this.props.rowHeight === 0);
184
179
  _this.vs.fixedScroll = _this.props.fixedScroll || false;
185
180
  _this.vs.PageChange = _this.pageChange;
186
181
  _this.vs.realSkip = _this.props.skip || 0;
@@ -310,7 +305,7 @@ var Grid = /** @class */ (function (_super) {
310
305
  _this.pageChange({ skip: event.skip, take: event.take }, event.syntheticEvent);
311
306
  };
312
307
  _this.sortChange = function (sort, syntheticEvent) {
313
- _this.raiseDataEvent(_this.props.onSortChange, { sort: sort }, { sort: sort }, syntheticEvent);
308
+ _this.raiseDataEvent(_this.props.onSortChange, { sort: sort }, __assign({ sort: sort }, (_this.props.scrollable === 'virtual' ? { skip: 0 } : {})), syntheticEvent);
314
309
  };
315
310
  _this.filterChange = function (filter, syntheticEvent) {
316
311
  _this.raiseDataEvent(_this.props.onFilterChange, { filter: filter }, { filter: filter || undefined, skip: 0 }, syntheticEvent);
@@ -336,6 +331,11 @@ var Grid = /** @class */ (function (_super) {
336
331
  });
337
332
  }
338
333
  };
334
+ _this.reInitVirtualization = (0, kendo_react_common_1.memoizeOne)(function (_vScrolling, _total, _filter, _group, _sort, useCached) {
335
+ _this.vs.reset();
336
+ var VS = _this.getVirtualScroll(_this.props);
337
+ _this.vs = new VS(useCached);
338
+ });
339
339
  _this.flatData = (0, kendo_react_common_1.memoizeOne)(function (propsData, groupingFooter, skip, group, expandField, _filter, _sort) {
340
340
  var flattedData = [];
341
341
  var resolvedGroupsCount = (0, index_1.flatData)(flattedData, propsData, groupingFooter, { index: skip }, group !== undefined, expandField);
@@ -502,7 +502,6 @@ var Grid = /** @class */ (function (_super) {
502
502
  (0, kendo_react_common_1.setScrollbarWidth)();
503
503
  var rtl = (0, kendo_react_data_tools_1.isRtl)(this.element);
504
504
  this.isRtl = rtl;
505
- this._prevTotal = this.props.total;
506
505
  kendo_react_data_tools_1.tableKeyboardNavigation.onComponentDidMount({
507
506
  scope: this.element || undefined,
508
507
  contextStateRef: this.contextStateRef,
@@ -528,7 +527,6 @@ var Grid = /** @class */ (function (_super) {
528
527
  */
529
528
  Grid.prototype.componentDidUpdate = function () {
530
529
  (0, kendo_react_common_1.setScrollbarWidth)();
531
- this._prevTotal = this.props.total;
532
530
  if (this.vs.tableTransform && this.vs.table) {
533
531
  this.vs.table.style.transform = this.vs.tableTransform;
534
532
  this.vs.tableTransform = '';
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-react-grid',
9
9
  productName: 'KendoReact',
10
10
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
11
- publishDate: 1675783223,
11
+ publishDate: 1676299603,
12
12
  version: '',
13
13
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
14
14
  };