@progress/kendo-angular-grid 19.2.0-develop.14 → 19.2.0-develop.2

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.
@@ -532,9 +532,6 @@ const isMultipleRangesEnabled = (selectableSettings) => {
532
532
  */
533
533
  const calcRowHeight = (tableBody) => {
534
534
  let result = 0;
535
- if (!isDocumentAvailable()) {
536
- return result;
537
- }
538
535
  if (tableBody) {
539
536
  const row = tableBody.insertRow(0);
540
537
  const cell = row.insertCell(0);
@@ -868,7 +865,7 @@ class ContextService {
868
865
  topToolbarNavigation;
869
866
  bottomToolbarNavigation;
870
867
  navigable;
871
- dataBindingDirective;
868
+ groupBindingDirective;
872
869
  constructor(renderer, localization) {
873
870
  this.renderer = renderer;
874
871
  this.localization = localization;
@@ -14139,7 +14136,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
14139
14136
  }] } });
14140
14137
 
14141
14138
  /**
14142
- * Represents a directive that manages keyboard navigation for a column menu item ([see example](slug:columnmenu_grid#customizing-the-content)).
14139
+ * Represents a directive that manages keyboard navigation for a column menu item. [See example](slug:columnmenu_grid#customizing-the-content).
14143
14140
  *
14144
14141
  * @example
14145
14142
  * ```html
@@ -16675,6 +16672,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
16675
16672
  */
16676
16673
  class CellSelectionAggregateService {
16677
16674
  ctx;
16675
+ dataChanges;
16678
16676
  columnInfoService;
16679
16677
  selectedItems = [];
16680
16678
  groupedAggregates = { dates: [], numbers: [], booleans: [] };
@@ -16690,8 +16688,9 @@ class CellSelectionAggregateService {
16690
16688
  latest: null
16691
16689
  };
16692
16690
  sub = new Subscription();
16693
- constructor(ctx, columnInfoService) {
16691
+ constructor(ctx, dataChanges, columnInfoService) {
16694
16692
  this.ctx = ctx;
16693
+ this.dataChanges = dataChanges;
16695
16694
  this.columnInfoService = columnInfoService;
16696
16695
  }
16697
16696
  ngOnDestroy() {
@@ -16852,12 +16851,12 @@ class CellSelectionAggregateService {
16852
16851
  this.aggregates['isFalse'] = this.aggregates['isTrue'] = null;
16853
16852
  this.aggregates['earliest'] = this.aggregates['latest'] = null;
16854
16853
  }
16855
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CellSelectionAggregateService, deps: [{ token: ContextService }, { token: ColumnInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
16854
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CellSelectionAggregateService, deps: [{ token: ContextService }, { token: LocalDataChangesService }, { token: ColumnInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
16856
16855
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CellSelectionAggregateService });
16857
16856
  }
16858
16857
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CellSelectionAggregateService, decorators: [{
16859
16858
  type: Injectable
16860
- }], ctorParameters: function () { return [{ type: ContextService }, { type: ColumnInfoService }]; } });
16859
+ }], ctorParameters: function () { return [{ type: ContextService }, { type: LocalDataChangesService }, { type: ColumnInfoService }]; } });
16861
16860
 
