@skyux/ag-grid 14.0.0-alpha.2 → 14.0.0-alpha.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.
@@ -1,15 +1,15 @@
1
- import { NgClass, AsyncPipe, CommonModule, NgTemplateOutlet } from '@angular/common';
1
+ import { NgClass, CommonModule, NgTemplateOutlet, AsyncPipe } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { NgModule, Injectable, input, numberAttribute, viewChild, inject, ChangeDetectorRef, ElementRef, DOCUMENT, effect, booleanAttribute, Input, HostBinding, ContentChild, ChangeDetectionStrategy, Component, contentChildren, signal, linkedSignal, computed, untracked, Directive, InjectionToken, model, output, contentChild, EnvironmentInjector, HostListener, ViewChild, ViewEncapsulation, isSignal, DestroyRef, CSP_NONCE, Optional } from '@angular/core';
3
+ import { NgModule, Injectable, signal, input, booleanAttribute, numberAttribute, viewChild, inject, DestroyRef, ElementRef, DOCUMENT, computed, effect, ContentChild, ChangeDetectionStrategy, Component, contentChildren, linkedSignal, ChangeDetectorRef, untracked, Directive, InjectionToken, model, output, contentChild, EnvironmentInjector, HostListener, ViewChild, ViewEncapsulation, HostBinding, isSignal, Input, CSP_NONCE } from '@angular/core';
4
4
  import { AgGridAngular } from 'ag-grid-angular';
5
5
  import * as i3 from '@skyux/i18n';
6
6
  import { SkyLibResourcesService, SkyI18nModule } from '@skyux/i18n';
7
- import { toSignal, toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
+ import { toSignal, takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
8
8
  import * as i1 from '@skyux/core';
9
9
  import { SkyMutationObserverService, SkyIdModule, SkyViewkeeperModule, SkyMediaQueryService, SkyResizeObserverService, SkyAffixModule, SkyOverlayService, SkyScrollableHostService, SKY_STACKING_CONTEXT, SkyNumericModule, SkyDynamicComponentService, SkyDynamicComponentLocation, SkyLogService } from '@skyux/core';
10
10
  import { SkyDataManagerService } from '@skyux/data-manager';
11
- import { Subject, BehaviorSubject, ReplaySubject, takeUntil, combineLatest, distinctUntilChanged, of, take, map, switchMap, filter, fromEvent, Subscription, merge, startWith, scan, first, fromEventPattern, isObservable, observeOn, asyncScheduler } from 'rxjs';
12
- import * as i2$4 from '@skyux/theme';
11
+ import { Observable, EMPTY, merge, Subject, map, takeUntil, switchMap, of, filter, Subscription, startWith, scan, BehaviorSubject, take, distinctUntilChanged, fromEvent, first, isObservable } from 'rxjs';
12
+ import * as i1$5 from '@skyux/theme';
13
13
  import { SkyThemeService, SkyThemeModule } from '@skyux/theme';
14
14
  import { themeQuartz, colorSchemeLight, KeyCode } from 'ag-grid-community';
15
15
  import * as i1$1 from '@skyux/layout';
@@ -28,7 +28,7 @@ import * as i2$3 from '@skyux/indicators';
28
28
  import { SkyStatusIndicatorModule, SkyWaitModule } from '@skyux/indicators';
29
29
  import * as i1$4 from '@skyux/popovers';
30
30
  import { SkyPopoverMessageType, SkyPopoverModule } from '@skyux/popovers';
31
- import * as i2$5 from '@skyux/icon';
31
+ import * as i2$4 from '@skyux/icon';
32
32
  import { SkyIconModule } from '@skyux/icon';
33
33
 
34
34
  /* istanbul ignore file */
@@ -150,6 +150,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
150
150
  }]
151
151
  }] });
152
152
 
153
+ function fromGridEvent(target, eventType) {
154
+ return new Observable((subscriber) => {
155
+ const handler = (event) => subscriber.next(event);
156
+ target.addEventListener(eventType, handler);
157
+ return () => {
158
+ target.removeEventListener(eventType, handler);
159
+ };
160
+ });
161
+ }
162
+
153
163
  const defaultsForAllThemes = {
154
164
  backgroundColor: 'var(--sky-override-ag-grid-background-color, var(--sky-color-background-row-base))',
155
165
  borderColor: 'var(--sky-override-ag-grid-border-color, var(--sky-color-border-separator-row))',
@@ -400,20 +410,6 @@ var SkyCellType;
400
410
 
401
411
  let idIndex = 0;
402
412
  class SkyAgGridWrapperComponent {
403
- /**
404
- * Enable a compact layout for the grid when using modern theme. Compact layout uses
405
- * a smaller font size and row height to display more data in a smaller space.
406
- */
407
- set compact(value) {
408
- this.#isCompact.next(value);
409
- }
410
- get viewkeeperClasses() {
411
- return this.#_viewkeeperClasses;
412
- }
413
- set viewkeeperClasses(value) {
414
- this.#_viewkeeperClasses = value;
415
- this.#changeDetector.markForCheck();
416
- }
417
413
  get #isInEditMode() {
418
414
  if (this.agGrid && this.agGrid.api) {
419
415
  const primaryGridEditing = this.agGrid.api.getEditingCells().length > 0;
@@ -432,97 +428,103 @@ class SkyAgGridWrapperComponent {
432
428
  }
433
429
  return false;
434
430
  }
435
- #_viewkeeperClasses;
436
- #ngUnsubscribe;
431
+ #destroyRef;
437
432
  #themeSvc;
438
- #wrapperClasses;
433
+ #themeSettings;
439
434
  #adapterService;
440
- #changeDetector;
441
- #parentChangeDetector;
442
435
  #elementRef;
443
436
  #document;
444
437
  #mutationObserverService;
445
- #isCompact;
446
438
  #hasEditableClass;
439
+ #cellEditingClasses;
440
+ #agGridClassObserver;
447
441
  constructor() {
448
- this.isNormalLayout = false;
442
+ this.isNormalLayout = signal(false, ...(ngDevMode ? [{ debugName: "isNormalLayout" }] : []));
443
+ /**
444
+ * Enable a compact layout for the grid when using modern theme. Compact layout uses
445
+ * a smaller font size and row height to display more data in a smaller space.
446
+ */
447
+ this.compact = input(false, { ...(ngDevMode ? { debugName: "compact" } : {}), transform: booleanAttribute });
449
448
  /**
450
449
  * The minimum height of the grid in pixels. The default value is `50`.
451
450
  */
452
451
  this.minHeight = input(50, { ...(ngDevMode ? { debugName: "minHeight" } : {}), transform: numberAttribute });
452
+ /**
453
+ * @internal
454
+ */
455
+ this.viewkeeperClasses = signal([], ...(ngDevMode ? [{ debugName: "viewkeeperClasses" }] : []));
453
456
  this.skyAgGridDiv = viewChild('skyAgGridDiv', ...(ngDevMode ? [{ debugName: "skyAgGridDiv" }] : []));
454
- this.#_viewkeeperClasses = [];
455
- this.#ngUnsubscribe = new Subject();
457
+ this.#destroyRef = inject(DestroyRef);
456
458
  this.#themeSvc = inject(SkyThemeService, {
457
459
  optional: true,
458
460
  });
459
- this.#wrapperClasses = new BehaviorSubject([
460
- `ag-theme-sky-data-grid-default`,
461
- ]);
461
+ this.#themeSettings = toSignal(this.#themeSvc?.settingsChange ?? EMPTY);
462
462
  this.#adapterService = inject(SkyAgGridAdapterService);
463
- this.#changeDetector = inject(ChangeDetectorRef);
464
- this.#parentChangeDetector = inject(ChangeDetectorRef, {
465
- optional: true,
466
- skipSelf: true,
467
- });
468
463
  this.#elementRef = inject((ElementRef));
469
464
  this.#document = inject(DOCUMENT);
470
465
  this.#mutationObserverService = inject(SkyMutationObserverService);
471
- this.#isCompact = new BehaviorSubject(false);
472
- this.#hasEditableClass = new ReplaySubject(1);
466
+ this.#hasEditableClass = signal(false, ...(ngDevMode ? [{ debugName: "#hasEditableClass" }] : []));
467
+ this.#cellEditingClasses = signal([], ...(ngDevMode ? [{ debugName: "#cellEditingClasses" }] : []));
468
+ this.wrapperClasses = computed(() => {
469
+ const hasEditableClass = this.#hasEditableClass();
470
+ const isCompact = this.compact();
471
+ const themeSettings = this.#themeSettings()?.currentSettings;
472
+ const cellEditingClasses = this.#cellEditingClasses();
473
+ const skyAgGridThemeClassName = getSkyAgGridThemeClassName(hasEditableClass, themeSettings, isCompact);
474
+ const classes = [skyAgGridThemeClassName, ...cellEditingClasses];
475
+ if (this.#getTextSelection(hasEditableClass)) {
476
+ classes.push('sky-ag-grid-text-selection');
477
+ }
478
+ return [...new Set(classes)];
479
+ }, ...(ngDevMode ? [{ debugName: "wrapperClasses" }] : []));
473
480
  idIndex++;
474
481
  this.afterAnchorId = 'sky-ag-grid-nav-anchor-after-' + idIndex;
475
482
  this.beforeAnchorId = 'sky-ag-grid-nav-anchor-before-' + idIndex;
476
483
  this.gridId = 'sky-ag-grid-' + idIndex;
477
- this.wrapperClasses$ = this.#wrapperClasses.asObservable();
478
484
  effect(() => {
479
485
  const minHeight = this.minHeight();
480
486
  const skyAgGridDiv = this.skyAgGridDiv()?.nativeElement;
481
487
  skyAgGridDiv?.style.setProperty('--sky-ag-grid-min-height', `${minHeight}px`);
482
488
  });
489
+ effect(() => {
490
+ const hasEditableClass = this.#hasEditableClass();
491
+ const skyAgGridTheme = getSkyAgGridTheme(hasEditableClass ? 'data-entry-grid' : 'data-grid');
492
+ this.agGrid?.api?.setGridOption('theme', skyAgGridTheme);
493
+ });
494
+ this.#destroyRef.onDestroy(() => {
495
+ this.#agGridClassObserver?.disconnect();
496
+ });
483
497
  }
