@progress/kendo-angular-grid 7.3.3 → 7.4.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.
@@ -0,0 +1,51 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { OnInit } from '@angular/core';
6
+ import { LocalizationService } from "@progress/kendo-angular-l10n";
7
+ import { ContextService } from '../common/provider.service';
8
+ import { ColumnMenuItemBase } from './column-menu-item-base';
9
+ import * as i0 from "@angular/core";
10
+ /**
11
+ * Represents the component for resizing all columns to the minimum possible width so that they fit the widest header or cell content without wrapping.
12
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
13
+ *
14
+ * > To enable the autosize-all-columns option, set the [`resizable`]({% slug api_grid_gridcomponent %}#toc-resizable)
15
+ * > property of the Grid to `true`.
16
+ *
17
+ * > You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by
18
+ * > the template to the `service` input of the `kendo-grid-columnmenu-autosize-all-columns` component.
19
+ *
20
+ * @example
21
+ * ```ts-preview
22
+ *
23
+ * _@Component({
24
+ * selector: 'my-app',
25
+ * template: `
26
+ * <kendo-grid [data]="data" [columnMenu]="true">
27
+ * <ng-template kendoGridColumnMenuTemplate let-service="service">
28
+ * <kendo-grid-columnmenu-autosize-all-columns [service]="service">
29
+ * </kendo-grid-columnmenu-autosize-all-columns>
30
+ * </ng-template>
31
+ * <kendo-grid-column field="Field1"></kendo-grid-column>
32
+ * <kendo-grid-column field="Field2"></kendo-grid-column>
33
+ * </kendo-grid>
34
+ * `
35
+ * })
36
+ *
37
+ * class AppComponent {
38
+ * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];
39
+ * }
40
+ *
41
+ * ```
42
+ */
43
+ export declare class ColumnMenuAutoSizeAllColumnsComponent extends ColumnMenuItemBase implements OnInit {
44
+ localization: LocalizationService;
45
+ ctx: ContextService;
46
+ constructor(localization: LocalizationService, ctx: ContextService);
47
+ ngOnInit(): void;
48
+ autoSizeAllColumns(): void;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<ColumnMenuAutoSizeAllColumnsComponent, never>;
50
+ static ɵcmp: i0.ɵɵComponentDeclaration<ColumnMenuAutoSizeAllColumnsComponent, "kendo-grid-columnmenu-autosize-all-columns", never, {}, {}, never, never>;
51
+ }
@@ -0,0 +1,55 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { OnInit } from '@angular/core';
6
+ import { LocalizationService } from "@progress/kendo-angular-l10n";
7
+ import { ContextService } from '../common/provider.service';
8
+ import { ColumnMenuItemBase } from './column-menu-item-base';
9
+ import * as i0 from "@angular/core";
10
+ /**
11
+ * Represents the component for resizing the specified column to the minimum possible width so that it fits the header or cell content without wrapping.
12
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
13
+ *
14
+ * > To enable the autosize-column option, set the [`resizable`]({% slug api_grid_gridcomponent %}#toc-resizable)
15
+ * > property of the Grid to `true`.
16
+ *
17
+ * > You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) and `column` that are passed by
18
+ * > the template to the `service` and `column` input of the `kendo-grid-columnmenu-autosize-column` component.
19
+ *
20
+ * @example
21
+ * ```ts-preview
22
+ *
23
+ * _@Component({
24
+ * selector: 'my-app',
25
+ * template: `
26
+ * <kendo-grid [data]="data" [columnMenu]="true">
27
+ * <ng-template kendoGridColumnMenuTemplate let-service="service" let-column="column">
28
+ * <kendo-grid-columnmenu-autosize-column [column]="column" [service]="service">
29
+ * </kendo-grid-columnmenu-autosize-column>
30
+ * </ng-template>
31
+ * <kendo-grid-column field="Field1"></kendo-grid-column>
32
+ * <kendo-grid-column field="Field2"></kendo-grid-column>
33
+ * </kendo-grid>
34
+ * `
35
+ * })
36
+ *
37
+ * class AppComponent {
38
+ * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];
39
+ * }
40
+ *
41
+ * ```
42
+ */
43
+ export declare class ColumnMenuAutoSizeColumnComponent extends ColumnMenuItemBase implements OnInit {
44
+ localization: LocalizationService;
45
+ ctx: ContextService;
46
+ /**
47
+ * The Grid column instance which will be resized through the auto size column option.
48
+ */
49
+ column: any;
50
+ constructor(localization: LocalizationService, ctx: ContextService);
51
+ ngOnInit(): void;
52
+ autoSizeColumn(): void;
53
+ static ɵfac: i0.ɵɵFactoryDeclaration<ColumnMenuAutoSizeColumnComponent, never>;
54
+ static ɵcmp: i0.ɵɵComponentDeclaration<ColumnMenuAutoSizeColumnComponent, "kendo-grid-columnmenu-autosize-column", never, { "column": "column"; }, {}, never, never>;
55
+ }
@@ -15,7 +15,6 @@ import * as i0 from "@angular/core";
15
15
  * > the template to the service input of the `kendo-grid-columnmenu-chooser` component.
