@progress/kendo-angular-grid 13.0.0-develop.2 → 13.0.0-develop.21

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 (75) hide show
  1. package/aggregates/aggregate-types.d.ts +58 -0
  2. package/aggregates/status-bar-template.directive.d.ts +19 -0
  3. package/aggregates/status-bar.component.d.ts +53 -0
  4. package/column-menu/column-chooser.component.d.ts +1 -1
  5. package/column-menu/column-menu-autosize-all.component.d.ts +3 -4
  6. package/column-menu/column-menu-chooser.component.d.ts +3 -4
  7. package/column-menu/column-menu-filter.component.d.ts +3 -4
  8. package/column-menu/column-menu-lock.component.d.ts +3 -4
  9. package/column-menu/column-menu-position.component.d.ts +3 -4
  10. package/column-menu/column-menu-sort.component.d.ts +4 -2
  11. package/esm2020/aggregates/aggregate-types.mjs +6 -0
  12. package/esm2020/aggregates/status-bar-template.directive.mjs +26 -0
  13. package/esm2020/aggregates/status-bar.component.mjs +236 -0
  14. package/esm2020/column-menu/column-chooser.component.mjs +1 -1
  15. package/esm2020/column-menu/column-list.component.mjs +3 -3
  16. package/esm2020/column-menu/column-menu-autosize-all.component.mjs +3 -4
  17. package/esm2020/column-menu/column-menu-chooser.component.mjs +4 -5
  18. package/esm2020/column-menu/column-menu-filter.component.mjs +4 -5
  19. package/esm2020/column-menu/column-menu-item.component.mjs +1 -1
  20. package/esm2020/column-menu/column-menu-lock.component.mjs +3 -4
  21. package/esm2020/column-menu/column-menu-position.component.mjs +3 -4
  22. package/esm2020/column-menu/column-menu-sort.component.mjs +4 -2
  23. package/esm2020/column-menu/column-menu.component.mjs +1 -1
  24. package/esm2020/editing/add-command.directive.mjs +1 -1
  25. package/esm2020/editing/cancel-command.directive.mjs +1 -1
  26. package/esm2020/editing/edit-command.directive.mjs +1 -1
  27. package/esm2020/editing/remove-command.directive.mjs +1 -1
  28. package/esm2020/editing/save-command.directive.mjs +1 -1
  29. package/esm2020/excel/excel-command.directive.mjs +1 -1
  30. package/esm2020/filtering/cell/boolean-filter-cell.component.mjs +1 -1
  31. package/esm2020/filtering/cell/filter-cell-operators.component.mjs +15 -1
  32. package/esm2020/filtering/cell/filter-cell-wrapper.component.mjs +3 -1
  33. package/esm2020/filtering/cell/string-filter-cell.component.mjs +1 -1
  34. package/esm2020/filtering/filter-input.directive.mjs +5 -1
  35. package/esm2020/filtering/menu/filter-menu-container.component.mjs +11 -11
  36. package/esm2020/filtering/menu/filter-menu.component.mjs +1 -1
  37. package/esm2020/grid.component.mjs +574 -540
  38. package/esm2020/grid.module.mjs +10 -2
  39. package/esm2020/grouping/group-header.component.mjs +25 -8
  40. package/esm2020/grouping/group-panel.component.mjs +2 -2
  41. package/esm2020/index.mjs +1 -0
  42. package/esm2020/localization/messages.mjs +5 -1
  43. package/esm2020/package-metadata.mjs +2 -2
  44. package/esm2020/pager/pager-element.component.mjs +17 -0
  45. package/esm2020/pager/pager-next-buttons.component.mjs +8 -11
  46. package/esm2020/pager/pager-page-sizes.component.mjs +1 -1
  47. package/esm2020/pager/pager-prev-buttons.component.mjs +8 -11
  48. package/esm2020/pdf/pdf-command.directive.mjs +1 -1
  49. package/esm2020/rendering/cell.component.mjs +1 -1
  50. package/esm2020/rendering/header/header.component.mjs +1 -1
  51. package/esm2020/rendering/list.component.mjs +12 -14
  52. package/esm2020/rendering/table-body.component.mjs +1 -1
  53. package/esm2020/selection/cell-selection.service.mjs +20 -1
  54. package/esm2020/selection/selection-checkbox.directive.mjs +2 -0
  55. package/esm2020/selection/selection-default.mjs +14 -1
  56. package/esm2020/selection/selection.service.mjs +31 -5
  57. package/fesm2015/progress-kendo-angular-grid.mjs +1026 -646
  58. package/fesm2020/progress-kendo-angular-grid.mjs +1027 -646
  59. package/filtering/cell/filter-cell-operators.component.d.ts +10 -1
  60. package/grid.component.d.ts +10 -1
  61. package/grid.module.d.ts +100 -98
  62. package/grouping/group-header.component.d.ts +6 -3
  63. package/grouping/group-panel.component.d.ts +0 -1
  64. package/index.d.ts +2 -0
  65. package/localization/messages.d.ts +25 -1
  66. package/package.json +16 -16
  67. package/pager/pager-element.component.d.ts +9 -0
  68. package/pager/pager-next-buttons.component.d.ts +0 -3
  69. package/pager/pager-prev-buttons.component.d.ts +0 -3
  70. package/schematics/ngAdd/index.js +3 -3
  71. package/scrolling/scroll-request.service.d.ts +6 -0
  72. package/selection/cell-selection.service.d.ts +3 -0
  73. package/selection/selection-default.d.ts +17 -2
  74. package/selection/selection.service.d.ts +8 -2
  75. package/selection/types.d.ts +27 -0
