@datorama/core 22.15.0 → 22.15.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.
Files changed (38) hide show
  1. package/bundle.scss +122 -50
  2. package/bundles/datorama-core.umd.js +167 -47
  3. package/bundles/datorama-core.umd.js.map +1 -1
  4. package/bundles/datorama-core.umd.min.js +27 -27
  5. package/bundles/datorama-core.umd.min.js.map +1 -1
  6. package/datorama-core.metadata.json +1 -1
  7. package/esm2015/lib/grid/grid/grid.component.js +4 -4
  8. package/esm2015/lib/grid/grid-sort.utils.js +7 -2
  9. package/esm2015/lib/grid-v2/grid/grid-v2.component.js +10 -3
  10. package/esm2015/lib/grid-v2/grid/grid-v2.config.js +30 -4
  11. package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +58 -24
  12. package/esm2015/lib/grid-v2/grid-header/grid-header.component.js +3 -2
  13. package/esm2015/lib/grid-v2/grid-store/grid.query.js +9 -5
  14. package/esm2015/lib/grid-v2/grid-store/grid.service.js +3 -2
  15. package/esm2015/lib/grid-v2/grid-store/util.js +27 -1
  16. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +22 -16
  17. package/esm2015/lib/version.js +2 -2
  18. package/esm5/lib/grid/grid/grid.component.js +4 -4
  19. package/esm5/lib/grid/grid-sort.utils.js +7 -2
  20. package/esm5/lib/grid-v2/grid/grid-v2.component.js +14 -3
  21. package/esm5/lib/grid-v2/grid/grid-v2.config.js +30 -4
  22. package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +62 -24
  23. package/esm5/lib/grid-v2/grid-header/grid-header.component.js +3 -2
  24. package/esm5/lib/grid-v2/grid-store/grid.query.js +9 -5
  25. package/esm5/lib/grid-v2/grid-store/grid.service.js +3 -2
  26. package/esm5/lib/grid-v2/grid-store/util.js +28 -1
  27. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +22 -16
  28. package/esm5/lib/version.js +2 -2
  29. package/fesm2015/datorama-core.js +160 -48
  30. package/fesm2015/datorama-core.js.map +1 -1
  31. package/fesm5/datorama-core.js +168 -48
  32. package/fesm5/datorama-core.js.map +1 -1
  33. package/lib/grid-v2/grid/grid-v2.component.d.ts +4 -0
  34. package/lib/grid-v2/grid-controller/grid-controller.component.d.ts +15 -0
  35. package/lib/grid-v2/grid-store/grid.service.d.ts +1 -1
  36. package/lib/grid-v2/grid-store/util.d.ts +7 -0
  37. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +1 -0
  38. package/package.json +1 -1
@@ -7,15 +7,19 @@
7
7
  */
8
8
  import { ElementRef } from '@angular/core';
9
9
  import { AgGridAngular } from '@ag-grid-community/angular';
10
+ import { GridReadyEvent } from '@ag-grid-community/core';
10
11
  import { DatoGridControllerComponent } from '../grid-controller/grid-controller.component';
11
12
  import { DatoGridOptions } from './grid-v2.types';
12
13
  export declare class DatoGridV2Component {
13
14
  private controller;
14
15
  private host;
15
16
  set grid(agGrid: AgGridAngular);
17
+ hasGridOptions$: import("rxjs").Observable<boolean>;
18
+ get agGridOptions(): DatoGridOptions;
16
19
  get gridOptions(): DatoGridOptions;
17
20
  get enableBackground(): boolean;
18
21
  get enableV2_1(): boolean;
19
22
  get isPivotStyle(): boolean;
20
23
  constructor(controller: DatoGridControllerComponent, host: ElementRef);
24
+ onGridReady(event: GridReadyEvent): void;
21
25
  }
@@ -8,6 +8,7 @@
8
8
  import { ChangeDetectorRef, ComponentFactoryResolver, ElementRef, EventEmitter, Injector, OnDestroy, QueryList } from '@angular/core';
9
9
  import { Observable } from 'rxjs';
10
10
  import { AgGridAngular } from '@ag-grid-community/angular';
11
+ import { GridReadyEvent } from '@ag-grid-community/core';
11
12
  import { GridQuery } from '../grid-store/grid.query';
12
13
  import { GridService } from '../grid-store/grid.service';