16
16
  *
17
17
  * @example
18
- * {% meta height:300 %}
19
18
  * ```ts-preview
20
19
  *
21
20
  * _@Component({
@@ -37,7 +36,6 @@ import * as i0 from "@angular/core";
37
36
  * }
38
37
  *
39
38
  * ```
40
- * {% endmeta %}
41
39
  */
42
40
  export declare class ColumnMenuChooserComponent extends ColumnMenuItemBase {
43
41
  localization: LocalizationService;
@@ -60,4 +60,14 @@ export interface ColumnMenuSettings {
60
60
  * @default false
61
61
  */
62
62
  setColumnPosition?: boolean | ExpandableColumnMenuItem;
63
+ /**
64
+ * Applies the minimum possible width for the specified column, so that the whole text fits without wrapping.
65
+ * @default false
66
+ */
67
+ autoSizeColumn?: boolean;
68
+ /**
69
+ * Adjusts the width of all columns to fit their entire content, including headers, without wrapping.
70
+ * @default false
71
+ */
72
+ autoSizeAllColumns?: boolean;
63
73
  }
@@ -3,20 +3,22 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { NavigationService } from './../navigation/navigation.service';
6
- import { TemplateRef, OnChanges, OnDestroy, ElementRef } from '@angular/core';
6
+ import { TemplateRef, OnChanges, OnDestroy, ElementRef, AfterViewInit } from '@angular/core';
7
7
  import { LocalizationService } from "@progress/kendo-angular-l10n";
8
8
  import { SinglePopupService } from '../common/single-popup.service';
9
9
  import { ColumnMenuService } from './column-menu.service';
10
10
  import { ColumnMenuSettings } from './column-menu-settings.interface';
11
+ import { ContextService } from '../common/provider.service';
11
12
  import * as i0 from "@angular/core";
12
13
  /**
13
14
  * Represents the [column menu]({% slug columnmenu_grid %}) component.
14
15
  */
15
- export declare class ColumnMenuComponent implements OnChanges, OnDestroy {
16
+ export declare class ColumnMenuComponent implements AfterViewInit, OnChanges, OnDestroy {
17
+ protected navigationService: NavigationService;
16
18
  protected popupService: SinglePopupService;
17
19
  localization: LocalizationService;
18
20
  service: ColumnMenuService;
19
- protected navigationService: NavigationService;
21
+ private ctx;
20
22
  /**
21
23
  * @hidden
22
24
  */
@@ -67,7 +69,7 @@ export declare class ColumnMenuComponent implements OnChanges, OnDestroy {
67
69
  expandedPosition: boolean;
68
70
  private popupRef;
69
71
  private closeSubscription;
70
- constructor(popupService: SinglePopupService, localization: LocalizationService, service: ColumnMenuService, navigationService: NavigationService);
72
+ constructor(navigationService: NavigationService, popupService: SinglePopupService, localization: LocalizationService, service: ColumnMenuService, ctx: ContextService);
71
73
  /**
72
74
  * @hidden
73
75
  */
@@ -84,6 +86,14 @@ export declare class ColumnMenuComponent implements OnChanges, OnDestroy {
84
86
  * @hidden
85
87
  */
86
88
  get hasColumnChooser(): boolean;
89
+ /**
90
+ * @hidden
91
+ */
92
+ get hasAutoSizeColumn(): boolean;
93
+ /**
94
+ * @hidden
95
+ */
96
+ get hasAutoSizeAllColumns(): boolean;
87
97
  /**
88
98
  * @hidden
89
99
  */
@@ -96,6 +106,7 @@ export declare class ColumnMenuComponent implements OnChanges, OnDestroy {
96
106
  * @hidden
97
107
  */
98
108
  get hasPosition(): boolean;
109
+ ngAfterViewInit(): void;
99
110
  ngOnChanges(): void;
100
111
  ngOnDestroy(): void;
101
112
  /**
@@ -17,14 +17,16 @@ import * as i11 from "./column-menu-container.component";
17
17
  import * as i12 from "./column-menu-item.directive";
18
18
  import * as i13 from "./column-menu-stick.component";
19
19
  import * as i14 from "./column-menu-position.component";
20
- import * as i15 from "@angular/common";
21
- import * as i16 from "../filtering/menu/filter-menu.module";
20
+ import * as i15 from "./column-menu-autosize.component";
21
+ import * as i16 from "./column-menu-autosize-all.component";
22
+ import * as i17 from "@angular/common";
23
+ import * as i18 from "../filtering/menu/filter-menu.module";
22
24
  /**
23
25
  * @hidden
24
26
  */
25
27
  export declare class ColumnMenuModule {
26
28
  static exports(): any[];
27
29
  static ɵfac: i0.ɵɵFactoryDeclaration<ColumnMenuModule, never>;
28
- static ɵmod: i0.ɵɵNgModuleDeclaration<ColumnMenuModule, [typeof i1.ColumnListComponent, typeof i2.ColumnChooserComponent, typeof i3.ColumnMenuChooserComponent, typeof i4.ColumnMenuFilterComponent, typeof i5.ColumnMenuItemComponent, typeof i6.ColumnMenuItemContentTemplateDirective, typeof i7.ColumnMenuSortComponent, typeof i8.ColumnMenuComponent, typeof i9.ColumnMenuLockComponent, typeof i10.ColumnMenuTemplateDirective, typeof i11.ColumnMenuContainerComponent, typeof i12.ColumnMenuItemDirective, typeof i13.ColumnMenuStickComponent, typeof i14.ColumnMenuPositionComponent], [typeof i15.CommonModule, typeof i16.FilterMenuModule], [typeof i1.ColumnListComponent, typeof i2.ColumnChooserComponent, typeof i3.ColumnMenuChooserComponent, typeof i4.ColumnMenuFilterComponent, typeof i5.ColumnMenuItemComponent, typeof i6.ColumnMenuItemContentTemplateDirective, typeof i7.ColumnMenuSortComponent, typeof i8.ColumnMenuComponent, typeof i9.ColumnMenuLockComponent, typeof i10.ColumnMenuTemplateDirective, typeof i11.ColumnMenuContainerComponent, typeof i12.ColumnMenuItemDirective, typeof i13.ColumnMenuStickComponent, typeof i14.ColumnMenuPositionComponent]>;
30
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ColumnMenuModule, [typeof i1.ColumnListComponent, typeof i2.ColumnChooserComponent, typeof i3.ColumnMenuChooserComponent, typeof i4.ColumnMenuFilterComponent, typeof i5.ColumnMenuItemComponent, typeof i6.ColumnMenuItemContentTemplateDirective, typeof i7.ColumnMenuSortComponent, typeof i8.ColumnMenuComponent, typeof i9.ColumnMenuLockComponent, typeof i10.ColumnMenuTemplateDirective, typeof i11.ColumnMenuContainerComponent, typeof i12.ColumnMenuItemDirective, typeof i13.ColumnMenuStickComponent, typeof i14.ColumnMenuPositionComponent, typeof i15.ColumnMenuAutoSizeColumnComponent, typeof i16.ColumnMenuAutoSizeAllColumnsComponent], [typeof i17.CommonModule, typeof i18.FilterMenuModule], [typeof i1.ColumnListComponent, typeof i2.ColumnChooserComponent, typeof i3.ColumnMenuChooserComponent, typeof i4.ColumnMenuFilterComponent, typeof i5.ColumnMenuItemComponent, typeof i6.ColumnMenuItemContentTemplateDirective, typeof i7.ColumnMenuSortComponent, typeof i8.ColumnMenuComponent, typeof i9.ColumnMenuLockComponent, typeof i10.ColumnMenuTemplateDirective, typeof i11.ColumnMenuContainerComponent, typeof i12.ColumnMenuItemDirective, typeof i13.ColumnMenuStickComponent, typeof i14.ColumnMenuPositionComponent, typeof i15.ColumnMenuAutoSizeColumnComponent, typeof i16.ColumnMenuAutoSizeAllColumnsComponent]>;
29
31
  static ɵinj: i0.ɵɵInjectorDeclaration<ColumnMenuModule>;
30
32
  }
@@ -26,6 +26,18 @@ export declare const hasPosition: (settings: any, column: any) => boolean;
26
26
  * @hidden
27
27
  */
28
28
  export declare const hasColumnChooser: (settings: any) => boolean;
29
+ /**
30
+ * @hidden
31
+ */
32
+ export declare const hasAutoSizeColumn: (settings: any) => boolean;
33
+ /**
34
+ * @hidden
35
+ */
36
+ export declare const hasAutoSizeAllColumns: (settings: any) => boolean;
37
+ /**
38
+ * @hidden
39
+ */
40
+ export declare const autoSizeColumn: (grid: any, service: any, column?: any) => void;
29
41
  /**
30
42
  * @hidden
31
43
  */
@@ -0,0 +1,8 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * @hidden
7
+ */
8
+ export declare const ColunnMenuErrorMessages: any;
@@ -0,0 +1,87 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Component, isDevMode } from '@angular/core';
6
+ import { ColunnMenuErrorMessages } from '../common/error-messages';
7
+ import { ColumnMenuItemBase } from './column-menu-item-base';
8
+ import { autoSizeColumn } from './utils';
9
+ import * as i0 from "@angular/core";
10
+ import * as i1 from "@progress/kendo-angular-l10n";
11
+ import * as i2 from "../common/provider.service";
12
+ import * as i3 from "./column-menu-item.component";
13
+ import * as i4 from "@angular/common";
14
+ /**
15
+ * Represents the component for resizing all columns to the minimum possible width so that they fit the widest header or cell content without wrapping.
16
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
17
+ *
18
+ * > To enable the autosize-all-columns option, set the [`resizable`]({% slug api_grid_gridcomponent %}#toc-resizable)
19
+ * > property of the Grid to `true`.
20
+ *
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.
23
+ *
24
+ * @example
25
+ * ```ts-preview
26
+ *
27
+ * _@Component({
28
+ * selector: 'my-app',
29
+ * template: `
30
+ * <kendo-grid [data]="data" [columnMenu]="true">
31
+ * <ng-template kendoGridColumnMenuTemplate let-service="service">
32
+ * <kendo-grid-columnmenu-autosize-all-columns [service]="service">
33
+ * </kendo-grid-columnmenu-autosize-all-columns>
34
+ * </ng-template>
35
+ * <kendo-grid-column field="Field1"></kendo-grid-column>
36
+ * <kendo-grid-column field="Field2"></kendo-grid-column>
37
+ * </kendo-grid>
38
+ * `
39
+ * })
40
+ *
41
+ * class AppComponent {
42
+ * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];
43
+ * }
44
+ *
45
+ * ```
46
+ */
47
+ export class ColumnMenuAutoSizeAllColumnsComponent extends ColumnMenuItemBase {
48
+ constructor(localization, ctx) {
49
+ super();
50
+ this.localization = localization;
51
+ this.ctx = ctx;
52
+ }
53
+ ngOnInit() {
54
+ const isVirtualColumns = this.ctx.grid.columnMenuTemplate && this.ctx.grid.virtualColumns;
55
+ if (isVirtualColumns && isDevMode()) {
56
+ console.warn(ColunnMenuErrorMessages.autoSizeAllColumns);
57
+ }
58
+ }
59
+ autoSizeAllColumns() {
60
+ autoSizeColumn(this.ctx.grid, this.service);
61
+ }
62
+ }
63
+ ColumnMenuAutoSizeAllColumnsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ColumnMenuAutoSizeAllColumnsComponent, deps: [{ token: i1.LocalizationService }, { token: i2.ContextService }], target: i0.ɵɵFactoryTarget.Component });
64
+ ColumnMenuAutoSizeAllColumnsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ColumnMenuAutoSizeAllColumnsComponent, selector: "kendo-grid-columnmenu-autosize-all-columns", usesInheritance: true, ngImport: i0, template: `
65
+ <kendo-grid-columnmenu-item
66
+ *ngIf="!this.ctx.grid.virtualColumns"
67
+ [text]="localization.get('autosizeAllColumns')"
68
+ icon="display-inline-block"
69
+ (itemClick)="autoSizeAllColumns()"
70
+ >
71
+ </kendo-grid-columnmenu-item>
72
+ `, isInline: true, components: [{ type: i3.ColumnMenuItemComponent, selector: "kendo-grid-columnmenu-item", inputs: ["icon", "text", "selected", "disabled", "expanded"], outputs: ["itemClick", "expand", "collapse"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ColumnMenuAutoSizeAllColumnsComponent, decorators: [{
74
+ type: Component,
75
+ args: [{
76
+ selector: 'kendo-grid-columnmenu-autosize-all-columns',
77
+ template: `
78
+ <kendo-grid-columnmenu-item
79
+ *ngIf="!this.ctx.grid.virtualColumns"
80
+ [text]="localization.get('autosizeAllColumns')"
81
+ icon="display-inline-block"
82
+ (itemClick)="autoSizeAllColumns()"
83
+ >
84
+ </kendo-grid-columnmenu-item>
85
+ `
86
+ }]
87
+ }], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.ContextService }]; } });
@@ -0,0 +1,91 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Component, Input, isDevMode } from '@angular/core';
6
+ import { ColunnMenuErrorMessages } from '../common/error-messages';
7
+ import { ColumnMenuItemBase } from './column-menu-item-base';
8
+ import { autoSizeColumn } from './utils';
9
+ import * as i0 from "@angular/core";
10
+ import * as i1 from "@progress/kendo-angular-l10n";
11
+ import * as i2 from "../common/provider.service";
12
+ import * as i3 from "./column-menu-item.component";
13
+ import * as i4 from "@angular/common";
14
+ /**
15
+ * Represents the component for resizing the specified column to the minimum possible width so that it fits the header or cell content without wrapping.
16
+ * The component can be placed inside a [ColumnMenuTemplate]({% slug api_grid_columnmenutemplatedirective %}) directive.
17
+ *
18
+ * > To enable the autosize-column option, set the [`resizable`]({% slug api_grid_gridcomponent %}#toc-resizable)
19
+ * > property of the Grid to `true`.
20
+ *
21
+ * > You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) and `column` that are passed by
22
+ * > the template to the `service` and `column` input of the `kendo-grid-columnmenu-autosize-column` component.
23
+ *
24
+ * @example
25
+ * ```ts-preview
26
+ *
27
+ * _@Component({
28
+ * selector: 'my-app',
29
+ * template: `
30
+ * <kendo-grid [data]="data" [columnMenu]="true">
31
+ * <ng-template kendoGridColumnMenuTemplate let-service="service" let-column="column">
32
+ * <kendo-grid-columnmenu-autosize-column [column]="column" [service]="service">
33
+ * </kendo-grid-columnmenu-autosize-column>
34
+ * </ng-template>
35
+ * <kendo-grid-column field="Field1"></kendo-grid-column>
36
+ * <kendo-grid-column field="Field2"></kendo-grid-column>
37
+ * </kendo-grid>
38
+ * `
39
+ * })
40
+ *
41
+ * class AppComponent {
42
+ * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];
43
+ * }
44
+ *
45
+ * ```
46
+ */
47
+ export class ColumnMenuAutoSizeColumnComponent extends ColumnMenuItemBase {
48
+ constructor(localization, ctx) {
49
+ super();
50
+ this.localization = localization;
51
+ this.ctx = ctx;
52
+ }
53
+ ngOnInit() {
54
+ const isVirtualColumns = this.ctx.grid.columnMenuTemplate && this.ctx.grid.virtualColumns;
55
+ if (isVirtualColumns && isDevMode()) {
56
+ console.warn(ColunnMenuErrorMessages.autoSizeColumn);
57
+ }
58
+ }
59
+ autoSizeColumn() {
60
+ autoSizeColumn(this.ctx.grid, this.service, this.column);
61
+ }
62
+ }
63
+ ColumnMenuAutoSizeColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ColumnMenuAutoSizeColumnComponent, deps: [{ token: i1.LocalizationService }, { token: i2.ContextService }], target: i0.ɵɵFactoryTarget.Component });
64
+ ColumnMenuAutoSizeColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ColumnMenuAutoSizeColumnComponent, selector: "kendo-grid-columnmenu-autosize-column", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: `
65
+ <kendo-grid-columnmenu-item
66
+ *ngIf="!this.ctx.grid.virtualColumns"
67
+ class="k-grid-columnmenu-autosize-column"
68
+ [text]="localization.get('autosizeThisColumn')"
69
+ icon="max-width"
70
+ (itemClick)="autoSizeColumn()"
71
+ >
72
+ </kendo-grid-columnmenu-item>
73
+ `, isInline: true, components: [{ type: i3.ColumnMenuItemComponent, selector: "kendo-grid-columnmenu-item", inputs: ["icon", "text", "selected", "disabled", "expanded"], outputs: ["itemClick", "expand", "collapse"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
74
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ColumnMenuAutoSizeColumnComponent, decorators: [{
75
+ type: Component,
76
+ args: [{
77
+ selector: 'kendo-grid-columnmenu-autosize-column',
78
+ template: `
79
+ <kendo-grid-columnmenu-item
80
+ *ngIf="!this.ctx.grid.virtualColumns"
81
+ class="k-grid-columnmenu-autosize-column"
82
+ [text]="localization.get('autosizeThisColumn')"
83
+ icon="max-width"
84
+ (itemClick)="autoSizeColumn()"
85
+ >
86
+ </kendo-grid-columnmenu-item>
87
+ `
88
+ }]
89
+ }], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.ContextService }]; }, propDecorators: { column: [{
90
+ type: Input
91
+ }] } });
@@ -18,7 +18,6 @@ import * as i5 from "./column-menu-item-content-template.directive";
18
18
  * > the template to the service input of the `kendo-grid-columnmenu-chooser` component.