@@ -0,0 +1,58 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * Represents the available cell selection aggregates.
7
+ */
8
+ export interface SelectionAggregates {
9
+ /**
10
+ * The sum of all numbers in all selected cells bound to numeric fields.
11
+ * Other selected cells that represent different data types do not affect the value.
12
+ */
13
+ sum?: number;
14
+ /**
15
+ * The smallest number in all selected cells bound to numeric fields.
16
+ * Other selected cells that represent different data types do not affect the value.
17
+ */
18
+ min?: number;
19
+ /**
20
+ * The greatest number in all selected cells bound to numeric fields.
21
+ * Other selected cells that represent different data types do not affect the value.
22
+ */
23
+ max?: number;
24
+ /**
25
+ * The average of all numbers in all selected cells bound to numeric fields.
26
+ * Other selected cells that represent different data types do not affect the value.
27
+ */
28
+ average?: number;
29
+ /**
30
+ * The total number of all selected cells.
31
+ */
32
+ count?: number;
33
+ /**
34
+ * The total number of selected cells bound to a `true` boolean value.
35
+ * Other selected cells that represent different data types do not affect the value.
36
+ */
37
+ isTrue?: number;
38
+ /**
39
+ * The total number of selected cells bound to a `false` boolean value.
40
+ * Other selected cells that represent different data types do not affect the value
41
+ */
42
+ isFalse?: number;
43
+ /**
44
+ * The earliest date in all selected cells bound to `Date` fields.
45
+ * Other selected cells that represent different data types do not affect the value.
46
+ */
47
+ earliest?: Date;
48
+ /**
49
+ * The latest date in all selected cells bound to `Date` fields.
50
+ * Other selected cells that represent different data types do not affect the value.
51
+ */
52
+ latest?: Date;
53
+ }
54
+ /**
55
+ * Represents the available selection aggregate calculations.
56
+ * Use in combination with [cellAggregates]({% slug api_grid_selectablesettings %}) to determine which aggregates will be calculated.
57
+ */
58
+ export declare type SelectionAggregate = 'sum' | 'min' | 'max' | 'average' | 'count' | 'earliest' | 'latest' | 'isTrue' | 'isFalse';
@@ -0,0 +1,19 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { TemplateRef } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents the status bar template of the Grid. Allows you to visualize the aggregates using custom rendering inside the template.
9
+ * The template context has the following field:
10
+ * - `aggregates`—The [SelectionAggregates]({% slug api_grid_selectionaggregates %}) object that contains all calculated aggregates.
11
+ * Use the Angular [ngFor](link:site.data.urls.angular['ngfor']) structural directive combined with the [KeyValuePipe](https://angular.io/api/common/KeyValuePipe)
12
+ * to loop through the aggregates as key-value pairs.
13
+ */
14
+ export declare class StatusBarTemplateDirective {
15
+ templateRef: TemplateRef<any>;
16
+ constructor(templateRef: TemplateRef<any>);
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<StatusBarTemplateDirective, never>;
18
+ static ɵdir: i0.ɵɵDirectiveDeclaration<StatusBarTemplateDirective, "[kendoGridStatusBarTemplate]", never, {}, {}, never>;
19
+ }
@@ -0,0 +1,53 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { OnDestroy, OnInit } from '@angular/core';
6
+ import { ContextService } from '../common/provider.service';
7
+ import { SelectionService } from '../selection/selection.service';
8
+ import { CellSelectionService } from '../selection/cell-selection.service';
9
+ import { SelectionAggregates } from './aggregate-types';
10
+ import { StatusBarTemplateDirective } from './status-bar-template.directive';
11
+ import { LocalDataChangesService } from '../editing/local-data-changes.service';
12
+ import { SelectableSettings } from '../selection/types';
13
+ import { ColumnInfoService } from '../common/column-info.service';
14
+ import * as i0 from "@angular/core";
15
+ interface GroupedAggregates {
16
+ dates?: Array<any>;
17
+ numbers?: Array<number>;
18
+ booleans?: Array<boolean>;
19
+ }
20
+ /**
21
+ * @hidden
22
+ */
23
+ export declare class StatusBarComponent implements OnInit, OnDestroy {
24
+ private ctx;
25
+ private selectionService;
26
+ private dataChanges;
27
+ private columnInfoService;
28
+ private cellSelectionService;
29
+ hostClasses: boolean;
30
+ get isStatusBarTemplate(): string;
31
+ selectableSettings: SelectableSettings | boolean;
32
+ statusBarTemplate: StatusBarTemplateDirective;
33
+ groupedAggregates: GroupedAggregates;
34
+ aggregates: SelectionAggregates;
35
+ private data;
36
+ private subs;
37
+ private selectedItems;
38
+ private selectService;
39
+ constructor(ctx: ContextService, selectionService: SelectionService, dataChanges: LocalDataChangesService, columnInfoService: ColumnInfoService, cellSelectionService: CellSelectionService);
40
+ ngOnInit(): void;
41
+ ngOnDestroy(): void;
42
+ private onSelectionChange;
43
+ private handleAggregateChanges;
44
+ private groupAggregates;
45
+ private calculateAggregates;
46
+ private handleSelectedItems;
47
+ private isAggregateIncluded;
48
+ private nullifyAggregates;
49
+ private get isRowSelection();
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<StatusBarComponent, never>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<StatusBarComponent, "kendo-grid-status-bar", never, { "selectableSettings": "selectableSettings"; "statusBarTemplate": "statusBarTemplate"; }, {}, never, never>;
52
+ }
53
+ export {};
@@ -10,7 +10,7 @@ import { Button } from '@progress/kendo-angular-buttons';
10
10
  import { ContextService } from '../common/provider.service';
11
11
  import * as i0 from "@angular/core";
12
12
  /**
13
- * Represents the component for toggling the Grid columns visibility. [See example](slug:columnmenu_grid#toc-using-standalone-column-chooser).
13
+ * Represents the component for toggling visibility of the Grid columns visibility. [See example](slug:columnmenu_grid#toc-using-standalone-column-chooser).
14
14
  * To show and hide the columns without including the column chooser item in the [Column Menu](slug:columnmenu_grid),
15
15
  * add the component inside the [ToolbarTemplate](slug:toolbartemplate_grid) directive.
16
16
  *
@@ -10,11 +10,10 @@ import * as i0 from "@angular/core";
10
10
  /**
11
11
  * Represents the column-menu item for resizing all columns to the minimum possible width so that they fit the widest header or cell content without wrapping.
12
12
  * [See example](slug:columnmenu_grid#toc-autosize-all-columns-item).
13
- * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
14
- * [See example](slug:columnmenu_grid#toc-customizing-the-content).
15
13
  *
16
- * You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
17
- * the template to the `service` input of the `kendo-grid-columnmenu-autosize-all-columns` component.
14
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
15
+ * To register the component as a known column menu item, set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
16
+ * the template to the `service` input of the `kendo-grid-columnmenu-autosize-all-columns` component. [See example](slug:columnmenu_grid#toc-customizing-the-content).
18
17
  *
19
18
  * @example
20
19
  * ```html
@@ -10,11 +10,10 @@ import { ContextService } from '../common/provider.service';
10
10
  import * as i0 from "@angular/core";
11
11
  /**
12
12
  * Represents the column-menu item for selecting columns in the Grid. [See example](slug:columnmenu_grid#toc-column-chooser-item).
13
- * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
14
- * [See example](slug:columnmenu_grid#toc-customizing-the-content).
15
13
  *
16
- * You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
17
- * the template to the service input of the `kendo-grid-columnmenu-chooser` component.
14
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
15
+ * To register the component as a known column menu item, set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
16
+ * the template to the service input of the `kendo-grid-columnmenu-chooser` component. [See example](slug:columnmenu_grid#toc-customizing-the-content).
18
17
  *
19
18
  * @example
20
19
  * ```html
@@ -9,11 +9,10 @@ import { ColumnMenuItemBase } from './column-menu-item-base';
9
9
  import * as i0 from "@angular/core";
10
10
  /**
11
11
  * Represents the column-menu item for editing column filters in the Grid. [See example](slug:columnmenu_grid#toc-filter-item).
12
- * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
13
- * [See example](slug:columnmenu_grid#toc-customizing-the-content).
14
12
  *
15
- * You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
16
- * the template to the service input of the `kendo-grid-columnmenu-filter` component.
13
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
14
+ * To register the component as a known column menu item, set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
15
+ * the template to the service input of the `kendo-grid-columnmenu-filter` component. [See example](slug:columnmenu_grid#toc-customizing-the-content).
17
16
  *
18
17
  * @example
19
18
  * ```html
@@ -10,11 +10,10 @@ import { ColumnMenuItemBase } from './column-menu-item-base';
10
10
  import * as i0 from "@angular/core";
11
11
  /**
12
12
  * Represents the column-menu item for locking and unlocking columns in the Grid. [See example](slug:columnmenu_grid#toc-lock-and-unlock-items).
13
- * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
14
- * [See example](slug:columnmenu_grid#toc-customizing-the-content).
15
13
  *
16
- * You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
17
- * the template to the service input of the `kendo-grid-columnmenu-lock` component.
14
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
15
+ * To register the component as a known column menu item, set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
16
+ * the template to the service input of the `kendo-grid-columnmenu-lock` component. [See example](slug:columnmenu_grid#toc-customizing-the-content).
18
17
  *
19
18
  * @example
20
19
  * ```html
@@ -9,11 +9,10 @@ import { ColumnMenuItemBase } from './column-menu-item-base';
9
9
  import * as i0 from "@angular/core";
10
10
  /**
11
11
  * Represents the column-menu item which combines the lock and sticky column functionalities.
12
- * [See example](slug:columnmenu_grid#toc-set-column-position-item).
13
- * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
14
12
  *
15
- * You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
16
- * the template to the service input of the `kendo-grid-columnmenu-filter` component.
13
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
14
+ * To register the component as a known column menu item, set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
15
+ * the template to the service input of the `kendo-grid-columnmenu-position` component. [See example](slug:columnmenu_grid#toc-set-column-position-item).
17
16
  *
18
17
  * @example
19
18
  * ```html
@@ -11,8 +11,10 @@ import * as i0 from "@angular/core";
11
11
  /**
12
12
  * Represents the column-menu item for sorting Grid columns.
13
13
  * [See example](slug:columnmenu_grid#toc-sort-item).
14
- * The compoenent can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
15
- * [See example](slug:columnmenu_grid#toc-customizing-the-content).
14
+ *
15
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
16
+ * To register the component as a known column menu item, set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
17
+ * the template to the service input of the `kendo-grid-columnmenu-sort` component. [See example](slug:columnmenu_grid#toc-customizing-the-content).
16
18
  *
17
19
  * You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
18
20
  * the template to the service input of the `kendo-grid-columnmenu-sort` component.
@@ -0,0 +1,6 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ ;
6
+ export {};
@@ -0,0 +1,26 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Directive, TemplateRef } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents the status bar template of the Grid. Allows you to visualize the aggregates using custom rendering inside the template.
9
+ * The template context has the following field:
10
+ * - `aggregates`&mdash;The [SelectionAggregates]({% slug api_grid_selectionaggregates %}) object that contains all calculated aggregates.
11
+ * Use the Angular [ngFor](link:site.data.urls.angular['ngfor']) structural directive combined with the [KeyValuePipe](https://angular.io/api/common/KeyValuePipe)
12
+ * to loop through the aggregates as key-value pairs.
13
+ */
14
+ export class StatusBarTemplateDirective {
15
+ constructor(templateRef) {
16
+ this.templateRef = templateRef;
17
+ }
18
+ }
19
+ StatusBarTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: StatusBarTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
20
+ StatusBarTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: StatusBarTemplateDirective, selector: "[kendoGridStatusBarTemplate]", ngImport: i0 });
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: StatusBarTemplateDirective, decorators: [{
22
+ type: Directive,
23
+ args: [{
24
+ selector: '[kendoGridStatusBarTemplate]'
25
+ }]
26
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
@@ -0,0 +1,236 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /* eslint-disable @typescript-eslint/no-explicit-any */
6
+ import { Component, HostBinding, Input } from '@angular/core';
7
+ import { Subscription } from 'rxjs';
8
+ import { ContextService } from '../common/provider.service';
9
+ import { SelectionService } from '../selection/selection.service';
10
+ import { CellSelectionService } from '../selection/cell-selection.service';
11
+ import { StatusBarTemplateDirective } from './status-bar-template.directive';
12
+ import { LocalDataChangesService } from '../editing/local-data-changes.service';
13
+ import { ColumnInfoService } from '../common/column-info.service';
14
+ import * as i0 from "@angular/core";
15
+ import * as i1 from "../common/provider.service";
16
+ import * as i2 from "../selection/selection.service";
17
+ import * as i3 from "../editing/local-data-changes.service";
18
+ import * as i4 from "../common/column-info.service";
19
+ import * as i5 from "../selection/cell-selection.service";
20
+ import * as i6 from "@angular/common";
21
+ ;
22
+ /**
23
+ * @hidden
24
+ */
25
+ export class StatusBarComponent {
26
+ constructor(ctx, selectionService, dataChanges, columnInfoService, cellSelectionService) {
27
+ this.ctx = ctx;
28
+ this.selectionService = selectionService;
29
+ this.dataChanges = dataChanges;
30
+ this.columnInfoService = columnInfoService;
31
+ this.cellSelectionService = cellSelectionService;
32
+ this.hostClasses = true;
33
+ this.groupedAggregates = { dates: [], numbers: [], booleans: [] };
34
+ this.aggregates = {
35
+ sum: null,
36
+ average: null,
37
+ min: null,
38
+ max: null,
39
+ count: null,
40
+ isTrue: null,
41
+ isFalse: null,
42
+ earliest: null,
43
+ latest: null
44
+ };
45
+ this.subs = new Subscription();
46
+ this.selectedItems = [];
47
+ }
48
+ get isStatusBarTemplate() {
49
+ return this.statusBarTemplate ? '' : 'none';
50
+ }
51
+ ngOnInit() {
52
+ if (this.selectableSettings.cellAggregates) {
53
+ this.data = this.dataChanges.data ? this.dataChanges.data : this.ctx.grid.data;
54
+ this.selectService = this.isRowSelection ? this.selectionService : this.cellSelectionService;
55
+ if (this.isAggregateIncluded('count')) {
56
+ this.aggregates['count'] = 0;
57
+ }
58
+ const selectionDirective = this.ctx.grid.selectionDirective;
59
+ if (selectionDirective && !this.isRowSelection) {
60
+ this.selectedItems = selectionDirective.selectedKeys;
61
+ }
62
+ this.subs.add(this.selectService.aggregateChanges.subscribe((selectionArgs) => this.onSelectionChange(selectionArgs)));
63
+ }
64
+ }
65
+ ngOnDestroy() {
66
+ this.subs.unsubscribe();
67
+ }
68
+ onSelectionChange(selectionArgs) {
69
+ this.handleSelectedItems(selectionArgs);
70
+ this.nullifyAggregates();
71
+ this.handleAggregateChanges();
72
+ this.selectService.aggregates = this.aggregates;
73
+ }
74
+ handleAggregateChanges() {
75
+ const lockedColumns = this.columnInfoService.lockedLeafColumns.toArray();
76
+ const nonLockedColumns = this.columnInfoService.nonLockedLeafColumns.toArray();
77
+ const selectedItemsLength = this.selectedItems.length;
78
+ const columns = [...lockedColumns, ...nonLockedColumns];
79
+ const fields = columns.map(col => col.field);
80
+ if (this.isAggregateIncluded('count')) {
81
+ this.aggregates['count'] = this.isRowSelection ? (selectedItemsLength * columns.length) : selectedItemsLength;
82
+ }
83
+ this.selectedItems.forEach((item) => {
84
+ if (this.isRowSelection) {
85
+ fields.forEach((field) => {
86
+ const cellValue = item.dataItem;
87
+ if (cellValue && cellValue.hasOwnProperty(field)) {
88
+ const cellValue = item.dataItem[field];
89
+ this.groupAggregates(cellValue);
90
+ }
91
+ });
92
+ }
93
+ else if (this.selectService.options.cell) {
94
+ const itemKey = this.data[item.itemKey];
95
+ const field = fields[item.columnKey];
96
+ if (itemKey && itemKey.hasOwnProperty(field)) {
97
+ const cellValue = itemKey[fields[item.columnKey]];
98
+ this.groupAggregates(cellValue);
99
+ }
100
+ }
101
+ });
102
+ this.calculateAggregates();
103
+ }
104
+ groupAggregates(aggregate) {
105
+ if (typeof aggregate === 'number') {
106
+ this.groupedAggregates.numbers.push(aggregate);
107
+ }
108
+ else if (typeof aggregate === 'boolean') {
109
+ this.groupedAggregates.booleans.push(aggregate);
110
+ }
111
+ else if (aggregate instanceof Date) {
112
+ this.groupedAggregates.dates.push(aggregate);
113
+ }
114
+ }
115
+ calculateAggregates() {
116
+ if (this.groupedAggregates.numbers.length > 0) {
117
+ if (this.isAggregateIncluded('min')) {
118
+ this.aggregates['min'] = Math.min(...this.groupedAggregates.numbers);
119
+ }
120
+ if (this.isAggregateIncluded('max')) {
121
+ this.aggregates['max'] = Math.max(...this.groupedAggregates.numbers);
122
+ }
123
+ if (this.isAggregateIncluded('sum')) {
124
+ this.aggregates['sum'] = this.groupedAggregates.numbers.reduce((acc, curr) => acc += curr, 0);
125
+ }
126
+ if (this.isAggregateIncluded('average')) {
127
+ this.aggregates['average'] = this.aggregates['sum'] / this.groupedAggregates.numbers.length;
128
+ }
129
+ }
130
+ if (this.groupedAggregates.booleans.length > 0) {
131
+ if (this.isAggregateIncluded('isTrue')) {
132
+ const isTrueCount = this.groupedAggregates.booleans.filter(bool => bool).length;
133
+ this.aggregates['isTrue'] = isTrueCount > 0 ? isTrueCount : null;
134
+ }
135
+ if (this.isAggregateIncluded('isFalse')) {
136
+ const isFalseCount = this.groupedAggregates.booleans.length - this.aggregates['isTrue'];
137
+ this.aggregates['isFalse'] = isFalseCount > 0 ? isFalseCount : null;
138
+ }
139
+ }
140
+ if (this.groupedAggregates.dates.length > 0) {
141
+ if (this.isAggregateIncluded('earliest')) {
142
+ this.aggregates['earliest'] = new Date(Math.min(...this.groupedAggregates.dates));
143
+ }
144
+ if (this.isAggregateIncluded('latest')) {
145
+ this.aggregates['latest'] = new Date(Math.max(...this.groupedAggregates.dates));
146
+ }
147
+ }
148
+ }
149
+ handleSelectedItems(selectionArgs) {
150
+ const rowOrCellSelect = `${this.isRowSelection ? 'selectedRows' : 'selectedCells'}`;
151
+ const rowOrCellDeselect = `${this.isRowSelection ? 'deselectedRows' : 'deselectedCells'}`;
152
+ const selectedItems = selectionArgs[rowOrCellSelect];
153
+ const deselectedItems = selectionArgs[rowOrCellDeselect];
154
+ if (!this.isRowSelection) {
155
+ // Needed when we have column groups with cell selection, the deselected items are duplicated
156
+ deselectedItems.forEach((item, index) => {
157
+ if (index + 1 < deselectedItems.length) {
158
+ if (item.itemKey === deselectedItems[index + 1].itemKey
159
+ && item.columnKey === deselectedItems[index + 1].columnKey) {
160
+ deselectedItems.splice(index, 1);
161
+ }
162
+ }
163
+ });
164
+ }
165
+ if (selectedItems.length > 0) {
166
+ selectedItems.forEach((item) => {
167
+ this.selectedItems = [...this.selectedItems, item];
168
+ });
169
+ }
170
+ if (deselectedItems.length > 0) {
171
+ if (this.isRowSelection) {
172
+ deselectedItems.forEach((row) => {
173
+ this.selectedItems = this.selectedItems.filter((elem) => elem.dataItem !== row.dataItem);
174
+ });
175
+ }
176
+ else {
177
+ deselectedItems.forEach((cell) => {
178
+ const index = this.selectedItems.findIndex((elem) => elem.itemKey === cell.itemKey && elem.columnKey === cell.columnKey);
179
+ this.selectedItems.splice(index, 1);
180
+ });
181
+ }
182
+ }
183
+ }
184
+ isAggregateIncluded(aggregate) {
185
+ const { cellAggregates } = this.selectService.options;
186
+ if (typeof cellAggregates !== 'boolean') {
187
+ return cellAggregates.includes(aggregate);
188
+ }
189
+ return true;
190
+ }
191
+ nullifyAggregates() {
192
+ this.groupedAggregates = { dates: [], numbers: [], booleans: [] };
193
+ this.aggregates['count'] = null;
194
+ this.aggregates['sum'] = this.aggregates['average'] = null;
195
+ this.aggregates['max'] = this.aggregates['min'] = null;
196
+ this.aggregates['isFalse'] = this.aggregates['isTrue'] = null;
197
+ this.aggregates['earliest'] = this.aggregates['latest'] = null;
198
+ }
199
+ get isRowSelection() {
200
+ return typeof this.selectableSettings === 'boolean' || !this.selectableSettings.cell;
201
+ }
202
+ }
203
+ StatusBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: StatusBarComponent, deps: [{ token: i1.ContextService }, { token: i2.SelectionService }, { token: i3.LocalDataChangesService }, { token: i4.ColumnInfoService }, { token: i5.CellSelectionService }], target: i0.ɵɵFactoryTarget.Component });
204
+ StatusBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: StatusBarComponent, selector: "kendo-grid-status-bar", inputs: { selectableSettings: "selectableSettings", statusBarTemplate: "statusBarTemplate" }, host: { properties: { "class.k-selection-aggregates": "this.hostClasses", "class.k-grid-selection-aggregates": "this.hostClasses", "style.display": "this.isStatusBarTemplate" } }, ngImport: i0, template: `
205
+ <ng-template
206
+ *ngIf="statusBarTemplate"
207
+ [ngTemplateOutlet]="statusBarTemplate?.templateRef"
208
+ [ngTemplateOutletContext]="{ aggregates: aggregates }">
209
+ </ng-template>
210
+ `, isInline: true, directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
211
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: StatusBarComponent, decorators: [{
212
+ type: Component,
213
+ args: [{
214
+ selector: 'kendo-grid-status-bar',
215
+ template: `
216
+ <ng-template
217
+ *ngIf="statusBarTemplate"
218
+ [ngTemplateOutlet]="statusBarTemplate?.templateRef"
219
+ [ngTemplateOutletContext]="{ aggregates: aggregates }">
220
+ </ng-template>
221
+ `
222
+ }]
223
+ }], ctorParameters: function () { return [{ type: i1.ContextService }, { type: i2.SelectionService }, { type: i3.LocalDataChangesService }, { type: i4.ColumnInfoService }, { type: i5.CellSelectionService }]; }, propDecorators: { hostClasses: [{
224
+ type: HostBinding,
225
+ args: ['class.k-selection-aggregates']
226
+ }, {
227
+ type: HostBinding,
228
+ args: ['class.k-grid-selection-aggregates']
229
+ }], isStatusBarTemplate: [{
230
+ type: HostBinding,
231
+ args: ['style.display']
232
+ }], selectableSettings: [{
233
+ type: Input
234
+ }], statusBarTemplate: [{
235
+ type: Input
236
+ }] } });
@@ -16,7 +16,7 @@ import * as i3 from "@progress/kendo-angular-popup";
16
16
  import * as i4 from "@progress/kendo-angular-buttons";