484
498
  ngAfterContentInit() {
485
499
  if (this.agGrid) {
486
500
  const domLayout = this.agGrid.gridOptions?.domLayout;
487
501
  if (domLayout === 'autoHeight') {
488
502
  if (this.agGrid.gridOptions?.context?.enableTopScroll) {
489
- this.viewkeeperClasses.push('.ag-header', '.ag-body-horizontal-scroll');
503
+ this.viewkeeperClasses.update((prev) => [
504
+ ...prev,
505
+ '.ag-header',
506
+ '.ag-body-horizontal-scroll',
507
+ ]);
490
508
  }
491
509
  else {
492
- this.viewkeeperClasses.push('.ag-header');
510
+ this.viewkeeperClasses.update((prev) => [...prev, '.ag-header']);
493
511
  }
494
512
  }
495
513
  else if (domLayout === 'normal') {
496
- this.isNormalLayout = true;
497
- this.#parentChangeDetector?.detectChanges();
514
+ this.isNormalLayout.set(true);
498
515
  }
499
- this.agGrid.gridReady
500
- .pipe(takeUntil(this.#ngUnsubscribe))
501
- .subscribe(() => {
502
- this.#moveHorizontalScroll();
503
- });
504
- this.agGrid.firstDataRendered
505
- .pipe(takeUntil(this.#ngUnsubscribe))
506
- .subscribe(() => {
507
- this.#moveHorizontalScroll();
508
- });
509
- this.agGrid.rowDataUpdated
510
- .pipe(takeUntil(this.#ngUnsubscribe))
511
- .subscribe(() => {
512
- this.#moveHorizontalScroll();
513
- });
516
+ merge(this.agGrid.gridReady, this.agGrid.firstDataRendered, this.agGrid.rowDataUpdated)
517
+ .pipe(takeUntilDestroyed(this.#destroyRef))
518
+ .subscribe(() => this.#moveHorizontalScroll());
514
519
  this.agGrid.cellEditingStarted
515
- .pipe(takeUntil(this.#ngUnsubscribe))
520
+ .pipe(takeUntilDestroyed(this.#destroyRef))
516
521
  .subscribe((params) => {
517
522
  if (params.colDef.type) {
518
523
  const types = Array.isArray(params.colDef.type)
519
524
  ? params.colDef.type
520
525
  : [params.colDef.type];
521
526
  const addClasses = types.map((t) => `sky-ag-grid-cell-editing-${t}`);
522
- this.#wrapperClasses.next([
523
- ...this.#wrapperClasses.getValue(),
524
- ...addClasses,
525
- ]);
527
+ this.#cellEditingClasses.update((prev) => [...prev, ...addClasses]);
526
528
  if (types.includes(SkyCellType.Template) &&
527
529
  params.rowIndex !== null) {
528
530
  this.agGrid?.api.setFocusedCell(params.rowIndex, params.column);
@@ -530,14 +532,12 @@ class SkyAgGridWrapperComponent {
530
532
  }
531
533
  });
532
534
  this.agGrid.cellEditingStopped
533
- .pipe(takeUntil(this.#ngUnsubscribe))
535
+ .pipe(takeUntilDestroyed(this.#destroyRef))
534
536
  .subscribe(() => {
535
- this.#wrapperClasses.next(this.#wrapperClasses
536
- .getValue()
537
- .filter((c) => !c.startsWith('sky-ag-grid-cell-editing-')));
537
+ this.#cellEditingClasses.set([]);
538
538
  });
539
539
  this.agGrid.cellFocused
540
- .pipe(takeUntil(this.#ngUnsubscribe))
540
+ .pipe(takeUntilDestroyed(this.#destroyRef))
541
541
  .subscribe((event) => {
542
542
  const context = event.context || {};
543
543
  context['lastFocusedCell'] = {
@@ -549,7 +549,7 @@ class SkyAgGridWrapperComponent {
549
549
  event.api?.setGridOption('context', context);
550
550
  });
551
551
  this.agGrid.headerFocused
552
- .pipe(takeUntil(this.#ngUnsubscribe))
552
+ .pipe(takeUntilDestroyed(this.#destroyRef))
553
553
  .subscribe((event) => {
554
554
  const context = event.context || {};
555
555
  context['lastFocusedCell'] = {
@@ -562,38 +562,19 @@ class SkyAgGridWrapperComponent {
562
562
  });
563
563
  }
564
564
  }
565
- ngOnDestroy() {
566
- this.#ngUnsubscribe.next();
567
- this.#ngUnsubscribe.complete();
568
- this.#hasEditableClass.complete();
569
- this.#isCompact.complete();
570
- this.#wrapperClasses.complete();
571
- }
572
- ngOnInit() {
573
- combineLatest([
574
- this.#hasEditableClass.pipe(distinctUntilChanged()),
575
- this.#isCompact.pipe(distinctUntilChanged()),
576
- this.#themeSvc?.settingsChange ?? of(undefined),
577
- ])
578
- .pipe(takeUntil(this.#ngUnsubscribe))
579
- .subscribe(([hasEditableClass, isCompact, settings]) => {
580
- this.#updateGridTheme(hasEditableClass, isCompact, settings?.currentSettings);
581
- });
582
- }
583
565
  ngAfterViewInit() {
584
- const agGridElement = this.#elementRef.nativeElement.querySelector('ag-grid-angular');
566
+ const agGridElement = this.#elementRef.nativeElement.querySelector('ag-grid-angular') ??
567
+ undefined;
585
568
  const callback = () => {
586
- this.#hasEditableClass.next(!!agGridElement?.classList.contains('sky-ag-grid-editable'));
569
+ this.#hasEditableClass.set(!!agGridElement?.classList.contains('sky-ag-grid-editable'));
587
570
  };
588
571
  if (agGridElement) {
589
- const agGridClassObserver = this.#mutationObserverService.create(callback);
590
- agGridClassObserver.observe(agGridElement, {
572
+ this.#agGridClassObserver =
573
+ this.#mutationObserverService.create(callback);
574
+ this.#agGridClassObserver.observe(agGridElement, {
591
575
  attributes: true,
592
576
  attributeFilter: ['class'],
593
577
  });
594
- this.#ngUnsubscribe.pipe(take(1)).subscribe(() => {
595
- agGridClassObserver.disconnect();
596
- });
597
578
  }
598
579
  callback();
599
580
  }
@@ -645,24 +626,6 @@ class SkyAgGridWrapperComponent {
645
626
  }
646
627
  }
647
628
  }
648
- #updateGridTheme(hasEditableClass, isCompact, themeSettings) {
649
- const skyAgGridTheme = getSkyAgGridTheme(hasEditableClass ? 'data-entry-grid' : 'data-grid');
650
- this.agGrid?.api?.setGridOption('theme', skyAgGridTheme);
651
- const skyAgGridThemeClassName = getSkyAgGridThemeClassName(hasEditableClass, themeSettings, isCompact);
652
- const previousValue = this.#wrapperClasses.getValue();
653
- let value = [
654
- ...previousValue.filter((c) => !c.startsWith('ag-theme-')),
655
- skyAgGridThemeClassName,
656
- ];
657
- const textSelectionClass = 'sky-ag-grid-text-selection';
658
- if (this.#getTextSelection(hasEditableClass)) {
659
- value.push(textSelectionClass);
660
- }
661
- else {
662
- value = value.filter((c) => c !== textSelectionClass);
663
- }
664
- this.#wrapperClasses.next([...new Set(value)]);
665
- }
666
629
  #getTextSelection(hasEditableClass) {
667
630
  if (this.agGrid?.gridOptions?.context?.enableCellTextSelection) {
668
631
  return !hasEditableClass;
@@ -672,23 +635,19 @@ class SkyAgGridWrapperComponent {
672
635
  }
673
636
  }
674
637
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
675
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.2", type: SkyAgGridWrapperComponent, isStandalone: true, selector: "sky-ag-grid-wrapper", inputs: { compact: { classPropertyName: "compact", publicName: "compact", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.sky-ag-grid-layout-normal": "this.isNormalLayout" } }, queries: [{ propertyName: "agGrid", first: true, predicate: AgGridAngular, descendants: true, static: true }], viewQueries: [{ propertyName: "skyAgGridDiv", first: true, predicate: ["skyAgGridDiv"], descendants: true, isSignal: true }], ngImport: i0, template: "<span\n class=\"nav-anchor\"\n tabindex=\"0\"\n [id]=\"beforeAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n<div\n #skyAgGridDiv\n class=\"sky-ag-grid\"\n skyViewkeeperOmitShadow=\".ag-body-horizontal-scroll\"\n tabindex=\"0\"\n [class.sky-ag-grid-top-scrollbar]=\"\n agGrid?.gridOptions?.context &&\n agGrid?.gridOptions?.context['enableTopScroll']\n \"\n [ngClass]=\"wrapperClasses$ | async\"\n [id]=\"gridId\"\n [skyViewkeeper]=\"viewkeeperClasses\"\n (keydown)=\"onGridKeydown($event)\"\n (keyup.escape)=\"onKeyUpEscape($event)\"\n>\n <ng-content />\n</div>\n<span\n tabindex=\"0\"\n class=\"nav-anchor\"\n [id]=\"afterAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: SkyIdModule }, { kind: "ngmodule", type: SkyViewkeeperModule }, { kind: "directive", type: i1.λ3, selector: "[skyViewkeeper]", inputs: ["skyViewkeeper", "skyViewkeeperOmitShadow"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
638
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.2", type: SkyAgGridWrapperComponent, isStandalone: true, selector: "sky-ag-grid-wrapper", inputs: { compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.sky-ag-grid-layout-normal": "isNormalLayout()" } }, queries: [{ propertyName: "agGrid", first: true, predicate: AgGridAngular, descendants: true, static: true }], viewQueries: [{ propertyName: "skyAgGridDiv", first: true, predicate: ["skyAgGridDiv"], descendants: true, isSignal: true }], ngImport: i0, template: "<span\n class=\"nav-anchor\"\n tabindex=\"0\"\n [id]=\"beforeAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n<div\n #skyAgGridDiv\n class=\"sky-ag-grid\"\n skyViewkeeperOmitShadow=\".ag-body-horizontal-scroll\"\n tabindex=\"0\"\n [class.sky-ag-grid-top-scrollbar]=\"\n agGrid?.gridOptions?.context &&\n agGrid?.gridOptions?.context['enableTopScroll']\n \"\n [ngClass]=\"wrapperClasses()\"\n [id]=\"gridId\"\n [skyViewkeeper]=\"viewkeeperClasses()\"\n (keydown)=\"onGridKeydown($event)\"\n (keyup.escape)=\"onKeyUpEscape($event)\"\n>\n <ng-content />\n</div>\n<span\n tabindex=\"0\"\n class=\"nav-anchor\"\n [id]=\"afterAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: SkyIdModule }, { kind: "ngmodule", type: SkyViewkeeperModule }, { kind: "directive", type: i1.λ3, selector: "[skyViewkeeper]", inputs: ["skyViewkeeper", "skyViewkeeperOmitShadow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
676
639
  }
677
640
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridWrapperComponent, decorators: [{
678
641
  type: Component,
679
- args: [{ selector: 'sky-ag-grid-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe, NgClass, SkyIdModule, SkyViewkeeperModule], template: "<span\n class=\"nav-anchor\"\n tabindex=\"0\"\n [id]=\"beforeAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n<div\n #skyAgGridDiv\n class=\"sky-ag-grid\"\n skyViewkeeperOmitShadow=\".ag-body-horizontal-scroll\"\n tabindex=\"0\"\n [class.sky-ag-grid-top-scrollbar]=\"\n agGrid?.gridOptions?.context &&\n agGrid?.gridOptions?.context['enableTopScroll']\n \"\n [ngClass]=\"wrapperClasses$ | async\"\n [id]=\"gridId\"\n [skyViewkeeper]=\"viewkeeperClasses\"\n (keydown)=\"onGridKeydown($event)\"\n (keyup.escape)=\"onKeyUpEscape($event)\"\n>\n <ng-content />\n</div>\n<span\n tabindex=\"0\"\n class=\"nav-anchor\"\n [id]=\"afterAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n" }]
642
+ args: [{ selector: 'sky-ag-grid-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, SkyIdModule, SkyViewkeeperModule], host: {
643
+ '[class.sky-ag-grid-layout-normal]': 'isNormalLayout()',
644
+ }, template: "<span\n class=\"nav-anchor\"\n tabindex=\"0\"\n [id]=\"beforeAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n<div\n #skyAgGridDiv\n class=\"sky-ag-grid\"\n skyViewkeeperOmitShadow=\".ag-body-horizontal-scroll\"\n tabindex=\"0\"\n [class.sky-ag-grid-top-scrollbar]=\"\n agGrid?.gridOptions?.context &&\n agGrid?.gridOptions?.context['enableTopScroll']\n \"\n [ngClass]=\"wrapperClasses()\"\n [id]=\"gridId\"\n [skyViewkeeper]=\"viewkeeperClasses()\"\n (keydown)=\"onGridKeydown($event)\"\n (keyup.escape)=\"onKeyUpEscape($event)\"\n>\n <ng-content />\n</div>\n<span\n tabindex=\"0\"\n class=\"nav-anchor\"\n [id]=\"afterAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n" }]
680
645
  }], ctorParameters: () => [], propDecorators: { agGrid: [{
681
646
  type: ContentChild,
682
647
  args: [AgGridAngular, {
683
648
  static: true,
684
649
  }]
685
- }], isNormalLayout: [{
686
- type: HostBinding,
687
- args: ['class.sky-ag-grid-layout-normal']
688
- }], compact: [{
689
- type: Input,
690
- args: [{ transform: booleanAttribute }]
691
- }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], skyAgGridDiv: [{ type: i0.ViewChild, args: ['skyAgGridDiv', { isSignal: true }] }] } });
650
+ }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], skyAgGridDiv: [{ type: i0.ViewChild, args: ['skyAgGridDiv', { isSignal: true }] }] } });
692
651
 
693
652
  function toColumnWidthName(breakpoint) {
694
653
  return breakpoint === 'xs' ? 'xs' : 'sm';
@@ -819,7 +778,7 @@ class SkyAgGridDataManagerAdapterDirective {
819
778
  this.#currentSkyAgGridWrapper = wrapper;
820
779
  setTimeout(() => {
821
780
  if (this.#currentSkyAgGridWrapper) {
822
- this.#currentSkyAgGridWrapper.viewkeeperClasses = [];
781
+ this.#currentSkyAgGridWrapper.viewkeeperClasses.set([]);
823
782
  }
824
783
  });
825
784
  }
@@ -833,8 +792,16 @@ class SkyAgGridDataManagerAdapterDirective {
833
792
  if (viewConfig) {
834
793
  viewConfig = {
835
794
  ...viewConfig,
836
- onSelectAllClick: () => agGrid.api.selectAll(),
837
- onClearAllClick: () => agGrid.api.deselectAll(),
795
+ onSelectAllClick: () => {
796
+ if (!agGrid.api.isDestroyed()) {
797
+ agGrid.api.selectAll();
798
+ }
799
+ },
800
+ onClearAllClick: () => {
801
+ if (!agGrid.api.isDestroyed()) {
802
+ agGrid.api.deselectAll();
803
+ }
804
+ },
838
805
  };
839
806
  if (viewConfig.columnPickerEnabled && !viewConfig.columnOptions) {
840
807
  viewConfig.columnOptions = this.#readColumnOptionsFromGrid(agGrid.api);
@@ -853,7 +820,7 @@ class SkyAgGridDataManagerAdapterDirective {
853
820
  this.#isAgGridReady.set(true);
854
821
  });
855
822
  agGrid.gridReady
856
- .pipe(takeUntil(this.#ngUnsubscribe), switchMap(() => fromEvent(agGrid.api, 'gridPreDestroyed')))
823
+ .pipe(takeUntil(this.#ngUnsubscribe), switchMap(() => fromGridEvent(agGrid.api, 'gridPreDestroyed')))
857
824
  .subscribe(() => {
858
825
  this.#unregisterAgGrid();
859
826
  });
@@ -1119,7 +1086,7 @@ class SkyAgGridRowDeleteComponent {
1119
1086
  this.tableWidth = signal(0, ...(ngDevMode ? [{ debugName: "tableWidth" }] : []));
1120
1087
  // Force redrawing overlays when the grid changes by incrementing a number.
1121
1088
  this.gridChanges = toSignal(toObservable(this.service.gridApi).pipe(switchMap((gridApi) => gridApi
1122
- ? merge(fromEvent(gridApi, 'componentStateChanged'), fromEvent(gridApi, 'firstDataRendered'), fromEvent(gridApi, 'gridSizeChanged'), fromEvent(gridApi, 'modelUpdated'), fromEvent(gridApi, 'rowDataUpdated')).pipe(takeUntil(fromEvent(gridApi, 'gridPreDestroyed')))
1089
+ ? merge(fromGridEvent(gridApi, 'componentStateChanged'), fromGridEvent(gridApi, 'firstDataRendered'), fromGridEvent(gridApi, 'gridSizeChanged'), fromGridEvent(gridApi, 'modelUpdated'), fromGridEvent(gridApi, 'rowDataUpdated')).pipe(takeUntil(fromGridEvent(gridApi, 'gridPreDestroyed')))
1123
1090
  : of(undefined)), startWith(1), map(() => 1), scan((acc, val) => acc + val)), { initialValue: 0 });
1124
1091
  this.#resizeObserverSvc = inject(SkyResizeObserverService);
1125
1092
  // Maintain table width when the grid is resized.
@@ -1132,7 +1099,7 @@ class SkyAgGridRowDeleteComponent {
1132
1099
  });
1133
1100
  // Clean up pending rows when the grid data is updated.
1134
1101
  toObservable(this.service.gridApi)
1135
- .pipe(filter((gridApi) => !!gridApi), switchMap((gridApi) => fromEvent(gridApi, 'rowDataUpdated').pipe(takeUntil(fromEvent(gridApi, 'gridPreDestroyed')), map(() => gridApi))), takeUntilDestroyed())
1102
+ .pipe(filter((gridApi) => !!gridApi), switchMap((gridApi) => fromGridEvent(gridApi, 'rowDataUpdated').pipe(takeUntil(fromGridEvent(gridApi, 'gridPreDestroyed')), map(() => gridApi))), takeUntilDestroyed())
1136
1103
  .subscribe((gridApi) => {
1137
1104
  this.pending.update((pending) => pending.filter((rowId) => !!gridApi.getRowNode(rowId)));
1138
1105
  });
@@ -1160,7 +1127,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
1160
1127
  * `rowDeleteIds` to determine which rows to add inline delete options to.
1161
1128
  */
1162
1129
  class SkyAgGridRowDeleteDirective {
1163
- #agGridBodyViewport;
1130
+ #agGridRootElement;
1164
1131
  #agGridBodyClipElements;
1165
1132
  #ngUnsubscribe;
1166
1133
  #rowDeleteIdsInternal;
@@ -1187,7 +1154,7 @@ class SkyAgGridRowDeleteDirective {
1187
1154
  */
1188
1155
  this.rowDeleteConfirm = output();
1189
1156
  this.agGrid = contentChild(AgGridAngular, ...(ngDevMode ? [{ debugName: "agGrid" }] : []));
1190
- this.#agGridBodyViewport = new BehaviorSubject([]);
1157
+ this.#agGridRootElement = new BehaviorSubject([]);
1191
1158
  this.#agGridBodyClipElements = new BehaviorSubject([]);
1192
1159
  this.#ngUnsubscribe = new Subject();
1193
1160
  this.#rowDeleteIdsInternal = linkedSignal({ ...(ngDevMode ? { debugName: "#rowDeleteIdsInternal" } : {}), source: this.rowDeleteIds,
@@ -1210,7 +1177,7 @@ class SkyAgGridRowDeleteDirective {
1210
1177
  this.#zIndex.next(zIndex);
1211
1178
  });
1212
1179
  }
1213
- this.#rowDeleteSvc = new SkyAgGridRowDeleteContext(this.#rowDeleteIdsInternal.asReadonly(), toSignal(this.#agGridBodyViewport), signal(undefined));
1180
+ this.#rowDeleteSvc = new SkyAgGridRowDeleteContext(this.#rowDeleteIdsInternal.asReadonly(), toSignal(this.#agGridRootElement), signal(undefined));
1214
1181
  this.#rowDeleteSvc.cancelRowDelete
1215
1182
  .pipe(takeUntil(this.#ngUnsubscribe))
1216
1183
  .subscribe((rowId) => {
@@ -1229,25 +1196,17 @@ class SkyAgGridRowDeleteDirective {
1229
1196
  const agGrid = toObservable(this.agGrid);
1230
1197
  const agGridReady = agGrid.pipe(filter((agGrid) => !!agGrid), switchMap((agGrid) => agGrid.gridReady), take(1), takeUntil(this.#ngUnsubscribe));
1231
1198
  agGridReady.subscribe((ready) => {
1232
- this.#agGridBodyViewport.next([
1233
- new ElementRef(this.#elementRef.nativeElement.querySelector('div.ag-root-wrapper')),
1234
- ]);
1199
+ const rootWrapper = this.#elementRef.nativeElement.querySelector('div.ag-root-wrapper');
1200
+ if (rootWrapper) {
1201
+ this.#agGridRootElement.next([
1202
+ new ElementRef(rootWrapper),
1203
+ ]);
1204
+ }
1235
1205
  this.#rowDeleteSvc.gridApi.set(ready.api);
1236
1206
  });
1237
- agGrid
1238
- .pipe(filter((grid) => !!grid), switchMap((grid) => merge(grid.firstDataRendered.asObservable(), grid.rowDataUpdated.asObservable(), agGridReady.pipe(switchMap(() => fromEvent(grid.api, 'gridOptionsChanged')))).pipe(takeUntil(this.#ngUnsubscribe), takeUntil(agGridReady.pipe(switchMap(() => fromEvent(grid.api, 'gridPreDestroyed').pipe(take(1))))), startWith(grid.api?.getGridOption('domLayout')), map(() => grid.api?.getGridOption('domLayout')), switchMap((domLayout) => {
1239
- if (domLayout === 'normal') {
1240
- return this.#agGridBodyViewport.asObservable();
1241
- }
1242
- return of([]);
1243
- }))))
1244
- .subscribe((agGridBodyClipElements) => {
1245
- // When using AG Grid's `domLayout: 'autoHeight'` option,
1246
- // the grid's body viewport is clipped by the scrollable host.
1247
- // But when using `domLayout: 'normal'`, the grid's body viewport
1248
- // should be used as the scrollable host for the row delete overlay.
1249
- this.#agGridBodyClipElements.next(agGridBodyClipElements);
1250
- });
1207
+ this.#agGridRootElement
1208
+ .pipe(takeUntilDestroyed())
1209
+ .subscribe((el) => this.#agGridBodyClipElements.next(el));
1251
1210
  agGrid
1252
1211
  .pipe(filter((agGrid) => !!agGrid), switchMap((agGrid) => agGrid.rowDataUpdated), takeUntil(this.#ngUnsubscribe))
1253
1212
  .subscribe((evt) => {
@@ -2168,103 +2127,104 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
2168
2127
  * @internal
2169
2128
  */
2170
2129
  class SkyAgGridCellValidatorTooltipComponent {
2130
+ #keyupHandler;
2131
+ #focusHandler;
2132
+ #cellFocusHandler;
2133
+ #blurHandler;
2171
2134
  constructor() {
2135
+ this.params = input(...(ngDevMode ? [undefined, { debugName: "params" }] : []));
2172
2136
  this.popoverMessageStream = new Subject();
2173
- this.showValidatorMessage = signal(false, ...(ngDevMode ? [{ debugName: "showValidatorMessage" }] : []));
2174
- this.#changeDetector = inject(ChangeDetectorRef);
2175
- this.#listenersAdded = false;
2137
+ this.validatorProperties = computed(() => this.params()?.skyComponentProperties, ...(ngDevMode ? [{ debugName: "validatorProperties" }] : []));
2138
+ this.validatorMessage = computed(() => {
2139
+ const params = this.params();
2140
+ const validatorProperties = this.validatorProperties();
2141
+ const validatorMessage = validatorProperties?.validatorMessage;
2142
+ if (!validatorMessage || !params) {
2143
+ return '';
2144
+ }
2145
+ if (isSignal(validatorMessage)) {
2146
+ return validatorMessage();
2147
+ }
2148
+ if (typeof validatorMessage === 'function') {
2149
+ return validatorMessage(params.value, params.data, params?.node?.rowIndex);
2150
+ }
2151
+ return validatorMessage;
2152
+ }, ...(ngDevMode ? [{ debugName: "validatorMessage" }] : []));
2153
+ this.showValidatorMessage = computed(() => {
2154
+ const validatorMessage = this.validatorMessage();
2155
+ const validatorProperties = this.validatorProperties();
2156
+ const params = this.params();
2157
+ if (!validatorMessage || !validatorProperties || !params) {
2158
+ return false;
2159
+ }
2160
+ const validator = validatorProperties.validator;
2161
+ if (typeof validator === 'function') {
2162
+ return !validator(params.value, params.data, params.node?.rowIndex);
2163
+ }
2164
+ return true;
2165
+ }, ...(ngDevMode ? [{ debugName: "showValidatorMessage" }] : []));
2176
2166
  this.#keyupHandler = (event) => {
2177
2167
  if (['ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp'].includes(event.key)) {
2178
- this.showPopover();
2168
+ this.#showPopover();
2179
2169
  }
2180
2170
  };
2181
- this.#focusHandler = () => this.showPopover();
2171
+ this.#focusHandler = () => this.#showPopover();
2182
2172
  this.#cellFocusHandler = (eventParams) => {
2183
- // We want to close any popovers that are opened when other cells are focused, but open a popover if the current cell is focused.
2173
+ const params = this.params();
2184
2174
  if (eventParams.column.getColId() ===
2185
- this.cellRendererParams?.column?.getColId() &&
2186
- eventParams.rowIndex === this.cellRendererParams?.node?.rowIndex) {
2187
- this.showPopover();
2175
+ params?.column?.getColId() &&
2176
+ eventParams.rowIndex === params?.node?.rowIndex) {
2177
+ this.#showPopover();
2188
2178
  }
2189
2179
  else {
2190
- this.hidePopover();
2180
+ this.#hidePopover();
2191
2181
  }
2192
2182
  };
2193
- this.#blurHandler = () => this.hidePopover();
2194
- }
2195
- set params(value) {
2196
- this.cellRendererParams = value;
2197
- if (value?.api && !this.#listenersAdded) {
2198
- this.#listenersAdded = true;
2199
- value.api.addEventListener('cellFocused', this.#cellFocusHandler);
2200
- value.api.addEventListener('cellEditingStarted', this.#blurHandler);
2201
- value.eGridCell?.addEventListener('keyup', this.#keyupHandler);
2202
- value.eGridCell?.addEventListener('mouseenter', this.#focusHandler);
2203
- value.eGridCell?.addEventListener('mouseleave', this.#blurHandler);
2204
- }
2205
- if (typeof value?.skyComponentProperties?.validatorMessage === 'function') {
2206
- this.validatorMessage = value.skyComponentProperties.validatorMessage(value.value, value.data, value?.node?.rowIndex);
2207
- }
2208
- else {
2209
- this.validatorMessage = value?.skyComponentProperties?.validatorMessage;
2210
- }
2211
- this.showValidatorMessage.set(this.#showValidatorMessage());
2212
- this.#changeDetector.markForCheck();
2213
- }
2214
- #changeDetector;
2215
- #listenersAdded;
2216
- #keyupHandler;
2217
- #focusHandler;
2218
- #cellFocusHandler;
2219
- #blurHandler;
2220
- ngOnDestroy() {
2221
- const params = this.cellRendererParams;
2222
- if (params?.api && (!params.api.isDestroyed || !params.api.isDestroyed())) {
2223
- params.api.removeEventListener('cellFocused', this.#cellFocusHandler);
2224
- params.api.removeEventListener('cellEditingStarted', this.#blurHandler);
2225
- }
2226
- if (params?.eGridCell) {
2227
- params.eGridCell.removeEventListener('keyup', this.#keyupHandler);
2228
- params.eGridCell.removeEventListener('mouseenter', this.#focusHandler);
2229
- params.eGridCell.removeEventListener('mouseleave', this.#blurHandler);
2230
- }
2183
+ this.#blurHandler = () => this.#hidePopover();
2184
+ effect((onCleanup) => {
2185
+ const value = this.params();
2186
+ if (value?.api) {
2187
+ value.api.addEventListener('cellFocused', this.#cellFocusHandler);
2188
+ value.api.addEventListener('cellEditingStarted', this.#blurHandler);
2189
+ value.eGridCell?.addEventListener('keyup', this.#keyupHandler);
2190
+ value.eGridCell?.addEventListener('mouseenter', this.#focusHandler);
2191
+ value.eGridCell?.addEventListener('mouseleave', this.#blurHandler);
2192
+ onCleanup(() => {
2193
+ if (!value.api.isDestroyed || !value.api.isDestroyed()) {
2194
+ value.api.removeEventListener('cellFocused', this.#cellFocusHandler);
2195
+ value.api.removeEventListener('cellEditingStarted', this.#blurHandler);
2196
+ }
2197
+ if (value.eGridCell) {
2198
+ value.eGridCell.removeEventListener('keyup', this.#keyupHandler);
2199
+ value.eGridCell.removeEventListener('mouseenter', this.#focusHandler);
2200
+ value.eGridCell.removeEventListener('mouseleave', this.#blurHandler);
2201
+ }
2202
+ });
2203
+ }
2204
+ });
2231
2205
  }
2232
- hidePopover() {
2206
+ #hidePopover() {
2233
2207
  this.popoverMessageStream.next({ type: SkyPopoverMessageType.Close });
2234
2208
  }
2235
- showPopover() {
2209
+ #showPopover() {
2236
2210
  if (this.#shouldShowPopover()) {
2237
2211
  this.popoverMessageStream.next({ type: SkyPopoverMessageType.Open });
2238
2212
  }
2239
2213
  }
2240
- #showValidatorMessage() {
2241
- if (!this.validatorMessage) {
2242
- return false;
2243
- }
2244
- if (typeof this.cellRendererParams?.skyComponentProperties?.validator ===
2245
- 'function') {
2246
- return !this.cellRendererParams.skyComponentProperties.validator(this.cellRendererParams.value, this.cellRendererParams.data, this.cellRendererParams.node?.rowIndex);
2247
- }
2248
- else {
2249
- return true;
2250
- }
2251
- }
2252
2214
  #shouldShowPopover() {
2253
2215
  if (!this.showValidatorMessage()) {
2254
2216
  return false;
2255
2217
  }
2256
- const editingCells = this.cellRendererParams?.api.getEditingCells() ?? [];
2218
+ const editingCells = this.params()?.api.getEditingCells() ?? [];
2257
2219
  return editingCells.length === 0;
2258
2220
  }
2259
2221
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridCellValidatorTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2260
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: SkyAgGridCellValidatorTooltipComponent, isStandalone: true, selector: "sky-ag-grid-cell-validator-tooltip", inputs: { params: "params" }, ngImport: i0, template: "<ng-template #displayValue>\n <ng-content />\n</ng-template>\n\n@if (showValidatorMessage()) {\n <div\n skyPopoverTrigger=\"mouseenter\"\n class=\"sky-validator-cell\"\n [skyPopover]=\"validatorPopover\"\n [skyPopoverMessageStream]=\"popoverMessageStream\"\n >\n <ng-container *ngTemplateOutlet=\"displayValue\" />\n <sky-status-indicator\n descriptionType=\"none\"\n indicatorType=\"danger\"\n class=\"sky-pull-right\"\n />\n </div>\n <sky-popover\n #validatorPopover\n data-sky-id=\"validatorPopover\"\n popoverType=\"danger\"\n >\n {{ validatorMessage }}\n </sky-popover>\n} @else {\n <ng-container *ngTemplateOutlet=\"displayValue\" />\n}\n", styles: [".sky-validator-cell:not(.sky-theme-modern *){--sky-override-cell-validator-space: 5px}:host{--sky-staus-indicator-padding-right: 0;display:contents}:host div.sky-validator-cell{height:100%;min-height:var(--ag-row-height);width:100%}:host div.sky-validator-cell:focus{outline:none}sky-status-indicator{margin-left:var(--sky-override-cell-validator-space, var(--sky-space-gap-icon-s))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: SkyPopoverModule }, { kind: "component", type: i1$4.λ6, selector: "sky-popover", inputs: ["alignment", "placement", "popoverTitle", "popoverType"], outputs: ["popoverClosed", "popoverOpened"] }, { kind: "directive", type: i1$4.λ7, selector: "[skyPopover]", inputs: ["skyPopover", "skyPopoverAlignment", "skyPopoverMessageStream", "skyPopoverPlacement", "skyPopoverTrigger"] }, { kind: "ngmodule", type: SkyStatusIndicatorModule }, { kind: "component", type: i2$3.λ10, selector: "sky-status-indicator", inputs: ["indicatorType", "descriptionType", "customDescription", "helpPopoverContent", "helpPopoverTitle", "helpKey"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2222
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: SkyAgGridCellValidatorTooltipComponent, isStandalone: true, selector: "sky-ag-grid-cell-validator-tooltip", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-template #displayValue>\n <ng-content />\n</ng-template>\n\n@if (showValidatorMessage()) {\n <div\n skyPopoverTrigger=\"mouseenter\"\n class=\"sky-validator-cell\"\n [skyPopover]=\"validatorPopover\"\n [skyPopoverMessageStream]=\"popoverMessageStream\"\n >\n <ng-container *ngTemplateOutlet=\"displayValue\" />\n <sky-status-indicator\n descriptionType=\"none\"\n indicatorType=\"danger\"\n class=\"sky-pull-right\"\n />\n </div>\n <sky-popover\n #validatorPopover\n data-sky-id=\"validatorPopover\"\n popoverType=\"danger\"\n >\n {{ validatorMessage() }}\n </sky-popover>\n} @else {\n <ng-container *ngTemplateOutlet=\"displayValue\" />\n}\n", styles: [".sky-validator-cell:not(.sky-theme-modern *){--sky-override-cell-validator-space: 5px}:host{--sky-staus-indicator-padding-right: 0;display:contents}:host div.sky-validator-cell{height:100%;min-height:var(--ag-row-height);width:100%}:host div.sky-validator-cell:focus{outline:none}sky-status-indicator{margin-left:var(--sky-override-cell-validator-space, var(--sky-space-gap-icon-s))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: SkyPopoverModule }, { kind: "component", type: i1$4.λ6, selector: "sky-popover", inputs: ["alignment", "placement", "popoverTitle", "popoverType"], outputs: ["popoverClosed", "popoverOpened"] }, { kind: "directive", type: i1$4.λ7, selector: "[skyPopover]", inputs: ["skyPopover", "skyPopoverAlignment", "skyPopoverMessageStream", "skyPopoverPlacement", "skyPopoverTrigger"] }, { kind: "ngmodule", type: SkyStatusIndicatorModule }, { kind: "component", type: i2$3.λ10, selector: "sky-status-indicator", inputs: ["indicatorType", "descriptionType", "customDescription", "helpPopoverContent", "helpPopoverTitle", "helpKey"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2261
2223
  }
2262
2224
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridCellValidatorTooltipComponent, decorators: [{
2263
2225
  type: Component,
2264
- args: [{ selector: 'sky-ag-grid-cell-validator-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, SkyPopoverModule, SkyStatusIndicatorModule], template: "<ng-template #displayValue>\n <ng-content />\n</ng-template>\n\n@if (showValidatorMessage()) {\n <div\n skyPopoverTrigger=\"mouseenter\"\n class=\"sky-validator-cell\"\n [skyPopover]=\"validatorPopover\"\n [skyPopoverMessageStream]=\"popoverMessageStream\"\n >\n <ng-container *ngTemplateOutlet=\"displayValue\" />\n <sky-status-indicator\n descriptionType=\"none\"\n indicatorType=\"danger\"\n class=\"sky-pull-right\"\n />\n </div>\n <sky-popover\n #validatorPopover\n data-sky-id=\"validatorPopover\"\n popoverType=\"danger\"\n >\n {{ validatorMessage }}\n </sky-popover>\n} @else {\n <ng-container *ngTemplateOutlet=\"displayValue\" />\n}\n", styles: [".sky-validator-cell:not(.sky-theme-modern *){--sky-override-cell-validator-space: 5px}:host{--sky-staus-indicator-padding-right: 0;display:contents}:host div.sky-validator-cell{height:100%;min-height:var(--ag-row-height);width:100%}:host div.sky-validator-cell:focus{outline:none}sky-status-indicator{margin-left:var(--sky-override-cell-validator-space, var(--sky-space-gap-icon-s))}\n"] }]
2265
- }], propDecorators: { params: [{
2266
- type: Input
2267
- }] } });
2226
+ args: [{ selector: 'sky-ag-grid-cell-validator-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, SkyPopoverModule, SkyStatusIndicatorModule], template: "<ng-template #displayValue>\n <ng-content />\n</ng-template>\n\n@if (showValidatorMessage()) {\n <div\n skyPopoverTrigger=\"mouseenter\"\n class=\"sky-validator-cell\"\n [skyPopover]=\"validatorPopover\"\n [skyPopoverMessageStream]=\"popoverMessageStream\"\n >\n <ng-container *ngTemplateOutlet=\"displayValue\" />\n <sky-status-indicator\n descriptionType=\"none\"\n indicatorType=\"danger\"\n class=\"sky-pull-right\"\n />\n </div>\n <sky-popover\n #validatorPopover\n data-sky-id=\"validatorPopover\"\n popoverType=\"danger\"\n >\n {{ validatorMessage() }}\n </sky-popover>\n} @else {\n <ng-container *ngTemplateOutlet=\"displayValue\" />\n}\n", styles: [".sky-validator-cell:not(.sky-theme-modern *){--sky-override-cell-validator-space: 5px}:host{--sky-staus-indicator-padding-right: 0;display:contents}:host div.sky-validator-cell{height:100%;min-height:var(--ag-row-height);width:100%}:host div.sky-validator-cell:focus{outline:none}sky-status-indicator{margin-left:var(--sky-override-cell-validator-space, var(--sky-space-gap-icon-s))}\n"] }]
2227
+ }], ctorParameters: () => [], propDecorators: { params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: false }] }] } });
2268
2228
 
2269
2229
  /**
2270
2230
  * @internal
@@ -2431,9 +2391,9 @@ class SkyAgGridCellRendererRowSelectorComponent {
2431
2391
  this.#subscription.unsubscribe();
2432
2392
  this.#subscription = new Subscription();
2433
2393
  this.#setLabel();
2434
- const rowSelected = !!this.#params.node?.isSelected();
2394
+ const rowSelected = !!this.#params?.node?.isSelected();
2435
2395
  if (this.dataField) {
2436
- this.checked.next(!!this.#params.value);
2396
+ this.checked.next(!!this.#params?.value);
2437
2397
  if (rowSelected !== this.checked.value) {
2438
2398
  this.rowNode?.setSelected(this.checked.value);
2439
2399
  }
@@ -2441,7 +2401,10 @@ class SkyAgGridCellRendererRowSelectorComponent {
2441
2401
  else {
2442
2402
  this.checked.next(rowSelected);
2443
2403
  }
2444
- this.#subscription.add(fromEventPattern((handler) => this.rowNode?.addEventListener('rowSelected', handler), (handler) => this.rowNode?.removeEventListener('rowSelected', handler)).subscribe((event) => this.#rowSelectedListener(event)));
2404
+ const node = this.rowNode;
2405
+ const handler = (event) => this.#rowSelectedListener(event);
2406
+ node?.addEventListener('rowSelected', handler);
2407
+ this.#subscription.add(() => node?.removeEventListener('rowSelected', handler));
2445
2408
  }
2446
2409
  #setLabel() {
2447
2410
  const cellRendererParamLabel = this.#params?.colDef?.cellRendererParams?.label;
@@ -2535,15 +2498,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
2535
2498
  * @internal
2536
2499
  */
2537
2500
  class SkyAgGridCellRendererValidatorTooltipComponent {
2501
+ #changeDetector;
2502
+ #valueSubscription;
2538
2503
  constructor() {
2504
+ this.params = input(...(ngDevMode ? [undefined, { debugName: "params" }] : []));
2539
2505
  this.valueObservable = new BehaviorSubject('');
2540
2506
  this.#changeDetector = inject(ChangeDetectorRef);
2507
+ effect(() => {
2508
+ const params = this.params();
2509
+ if (params) {
2510
+ this.agInit(params);
2511
+ }
2512
+ });
2541
2513
  }
2542
- set params(value) {
2543
- this.agInit(value);
2544
- }
2545
- #changeDetector;
2546
- #valueSubscription;
2547
2514
  ngOnDestroy() {
2548
2515
  this.#valueSubscription?.unsubscribe();
2549
2516
  this.valueObservable.complete();
@@ -2570,14 +2537,12 @@ class SkyAgGridCellRendererValidatorTooltipComponent {
2570
2537
  return false;
2571
2538
  }
2572
2539
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridCellRendererValidatorTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2573
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: SkyAgGridCellRendererValidatorTooltipComponent, isStandalone: true, selector: "sky-ag-grid-cell-renderer-validator-tooltip", inputs: { params: "params" }, ngImport: i0, template: "<sky-ag-grid-cell-validator-tooltip [params]=\"cellRendererParams\">\n {{ valueObservable | async }}\n</sky-ag-grid-cell-validator-tooltip>\n", dependencies: [{ kind: "component", type: SkyAgGridCellValidatorTooltipComponent, selector: "sky-ag-grid-cell-validator-tooltip", inputs: ["params"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2540
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.2", type: SkyAgGridCellRendererValidatorTooltipComponent, isStandalone: true, selector: "sky-ag-grid-cell-renderer-validator-tooltip", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<sky-ag-grid-cell-validator-tooltip [params]=\"cellRendererParams\">\n {{ valueObservable | async }}\n</sky-ag-grid-cell-validator-tooltip>\n", dependencies: [{ kind: "component", type: SkyAgGridCellValidatorTooltipComponent, selector: "sky-ag-grid-cell-validator-tooltip", inputs: ["params"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2574
2541
  }
2575
2542
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridCellRendererValidatorTooltipComponent, decorators: [{
2576
2543
  type: Component,
2577
2544
  args: [{ selector: 'sky-ag-grid-cell-renderer-validator-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SkyAgGridCellValidatorTooltipComponent, AsyncPipe], template: "<sky-ag-grid-cell-validator-tooltip [params]=\"cellRendererParams\">\n {{ valueObservable | async }}\n</sky-ag-grid-cell-validator-tooltip>\n" }]
2578
- }], propDecorators: { params: [{
2579
- type: Input
2580
- }] } });
2545
+ }], ctorParameters: () => [], propDecorators: { params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: false }] }] } });
2581
2546
 
2582
2547
  /**
2583
2548
  * To display a help button beside the column group header, create a component containing
@@ -2640,10 +2605,10 @@ class SkyAgGridHeaderGroupComponent {
2640
2605
  }
2641
2606
  this.#subscriptions = new Subscription();
2642
2607
  this.#columnGroup = params.columnGroup.getProvidedColumnGroup();
2643
- this.#isExpandableSubject.next(this.#columnGroup.isExpandable());
2608
+ this.#isExpandableSubject.next(!!this.#columnGroup?.isExpandable());
2644
2609
  if (this.#isExpandableSubject.getValue()) {
2645
- this.#subscriptions.add(fromEvent(params.api, 'columnGroupOpened')
2646
- .pipe(takeUntil(fromEvent(params.api, 'gridPreDestroyed')))
2610
+ this.#subscriptions.add(fromGridEvent(params.api, 'columnGroupOpened')
2611
+ .pipe(takeUntil(fromGridEvent(params.api, 'gridPreDestroyed')))
2647
2612
  .subscribe((event) => {
2648
2613
  if (this.#columnGroup &&
2649
2614
  event.columnGroups.includes(this.#columnGroup)) {
@@ -2682,7 +2647,7 @@ class SkyAgGridHeaderGroupComponent {
2682
2647
  }
2683
2648
  }
2684
2649
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridHeaderGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2685
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: SkyAgGridHeaderGroupComponent, isStandalone: true, selector: "sky-header-group", viewQueries: [{ propertyName: "inlineHelpContainer", first: true, predicate: ["inlineHelpContainer"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "@if (params?.displayName) {\n <span\n class=\"header-group-text\"\n role=\"presentation\"\n [skyThemeClass]=\"{ 'sky-font-heading-4': 'modern' }\"\n >{{ params?.displayName }}</span\n >\n}\n@if (isExpandable$ | async) {\n @if (isExpanded$ | async) {\n <button\n class=\"sky-btn sky-btn-icon-borderless\"\n type=\"button\"\n [attr.aria-label]=\"\n 'sky_ag_grid_column_group_header_collapse_aria_label'\n | skyLibResources: params?.displayName\n \"\n (click)=\"setExpanded(false)\"\n >\n <sky-icon iconName=\"chevron-double-left\" />\n </button>\n } @else {\n <button\n class=\"sky-btn sky-btn-icon-borderless\"\n type=\"button\"\n [attr.aria-label]=\"\n 'sky_ag_grid_column_group_header_expand_aria_label'\n | skyLibResources: params?.displayName\n \"\n (click)=\"setExpanded(true)\"\n >\n <sky-icon iconName=\"chevron-double-right\" />\n </button>\n }\n}\n<span #inlineHelpContainer class=\"sky-control-help-container\"></span>\n", styles: ["button:not(.sky-theme-modern *){--sky-override-ag-grid-header-button-margin-left: var(--sky-margin-inline-sm)}:host{display:flex;max-width:100%;align-items:center;align-content:center}.header-group-text{flex-grow:0;flex-shrink:1;overflow:hidden;text-overflow:ellipsis}button{cursor:pointer;margin-left:var(--sky-override-ag-grid-header-button-margin-left, var(--sky-space-gap-text_action-xs));flex-grow:0;flex-shrink:1}\n"], dependencies: [{ kind: "ngmodule", type: SkyThemeModule }, { kind: "directive", type: i2$4.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { kind: "ngmodule", type: SkyIconModule }, { kind: "component", type: i2$5.λ1, selector: "sky-icon", inputs: ["iconName", "variant", "iconSize"] }, { kind: "ngmodule", type: SkyI18nModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2650
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: SkyAgGridHeaderGroupComponent, isStandalone: true, selector: "sky-header-group", viewQueries: [{ propertyName: "inlineHelpContainer", first: true, predicate: ["inlineHelpContainer"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "@if (params?.displayName) {\n <span\n class=\"header-group-text\"\n role=\"presentation\"\n [skyThemeClass]=\"{ 'sky-font-heading-4': 'modern' }\"\n >{{ params?.displayName }}</span\n >\n}\n@if (isExpandable$ | async) {\n @if (isExpanded$ | async) {\n <button\n class=\"sky-btn sky-btn-icon-borderless\"\n type=\"button\"\n [attr.aria-label]=\"\n 'sky_ag_grid_column_group_header_collapse_aria_label'\n | skyLibResources: params?.displayName\n \"\n (click)=\"setExpanded(false)\"\n >\n <sky-icon iconName=\"chevron-double-left\" />\n </button>\n } @else {\n <button\n class=\"sky-btn sky-btn-icon-borderless\"\n type=\"button\"\n [attr.aria-label]=\"\n 'sky_ag_grid_column_group_header_expand_aria_label'\n | skyLibResources: params?.displayName\n \"\n (click)=\"setExpanded(true)\"\n >\n <sky-icon iconName=\"chevron-double-right\" />\n </button>\n }\n}\n<span #inlineHelpContainer class=\"sky-control-help-container\"></span>\n", styles: ["button:not(.sky-theme-modern *){--sky-override-ag-grid-header-button-margin-left: var(--sky-margin-inline-sm)}:host{display:flex;max-width:100%;align-items:center;align-content:center}.header-group-text{flex-grow:0;flex-shrink:1;overflow:hidden;text-overflow:ellipsis}button{cursor:pointer;margin-left:var(--sky-override-ag-grid-header-button-margin-left, var(--sky-space-gap-text_action-xs));flex-grow:0;flex-shrink:1}\n"], dependencies: [{ kind: "ngmodule", type: SkyThemeModule }, { kind: "directive", type: i1$5.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { kind: "ngmodule", type: SkyIconModule }, { kind: "component", type: i2$4.λ1, selector: "sky-icon", inputs: ["iconName", "variant", "iconSize"] }, { kind: "ngmodule", type: SkyI18nModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2686
2651
  }
2687
2652
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridHeaderGroupComponent, decorators: [{
2688
2653
  type: Component,
@@ -2715,8 +2680,8 @@ class SkyAgGridHeaderRowSelectorComponent {
2715
2680
  this.multiSelect.set(rowSelection === 'multiple' ||
2716
2681
  (typeof rowSelection === 'object' && rowSelection?.mode === 'multiRow'));
2717
2682
  if (this.multiSelect()) {
2718
- fromEvent(params.api, 'selectionChanged')
2719
- .pipe(takeUntilDestroyed(this.#destroyRef), observeOn(asyncScheduler))
2683
+ fromGridEvent(params.api, 'selectionChanged')
2684
+ .pipe(takeUntilDestroyed(this.#destroyRef))
2720
2685
  .subscribe((change) => {
2721
2686
  if (change.source.match(/selectall/i)) {
2722
2687
  // Either select all or clear selection.
@@ -2728,7 +2693,7 @@ class SkyAgGridHeaderRowSelectorComponent {
2728
2693
  this.checked.set(false);
2729
2694
  }
2730
2695
  });
2731
- fromEvent(params.api, 'rowDataUpdated')
2696
+ fromGridEvent(params.api, 'rowDataUpdated')
2732
2697
  .pipe(takeUntilDestroyed(this.#destroyRef))
2733
2698
  .subscribe(() => {
2734
2699
  this.indeterminate.set(!!this.#api?.getSelectedNodes().length);
@@ -2840,36 +2805,28 @@ class SkyAgGridHeaderComponent {
2840
2805
  this.#leftPosition = params.column.getLeft() ?? 0;
2841
2806
  this.#subscriptions = new Subscription();
2842
2807
  if (params.column.isFilterAllowed()) {
2843
- this.#subscriptions.add(fromEvent(params.column, 'filterChanged')
2844
- .pipe(takeUntil(fromEvent(params.api, 'gridPreDestroyed')))
2845
- .subscribe(() => {
2808
+ const handler = () => {
2846
2809
  const isFilterActive = params.column.isFilterActive();
2847
2810
  if (isFilterActive !== this.filterEnabled$.getValue()) {
2848
2811
  this.filterEnabled$.next(isFilterActive);
2849
2812
  }
2850
- }));
2813
+ };
2814
+ params.column.addEventListener('filterChanged', handler);
2815
+ this.#subscriptions.add(() => params.column.removeEventListener('filterChanged', handler));
2851
2816
  }
2852
2817
  if (params.enableSorting) {
2853
2818
  // Column sort state changes
2854
- this.#subscriptions.add(fromEvent(params.column, 'sortChanged')
2855
- .pipe(takeUntil(fromEvent(params.api, 'gridPreDestroyed')))
2856
- .subscribe(() => {
2857
- this.#updateSort();
2858
- }));
2819
+ const handler = () => this.#updateSort();
2820
+ params.column.addEventListener('sortChanged', handler);
2821
+ this.#subscriptions.add(() => params.column.removeEventListener('sortChanged', handler));
2859
2822
  // Other column sort state changes, for multi-column sorting
2860
- this.#subscriptions.add(fromEvent(params.api, 'sortChanged')
2861
- .pipe(takeUntil(fromEvent(params.api, 'gridPreDestroyed')))
2862
- .subscribe(() => {
2863
- this.#updateSortIndex();
2864
- }));
2823
+ this.#subscriptions.add(fromGridEvent(params.api, 'sortChanged').subscribe(() => this.#updateSortIndex()));
2865
2824
  this.#updateSort();
2866
2825
  this.#updateSortIndex();
2867
2826
  }
2868
2827
  // When the column is moved left via the keyboard, the element is detached
2869
2828
  // and reattached to the DOM to maintain DOM order, and its focus is lost.
2870
- this.#subscriptions.add(fromEvent(params.api, 'columnMoved')
2871
- .pipe(takeUntil(fromEvent(params.api, 'gridPreDestroyed')))
2872
- .subscribe((event) => {
2829
+ this.#subscriptions.add(fromGridEvent(params.api, 'columnMoved').subscribe((event) => {
2873
2830
  const left = event.column?.getLeft() ?? 0;
2874
2831
  const oldLeft = this.#leftPosition;
2875
2832
  if (event.column === params.column &&
@@ -2879,6 +2836,7 @@ class SkyAgGridHeaderComponent {
2879
2836
  }
2880
2837
  this.#leftPosition = left;
2881
2838
  }));
2839
+ this.#subscriptions.add(fromGridEvent(params.api, 'gridPreDestroyed').subscribe(() => this.#subscriptions.unsubscribe()));
2882
2840
  this.#updateInlineHelp();
2883
2841
  this.#changeDetector.markForCheck();
2884
2842
  }
@@ -2941,7 +2899,7 @@ class SkyAgGridHeaderComponent {
2941
2899
  }
2942
2900
  }
2943
2901
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2944
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: SkyAgGridHeaderComponent, isStandalone: true, selector: "sky-ag-grid-header", host: { properties: { "attr.title": "accessibleHeaderText()", "attr.aria-label": "displayName() || accessibleHeaderText()", "attr.role": "\"note\"" } }, viewQueries: [{ propertyName: "inlineHelpContainer", first: true, predicate: ["inlineHelpContainer"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div class=\"ag-cell-label-container\" role=\"presentation\">\n @if (params()?.enableMenu) {\n <span\n class=\"ag-header-icon ag-header-cell-menu-button\"\n aria-hidden=\"true\"\n (click)=\"onMenuClick($event)\"\n >\n <sky-icon iconName=\"more-actions\" />\n </span>\n }\n <div class=\"ag-header-cell-label\" role=\"presentation\">\n <span class=\"ag-header-cell-label-and-icons\">\n @if (params()?.enableSorting) {\n <button\n aria-hidden=\"true\"\n class=\"ag-header-cell-text ag-header-cell-label-sortable sky-btn-link-inline\"\n tabindex=\"-1\"\n type=\"button\"\n [attr.aria-label]=\"accessibleHeaderText()\"\n [innerText]=\"displayName() ?? ''\"\n [skyThemeClass]=\"{ 'sky-font-heading-4': 'modern' }\"\n (click)=\"onSortRequested($event)\"\n ></button>\n } @else if (displayName()) {\n <span\n aria-hidden=\"true\"\n class=\"ag-header-cell-text\"\n [skyThemeClass]=\"{ 'sky-font-heading-4': 'modern' }\"\n >{{ displayName() }}</span\n >\n }\n @if (filterEnabled$ | async) {\n <span\n aria-hidden=\"true\"\n class=\"ag-header-icon ag-header-label-icon ag-filter-icon\"\n ><sky-icon iconName=\"filter\"\n /></span>\n }\n @if (params()?.enableSorting) {\n @if (sortOrder$ | async; as sortDirection) {\n <button\n class=\"ag-sort-indicator-container sky-btn sky-btn-icon-borderless\"\n type=\"button\"\n (click)=\"onSortRequested($event)\"\n >\n @if (sortDirection === 'desc') {\n <span class=\"ag-header-icon ag-header-label-icon\">\n <sky-icon iconName=\"chevron-down\" iconSize=\"s\" />\n <span class=\"sky-screen-reader-only\">{{\n 'sky_ag_grid_column_header_sort_button_aria_label_currently_desc'\n | skyLibResources: displayName() ?? accessibleHeaderText()\n }}</span></span\n >\n }\n @if (sortDirection === 'asc') {\n <span class=\"ag-header-icon ag-header-label-icon\">\n <sky-icon iconName=\"chevron-up\" iconSize=\"s\" />\n <span class=\"sky-screen-reader-only\">{{\n 'sky_ag_grid_column_header_sort_button_aria_label_currently_asc'\n | skyLibResources: displayName() ?? accessibleHeaderText()\n }}</span></span\n >\n }\n\n @if (sortIndexDisplay$ | async; as sortIndexDisplay) {\n <span\n aria-hidden=\"true\"\n class=\"ag-sort-indicator-icon ag-sort-order\"\n >{{ sortIndexDisplay }}</span\n >\n }\n </button>\n } @else {\n <span class=\"sky-screen-reader-only\">{{\n 'sky_ag_grid_column_header_sort_button_aria_label_currently_not_sorted'\n | skyLibResources: displayName() ?? accessibleHeaderText()\n }}</span>\n }\n }\n </span>\n <span #inlineHelpContainer class=\"sky-control-help-container\"></span>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex-wrap:nowrap;width:100%;max-width:100%;height:100%;align-items:center;align-content:center}:host-context(.ag-header-cell.ag-right-aligned-header,.ag-header-cell.sky-ag-grid-header-right-aligned){flex-direction:row-reverse}:host-context(.ag-header-cell.ag-right-aligned-header,.ag-header-cell.sky-ag-grid-header-right-aligned) .ag-header-cell-label .sky-control-help-container{order:0}:host-context(.ag-header-cell.ag-right-aligned-header,.ag-header-cell.sky-ag-grid-header-right-aligned) .ag-header-cell-label .ag-header-cell-label-and-icons{order:1}.ag-header-cell-label .ag-header-cell-label-and-icons .ag-header-label-icon,.ag-header-cell-label .ag-header-cell-label-and-icons .ag-header-menu-icon,.ag-header-cell-label .ag-header-cell-label-and-icons .ag-header-icon{line-height:0;margin-left:var(--sky-override-ag-grid-header-icon-spacing, var(--sky-space-gap-text_action-xs))}.ag-header-cell-label .ag-header-cell-label-and-icons .sky-btn.sky-btn-icon-borderless{margin-left:var(--sky-override-ag-grid-header-icon-spacing, var(--sky-space-gap-text_action-xs))}.ag-header-cell-label .ag-header-cell-label-and-icons .sky-btn.sky-btn-icon-borderless .ag-header-label-icon,.ag-header-cell-label .ag-header-cell-label-and-icons .sky-btn.sky-btn-icon-borderless .ag-header-menu-icon,.ag-header-cell-label .ag-header-cell-label-and-icons .sky-btn.sky-btn-icon-borderless .ag-header-icon{margin-left:0}button.ag-header-cell-label{max-width:100%}.ag-cell-label-container{padding:0;gap:var(--sky-override-ag-grid-header-icon-spacing, var(--sky-space-gap-text_action-xs))}.ag-header-cell-label{padding-right:0;padding-left:0}.ag-header-cell-label .ag-header-cell-label-and-icons{display:flex;flex-wrap:nowrap;flex-direction:row;overflow:hidden;align-items:center}.ag-header-cell-label .ag-header-cell-label-and-icons .ag-header-cell-text{flex-grow:0;flex-shrink:1}.ag-header-cell-label .ag-header-cell-label-and-icons .ag-sort-indicator-container{color:var(--sky-override-ag-grid-sort-color, var(--sky-color-text-deemphasized));width:initial;height:initial}.ag-header-cell-label .ag-header-cell-label-and-icons .ag-sort-indicator-container:hover{border:none}button{cursor:pointer;flex-grow:0;flex-shrink:1}\n"], dependencies: [{ kind: "ngmodule", type: SkyIconModule }, { kind: "component", type: i2$5.λ1, selector: "sky-icon", inputs: ["iconName", "variant", "iconSize"] }, { kind: "ngmodule", type: SkyThemeModule }, { kind: "directive", type: i2$4.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { kind: "ngmodule", type: SkyI18nModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2902
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: SkyAgGridHeaderComponent, isStandalone: true, selector: "sky-ag-grid-header", host: { properties: { "attr.title": "accessibleHeaderText()", "attr.aria-label": "displayName() || accessibleHeaderText()", "attr.role": "\"note\"" } }, viewQueries: [{ propertyName: "inlineHelpContainer", first: true, predicate: ["inlineHelpContainer"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div class=\"ag-cell-label-container\" role=\"presentation\">\n @if (params()?.enableMenu) {\n <span\n class=\"ag-header-icon ag-header-cell-menu-button\"\n aria-hidden=\"true\"\n (click)=\"onMenuClick($event)\"\n >\n <sky-icon iconName=\"more-actions\" />\n </span>\n }\n <div class=\"ag-header-cell-label\" role=\"presentation\">\n <span class=\"ag-header-cell-label-and-icons\">\n @if (params()?.enableSorting) {\n <button\n aria-hidden=\"true\"\n class=\"ag-header-cell-text ag-header-cell-label-sortable sky-btn-link-inline\"\n tabindex=\"-1\"\n type=\"button\"\n [attr.aria-label]=\"accessibleHeaderText()\"\n [innerText]=\"displayName() ?? ''\"\n [skyThemeClass]=\"{ 'sky-font-heading-4': 'modern' }\"\n (click)=\"onSortRequested($event)\"\n ></button>\n } @else if (displayName()) {\n <span\n aria-hidden=\"true\"\n class=\"ag-header-cell-text\"\n [skyThemeClass]=\"{ 'sky-font-heading-4': 'modern' }\"\n >{{ displayName() }}</span\n >\n }\n @if (filterEnabled$ | async) {\n <span\n aria-hidden=\"true\"\n class=\"ag-header-icon ag-header-label-icon ag-filter-icon\"\n ><sky-icon iconName=\"filter\"\n /></span>\n }\n @if (params()?.enableSorting) {\n @if (sortOrder$ | async; as sortDirection) {\n <button\n class=\"ag-sort-indicator-container sky-btn sky-btn-icon-borderless\"\n type=\"button\"\n (click)=\"onSortRequested($event)\"\n >\n @if (sortDirection === 'desc') {\n <span class=\"ag-header-icon ag-header-label-icon\">\n <sky-icon iconName=\"chevron-down\" iconSize=\"s\" />\n <span class=\"sky-screen-reader-only\">{{\n 'sky_ag_grid_column_header_sort_button_aria_label_currently_desc'\n | skyLibResources: displayName() ?? accessibleHeaderText()\n }}</span></span\n >\n }\n @if (sortDirection === 'asc') {\n <span class=\"ag-header-icon ag-header-label-icon\">\n <sky-icon iconName=\"chevron-up\" iconSize=\"s\" />\n <span class=\"sky-screen-reader-only\">{{\n 'sky_ag_grid_column_header_sort_button_aria_label_currently_asc'\n | skyLibResources: displayName() ?? accessibleHeaderText()\n }}</span></span\n >\n }\n\n @if (sortIndexDisplay$ | async; as sortIndexDisplay) {\n <span\n aria-hidden=\"true\"\n class=\"ag-sort-indicator-icon ag-sort-order\"\n >{{ sortIndexDisplay }}</span\n >\n }\n </button>\n } @else {\n <span class=\"sky-screen-reader-only\">{{\n 'sky_ag_grid_column_header_sort_button_aria_label_currently_not_sorted'\n | skyLibResources: displayName() ?? accessibleHeaderText()\n }}</span>\n }\n }\n </span>\n <span #inlineHelpContainer class=\"sky-control-help-container\"></span>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex-wrap:nowrap;width:100%;max-width:100%;height:100%;align-items:center;align-content:center}:host-context(.ag-header-cell.ag-right-aligned-header,.ag-header-cell.sky-ag-grid-header-right-aligned){flex-direction:row-reverse}:host-context(.ag-header-cell.ag-right-aligned-header,.ag-header-cell.sky-ag-grid-header-right-aligned) .ag-header-cell-label .sky-control-help-container{order:0}:host-context(.ag-header-cell.ag-right-aligned-header,.ag-header-cell.sky-ag-grid-header-right-aligned) .ag-header-cell-label .ag-header-cell-label-and-icons{order:1}.ag-header-cell-label .ag-header-cell-label-and-icons .ag-header-label-icon,.ag-header-cell-label .ag-header-cell-label-and-icons .ag-header-menu-icon,.ag-header-cell-label .ag-header-cell-label-and-icons .ag-header-icon{line-height:0;margin-left:var(--sky-override-ag-grid-header-icon-spacing, var(--sky-space-gap-text_action-xs))}.ag-header-cell-label .ag-header-cell-label-and-icons .sky-btn.sky-btn-icon-borderless{margin-left:var(--sky-override-ag-grid-header-icon-spacing, var(--sky-space-gap-text_action-xs))}.ag-header-cell-label .ag-header-cell-label-and-icons .sky-btn.sky-btn-icon-borderless .ag-header-label-icon,.ag-header-cell-label .ag-header-cell-label-and-icons .sky-btn.sky-btn-icon-borderless .ag-header-menu-icon,.ag-header-cell-label .ag-header-cell-label-and-icons .sky-btn.sky-btn-icon-borderless .ag-header-icon{margin-left:0}button.ag-header-cell-label{max-width:100%}.ag-cell-label-container{padding:0;gap:var(--sky-override-ag-grid-header-icon-spacing, var(--sky-space-gap-text_action-xs))}.ag-header-cell-label{padding-right:0;padding-left:0}.ag-header-cell-label .ag-header-cell-label-and-icons{display:flex;flex-wrap:nowrap;flex-direction:row;overflow:hidden;align-items:center}.ag-header-cell-label .ag-header-cell-label-and-icons .ag-header-cell-text{flex-grow:0;flex-shrink:1}.ag-header-cell-label .ag-header-cell-label-and-icons .ag-sort-indicator-container{color:var(--sky-override-ag-grid-sort-color, var(--sky-color-text-deemphasized));width:initial;height:initial}.ag-header-cell-label .ag-header-cell-label-and-icons .ag-sort-indicator-container:hover{border:none}button{cursor:pointer;flex-grow:0;flex-shrink:1}\n"], dependencies: [{ kind: "ngmodule", type: SkyIconModule }, { kind: "component", type: i2$4.λ1, selector: "sky-icon", inputs: ["iconName", "variant", "iconSize"] }, { kind: "ngmodule", type: SkyThemeModule }, { kind: "directive", type: i1$5.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { kind: "ngmodule", type: SkyI18nModule }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2945
2903
  }
2946
2904
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridHeaderComponent, decorators: [{
2947
2905
  type: Component,
@@ -3512,29 +3470,17 @@ let rowNodeId = -1;
3512
3470
  class SkyAgGridService {
3513
3471
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3514
3472
  #keyMap = new WeakMap();
3515
- #ngUnsubscribe = new Subject();
3516
- #currentTheme = undefined;
3517
- #agGridAdapterService;
3518
- #resources;
3473
+ #agGridAdapterService = inject(SkyAgGridAdapterService);
3474
+ #resources = inject(SkyLibResourcesService, { optional: true });
3519
3475
  #dateService = inject(SkyDateService);
3520
3476
  #logService = inject(SkyLogService);
3521
3477
  #cspNonce = inject(CSP_NONCE, { optional: true });
3522
- constructor(agGridAdapterService, themeSvc, resources) {
3523
- this.#agGridAdapterService = agGridAdapterService;
3524
- this.#resources = resources;
3525
- /*istanbul ignore else*/
3526
- if (themeSvc) {
3527
- themeSvc.settingsChange
3528
- .pipe(takeUntil(this.#ngUnsubscribe))
3529
- .subscribe((settingsChange) => {
3530
- this.#currentTheme = settingsChange.currentSettings;
3531
- });
3532
- }
3533
- }
3534
- ngOnDestroy() {
3535
- this.#ngUnsubscribe.next();
3536
- this.#ngUnsubscribe.complete();
3537
- }
3478
+ #doc = inject(DOCUMENT);
3479
+ #currentTheme = toSignal(inject(SkyThemeService, { optional: true })?.settingsChange.pipe(map((settingsChange) => settingsChange.currentSettings)) ?? EMPTY, { initialValue: undefined });
3480
+ #currencyValidatorMsg = toSignal(this.#resources?.getString('sky_ag_grid_cell_renderer_currency_validator_message') ?? of('Please enter a valid currency'), { initialValue: 'Please enter a valid currency' });
3481
+ #numberValidatorMsg = toSignal(this.#resources?.getString('sky_ag_grid_cell_renderer_number_validator_message') ?? of('Please enter a valid number'), { initialValue: 'Please enter a valid number' });
3482
+ #rowSelectorHeading = toSignal(this.#resources?.getString('sky_ag_grid_row_selector_column_heading') ??
3483
+ of('Row selection'), { initialValue: 'Row selection' });
3538
3484
  /**
3539
3485
  * Returns [AG Grid `gridOptions`](https://www.ag-grid.com/angular-data-grid/grid-options/) with default SKY UX options, styling, and cell renderers registered for read-only grids.
3540
3486
  * @param args
@@ -3718,7 +3664,7 @@ class SkyAgGridService {
3718
3664
  },
3719
3665
  cellEditor: SkyAgGridCellEditorDatepickerComponent,
3720
3666
  comparator: dateComparator,
3721
- minWidth: this.#currentTheme?.theme?.name === 'modern' ? 180 : 160,
3667
+ minWidth: this.#currentTheme()?.theme?.name === 'modern' ? 180 : 160,
3722
3668
  valueFormatter: (params) => {
3723
3669
  try {
3724
3670
  return (this.#dateService.format(params.value, args.locale, args.dateFormat || 'shortDate') || '');
@@ -3779,7 +3725,7 @@ class SkyAgGridService {
3779
3725
  },
3780
3726
  cellRenderer: SkyAgGridCellRendererRowSelectorComponent,
3781
3727
  headerComponent: SkyAgGridHeaderRowSelectorComponent,
3782
- headerName: 'Row selection',
3728
+ headerValueGetter: () => this.#rowSelectorHeading(),
3783
3729
  minWidth: 55,
3784
3730
  maxWidth: 55,
3785
3731
  resizable: false,
@@ -3877,6 +3823,7 @@ class SkyAgGridService {
3877
3823
  styleNonce: this.#cspNonce ?? undefined,
3878
3824
  suppressDragLeaveHidesColumns: true,
3879
3825
  theme: getSkyAgGridTheme('data-grid'),
3826
+ themeStyleContainer: this.#doc.head,
3880
3827
  };
3881
3828
  const columnTypes = defaultSkyGridOptions.columnTypes;
3882
3829
  columnTypes[SkyCellType.CurrencyValidator] = {
@@ -3886,19 +3833,10 @@ class SkyAgGridService {
3886
3833
  validator: (value) => {
3887
3834
  return !!`${value || ''}`.match(/^[^0-9]*(\d+[,.]?)+\d*[^0-9]*$/);
3888
3835
  },
3889
- validatorMessage: 'Please enter a valid currency',
3836
+ validatorMessage: this.#currencyValidatorMsg,
3890
3837
  },
3891
3838
  },
3892
3839
  };
3893
- /*istanbul ignore else*/
3894
- if (this.#resources) {
3895
- this.#resources
3896
- .getString('sky_ag_grid_cell_renderer_currency_validator_message')
3897
- .pipe(takeUntil(this.#ngUnsubscribe))
3898
- .subscribe((value) => {
3899
- columnTypes[SkyCellType.CurrencyValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
3900
- });
3901
- }
3902
3840
  columnTypes[SkyCellType.NumberValidator] = {
3903
3841
  ...columnTypes[SkyCellType.Validator],
3904
3842
  ...columnTypes[SkyCellType.Number],
@@ -3911,25 +3849,10 @@ class SkyAgGridService {
3911
3849
  validator: (value) => {
3912
3850
  return !!value && !isNaN(parseFloat(value));
3913
3851
  },
3914
- validatorMessage: 'Please enter a valid number',
3852
+ validatorMessage: this.#numberValidatorMsg,
3915
3853
  },
3916
3854
  },
3917
3855
  };
3918
- /*istanbul ignore else*/
3919
- if (this.#resources) {
3920
- this.#resources
3921
- .getString('sky_ag_grid_cell_renderer_number_validator_message')
3922
- .pipe(takeUntil(this.#ngUnsubscribe))
3923
- .subscribe((value) => {
3924
- columnTypes[SkyCellType.NumberValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
3925
- });
3926
- this.#resources
3927
- .getString('sky_ag_grid_row_selector_column_heading')
3928
- .pipe(takeUntil(this.#ngUnsubscribe))
3929
- .subscribe((value) => {
3930
- columnTypes[SkyCellType.RowSelector].headerName = value;
3931
- });
3932
- }
3933
3856
  return defaultSkyGridOptions;
3934
3857
  }
3935
3858
  #onCellFocused(event) {
@@ -3985,7 +3908,7 @@ class SkyAgGridService {
3985
3908
  }
3986
3909
  return false;
3987
3910
  }
3988
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridService, deps: [{ token: SkyAgGridAdapterService }, { token: i2$4.SkyThemeService, optional: true }, { token: i3.SkyLibResourcesService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
3911
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3989
3912
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridService, providedIn: 'root' }); }
3990
3913
  }
3991
3914
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SkyAgGridService, decorators: [{
@@ -3993,11 +3916,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
3993
3916
  args: [{
3994
3917
  providedIn: 'root',
3995
3918
  }]
3996
- }], ctorParameters: () => [{ type: SkyAgGridAdapterService }, { type: i2$4.SkyThemeService, decorators: [{
3997
- type: Optional
3998
- }] }, { type: i3.SkyLibResourcesService, decorators: [{
3999
- type: Optional
4000
- }] }] });
3919
+ }] });
4001
3920
 
4002
3921
  // Export any types that should be included in the root.
4003
3922