@progress/kendo-angular-grid 14.4.0-develop.14 → 14.4.0-develop.15

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/common/clipboard-types.d.ts +102 -0
  2. package/common/clipboard.directive.d.ts +53 -0
  3. package/common/clipboard.service.d.ts +28 -0
  4. package/common/dom-events.service.d.ts +1 -0
  5. package/common/error-messages.d.ts +12 -0
  6. package/databinding.directive.d.ts +1 -1
  7. package/esm2020/column-menu/column-menu-item-base.mjs +2 -1
  8. package/esm2020/columns/column-base.mjs +3 -2
  9. package/esm2020/columns/column-group.component.mjs +2 -1
  10. package/esm2020/columns/span-column.component.mjs +2 -1
  11. package/esm2020/common/clipboard-types.mjs +5 -0
  12. package/esm2020/common/clipboard.directive.mjs +190 -0
  13. package/esm2020/common/clipboard.service.mjs +191 -0
  14. package/esm2020/common/dom-events.service.mjs +1 -0
  15. package/esm2020/common/error-messages.mjs +46 -1
  16. package/esm2020/databinding.directive.mjs +3 -2
  17. package/esm2020/editing-directives/local-edit.service.mjs +2 -2
  18. package/esm2020/excel/excel.service.mjs +2 -1
  19. package/esm2020/grid.component.mjs +40 -34
  20. package/esm2020/grid.module.mjs +8 -4
  21. package/esm2020/grouping/group-scroll-binding.directive.mjs +2 -3
  22. package/esm2020/index.mjs +2 -0
  23. package/esm2020/package-metadata.mjs +2 -2
  24. package/esm2020/pdf/pdf.component.mjs +3 -2
  25. package/esm2020/pdf/pdf.service.mjs +2 -1
  26. package/esm2020/rendering/details/detail-template.directive.mjs +2 -1
  27. package/esm2020/selection/selection-default.mjs +11 -5
  28. package/esm2020/utils.mjs +10 -0
  29. package/fesm2015/progress-kendo-angular-grid.mjs +498 -72
  30. package/fesm2020/progress-kendo-angular-grid.mjs +495 -72
  31. package/grid.component.d.ts +7 -1
  32. package/grid.module.d.ts +99 -98
  33. package/index.d.ts +3 -1
  34. package/package.json +16 -16
  35. package/schematics/ngAdd/index.js +3 -3
  36. package/selection/selection-default.d.ts +10 -4
  37. package/selection/types.d.ts +6 -0
  38. package/utils.d.ts +8 -0
