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

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/esm2022/utils.mjs CHANGED
@@ -4,7 +4,6 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { InjectionToken } from '@angular/core';
6
6
  import { merge, of } from 'rxjs';
7
- import { isDocumentAvailable } from '@progress/kendo-angular-common';
8
7
  export { isChanged, anyChanged, hasObservers } from '@progress/kendo-angular-common';
9
8
  const EMPTY_REGEX = /^\s*$/;
10
9
  /**
@@ -206,9 +205,6 @@ export const isMultipleRangesEnabled = (selectableSettings) => {
206
205
  */
207
206
  export const calcRowHeight = (tableBody) => {
208
207
  let result = 0;
209
- if (!isDocumentAvailable()) {
210
- return result;
211
- }
212
208
  if (tableBody) {
213
209
  const row = tableBody.insertRow(0);
214
210
  const cell = row.insertCell(0);
@@ -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
@@ -21214,8 +21213,8 @@ const packageMetadata = {
21214
21213
  productName: 'Kendo UI for Angular',
21215
21214
  productCode: 'KENDOUIANGULAR',
21216
21215
  productCodes: ['KENDOUIANGULAR'],
21217
- publishDate: 1751450548,
21218
- version: '19.2.0-develop.14',
21216
+ publishDate: 1750851099,
21217
+ version: '19.2.0-develop.3',
21219
21218
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
21220
21219
  };
21221
21220
 
@@ -23596,11 +23595,10 @@ class ListComponent {
23596
23595
  if (this.virtualColumns && (!this.viewportColumns || this.viewportWidthChange())) {
23597
23596
  this.updateViewportColumns();
23598
23597
  }
23599
- const shouldCalculatePageSize = isDocumentAvailable() && this.isVirtual && this.ctx.grid && !this.ctx.grid.pageSize;
23600
- if (shouldCalculatePageSize) {
23598
+ if (this.isVirtual && this.ctx.grid && !this.ctx.grid.pageSize) {
23601
23599
  const calculatedPageSize = this.calcVirtualPageSize();
23602
23600
  if (calculatedPageSize > 0) {
23603
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
23601
+ this.ngZone.onMicrotaskEmpty.pipe(take(1)).subscribe(() => {
23604
23602
  this.ctx.grid.pageSize = calculatedPageSize;
23605
23603
  this.ngZone.run(() => {
23606
23604
  this.pageChange.emit({
@@ -23679,36 +23677,6 @@ class ListComponent {
23679
23677
  args.preventDefault();
23680
23678
  }
23681
23679
  }
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
23680
  detailExpand({ index, expand }) {
23713
23681
  if (expand) {
23714
23682
  this.rowHeightService.expandDetail(index);
@@ -23934,6 +23902,36 @@ class ListComponent {
23934
23902
  })
23935
23903
  .forEach(setHeight(this.renderer));
23936
23904
  }
23905
+ updateViewportColumns(range) {
23906
+ const columns = this.columns.nonLockedLeafColumns.toArray();
23907
+ // eslint-disable-next-line prefer-const
23908
+ let { startIdx, endIdx, offset } = range || this.calculateViewportColumns();
23909
+ const start = Math.max(0, startIdx - bufferSize);
23910
+ const end = Math.min(endIdx + bufferSize, columns.length - 1);
23911
+ if (start < startIdx) {
23912
+ for (let idx = startIdx - 1; idx >= start; idx--) {
23913
+ offset -= columns[idx].width;
23914
+ }
23915
+ }
23916
+ let currentColumns = columns.slice(start, end + 1);
23917
+ this.viewportColumnsWidth = currentColumns.reduce((total, column) => total + column.width, 0);
23918
+ const stickyBeforeStart = columns.slice(0, start).filter(c => c.sticky && !currentColumns.some(col => col === c));
23919
+ const stickyAfterEnd = columns.slice(end, columns.length).filter(c => c.sticky && !currentColumns.some(col => col === c));
23920
+ currentColumns = [...stickyBeforeStart, ...currentColumns, ...stickyAfterEnd];
23921
+ if (start > 0) {
23922
+ const offsetColumn = new ColumnBase();
23923
+ offsetColumn.width = offset;
23924
+ currentColumns.unshift(offsetColumn);
23925
+ }
23926
+ this.viewportColumns = new QueryList();
23927
+ this.viewportColumns.reset(currentColumns);
23928
+ this.columnsStartIdx = start;
23929
+ this.columnsEndIdx = end;
23930
+ this.columnInfo.columnRangeChange.emit({ start, end, offset });
23931
+ if (!range) {
23932
+ this.updateColumnViewport(startIdx, endIdx);
23933
+ }
23934
+ }
23937
23935
  handleColumnScroll() {
23938
23936
  const container = this.container.nativeElement;
23939
23937
  const scrollLeft = container.scrollLeft;
@@ -28437,8 +28435,10 @@ class GridComponent {
28437
28435
  dragTargetContainer;
28438
28436
  dropTargetContainer;
28439
28437
  dialogContainer;
28438
+ /**
28439
+ * @hidden
28440
+ */
28440
28441
  adaptiveRenderer;
28441
- listComponent;
28442
28442
  get scrollbarWidth() {
28443
28443
  return this.supportService.scrollbarWidth;
28444
28444
  }
@@ -29123,12 +29123,12 @@ class GridComponent {
29123
29123
  this.sort = state.sort;
29124
29124
  this.group = state.group;
29125
29125
  this.filter = state.filter;
29126
+ this.group = state.group;
29126
29127
  this.skip = state.skip;
29127
29128
  this.pageSize = state.take;
29128
- if (state.currentData) {
29129
- this.data = state.currentData;
29130
- }
29131
- this.changeDetectorRef.markForCheck();
29129
+ this.data = state.currentData;
29130
+ this.changeNotification.notify();
29131
+ this.changeDetectorRef.detectChanges();
29132
29132
  }
29133
29133
  traverseColumns(columns, callback) {
29134
29134
  columns.forEach((column) => {
@@ -29339,9 +29339,6 @@ class GridComponent {
29339
29339
  source.locked = target.locked;
29340
29340
  }
29341
29341
  this.columnsContainer.refresh();
29342
- if (this.virtualColumns) {
29343
- this.listComponent.updateViewportColumns();
29344
- }
29345
29342
  this.changeDetectorRef.markForCheck();
29346
29343
  });
29347
29344
  }
@@ -29764,8 +29761,7 @@ class GridComponent {
29764
29761
  column = toAdd.shift();
29765
29762
  viewportColumns.push(column);
29766
29763
  if (column.isColumnGroup) {
29767
- const children = columnsArray.filter(c => c.parent && c.parent.id === column.id);
29768
- toAdd.unshift(...children);
29764
+ toAdd.unshift(...column.childrenArray);
29769
29765
  }
29770
29766
  }
29771
29767
  const lastFromGroup = viewportColumns[viewportColumns.length - 1];
@@ -29821,8 +29817,8 @@ class GridComponent {
29821
29817
  }
29822
29818
  if (this.groupsService.isExpanded({ groupIndex: index }) !== expand) {
29823
29819
  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 });
29820
+ if (this.ctx.groupBindingDirective) {
29821
+ this.ctx.groupBindingDirective[`group${expand ? 'Expand' : 'Collapse'}`]({ groupIndex: index });
29826
29822
  }
29827
29823
  }
29828
29824
  }
@@ -29895,7 +29891,7 @@ class GridComponent {
29895
29891
  ColumnMenuService,
29896
29892
  MenuTabbingService,
29897
29893
  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: `
29894
+ ], 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
29895
  <ng-container kendoGridLocalizedMessages
29900
29896
  i18n-groupPanelEmpty="kendo.grid.groupPanelEmpty|The label visible in the Grid group panel when it is empty"
29901
29897
  groupPanelEmpty="Drag a column header and drop it here to group by that column"
@@ -31712,9 +31708,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
31712
31708
  }], adaptiveRenderer: [{
31713
31709
  type: ViewChild,
31714
31710
  args: [AdaptiveRendererComponent]
31715
- }], listComponent: [{
31716
- type: ViewChild,
31717
- args: [ListComponent]
31718
31711
  }] } });
31719
31712
 
31720
31713
  /**
@@ -31843,7 +31836,7 @@ class DataBindingDirective {
31843
31836
  stateChangeSubscription;
31844
31837
  dataChangedSubscription;
31845
31838
  rowReorderSubscription;
31846
- constructor(grid, changeDetector, localDataChangesService, rowReorderService, ctx) {
31839
+ constructor(grid, changeDetector, localDataChangesService, rowReorderService) {
31847
31840
  this.grid = grid;
31848
31841
  this.changeDetector = changeDetector;
31849
31842
  this.localDataChangesService = localDataChangesService;
@@ -31851,7 +31844,6 @@ class DataBindingDirective {
31851
31844
  if (localDataChangesService) {
31852
31845
  this.dataChangedSubscription = this.localDataChangesService.changes.subscribe(this.rebind.bind(this));
31853
31846
  }
31854
- ctx && (ctx.dataBindingDirective = this);
31855
31847
  }
31856
31848
  /**
31857
31849
  * @hidden
@@ -31946,7 +31938,7 @@ class DataBindingDirective {
31946
31938
  this.grid.updateNavigationMetadata();
31947
31939
  this.dataChanged = false;
31948
31940
  }
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 });
31941
+ 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
31942
  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
31943
  }
31952
31944
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataBindingDirective, decorators: [{
@@ -31956,7 +31948,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
31956
31948
  exportAs: 'kendoGridBinding',
31957
31949
  standalone: true
31958
31950
  }]
31959
- }], ctorParameters: function () { return [{ type: GridComponent }, { type: i0.ChangeDetectorRef }, { type: LocalDataChangesService }, { type: RowReorderService }, { type: ContextService }]; }, propDecorators: { skip: [{
31951
+ }], ctorParameters: function () { return [{ type: GridComponent }, { type: i0.ChangeDetectorRef }, { type: LocalDataChangesService }, { type: RowReorderService }]; }, propDecorators: { skip: [{
31960
31952
  type: Input
31961
31953
  }], sort: [{
31962
31954
  type: Input
@@ -33053,9 +33045,9 @@ class GroupBindingDirective extends DataBindingDirective {
33053
33045
  groups;
33054
33046
  gridSubs = new Subscription();
33055
33047
  constructor(changeDetector, localDataChangesService, ctxService, groupsService) {
33056
- super(ctxService.grid, changeDetector, localDataChangesService, null, ctxService);
33048
+ super(ctxService.grid, changeDetector, localDataChangesService);
33057
33049
  this.groupsService = groupsService;
33058
- ctxService.dataBindingDirective = this;
33050
+ ctxService.groupBindingDirective = this;
33059
33051
  }
33060
33052
  ngOnInit() {
33061
33053
  super.ngOnInit();
@@ -33141,12 +33133,6 @@ class GroupBindingDirective extends DataBindingDirective {
33141
33133
  this.grid.data = this.dataResult(this.state.skip, this.state.take);
33142
33134
  }
33143
33135
  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
33136
  if (state.group && state.group.length) {
33151
33137
  const groups = this.processGroups(state);
33152
33138
  this.grid.skip -= skippedHeaders(groups.data[0]);
@@ -33855,12 +33841,6 @@ class UndoRedoStack {
33855
33841
  this.currentNode = this.currentNode.previous;
33856
33842
  return this.currentNode.state;
33857
33843
  }
33858
- peekNext() {
33859
- return this.currentNode.next?.state || null;
33860
- }
33861
- peekPrev() {
33862
- return this.currentNode.previous?.state || null;
33863
- }
33864
33844
  /**
33865
33845
  * Performs a redo operation, moving to the next state
33866
33846
  * @returns The next state or null if can't redo
@@ -33983,6 +33963,7 @@ class UndoRedoService {
33983
33963
  onUndo = new Subject();
33984
33964
  onRedo = new Subject();
33985
33965
  stackEndReached = new Subject();
33966
+ setState = new Subject();
33986
33967
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UndoRedoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
33987
33968
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UndoRedoService });
33988
33969
  }
@@ -34006,17 +33987,11 @@ class UndoRedoDirective {
34006
33987
  editService;
34007
33988
  undoRedoService;
34008
33989
  changeNotification;
34009
- ctx;
34010
- localDataChangesService;
34011
33990
  /**
34012
33991
  * Sets the maximum number of actions to keep in the undo-redo stack.
34013
33992
  * @default 10
34014
33993
  */
34015
33994
  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
33995
  /**
34021
33996
  * Fires when you perform the undo action. Provides the Grid state to apply.
34022
33997
  */
@@ -34034,17 +34009,24 @@ class UndoRedoDirective {
34034
34009
  stack;
34035
34010
  subs = new Subscription();
34036
34011
  addToState = true;
34037
- constructor(host, editService, undoRedoService, changeNotification, ctx, localDataChangesService) {
34012
+ constructor(host, editService, undoRedoService, changeNotification) {
34038
34013
  this.host = host;
34039
34014
  this.editService = editService;
34040
34015
  this.undoRedoService = undoRedoService;
34041
34016
  this.changeNotification = changeNotification;
34042
- this.ctx = ctx;
34043
- this.localDataChangesService = localDataChangesService;
34044
34017
  this.host.undoRedoService = this.undoRedoService;
34045
34018
  }
34046
34019
  ngOnInit() {
34047
34020
  this.stack = new UndoRedoStack(this.maxStoredStates);
34021
+ this.stack.add({
34022
+ originalEvent: {
34023
+ skip: this.host.skip,
34024
+ take: this.host.pageSize,
34025
+ sort: this.host.sort,
34026
+ filter: this.host.filter,
34027
+ group: this.host.group
34028
+ }, gridState: structuredClone(this.host.currentState)
34029
+ });
34048
34030
  this.subs = this.host.gridStateChange.subscribe((state) => {
34049
34031
  if (this.addToState) {
34050
34032
  this.stack.add({
@@ -34055,7 +34037,7 @@ class UndoRedoDirective {
34055
34037
  filter: state.filter,
34056
34038
  group: state.group
34057
34039
  },
34058
- gridState: state
34040
+ gridState: structuredClone(state)
34059
34041
  });
34060
34042
  }
34061
34043
  let stackEndPointReached;
@@ -34068,83 +34050,36 @@ class UndoRedoDirective {
34068
34050
  this.undoRedoService.stackEndReached.next(stackEndPointReached);
34069
34051
  });
34070
34052
  this.subs.add(this.editService.changes
34071
- .pipe(filter((event) => event.action === 'save' || event.action === 'remove'))
34053
+ .pipe(filter(event => event.action === 'save' || event.action === 'remove'), tap(event => this.undoRedoService.originalEvent = event))
34072
34054
  .subscribe(event => {
34073
34055
  this.stack.add({
34074
- originalEvent: { ...event, dataItem: structuredClone(event.dataItem) },
34075
- gridState: this.host.currentState
34056
+ originalEvent: event,
34057
+ gridState: structuredClone(this.host.currentState)
34076
34058
  });
34077
34059
  this.addToState = false;
34078
34060
  this.host.gridStateChange.emit(this.stack.current.gridState);
34079
34061
  this.addToState = true;
34080
34062
  this.updateUndoRedoDisabled();
34081
34063
  }));
34082
- this.subs.add(this.changeNotification.changes.subscribe(() => {
34083
- if (!this.ctx.dataBindingDirective) {
34084
- this.stack.current.gridState = this.host.currentState;
34085
- }
34086
- }));
34064
+ this.subs.add(this.changeNotification.changes.subscribe(() => this.stack.current.gridState = this.host.currentState));
34087
34065
  ['Undo', 'Redo'].forEach((action) => {
34088
34066
  this.subs.add(this.undoRedoService[`on${action}`].subscribe(() => {
34089
34067
  if (!this.stack[`can${action}`]) {
34090
34068
  return;
34091
34069
  }
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);
34070
+ this.stack[`${action.toLowerCase()}`]();
34101
34071
  if (hasObservers(this[`on${action}`])) {
34072
+ const event = new UndoRedoEvent(this.stack.current);
34102
34073
  this[`on${action}`].emit(event);
34103
34074
  if (event.isDefaultPrevented()) {
34104
34075
  return;
34105
34076
  }
34106
34077
  }
34107
- this.stack[`${action.toLowerCase()}`]();
34108
34078
  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
- }
34079
+ this.host.loadState(this.stack.current.gridState);
34135
34080
  }));
34136
34081
  });
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
- });
34082
+ this.subs.add(this.undoRedoService.setState.subscribe((state) => this.stack.add({ originalEvent: 'dataChange', gridState: state })));
34148
34083
  }
34149
34084
  ngOnDestroy() {
34150
34085
  this.stack.clear();
@@ -34186,15 +34121,8 @@ class UndoRedoDirective {
34186
34121
  }
34187
34122
  this.undoRedoService.stackEndReached.next(false);
34188
34123
  }
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 });
34124
+ 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 });
34125
+ 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
34126
  }
34199
34127
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UndoRedoDirective, decorators: [{
34200
34128
  type: Directive,
@@ -34204,9 +34132,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
34204
34132
  exportAs: 'kendoGridUndoRedo',
34205
34133
  providers: [UndoRedoService]
34206
34134
  }]
34207
- }], ctorParameters: function () { return [{ type: GridComponent }, { type: EditService }, { type: UndoRedoService }, { type: ChangeNotificationService }, { type: ContextService }, { type: LocalDataChangesService }]; }, propDecorators: { maxStoredStates: [{
34208
- type: Input
34209
- }], itemIdKey: [{
34135
+ }], ctorParameters: function () { return [{ type: GridComponent }, { type: EditService }, { type: UndoRedoService }, { type: ChangeNotificationService }]; }, propDecorators: { maxStoredStates: [{
34210
34136
  type: Input
34211
34137
  }], onUndo: [{
34212
34138
  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.3",
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": 1750851099,
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.3",
43
+ "@progress/kendo-angular-common": "19.2.0-develop.3",
44
+ "@progress/kendo-angular-dateinputs": "19.2.0-develop.3",
45
+ "@progress/kendo-angular-layout": "19.2.0-develop.3",
46
+ "@progress/kendo-angular-navigation": "19.2.0-develop.3",
47
+ "@progress/kendo-angular-dropdowns": "19.2.0-develop.3",
48
+ "@progress/kendo-angular-excel-export": "19.2.0-develop.3",
49
+ "@progress/kendo-angular-icons": "19.2.0-develop.3",
50
+ "@progress/kendo-angular-inputs": "19.2.0-develop.3",
51
+ "@progress/kendo-angular-intl": "19.2.0-develop.3",
52
+ "@progress/kendo-angular-l10n": "19.2.0-develop.3",
53
+ "@progress/kendo-angular-label": "19.2.0-develop.3",
54
+ "@progress/kendo-angular-pager": "19.2.0-develop.3",
55
+ "@progress/kendo-angular-pdf-export": "19.2.0-develop.3",
56
+ "@progress/kendo-angular-popup": "19.2.0-develop.3",
57
+ "@progress/kendo-angular-toolbar": "19.2.0-develop.3",
58
+ "@progress/kendo-angular-utils": "19.2.0-develop.3",
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.3",
64
64
  "@progress/kendo-common": "^1.0.1",
65
65
  "@progress/kendo-file-saver": "^1.0.0"
66
66
  },
@@ -138,7 +138,6 @@ export declare class ListComponent implements OnInit, OnDestroy, AfterViewInit,
138
138
  lockedScroll(): void;
139
139
  lockedMousewheel(args: any): void;
140
140
  lockedKeydown(args: any): void;
141
- updateViewportColumns(range?: any): void;
142
141
  private detailExpand;
143
142
  private attachContainerScroll;
144
143
  private createScroller;
@@ -154,6 +153,7 @@ export declare class ListComponent implements OnInit, OnDestroy, AfterViewInit,
154
153
  private cleanupScroller;
155
154
  private initResizeService;
156
155
  private syncContainerHeight;
156
+ private updateViewportColumns;
157
157
  private handleColumnScroll;
158
158
  private updateColumnViewport;
159
159
  private calculateViewportColumns;
@@ -4,14 +4,14 @@ const schematics_1 = require("@angular-devkit/schematics");
4
4
  function default_1(options) {
5
5
  const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'GridModule', package: 'grid', peerDependencies: {
6
6
  // peer deps of the dropdowns
7
- '@progress/kendo-angular-treeview': '19.2.0-develop.14',
8
- '@progress/kendo-angular-navigation': '19.2.0-develop.14',
7
+ '@progress/kendo-angular-treeview': '19.2.0-develop.3',
8
+ '@progress/kendo-angular-navigation': '19.2.0-develop.3',
9
9
  // peer dependency of kendo-angular-inputs
10
- '@progress/kendo-angular-dialog': '19.2.0-develop.14',
10
+ '@progress/kendo-angular-dialog': '19.2.0-develop.3',
11
11
  // peer dependency of kendo-angular-icons
12
12
  '@progress/kendo-svg-icons': '^4.0.0',
13
13
  // peer dependency of kendo-angular-layout
14
- '@progress/kendo-angular-progressbar': '19.2.0-develop.14'
14
+ '@progress/kendo-angular-progressbar': '19.2.0-develop.3'
15
15
  } });
16
16
  return (0, schematics_1.externalSchematic)('@progress/kendo-angular-schematics', 'ng-add', finalOptions);
17
17
  }