19
19
  *
20
20
  * @example
21
- * {% meta height:300 %}
22
21
  * ```ts-preview
23
22
  *
24
23
  * _@Component({
@@ -40,7 +39,6 @@ import * as i5 from "./column-menu-item-content-template.directive";
40
39
  * }
41
40
  *
42
41
  * ```
43
- * {% endmeta %}
44
42
  */
45
43
  export class ColumnMenuChooserComponent extends ColumnMenuItemBase {
46
44
  constructor(localization, columnInfoService, changeDetector, hostElement) {
@@ -3,35 +3,40 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { MenuTabbingService } from './../filtering/menu/menu-tabbing.service';
6
- import { Component, Input, TemplateRef, HostBinding, ViewChild } from '@angular/core';
6
+ import { Component, Input, TemplateRef, HostBinding, ViewChild, isDevMode } from '@angular/core';
7
7
  import { ColumnMenuService } from './column-menu.service';
8
8
  import { filtersByField } from '../filtering/base-filter-cell.component';
9
- import { hasFilter, hasSort, hasLock, hasStick, hasColumnChooser, hasPosition } from './utils';
9
+ import { hasFilter, hasSort, hasLock, hasStick, hasColumnChooser, hasAutoSizeColumn, hasPosition, hasAutoSizeAllColumns } from './utils';
10
10
  import { replaceMessagePlaceholder } from '../utils';
11
+ import { ColunnMenuErrorMessages } from '../common/error-messages';
11
12
  import * as i0 from "@angular/core";
12
- import * as i1 from "../common/single-popup.service";
13
- import * as i2 from "@progress/kendo-angular-l10n";
14
- import * as i3 from "./column-menu.service";
15
- import * as i4 from "./../navigation/navigation.service";
16
- import * as i5 from "./column-menu-container.component";
17
- import * as i6 from "./column-menu-sort.component";
18
- import * as i7 from "./column-menu-lock.component";
19
- import * as i8 from "./column-menu-stick.component";
20
- import * as i9 from "./column-menu-position.component";
21
- import * as i10 from "./column-menu-chooser.component";
22
- import * as i11 from "./column-menu-filter.component";
23
- import * as i12 from "@angular/common";
24
- import * as i13 from "./column-menu-item.directive";
13
+ import * as i1 from "./../navigation/navigation.service";
14
+ import * as i2 from "../common/single-popup.service";
15
+ import * as i3 from "@progress/kendo-angular-l10n";
16
+ import * as i4 from "./column-menu.service";
17
+ import * as i5 from "../common/provider.service";
18
+ import * as i6 from "./column-menu-container.component";
19
+ import * as i7 from "./column-menu-sort.component";
20
+ import * as i8 from "./column-menu-lock.component";
21
+ import * as i9 from "./column-menu-stick.component";
22
+ import * as i10 from "./column-menu-position.component";
23
+ import * as i11 from "./column-menu-chooser.component";
24
+ import * as i12 from "./column-menu-autosize.component";
25
+ import * as i13 from "./column-menu-autosize-all.component";
26
+ import * as i14 from "./column-menu-filter.component";
27
+ import * as i15 from "@angular/common";
28
+ import * as i16 from "./column-menu-item.directive";
25
29
  const POPUP_CLASS = 'k-grid-columnmenu-popup';
26
30
  /**
27
31
  * Represents the [column menu]({% slug columnmenu_grid %}) component.
28
32
  */
29
33
  export class ColumnMenuComponent {
30
- constructor(popupService, localization, service, navigationService) {
34
+ constructor(navigationService, popupService, localization, service, ctx) {
35
+ this.navigationService = navigationService;
31
36
  this.popupService = popupService;
32
37
  this.localization = localization;
33
38
  this.service = service;
34
- this.navigationService = navigationService;
39
+ this.ctx = ctx;
35
40
  /**
36
41
  * @hidden
37
42
  */
@@ -87,6 +92,18 @@ export class ColumnMenuComponent {
87
92
  get hasColumnChooser() {
88
93
  return hasColumnChooser(this.settings);
89
94
  }
95
+ /**
96
+ * @hidden
97
+ */
98
+ get hasAutoSizeColumn() {
99
+ return hasAutoSizeColumn(this.settings);
100
+ }
101
+ /**
102
+ * @hidden
103
+ */
104
+ get hasAutoSizeAllColumns() {
105
+ return hasAutoSizeAllColumns(this.settings);
106
+ }
90
107
  /**
91
108
  * @hidden
92
109
  */
@@ -105,6 +122,18 @@ export class ColumnMenuComponent {
105
122
  get hasPosition() {
106
123
  return hasPosition(this.settings, this.column);
107
124
  }
125
+ ngAfterViewInit() {
126
+ if (this.ctx.grid.virtualColumns && isDevMode()) {
127
+ if (this.settings.autoSizeAllColumns) {
128
+ this.settings.autoSizeAllColumns = false;
129
+ console.warn(ColunnMenuErrorMessages.autoSizeAllColumns);
130
+ }
131
+ if (this.settings.autoSizeColumn) {
132
+ this.settings.autoSizeColumn = false;
133
+ console.warn(ColunnMenuErrorMessages.autoSizeColumn);
134
+ }
135
+ }
136
+ }
108
137
  ngOnChanges() {
109
138
  this.service.column = this.column;
110
139
  this.service.sort = this.sort;
@@ -161,7 +190,7 @@ export class ColumnMenuComponent {
161
190
  return typeof (menuItemSettings) === 'object' ? menuItemSettings.expanded : false;
162
191
  }
163
192
  }
164
- ColumnMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ColumnMenuComponent, deps: [{ token: i1.SinglePopupService }, { token: i2.LocalizationService }, { token: i3.ColumnMenuService }, { token: i4.NavigationService }], target: i0.ɵɵFactoryTarget.Component });
193
+ ColumnMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ColumnMenuComponent, deps: [{ token: i1.NavigationService }, { token: i2.SinglePopupService }, { token: i3.LocalizationService }, { token: i4.ColumnMenuService }, { token: i5.ContextService }], target: i0.ɵɵFactoryTarget.Component });
165
194
  ColumnMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ColumnMenuComponent, selector: "kendo-grid-column-menu", inputs: { standalone: "standalone", column: "column", settings: "settings", sort: "sort", filter: "filter", sortable: "sortable", columnMenuTemplate: "columnMenuTemplate", tabIndex: "tabIndex" }, host: { properties: { "class.k-grid-column-menu-standalone": "this.standalone" } }, providers: [
166
195
  ColumnMenuService,
167
196
  MenuTabbingService
@@ -201,6 +230,7 @@ ColumnMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
201
230
  [service]="service"
202
231
  [expanded]="expandedPosition">
203
232
  </kendo-grid-columnmenu-position>
233
+ <span [style.borderColor]="'rgba(0, 0, 0, 0.08)'" *ngIf="hasColumnChooser || hasAutoSizeColumn || hasAutoSizeAllColumns" class="k-separator"></span>
204
234
  <kendo-grid-columnmenu-chooser
205
235
  #chooserItem
206
236
  *ngIf="hasColumnChooser"
@@ -208,6 +238,23 @@ ColumnMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
208
238
  [service]="service"
209
239
  [expanded]="expandedColumns">
210
240
  </kendo-grid-columnmenu-chooser>
241
+ <kendo-grid-columnmenu-autosize-column
242
+ #autoSizeColumnItem
243
+ *ngIf="hasAutoSizeColumn"
244
+ [service]="service"
245
+ [kendoGridColumnMenuItem]="autoSizeColumnItem"
246
+ [column]="column"
247
+ >
248
+ </kendo-grid-columnmenu-autosize-column>
249
+
250
+ <kendo-grid-columnmenu-autosize-all-columns
251
+ #autoSizeAllColumnsItem
252
+ *ngIf="hasAutoSizeAllColumns"
253
+ [service]="service"
254
+ [kendoGridColumnMenuItem]="autoSizeAllColumnsItem"
255
+ >
256
+ </kendo-grid-columnmenu-autosize-all-columns>
257
+ <span [style.borderColor]="'rgba(0, 0, 0, 0.08)'" *ngIf="hasColumnChooser || hasAutoSizeColumn || hasAutoSizeAllColumns" class="k-separator"></span>
211
258
  <kendo-grid-columnmenu-filter
212
259
  #filterItem
213
260
  *ngIf="hasFilter"
@@ -217,7 +264,7 @@ ColumnMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
217
264
  </kendo-grid-columnmenu-filter>
218
265
  </kendo-grid-columnmenu-container>
219
266
  </ng-template>
220
- `, isInline: true, components: [{ type: i5.ColumnMenuContainerComponent, selector: "kendo-grid-columnmenu-container" }, { type: i6.ColumnMenuSortComponent, selector: "kendo-grid-columnmenu-sort" }, { type: i7.ColumnMenuLockComponent, selector: "kendo-grid-columnmenu-lock" }, { type: i8.ColumnMenuStickComponent, selector: "kendo-grid-columnmenu-stick" }, { type: i9.ColumnMenuPositionComponent, selector: "kendo-grid-columnmenu-position", inputs: ["expanded", "showLock", "showStick", "isLast"], outputs: ["expand", "collapse"] }, { type: i10.ColumnMenuChooserComponent, selector: "kendo-grid-columnmenu-chooser", inputs: ["expanded", "isLast"], outputs: ["expand", "collapse"] }, { type: i11.ColumnMenuFilterComponent, selector: "kendo-grid-columnmenu-filter", inputs: ["expanded", "isLast"], outputs: ["expand", "collapse"] }], directives: [{ type: i12.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i12.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i12.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i13.ColumnMenuItemDirective, selector: "[kendoGridColumnMenuItem]", inputs: ["kendoGridColumnMenuItem"] }] });
267
+ `, isInline: true, components: [{ type: i6.ColumnMenuContainerComponent, selector: "kendo-grid-columnmenu-container" }, { type: i7.ColumnMenuSortComponent, selector: "kendo-grid-columnmenu-sort" }, { type: i8.ColumnMenuLockComponent, selector: "kendo-grid-columnmenu-lock" }, { type: i9.ColumnMenuStickComponent, selector: "kendo-grid-columnmenu-stick" }, { type: i10.ColumnMenuPositionComponent, selector: "kendo-grid-columnmenu-position", inputs: ["expanded", "showLock", "showStick", "isLast"], outputs: ["expand", "collapse"] }, { type: i11.ColumnMenuChooserComponent, selector: "kendo-grid-columnmenu-chooser", inputs: ["expanded", "isLast"], outputs: ["expand", "collapse"] }, { type: i12.ColumnMenuAutoSizeColumnComponent, selector: "kendo-grid-columnmenu-autosize-column", inputs: ["column"] }, { type: i13.ColumnMenuAutoSizeAllColumnsComponent, selector: "kendo-grid-columnmenu-autosize-all-columns" }, { type: i14.ColumnMenuFilterComponent, selector: "kendo-grid-columnmenu-filter", inputs: ["expanded", "isLast"], outputs: ["expand", "collapse"] }], directives: [{ type: i15.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i15.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i15.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i16.ColumnMenuItemDirective, selector: "[kendoGridColumnMenuItem]", inputs: ["kendoGridColumnMenuItem"] }] });
221
268
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ColumnMenuComponent, decorators: [{
222
269
  type: Component,
223
270
  args: [{
@@ -262,6 +309,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
262
309
  [service]="service"
263
310
  [expanded]="expandedPosition">
264
311
  </kendo-grid-columnmenu-position>
312
+ <span [style.borderColor]="'rgba(0, 0, 0, 0.08)'" *ngIf="hasColumnChooser || hasAutoSizeColumn || hasAutoSizeAllColumns" class="k-separator"></span>
265
313
  <kendo-grid-columnmenu-chooser
266
314
  #chooserItem
267
315
  *ngIf="hasColumnChooser"
@@ -269,6 +317,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
269
317
  [service]="service"
270
318
  [expanded]="expandedColumns">
271
319
  </kendo-grid-columnmenu-chooser>
320
+ <kendo-grid-columnmenu-autosize-column
321
+ #autoSizeColumnItem
322
+ *ngIf="hasAutoSizeColumn"
323
+ [service]="service"
324
+ [kendoGridColumnMenuItem]="autoSizeColumnItem"
325
+ [column]="column"
326
+ >
327
+ </kendo-grid-columnmenu-autosize-column>
328
+
329
+ <kendo-grid-columnmenu-autosize-all-columns
330
+ #autoSizeAllColumnsItem
331
+ *ngIf="hasAutoSizeAllColumns"
332
+ [service]="service"
333
+ [kendoGridColumnMenuItem]="autoSizeAllColumnsItem"
334
+ >
335
+ </kendo-grid-columnmenu-autosize-all-columns>
336
+ <span [style.borderColor]="'rgba(0, 0, 0, 0.08)'" *ngIf="hasColumnChooser || hasAutoSizeColumn || hasAutoSizeAllColumns" class="k-separator"></span>
272
337
  <kendo-grid-columnmenu-filter
273
338
  #filterItem
274
339
  *ngIf="hasFilter"
@@ -280,7 +345,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
280
345
  </ng-template>
281
346
  `
282
347
  }]
283
- }], ctorParameters: function () { return [{ type: i1.SinglePopupService }, { type: i2.LocalizationService }, { type: i3.ColumnMenuService }, { type: i4.NavigationService }]; }, propDecorators: { standalone: [{
348
+ }], ctorParameters: function () { return [{ type: i1.NavigationService }, { type: i2.SinglePopupService }, { type: i3.LocalizationService }, { type: i4.ColumnMenuService }, { type: i5.ContextService }]; }, propDecorators: { standalone: [{
284
349
  type: HostBinding,
285
350
  args: ['class.k-grid-column-menu-standalone']
286
351
  }, {