16862
16861
  /**
16863
16862
  * @hidden
@@ -16986,8 +16985,6 @@ class SelectionService {
16986
16985
  if (ev.shiftKey) {
16987
16986
  ev.rangeStartRow = { dataItem: this.lastSelectionData, index: this.lastSelectionStartIndex };
16988
16987
  ev.rangeEndRow = { dataItem: item.data, index: item.index };
16989
- this.lastSelectionData = item.data;
16990
- this.lastSelectionStartIndex = item.index;
16991
16988
  }
16992
16989
  this.syncCurrentSelection(ev);
16993
16990
  this.changes.emit(ev);
@@ -17076,14 +17073,13 @@ class SelectionService {
17076
17073
  item = iterator.next();
17077
17074
  }
17078
17075
  }
17079
- addAllTo(item, ctrlKey, preserveSelection = false, shiftKey = false) {
17076
+ addAllTo(item, ctrlKey, preserveSelection = false) {
17080
17077
  const selectedRows = [];
17081
17078
  const deselectedRows = [];
17082
17079
  const start = Math.min(this.lastSelectionStartIndex, item.index);
17083
17080
  const end = Math.max(this.lastSelectionStartIndex, item.index);
17084
17081
  const iterator = this.getIterator();
17085
17082
  let next = iterator.next();
17086
- let selectedItem;
17087
17083
  while (!next.done) {
17088
17084
  if (next.value && next.value.type === "data") {
17089
17085
  const idx = next.value.index;
@@ -17094,9 +17090,6 @@ class SelectionService {
17094
17090
  if ((idx >= start && idx <= end) && !this.isSelected(idx) && !this.nonSelectableRows.has(idx)) {
17095
17091
  selectedRows.push(rowArgs);
17096
17092
  }
17097
- if (idx === item.index && !this.nonSelectableRows.has(idx)) {
17098
- selectedItem = rowArgs;
17099
- }
17100
17093
  }
17101
17094
  next = iterator.next();
17102
17095
  }
@@ -17104,23 +17097,10 @@ class SelectionService {
17104
17097
  const nonSelectableRows = this.currentSelection.filter(i => this.nonSelectableRows.has(i.index));
17105
17098
  deselectedRows.push(...nonSelectableRows);
17106
17099
  }
17107
- const selectionEvent = {
17108
- deselectedRows,
17109
- selectedRows
17100
+ return {
17101
+ deselectedRows: deselectedRows,
17102
+ selectedRows: selectedRows
17110
17103
  };
17111
- if (shiftKey && selectedItem) {
17112
- selectionEvent.rangeStartRow = {
17113
- dataItem: this.lastSelectionData,
17114
- index: this.lastSelectionStartIndex
17115
- };
17116
- selectionEvent.rangeEndRow = {
17117
- dataItem: selectedItem.dataItem,
17118
- index: selectedItem.index
17119
- };
17120
- this.lastSelectionData = selectedItem.dataItem;
17121
- this.lastSelectionStartIndex = selectedItem.index;
17122
- }
17123
- return selectionEvent;
17124
17104
  }
17125
17105
  updateAll(selectAllChecked) {
17126
17106
  this.selectAllChecked = selectAllChecked;
@@ -19109,7 +19089,7 @@ class SelectionCheckboxDirective {
19109
19089
  const ctrlKey = event.ctrlKey || event.metaKey;
19110
19090
  if (event.shiftKey && this.selectionService.options.mode === 'multiple') {
19111
19091
  const item = { index: this.itemIndex };
19112
- ev = this.selectionService.addAllTo(item, ctrlKey, false, event.shiftKey);
19092
+ ev = this.selectionService.addAllTo(item, ctrlKey);
19113
19093
  }
19114
19094
  else {
19115
19095
  ev = this.selectionService.toggleByIndex(this.itemIndex);
@@ -21214,8 +21194,8 @@ const packageMetadata = {
21214
21194
  productName: 'Kendo UI for Angular',
21215
21195
  productCode: 'KENDOUIANGULAR',
21216
21196
  productCodes: ['KENDOUIANGULAR'],
21217
- publishDate: 1751450548,
21218
- version: '19.2.0-develop.14',
21197
+ publishDate: 1750841713,
21198
+ version: '19.2.0-develop.2',
21219
21199
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
21220
21200
  };
21221
21201
 
@@ -23596,11 +23576,10 @@ class ListComponent {
23596
23576
  if (this.virtualColumns && (!this.viewportColumns || this.viewportWidthChange())) {
23597
23577
  this.updateViewportColumns();
23598
23578
  }
23599
- const shouldCalculatePageSize = isDocumentAvailable() && this.isVirtual && this.ctx.grid && !this.ctx.grid.pageSize;
23600
- if (shouldCalculatePageSize) {
23579
+ if (this.isVirtual && this.ctx.grid && !this.ctx.grid.pageSize) {
23601
23580
  const calculatedPageSize = this.calcVirtualPageSize();
23602
23581
  if (calculatedPageSize > 0) {
23603
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
23582
+ this.ngZone.onMicrotaskEmpty.pipe(take(1)).subscribe(() => {
23604
23583
  this.ctx.grid.pageSize = calculatedPageSize;
23605
23584
  this.ngZone.run(() => {
23606
23585
  this.pageChange.emit({
@@ -23679,36 +23658,6 @@ class ListComponent {
23679
23658
  args.preventDefault();
23680
23659
  }
23681
23660
  }
23682
- updateViewportColumns(range) {
23683
- const columns = this.columns.nonLockedLeafColumns.toArray();
23684
- // eslint-disable-next-line prefer-const
23685
- let { startIdx, endIdx, offset } = range || this.calculateViewportColumns();
23686
- const start = Math.max(0, startIdx - bufferSize);
23687
- const end = Math.min(endIdx + bufferSize, columns.length - 1);
23688
- if (start < startIdx) {
23689
- for (let idx = startIdx - 1; idx >= start; idx--) {
23690
- offset -= columns[idx].width;
23691
- }
23692
- }
23693
- let currentColumns = columns.slice(start, end + 1);
23694
- this.viewportColumnsWidth = currentColumns.reduce((total, column) => total + column.width, 0);
23695
- const stickyBeforeStart = columns.slice(0, start).filter(c => c.sticky && !currentColumns.some(col => col === c));
23696
- const stickyAfterEnd = columns.slice(end, columns.length).filter(c => c.sticky && !currentColumns.some(col => col === c));
23697
- currentColumns = [...stickyBeforeStart, ...currentColumns, ...stickyAfterEnd];
23698
- if (start > 0) {
23699
- const offsetColumn = new ColumnBase();
23700
- offsetColumn.width = offset;
23701
- currentColumns.unshift(offsetColumn);
23702
- }
23703
- this.viewportColumns = new QueryList();
23704
- this.viewportColumns.reset(currentColumns);
23705
- this.columnsStartIdx = start;
23706
- this.columnsEndIdx = end;
23707
- this.columnInfo.columnRangeChange.emit({ start, end, offset });
23708
- if (!range) {
23709
- this.updateColumnViewport(startIdx, endIdx);
23710
- }
23711
- }
23712
23661
  detailExpand({ index, expand }) {
23713
23662
  if (expand) {
23714
23663
  this.rowHeightService.expandDetail(index);
@@ -23934,6 +23883,36 @@ class ListComponent {
23934
23883
  })
23935
23884
  .forEach(setHeight(this.renderer));
23936
23885
  }
23886
+ updateViewportColumns(range) {
23887
+ const columns = this.columns.nonLockedLeafColumns.toArray();
23888
+ // eslint-disable-next-line prefer-const
23889
+ let { startIdx, endIdx, offset } = range || this.calculateViewportColumns();
23890
+ const start = Math.max(0, startIdx - bufferSize);
23891
+ const end = Math.min(endIdx + bufferSize, columns.length - 1);
23892
+ if (start < startIdx) {
23893
+ for (let idx = startIdx - 1; idx >= start; idx--) {
23894
+ offset -= columns[idx].width;
23895
+ }
23896
+ }
23897
+ let currentColumns = columns.slice(start, end + 1);
23898
+ this.viewportColumnsWidth = currentColumns.reduce((total, column) => total + column.width, 0);
23899
+ const stickyBeforeStart = columns.slice(0, start).filter(c => c.sticky && !currentColumns.some(col => col === c));
23900
+ const stickyAfterEnd = columns.slice(end, columns.length).filter(c => c.sticky && !currentColumns.some(col => col === c));
23901
+ currentColumns = [...stickyBeforeStart, ...currentColumns, ...stickyAfterEnd];
23902
+ if (start > 0) {
23903
+ const offsetColumn = new ColumnBase();
23904
+ offsetColumn.width = offset;
23905
+ currentColumns.unshift(offsetColumn);
23906
+ }
23907
+ this.viewportColumns = new QueryList();
23908
+ this.viewportColumns.reset(currentColumns);
23909
+ this.columnsStartIdx = start;
23910
+ this.columnsEndIdx = end;
23911
+ this.columnInfo.columnRangeChange.emit({ start, end, offset });
23912
+ if (!range) {
23913
+ this.updateColumnViewport(startIdx, endIdx);
23914
+ }
23915
+ }
23937
23916
  handleColumnScroll() {
23938
23917
  const container = this.container.nativeElement;
23939
23918
  const scrollLeft = container.scrollLeft;
@@ -28437,8 +28416,10 @@ class GridComponent {
28437
28416
  dragTargetContainer;
28438
28417
  dropTargetContainer;
28439
28418
  dialogContainer;
28419
+ /**
28420
+ * @hidden
28421
+ */
28440
28422
  adaptiveRenderer;