17
17
  import * as i5 from "./column-list.component";
18
18
  /**
19
- * Represents the component for toggling the Grid columns visibility. [See example](slug:columnmenu_grid#toc-using-standalone-column-chooser).
19
+ * Represents the component for toggling visibility of the Grid columns visibility. [See example](slug:columnmenu_grid#toc-using-standalone-column-chooser).
20
20
  * To show and hide the columns without including the column chooser item in the [Column Menu](slug:columnmenu_grid),
21
21
  * add the component inside the [ToolbarTemplate](slug:toolbartemplate_grid) directive.
22
22
  *
@@ -20,7 +20,7 @@ export class ColumnListComponent {
20
20
  this.columnChange = new EventEmitter();
21
21
  this.autoSync = true;
22
22
  this.allowHideAll = false;
23
- this.actionsClass = 'k-actions';
23
+ this.actionsClass = 'k-actions k-actions-stretched k-actions-horizontal';
24
24
  this.unlockedCount = 0;
25
25
  }
26
26
  get className() {
@@ -159,8 +159,8 @@ ColumnListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
159
159
  </label>
160
160
  </div>
161
161
  <div [ngClass]="actionsClass" *ngIf="!autoSync">
162
- <button type="button" class="k-button k-button-solid-base k-button-solid k-button-md k-rounded-md k-button-rectangle" (click)="cancelChanges()">{{ resetText }}</button>
163
162
  <button #applyButton type="button" (keydown.tab)="onTab($event)" class="k-button k-button-solid-primary k-button-solid k-button-md k-rounded-md k-button-rectangle" (click)="applyChanges()">{{ applyText }}</button>
163
+ <button type="button" class="k-button k-button-solid-base k-button-solid k-button-md k-rounded-md k-button-rectangle" (click)="cancelChanges()">{{ resetText }}</button>
164
164
  </div>
165
165
  `, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
166
166
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnListComponent, decorators: [{
@@ -174,8 +174,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
174
174
  </label>
175
175
  </div>
176
176
  <div [ngClass]="actionsClass" *ngIf="!autoSync">
177
- <button type="button" class="k-button k-button-solid-base k-button-solid k-button-md k-rounded-md k-button-rectangle" (click)="cancelChanges()">{{ resetText }}</button>
178
177
  <button #applyButton type="button" (keydown.tab)="onTab($event)" class="k-button k-button-solid-primary k-button-solid k-button-md k-rounded-md k-button-rectangle" (click)="applyChanges()">{{ applyText }}</button>
178
+ <button type="button" class="k-button k-button-solid-base k-button-solid k-button-md k-rounded-md k-button-rectangle" (click)="cancelChanges()">{{ resetText }}</button>
179
179
  </div>
180
180
  `
181
181
  }]
@@ -15,11 +15,10 @@ import * as i3 from "@angular/common";
15
15
  /**
16
16
  * Represents the column-menu item for resizing all columns to the minimum possible width so that they fit the widest header or cell content without wrapping.
17
17
  * [See example](slug:columnmenu_grid#toc-autosize-all-columns-item).
18
- * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
19
- * [See example](slug:columnmenu_grid#toc-customizing-the-content).
20
18
  *
21
- * You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
22
- * the template to the `service` input of the `kendo-grid-columnmenu-autosize-all-columns` component.
19
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
20
+ * To register the component as a known column menu item, set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
21
+ * the template to the `service` input of the `kendo-grid-columnmenu-autosize-all-columns` component. [See example](slug:columnmenu_grid#toc-customizing-the-content).
23
22
  *
24
23
  * @example
25
24
  * ```html
@@ -15,11 +15,10 @@ import * as i4 from "./column-list.component";
15
15
  import * as i5 from "./column-menu-item-content-template.directive";
16
16
  /**
17
17
  * Represents the column-menu item for selecting columns in the Grid. [See example](slug:columnmenu_grid#toc-column-chooser-item).
18
- * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
19
- * [See example](slug:columnmenu_grid#toc-customizing-the-content).
20
18
  *
21
- * You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
22
- * the template to the service input of the `kendo-grid-columnmenu-chooser` component.
19
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
20
+ * To register the component as a known column menu item, set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
21
+ * the template to the service input of the `kendo-grid-columnmenu-chooser` component. [See example](slug:columnmenu_grid#toc-customizing-the-content).
23
22
  *
24
23
  * @example
25
24
  * ```html
@@ -57,7 +56,7 @@ export class ColumnMenuChooserComponent extends ColumnMenuItemBase {
57
56
  /**
58
57
  * @hidden
59
58
  */
