igniteui-angular 22.0.3 → 22.0.5

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.
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { Injectable, inject, ElementRef, ChangeDetectorRef, TemplateRef, HostBinding, HostListener, ViewChild, Input, ChangeDetectionStrategy, Component, Pipe, DOCUMENT, forwardRef, InjectionToken, QueryList, NgZone, IterableDiffers, ViewContainerRef, Injector, EnvironmentInjector, LOCALE_ID, EventEmitter, createComponent, booleanAttribute, ViewChildren, ContentChildren, ContentChild, Output, Directive, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
3
3
  import { NgTemplateOutlet, NgClass, NgStyle } from '@angular/common';
4
4
  import { GridBaseAPIService, IGX_GRID_BASE, IgxGridSelectionService, IgxFilteringService, GridSelectionMode, IgxColumnFormatterPipe, IgxGroupByAreaDirective, IgxGroupAreaDropDirective, IgxGroupByMetaPipe, GridSummaryPosition, RowPinningPosition, IgxGridCellComponent, IgxGridCellImageAltPipe, IgxStringReplacePipe, IgxRowDirective, IgxRowDragDirective, IgxGridNotGroupedPipe, IgxGridTopLevelColumns, IgxGridCellStylesPipe, IgxGridCellStyleClassesPipe, IgxGridDataMapperPipe, IgxGridTransactionStatePipe, FilterMode, GridCellMergeMode, IgxGridValidationService, IgxColumnResizingService, IGX_GRID_SERVICE_BASE, IgxGridNavigationService, IgxGridSummaryService, IgxGridTransaction, RowEditPositionStrategy, getUUID, IgxGridExcelStyleFilteringComponent, DropPosition, IgxCell, IgxEditRow, IgxColumnComponent, CharSeparatedValueData, IgxAdvancedFilteringDialogComponent, IgxColumnGroupComponent, IgxGridPinningActionsComponent, IgxGridColumnResizerComponent, IgxGridHeaderRowComponent, IgxGridBodyDirective, IgxRowEditTabStopDirective, IgxSummaryRowComponent, IgxExcelStyleLoadingValuesTemplateDirective, IgxRowAddTextDirective, IgxRowExpandedIndicatorDirective, IgxRowCollapsedIndicatorDirective, IgxHeaderExpandedIndicatorDirective, IgxHeaderCollapsedIndicatorDirective, IgxExcelStyleHeaderIconDirective, IgxSortAscendingHeaderIconDirective, IgxSortDescendingHeaderIconDirective, IgxSortHeaderIconDirective, IgxGridLoadingTemplateDirective, IgxGridEmptyTemplateDirective, IgxHeadSelectorDirective, IgxRowSelectorDirective, IgxRowDragGhostDirective, IgxRowEditTemplateDirective, IgxRowEditTextDirective, IgxRowEditActionsDirective, IgxDragIndicatorIconDirective, IgxToolbarToken, WatchChanges, IgxGridRow, IgxGridCell, IgxGroupByRow, IgxSummaryRow, IgxGridMRLNavigationService, IgxGridDragSelectDirective, IgxColumnMovingDropDirective, IgxGridTransactionPipe, IgxHasVisibleColumnsPipe, IgxGridRowPinningPipe, IgxGridAddRowPipe, IgxGridRowClassesPipe, IgxGridRowStylesPipe, IgxSummaryDataPipe, IgxGridDetailTemplateDirective, IgxGroupByRowTemplateDirective, IgxGroupByRowSelectorDirective, IgxGridCRUDService, IgxGridFooterComponent, IgxGridStateDirective, IgxGridEditingActionsComponent, IgxGridActionsBaseDirective, IgxGridActionButtonComponent, IgxGridHeaderComponent, IgxGridHeaderGroupComponent, IgxFilterCellTemplateDirective, IgxSummaryTemplateDirective, IgxCellTemplateDirective, IgxCellValidationErrorDirective, IgxCellHeaderTemplateDirective, IgxCellFooterTemplateDirective, IgxCellEditorTemplateDirective, IgxCollapsibleIndicatorTemplateDirective, IgxColumnLayoutComponent, IgxColumnActionsComponent, IgxColumnHidingDirective, IgxColumnPinningDirective, IgxCSVTextDirective, IgxExcelTextDirective, IgxGridToolbarActionsComponent, IgxGridToolbarAdvancedFilteringComponent, IgxGridToolbarComponent, IgxGridToolbarExporterComponent, IgxGridToolbarHidingComponent, IgxGridToolbarPinningComponent, IgxGridToolbarTitleComponent, IgxGridToolbarDirective, IgxExcelStyleHeaderComponent, IgxExcelStyleSortingComponent, IgxExcelStylePinningComponent, IgxExcelStyleHidingComponent, IgxExcelStyleSelectingComponent, IgxExcelStyleClearFiltersComponent, IgxExcelStyleConditionalFilterComponent, IgxExcelStyleMovingComponent, IgxExcelStyleSearchComponent, IgxExcelStyleColumnOperationsTemplateDirective, IgxExcelStyleFilterOperationsTemplateDirective, IgxColumnRequiredValidatorDirective, IgxColumnMinValidatorDirective, IgxColumnMaxValidatorDirective, IgxColumnEmailValidatorDirective, IgxColumnMinLengthValidatorDirective, IgxColumnMaxLengthValidatorDirective, IgxColumnPatternValidatorDirective } from 'igniteui-angular/grids/core';
5
- import { cloneArray, DataUtil, GridColumnDataType, IgxNumberFormatterPipe, IgxDateFormatterPipe, IgxPercentFormatterPipe, IgxCurrencyFormatterPipe, GridSummaryCalculationMode, FilteringExpressionsTree, FilterUtil, HammerGesturesManager, isTree, FilteringLogic, FilteringExpressionsTreeType, getCurrentResourceStrings, GridResourceStringsEN, isObject, TransactionType, IgxFlatTransactionFactory, IgxOverlayService, PlatformUtil, I18N_FORMATTER, DefaultMergeStrategy, FilteringStrategy, ColumnPinningPosition, VerticalAlignment, HorizontalAlignment, ConnectedPositioningStrategy, AbsoluteScrollStrategy, DefaultDataCloneStrategy, ɵSize as _Size, areEqualArrays, resizeObservable, compareMaps, TransactionEventOrigin, mergeObjects, ContainerPositionStrategy, resolveNestedPath, columnFieldPath, recreateTree, recreateTreeFromFields, DEFAULT_LOCALE, onResourceChangeHandle, IgxOverlayOutletDirective, IgxActionStripToken } from 'igniteui-angular/core';
5
+ import { cloneArray, DataUtil, GridColumnDataType, IgxNumberFormatterPipe, IgxDateFormatterPipe, IgxPercentFormatterPipe, IgxCurrencyFormatterPipe, GridSummaryCalculationMode, FilteringExpressionsTree, FilterUtil, HammerGesturesManager, isTree, FilteringLogic, FilteringExpressionsTreeType, getCurrentResourceStrings, GridResourceStringsEN, isObject, TransactionType, IgxFlatTransactionFactory, IgxOverlayService, PlatformUtil, I18N_FORMATTER, DefaultMergeStrategy, FilteringStrategy, ColumnPinningPosition, VerticalAlignment, HorizontalAlignment, ConnectedPositioningStrategy, AbsoluteScrollStrategy, DefaultDataCloneStrategy, ɵSize as _Size, areEqualArrays, runAfterRenderOnce, resizeObservable, compareMaps, TransactionEventOrigin, mergeObjects, ContainerPositionStrategy, resolveNestedPath, columnFieldPath, recreateTree, recreateTreeFromFields, DEFAULT_LOCALE, onResourceChangeHandle, IgxOverlayOutletDirective, IgxActionStripToken } from 'igniteui-angular/core';
6
6
  import { takeUntil, shareReplay, filter, throttle, take, switchMap, throttleTime, takeWhile, map, first } from 'rxjs/operators';
7
7
  import { Subject, BehaviorSubject, animationFrameScheduler, fromEvent, timer, pipe, merge } from 'rxjs';
8
8
  import { IgxIconComponent } from 'igniteui-angular/icon';
@@ -4082,9 +4082,7 @@ class IgxGridBaseDirective {
4082
4082
  if (this.hasColumnsToAutosize) {
4083
4083
  this.headerContainer?.dataChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
4084
4084
  this.cdr.detectChanges();
4085
- this.zone.onStable.pipe(first()).subscribe(() => {
4086
- this.autoSizeColumnsInView();
4087
- });
4085
+ runAfterRenderOnce(this.injector, () => this.autoSizeColumnsInView());
4088
4086
  });
4089
4087
  }