@@ -0,0 +1,102 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2024 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 starting point (Grid cell) of the Grid clipboard operations.
7
+ */
8
+ export declare type GridClipboardTargetType = 'selectionStart' | 'activeCell';
9
+ /**
10
+ * The possible values of the Grid [`GridClipboardEvent`]({% slug api_grid_gridclipboardevent %}) `type` property.
11
+ */
12
+ export declare type GridClipboardEventType = 'copy' | 'cut' | 'paste';
13
+ /**
14
+ * The Grid data items and their respective fields, affected by the current clipboard operation.
15
+ */
16
+ export interface GridClipboardItem {
17
+ dataItem: any;
18
+ fields: string[];
19
+ }
20
+ /**
21
+ * The event data, exposed in the `GridClipboardDirective` `clipboard` event.
22
+ */
23
+ export interface GridClipboardEvent {
24
+ /**
25
+ * The type of the original clipboard event.
26
+ */
27
+ type: GridClipboardEventType;
28
+ /**
29
+ * The data of the original DOM event.
30
+ */
31
+ originalEvent: ClipboardEvent;
32
+ /**
33
+ * When the action is `copy` or `cut` - the Grid data, copied to the clipboard, in Excel-compatible format.
34
+ * When the action is `paste` - the current clipboard data, available in the original DOM event.
35
+ */
36
+ clipboardData: string;
37
+ /**
38
+ * The Grid data items and their respective fields, affected by the clipboard action.
39
+ */
40
+ gridData: GridClipboardItem[];
41
+ /**
42
+ * The Grid cell used as a target of the current clipboard operation.
43
+ */
44
+ target: GridClipboardTargetCell;
45
+ }
46
+ /**
47
+ *
48
+ */
49
+ export interface GridClipboardTargetCell {
50
+ /**
51
+ * The data index of the clipboard target cell parent row.
52
+ */
53
+ dataRowIndex: number;
54
+ /**
55
+ * The field of the Grid column the clipboard target cell is in.
56
+ */
57
+ colField: string;
58
+ /**
59
+ * The Grid data item corresponding to the clipboard target cell.
60
+ */
61
+ dataItem: any;
62
+ }
63
+ /**
64
+ * The `GridClipboardDirective` settings.
65
+ */
66
+ export interface GridClipboardSettings {
67
+ /**
68
+ * Determines whether the clipboard actions will affect the whole data row
69
+ * when it is either partially selected, or contains the active cell.
70
+ *
71
+ * Defaults to `false`.
72
+ */
73
+ wholeRow?: boolean;
74
+ /**
75
+ * Determines whether column titles or field names will be included in the generated data
76
+ * during the `copy` and `cut` actions.
77
+ *
78
+ * Defaults to `false`.
79
+ */
80
+ copyHeaders?: boolean;
81
+ /**
82
+ * Determines whether the `copy` operation will modify the Clipboard content
83
+ * and trigger the `clipboard` event.
84
+ *
85
+ * Defaults to `true`.
86
+ */
87
+ copy?: boolean;
88
+ /**
89
+ * Determines whether the `cut` operation will modify the Clipboard content
90
+ * and trigger the `clipboard` event.
91
+ *
92
+ * Defaults to `true`.
93
+ */
94
+ cut?: boolean;
95
+ /**
96
+ * Determines whether the `paste` operation will modify the Clipboard content
97
+ * and trigger the `clipboard` event.
98
+ *
99
+ * Defaults to `true`.
100
+ */
101
+ paste?: boolean;
102
+ }
@@ -0,0 +1,53 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { AfterViewInit, EventEmitter, NgZone, OnChanges, OnDestroy, Renderer2, SimpleChanges } from '@angular/core';
6
+ import { ClipboardService } from './clipboard.service';
7
+ import { GridComponent } from '../grid.component';
8
+ import { GridClipboardTargetType, GridClipboardEvent, GridClipboardSettings } from './clipboard-types';
9
+ import * as i0 from "@angular/core";
10
+ /**
11
+ * The directive that enables the Grid built-in clipboard support. Allows copy, cut, and paste interactions
12
+ * with the Grid.
13
+ */
14
+ export declare class GridClipboardDirective implements OnChanges, AfterViewInit, OnDestroy {
15
+ private host;
16
+ private clipboardService;
17
+ private renderer;
18
+ private zone;
19
+ /**
20
+ * Determines the target of the clipboard operation. The possible options are:
21
+ * - `activeCell`—Only the content of the current active cell or the row it is in will be copied to the clipboard.
22
+ * When pasting, the active cell will be the pivotal point for pasted content.
23
+ * - `selectionStart`—The content of all selected cells or rows from the current page will be copied to the clipboard.
24
+ * When pasting the first selected cell will be the pivotal point for pasted content.
25
+ *
26
+ * This option must be set, and the Grid keyboard navigation and/or selection functionalities must be enabled
27
+ * for the Clipboard directive to function as designed.
28
+ */
29
+ set clipboardTarget(value: GridClipboardTargetType);
30
+ get clipboardTarget(): GridClipboardTargetType;
31
+ /**
32
+ * The `GridClipboardDirective` settings.
33
+ *
34
+ * @default { wholeRow: false, copyHeaders: false copy: true, cut: true, paste: true }
35
+ */
36
+ set clipboardSettings(value: GridClipboardSettings);
37
+ get clipboardSettings(): GridClipboardSettings;
38
+ /**
39
+ * Fires when the user performs `cut`, `copy` or `paste` action within the Grid content area.
40
+ */
41
+ clipboard: EventEmitter<GridClipboardEvent>;
42
+ private _target;
43
+ private _clipboardSettings;
44
+ private subs;
45
+ constructor(host: GridComponent, clipboardService: ClipboardService, renderer: Renderer2, zone: NgZone);
46
+ ngAfterViewInit(): void;
47
+ ngOnChanges(changes: SimpleChanges): void;
48
+ ngOnDestroy(): void;
49
+ private onClipboard;
50
+ private inGrid;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<GridClipboardDirective, never>;
52
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GridClipboardDirective, "[kendoGridClipboard]", ["kendoGridClipboard"], { "clipboardTarget": "clipboardTarget"; "clipboardSettings": "clipboardSettings"; }, { "clipboard": "clipboard"; }, never>;
53
+ }
@@ -0,0 +1,28 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { ColumnBase } from '../columns/column-base';
6
+ import { ContextService } from './provider.service';
7
+ import { GridClipboardTargetType, GridClipboardItem } from './clipboard-types';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare class ClipboardService {
13
+ private contextService;
14
+ targetColField: string;
15
+ targetRowIndex: number;
16
+ constructor(contextService: ContextService);
17
+ createClipboardData(data: any[], columns: ColumnBase[], options: any): {
18
+ dataString: string;
19
+ gridItems: GridClipboardItem[];
20
+ };
21
+ getGridData(data: string, columns: ColumnBase[], targetType: GridClipboardTargetType, targetRowIndex: number, options: any): GridClipboardItem[];
22
+ private itemToString;
23
+ private groupSelection;
24
+ private areEqual;
25
+ private addHeaders;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardService, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<ClipboardService>;
28
+ }
@@ -17,6 +17,7 @@ export declare class DomEventsService {
17
17
  focusIn: EventEmitter<any>;
18
18
  focusOut: EventEmitter<any>;
19
19
  windowBlur: EventEmitter<any>;
20
+ paste: EventEmitter<any>;
20
21
  static ɵfac: i0.ɵɵFactoryDeclaration<DomEventsService, never>;
21
22
  static ɵprov: i0.ɵɵInjectableDeclaration<DomEventsService>;
22
23
  }