60
- this.actionsClass = 'k-actions';
59
+ this.actionsClass = 'k-actions k-actions-stretched k-actions-horizontal';
61
60
  this.columnsIcon = columnsIcon;
62
61
  }
63
62
  get columns() {
@@ -13,11 +13,10 @@ import * as i3 from "../filtering/menu/filter-menu-container.component";
13
13
  import * as i4 from "./column-menu-item-content-template.directive";
14
14
  /**
15
15
  * Represents the column-menu item for editing column filters in the Grid. [See example](slug:columnmenu_grid#toc-filter-item).
16
- * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
17
- * [See example](slug:columnmenu_grid#toc-customizing-the-content).
18
16
  *
19
- * You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
20
- * the template to the service input of the `kendo-grid-columnmenu-filter` component.
17
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
18
+ * To register the component as a known column menu item, set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
19
+ * the template to the service input of the `kendo-grid-columnmenu-filter` component. [See example](slug:columnmenu_grid#toc-customizing-the-content).
21
20
  *
22
21
  * @example
23
22
  * ```html
@@ -54,7 +53,7 @@ export class ColumnMenuFilterComponent extends ColumnMenuItemBase {
54
53
  /**
55
54
  * @hidden
56
55
  */
57
- this.actionsClass = 'k-actions';
56
+ this.actionsClass = 'k-actions k-actions-stretched k-actions-horizontal';
58
57
  this.filterIcon = filterIcon;
59
58
  }
60
59
  /**
@@ -81,7 +81,7 @@ ColumnMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
81
81
  <ng-container [ngTemplateOutlet]="contentTemplate.templateRef">
82
82
  </ng-container>
83
83
  <div>
84
- `, isInline: true, components: [{ type: i1.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
84
+ `, isInline: true, components: [{ type: i1.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
85
85
  trigger('state', [
86
86
  state('collapsed', style({ display: 'none' })),
87
87
  state('expanded', style({ display: 'block' })),