igniteui-angular 22.0.3 → 22.0.4

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.
@@ -4,7 +4,7 @@ import { inject, ElementRef, HostListener, ChangeDetectionStrategy, Component, H
4
4
  import { NgTemplateOutlet, NgClass, NgStyle } from '@angular/common';
5
5
  import { takeUntil, take, timeout, first } from 'rxjs/operators';
6
6
  import { IgxGridHeaderComponent, IgxPivotColumnResizingService, PivotRowLayoutType, PivotUtil, SortingIndexPipe, IgxGridHeaderGroupComponent, IGX_GRID_BASE, IgxColumnMovingDragDirective, IgxColumnMovingDropDirective, IgxPivotResizeHandleDirective, IgxHeaderGroupStylePipe, IgxGridHeaderRowComponent, DropPosition, IgxGridExcelStyleFilteringComponent, IgxExcelStyleColumnOperationsTemplateDirective, IgxExcelStyleFilterOperationsTemplateDirective, IgxExcelStyleSearchComponent, IgxGridTopLevelColumns, IgxGridNavigationService, HEADER_KEYS, ROW_EXPAND_KEYS, ROW_COLLAPSE_KEYS, PivotSummaryPosition, IgxFilteringService, DimensionValuesFilteringStrategy, IgxColumnComponent, DEFAULT_PIVOT_KEYS, PivotRowDimensionsStrategy, PivotColumnDimensionsStrategy, GridBaseAPIService, IgxRowDirective, IgxGridCellComponent, IgxGridNotGroupedPipe, IgxGridCellStylesPipe, IgxGridTransactionStatePipe, FilterMode, PivotDimensionType, NoopPivotDimensionsStrategy, IgxPivotDateDimension, IgxColumnGroupComponent, IgxGridBodyDirective, IgxGridDragSelectDirective, IgxPivotGridColumnResizerComponent, IgxGridRowClassesPipe, IgxGridRowStylesPipe, IgxGridCRUDService, IgxGridValidationService, IgxGridSummaryService, IgxGridSelectionService, IgxColumnResizingService, IGX_GRID_SERVICE_BASE, WatchChanges, IgxGridFooterComponent, IgxAdvancedFilteringDialogComponent, IgxRowExpandedIndicatorDirective, IgxRowCollapsedIndicatorDirective, IgxHeaderExpandedIndicatorDirective, IgxHeaderCollapsedIndicatorDirective, IgxExcelStyleHeaderIconDirective, IgxSortAscendingHeaderIconDirective, IgxSortDescendingHeaderIconDirective, IgxSortHeaderIconDirective, IgxDragIndicatorIconDirective, IgxRowDragGhostDirective, IgxGridStateDirective, IgxGridPinningActionsComponent, IgxGridEditingActionsComponent, IgxGridActionsBaseDirective, IgxGridActionButtonComponent, IgxFilterCellTemplateDirective, IgxSummaryTemplateDirective, IgxCellTemplateDirective, IgxCellValidationErrorDirective, IgxCellHeaderTemplateDirective, IgxCellFooterTemplateDirective, IgxCellEditorTemplateDirective, IgxCollapsibleIndicatorTemplateDirective, IgxColumnLayoutComponent, IgxColumnActionsComponent, IgxColumnHidingDirective, IgxColumnPinningDirective, IgxRowSelectorDirective, IgxGroupByRowSelectorDirective, IgxHeadSelectorDirective, IgxCSVTextDirective, IgxExcelTextDirective, IgxGridToolbarActionsComponent, IgxGridToolbarAdvancedFilteringComponent, IgxGridToolbarComponent, IgxGridToolbarExporterComponent, IgxGridToolbarHidingComponent, IgxGridToolbarPinningComponent, IgxGridToolbarTitleComponent, IgxGridToolbarDirective, IgxExcelStyleHeaderComponent, IgxExcelStyleSortingComponent, IgxExcelStylePinningComponent, IgxExcelStyleHidingComponent, IgxExcelStyleSelectingComponent, IgxExcelStyleClearFiltersComponent, IgxExcelStyleConditionalFilterComponent, IgxExcelStyleMovingComponent, IgxExcelStyleLoadingValuesTemplateDirective } from 'igniteui-angular/grids/core';
7
- import { SortingDirection, VerticalAlignment, AbsoluteScrollStrategy, AutoPositionStrategy, FilteringExpressionsTree, FilteringLogic, DefaultSortingStrategy, GridColumnDataType, parseDate, cloneArray, FilterUtil, DataUtil, columnFieldPath, resolveNestedPath, DefaultDataCloneStrategy, ɵSize as _Size, onResourceChangeHandle, resizeObservable, IgxOverlayOutletDirective } from 'igniteui-angular/core';
7
+ import { SortingDirection, VerticalAlignment, AbsoluteScrollStrategy, AutoPositionStrategy, FilteringExpressionsTree, FilteringLogic, DefaultSortingStrategy, GridColumnDataType, parseDate, cloneArray, FilterUtil, DataUtil, columnFieldPath, resolveNestedPath, DefaultDataCloneStrategy, ɵSize as _Size, onResourceChangeHandle, resizeObservable, runAfterRenderOnce, IgxOverlayOutletDirective } from 'igniteui-angular/core';
8
8
  import { IgxIconComponent } from 'igniteui-angular/icon';
9
9
  import { IgxDropDirective, IgxGridForOfDirective, IgxTemplateOutletDirective, IgxToggleDirective, IgxForOfSyncService, IgxForOfScrollSyncService, IgxDragDirective, IgxDragHandleDirective } from 'igniteui-angular/directives';
10
10
  import { IgxChipsAreaComponent, IgxChipComponent } from 'igniteui-angular/chips';
@@ -2638,6 +2638,7 @@ class IgxPivotGridComponent extends IgxGridBaseDirective {
2638
2638
  this._pivotConfiguration = value;
2639
2639
  this.emitInitEvents(this._pivotConfiguration);
2640
2640
  this.filteringExpressionsTree = PivotUtil.buildExpressionTree(value);
2641
+ this.setDateDimensionsLocaleData();
2641
2642
  if (!this._init) {
2642
2643
  this.setupColumns();
2643
2644
  }
@@ -2974,6 +2975,7 @@ class IgxPivotGridComponent extends IgxGridBaseDirective {
2974
2975
  this.setupColumns();
2975
2976
  // Bind to onResourceChange after the columns have initialized the first time to avoid premature initialization.
2976
2977
  onResourceChangeHandle(this.destroy$, () => {
2978
+ this.setDateDimensionsLocaleData();
2977
2979
  // Since the columns are kinda static, due to assigning DisplayName on init, they need to be regenerated.
2978
2980
  this.setupColumns();
2979
2981
  }, this);
@@ -3534,6 +3536,7 @@ class IgxPivotGridComponent extends IgxGridBaseDirective {
3534
3536
  * This parameter is optional. If not set it will add it to the end of the collection.
3535
3537
  */
3536
3538
  insertDimensionAt(dimension, targetCollectionType, index) {
3539
+ this.setDateDimensionsLocaleData([dimension]);
3537
3540
  const targetCollection = this.getDimensionsByType(targetCollectionType);
3538
3541
  if (index !== undefined) {
3539
3542
  targetCollection.splice(index, 0, dimension);
@@ -4029,7 +4032,7 @@ class IgxPivotGridComponent extends IgxGridBaseDirective {
4029
4032
  super.calculateGridSizes(recalcFeatureWidth);
4030
4033
  if (this.hasDimensionsToAutosize) {
4031
4034
  this.cdr.detectChanges();
4032
- this.zone.onStable.pipe(first()).subscribe(() => {
4035
+ runAfterRenderOnce(this.injector, () => {
4033
4036
  requestAnimationFrame(() => {
4034
4037
  this.autoSizeDimensionsInView();
4035
4038
  });
@@ -4321,6 +4324,36 @@ class IgxPivotGridComponent extends IgxGridBaseDirective {
4321
4324
  this.pipeTrigger++;
4322
4325
  }
4323
4326
  }
4327
+ /**
4328
+ * Sets the locale and resourceStrings data based on the grid's properties for all IgxPivotDateDimensions in the config.
4329
+ * By default search all dimensions (even not enabled).
4330
+ * @param entryDimensions Entry dimension on which to check for IgxPivotDateDimension instead of the default.
4331
+ */
4332
+ setDateDimensionsLocaleData(entryDimensions) {
4333
+ const topDimensions = entryDimensions ?? [...this.allDimensions];
4334
+ for (const dim of topDimensions) {
4335
+ let foundDateDim;
4336
+ if (dim instanceof IgxPivotDateDimension) {
4337
+ foundDateDim = dim;
4338
+ }
4339
+ else if (dim.childLevel) {
4340
+ var curChild = dim.childLevel;
4341
+ while (curChild) {
4342
+ if (curChild instanceof IgxPivotDateDimension) {
4343
+ foundDateDim = curChild;
4344
+ break;
4345
+ }
4346
+ curChild = curChild.childLevel;
4347
+ }
4348
+ }
4349
+ if (foundDateDim) {
4350
+ foundDateDim.resourceStrings = this.resourceStrings;
4351
+ if (this.locale) {
4352
+ foundDateDim.locale = this.locale;
4353
+ }
4354
+ }
4355
+ }
4356
+ }
4324
4357
  /**
4325
4358
  * @hidden @internal
4326
4359
  */