@skyux/ag-grid 12.9.0 → 12.11.0

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,17 +1,17 @@
1
1
  import { DOCUMENT, AsyncPipe, NgClass, CommonModule, NgTemplateOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { NgModule, Injectable, input, numberAttribute, computed, inject, ChangeDetectorRef, ElementRef, booleanAttribute, Input, HostBinding, ContentChild, ChangeDetectionStrategy, Component, contentChildren, effect, Directive, InjectionToken, signal, model, output, contentChild, linkedSignal, EnvironmentInjector, HostListener, ViewChild, ViewEncapsulation, Optional } from '@angular/core';
3
+ import { NgModule, Injectable, input, numberAttribute, viewChild, inject, ChangeDetectorRef, ElementRef, effect, booleanAttribute, Input, HostBinding, ContentChild, ChangeDetectionStrategy, Component, contentChildren, Directive, InjectionToken, computed, signal, model, output, contentChild, linkedSignal, EnvironmentInjector, HostListener, ViewChild, ViewEncapsulation, CSP_NONCE, Optional } 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
7
  import { toSignal, toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
8
8
  import * as i1 from '@skyux/core';
9
- import { SkyMutationObserverService, SkyViewkeeperModule, SkyMediaQueryService, SkyResizeObserverService, SkyAffixModule, SkyOverlayService, SkyScrollableHostService, SKY_STACKING_CONTEXT, SkyIdModule, SkyNumericModule, SkyDynamicComponentService, SkyDynamicComponentLocation, SkyLogService } from '@skyux/core';
9
+ import { SkyMutationObserverService, SkyIdModule, SkyViewkeeperModule, SkyMediaQueryService, SkyResizeObserverService, SkyAffixModule, SkyOverlayService, SkyScrollableHostService, SKY_STACKING_CONTEXT, SkyNumericModule, SkyDynamicComponentService, SkyDynamicComponentLocation, SkyLogService } from '@skyux/core';
10
10
  import { Subject, BehaviorSubject, ReplaySubject, takeUntil, combineLatest, of, distinctUntilChanged, take, Subscription, switchMap, merge, fromEvent, startWith, map, scan, filter as filter$1, fromEventPattern, isObservable } from 'rxjs';
11
11
  import { takeUntil as takeUntil$1, filter, first } from 'rxjs/operators';
12
12
  import * as i2$4 from '@skyux/theme';
13
13
  import { SkyThemeService, SkyThemeModule } from '@skyux/theme';
14
- import { themeQuartz, colorSchemeLight, iconSetQuartz, colorSchemeDark, KeyCode, PopupComponent } from 'ag-grid-community';
14
+ import { themeQuartz, colorSchemeLight, colorSchemeDark, KeyCode, PopupComponent } from 'ag-grid-community';
15
15
  import * as i1$1 from '@skyux/data-manager';
16
16
  import * as i1$2 from '@skyux/layout';
17
17
  import { SkyInlineDeleteModule } from '@skyux/layout';
@@ -242,8 +242,8 @@ const modernThemeDarkBase = {
242
242
  rowHeight: 60,
243
243
  };
244
244
  const SkyAgGridDataGridDefault = themeQuartz
245
+ .withoutPart('iconSet')
245
246
  .withPart(colorSchemeLight)
246
- .withPart(iconSetQuartz)
247
247
  .withParams(defaultThemeBase);
248
248
  const SkyAgGridDataEntryGridDefault = SkyAgGridDataGridDefault.withParams(defaultsForDataEntryGrid).withParams({
249
249
  cellHorizontalPadding: '11px',
@@ -254,13 +254,13 @@ const SkyAgGridDataEntryGridDefault = SkyAgGridDataGridDefault.withParams(defaul
254
254
  },
255
255
  });
256
256
  const SkyAgGridDataGridModernLight = themeQuartz
257
+ .withoutPart('iconSet')
257
258
  .withPart(colorSchemeLight)
258
- .withPart(iconSetQuartz)
259
259
  .withParams(modernThemeBase);
260
260
  const SkyAgGridDataGridModernLightCompact = SkyAgGridDataGridModernLight.withParams(modernCompactThemeBase);
261
261
  const SkyAgGridDataGridModernDark = themeQuartz
262
+ .withoutPart('iconSet')
262
263
  .withPart(colorSchemeDark)
263
- .withPart(iconSetQuartz)
264
264
  .withParams(modernThemeDarkBase);
265
265
  const SkyAgGridDataGridModernDarkCompact = SkyAgGridDataGridModernDark.withParams(modernCompactThemeBase);
266
266
  const SkyAgGridDataEntryGridModernLight = SkyAgGridDataGridModernLight.withParams(defaultsForDataEntryGrid).withParams({
@@ -377,9 +377,9 @@ class SkyAgGridAdapterService {
377
377
  return undefined;
378
378
  }
379
379
  focusOnFocusableChildren(element) {
380
- const focusableChildren = this.#skyAdapterService.getFocusableChildren(element);
381
- if (focusableChildren.length) {
382
- focusableChildren[0].focus();
380
+ const [focusChild] = this.#skyAdapterService.getFocusableChildren(element);
381
+ if (focusChild?.offsetParent) {
382
+ focusChild.focus();
383
383
  }
384
384
  }
385
385
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SkyAgGridAdapterService, deps: [{ token: i1.SkyCoreAdapterService }], target: i0.ɵɵFactoryTarget.Injectable }); }
@@ -550,9 +550,7 @@ class SkyAgGridWrapperComponent {
550
550
  this.minHeight = input(50, {
551
551
  transform: numberAttribute,
552
552
  });
553
- this.minHeightStyle = computed(() => {
554
- return `--sky-ag-grid-min-height: ${this.minHeight()}px;`;
555
- });
553
+ this.skyAgGridDiv = viewChild('skyAgGridDiv');
556
554
  this.#_viewkeeperClasses = [];
557
555
  this.#ngUnsubscribe = new Subject();
558
556
  this.#themeSvc = inject(SkyThemeService, {
@@ -577,6 +575,11 @@ class SkyAgGridWrapperComponent {
577
575
  this.beforeAnchorId = 'sky-ag-grid-nav-anchor-before-' + idIndex;
578
576
  this.gridId = 'sky-ag-grid-' + idIndex;
579
577
  this.wrapperClasses$ = this.#wrapperClasses.asObservable();
578
+ effect(() => {
579
+ const minHeight = this.minHeight();
580
+ const skyAgGridDiv = this.skyAgGridDiv()?.nativeElement;
581
+ skyAgGridDiv?.style.setProperty('--sky-ag-grid-min-height', `${minHeight}px`);
582
+ });
580
583
  }
581
584
  ngAfterContentInit() {
582
585
  if (this.agGrid) {
@@ -769,11 +772,11 @@ class SkyAgGridWrapperComponent {
769
772
  }
770
773
  }
771
774
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SkyAgGridWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
772
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.7", 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 }], ngImport: i0, template: "<span\n class=\"nav-anchor\"\n tabindex=\"0\"\n [id]=\"beforeAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n<div\n class=\"sky-ag-grid\"\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 [style]=\"minHeightStyle()\"\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: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: SkyViewkeeperModule }, { kind: "directive", type: i1.λ3, selector: "[skyViewkeeper]", inputs: ["skyViewkeeper"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
775
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.7", 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 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: "pipe", type: AsyncPipe, name: "async" }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
773
776
  }
774
777
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SkyAgGridWrapperComponent, decorators: [{
775
778
  type: Component,
776
- args: [{ selector: 'sky-ag-grid-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe, NgClass, SkyViewkeeperModule], template: "<span\n class=\"nav-anchor\"\n tabindex=\"0\"\n [id]=\"beforeAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n<div\n class=\"sky-ag-grid\"\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 [style]=\"minHeightStyle()\"\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" }]
779
+ 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 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" }]
777
780
  }], ctorParameters: () => [], propDecorators: { agGrid: [{
778
781
  type: ContentChild,
779
782
  args: [AgGridAngular, {
@@ -2802,34 +2805,456 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
2802
2805
  }] } });
2803
2806
 
2804
2807
  const iconMap = {
2805
- sortDescending: {
2808
+ // header column group shown when expanded (click to contract)
2809
+ columnGroupOpened: {
2810
+ name: 'chevron-double-left',
2811
+ size: 16,
2812
+ },
2813
+ // header column group shown when contracted (click to expand)
2814
+ columnGroupClosed: {
2815
+ name: 'chevron-double-right',
2816
+ size: 16,
2817
+ },
2818
+ // column tool panel column group contracted (click to expand)
2819
+ columnSelectClosed: {
2820
+ name: 'chevron-right',
2821
+ size: 24,
2822
+ },
2823
+ // column tool panel column group expanded (click to contract)
2824
+ columnSelectOpen: {
2806
2825
  name: 'chevron-down',
2826
+ size: 24,
2827
+ },
2828
+ // column tool panel header expand/collapse all button, shown
2829
+ // when some children are expanded and others are collapsed
2830
+ columnSelectIndeterminate: {
2831
+ name: 'subtract',
2807
2832
  size: 16,
2808
2833
  },
2809
- sortAscending: {
2810
- name: 'chevron-up',
2834
+ // accordion open (filter tool panel group, charts group)
2835
+ accordionOpen: {
2836
+ name: 'chevron-down',
2837
+ size: 24,
2838
+ },
2839
+ // accordion closed (filter tool panel group, charts group)
2840
+ accordionClosed: {
2841
+ name: 'chevron-right',
2842
+ size: 24,
2843
+ },
2844
+ // accordion indeterminate - shown when some children are expanded and
2845
+ // others are collapsed (filter tool panel group, charts group)
2846
+ accordionIndeterminate: {
2847
+ name: 'subtract',
2811
2848
  size: 16,
2812
2849
  },
2813
- columnMoveMove: {
2850
+ // shown on drag and drop image component icon while dragging
2851
+ // column to the side of the grid to pin
2852
+ columnMovePin: {
2814
2853
  name: 'arrow-move',
2815
2854
  size: 20,
2816
2855
  },
2856
+ // shown on drag and drop image component icon while dragging over
2857
+ // part of the page that is not a drop zone
2817
2858
  columnMoveHide: {
2818
2859
  name: 'eye-off',
2819
2860
  size: 16,
2820
2861
  },
2862
+ // shown on drag and drop image component icon while dragging
2863
+ // columns to reorder
2864
+ columnMoveMove: {
2865
+ name: 'arrow-move',
2866
+ size: 20,
2867
+ },
2868
+ // animating icon shown when dragging a column to the right of
2869
+ // the grid causes horizontal scrolling
2821
2870
  columnMoveLeft: {
2822
2871
  name: 'arrow-move',
2823
2872
  size: 20,
2824
2873
  },
2874
+ // animating icon shown when dragging a column to the left of
2875
+ // the grid causes horizontal scrolling
2825
2876
  columnMoveRight: {
2826
2877
  name: 'arrow-move',
2827
2878
  size: 20,
2828
2879
  },
2829
- columnMovePin: {
2830
- name: 'arrow-move',
2880
+ // shown on drag and drop image component icon while dragging
2881
+ // over Row Groups drop zone
2882
+ columnMoveGroup: {
2883
+ name: 'group',
2884
+ size: 20,
2885
+ },
2886
+ // shown on drag and drop image component icon while dragging
2887
+ // over Values drop zone
2888
+ columnMoveValue: {
2889
+ name: 'calculator',
2890
+ size: 16,
2891
+ },
2892
+ // shown on drag and drop image component icon while dragging
2893
+ // over pivot drop zone
2894
+ columnMovePivot: {
2895
+ name: 'table-freeze-column',
2896
+ size: 16,
2897
+ },
2898
+ // shown on drag and drop image component icon while dragging
2899
+ // over drop zone that doesn't support it, e.g.
2900
+ // string column over aggregation drop zone
2901
+ dropNotAllowed: {
2902
+ name: 'prohibited',
2903
+ size: 16,
2904
+ },
2905
+ // shown on row group when contracted (click to expand)
2906
+ groupContracted: {
2907
+ name: 'chevron-right',
2908
+ size: 24,
2909
+ },
2910
+ // shown on row group when expanded (click to contract)
2911
+ groupExpanded: {
2912
+ name: 'chevron-down',
2913
+ size: 24,
2914
+ },
2915
+ // set filter tree list group contracted (click to expand)
2916
+ setFilterGroupClosed: {
2917
+ name: 'chevron-right',
2918
+ size: 24,
2919
+ },
2920
+ // set filter tree list group expanded (click to contract)
2921
+ setFilterGroupOpen: {
2922
+ name: 'chevron-down',
2923
+ size: 24,
2924
+ },
2925
+ // set filter tree list expand/collapse all button, shown when
2926
+ // some children are expanded and
2927
+ // others are collapsed
2928
+ setFilterGroupIndeterminate: {
2929
+ name: 'subtract',
2930
+ size: 16,
2931
+ },
2932
+ // set filter async values loading
2933
+ setFilterLoading: {
2934
+ name: 'spinner-ios',
2935
+ size: 16,
2936
+ },
2937
+ // context menu chart item
2938
+ chart: {
2939
+ name: 'data-bar-vertical-ascending',
2940
+ size: 16,
2941
+ },
2942
+ // dialog title bar
2943
+ close: {
2944
+ name: 'close',
2945
+ size: 24,
2946
+ },
2947
+ // X (remove) on column 'pill' after adding it to a drop zone list
2948
+ cancel: {
2949
+ name: 'close',
2950
+ size: 24,
2951
+ },
2952
+ // indicates the currently active pin state in the "Pin column"
2953
+ // sub-menu of the column menu
2954
+ check: {
2955
+ name: 'checkmark',
2831
2956
  size: 20,
2832
2957
  },
2958
+ // "go to first" button in pagination controls
2959
+ first: {
2960
+ name: 'arrow-previous',
2961
+ size: 16,
2962
+ },
2963
+ // "go to previous" button in pagination controls
2964
+ previous: {
2965
+ name: 'chevron-left',
2966
+ size: 24,
2967
+ },
2968
+ // "go to next" button in pagination controls
2969
+ next: {
2970
+ name: 'chevron-right',
2971
+ size: 24,
2972
+ },
2973
+ // "go to last" button in pagination controls
2974
+ last: {
2975
+ name: 'arrow-next',
2976
+ size: 16,
2977
+ },
2978
+ // shown on top right of chart when chart is linked to range
2979
+ // data (click to unlink)
2980
+ linked: {
2981
+ name: 'link-dismiss',
2982
+ size: 16,
2983
+ },
2984
+ // shown on top right of chart when chart is not linked to
2985
+ // range data (click to link)
2986
+ unlinked: {
2987
+ name: 'link',
2988
+ size: 16,
2989
+ },
2990
+ // rotating spinner shown by the loading cell renderer
2991
+ groupLoading: {
2992
+ name: 'spinner-ios',
2993
+ size: 16,
2994
+ },
2995
+ // button to launch legacy column menu
2996
+ menu: {
2997
+ name: 'more-actions',
2998
+ size: 24,
2999
+ },
3000
+ // button to launch new enterprise column menu
3001
+ menuAlt: {
3002
+ name: 'more-actions',
3003
+ size: 24,
3004
+ },
3005
+ // menu tab icon in legacy tabbed enterprise column menu
3006
+ legacyMenu: {
3007
+ name: 'more-actions',
3008
+ size: 24,
3009
+ },
3010
+ // open filter button - header, floating filter, menu
3011
+ filter: {
3012
+ name: 'filter',
3013
+ size: 16,
3014
+ },
3015
+ // filter is applied - header (legacy column menu), filter tool panel
3016
+ filterActive: {
3017
+ name: 'filter',
3018
+ size: 16,
3019
+ },
3020
+ // filter tab icon in legacy tabbed enterprise column menu
3021
+ filterTab: {
3022
+ name: 'filter',
3023
+ size: 16,
3024
+ },
3025
+ // filter tool panel tab
3026
+ filtersToolPanel: {
3027
+ name: 'filter',
3028
+ size: 16,
3029
+ },
3030
+ // columns in menu (column chooser / columns tab)
3031
+ columns: {
3032
+ name: 'layout-column-three',
3033
+ size: 16,
3034
+ },
3035
+ // column tool panel tab
3036
+ columnsToolPanel: {
3037
+ name: 'layout-column-three',
3038
+ size: 16,
3039
+ },
3040
+ // button in chart regular size window title bar (click to maximise)
3041
+ maximize: {
3042
+ name: 'arrow-maximize',
3043
+ size: 16,
3044
+ },
3045
+ // button in chart maximised window title bar (click to make regular size)
3046
+ minimize: {
3047
+ name: 'arrow-minimize',
3048
+ size: 16,
3049
+ },
3050
+ // "Pin column" item in column header menu
3051
+ menuPin: {
3052
+ name: 'pin',
3053
+ size: 16,
3054
+ },
3055
+ // "Value aggregation" column menu item (shown on numeric
3056
+ // columns when grouping is active)"
3057
+ menuValue: {
3058
+ name: 'calculator',
3059
+ size: 16,
3060
+ },
3061
+ // "Group by {column-name}" item in column header menu
3062
+ menuAddRowGroup: {
3063
+ name: 'arrow-collapse-all',
3064
+ size: 16,
3065
+ },
3066
+ // "Un-Group by {column-name}" item in column header menu
3067
+ menuRemoveRowGroup: {
3068
+ name: 'arrow-collapse-all',
3069
+ size: 16,
3070
+ },
3071
+ // context menu copy item
3072
+ clipboardCopy: {
3073
+ name: 'copy',
3074
+ size: 16,
3075
+ },
3076
+ // context menu cut item
3077
+ clipboardCut: {
3078
+ name: 'cut',
3079
+ size: 16,
3080
+ },
3081
+ // context menu paste item
3082
+ clipboardPaste: {
3083
+ name: 'clipboard-arrow-right',
3084
+ size: 16,
3085
+ },
3086
+ // identifies the pivot drop zone
3087
+ pivotPanel: {
3088
+ name: 'pivot',
3089
+ size: 16,
3090
+ },
3091
+ // "Row groups" drop zone in column tool panel
3092
+ rowGroupPanel: {
3093
+ name: 'group',
3094
+ size: 20,
3095
+ },
3096
+ // columns tool panel Values drop zone
3097
+ valuePanel: {
3098
+ name: 'calculator',
3099
+ size: 16,
3100
+ },
3101
+ // drag handle used to pick up draggable columns
3102
+ columnDrag: {
3103
+ name: 're-order-dots-vertical',
3104
+ size: 16,
3105
+ },
3106
+ // drag handle used to pick up draggable rows
3107
+ rowDrag: {
3108
+ name: 'arrow-bidirectional-up-down',
3109
+ size: 16,
3110
+ },
3111
+ // context menu export item
3112
+ save: {
3113
+ name: 'arrow-download',
3114
+ size: 16,
3115
+ },
3116
+ // csv export
3117
+ csvExport: {
3118
+ name: 'document-text',
3119
+ size: 16,
3120
+ },
3121
+ // excel export
3122
+ excelExport: {
3123
+ name: 'document-xls',
3124
+ size: 16,
3125
+ },
3126
+ // icon on select dropdowns (select cell editor, charts tool panels)
3127
+ selectOpen: {
3128
+ name: 'chevron-down',
3129
+ size: 24,
3130
+ },
3131
+ // open icon for rich select editor
3132
+ richSelectOpen: {
3133
+ name: 'chevron-down',
3134
+ size: 24,
3135
+ },
3136
+ // remove for rich select editor pills
3137
+ richSelectRemove: {
3138
+ name: 'close',
3139
+ size: 24,
3140
+ },
3141
+ // icon for sub menu item
3142
+ subMenuOpen: {
3143
+ name: 'arrow-right',
3144
+ size: 16,
3145
+ },
3146
+ // version of subMenuOpen used in RTL mode
3147
+ subMenuOpenRtl: {
3148
+ name: 'arrow-left',
3149
+ size: 16,
3150
+ },
3151
+ // separator between column 'pills' when you add multiple
3152
+ // columns to the header drop zone
3153
+ panelDelimiter: {
3154
+ name: 'chevron-right',
3155
+ size: 16,
3156
+ },
3157
+ // version of panelDelimiter used in RTL mode
3158
+ panelDelimiterRtl: {
3159
+ name: 'arrow-left',
3160
+ size: 16,
3161
+ },
3162
+ // show on column header when column is sorted ascending
3163
+ sortAscending: {
3164
+ name: 'chevron-up',
3165
+ size: 24,
3166
+ },
3167
+ // show on column header when column is sorted descending
3168
+ sortDescending: {
3169
+ name: 'chevron-down',
3170
+ size: 24,
3171
+ },
3172
+ // show on column header when column has no sort, only when
3173
+ // enabled with colDef.unSortIcon=true
3174
+ sortUnSort: {
3175
+ name: 'subtract',
3176
+ size: 16,
3177
+ },
3178
+ // Builder button in Advanced Filter
3179
+ advancedFilterBuilder: {
3180
+ name: 'group',
3181
+ size: 20,
3182
+ },
3183
+ // drag handle used to pick up Advanced Filter Builder rows
3184
+ advancedFilterBuilderDrag: {
3185
+ name: 're-order-dots-vertical',
3186
+ size: 16,
3187
+ },
3188
+ // Advanced Filter Builder row validation error
3189
+ advancedFilterBuilderInvalid: {
3190
+ name: 'prohibited',
3191
+ size: 16,
3192
+ },
3193
+ // shown on Advanced Filter Builder rows to move them up
3194
+ advancedFilterBuilderMoveUp: {
3195
+ name: 'chevron-up',
3196
+ size: 24,
3197
+ },
3198
+ // shown on Advanced Filter Builder rows to move them down
3199
+ advancedFilterBuilderMoveDown: {
3200
+ name: 'chevron-down',
3201
+ size: 24,
3202
+ },
3203
+ // shown on Advanced Filter Builder rows to add new rows
3204
+ advancedFilterBuilderAdd: {
3205
+ name: 'add-circle',
3206
+ size: 24,
3207
+ },
3208
+ // shown on Advanced Filter Builder rows to remove row
3209
+ advancedFilterBuilderRemove: {
3210
+ name: 'subtract-circle',
3211
+ size: 16,
3212
+ },
3213
+ // shown on Advanced Filter Builder selection pills
3214
+ advancedFilterBuilderSelect: {
3215
+ name: 'chevron-down',
3216
+ size: 24,
3217
+ },
3218
+ // icon to open charts menu
3219
+ chartsMenu: {
3220
+ name: 'more-actions',
3221
+ size: 24,
3222
+ },
3223
+ // Edit Chart menu item shown in Integrated Charts menu
3224
+ chartsMenuEdit: {
3225
+ name: 'data-bar-vertical-ascending',
3226
+ size: 16,
3227
+ },
3228
+ // Advanced Settings menu item shown in Integrated Charts menu
3229
+ chartsMenuAdvancedSettings: {
3230
+ name: 'settings',
3231
+ size: 16,
3232
+ },
3233
+ // shown in Integrated Charts menu add fields
3234
+ chartsMenuAdd: {
3235
+ name: 'add',
3236
+ size: 24,
3237
+ },
3238
+ // shown in Integrated Charts tool panel color picker
3239
+ chartsColorPicker: {
3240
+ name: 'chevron-down',
3241
+ size: 24,
3242
+ },
3243
+ // previous in Integrated Charts settings tool panel theme switcher
3244
+ chartsThemePrevious: {
3245
+ name: 'chevron-left',
3246
+ size: 24,
3247
+ },
3248
+ // next in Integrated Charts settings tool panel theme switcher
3249
+ chartsThemeNext: {
3250
+ name: 'chevron-right',
3251
+ size: 24,
3252
+ },
3253
+ // download chart
3254
+ chartsDownload: {
3255
+ name: 'arrow-download',
3256
+ size: 16,
3257
+ },
2833
3258
  };
2834
3259
 
2835
3260
  class SkyAgGridLoadingComponent {
@@ -2942,6 +3367,7 @@ class SkyAgGridService {
2942
3367
  #resources;
2943
3368
  #dateService = inject(SkyDateService);
2944
3369
  #logService = inject(SkyLogService);
3370
+ #cspNonce = inject(CSP_NONCE, { optional: true });
2945
3371
  constructor(agGridAdapterService, themeSvc, resources) {
2946
3372
  this.#agGridAdapterService = agGridAdapterService;
2947
3373
  this.#resources = resources;
@@ -3284,17 +3710,12 @@ class SkyAgGridService {
3284
3710
  return [];
3285
3711
  }
3286
3712
  },
3287
- icons: {
3288
- sortDescending: this.#getIconTemplate('sortDescending'),
3289
- sortAscending: this.#getIconTemplate('sortAscending'),
3290
- columnMoveMove: this.#getIconTemplate('columnMoveMove'),
3291
- columnMoveHide: this.#getIconTemplate('columnMoveHide'),
3292
- columnMoveLeft: this.#getIconTemplate('columnMoveLeft'),
3293
- columnMoveRight: this.#getIconTemplate('columnMoveRight'),
3294
- columnMovePin: this.#getIconTemplate('columnMovePin'),
3295
- },
3713
+ icons: Object.fromEntries(Object.keys(iconMap).map((iconKey) => [
3714
+ iconKey,
3715
+ this.#getIconTemplate(iconKey),
3716
+ ])),
3296
3717
  loadingOverlayComponent: SkyAgGridLoadingComponent,
3297
- onCellFocused: () => this.#onCellFocused(),
3718
+ onCellFocused: (event) => this.#onCellFocused(event),
3298
3719
  rowModelType: 'clientSide',
3299
3720
  rowSelection: {
3300
3721
  mode: 'multiRow',
@@ -3304,6 +3725,7 @@ class SkyAgGridService {
3304
3725
  headerCheckbox: false,
3305
3726
  },
3306
3727
  singleClickEdit: true,
3728
+ styleNonce: this.#cspNonce ?? undefined,
3307
3729
  suppressDragLeaveHidesColumns: true,
3308
3730
  theme: getSkyAgGridTheme('data-grid', this.#currentTheme?.theme?.name, this.#currentTheme?.mode?.name, this.#currentTheme?.spacing?.name),
3309
3731
  };
@@ -3361,9 +3783,25 @@ class SkyAgGridService {
3361
3783
  }
3362
3784
  return defaultSkyGridOptions;
3363
3785
  }
3364
- #onCellFocused() {
3365
- const currentElement = this.#agGridAdapterService.getFocusedElement();
3366
- this.#agGridAdapterService.focusOnFocusableChildren(currentElement);
3786
+ #onCellFocused(event) {
3787
+ const shouldFocus = this.#shouldFocusChildren(event);
3788
+ if (shouldFocus) {
3789
+ const currentElement = this.#agGridAdapterService.getFocusedElement();
3790
+ this.#agGridAdapterService.focusOnFocusableChildren(currentElement);
3791
+ }
3792
+ }
3793
+ #shouldFocusChildren(event) {
3794
+ let shouldFocus = true;
3795
+ // The API says the column can be string or null, but should be an object.
3796
+ shouldFocus &&= typeof event.column === 'object';
3797
+ // Row index can be number or null.
3798
+ const rowNode = Number.isInteger(event.rowIndex) &&
3799
+ event.api.getDisplayedRowAtIndex(event.rowIndex);
3800
+ shouldFocus &&= !!rowNode;
3801
+ // Do not change focus if the cell is a row drag or dnd source.
3802
+ shouldFocus &&= !event.column.isRowDrag(rowNode);
3803
+ shouldFocus &&= !event.column.isDndSource(rowNode);
3804
+ return shouldFocus;
3367
3805
  }
3368
3806
  #getDefaultEditableGridOptions(args) {
3369
3807
  const defaultGridOptions = this.#getDefaultGridOptions(args);