@progress/kendo-angular-grid 14.4.0-develop.18 → 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.
- package/common/clipboard-types.d.ts +1 -1
- package/common/clipboard.directive.d.ts +6 -10
- package/esm2020/common/clipboard.directive.mjs +34 -39
- package/esm2020/common/clipboard.service.mjs +73 -46
- package/esm2020/common/error-messages.mjs +1 -2
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/selection/marquee.directive.mjs +11 -17
- package/esm2020/utils.mjs +1 -1
- package/fesm2015/progress-kendo-angular-grid.mjs +121 -105
- package/fesm2020/progress-kendo-angular-grid.mjs +120 -105
- package/package.json +16 -16
- package/schematics/ngAdd/index.js +3 -3
- package/selection/marquee.directive.d.ts +4 -3
|
@@ -169,7 +169,7 @@ const replaceMessagePlaceholder = (message, name, value) => message.replace(new
|
|
|
169
169
|
/**
|
|
170
170
|
* @hidden
|
|
171
171
|
*/
|
|
172
|
-
const recursiveFlatMap = (item) => isGroupResult(item) ? item.items.flatMap(recursiveFlatMap) : [item];
|
|
172
|
+
const recursiveFlatMap = (item) => isGroupResult(item) ? item.items.flatMap(recursiveFlatMap) : [Object.assign({}, item)];
|
|
173
173
|
/**
|
|
174
174
|
* @hidden
|
|
175
175
|
*/
|
|
@@ -463,9 +463,8 @@ const ColumnMenuErrorMessages = {
|
|
|
463
463
|
* @hidden
|
|
464
464
|
*/
|
|
465
465
|
const ClipboardErrorMessages = {
|
|
466
|
-
clipboardTarget: 'The "clipboardTarget" option must be set for the ClipboardDirective to function as designed.',
|
|
467
466
|
activeCellNavigable: 'Grid must be navigable to use "activeCell" as clipboard target type.',
|
|
468
|
-
|
|
467
|
+
selectionSelectable: 'Grid must be selectable to use "selection" as clipboard target type.'
|
|
469
468
|
};
|
|
470
469
|
/**
|
|
471
470
|
* @hidden
|
|
@@ -4360,19 +4359,15 @@ const offsets = {
|
|
|
4360
4359
|
* @hidden
|
|
4361
4360
|
*/
|
|
4362
4361
|
class GridMarqueeDirective {
|
|
4363
|
-
constructor(draggable, selection, cellSelection, domEvents) {
|
|
4362
|
+
constructor(draggable, selection, cellSelection, domEvents, host, renderer) {
|
|
4364
4363
|
this.draggable = draggable;
|
|
4365
4364
|
this.selection = selection;
|
|
4366
4365
|
this.cellSelection = cellSelection;
|
|
4367
4366
|
this.domEvents = domEvents;
|
|
4367
|
+
this.host = host;
|
|
4368
|
+
this.renderer = renderer;
|
|
4368
4369
|
this.selectionStarted = false;
|
|
4369
4370
|
}
|
|
4370
|
-
get webkitUserSelection() {
|
|
4371
|
-
return (this.cellSelection.enableMarquee || this.selection.enableMarquee) ? 'none' : null;
|
|
4372
|
-
}
|
|
4373
|
-
get userSelection() {
|
|
4374
|
-
return (this.cellSelection.enableMarquee || this.selection.enableMarquee);
|
|
4375
|
-
}
|
|
4376
4371
|
ngOnInit() {
|
|
4377
4372
|
this.subscriptions = (this.draggable.kendoPress.subscribe(this.start.bind(this)));
|
|
4378
4373
|
this.subscriptions.add(this.draggable.kendoDrag.subscribe(this.moveMarquee.bind(this)));
|
|
@@ -4403,6 +4398,8 @@ class GridMarqueeDirective {
|
|
|
4403
4398
|
const distance = Math.sqrt(Math.pow((args.pageX - press.pageX), 2) + Math.pow((args.pageY - press.pageY), 2));
|
|
4404
4399
|
if (distance > MINIMAL_DRAG_DISTANCE) {
|
|
4405
4400
|
this.selectionStarted = true;
|
|
4401
|
+
this.renderer.addClass(this.host.nativeElement, 'user-select-none');
|
|
4402
|
+
this.renderer.setStyle(this.host.nativeElement, 'user-select', 'none');
|
|
4406
4403
|
this.dragEndSubscription = merge(this.domEvents.cellMouseup.pipe(take(1)), this.draggable.kendoRelease.pipe(delay(1), take(1)))
|
|
4407
4404
|
.subscribe(this.endSelection.bind(this));
|
|
4408
4405
|
}
|
|
@@ -4447,6 +4444,8 @@ class GridMarqueeDirective {
|
|
|
4447
4444
|
if (this.dragEndSubscription) {
|
|
4448
4445
|
this.dragEndSubscription.unsubscribe();
|
|
4449
4446
|
}
|
|
4447
|
+
this.renderer.removeClass(this.host.nativeElement, 'user-select-none');
|
|
4448
|
+
this.renderer.removeStyle(this.host.nativeElement, 'user-select');
|
|
4450
4449
|
this.dragEndSubscription = null;
|
|
4451
4450
|
this.pressTarget = null;
|
|
4452
4451
|
this.pressArgs = null;
|
|
@@ -4483,20 +4482,14 @@ class GridMarqueeDirective {
|
|
|
4483
4482
|
return null;
|
|
4484
4483
|
}
|
|
4485
4484
|
}
|
|
4486
|
-
GridMarqueeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridMarqueeDirective, deps: [{ token: i1$1.DraggableDirective }, { token: SelectionService }, { token: CellSelectionService }, { token: DomEventsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4487
|
-
GridMarqueeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GridMarqueeDirective, selector: "[kendoGridSelectionMarquee]",
|
|
4485
|
+
GridMarqueeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridMarqueeDirective, deps: [{ token: i1$1.DraggableDirective }, { token: SelectionService }, { token: CellSelectionService }, { token: DomEventsService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4486
|
+
GridMarqueeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GridMarqueeDirective, selector: "[kendoGridSelectionMarquee]", ngImport: i0 });
|
|
4488
4487
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridMarqueeDirective, decorators: [{
|
|
4489
4488
|
type: Directive,
|
|
4490
4489
|
args: [{
|
|
4491
4490
|
selector: '[kendoGridSelectionMarquee]'
|
|
4492
4491
|
}]
|
|
4493
|
-
}], ctorParameters: function () { return [{ type: i1$1.DraggableDirective }, { type: SelectionService }, { type: CellSelectionService }, { type: DomEventsService }
|
|
4494
|
-
type: HostBinding,
|
|
4495
|
-
args: ['style.-webkit-user-select']
|
|
4496
|
-
}], userSelection: [{
|
|
4497
|
-
type: HostBinding,
|
|
4498
|
-
args: ['class.user-select-none']
|
|
4499
|
-
}] } });
|
|
4492
|
+
}], ctorParameters: function () { return [{ type: i1$1.DraggableDirective }, { type: SelectionService }, { type: CellSelectionService }, { type: DomEventsService }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
|
|
4500
4493
|
|
|
4501
4494
|
/**
|
|
4502
4495
|
* @hidden
|
|
@@ -4539,8 +4532,8 @@ const packageMetadata = {
|
|
|
4539
4532
|
name: '@progress/kendo-angular-grid',
|
|
4540
4533
|
productName: 'Kendo UI for Angular',
|
|
4541
4534
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
4542
|
-
publishDate:
|
|
4543
|
-
version: '14.4.0-develop.
|
|
4535
|
+
publishDate: 1706287616,
|
|
4536
|
+
version: '14.4.0-develop.19',
|
|
4544
4537
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
4545
4538
|
};
|
|
4546
4539
|
|
|
@@ -6883,12 +6876,12 @@ class ClipboardService {
|
|
|
6883
6876
|
gridItems: [],
|
|
6884
6877
|
dataString: ''
|
|
6885
6878
|
};
|
|
6879
|
+
const fieldCols = columns.flatMap(c => c instanceof ColumnComponent && isPresent$1(c.field) ? [c] : []);
|
|
6880
|
+
const clipboardData = { items: [], dataStrings: [] };
|
|
6881
|
+
const colFields = fieldCols.map(c => c.field);
|
|
6886
6882
|
if (options.wholeRow) {
|
|
6887
|
-
const fieldCols = columns.flatMap(c => c instanceof ColumnComponent && isPresent$1(c.field) ? [c] : []);
|
|
6888
6883
|
this.targetColField = (_a = fieldCols[0]) === null || _a === void 0 ? void 0 : _a.field;
|
|
6889
6884
|
this.targetRowIndex = data[0].dataRowIndex;
|
|
6890
|
-
const clipboardData = { items: [], dataStrings: [] };
|
|
6891
|
-
const colFields = fieldCols.map(c => c.field);
|
|
6892
6885
|
data.forEach(item => {
|
|
6893
6886
|
clipboardData.items.push({ dataItem: Object.assign({}, item.dataItem), fields: colFields });
|
|
6894
6887
|
clipboardData.dataStrings.push(this.itemToString(item.dataItem, fieldCols));
|
|
@@ -6902,56 +6895,83 @@ class ClipboardService {
|
|
|
6902
6895
|
};
|
|
6903
6896
|
}
|
|
6904
6897
|
else {
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
const selectedColFields = selectedFieldCols.map(c => c.field);
|
|
6912
|
-
this.targetColField = selectedColFields[0];
|
|
6913
|
-
result.dataString = data.flatMap(item => {
|
|
6914
|
-
const itemString = this.itemToString(item.dataItem, selectedFieldCols);
|
|
6915
|
-
const existingItem = isPresent$1(itemString);
|
|
6916
|
-
if (!isPresent$1(this.targetRowIndex) && isPresent$1(itemString)) {
|
|
6917
|
-
this.targetRowIndex = item.dataRowIndex;
|
|
6918
|
-
}
|
|
6919
|
-
result.gridItems.push({
|
|
6920
|
-
dataItem: item.dataItem,
|
|
6921
|
-
fields: selectedColFields
|
|
6922
|
-
});
|
|
6923
|
-
return existingItem ? [itemString] : [];
|
|
6924
|
-
}).join(`\r\n`);
|
|
6925
|
-
if (options.copyHeaders) {
|
|
6926
|
-
result.dataString = this.addHeaders(result.dataString, selectedFieldCols);
|
|
6927
|
-
}
|
|
6928
|
-
}
|
|
6929
|
-
else { // split per row (uneven rows)
|
|
6930
|
-
const rowIdentifier = selectionDirective.selectionKey;
|
|
6931
|
-
result.dataString = data.flatMap(item => {
|
|
6932
|
-
// determine cols per item
|
|
6933
|
-
const key = rowIdentifier ?
|
|
6934
|
-
typeof rowIdentifier === 'string' ? item.dataItem[rowIdentifier] : rowIdentifier({ index: item.dataRowIndex, dataItem: item.dataItem }) :
|
|
6935
|
-
item.dataRowIndex;
|
|
6936
|
-
const selectionKeys = groups.find(gr => gr.value === key).items.map(item => item.columnKey);
|
|
6898
|
+
if (options.target === 'selection') {
|
|
6899
|
+
const { tabular, groups } = this.groupSelection();
|
|
6900
|
+
const selectionDirective = this.contextService.grid.selectionDirective;
|
|
6901
|
+
const colIdentifier = selectionDirective.columnKey;
|
|
6902
|
+
if (tabular) {
|
|
6903
|
+
const selectionKeys = groups[0].items.map(item => item.columnKey);
|
|
6937
6904
|
const selectedFieldCols = columns.flatMap((c, i) => (c instanceof ColumnComponent && c.field) && selectionKeys.find(k => typeof colIdentifier === 'function' ? k === colIdentifier(c, i) : k === i) ? [c] : []);
|
|
6938
6905
|
const selectedColFields = selectedFieldCols.map(c => c.field);
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6906
|
+
this.targetColField = selectedColFields[0];
|
|
6907
|
+
result.dataString = data.flatMap(item => {
|
|
6908
|
+
const itemString = this.itemToString(item.dataItem, selectedFieldCols);
|
|
6909
|
+
const existingItem = isPresent$1(itemString);
|
|
6910
|
+
if (!isPresent$1(this.targetRowIndex) && isPresent$1(itemString)) {
|
|
6911
|
+
this.targetRowIndex = item.dataRowIndex;
|
|
6912
|
+
}
|
|
6913
|
+
if (options.operationType === 'cut') {
|
|
6914
|
+
selectedColFields.forEach(f => item.dataItem[f] = null);
|
|
6915
|
+
}
|
|
6948
6916
|
result.gridItems.push({
|
|
6949
6917
|
dataItem: item.dataItem,
|
|
6950
6918
|
fields: selectedColFields
|
|
6951
6919
|
});
|
|
6920
|
+
return existingItem ? [itemString] : [];
|
|
6921
|
+
}).join(`\r\n`);
|
|
6922
|
+
if (options.copyHeaders) {
|
|
6923
|
+
result.dataString = this.addHeaders(result.dataString, selectedFieldCols);
|
|
6952
6924
|
}
|
|
6953
|
-
|
|
6954
|
-
|
|
6925
|
+
}
|
|
6926
|
+
else { // split per row (uneven rows)
|
|
6927
|
+
const rowIdentifier = selectionDirective.selectionKey;
|
|
6928
|
+
result.dataString = data.flatMap(item => {
|
|
6929
|
+
// determine cols per item
|
|
6930
|
+
const key = rowIdentifier ?
|
|
6931
|
+
typeof rowIdentifier === 'string' ? item.dataItem[rowIdentifier] : rowIdentifier({ index: item.dataRowIndex, dataItem: item.dataItem }) :
|
|
6932
|
+
item.dataRowIndex;
|
|
6933
|
+
const selectionKeys = groups.find(gr => gr.value === key).items.map(item => item.columnKey);
|
|
6934
|
+
const selectedFieldCols = columns.flatMap((c, i) => (c instanceof ColumnComponent && c.field) && selectionKeys.find(k => typeof colIdentifier === 'function' ? k === colIdentifier(c, i) : k === i) ? [c] : []);
|
|
6935
|
+
const selectedColFields = selectedFieldCols.map(c => c.field);
|
|
6936
|
+
if (!this.targetColField) {
|
|
6937
|
+
this.targetColField = selectedColFields[0];
|
|
6938
|
+
}
|
|
6939
|
+
const itemString = this.itemToString(item.dataItem, selectedFieldCols);
|
|
6940
|
+
const existingItem = isPresent$1(itemString);
|
|
6941
|
+
if (!isPresent$1(this.targetRowIndex) && existingItem) {
|
|
6942
|
+
this.targetRowIndex = item.dataRowIndex;
|
|
6943
|
+
}
|
|
6944
|
+
if (existingItem) {
|
|
6945
|
+
if (options.operationType === 'cut') {
|
|
6946
|
+
selectedColFields.forEach(f => item.dataItem[f] = null);
|
|
6947
|
+
}
|
|
6948
|
+
result.gridItems.push({
|
|
6949
|
+
dataItem: item.dataItem,
|
|
6950
|
+
fields: selectedColFields
|
|
6951
|
+
});
|
|
6952
|
+
}
|
|
6953
|
+
return existingItem ? options.copyHeaders ? [this.addHeaders(itemString, selectedFieldCols)] : [itemString] : [];
|
|
6954
|
+
}).join(`\r\n`);
|
|
6955
|
+
}
|
|
6956
|
+
}
|
|
6957
|
+
else {
|
|
6958
|
+
const item = data[0];
|
|
6959
|
+
const col = columns[item.colIndex];
|
|
6960
|
+
const colField = col.field;
|
|
6961
|
+
const title = col.title;
|
|
6962
|
+
const copiedData = item.dataItem[colField];
|
|
6963
|
+
this.targetRowIndex = item.dataRowIndex;
|
|
6964
|
+
this.targetColField = colField;
|
|
6965
|
+
if (options.operationType === 'cut' && colField) {
|
|
6966
|
+
item.dataItem[colField] = null;
|
|
6967
|
+
}
|
|
6968
|
+
result = {
|
|
6969
|
+
gridItems: [{
|
|
6970
|
+
dataItem: item.dataItem,
|
|
6971
|
+
fields: colField ? [colField] : []
|
|
6972
|
+
}],
|
|
6973
|
+
dataString: options.copyHeaders ? [title || colField, copiedData].join(`\r\n`) : colField ? copiedData : ``
|
|
6974
|
+
};
|
|
6955
6975
|
}
|
|
6956
6976
|
}
|
|
6957
6977
|
return result;
|
|
@@ -26700,6 +26720,7 @@ class GridClipboardDirective {
|
|
|
26700
26720
|
* Fires when the user performs `cut`, `copy` or `paste` action within the Grid content area.
|
|
26701
26721
|
*/
|
|
26702
26722
|
this.clipboard = new EventEmitter();
|
|
26723
|
+
this._target = 'selection';
|
|
26703
26724
|
this._clipboardSettings = {
|
|
26704
26725
|
wholeRow: false,
|
|
26705
26726
|
copyHeaders: false,
|
|
@@ -26710,7 +26731,7 @@ class GridClipboardDirective {
|
|
|
26710
26731
|
this.subs = new Subscription();
|
|
26711
26732
|
this.onClipboard = (operationType, args) => {
|
|
26712
26733
|
var _a, _b;
|
|
26713
|
-
if (!this.
|
|
26734
|
+
if (!this.clipboardSettings[operationType] || !this.inGrid(args)) {
|
|
26714
26735
|
return;
|
|
26715
26736
|
}
|
|
26716
26737
|
const gridData = Array.isArray(this.host.data) ? this.host.data : this.host.data.data;
|
|
@@ -26724,10 +26745,10 @@ class GridClipboardDirective {
|
|
|
26724
26745
|
case 'activeCell':
|
|
26725
26746
|
{
|
|
26726
26747
|
const targetCell = Object.assign({}, this.host.activeCell);
|
|
26727
|
-
clipboardData = targetCell && [{ dataItem: targetCell.dataItem, dataRowIndex: targetCell.dataRowIndex }];
|
|
26748
|
+
clipboardData = targetCell && [{ dataItem: targetCell.dataItem, dataRowIndex: targetCell.dataRowIndex, colIndex: targetCell.colIndex }];
|
|
26728
26749
|
}
|
|
26729
26750
|
break;
|
|
26730
|
-
case '
|
|
26751
|
+
case 'selection':
|
|
26731
26752
|
{
|
|
26732
26753
|
const identifier = selectionDirective.selectionKey;
|
|
26733
26754
|
clipboardData = gridDataItems.flatMap((item, index) => {
|
|
@@ -26750,28 +26771,32 @@ class GridClipboardDirective {
|
|
|
26750
26771
|
const data = isPaste ?
|
|
26751
26772
|
{
|
|
26752
26773
|
dataString: pastedData,
|
|
26753
|
-
gridItems: this.clipboardService.getGridData(pastedData, visibleCols, this.clipboardTarget, clipboardData[0].dataRowIndex, {
|
|
26774
|
+
gridItems: this.clipboardService.getGridData(pastedData, visibleCols, this.clipboardTarget, (_b = clipboardData[0]) === null || _b === void 0 ? void 0 : _b.dataRowIndex, {
|
|
26754
26775
|
wholeRow: this.clipboardSettings.wholeRow,
|
|
26755
26776
|
isCellSelection
|
|
26756
26777
|
})
|
|
26757
26778
|
} :
|
|
26758
26779
|
this.clipboardService.createClipboardData(clipboardData || [], visibleCols, {
|
|
26759
|
-
wholeRow: this.clipboardSettings.wholeRow || !isCellSelection,
|
|
26780
|
+
wholeRow: this.clipboardSettings.wholeRow || (this.clipboardTarget === 'selection' && !isCellSelection),
|
|
26781
|
+
target: this.clipboardTarget,
|
|
26760
26782
|
copyHeaders: this.clipboardSettings.copyHeaders,
|
|
26761
26783
|
operationType
|
|
26762
26784
|
});
|
|
26763
26785
|
!isPaste && navigator.clipboard.writeText(data.dataString);
|
|
26764
26786
|
if (hasObservers(this.clipboard)) {
|
|
26765
|
-
this.
|
|
26766
|
-
|
|
26767
|
-
|
|
26768
|
-
|
|
26769
|
-
|
|
26770
|
-
|
|
26771
|
-
|
|
26772
|
-
|
|
26773
|
-
|
|
26774
|
-
|
|
26787
|
+
this.zone.run(() => {
|
|
26788
|
+
var _a;
|
|
26789
|
+
this.clipboard.emit({
|
|
26790
|
+
type: operationType,
|
|
26791
|
+
originalEvent: args,
|
|
26792
|
+
clipboardData: data.dataString,
|
|
26793
|
+
gridData: data.gridItems,
|
|
26794
|
+
target: {
|
|
26795
|
+
dataRowIndex: this.clipboardService.targetRowIndex,
|
|
26796
|
+
colField: this.clipboardService.targetColField,
|
|
26797
|
+
dataItem: (_a = clipboardData.find(item => item.dataRowIndex === this.clipboardService.targetRowIndex)) === null || _a === void 0 ? void 0 : _a.dataItem
|
|
26798
|
+
}
|
|
26799
|
+
});
|
|
26775
26800
|
});
|
|
26776
26801
|
}
|
|
26777
26802
|
this.clipboardService.targetColField = this.clipboardService.targetRowIndex = null;
|
|
@@ -26784,14 +26809,11 @@ class GridClipboardDirective {
|
|
|
26784
26809
|
};
|
|
26785
26810
|
}
|
|
26786
26811
|
/**
|
|
26787
|
-
* Determines the target of the clipboard operation. The possible options are:
|
|
26788
|
-
* - `activeCell
|
|
26789
|
-
*
|
|
26790
|
-
* - `selectionStart`—The content of all selected cells or rows from the current page will be copied to the clipboard.
|
|
26791
|
-
* When pasting the first selected cell will be the pivotal point for pasted content.
|
|
26812
|
+
* Determines the target of the clipboard operation ([see example]({% slug clipboard_grid %}#toc-clipboard-target)). The possible options are:
|
|
26813
|
+
* - `activeCell`
|
|
26814
|
+
* - `selection`
|
|
26792
26815
|
*
|
|
26793
|
-
*
|
|
26794
|
-
* for the Clipboard directive to function as designed.
|
|
26816
|
+
* @default 'selection'
|
|
26795
26817
|
*/
|
|
26796
26818
|
set clipboardTarget(value) {
|
|
26797
26819
|
if (isDevMode()) {
|
|
@@ -26799,11 +26821,8 @@ class GridClipboardDirective {
|
|
|
26799
26821
|
if (value === 'activeCell' && !(this.host.navigable.length)) {
|
|
26800
26822
|
console.warn(ClipboardErrorMessages.clipboardTarget.activeCellNavigable);
|
|
26801
26823
|
}
|
|
26802
|
-
else if (value === '
|
|
26803
|
-
console.warn(ClipboardErrorMessages.
|
|
26804
|
-
}
|
|
26805
|
-
else if (!isPresent(value)) {
|
|
26806
|
-
console.warn(ClipboardErrorMessages.clipboardTarget);
|
|
26824
|
+
else if (value === 'selection' && !(this.host.selectable || this.host.selectionDirective)) {
|
|
26825
|
+
console.warn(ClipboardErrorMessages.selectionSelectable);
|
|
26807
26826
|
}
|
|
26808
26827
|
});
|
|
26809
26828
|
}
|
|
@@ -26827,26 +26846,23 @@ class GridClipboardDirective {
|
|
|
26827
26846
|
if (!isDocumentAvailable()) {
|
|
26828
26847
|
return;
|
|
26829
26848
|
}
|
|
26830
|
-
if (
|
|
26831
|
-
console.warn(ClipboardErrorMessages.
|
|
26849
|
+
if (this.clipboardTarget === 'selection' && !(this.host.selectable || this.host.selectionDirective)) {
|
|
26850
|
+
console.warn(ClipboardErrorMessages.selectionSelectable);
|
|
26832
26851
|
}
|
|
26833
26852
|
// needed due to the following issue in Chrome
|
|
26834
26853
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1156117&q=focus%20programmatically%20paste&can=2
|
|
26835
|
-
this.
|
|
26836
|
-
|
|
26837
|
-
|
|
26838
|
-
|
|
26839
|
-
|
|
26840
|
-
if (changes['clipboardTarget'] && isDevMode() && !isPresent(changes['clipboardTarget'].currentValue)) {
|
|
26841
|
-
console.warn(ClipboardErrorMessages.clipboardTarget);
|
|
26842
|
-
}
|
|
26854
|
+
this.zone.runOutsideAngular(() => {
|
|
26855
|
+
this.subs.add(this.renderer.listen(document, 'copy', (args) => this.onClipboard('copy', args)));
|
|
26856
|
+
this.subs.add(this.renderer.listen(document, 'cut', (args) => this.onClipboard('cut', args)));
|
|
26857
|
+
this.subs.add(this.renderer.listen(document, 'paste', (args) => this.onClipboard('paste', args)));
|
|
26858
|
+
});
|
|
26843
26859
|
}
|
|
26844
26860
|
ngOnDestroy() {
|
|
26845
26861
|
this.subs.unsubscribe();
|
|
26846
26862
|
}
|
|
26847
26863
|
}
|
|
26848
26864
|
GridClipboardDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridClipboardDirective, deps: [{ token: GridComponent }, { token: ClipboardService }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
26849
|
-
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"],
|
|
26865
|
+
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 });
|
|
26850
26866
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GridClipboardDirective, decorators: [{
|
|
26851
26867
|
type: Directive,
|
|
26852
26868
|
args: [{
|