@progress/kendo-spreadsheet-common 1.0.1 → 1.1.0-develop.1
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/dist/index-esm.js +82 -74
- package/dist/index.js +82 -74
- package/package.json +1 -1
package/dist/index-esm.js
CHANGED
|
@@ -11203,50 +11203,39 @@ class Controller {
|
|
|
11203
11203
|
return;
|
|
11204
11204
|
}
|
|
11205
11205
|
|
|
11206
|
-
//
|
|
11207
|
-
// this.colHeaderContextMenu.close();
|
|
11208
|
-
// this.rowHeaderContextMenu.close();
|
|
11209
|
-
// this.drawingContextMenu.close();
|
|
11206
|
+
// emit close here if necessary
|
|
11210
11207
|
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
// let object = this.objectAt(event);
|
|
11208
|
+
let object = this.objectAt(event);
|
|
11214
11209
|
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11210
|
+
if (object.type === "columnresizehandle" || object.type === "rowresizehandle") {
|
|
11211
|
+
return;
|
|
11212
|
+
}
|
|
11218
11213
|
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11214
|
+
if (object.ref) {
|
|
11215
|
+
this.navigator.selectForContextMenu(object.ref, SELECTION_MODES[object.type]);
|
|
11216
|
+
} else if (object.type == "drawing") {
|
|
11217
|
+
this.navigator.selectDrawingForContextMenu(object.drawing);
|
|
11218
|
+
}
|
|
11224
11219
|
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
// if (object.type == "columnheader") {
|
|
11230
|
-
// menu = this.colHeaderContextMenu;
|
|
11231
|
-
// showUnhide = !isComposite && this.axisManager.selectionIncludesHiddenColumns();
|
|
11232
|
-
// } else if (object.type == "rowheader") {
|
|
11233
|
-
// menu = this.rowHeaderContextMenu;
|
|
11234
|
-
// showUnhide = !isComposite && this.axisManager.selectionIncludesHiddenRows();
|
|
11235
|
-
// } else if (object.type == "drawing") {
|
|
11236
|
-
// menu = this.drawingContextMenu;
|
|
11237
|
-
// } else {
|
|
11238
|
-
// menu = this.cellContextMenu;
|
|
11239
|
-
// showUnmerge = this.navigator.selectionIncludesMergedCells();
|
|
11240
|
-
// }
|
|
11220
|
+
let isComposite = this.navigator._sheet.select() instanceof UnionRef;
|
|
11221
|
+
let showUnhide = false;
|
|
11222
|
+
let showUnmerge = false;
|
|
11241
11223
|
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11224
|
+
if (object.type == "columnheader") {
|
|
11225
|
+
showUnhide = !isComposite && this.axisManager.selectionIncludesHiddenColumns();
|
|
11226
|
+
} else if (object.type == "rowheader") {
|
|
11227
|
+
showUnhide = !isComposite && this.axisManager.selectionIncludesHiddenRows();
|
|
11228
|
+
} else if (object.type == "drawing") ; else {
|
|
11229
|
+
showUnmerge = this.navigator.selectionIncludesMergedCells();
|
|
11230
|
+
}
|
|
11245
11231
|
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11232
|
+
this._workbook.trigger("contextmenu", {
|
|
11233
|
+
objectRef: object.ref,
|
|
11234
|
+
targetType: object.type,
|
|
11235
|
+
showUnhide,
|
|
11236
|
+
showUnmerge,
|
|
11237
|
+
originalEvent: event
|
|
11238
|
+
});
|
|
11250
11239
|
}
|
|
11251
11240
|
|
|
11252
11241
|
prevent(event) {
|
|
@@ -24516,14 +24505,13 @@ class AdjustRowHeightCommand extends Command {
|
|
|
24516
24505
|
|
|
24517
24506
|
class ToolbarPasteCommand extends Command {
|
|
24518
24507
|
exec() {
|
|
24519
|
-
|
|
24520
|
-
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
|
|
24524
|
-
|
|
24525
|
-
|
|
24526
|
-
// }
|
|
24508
|
+
if (detectClipboardAccess().paste) {
|
|
24509
|
+
this._workbook._view.clipboard.focus();
|
|
24510
|
+
// explore programmatic pasting further
|
|
24511
|
+
document.execCommand('paste');
|
|
24512
|
+
} else {
|
|
24513
|
+
return { reason: "error", type: "useKeyboard" };
|
|
24514
|
+
}
|
|
24527
24515
|
}
|
|
24528
24516
|
}
|
|
24529
24517
|
|
|
@@ -24602,19 +24590,28 @@ class CopyCommand extends CutCommand {
|
|
|
24602
24590
|
// $(textarea).remove();
|
|
24603
24591
|
// }
|
|
24604
24592
|
|
|
24593
|
+
function detectClipboardAccess() {
|
|
24594
|
+
const commands = {
|
|
24595
|
+
copy: document.queryCommandSupported ? document.queryCommandSupported("copy") : false,
|
|
24596
|
+
cut: document.queryCommandSupported ? document.queryCommandSupported("cut") : false,
|
|
24597
|
+
paste: document.queryCommandSupported ? document.queryCommandSupported("paste") : false
|
|
24598
|
+
};
|
|
24599
|
+
|
|
24600
|
+
return commands;
|
|
24601
|
+
}
|
|
24602
|
+
|
|
24605
24603
|
class ToolbarCopyCommand extends Command {
|
|
24606
24604
|
constructor(options) {
|
|
24607
24605
|
super(options);
|
|
24608
24606
|
this._clipboard = options.workbook.clipboard();
|
|
24609
|
-
this.
|
|
24607
|
+
this.cannotUndo = true;
|
|
24610
24608
|
}
|
|
24611
24609
|
exec() {
|
|
24612
|
-
|
|
24613
|
-
|
|
24614
|
-
|
|
24615
|
-
|
|
24616
|
-
|
|
24617
|
-
// }
|
|
24610
|
+
if (detectClipboardAccess().copy) {
|
|
24611
|
+
document.execCommand('copy');
|
|
24612
|
+
} else {
|
|
24613
|
+
return { reason: "error", type: "useKeyboard" };
|
|
24614
|
+
}
|
|
24618
24615
|
}
|
|
24619
24616
|
}
|
|
24620
24617
|
|
|
@@ -24664,12 +24661,11 @@ class ToolbarCutCommand extends Command {
|
|
|
24664
24661
|
this.cannotUndo = true;
|
|
24665
24662
|
}
|
|
24666
24663
|
exec() {
|
|
24667
|
-
|
|
24668
|
-
|
|
24669
|
-
|
|
24670
|
-
|
|
24671
|
-
|
|
24672
|
-
// }
|
|
24664
|
+
if (detectClipboardAccess().copy) {
|
|
24665
|
+
document.execCommand('cut');
|
|
24666
|
+
} else {
|
|
24667
|
+
return { reason: "error", type: "useKeyboard" };
|
|
24668
|
+
}
|
|
24673
24669
|
}
|
|
24674
24670
|
}
|
|
24675
24671
|
|
|
@@ -26740,6 +26736,7 @@ const events$1 = [
|
|
|
26740
26736
|
"paste",
|
|
26741
26737
|
"changing",
|
|
26742
26738
|
"change",
|
|
26739
|
+
"contextmenu",
|
|
26743
26740
|
"excelImport",
|
|
26744
26741
|
"excelExport",
|
|
26745
26742
|
"insertSheet",
|
|
@@ -27765,6 +27762,7 @@ class SpreadsheetWidget extends Widget {
|
|
|
27765
27762
|
|
|
27766
27763
|
_keyDown(e) {
|
|
27767
27764
|
let key = e.keyCode;
|
|
27765
|
+
let controlKey = e.ctrlKey || e.metaKey;
|
|
27768
27766
|
|
|
27769
27767
|
if (key === keys.F11 && e.shiftKey) {
|
|
27770
27768
|
this._view.sheetsbar._onAddSelect();
|
|
@@ -27798,21 +27796,12 @@ class SpreadsheetWidget extends Widget {
|
|
|
27798
27796
|
this._view.sheetsbar._createEditor();
|
|
27799
27797
|
e.preventDefault();
|
|
27800
27798
|
return;
|
|
27801
|
-
} else if (
|
|
27802
|
-
|
|
27803
|
-
|
|
27804
|
-
|
|
27805
|
-
|
|
27806
|
-
|
|
27807
|
-
const italic = this.element.querySelector("[data-tool=italic]");
|
|
27808
|
-
if (italic) {
|
|
27809
|
-
italic.click();
|
|
27810
|
-
}
|
|
27811
|
-
} else if (e.ctrlKey && key === keys.U) {
|
|
27812
|
-
const underline = this.element.querySelector("[data-tool=underline]");
|
|
27813
|
-
if (underline) {
|
|
27814
|
-
underline.click();
|
|
27815
|
-
}
|
|
27799
|
+
} else if (controlKey && key === keys.B) {
|
|
27800
|
+
this._handleTypographicalEmphasis('bold');
|
|
27801
|
+
} else if (controlKey && key === keys.I) {
|
|
27802
|
+
this._handleTypographicalEmphasis('italic');
|
|
27803
|
+
} else if (controlKey && key === keys.U) {
|
|
27804
|
+
this._handleTypographicalEmphasis('underline');
|
|
27816
27805
|
} else if (e.altKey && key === keys.H) {
|
|
27817
27806
|
this._view.tabstrip.select(0);
|
|
27818
27807
|
e.preventDefault();
|
|
@@ -27828,6 +27817,20 @@ class SpreadsheetWidget extends Widget {
|
|
|
27828
27817
|
}
|
|
27829
27818
|
}
|
|
27830
27819
|
|
|
27820
|
+
_handleTypographicalEmphasis(command) {
|
|
27821
|
+
const sheet = this.activeSheet();
|
|
27822
|
+
|
|
27823
|
+
if (sheet) {
|
|
27824
|
+
this.executeCommand({
|
|
27825
|
+
command: 'PropertyChangeCommand',
|
|
27826
|
+
options: {
|
|
27827
|
+
property: command,
|
|
27828
|
+
value: !sheet.range(sheet.activeCell())[command]()
|
|
27829
|
+
}
|
|
27830
|
+
});
|
|
27831
|
+
}
|
|
27832
|
+
}
|
|
27833
|
+
|
|
27831
27834
|
_resize() {
|
|
27832
27835
|
this.refresh({ layout: true });
|
|
27833
27836
|
}
|
|
@@ -28121,6 +28124,10 @@ class SpreadsheetWidget extends Widget {
|
|
|
28121
28124
|
// kendo.ui.progress(this.element, e.toggle);
|
|
28122
28125
|
}
|
|
28123
28126
|
|
|
28127
|
+
_onContextMenu(e) {
|
|
28128
|
+
this.trigger("contextmenu", e);
|
|
28129
|
+
}
|
|
28130
|
+
|
|
28124
28131
|
_bindWorkbookEvents() {
|
|
28125
28132
|
this._workbook.bind("cut", this._workbookCut.bind(this));
|
|
28126
28133
|
this._workbook.bind("copy", this._workbookCopy.bind(this));
|
|
@@ -28147,6 +28154,7 @@ class SpreadsheetWidget extends Widget {
|
|
|
28147
28154
|
this._workbook.bind("dataBinding", this._workbookDataBinding.bind(this));
|
|
28148
28155
|
this._workbook.bind("dataBound", this._workbookDataBound.bind(this));
|
|
28149
28156
|
this._workbook.bind("progress", this._workbookProgress.bind(this));
|
|
28157
|
+
this._workbook.bind("contextmenu", this._onContextMenu.bind(this));
|
|
28150
28158
|
}
|
|
28151
28159
|
|
|
28152
28160
|
destroy() {
|
package/dist/index.js
CHANGED
|
@@ -11204,50 +11204,39 @@
|
|
|
11204
11204
|
return;
|
|
11205
11205
|
}
|
|
11206
11206
|
|
|
11207
|
-
//
|
|
11208
|
-
// this.colHeaderContextMenu.close();
|
|
11209
|
-
// this.rowHeaderContextMenu.close();
|
|
11210
|
-
// this.drawingContextMenu.close();
|
|
11207
|
+
// emit close here if necessary
|
|
11211
11208
|
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
// let object = this.objectAt(event);
|
|
11209
|
+
let object = this.objectAt(event);
|
|
11215
11210
|
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11211
|
+
if (object.type === "columnresizehandle" || object.type === "rowresizehandle") {
|
|
11212
|
+
return;
|
|
11213
|
+
}
|
|
11219
11214
|
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11215
|
+
if (object.ref) {
|
|
11216
|
+
this.navigator.selectForContextMenu(object.ref, SELECTION_MODES[object.type]);
|
|
11217
|
+
} else if (object.type == "drawing") {
|
|
11218
|
+
this.navigator.selectDrawingForContextMenu(object.drawing);
|
|
11219
|
+
}
|
|
11225
11220
|
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
// if (object.type == "columnheader") {
|
|
11231
|
-
// menu = this.colHeaderContextMenu;
|
|
11232
|
-
// showUnhide = !isComposite && this.axisManager.selectionIncludesHiddenColumns();
|
|
11233
|
-
// } else if (object.type == "rowheader") {
|
|
11234
|
-
// menu = this.rowHeaderContextMenu;
|
|
11235
|
-
// showUnhide = !isComposite && this.axisManager.selectionIncludesHiddenRows();
|
|
11236
|
-
// } else if (object.type == "drawing") {
|
|
11237
|
-
// menu = this.drawingContextMenu;
|
|
11238
|
-
// } else {
|
|
11239
|
-
// menu = this.cellContextMenu;
|
|
11240
|
-
// showUnmerge = this.navigator.selectionIncludesMergedCells();
|
|
11241
|
-
// }
|
|
11221
|
+
let isComposite = this.navigator._sheet.select() instanceof UnionRef;
|
|
11222
|
+
let showUnhide = false;
|
|
11223
|
+
let showUnmerge = false;
|
|
11242
11224
|
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11225
|
+
if (object.type == "columnheader") {
|
|
11226
|
+
showUnhide = !isComposite && this.axisManager.selectionIncludesHiddenColumns();
|
|
11227
|
+
} else if (object.type == "rowheader") {
|
|
11228
|
+
showUnhide = !isComposite && this.axisManager.selectionIncludesHiddenRows();
|
|
11229
|
+
} else if (object.type == "drawing") ; else {
|
|
11230
|
+
showUnmerge = this.navigator.selectionIncludesMergedCells();
|
|
11231
|
+
}
|
|
11246
11232
|
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11233
|
+
this._workbook.trigger("contextmenu", {
|
|
11234
|
+
objectRef: object.ref,
|
|
11235
|
+
targetType: object.type,
|
|
11236
|
+
showUnhide,
|
|
11237
|
+
showUnmerge,
|
|
11238
|
+
originalEvent: event
|
|
11239
|
+
});
|
|
11251
11240
|
}
|
|
11252
11241
|
|
|
11253
11242
|
prevent(event) {
|
|
@@ -24517,14 +24506,13 @@
|
|
|
24517
24506
|
|
|
24518
24507
|
class ToolbarPasteCommand extends Command {
|
|
24519
24508
|
exec() {
|
|
24520
|
-
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
|
|
24524
|
-
|
|
24525
|
-
|
|
24526
|
-
|
|
24527
|
-
// }
|
|
24509
|
+
if (detectClipboardAccess().paste) {
|
|
24510
|
+
this._workbook._view.clipboard.focus();
|
|
24511
|
+
// explore programmatic pasting further
|
|
24512
|
+
document.execCommand('paste');
|
|
24513
|
+
} else {
|
|
24514
|
+
return { reason: "error", type: "useKeyboard" };
|
|
24515
|
+
}
|
|
24528
24516
|
}
|
|
24529
24517
|
}
|
|
24530
24518
|
|
|
@@ -24603,19 +24591,28 @@
|
|
|
24603
24591
|
// $(textarea).remove();
|
|
24604
24592
|
// }
|
|
24605
24593
|
|
|
24594
|
+
function detectClipboardAccess() {
|
|
24595
|
+
const commands = {
|
|
24596
|
+
copy: document.queryCommandSupported ? document.queryCommandSupported("copy") : false,
|
|
24597
|
+
cut: document.queryCommandSupported ? document.queryCommandSupported("cut") : false,
|
|
24598
|
+
paste: document.queryCommandSupported ? document.queryCommandSupported("paste") : false
|
|
24599
|
+
};
|
|
24600
|
+
|
|
24601
|
+
return commands;
|
|
24602
|
+
}
|
|
24603
|
+
|
|
24606
24604
|
class ToolbarCopyCommand extends Command {
|
|
24607
24605
|
constructor(options) {
|
|
24608
24606
|
super(options);
|
|
24609
24607
|
this._clipboard = options.workbook.clipboard();
|
|
24610
|
-
this.
|
|
24608
|
+
this.cannotUndo = true;
|
|
24611
24609
|
}
|
|
24612
24610
|
exec() {
|
|
24613
|
-
|
|
24614
|
-
|
|
24615
|
-
|
|
24616
|
-
|
|
24617
|
-
|
|
24618
|
-
// }
|
|
24611
|
+
if (detectClipboardAccess().copy) {
|
|
24612
|
+
document.execCommand('copy');
|
|
24613
|
+
} else {
|
|
24614
|
+
return { reason: "error", type: "useKeyboard" };
|
|
24615
|
+
}
|
|
24619
24616
|
}
|
|
24620
24617
|
}
|
|
24621
24618
|
|
|
@@ -24665,12 +24662,11 @@
|
|
|
24665
24662
|
this.cannotUndo = true;
|
|
24666
24663
|
}
|
|
24667
24664
|
exec() {
|
|
24668
|
-
|
|
24669
|
-
|
|
24670
|
-
|
|
24671
|
-
|
|
24672
|
-
|
|
24673
|
-
// }
|
|
24665
|
+
if (detectClipboardAccess().copy) {
|
|
24666
|
+
document.execCommand('cut');
|
|
24667
|
+
} else {
|
|
24668
|
+
return { reason: "error", type: "useKeyboard" };
|
|
24669
|
+
}
|
|
24674
24670
|
}
|
|
24675
24671
|
}
|
|
24676
24672
|
|
|
@@ -26741,6 +26737,7 @@
|
|
|
26741
26737
|
"paste",
|
|
26742
26738
|
"changing",
|
|
26743
26739
|
"change",
|
|
26740
|
+
"contextmenu",
|
|
26744
26741
|
"excelImport",
|
|
26745
26742
|
"excelExport",
|
|
26746
26743
|
"insertSheet",
|
|
@@ -27766,6 +27763,7 @@
|
|
|
27766
27763
|
|
|
27767
27764
|
_keyDown(e) {
|
|
27768
27765
|
let key = e.keyCode;
|
|
27766
|
+
let controlKey = e.ctrlKey || e.metaKey;
|
|
27769
27767
|
|
|
27770
27768
|
if (key === keys.F11 && e.shiftKey) {
|
|
27771
27769
|
this._view.sheetsbar._onAddSelect();
|
|
@@ -27799,21 +27797,12 @@
|
|
|
27799
27797
|
this._view.sheetsbar._createEditor();
|
|
27800
27798
|
e.preventDefault();
|
|
27801
27799
|
return;
|
|
27802
|
-
} else if (
|
|
27803
|
-
|
|
27804
|
-
|
|
27805
|
-
|
|
27806
|
-
|
|
27807
|
-
|
|
27808
|
-
const italic = this.element.querySelector("[data-tool=italic]");
|
|
27809
|
-
if (italic) {
|
|
27810
|
-
italic.click();
|
|
27811
|
-
}
|
|
27812
|
-
} else if (e.ctrlKey && key === keys.U) {
|
|
27813
|
-
const underline = this.element.querySelector("[data-tool=underline]");
|
|
27814
|
-
if (underline) {
|
|
27815
|
-
underline.click();
|
|
27816
|
-
}
|
|
27800
|
+
} else if (controlKey && key === keys.B) {
|
|
27801
|
+
this._handleTypographicalEmphasis('bold');
|
|
27802
|
+
} else if (controlKey && key === keys.I) {
|
|
27803
|
+
this._handleTypographicalEmphasis('italic');
|
|
27804
|
+
} else if (controlKey && key === keys.U) {
|
|
27805
|
+
this._handleTypographicalEmphasis('underline');
|
|
27817
27806
|
} else if (e.altKey && key === keys.H) {
|
|
27818
27807
|
this._view.tabstrip.select(0);
|
|
27819
27808
|
e.preventDefault();
|
|
@@ -27829,6 +27818,20 @@
|
|
|
27829
27818
|
}
|
|
27830
27819
|
}
|
|
27831
27820
|
|
|
27821
|
+
_handleTypographicalEmphasis(command) {
|
|
27822
|
+
const sheet = this.activeSheet();
|
|
27823
|
+
|
|
27824
|
+
if (sheet) {
|
|
27825
|
+
this.executeCommand({
|
|
27826
|
+
command: 'PropertyChangeCommand',
|
|
27827
|
+
options: {
|
|
27828
|
+
property: command,
|
|
27829
|
+
value: !sheet.range(sheet.activeCell())[command]()
|
|
27830
|
+
}
|
|
27831
|
+
});
|
|
27832
|
+
}
|
|
27833
|
+
}
|
|
27834
|
+
|
|
27832
27835
|
_resize() {
|
|
27833
27836
|
this.refresh({ layout: true });
|
|
27834
27837
|
}
|
|
@@ -28122,6 +28125,10 @@
|
|
|
28122
28125
|
// kendo.ui.progress(this.element, e.toggle);
|
|
28123
28126
|
}
|
|
28124
28127
|
|
|
28128
|
+
_onContextMenu(e) {
|
|
28129
|
+
this.trigger("contextmenu", e);
|
|
28130
|
+
}
|
|
28131
|
+
|
|
28125
28132
|
_bindWorkbookEvents() {
|
|
28126
28133
|
this._workbook.bind("cut", this._workbookCut.bind(this));
|
|
28127
28134
|
this._workbook.bind("copy", this._workbookCopy.bind(this));
|
|
@@ -28148,6 +28155,7 @@
|
|
|
28148
28155
|
this._workbook.bind("dataBinding", this._workbookDataBinding.bind(this));
|
|
28149
28156
|
this._workbook.bind("dataBound", this._workbookDataBound.bind(this));
|
|
28150
28157
|
this._workbook.bind("progress", this._workbookProgress.bind(this));
|
|
28158
|
+
this._workbook.bind("contextmenu", this._onContextMenu.bind(this));
|
|
28151
28159
|
}
|
|
28152
28160
|
|
|
28153
28161
|
destroy() {
|