@@ -6,3 +6,15 @@
6
6
  * @hidden
7
7
  */
8
8
  export declare const ColumnMenuErrorMessages: any;
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare const ClipboardErrorMessages: any;
13
+ /**
14
+ * @hidden
15
+ */
16
+ export declare const ColumnConfigurationErrorMessages: any;
17
+ /**
18
+ * @hidden
19
+ */
20
+ export declare const GridConfigurationErrorMessages: any;
@@ -93,5 +93,5 @@ export declare class DataBindingDirective implements OnInit, OnDestroy, DoCheck,
93
93
  protected applyState({ skip, take, sort, group, filter }: State): void;
94
94
  protected updateGridData(): void;
95
95
  static ɵfac: i0.ɵɵFactoryDeclaration<DataBindingDirective, never>;
96
- static ɵdir: i0.ɵɵDirectiveDeclaration<DataBindingDirective, "[kendoGridBinding]", never, { "skip": "skip"; "sort": "sort"; "filter": "filter"; "pageSize": "pageSize"; "group": "group"; "data": "kendoGridBinding"; }, {}, never>;
96
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DataBindingDirective, "[kendoGridBinding]", ["kendoGridBinding"], { "skip": "skip"; "sort": "sort"; "filter": "filter"; "pageSize": "pageSize"; "group": "group"; "data": "kendoGridBinding"; }, {}, never>;
97
97
  }
@@ -4,6 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { Input, isDevMode, HostBinding, Component } from '@angular/core';
6
6
  import { ColumnMenuService } from './column-menu.service';
7
+ import { ColumnMenuErrorMessages } from '../common/error-messages';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
9
10
  * @hidden
@@ -14,7 +15,7 @@ export class ColumnMenuItemBase {
14
15
  }
15
16
  ngOnInit() {
16
17
  if (isDevMode() && !this.service) {
17
- throw new Error('The service input of the predefined column menu components is mandatory.');
18
+ throw new Error(ColumnMenuErrorMessages.serviceInput);
18
19
  }
19
20
  }