28441
- listComponent;
28442
28423
  get scrollbarWidth() {
28443
28424
  return this.supportService.scrollbarWidth;
28444
28425
  }
@@ -29123,12 +29104,12 @@ class GridComponent {
29123
29104
  this.sort = state.sort;
29124
29105
  this.group = state.group;
29125
29106
  this.filter = state.filter;
29107
+ this.group = state.group;
29126
29108
  this.skip = state.skip;
29127
29109
  this.pageSize = state.take;
29128
- if (state.currentData) {
29129
- this.data = state.currentData;
29130
- }
29131
- this.changeDetectorRef.markForCheck();
29110
+ this.data = state.currentData;
29111
+ this.changeNotification.notify();
29112
+ this.changeDetectorRef.detectChanges();
29132
29113
  }
29133
29114
  traverseColumns(columns, callback) {
29134
29115
  columns.forEach((column) => {
@@ -29339,9 +29320,6 @@ class GridComponent {
29339
29320
  source.locked = target.locked;
29340
29321
  }
29341
29322
  this.columnsContainer.refresh();
29342
- if (this.virtualColumns) {
29343
- this.listComponent.updateViewportColumns();
29344
- }
29345
29323
  this.changeDetectorRef.markForCheck();
29346
29324
  });
29347
29325
  }
@@ -29764,8 +29742,7 @@ class GridComponent {
29764
29742
  column = toAdd.shift();
29765
29743
  viewportColumns.push(column);
29766
29744
  if (column.isColumnGroup) {
29767
- const children = columnsArray.filter(c => c.parent && c.parent.id === column.id);
29768
- toAdd.unshift(...children);
29745
+ toAdd.unshift(...column.childrenArray);
29769
29746
  }
29770
29747
  }
29771
29748
  const lastFromGroup = viewportColumns[viewportColumns.length - 1];
@@ -29821,8 +29798,8 @@ class GridComponent {
29821
29798
  }
