@progress/kendo-angular-grid 14.4.0-develop.17 → 14.4.0-develop.19

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.
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Represents the starting point (Grid cell) of the Grid clipboard operations.
7
7
  */
8
- export declare type GridClipboardTargetType = 'selectionStart' | 'activeCell';
8
+ export declare type GridClipboardTargetType = 'selection' | 'activeCell';
9
9
  /**
10
10
  * The possible values of the Grid [`GridClipboardEvent`]({% slug api_grid_gridclipboardevent %}) `type` property.
11
11
  */
@@ -2,7 +2,7 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { AfterViewInit, EventEmitter, NgZone, OnChanges, OnDestroy, Renderer2, SimpleChanges } from '@angular/core';
5
+ import { AfterViewInit, EventEmitter, NgZone, OnDestroy, Renderer2 } from '@angular/core';
6
6
  import { ClipboardService } from './clipboard.service';
7
7
  import { GridComponent } from '../grid.component';
8
8
  import { GridClipboardTargetType, GridClipboardEvent, GridClipboardSettings } from './clipboard-types';
@@ -11,20 +11,17 @@ import * as i0 from "@angular/core";
11
11
  * The directive that enables the Grid built-in clipboard support. Allows copy, cut, and paste interactions
12
12
  * with the Grid.
13
13
  */
