igniteui-angular 21.1.4 → 21.1.6

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.
@@ -1,7 +1,7 @@
1
1
  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
- 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, 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, IgxGridPinningActionsComponent, 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';
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
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';
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';
@@ -737,7 +737,7 @@ class IgxGridUnmergeActivePipe {
737
737
  }
738
738
  const result = cloneArray(collection);
739
739
  uniqueRoots.forEach(x => {
740
- const index = collection.indexOf(x);
740
+ const index = x.index;
741
741
  const colKeys = [...x.cellMergeMeta.keys()];
742
742
  const cols = colsToMerge.filter(col => colKeys.indexOf(col.field) !== -1);
743
743
  for (const col of cols) {
@@ -3620,7 +3620,7 @@ class IgxGridBaseDirective {
3620
3620
  }
3621
3621
  getMergeCellOffset(rowData) {
3622
3622
  const index = rowData.dataIndex;
3623
- let offset = this.verticalScrollContainer.scrollPosition - this.verticalScrollContainer.getScrollForIndex(index);
3623
+ let offset = this.verticalScrollContainer._virtScrollPosition - this.verticalScrollContainer.getScrollForIndex(index);
3624
3624
  if (this.hasPinnedRecords && this.isRowPinningToTop) {
3625
3625
  offset -= this.pinnedRowHeight;
3626
3626
  }
@@ -3786,7 +3786,7 @@ class IgxGridBaseDirective {
3786
3786
  this.cdr.detectChanges();
3787
3787
  });
3788
3788
  this.verticalScrollContainer.contentSizeChange.pipe(filter(() => !this._init), throttleTime(30), destructor).subscribe(() => {
3789
- this.notifyChanges(true);
3789
+ this.onContentSizeChange();
3790
3790
  });
3791
3791
  this.verticalScrollContainer.chunkPreload.pipe(filter(() => !this._init), destructor).subscribe(() => {
3792
3792
  this.updateMergedData();
@@ -3961,6 +3961,11 @@ class IgxGridBaseDirective {
3961
3961
  this.paginationComponents.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
3962
3962
  this.setUpPaginator();
3963
3963
  });
3964
+ this.actionStripComponents.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
3965
+ if (this.actionStrip) {
3966
+ this.actionStrip.menuOverlaySettings.outlet = this.outlet;
3967
+ }
3968
+ });
3964
3969
  if (this.actionStrip) {
3965
3970
  this.actionStrip.menuOverlaySettings.outlet = this.outlet;
3966
3971
  }
@@ -6829,18 +6834,21 @@ class IgxGridBaseDirective {
6829
6834
  if (!this._height) {
6830
6835
  return null;
6831
6836
  }
6837
+ const styles = this.document.defaultView.getComputedStyle(this.nativeElement);
6832
6838
  const actualTheadRow = this.getTheadRowHeight();
6833
6839
  const footerHeight = this.getFooterHeight();
6834
6840
  const toolbarHeight = this.getToolbarHeight();
6835
6841
  const pagingHeight = this.getPagingFooterHeight();
6836
6842
  const groupAreaHeight = this.getGroupAreaHeight();
6837
6843
  const scrHeight = this.getComputedHeight(this.scr.nativeElement);
6844
+ const borderTop = parseFloat(styles.getPropertyValue('border-top-width')) || 0;
6845
+ const borderBottom = parseFloat(styles.getPropertyValue('border-bottom-width')) || 0;
6838
6846
  const renderedHeight = toolbarHeight + actualTheadRow +
6839
6847
  footerHeight + pagingHeight + groupAreaHeight +
6840
- scrHeight;
6848
+ scrHeight + borderTop + borderBottom;
6841
6849
  let gridHeight = 0;
6842
6850
  if (this.isPercentHeight) {
6843
- const computed = this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('height');
6851
+ const computed = styles.getPropertyValue('height');
6844
6852
  const autoSize = this._shouldAutoSize(renderedHeight);
6845
6853
  if (autoSize || computed.indexOf('%') !== -1) {
6846
6854
  const bodyHeight = this.getDataBasedBodyHeight();
@@ -7350,9 +7358,16 @@ class IgxGridBaseDirective {
7350
7358
  });
7351
7359
  this.disableTransitions = false;
7352
7360
  this.hideOverlays();
7353
- this.actionStrip?.hide();
7354
- if (this.actionStrip) {
7355
- this.actionStrip.context = null;
7361
+ const context = this.actionStrip?.context;
7362
+ const contextEl = context?.element?.nativeElement;
7363
+ const keepActionStrip = !!context?.pinned &&
7364
+ !!contextEl?.isConnected &&
7365
+ !this.hasMenuPinningActions();
7366
+ if (!keepActionStrip) {
7367
+ if (this.actionStrip) {
7368
+ this.actionStrip.hide();
7369
+ this.actionStrip.context = null;
7370
+ }
7356
7371
  }
7357
7372
  const args = {
7358
7373
  direction: 'vertical',
@@ -7361,6 +7376,17 @@ class IgxGridBaseDirective {
7361
7376
  };
7362
7377
  this.gridScroll.emit(args);
7363
7378
  }
7379
+ hasMenuPinningActions() {
7380
+ const strip = this.actionStrip;
7381
+ const actionButtons = strip?.actionButtons;
7382
+ if (!actionButtons?.length) {
7383
+ return false;
7384
+ }
7385
+ return actionButtons
7386
+ .toArray()
7387
+ .some((button) => button instanceof IgxGridPinningActionsComponent &&
7388
+ button.asMenuItems);
7389
+ }
7364
7390
  horizontalScrollHandler(event) {
7365
7391
  const scrollLeft = event.target.scrollLeft;
7366
7392
  this.headerContainer.onHScroll(scrollLeft);
@@ -7703,6 +7729,9 @@ class IgxGridBaseDirective {
7703
7729
  return false;
7704
7730
  return Object.keys(oldData[0]).join() !== Object.keys(newData[0]).join();
7705
7731
  }
7732
+ onContentSizeChange() {
7733
+ this.notifyChanges(true);
7734
+ }
7706
7735
  /**
7707
7736
  * Clears the current navigation service active node
7708
7737
  */
@@ -7736,16 +7765,15 @@ class IgxGridBaseDirective {
7736
7765
  // recalc merged data
7737
7766
  if (this.columnsToMerge.length > 0) {
7738
7767
  const startIndex = this.verticalScrollContainer.state.startIndex;
7739
- const prevDataView = this.verticalScrollContainer.igxForOf?.slice(0, startIndex);
7740
7768
  const data = [];
7741
- for (let index = 0; index < startIndex; index++) {
7742
- const rec = prevDataView[index];
7743
- if (rec.cellMergeMeta &&
7744
- // index + maxRowSpan is within view
7745
- startIndex < (index + Math.max(...rec.cellMergeMeta.values().toArray().map(x => x.rowSpan)))) {
7746
- const visibleIndex = this.isRowPinningToTop ? index + this.pinnedRecordsCount : index;
7747
- data.push({ record: rec, index: visibleIndex, dataIndex: index });
7748
- }
7769
+ const rec = this.verticalScrollContainer.igxForOf[startIndex];
7770
+ if (rec && rec.cellMergeMeta) {
7771
+ this.columnsToMerge.forEach((col) => {
7772
+ const root = rec.cellMergeMeta?.get(col.field)?.root;
7773
+ if (root) {
7774
+ data.push({ record: root, index: root.index, dataIndex: root.index });
7775
+ }
7776
+ });
7749
7777
  }
7750
7778
  this._mergedDataInView = data;
7751
7779
  this.notifyChanges();