29822
29799
  if (this.groupsService.isExpanded({ groupIndex: index }) !== expand) {
29823
29800
  this.groupsService.toggleRow({ index }, false);
29824
- if (this.ctx.dataBindingDirective && isPresent(this.ctx.dataBindingDirective.groupExpand)) {
29825
- this.ctx.dataBindingDirective[`group${expand ? 'Expand' : 'Collapse'}`]({ groupIndex: index });
29801
+ if (this.ctx.groupBindingDirective) {
29802
+ this.ctx.groupBindingDirective[`group${expand ? 'Expand' : 'Collapse'}`]({ groupIndex: index });
29826
29803
  }
29827
29804
  }
29828
29805
  }
@@ -29895,7 +29872,7 @@ class GridComponent {
29895
29872
  ColumnMenuService,
29896
29873
  MenuTabbingService,
29897
29874
  DataMappingService
29898
- ], queries: [{ propertyName: "columns", predicate: ColumnBase }, { propertyName: "detailTemplateChildren", predicate: DetailTemplateDirective }, { propertyName: "cellLoadingTemplateChildren", predicate: CellLoadingTemplateDirective }, { propertyName: "loadingTemplateChildren", predicate: LoadingTemplateDirective }, { propertyName: "statusBarTemplateChildren", predicate: StatusBarTemplateDirective }, { propertyName: "noRecordsTemplateChildren", predicate: NoRecordsTemplateDirective }, { propertyName: "pagerTemplateChildren", predicate: PagerTemplateDirective }, { propertyName: "toolbarTemplateChildren", predicate: ToolbarTemplateDirective }, { propertyName: "columnMenuTemplates", predicate: ColumnMenuTemplateDirective }], viewQueries: [{ propertyName: "lockedHeader", first: true, predicate: ["lockedHeader"], descendants: true }, { propertyName: "header", first: true, predicate: ["header"], descendants: true }, { propertyName: "ariaRoot", first: true, predicate: ["ariaRoot"], descendants: true, static: true }, { propertyName: "dragTargetContainer", first: true, predicate: DragTargetContainerDirective, descendants: true }, { propertyName: "dropTargetContainer", first: true, predicate: DropTargetContainerDirective, descendants: true }, { propertyName: "dialogContainer", first: true, predicate: ["dialogContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "adaptiveRenderer", first: true, predicate: AdaptiveRendererComponent, descendants: true }, { propertyName: "listComponent", first: true, predicate: ListComponent, descendants: true }, { propertyName: "footer", predicate: ["footer"], descendants: true }], exportAs: ["kendoGrid"], usesOnChanges: true, ngImport: i0, template: `
29875
+ ], queries: [{ propertyName: "columns", predicate: ColumnBase }, { propertyName: "detailTemplateChildren", predicate: DetailTemplateDirective }, { propertyName: "cellLoadingTemplateChildren", predicate: CellLoadingTemplateDirective }, { propertyName: "loadingTemplateChildren", predicate: LoadingTemplateDirective }, { propertyName: "statusBarTemplateChildren", predicate: StatusBarTemplateDirective }, { propertyName: "noRecordsTemplateChildren", predicate: NoRecordsTemplateDirective }, { propertyName: "pagerTemplateChildren", predicate: PagerTemplateDirective }, { propertyName: "toolbarTemplateChildren", predicate: ToolbarTemplateDirective }, { propertyName: "columnMenuTemplates", predicate: ColumnMenuTemplateDirective }], viewQueries: [{ propertyName: "lockedHeader", first: true, predicate: ["lockedHeader"], descendants: true }, { propertyName: "header", first: true, predicate: ["header"], descendants: true }, { propertyName: "ariaRoot", first: true, predicate: ["ariaRoot"], descendants: true, static: true }, { propertyName: "dragTargetContainer", first: true, predicate: DragTargetContainerDirective, descendants: true }, { propertyName: "dropTargetContainer", first: true, predicate: DropTargetContainerDirective, descendants: true }, { propertyName: "dialogContainer", first: true, predicate: ["dialogContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "adaptiveRenderer", first: true, predicate: AdaptiveRendererComponent, descendants: true }, { propertyName: "footer", predicate: ["footer"], descendants: true }], exportAs: ["kendoGrid"], usesOnChanges: true, ngImport: i0, template: `
29899
29876
  <ng-container kendoGridLocalizedMessages
29900
29877
  i18n-groupPanelEmpty="kendo.grid.groupPanelEmpty|The label visible in the Grid group panel when it is empty"
29901
29878
  groupPanelEmpty="Drag a column header and drop it here to group by that column"
@@ -31712,9 +31689,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
31712
31689
  }], adaptiveRenderer: [{
31713
31690
  type: ViewChild,
31714
31691
  args: [AdaptiveRendererComponent]
31715
- }], listComponent: [{
31716
- type: ViewChild,
31717
- args: [ListComponent]
31718
31692
  }] } });
31719
31693
 