14
- export declare class GridClipboardDirective implements OnChanges, AfterViewInit, OnDestroy {
14
+ export declare class GridClipboardDirective implements AfterViewInit, OnDestroy {
15
15
  private host;
16
16
  private clipboardService;
17
17
  private renderer;
18
18
  private zone;
19
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.
20
+ * Determines the target of the clipboard operation ([see example]({% slug clipboard_grid %}#toc-clipboard-target)). The possible options are:
21
+ * - `activeCell`
22
+ * - `selection`
25
23
  *
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.
24
+ * @default 'selection'
28
25
  */
29
26
  set clipboardTarget(value: GridClipboardTargetType);
30
27
  get clipboardTarget(): GridClipboardTargetType;
@@ -44,7 +41,6 @@ export declare class GridClipboardDirective implements OnChanges, AfterViewInit,
44
41
  private subs;
45
42
  constructor(host: GridComponent, clipboardService: ClipboardService, renderer: Renderer2, zone: NgZone);
46
43
  ngAfterViewInit(): void;
47
- ngOnChanges(changes: SimpleChanges): void;
48
44
  ngOnDestroy(): void;
49
45
  private onClipboard;
50
46
  private inGrid;
@@ -9,7 +9,7 @@ import { hasObservers, isDocumentAvailable } from '@progress/kendo-angular-commo
9
9
  import { Subscription } from 'rxjs';
10
10
  import { take } from 'rxjs/operators';
11
11
  import { closest, contains } from '../rendering/common/dom-queries';
12
- import { isPresent, recursiveFlatMap } from '../utils';
12
+ import { recursiveFlatMap } from '../utils';
13
13
  import { ClipboardErrorMessages } from './error-messages';
14
14
  import * as i0 from "@angular/core";
15
15
  import * as i1 from "../grid.component";
@@ -28,6 +28,7 @@ export class GridClipboardDirective {
28
28
  * Fires when the user performs `cut`, `copy` or `paste` action within the Grid content area.
29
29
  */
30
30
  this.clipboard = new EventEmitter();
31
+ this._target = 'selection';
31
32
  this._clipboardSettings = {
32
33
  wholeRow: false,
33
34
  copyHeaders: false,
@@ -37,7 +38,7 @@ export class GridClipboardDirective {
37
38
  };
38
39
  this.subs = new Subscription();
39
40
  this.onClipboard = (operationType, args) => {
40
- if (!this.inGrid(args) || !this.clipboardSettings[operationType]) {
41
+ if (!this.clipboardSettings[operationType] || !this.inGrid(args)) {
41
42
  return;
42
43
  }
43
44
  const gridData = Array.isArray(this.host.data) ? this.host.data : this.host.data.data;
@@ -51,10 +52,10 @@ export class GridClipboardDirective {
51
52
  case 'activeCell':
52
53
  {
53
54
  const targetCell = { ...this.host.activeCell };
54
- clipboardData = targetCell && [{ dataItem: targetCell.dataItem, dataRowIndex: targetCell.dataRowIndex }];
55
+ clipboardData = targetCell && [{ dataItem: targetCell.dataItem, dataRowIndex: targetCell.dataRowIndex, colIndex: targetCell.colIndex }];
55
56
  }
56
57
  break;
57
- case 'selectionStart':
58
+ case 'selection':
58
59
  {
59
60
  const identifier = selectionDirective.selectionKey;
60
61
  clipboardData = gridDataItems.flatMap((item, index) => {
@@ -77,28 +78,31 @@ export class GridClipboardDirective {
77
78
  const data = isPaste ?
78
79
  {
79
80
  dataString: pastedData,
80
- gridItems: this.clipboardService.getGridData(pastedData, visibleCols, this.clipboardTarget, clipboardData[0].dataRowIndex, {
81
+ gridItems: this.clipboardService.getGridData(pastedData, visibleCols, this.clipboardTarget, clipboardData[0]?.dataRowIndex, {
81
82
  wholeRow: this.clipboardSettings.wholeRow,
82
83
  isCellSelection
83
84
  })
84
85
  } :
85
86
  this.clipboardService.createClipboardData(clipboardData || [], visibleCols, {
86
- wholeRow: this.clipboardSettings.wholeRow || !isCellSelection,
87
+ wholeRow: this.clipboardSettings.wholeRow || (this.clipboardTarget === 'selection' && !isCellSelection),
88
+ target: this.clipboardTarget,
87
89
  copyHeaders: this.clipboardSettings.copyHeaders,
88
90
  operationType
89
91
  });
90
92
  !isPaste && navigator.clipboard.writeText(data.dataString);
91
93
  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
- }
94
+ this.zone.run(() => {
95
+ this.clipboard.emit({
96
+ type: operationType,
97
+ originalEvent: args,
98
+ clipboardData: data.dataString,
99
+ gridData: data.gridItems,
100
+ target: {
101
+ dataRowIndex: this.clipboardService.targetRowIndex,
102
+ colField: this.clipboardService.targetColField,
103
+ dataItem: clipboardData.find(item => item.dataRowIndex === this.clipboardService.targetRowIndex)?.dataItem
104
+ }
105
+ });
102
106
  });
103
107
  }
104
108
  this.clipboardService.targetColField = this.clipboardService.targetRowIndex = null;
@@ -111,14 +115,11 @@ export class GridClipboardDirective {
111
115
  };
112
116
  }
113
117
  /**
114
- * Determines the target of the clipboard operation. The possible options are:
115
- * - `activeCell`—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`—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.
118
+ * Determines the target of the clipboard operation ([see example]({% slug clipboard_grid %}#toc-clipboard-target)). The possible options are:
119
+ * - `activeCell`
120
+ * - `selection`
119
121
  *
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
+ * @default 'selection'
122
123
  */
123
124
  set clipboardTarget(value) {
124
125
  if (isDevMode()) {
@@ -126,11 +127,8 @@ export class GridClipboardDirective {
126
127
  if (value === 'activeCell' && !(this.host.navigable.length)) {
127
128
  console.warn(ClipboardErrorMessages.clipboardTarget.activeCellNavigable);
128
129
  }
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);
130
+ else if (value === 'selection' && !(this.host.selectable || this.host.selectionDirective)) {
131
+ console.warn(ClipboardErrorMessages.selectionSelectable);
134
132
  }
135
133
  });
136
134
  }
@@ -154,26 +152,23 @@ export class GridClipboardDirective {
154
152
  if (!isDocumentAvailable()) {
155
153
  return;
156
154
  }
157
- if (isDevMode() && !isPresent(this.clipboardTarget)) {
158
- console.warn(ClipboardErrorMessages.clipboardTarget);
155
+ if (this.clipboardTarget === 'selection' && !(this.host.selectable || this.host.selectionDirective)) {
156
+ console.warn(ClipboardErrorMessages.selectionSelectable);
159
157
  }
160
158
  // needed due to the following issue in Chrome
161
159
  // 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
- }
160
+ this.zone.runOutsideAngular(() => {
161
+ this.subs.add(this.renderer.listen(document, 'copy', (args) => this.onClipboard('copy', args)));
162
+ this.subs.add(this.renderer.listen(document, 'cut', (args) => this.onClipboard('cut', args)));
163
+ this.subs.add(this.renderer.listen(document, 'paste', (args) => this.onClipboard('paste', args)));
164
+ });
170
165
  }
171
166
  ngOnDestroy() {
172
167
  this.subs.unsubscribe();
173
168
  }
174
169
  }
175
170
  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 });
171
+ 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"], ngImport: i0 });
177
172
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridClipboardDirective, decorators: [{
178
173
  type: Directive,
179
174
  args: [{
@@ -27,12 +27,12 @@ export class ClipboardService {
27
27
  gridItems: [],
28
28
  dataString: ''
29
29
  };
30
+ const fieldCols = columns.flatMap(c => c instanceof ColumnComponent && isPresent(c.field) ? [c] : []);
31
+ const clipboardData = { items: [], dataStrings: [] };
32
+ const colFields = fieldCols.map(c => c.field);
30
33
  if (options.wholeRow) {
31
- const fieldCols = columns.flatMap(c => c instanceof ColumnComponent && isPresent(c.field) ? [c] : []);
32
34
  this.targetColField = fieldCols[0]?.field;
33
35
  this.targetRowIndex = data[0].dataRowIndex;
34
- const clipboardData = { items: [], dataStrings: [] };
35
- const colFields = fieldCols.map(c => c.field);
36
36
  data.forEach(item => {
37
37
  clipboardData.items.push({ dataItem: { ...item.dataItem }, fields: colFields });
38
38
  clipboardData.dataStrings.push(this.itemToString(item.dataItem, fieldCols));
@@ -46,56 +46,83 @@ export class ClipboardService {
46
46
  };
47
47
  }
48
48
  else {
49
- const { tabular, groups } = this.groupSelection();
50
- const selectionDirective = this.contextService.grid.selectionDirective;
51
- const colIdentifier = selectionDirective.columnKey;
52
- if (tabular) {
53
- const selectionKeys = groups[0].items.map(item => item.columnKey);
54
- const selectedFieldCols = columns.flatMap((c, i) => (c instanceof ColumnComponent && c.field) && selectionKeys.find(k => typeof colIdentifier === 'function' ? k === colIdentifier(c, i) : k === i) ? [c] : []);
55
- const selectedColFields = selectedFieldCols.map(c => c.field);
56
- this.targetColField = selectedColFields[0];
57
- result.dataString = data.flatMap(item => {
58
- const itemString = this.itemToString(item.dataItem, selectedFieldCols);
59
- const existingItem = isPresent(itemString);
60
- if (!isPresent(this.targetRowIndex) && isPresent(itemString)) {
61
- this.targetRowIndex = item.dataRowIndex;
62
- }
63
- result.gridItems.push({
64
- dataItem: item.dataItem,
65
- fields: selectedColFields
66
- });
67
- return existingItem ? [itemString] : [];
68
- }).join(`\r\n`);
69
- if (options.copyHeaders) {
70
- result.dataString = this.addHeaders(result.dataString, selectedFieldCols);
71
- }
72
- }
73
- else { // split per row (uneven rows)
74
- const rowIdentifier = selectionDirective.selectionKey;
75
- result.dataString = data.flatMap(item => {
76
- // determine cols per item
77
- const key = rowIdentifier ?
78
- typeof rowIdentifier === 'string' ? item.dataItem[rowIdentifier] : rowIdentifier({ index: item.dataRowIndex, dataItem: item.dataItem }) :
79
- item.dataRowIndex;
80
- const selectionKeys = groups.find(gr => gr.value === key).items.map(item => item.columnKey);
49
+ if (options.target === 'selection') {
50
+ const { tabular, groups } = this.groupSelection();
51
+ const selectionDirective = this.contextService.grid.selectionDirective;
52
+ const colIdentifier = selectionDirective.columnKey;
53
+ if (tabular) {
54
+ const selectionKeys = groups[0].items.map(item => item.columnKey);
81
55
  const selectedFieldCols = columns.flatMap((c, i) => (c instanceof ColumnComponent && c.field) && selectionKeys.find(k => typeof colIdentifier === 'function' ? k === colIdentifier(c, i) : k === i) ? [c] : []);
82
56
  const selectedColFields = selectedFieldCols.map(c => c.field);
83
- if (!this.targetColField) {
84
- this.targetColField = selectedColFields[0];
85
- }
86
- const itemString = this.itemToString(item.dataItem, selectedFieldCols);
87
- const existingItem = isPresent(itemString);
88
- if (!isPresent(this.targetRowIndex) && existingItem) {
89
- this.targetRowIndex = item.dataRowIndex;
90
- }
91
- if (existingItem) {
57
+ this.targetColField = selectedColFields[0];
58
+ result.dataString = data.flatMap(item => {
59
+ const itemString = this.itemToString(item.dataItem, selectedFieldCols);
60
+ const existingItem = isPresent(itemString);
61
+ if (!isPresent(this.targetRowIndex) && isPresent(itemString)) {
62
+ this.targetRowIndex = item.dataRowIndex;
63
+ }
64
+ if (options.operationType === 'cut') {
65
+ selectedColFields.forEach(f => item.dataItem[f] = null);
66
+ }
92
67
  result.gridItems.push({
93
68
  dataItem: item.dataItem,
94
69
  fields: selectedColFields
95
70
  });
71
+ return existingItem ? [itemString] : [];
72
+ }).join(`\r\n`);
73
+ if (options.copyHeaders) {
74
+ result.dataString = this.addHeaders(result.dataString, selectedFieldCols);
96
75
  }
97
- return existingItem ? options.copyHeaders ? [this.addHeaders(itemString, selectedFieldCols)] : [itemString] : [];
98
- }).join(`\r\n`);
76
+ }
77
+ else { // split per row (uneven rows)
78
+ const rowIdentifier = selectionDirective.selectionKey;
79
+ result.dataString = data.flatMap(item => {
80
+ // determine cols per item
81
+ const key = rowIdentifier ?
82
+ typeof rowIdentifier === 'string' ? item.dataItem[rowIdentifier] : rowIdentifier({ index: item.dataRowIndex, dataItem: item.dataItem }) :
83
+ item.dataRowIndex;
84
+ const selectionKeys = groups.find(gr => gr.value === key).items.map(item => item.columnKey);
85
+ const selectedFieldCols = columns.flatMap((c, i) => (c instanceof ColumnComponent && c.field) && selectionKeys.find(k => typeof colIdentifier === 'function' ? k === colIdentifier(c, i) : k === i) ? [c] : []);
86
+ const selectedColFields = selectedFieldCols.map(c => c.field);
87
+ if (!this.targetColField) {
88
+ this.targetColField = selectedColFields[0];
89
+ }
90
+ const itemString = this.itemToString(item.dataItem, selectedFieldCols);
91
+ const existingItem = isPresent(itemString);
92
+ if (!isPresent(this.targetRowIndex) && existingItem) {
93
+ this.targetRowIndex = item.dataRowIndex;
94
+ }
95
+ if (existingItem) {
96
+ if (options.operationType === 'cut') {
97
+ selectedColFields.forEach(f => item.dataItem[f] = null);
98
+ }
99
+ result.gridItems.push({
100
+ dataItem: item.dataItem,
101
+ fields: selectedColFields
102
+ });
103
+ }
104
+ return existingItem ? options.copyHeaders ? [this.addHeaders(itemString, selectedFieldCols)] : [itemString] : [];
105
+ }).join(`\r\n`);
106
+ }
107
+ }
108
+ else {
109
+ const item = data[0];
110
+ const col = columns[item.colIndex];
111
+ const colField = col.field;
112
+ const title = col.title;
113
+ const copiedData = item.dataItem[colField];
114
+ this.targetRowIndex = item.dataRowIndex;
115
+ this.targetColField = colField;
116
+ if (options.operationType === 'cut' && colField) {
117
+ item.dataItem[colField] = null;
118
+ }
119
+ result = {
120
+ gridItems: [{
121
+ dataItem: item.dataItem,
122
+ fields: colField ? [colField] : []
123
+ }],
124
+ dataString: options.copyHeaders ? [title || colField, copiedData].join(`\r\n`) : colField ? copiedData : ``
125
+ };
99
126
  }
100
127
  }
101
128
  return result;
@@ -14,9 +14,8 @@ export const ColumnMenuErrorMessages = {
14
14
  * @hidden
15
15
  */
16
16
  export const ClipboardErrorMessages = {
17
- clipboardTarget: 'The "clipboardTarget" option must be set for the ClipboardDirective to function as designed.',
18
17
  activeCellNavigable: 'Grid must be navigable to use "activeCell" as clipboard target type.',
19
- selectionStartSelectable: 'Grid must be selectable to use "selectionStart" as clipboard target type.'
18
+ selectionSelectable: 'Grid must be selectable to use "selection" as clipboard target type.'
20
19
  };
21
20
  /**
22
21
  * @hidden
@@ -75,7 +75,7 @@ AutoCompleteFilterCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion:
75
75
  [value]="currentFilter?.value">
76
76
  </kendo-autocomplete>
77
77
  </kendo-grid-filter-wrapper-cell>
78
- `, isInline: true, components: [{ type: i5.FilterCellWrapperComponent, selector: "kendo-grid-filter-wrapper-cell", inputs: ["showOperators"] }, { type: i6.AutoCompleteComponent, selector: "kendo-autocomplete", inputs: ["highlightFirst", "showStickyHeader", "focusableId", "data", "value", "valueField", "placeholder", "adaptiveMode", "title", "subtitle", "popupSettings", "listHeight", "loading", "clearButton", "suggest", "disabled", "itemDisabled", "readonly", "tabindex", "tabIndex", "filterable", "virtual", "size", "rounded", "fillMode"], outputs: ["valueChange", "filterChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoAutoComplete"] }], directives: [{ type: i7.FilterInputDirective, selector: "[kendoFilterInput]", inputs: ["filterDelay", "columnLabel", "value"] }] });
78
+ `, isInline: true, components: [{ type: i5.FilterCellWrapperComponent, selector: "kendo-grid-filter-wrapper-cell", inputs: ["showOperators"] }, { type: i6.AutoCompleteComponent, selector: "kendo-autocomplete", inputs: ["highlightFirst", "showStickyHeader", "focusableId", "data", "value", "valueField", "placeholder", "adaptiveMode", "title", "subtitle", "popupSettings", "listHeight", "loading", "clearButton", "suggest", "disabled", "itemDisabled", "readonly", "tabindex", "tabIndex", "filterable", "virtual", "size", "rounded", "fillMode"], outputs: ["valueChange", "filterChange", "open", "opened", "close", "closed", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoAutoComplete"] }], directives: [{ type: i7.FilterInputDirective, selector: "[kendoFilterInput]", inputs: ["filterDelay", "columnLabel", "value"] }] });
79
79
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AutoCompleteFilterCellComponent, decorators: [{
80
80
  type: Component,
81
81
  args: [{
@@ -101,7 +101,7 @@ NumericFilterCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
101
101
  </kendo-numerictextbox-messages>
102
102
  </kendo-numerictextbox>
103
103
  </kendo-grid-filter-wrapper-cell>
104
- `, isInline: true, components: [{ type: i4.FilterCellWrapperComponent, selector: "kendo-grid-filter-wrapper-cell", inputs: ["showOperators"] }, { type: i5.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur"], exportAs: ["kendoNumericTextBox"] }, { type: i5.NumericTextBoxCustomMessagesComponent, selector: "kendo-numerictextbox-messages" }], directives: [{ type: i6.FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { type: i7.FilterInputDirective, selector: "[kendoFilterInput]", inputs: ["filterDelay", "columnLabel", "value"] }] });
104
+ `, isInline: true, components: [{ type: i4.FilterCellWrapperComponent, selector: "kendo-grid-filter-wrapper-cell", inputs: ["showOperators"] }, { type: i5.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }, { type: i5.NumericTextBoxCustomMessagesComponent, selector: "kendo-numerictextbox-messages" }], directives: [{ type: i6.FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { type: i7.FilterInputDirective, selector: "[kendoFilterInput]", inputs: ["filterDelay", "columnLabel", "value"] }] });
105
105
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: NumericFilterCellComponent, decorators: [{
106
106
  type: Component,
107
107
  args: [{
@@ -75,7 +75,7 @@ NumericFilterMenuInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion:
75
75
  </kendo-numerictextbox-messages>
76
76
  </kendo-numerictextbox>
77
77
  </kendo-grid-filter-menu-input-wrapper>
78
- `, isInline: true, components: [{ type: i2.FilterMenuInputWrapperComponent, selector: "kendo-grid-filter-menu-input-wrapper", inputs: ["filterService", "isFirstDropDown", "menuTabbingService", "currentFilter"] }, { type: i3.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur"], exportAs: ["kendoNumericTextBox"] }, { type: i3.NumericTextBoxCustomMessagesComponent, selector: "kendo-numerictextbox-messages" }], directives: [{ type: i4.FilterInputDirective, selector: "[kendoFilterInput]", inputs: ["filterDelay", "columnLabel", "value"] }] });
78
+ `, isInline: true, components: [{ type: i2.FilterMenuInputWrapperComponent, selector: "kendo-grid-filter-menu-input-wrapper", inputs: ["filterService", "isFirstDropDown", "menuTabbingService", "currentFilter"] }, { type: i3.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }, { type: i3.NumericTextBoxCustomMessagesComponent, selector: "kendo-numerictextbox-messages" }], directives: [{ type: i4.FilterInputDirective, selector: "[kendoFilterInput]", inputs: ["filterDelay", "columnLabel", "value"] }] });
79
79
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: NumericFilterMenuInputComponent, decorators: [{
80
80
  type: Component,
81
81
  args: [{
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-grid',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1706192885,
13
- version: '14.4.0-develop.17',
12
+ publishDate: 1706287616,
13
+ version: '14.4.0-develop.19',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
15
15
  };
@@ -105,7 +105,7 @@ PagerInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
105
105
  </kendo-numerictextbox>
106
106
  {{textFor('pagerOf')}} {{totalPages}}
107
107
  </span>
108
- `, isInline: true, components: [{ type: i4.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur"], exportAs: ["kendoNumericTextBox"] }], directives: [{ type: i5.PagerInputDirective, selector: "[kendoGridPagerInput]" }, { type: i6.FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { type: i7.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }] });
108
+ `, isInline: true, components: [{ type: i4.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }], directives: [{ type: i5.PagerInputDirective, selector: "[kendoGridPagerInput]" }, { type: i6.FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { type: i7.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }] });
109
109
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PagerInputComponent, decorators: [{
110
110
  type: Component,
111
111
  args: [{
@@ -235,7 +235,7 @@ CellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version:
235
235
  </ng-container>
236
236
  </ng-container>
237
237
  </ng-container>
238
- `, isInline: true, components: [{ type: i4.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { type: i5.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur"], exportAs: ["kendoNumericTextBox"] }, { type: i6.DatePickerComponent, selector: "kendo-datepicker", inputs: ["focusableId", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "navigationItemTemplate", "activeView", "bottomView", "topView", "calendarType", "animateCalendarNavigation", "disabled", "readonly", "readOnlyInput", "popupSettings", "navigation", "min", "max", "incompleteDateValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "enableMouseWheel", "allowCaretMode", "autoFill", "focusedDate", "value", "format", "twoDigitYearMax", "formatPlaceholder", "placeholder", "tabindex", "tabIndex", "disabledDates", "title", "subtitle", "rangeValidation", "disabledDatesValidation", "weekNumber", "size", "rounded", "fillMode", "adaptiveMode"], outputs: ["valueChange", "focus", "blur", "open", "close"], exportAs: ["kendo-datepicker"] }], directives: [{ type: i7.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { type: i9.SelectionCheckboxDirective, selector: "[kendoGridSelectionCheckbox]", inputs: ["kendoGridSelectionCheckbox"] }, { type: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i10.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i7.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }], pipes: { "valueOf": i11.FieldAccessorPipe } });
238
+ `, isInline: true, components: [{ type: i4.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { type: i5.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }, { type: i6.DatePickerComponent, selector: "kendo-datepicker", inputs: ["focusableId", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "navigationItemTemplate", "activeView", "bottomView", "topView", "calendarType", "animateCalendarNavigation", "disabled", "readonly", "readOnlyInput", "popupSettings", "navigation", "min", "max", "incompleteDateValidation", "autoCorrectParts", "autoSwitchParts", "autoSwitchKeys", "enableMouseWheel", "allowCaretMode", "autoFill", "focusedDate", "value", "format", "twoDigitYearMax", "formatPlaceholder", "placeholder", "tabindex", "tabIndex", "disabledDates", "title", "subtitle", "rangeValidation", "disabledDatesValidation", "weekNumber", "size", "rounded", "fillMode", "adaptiveMode"], outputs: ["valueChange", "focus", "blur", "open", "close"], exportAs: ["kendo-datepicker"] }], directives: [{ type: i7.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.FocusableDirective, selector: "[kendoGridFocusable],\n [kendoGridEditCommand],\n [kendoGridRemoveCommand],\n [kendoGridSaveCommand],\n [kendoGridCancelCommand],\n [kendoGridSelectionCheckbox]\n ", inputs: ["kendoGridFocusable"] }, { type: i9.SelectionCheckboxDirective, selector: "[kendoGridSelectionCheckbox]", inputs: ["kendoGridSelectionCheckbox"] }, { type: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i10.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i7.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }], pipes: { "valueOf": i11.FieldAccessorPipe } });
239
239
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CellComponent, decorators: [{
240
240
  type: Component,
241
241
  args: [{
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { DomEventsService } from './../common/dom-events.service';
6
- import { Directive, HostBinding } from '@angular/core';
6
+ import { Directive, ElementRef, Renderer2 } from '@angular/core';
7
7
  import { DraggableDirective, isDocumentAvailable, isPresent } from '@progress/kendo-angular-common';
8
8
  import { SelectionService } from './selection.service';
9
9
  import { CellSelectionService } from './cell-selection.service';
@@ -37,19 +37,15 @@ const offsets = {
37
37
  * @hidden
38
38
  */
39
39
  export class GridMarqueeDirective {
40
- constructor(draggable, selection, cellSelection, domEvents) {
40
+ constructor(draggable, selection, cellSelection, domEvents, host, renderer) {
41
41
  this.draggable = draggable;
42
42
  this.selection = selection;
43
43
  this.cellSelection = cellSelection;
44
44
  this.domEvents = domEvents;
45
+ this.host = host;
46
+ this.renderer = renderer;
45
47
  this.selectionStarted = false;
46
48
  }
47
- get webkitUserSelection() {
48
- return (this.cellSelection.enableMarquee || this.selection.enableMarquee) ? 'none' : null;
49
- }
50
- get userSelection() {
51
- return (this.cellSelection.enableMarquee || this.selection.enableMarquee);
52
- }
53
49
  ngOnInit() {
54
50
  this.subscriptions = (this.draggable.kendoPress.subscribe(this.start.bind(this)));
55
51
  this.subscriptions.add(this.draggable.kendoDrag.subscribe(this.moveMarquee.bind(this)));
@@ -80,6 +76,8 @@ export class GridMarqueeDirective {
80
76
  const distance = Math.sqrt((args.pageX - press.pageX) ** 2 + (args.pageY - press.pageY) ** 2);
81
77
  if (distance > MINIMAL_DRAG_DISTANCE) {
82
78
  this.selectionStarted = true;
79
+ this.renderer.addClass(this.host.nativeElement, 'user-select-none');
80
+ this.renderer.setStyle(this.host.nativeElement, 'user-select', 'none');
83
81
  this.dragEndSubscription = merge(this.domEvents.cellMouseup.pipe(take(1)), this.draggable.kendoRelease.pipe(delay(1), take(1)))
84
82
  .subscribe(this.endSelection.bind(this));
85
83
  }
@@ -124,6 +122,8 @@ export class GridMarqueeDirective {
124
122
  if (this.dragEndSubscription) {
125
123
  this.dragEndSubscription.unsubscribe();
126
124
  }
125
+ this.renderer.removeClass(this.host.nativeElement, 'user-select-none');
126
+ this.renderer.removeStyle(this.host.nativeElement, 'user-select');
127
127
  this.dragEndSubscription = null;
128
128
  this.pressTarget = null;
129
129
  this.pressArgs = null;
@@ -160,17 +160,11 @@ export class GridMarqueeDirective {
160
160
  return null;
161
161
  }
162
162
  }
163
- GridMarqueeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridMarqueeDirective, deps: [{ token: i1.DraggableDirective }, { token: i2.SelectionService }, { token: i3.CellSelectionService }, { token: i4.DomEventsService }], target: i0.ɵɵFactoryTarget.Directive });
164
- GridMarqueeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GridMarqueeDirective, selector: "[kendoGridSelectionMarquee]", host: { properties: { "style.-webkit-user-select": "this.webkitUserSelection", "class.user-select-none": "this.userSelection" } }, ngImport: i0 });
163
+ GridMarqueeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridMarqueeDirective, deps: [{ token: i1.DraggableDirective }, { token: i2.SelectionService }, { token: i3.CellSelectionService }, { token: i4.DomEventsService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
164
+ GridMarqueeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GridMarqueeDirective, selector: "[kendoGridSelectionMarquee]", ngImport: i0 });
165
165
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridMarqueeDirective, decorators: [{
166
166
  type: Directive,
167
167
  args: [{
168
168
  selector: '[kendoGridSelectionMarquee]'
169
169
  }]
170
- }], ctorParameters: function () { return [{ type: i1.DraggableDirective }, { type: i2.SelectionService }, { type: i3.CellSelectionService }, { type: i4.DomEventsService }]; }, propDecorators: { webkitUserSelection: [{
171
- type: HostBinding,
172
- args: ['style.-webkit-user-select']
173
- }], userSelection: [{
174
- type: HostBinding,
175
- args: ['class.user-select-none']
176
- }] } });
170
+ }], ctorParameters: function () { return [{ type: i1.DraggableDirective }, { type: i2.SelectionService }, { type: i3.CellSelectionService }, { type: i4.DomEventsService }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
package/esm2020/utils.mjs CHANGED
@@ -132,7 +132,7 @@ export const replaceMessagePlaceholder = (message, name, value) => message.repla
132
132
  /**
133
133
  * @hidden
134
134
  */
135
- export const recursiveFlatMap = (item) => isGroupResult(item) ? item.items.flatMap(recursiveFlatMap) : [item];
135
+ export const recursiveFlatMap = (item) => isGroupResult(item) ? item.items.flatMap(recursiveFlatMap) : [{ ...item }];
136
136
  /**
137
137
  * @hidden
138
138
  */