20
21
  /**
@@ -7,6 +7,7 @@ import { HeaderTemplateDirective } from '../rendering/header/header-template.dir
7
7
  import { FooterTemplateDirective } from '../rendering/footer/footer-template.directive';
8
8
  import { ColumnMenuTemplateDirective } from '../column-menu/column-menu-template.directive';
9
9
  import { IdService } from '../common/id.service';
10
+ import { ColumnConfigurationErrorMessages } from '../common/error-messages';
10
11
  import * as i0 from "@angular/core";
11
12
  import * as i1 from "../common/id.service";
12
13
  /**
@@ -102,7 +103,7 @@ export class ColumnBase {
102
103
  this.columnMenuTemplates = new QueryList();
103
104
  this.idService = idService;
104
105
  if (parent && idService && parent.idService.gridId() === idService.gridId() && !isColumnContainer(parent)) {
105
- throw new Error('Columns can be nested only inside ColumnGroupComponent');
106
+ throw new Error(ColumnConfigurationErrorMessages.columnNested);
106
107
  }
107
108
  }
108
109
  /**
@@ -124,7 +125,7 @@ export class ColumnBase {
124
125
  if (typeof value === 'string') {
125
126
  const parsedValue = this._width = parseInt(value, 10);
126
127
  if (isDevMode()) {
127
- console.warn(`Expected numeric value for column width, but got a string "${value}". Treating as ${parsedValue}px.`);
128
+ console.warn(ColumnConfigurationErrorMessages.width(value, parsedValue));
128
129
  }
129
130
  }
130
131
  else {
@@ -6,6 +6,7 @@ import { Component, forwardRef, SkipSelf, Host, Optional, QueryList, ContentChil
6
6
  import { IdService } from '../common/id.service';
7
7
  import { ColumnBase } from './column-base';
8
8
  import { columnsSpan } from './column-common';
9
+ import { ColumnConfigurationErrorMessages } from '../common/error-messages';
9
10
  import * as i0 from "@angular/core";
10
11
  import * as i1 from "./column-base";
11
12
  import * as i2 from "../common/id.service";
@@ -47,7 +48,7 @@ export class ColumnGroupComponent extends ColumnBase {
47
48
  */
48
49
  this.minResizableWidth = 10;
49
50
  if (parent && parent.isSpanColumn) {
50
- throw new Error('ColumnGroupComponent cannot be nested inside SpanColumnComponent');
51
+ throw new Error(ColumnConfigurationErrorMessages.nestedInside('ColumnGroupComponent', 'SpanColumnComponent'));
51
52
  }
52
53
  }