31720
31694
  /**
@@ -31843,7 +31817,7 @@ class DataBindingDirective {
31843
31817
  stateChangeSubscription;
31844
31818
  dataChangedSubscription;
31845
31819
  rowReorderSubscription;
31846
- constructor(grid, changeDetector, localDataChangesService, rowReorderService, ctx) {
31820
+ constructor(grid, changeDetector, localDataChangesService, rowReorderService) {
31847
31821
  this.grid = grid;
31848
31822
  this.changeDetector = changeDetector;
31849
31823
  this.localDataChangesService = localDataChangesService;
@@ -31851,7 +31825,6 @@ class DataBindingDirective {
31851
31825
  if (localDataChangesService) {
31852
31826
  this.dataChangedSubscription = this.localDataChangesService.changes.subscribe(this.rebind.bind(this));
31853
31827
  }
31854
- ctx && (ctx.dataBindingDirective = this);
31855
31828
  }
31856
31829
  /**
31857
31830
  * @hidden
@@ -31946,7 +31919,7 @@ class DataBindingDirective {
31946
31919
  this.grid.updateNavigationMetadata();
31947
31920
  this.dataChanged = false;
31948
31921
  }
31949
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataBindingDirective, deps: [{ token: GridComponent }, { token: i0.ChangeDetectorRef }, { token: LocalDataChangesService }, { token: RowReorderService }, { token: ContextService }], target: i0.ɵɵFactoryTarget.Directive });
31922
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataBindingDirective, deps: [{ token: GridComponent }, { token: i0.ChangeDetectorRef }, { token: LocalDataChangesService }, { token: RowReorderService }], target: i0.ɵɵFactoryTarget.Directive });
31950
31923
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DataBindingDirective, isStandalone: true, selector: "[kendoGridBinding]", inputs: { skip: "skip", sort: "sort", filter: "filter", pageSize: "pageSize", group: "group", data: ["kendoGridBinding", "data"] }, exportAs: ["kendoGridBinding"], usesOnChanges: true, ngImport: i0 });
31951
31924
  }
31952
31925
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataBindingDirective, decorators: [{
@@ -31956,7 +31929,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
31956
31929
  exportAs: 'kendoGridBinding',
31957
31930
  standalone: true
31958
31931
  }]
31959
- }], ctorParameters: function () { return [{ type: GridComponent }, { type: i0.ChangeDetectorRef }, { type: LocalDataChangesService }, { type: RowReorderService }, { type: ContextService }]; }, propDecorators: { skip: [{
31932
+ }], ctorParameters: function () { return [{ type: GridComponent }, { type: i0.ChangeDetectorRef }, { type: LocalDataChangesService }, { type: RowReorderService }]; }, propDecorators: { skip: [{
31960
31933
  type: Input
31961
31934
  }], sort: [{
31962
31935
  type: Input
@@ -33053,9 +33026,9 @@ class GroupBindingDirective extends DataBindingDirective {
33053
33026
  groups;
33054
33027
  gridSubs = new Subscription();
33055
33028
  constructor(changeDetector, localDataChangesService, ctxService, groupsService) {
33056
- super(ctxService.grid, changeDetector, localDataChangesService, null, ctxService);
33029
+ super(ctxService.grid, changeDetector, localDataChangesService);
33057
33030
  this.groupsService = groupsService;
33058
- ctxService.dataBindingDirective = this;
33031
+ ctxService.groupBindingDirective = this;
33059
33032
  }
33060
33033
  ngOnInit() {
33061
33034
  super.ngOnInit();
@@ -33141,12 +33114,6 @@ class GroupBindingDirective extends DataBindingDirective {
33141
33114
  this.grid.data = this.dataResult(this.state.skip, this.state.take);
33142
33115
  }
33143
33116
  process(state) {
33144
- if (this.grid.isVirtual && (!isPresent(state.take) || state.take === 0)) {
33145
- return {
33146
- data: [],
33147
- total: this.originalData?.length || 0
33148
- };
33149
- }
33150
33117
  if (state.group && state.group.length) {
33151
33118
  const groups = this.processGroups(state);
33152
33119
  this.grid.skip -= skippedHeaders(groups.data[0]);
@@ -33855,12 +33822,6 @@ class UndoRedoStack {
33855
33822
  this.currentNode = this.currentNode.previous;
33856
33823
  return this.currentNode.state;
33857
33824
  }
33858
- peekNext() {
33859
- return this.currentNode.next?.state || null;
33860
- }
33861
- peekPrev() {
33862
- return this.currentNode.previous?.state || null;
33863
- }
33864
33825
  /**
33865
33826
  * Performs a redo operation, moving to the next state
33866
33827
  * @returns The next state or null if can't redo
@@ -33983,6 +33944,7 @@ class UndoRedoService {
33983
33944
  onUndo = new Subject();
33984
33945
  onRedo = new Subject();
33985
33946
  stackEndReached = new Subject();
33947
+ setState = new Subject();
33986
33948
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UndoRedoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
33987
33949
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UndoRedoService });
33988
33950
  }
@@ -34006,17 +33968,11 @@ class UndoRedoDirective {
34006
33968
  editService;
34007
33969
  undoRedoService;
34008
33970
  changeNotification;
34009
- ctx;
34010
- localDataChangesService;
34011
33971
  /**
34012
33972
  * Sets the maximum number of actions to keep in the undo-redo stack.
34013
33973
  * @default 10
34014
33974
  */