13
14
  import { DatoGridOptions, DatoGridSort, GridChangeEvent } from '../grid/grid-v2.types';
@@ -37,9 +38,22 @@ export declare class DatoGridControllerComponent implements OnDestroy {
37
38
  get gridOptions(): DatoGridOptions;
38
39
  gridReady$: Observable<boolean>;
39
40
  agGridEl: HTMLElement;
41
+ /**
42
+ * dato-grid-v2 renders <ag-grid-angular> only once options exist, since consumers may set them
43
+ * asynchronously. AG Grid 27 reads its options and registered listeners when it creates the grid,
44
+ * so the normalized options go in through the [gridOptions] input and gridReady through a template
45
+ * (gridReady) binding, instead of assigning/subscribing from the ViewChild setter (too late under *ngIf).
46
+ * @internal
47
+ */
48
+ hasGridOptions$: Observable<boolean>;
49
+ get agGridOptions(): DatoGridOptions;
40
50
  private contentInit;
51
+ private destroy$;
41
52
  private tooltip;
42
53
  private _gridOptions;
54
+ private _agGridOptions;
55
+ private hasGridOptions;
56
+ private agGridReady;
43
57
  private rowHoverComponent;
44
58
  private lastHoveredRow;
45
59
  private gridElements;
@@ -47,6 +61,7 @@ export declare class DatoGridControllerComponent implements OnDestroy {
47
61
  private cellMouseOutTimer;
48
62
  constructor(gridService: GridService, gridQuery: GridQuery, cdr: ChangeDetectorRef, iconRegistry: IconRegistry, translate: DatoTranslateService, host: ElementRef, injector: Injector, resolver: ComponentFactoryResolver, hotkeys: DatoHotkeys, storageAPI: GridStorageAPI);
49
63
  ngOnDestroy(): void;
64
+ onAgGridReady(event: GridReadyEvent): void;
50
65
  initializeGrid(agGrid: AgGridAngular, agGridEl: HTMLElement): void;
51
66
  private _initializeGrid;
52
67
  private normalizeOptions;
@@ -152,7 +152,7 @@ export declare class GridService implements OnDestroy {
152
152
  editType?: string;
153
153
  singleClickEdit?: boolean;
154
154
  suppressClickEdit?: boolean;
155
- readOnlyEdit?: boolean; /** Add tree grid specific required settings */
155
+ readOnlyEdit?: boolean;
156
156
  stopEditingWhenCellsLoseFocus?: boolean;
157
157
  enterMovesDown?: boolean;
158
158
  enterMovesDownAfterEdit?: boolean;
@@ -10,4 +10,11 @@ export declare function getColumnsSizes(columns: Column[], original?: boolean):
10
10
  */
11
11
  export declare function getColField(colDef: ColDef): string;
12
12
  export declare function tryParsePivotValue(str: string): PivotColumnData | undefined;
13
+ /**
14
+ * ag-grid 22 nested each pivot row total column in one group per pivot level, and the innermost group gets the "Total" header,
15
+ * but ag-grid 27 adds the column without groups.
16
+ * Turn the column def into those groups in place, as processSecondaryColDef can't replace it in its parent's children.
17
+ * This relies on ag-grid checking for children before it calls processSecondaryColDef, so re-check it when moving to processPivotResultColDef.
18
+ */
19
+ export declare function wrapPivotRowTotalColDef(colDef: ColDef, headerName: string, pivotLevels: number): void;
13
20
  export declare function isHtmlAllowedForCol(gridOptions: DatoGridOptions, colDef: DatoGridColumnDef): boolean;
@@ -22,6 +22,7 @@ export declare class DatoGridV2ToolbarComponent implements OnInit, OnDestroy {
22
22
  private gridService;
23
23
  private readonly MAX_VISIBLE_ROW_ACTIONS;
24
24
  private readonly MAX_VISIBLE_GRID_ACTIONS;
25
+ private destroy$;
25
26
  private _maxRowActions;
26
27
  groupTrigger: ElementRef;
27
28
  settingsTrigger: ElementRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datorama/core",
3
- "version": "22.15.0",
3
+ "version": "22.15.3",
4
4
  "peerDependencies": {
5
5
  "@ag-grid-community/angular": "~27.3.0",
6
6
  "@ag-grid-community/core": "~27.3.0",