53
54
  /**
@@ -9,6 +9,7 @@ import { ColumnBase } from './column-base';
9
9
  import { ColumnComponent } from "./column.component";
10
10
  import { isPresent } from "../utils";
11
11
  import { IdService } from '../common/id.service';
12
+ import { ColumnConfigurationErrorMessages } from '../common/error-messages';
12
13
  import * as i0 from "@angular/core";
13
14
  import * as i1 from "./column-base";
14
15
  import * as i2 from "../common/id.service";
@@ -56,7 +57,7 @@ export class SpanColumnComponent extends ColumnBase {
56
57
  this.includeInChooser = false;
57
58
  this._editable = true;
58
59
  if (parent && parent.isSpanColumn) {
59
- throw new Error('SpanColumn cannot be nested inside another SpanColumn');
60
+ throw new Error(ColumnConfigurationErrorMessages.nestedInside('SpanColumnComponent', 'SpanColumnComponent'));
60
61
  }
61
62
  }
62
63
  /**
@@ -0,0 +1,5 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ export {};
@@ -0,0 +1,190 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2024 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, EventEmitter, Input, NgZone, Output, Renderer2, isDevMode } from '@angular/core';
6
+ import { ClipboardService } from './clipboard.service';
7
+ import { GridComponent } from '../grid.component';
8
+ import { hasObservers, isDocumentAvailable } from '@progress/kendo-angular-common';
9
+ import { Subscription } from 'rxjs';
10
+ import { take } from 'rxjs/operators';
11
+ import { closest, contains } from '../rendering/common/dom-queries';
12
+ import { isPresent, recursiveFlatMap } from '../utils';
13
+ import { ClipboardErrorMessages } from './error-messages';
14
+ import * as i0 from "@angular/core";
15
+ import * as i1 from "../grid.component";
16
+ import * as i2 from "./clipboard.service";
17
+ /**
18
+ * The directive that enables the Grid built-in clipboard support. Allows copy, cut, and paste interactions
19
+ * with the Grid.
20
+ */
21
+ export class GridClipboardDirective {
22
+ constructor(host, clipboardService, renderer, zone) {
23
+ this.host = host;
24
+ this.clipboardService = clipboardService;
25
+ this.renderer = renderer;
26
+ this.zone = zone;
27
+ /**
28
+ * Fires when the user performs `cut`, `copy` or `paste` action within the Grid content area.
29
+ */
30
+ this.clipboard = new EventEmitter();
31
+ this._clipboardSettings = {
32
+ wholeRow: false,
33
+ copyHeaders: false,
34
+ copy: true,
35
+ cut: true,
36
+ paste: true
37
+ };
38
+ this.subs = new Subscription();
39
+ this.onClipboard = (operationType, args) => {
40
+ if (!this.inGrid(args) || !this.clipboardSettings[operationType]) {
41
+ return;
42
+ }
43
+ const gridData = Array.isArray(this.host.data) ? this.host.data : this.host.data.data;
44
+ const gridDataItems = gridData.flatMap(recursiveFlatMap);
45
+ const selection = this.host.selection;
46
+ const selectionDirective = this.host.selectionDirective;
47
+ const targetType = this.clipboardTarget;
48
+ const isCellSelection = (this.host.selectable?.cell || selectionDirective.isCellSelectionMode);
49
+ let clipboardData = [];
50
+ switch (targetType) {
51
+ case 'activeCell':
52
+ {
53
+ const targetCell = { ...this.host.activeCell };
54
+ clipboardData = targetCell && [{ dataItem: targetCell.dataItem, dataRowIndex: targetCell.dataRowIndex }];
55
+ }
56
+ break;
57
+ case 'selectionStart':
58
+ {
59
+ const identifier = selectionDirective.selectionKey;
60
+ clipboardData = gridDataItems.flatMap((item, index) => {
61
+ if (identifier) {
62
+ const key = typeof identifier === 'string' ? item[identifier] : identifier({ index: index + this.host.skip, dataItem: item });
63
+ return isCellSelection ?
64
+ selection.some(s => s.itemKey === key) ? [{ dataItem: item, dataRowIndex: index + this.host.skip }] : [] :
65
+ selection.indexOf(key) > -1 ? [{ dataItem: item, dataRowIndex: index + this.host.skip }] : [];
66
+ }
67
+ return isCellSelection ?
68
+ selection.some(s => s.itemKey === index + this.host.skip) ? [{ dataItem: item, dataRowIndex: index + this.host.skip }] : [] :
69
+ selection.indexOf(index + this.host.skip) > -1 ? [{ dataItem: item, dataRowIndex: index + this.host.skip }] : [];
70
+ });
71
+ }
72
+ break;
73
+ }
74
+ const isPaste = operationType === 'paste';
75
+ const pastedData = args.clipboardData.getData('text').trim();
76
+ const visibleCols = this.host.columns.toArray().filter(c => c.isVisible);
77
+ const data = isPaste ?
78
+ {
79
+ dataString: pastedData,
80
+ gridItems: this.clipboardService.getGridData(pastedData, visibleCols, this.clipboardTarget, clipboardData[0].dataRowIndex, {
81
+ wholeRow: this.clipboardSettings.wholeRow,
82
+ isCellSelection
83
+ })
84
+ } :
85
+ this.clipboardService.createClipboardData(clipboardData || [], visibleCols, {
86
+ wholeRow: this.clipboardSettings.wholeRow || !isCellSelection,
87
+ copyHeaders: this.clipboardSettings.copyHeaders,
88
+ operationType
89
+ });
90
+ !isPaste && navigator.clipboard.writeText(data.dataString);
91
+ if (hasObservers(this.clipboard)) {
92
+ this.clipboard.emit({
93
+ type: operationType,
94
+ originalEvent: args,
95
+ clipboardData: data.dataString,
96
+ gridData: data.gridItems,
97
+ target: {
98
+ dataRowIndex: this.clipboardService.targetRowIndex,
99
+ colField: this.clipboardService.targetColField,
100
+ dataItem: clipboardData.find(item => item.dataRowIndex === this.clipboardService.targetRowIndex)?.dataItem
101
+ }
102
+ });
103
+ }
104
+ this.clipboardService.targetColField = this.clipboardService.targetRowIndex = null;
105
+ };
106
+ this.inGrid = (args) => {
107
+ const target = document.activeElement.matches('.k-table-td') ? document.activeElement : args.target;
108
+ const inContentArea = closest(target, node => node.parentElement?.classList.contains('k-grid-container'));
109
+ const inHost = contains(this.host.wrapper.nativeElement, target);
110
+ return target && inHost && inContentArea;
111
+ };
112
+ }
113
+ /**
114
+ * Determines the target of the clipboard operation. The possible options are:
115
+ * - `activeCell`&mdash;Only the content of the current active cell or the row it is in will be copied to the clipboard.
116
+ * When pasting, the active cell will be the pivotal point for pasted content.
117
+ * - `selectionStart`&mdash;The content of all selected cells or rows from the current page will be copied to the clipboard.
118
+ * When pasting the first selected cell will be the pivotal point for pasted content.
119
+ *
120
+ * This option must be set, and the Grid keyboard navigation and/or selection functionalities must be enabled
121
+ * for the Clipboard directive to function as designed.
122
+ */
123
+ set clipboardTarget(value) {
124
+ if (isDevMode()) {
125
+ this.zone.onStable.pipe(take(1)).subscribe(() => {
126
+ if (value === 'activeCell' && !(this.host.navigable.length)) {
127
+ console.warn(ClipboardErrorMessages.clipboardTarget.activeCellNavigable);
128
+ }
129
+ else if (value === 'selectionStart' && !(this.host.selectable || this.host.selectionDirective)) {
130
+ console.warn(ClipboardErrorMessages.selectionStartSelectable);
131
+ }
132
+ else if (!isPresent(value)) {
133
+ console.warn(ClipboardErrorMessages.clipboardTarget);
134
+ }
135
+ });
136
+ }
137
+ this._target = value;
138
+ }
139
+ get clipboardTarget() {
140
+ return this._target;
141
+ }
142
+ /**
143
+ * The `GridClipboardDirective` settings.
144
+ *
145
+ * @default { wholeRow: false, copyHeaders: false copy: true, cut: true, paste: true }
146
+ */
147
+ set clipboardSettings(value) {
148
+ this._clipboardSettings = Object.assign({}, this._clipboardSettings, value);
149
+ }
150
+ get clipboardSettings() {
151
+ return this._clipboardSettings;
152
+ }
153
+ ngAfterViewInit() {
154
+ if (!isDocumentAvailable()) {
155
+ return;
156
+ }
157
+ if (isDevMode() && !isPresent(this.clipboardTarget)) {
158
+ console.warn(ClipboardErrorMessages.clipboardTarget);
159
+ }
160
+ // needed due to the following issue in Chrome
161
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1156117&q=focus%20programmatically%20paste&can=2
162
+ this.subs.add(this.renderer.listen(document, 'copy', (args) => this.onClipboard('copy', args)));
163
+ this.subs.add(this.renderer.listen(document, 'cut', (args) => this.onClipboard('cut', args)));
164
+ this.subs.add(this.renderer.listen(document, 'paste', (args) => this.onClipboard('paste', args)));
165
+ }
166
+ ngOnChanges(changes) {
167
+ if (changes['clipboardTarget'] && isDevMode() && !isPresent(changes['clipboardTarget'].currentValue)) {
168
+ console.warn(ClipboardErrorMessages.clipboardTarget);
169
+ }
170
+ }
171
+ ngOnDestroy() {
172
+ this.subs.unsubscribe();
173
+ }
174
+ }
175
+ GridClipboardDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridClipboardDirective, deps: [{ token: i1.GridComponent }, { token: i2.ClipboardService }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
176
+ GridClipboardDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GridClipboardDirective, selector: "[kendoGridClipboard]", inputs: { clipboardTarget: "clipboardTarget", clipboardSettings: "clipboardSettings" }, outputs: { clipboard: "clipboard" }, providers: [ClipboardService], exportAs: ["kendoGridClipboard"], usesOnChanges: true, ngImport: i0 });
177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridClipboardDirective, decorators: [{
178
+ type: Directive,
179
+ args: [{
180
+ selector: '[kendoGridClipboard]',
181
+ exportAs: 'kendoGridClipboard',
182
+ providers: [ClipboardService]
183
+ }]
184
+ }], ctorParameters: function () { return [{ type: i1.GridComponent }, { type: i2.ClipboardService }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { clipboardTarget: [{
185
+ type: Input
186
+ }], clipboardSettings: [{
187
+ type: Input
188
+ }], clipboard: [{
189
+ type: Output
190
+ }] } });