34015
33975
  maxStoredStates = 10;
34016
- /**
34017
- * Defines the property name of the data item unique key that will be used to identify the items when performing undo-redo actions.
34018
- */
34019
- itemIdKey;
34020
33976
  /**
34021
33977
  * Fires when you perform the undo action. Provides the Grid state to apply.
34022
33978
  */
@@ -34034,17 +33990,24 @@ class UndoRedoDirective {
34034
33990
  stack;
34035
33991
  subs = new Subscription();
34036
33992
  addToState = true;
34037
- constructor(host, editService, undoRedoService, changeNotification, ctx, localDataChangesService) {
33993
+ constructor(host, editService, undoRedoService, changeNotification) {
34038
33994
  this.host = host;
34039
33995
  this.editService = editService;
34040
33996
  this.undoRedoService = undoRedoService;
34041
33997
  this.changeNotification = changeNotification;
34042
- this.ctx = ctx;
34043
- this.localDataChangesService = localDataChangesService;
34044
33998
  this.host.undoRedoService = this.undoRedoService;
34045
33999
  }
34046
34000
  ngOnInit() {
34047
34001
  this.stack = new UndoRedoStack(this.maxStoredStates);
34002
+ this.stack.add({
34003
+ originalEvent: {
34004
+ skip: this.host.skip,
34005
+ take: this.host.pageSize,
34006
+ sort: this.host.sort,
34007
+ filter: this.host.filter,
34008
+ group: this.host.group
34009
+ }, gridState: structuredClone(this.host.currentState)
34010
+ });
34048
34011
  this.subs = this.host.gridStateChange.subscribe((state) => {
34049
34012
  if (this.addToState) {
34050
34013
  this.stack.add({
@@ -34055,7 +34018,7 @@ class UndoRedoDirective {
34055
34018
  filter: state.filter,
34056
34019
  group: state.group
34057
34020
  },
34058
- gridState: state
34021
+ gridState: structuredClone(state)
34059
34022
  });
34060
34023
  }
34061
34024
  let stackEndPointReached;
@@ -34068,83 +34031,36 @@ class UndoRedoDirective {
34068
34031
  this.undoRedoService.stackEndReached.next(stackEndPointReached);
34069
34032
  });
34070
34033
  this.subs.add(this.editService.changes
34071
- .pipe(filter((event) => event.action === 'save' || event.action === 'remove'))
34034
+ .pipe(filter(event => event.action === 'save' || event.action === 'remove'), tap(event => this.undoRedoService.originalEvent = event))
34072
34035
  .subscribe(event => {
34073
34036
  this.stack.add({
34074
- originalEvent: { ...event, dataItem: structuredClone(event.dataItem) },
34075
- gridState: this.host.currentState
34037
+ originalEvent: event,
34038
+ gridState: structuredClone(this.host.currentState)
34076
34039
  });
34077
34040
  this.addToState = false;
34078
34041
  this.host.gridStateChange.emit(this.stack.current.gridState);
34079
34042
  this.addToState = true;
34080
34043
  this.updateUndoRedoDisabled();
34081
34044
  }));
34082
- this.subs.add(this.changeNotification.changes.subscribe(() => {
34083
- if (!this.ctx.dataBindingDirective) {
34084
- this.stack.current.gridState = this.host.currentState;
34085
- }
34086
- }));
34045
+ this.subs.add(this.changeNotification.changes.subscribe(() => this.stack.current.gridState = this.host.currentState));
34087
34046
  ['Undo', 'Redo'].forEach((action) => {
34088
34047
  this.subs.add(this.undoRedoService[`on${action}`].subscribe(() => {
34089
34048
  if (!this.stack[`can${action}`]) {
34090
34049
  return;
34091
34050
  }
34092
- let eventData;
34093
- if (action === 'Undo') {
34094
- const isSaveOrRemove = this.stack.current.originalEvent.action === 'save' || this.stack.current.originalEvent.action === 'remove';
34095
- eventData = isSaveOrRemove ? this.stack.current : this.stack.peekPrev();
34096
- }
34097
- else {
34098
- eventData = this.stack.peekNext();
34099
- }
34100
- const event = new UndoRedoEvent(eventData);
34051
+ this.stack[`${action.toLowerCase()}`]();
34101
34052
  if (hasObservers(this[`on${action}`])) {
34053
+ const event = new UndoRedoEvent(this.stack.current);
34102
34054
  this[`on${action}`].emit(event);
34103
34055
  if (event.isDefaultPrevented()) {
34104
34056
  return;
34105
34057
  }
34106
34058
  }
34107
- this.stack[`${action.toLowerCase()}`]();
34108
34059
  this.updateUndoRedoDisabled();
34109
- const originalAction = event.originalEvent.action;
34110
- const isLocalData = isPresent$1(this.ctx?.dataBindingDirective);
34111
- if (!isLocalData) {
34112
- return;
34113
- }
34114
- const isSaveOrRemove = originalAction === 'save' || originalAction === 'remove';
34115
- if (isSaveOrRemove) {
34116
- if (originalAction === 'save') {
34117
- const stateItem = this.getGridDataItems(this.stack.current.gridState.currentData).find(item => item[this.itemIdKey] === event.originalEvent.dataItem[this.itemIdKey]);
34118
- this.localDataChangesService?.data.splice(event.originalEvent.rowIndex, 1, stateItem);
34119
- }
34120
- else if (action === 'Undo') {
34121
- this.localDataChangesService?.data.splice(event.originalEvent.rowIndex, 0, event.originalEvent.dataItem);
34122
- }
34123
- else {
34124
- this.localDataChangesService?.data.splice(event.originalEvent.rowIndex, 1);
34125
- }
34126
- this.localDataChangesService?.changes.emit();
34127
- }
34128
- else {
34129
- this.host.loadState({ ...this.stack.current.gridState, currentData: null });
34130
- if (this.isDataStateChangeEvent(event.originalEvent)) {
34131
- const { skip, take, sort, filter, group } = event.gridState;
34132
- this.host.dataStateChange.emit({ skip, take, sort, filter, group });
34133
- }
34134
- }
34060
+ this.host.loadState(this.stack.current.gridState);
34135
34061
  }));
34136
34062
  });
34137
- }
34138
- ngAfterViewInit() {
34139
- this.stack.add({
34140
- originalEvent: {
34141
- skip: this.host.skip,
34142
- take: this.host.pageSize,
34143
- sort: this.host.sort,
34144
- filter: this.host.filter,
34145
- group: this.host.group
34146
- }, gridState: this.host.currentState
34147
- });
34063
+ this.subs.add(this.undoRedoService.setState.subscribe((state) => this.stack.add({ originalEvent: 'dataChange', gridState: state })));
34148
34064
  }
34149
34065
  ngOnDestroy() {
34150
34066
  this.stack.clear();
@@ -34186,15 +34102,8 @@ class UndoRedoDirective {
34186
34102
  }
34187
34103
  this.undoRedoService.stackEndReached.next(false);
34188
34104
  }
34189
- getGridDataItems(data) {
34190
- return Array.isArray(data) ? data.flatMap(recursiveFlatMap) :
34191
- data.data.flatMap(recursiveFlatMap);
34192
- }
34193
- isDataStateChangeEvent(event) {
34194
- return event && ['skip', 'take', 'sort', 'filter', 'group'].some(prop => prop in event);
34195
- }
34196
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UndoRedoDirective, deps: [{ token: GridComponent }, { token: EditService }, { token: UndoRedoService }, { token: ChangeNotificationService }, { token: ContextService }, { token: LocalDataChangesService }], target: i0.ɵɵFactoryTarget.Directive });
34197
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: UndoRedoDirective, isStandalone: true, selector: "[kendoGridUndoRedo]", inputs: { maxStoredStates: "maxStoredStates", itemIdKey: "itemIdKey" }, outputs: { onUndo: "undo", onRedo: "redo" }, providers: [UndoRedoService], exportAs: ["kendoGridUndoRedo"], ngImport: i0 });
34105
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UndoRedoDirective, deps: [{ token: GridComponent }, { token: EditService }, { token: UndoRedoService }, { token: ChangeNotificationService }], target: i0.ɵɵFactoryTarget.Directive });
34106
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: UndoRedoDirective, isStandalone: true, selector: "[kendoGridUndoRedo]", inputs: { maxStoredStates: "maxStoredStates" }, outputs: { onUndo: "undo", onRedo: "redo" }, providers: [UndoRedoService], exportAs: ["kendoGridUndoRedo"], ngImport: i0 });
34198
34107
  }