4090
4088
  // Window resize observer not needed because when you resize the window element the tbody container always resize so
@@ -4532,7 +4530,7 @@ class IgxGridBaseDirective {
4532
4530
  // reset auto-size and calculate it again.
4533
4531
  this._columns.forEach(x => x.autoSize = undefined);
4534
4532
  this.resetCaches();
4535
- this.zone.onStable.pipe(first()).subscribe(() => {
4533
+ runAfterRenderOnce(this.injector, () => {
4536
4534
  this.cdr.detectChanges();
4537
4535
  this.autoSizeColumnsInView();
4538
4536
  });
@@ -5394,6 +5392,15 @@ class IgxGridBaseDirective {
5394
5392
  if (!sumExistingWidths && !columnsToSize) {
5395
5393
  return '0px';
5396
5394
  }
5395
+ // When the grid has no measurable width, calculateGridWidth() falls back to the
5396
+ // sum of its column widths and sets isColumnWidthSum. If all visible columns
5397
+ // already have explicit or constrained widths, columnsToSize is 0 and
5398
+ // computedWidth equals sumExistingWidths, resulting in 0 / 0 = NaN.
5399
+ // Return the "0px" sentinel so _derivePossibleWidth() preserves the existing
5400
+ // valid column widths.
5401
+ if (columnsToSize <= 0 && this.isColumnWidthSum) {
5402
+ return '0px';
5403
+ }
5397
5404
  computedWidth -= this.featureColumnsWidth();
5398
5405
  const columnWidth = !Number.isFinite(sumExistingWidths) ?
5399
5406
  computedWidth / columnsToSize :
@@ -6065,7 +6072,7 @@ class IgxGridBaseDirective {
6065
6072
  const tmplId = args.context.templateID.type;
6066
6073
  const index = args.context.index;
6067
6074
  args.view.detectChanges();
6068
- this.zone.onStable.pipe(first()).subscribe(() => {
6075
+ runAfterRenderOnce(this.injector, () => {
6069
6076
  const row = tmplId === 'dataRow' ? this.gridAPI.get_row_by_index(index) : null;
6070
6077
  const summaryRow = tmplId === 'summaryRow' ? this.summariesRowList.find((sr) => sr.dataRowIndex === index) : null;
6071
6078
  if (row && row instanceof IgxRowDirective) {
@@ -6700,25 +6707,16 @@ class IgxGridBaseDirective {
6700
6707
  this.calculateGridWidth();
6701
6708
  this.cdr.detectChanges();
6702
6709
  }
6703
- if (this.zone.isStable) {
6710
+ runAfterRenderOnce(this.injector, () => {
6704
6711
  this.zone.run(() => {
6705
6712
  this._applyWidthHostBinding();
6706
6713
  this.cdr.detectChanges();
6707
6714
  });
6708
- }
6709
- else {
6710
- this.zone.onStable.pipe(first()).subscribe(() => {
6711
- this.zone.run(() => {
6712
- this._applyWidthHostBinding();
6713
- });
6714
- });
6715
- }
6715
+ });
6716
6716
  this.resetCaches(recalcFeatureWidth);
6717
6717
  if (this.hasColumnsToAutosize) {
6718
6718
  this.cdr.detectChanges();
6719
- this.zone.onStable.pipe(first()).subscribe(() => {
6720
- this._autoSizeColumnsNotify.next();
6721
- });
6719
+ runAfterRenderOnce(this.injector, () => this._autoSizeColumnsNotify.next());
6722
6720
  }
6723
6721
  // in case horizontal scrollbar has appeared recalc to size correctly.
6724
6722
  if (hasHScroll !== this.hasHorizontalScroll()) {
@@ -7329,13 +7327,7 @@ class IgxGridBaseDirective {
7329
7327
  this.changeRowEditingOverlayStateOnScroll(this.crudService.rowInEditMode);
7330
7328
  }
7331
7329
  };
7332
- if (this.isZonelessChangeDetection()) {
7333
- this.cdr.detectChanges();
7334
- callback();
7335
- }
7336
- else {
7337
- this.zone.onStable.pipe(first()).subscribe(callback);
7338
- }
7330
+ runAfterRenderOnce(this.injector, callback);
7339
7331
  this.disableTransitions = false;
7340
7332
  this.hideOverlays();
7341
7333
  const context = this.actionStrip?.context;
@@ -7356,9 +7348,6 @@ class IgxGridBaseDirective {
7356
7348
  };
7357
7349
  this.gridScroll.emit(args);
7358
7350
  }
7359
- isZonelessChangeDetection() {
7360
- return this.zone.constructor.name === 'NoopNgZone';
7361
- }
7362
7351
  hasMenuPinningActions() {
7363
7352
  const strip = this.actionStrip;
7364
7353
  const actionButtons = strip?.actionButtons;
@@ -7376,7 +7365,7 @@ class IgxGridBaseDirective {
7376
7365
  this._horizontalForOfs.forEach(vfor => vfor.onHScroll(scrollLeft));
7377
7366
  this.cdr.markForCheck();
7378
7367
  this.zone.run(() => {
7379
- this.zone.onStable.pipe(first()).subscribe(() => {
7368
+ runAfterRenderOnce(this.injector, () => {
7380
7369
  this.parentVirtDir.chunkLoad.emit(this.headerContainer.state);
7381
7370
  requestAnimationFrame(() => {
7382
7371
  this.autoSizeColumnsInView();