34199
34108
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UndoRedoDirective, decorators: [{
34200
34109
  type: Directive,
@@ -34204,9 +34113,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
34204
34113
  exportAs: 'kendoGridUndoRedo',
34205
34114
  providers: [UndoRedoService]
34206
34115
  }]
34207
- }], ctorParameters: function () { return [{ type: GridComponent }, { type: EditService }, { type: UndoRedoService }, { type: ChangeNotificationService }, { type: ContextService }, { type: LocalDataChangesService }]; }, propDecorators: { maxStoredStates: [{
34208
- type: Input
34209
- }], itemIdKey: [{
34116
+ }], ctorParameters: function () { return [{ type: GridComponent }, { type: EditService }, { type: UndoRedoService }, { type: ChangeNotificationService }]; }, propDecorators: { maxStoredStates: [{
34210
34117
  type: Input
34211
34118
  }], onUndo: [{
34212
34119
  type: Output,
@@ -79,7 +79,6 @@ import { RowReorderEvent } from './row-reordering/types';
79
79
  import { DragTargetContainerDirective, DragTargetDataFn, DropTargetContainerDirective } from '@progress/kendo-angular-utils';
80
80
  import { RowReorderService } from './row-reordering/row-reorder.service';
81
81
  import { StatusBarTemplateDirective } from './aggregates/status-bar-template.directive';
82
- import { ListComponent } from './rendering/list.component';
83
82
  import { PagerTemplateDirective } from '@progress/kendo-angular-pager';
84
83
  import { GridResizableSettings } from './common/resizable-settings';
85
84
  import { GridState } from './state-management/grid-state.models';
@@ -610,8 +609,10 @@ export declare class GridComponent implements AfterContentInit, AfterViewInit, O
610
609
  dragTargetContainer: DragTargetContainerDirective;
611
610
  dropTargetContainer: DropTargetContainerDirective;
612
611
  dialogContainer: ViewContainerRef;
612
+ /**
613
+ * @hidden
614
+ */
613
615
  adaptiveRenderer: AdaptiveRendererComponent;
614
- listComponent: ListComponent;
615
616
  get scrollbarWidth(): number;
616
617
  get showPagerInput(): boolean;
617
618
  set showPagerInput(value: boolean);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-grid",
3
- "version": "19.2.0-develop.14",
3
+ "version": "19.2.0-develop.2",
4
4
  "description": "Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -26,7 +26,7 @@
26
26
  "package": {
27
27
  "productName": "Kendo UI for Angular",
28
28
  "productCode": "KENDOUIANGULAR",
29
- "publishDate": 1751450548,
29
+ "publishDate": 1750841713,
30
30
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
31
31
  }
32
32
  },
@@ -39,28 +39,28 @@
39
39
  "@progress/kendo-data-query": "^1.0.0",
40
40
  "@progress/kendo-drawing": "^1.21.0",
41
41
  "@progress/kendo-licensing": "^1.5.0",
42
- "@progress/kendo-angular-buttons": "19.2.0-develop.14",
43
- "@progress/kendo-angular-common": "19.2.0-develop.14",
44
- "@progress/kendo-angular-dateinputs": "19.2.0-develop.14",
45
- "@progress/kendo-angular-layout": "19.2.0-develop.14",
46
- "@progress/kendo-angular-navigation": "19.2.0-develop.14",
47
- "@progress/kendo-angular-dropdowns": "19.2.0-develop.14",
48
- "@progress/kendo-angular-excel-export": "19.2.0-develop.14",
49
- "@progress/kendo-angular-icons": "19.2.0-develop.14",
50
- "@progress/kendo-angular-inputs": "19.2.0-develop.14",
51
- "@progress/kendo-angular-intl": "19.2.0-develop.14",
52
- "@progress/kendo-angular-l10n": "19.2.0-develop.14",
53
- "@progress/kendo-angular-label": "19.2.0-develop.14",
54
- "@progress/kendo-angular-pager": "19.2.0-develop.14",
55
- "@progress/kendo-angular-pdf-export": "19.2.0-develop.14",
56
- "@progress/kendo-angular-popup": "19.2.0-develop.14",
57
- "@progress/kendo-angular-toolbar": "19.2.0-develop.14",
58
- "@progress/kendo-angular-utils": "19.2.0-develop.14",
42
+ "@progress/kendo-angular-buttons": "19.2.0-develop.2",
43
+ "@progress/kendo-angular-common": "19.2.0-develop.2",
44
+ "@progress/kendo-angular-dateinputs": "19.2.0-develop.2",
45
+ "@progress/kendo-angular-layout": "19.2.0-develop.2",
46
+ "@progress/kendo-angular-navigation": "19.2.0-develop.2",
47
+ "@progress/kendo-angular-dropdowns": "19.2.0-develop.2",
48
+ "@progress/kendo-angular-excel-export": "19.2.0-develop.2",
49
+ "@progress/kendo-angular-icons": "19.2.0-develop.2",
50
+ "@progress/kendo-angular-inputs": "19.2.0-develop.2",
51
+ "@progress/kendo-angular-intl": "19.2.0-develop.2",
52
+ "@progress/kendo-angular-l10n": "19.2.0-develop.2",
53
+ "@progress/kendo-angular-label": "19.2.0-develop.2",
54
+ "@progress/kendo-angular-pager": "19.2.0-develop.2",
55
+ "@progress/kendo-angular-pdf-export": "19.2.0-develop.2",
56
+ "@progress/kendo-angular-popup": "19.2.0-develop.2",
57
+ "@progress/kendo-angular-toolbar": "19.2.0-develop.2",
58
+ "@progress/kendo-angular-utils": "19.2.0-develop.2",
59
59
  "rxjs": "^6.5.3 || ^7.0.0"
60
60
  },
61
61
  "dependencies": {
62
62
  "tslib": "^2.3.1",
63
- "@progress/kendo-angular-schematics": "19.2.0-develop.14",
63
+ "@progress/kendo-angular-schematics": "19.2.0-develop.2",
64
64
  "@progress/kendo-common": "^1.0.1",
65
65
  "@progress/kendo-file-saver": "^1.0.0"
66
66
  },