@progress/kendo-spreadsheet-common 1.0.0-develop.12 → 1.0.0-develop.14
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 +46 -74
- package/dist/index.js +46 -74
- package/package.json +1 -1
- package/src/index.d.ts +20 -0
package/dist/index-esm.js
CHANGED
|
@@ -949,6 +949,7 @@ const messages = {};
|
|
|
949
949
|
messages.view = {
|
|
950
950
|
nameBox: "Name Box",
|
|
951
951
|
errors: {
|
|
952
|
+
modifyMerged: "Cannot change part of a merged cell.",
|
|
952
953
|
openUnsupported: "Unsupported format. Please select an .xlsx file.",
|
|
953
954
|
shiftingNonblankCells: "Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",
|
|
954
955
|
insertColumnWhenRowIsSelected: "Cannot insert column when all columns are selected.",
|
|
@@ -10797,13 +10798,13 @@ class Controller {
|
|
|
10797
10798
|
this.editor.deactivate(true); // make sure we don't call any change hooks
|
|
10798
10799
|
this.view.showError(result, function() {
|
|
10799
10800
|
// we only get here in case of a validation error when the user decided to retry.
|
|
10800
|
-
this.activateEditor(false);
|
|
10801
|
+
// this.activateEditor(false);
|
|
10801
10802
|
// reset to last input from user
|
|
10802
|
-
this.editor.value(this._lastEditorValue);
|
|
10803
|
+
// this.editor.value(this._lastEditorValue);
|
|
10803
10804
|
// however, set _value manually such that it'll detect change properly. ugly :-\
|
|
10804
|
-
this.editor._value = this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell());
|
|
10805
|
+
// this.editor._value = this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell());
|
|
10805
10806
|
// seems like a nice UX to have the whole input selected
|
|
10806
|
-
this.editor.select();
|
|
10807
|
+
// this.editor.select();
|
|
10807
10808
|
}.bind(this));
|
|
10808
10809
|
} else {
|
|
10809
10810
|
this.view.openDialog(result.reason);
|
|
@@ -22600,7 +22601,7 @@ class View extends Observable {
|
|
|
22600
22601
|
messages: messages.view
|
|
22601
22602
|
}, this.options, options);
|
|
22602
22603
|
|
|
22603
|
-
this.events = ['update'];
|
|
22604
|
+
this.events = ['update', 'message'];
|
|
22604
22605
|
|
|
22605
22606
|
this._chrome();
|
|
22606
22607
|
|
|
@@ -23083,81 +23084,41 @@ class View extends Observable {
|
|
|
23083
23084
|
});
|
|
23084
23085
|
}
|
|
23085
23086
|
|
|
23086
|
-
openDialog(
|
|
23087
|
-
|
|
23088
|
-
|
|
23089
|
-
|
|
23090
|
-
|
|
23091
|
-
|
|
23092
|
-
|
|
23093
|
-
// dialog.bind("deactivate", this._destroyDialog.bind(this));
|
|
23094
|
-
// this._dialogs.push(dialog);
|
|
23095
|
-
|
|
23096
|
-
// let ref = sheet.activeCell();
|
|
23097
|
-
// let range = new kendo.spreadsheet.Range(ref, sheet);
|
|
23098
|
-
|
|
23099
|
-
// dialog.open(range);
|
|
23100
|
-
// return dialog;
|
|
23101
|
-
// }
|
|
23102
|
-
// }.bind(this));
|
|
23087
|
+
openDialog(name, options) {
|
|
23088
|
+
let sheet = this._sheet;
|
|
23089
|
+
return sheet.withCultureDecimals(function() {
|
|
23090
|
+
let ref = sheet.activeCell();
|
|
23091
|
+
let range = new Range$1(ref, sheet);
|
|
23092
|
+
this.trigger('message', { ...options, name, ref, range });
|
|
23093
|
+
}.bind(this));
|
|
23103
23094
|
}
|
|
23104
23095
|
|
|
23105
|
-
showError(
|
|
23106
|
-
|
|
23107
|
-
|
|
23108
|
-
// let hasOpenedError = false;
|
|
23096
|
+
showError(options, reopenEditor) {
|
|
23097
|
+
let currentDialogs = this._dialogs;
|
|
23098
|
+
let errorMessages = this.options.messages.errors;
|
|
23109
23099
|
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
// hasOpenedError = true;
|
|
23114
|
-
// }
|
|
23115
|
-
// });
|
|
23116
|
-
// }
|
|
23117
|
-
// if (hasOpenedError) {
|
|
23118
|
-
// return;
|
|
23119
|
-
// }
|
|
23100
|
+
if (currentDialogs.length > 0) {
|
|
23101
|
+
return;
|
|
23102
|
+
}
|
|
23120
23103
|
|
|
23121
|
-
|
|
23122
|
-
|
|
23123
|
-
|
|
23124
|
-
|
|
23125
|
-
|
|
23126
|
-
|
|
23127
|
-
|
|
23128
|
-
|
|
23129
|
-
// };
|
|
23104
|
+
let onClose = function() {
|
|
23105
|
+
currentDialogs.pop();
|
|
23106
|
+
// let dlg = e.sender;
|
|
23107
|
+
this.selectClipboardContents();
|
|
23108
|
+
if (reopenEditor) { // dlg._retry &&
|
|
23109
|
+
reopenEditor();
|
|
23110
|
+
}
|
|
23111
|
+
}.bind(this);
|
|
23130
23112
|
|
|
23131
|
-
|
|
23132
|
-
|
|
23133
|
-
|
|
23134
|
-
|
|
23135
|
-
|
|
23136
|
-
// }
|
|
23137
|
-
// }.bind(this);
|
|
23138
|
-
|
|
23139
|
-
// if (kendo.spreadsheet.dialogs.registered(options.type)) {
|
|
23140
|
-
// let dialogOptions = {
|
|
23141
|
-
// close: onClose
|
|
23142
|
-
// };
|
|
23143
|
-
|
|
23144
|
-
// if (options.type === "validationError") {
|
|
23145
|
-
// dialogOptions = $.extend(dialogOptions, {
|
|
23146
|
-
// title: options.title || "Error",
|
|
23147
|
-
// text: options.body ? options.body : errorMessages[options.type],
|
|
23148
|
-
// activate: focusButton
|
|
23149
|
-
// });
|
|
23150
|
-
// }
|
|
23113
|
+
const dialogOptions = {
|
|
23114
|
+
title: options.title || "Error",
|
|
23115
|
+
text: options.body ? options.body : errorMessages[options.type],
|
|
23116
|
+
close: onClose
|
|
23117
|
+
};
|
|
23151
23118
|
|
|
23152
|
-
|
|
23153
|
-
|
|
23154
|
-
|
|
23155
|
-
// title : options.title || "Error",
|
|
23156
|
-
// text : options.body ? options.body : errorMessages[options.type],
|
|
23157
|
-
// activate: focusButton,
|
|
23158
|
-
// close: onClose
|
|
23159
|
-
// });
|
|
23160
|
-
// }
|
|
23119
|
+
currentDialogs.push(dialogOptions);
|
|
23120
|
+
|
|
23121
|
+
this.openDialog(options.type || "message", dialogOptions);
|
|
23161
23122
|
}
|
|
23162
23123
|
|
|
23163
23124
|
destroy() {
|
|
@@ -23994,6 +23955,16 @@ class PropertyChangeCommand extends Command {
|
|
|
23994
23955
|
}
|
|
23995
23956
|
}
|
|
23996
23957
|
|
|
23958
|
+
class PropertyCleanCommand extends PropertyChangeCommand {
|
|
23959
|
+
exec() {
|
|
23960
|
+
let range = this.range();
|
|
23961
|
+
if (range.enable()) {
|
|
23962
|
+
this.getState();
|
|
23963
|
+
range.clearFormat();
|
|
23964
|
+
}
|
|
23965
|
+
}
|
|
23966
|
+
}
|
|
23967
|
+
|
|
23997
23968
|
class ClearContentCommand extends Command {
|
|
23998
23969
|
exec() {
|
|
23999
23970
|
let values = [], range, rowValues, nullValues, validationState, currentRange;
|
|
@@ -25095,6 +25066,7 @@ var commands = /*#__PURE__*/Object.freeze({
|
|
|
25095
25066
|
OpenCommand: OpenCommand,
|
|
25096
25067
|
PasteCommand: PasteCommand,
|
|
25097
25068
|
PropertyChangeCommand: PropertyChangeCommand,
|
|
25069
|
+
PropertyCleanCommand: PropertyCleanCommand,
|
|
25098
25070
|
ReorderDrawingsCommand: ReorderDrawingsCommand,
|
|
25099
25071
|
RowHeightCommand: RowHeightCommand,
|
|
25100
25072
|
SaveAsCommand: SaveAsCommand,
|
package/dist/index.js
CHANGED
|
@@ -950,6 +950,7 @@
|
|
|
950
950
|
messages.view = {
|
|
951
951
|
nameBox: "Name Box",
|
|
952
952
|
errors: {
|
|
953
|
+
modifyMerged: "Cannot change part of a merged cell.",
|
|
953
954
|
openUnsupported: "Unsupported format. Please select an .xlsx file.",
|
|
954
955
|
shiftingNonblankCells: "Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",
|
|
955
956
|
insertColumnWhenRowIsSelected: "Cannot insert column when all columns are selected.",
|
|
@@ -10798,13 +10799,13 @@
|
|
|
10798
10799
|
this.editor.deactivate(true); // make sure we don't call any change hooks
|
|
10799
10800
|
this.view.showError(result, function() {
|
|
10800
10801
|
// we only get here in case of a validation error when the user decided to retry.
|
|
10801
|
-
this.activateEditor(false);
|
|
10802
|
+
// this.activateEditor(false);
|
|
10802
10803
|
// reset to last input from user
|
|
10803
|
-
this.editor.value(this._lastEditorValue);
|
|
10804
|
+
// this.editor.value(this._lastEditorValue);
|
|
10804
10805
|
// however, set _value manually such that it'll detect change properly. ugly :-\
|
|
10805
|
-
this.editor._value = this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell());
|
|
10806
|
+
// this.editor._value = this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell());
|
|
10806
10807
|
// seems like a nice UX to have the whole input selected
|
|
10807
|
-
this.editor.select();
|
|
10808
|
+
// this.editor.select();
|
|
10808
10809
|
}.bind(this));
|
|
10809
10810
|
} else {
|
|
10810
10811
|
this.view.openDialog(result.reason);
|
|
@@ -22601,7 +22602,7 @@
|
|
|
22601
22602
|
messages: messages.view
|
|
22602
22603
|
}, this.options, options);
|
|
22603
22604
|
|
|
22604
|
-
this.events = ['update'];
|
|
22605
|
+
this.events = ['update', 'message'];
|
|
22605
22606
|
|
|
22606
22607
|
this._chrome();
|
|
22607
22608
|
|
|
@@ -23084,81 +23085,41 @@
|
|
|
23084
23085
|
});
|
|
23085
23086
|
}
|
|
23086
23087
|
|
|
23087
|
-
openDialog(
|
|
23088
|
-
|
|
23089
|
-
|
|
23090
|
-
|
|
23091
|
-
|
|
23092
|
-
|
|
23093
|
-
|
|
23094
|
-
// dialog.bind("deactivate", this._destroyDialog.bind(this));
|
|
23095
|
-
// this._dialogs.push(dialog);
|
|
23096
|
-
|
|
23097
|
-
// let ref = sheet.activeCell();
|
|
23098
|
-
// let range = new kendo.spreadsheet.Range(ref, sheet);
|
|
23099
|
-
|
|
23100
|
-
// dialog.open(range);
|
|
23101
|
-
// return dialog;
|
|
23102
|
-
// }
|
|
23103
|
-
// }.bind(this));
|
|
23088
|
+
openDialog(name, options) {
|
|
23089
|
+
let sheet = this._sheet;
|
|
23090
|
+
return sheet.withCultureDecimals(function() {
|
|
23091
|
+
let ref = sheet.activeCell();
|
|
23092
|
+
let range = new Range$1(ref, sheet);
|
|
23093
|
+
this.trigger('message', { ...options, name, ref, range });
|
|
23094
|
+
}.bind(this));
|
|
23104
23095
|
}
|
|
23105
23096
|
|
|
23106
|
-
showError(
|
|
23107
|
-
|
|
23108
|
-
|
|
23109
|
-
// let hasOpenedError = false;
|
|
23097
|
+
showError(options, reopenEditor) {
|
|
23098
|
+
let currentDialogs = this._dialogs;
|
|
23099
|
+
let errorMessages = this.options.messages.errors;
|
|
23110
23100
|
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
|
|
23114
|
-
// hasOpenedError = true;
|
|
23115
|
-
// }
|
|
23116
|
-
// });
|
|
23117
|
-
// }
|
|
23118
|
-
// if (hasOpenedError) {
|
|
23119
|
-
// return;
|
|
23120
|
-
// }
|
|
23101
|
+
if (currentDialogs.length > 0) {
|
|
23102
|
+
return;
|
|
23103
|
+
}
|
|
23121
23104
|
|
|
23122
|
-
|
|
23123
|
-
|
|
23124
|
-
|
|
23125
|
-
|
|
23126
|
-
|
|
23127
|
-
|
|
23128
|
-
|
|
23129
|
-
|
|
23130
|
-
// };
|
|
23105
|
+
let onClose = function() {
|
|
23106
|
+
currentDialogs.pop();
|
|
23107
|
+
// let dlg = e.sender;
|
|
23108
|
+
this.selectClipboardContents();
|
|
23109
|
+
if (reopenEditor) { // dlg._retry &&
|
|
23110
|
+
reopenEditor();
|
|
23111
|
+
}
|
|
23112
|
+
}.bind(this);
|
|
23131
23113
|
|
|
23132
|
-
|
|
23133
|
-
|
|
23134
|
-
|
|
23135
|
-
|
|
23136
|
-
|
|
23137
|
-
// }
|
|
23138
|
-
// }.bind(this);
|
|
23139
|
-
|
|
23140
|
-
// if (kendo.spreadsheet.dialogs.registered(options.type)) {
|
|
23141
|
-
// let dialogOptions = {
|
|
23142
|
-
// close: onClose
|
|
23143
|
-
// };
|
|
23144
|
-
|
|
23145
|
-
// if (options.type === "validationError") {
|
|
23146
|
-
// dialogOptions = $.extend(dialogOptions, {
|
|
23147
|
-
// title: options.title || "Error",
|
|
23148
|
-
// text: options.body ? options.body : errorMessages[options.type],
|
|
23149
|
-
// activate: focusButton
|
|
23150
|
-
// });
|
|
23151
|
-
// }
|
|
23114
|
+
const dialogOptions = {
|
|
23115
|
+
title: options.title || "Error",
|
|
23116
|
+
text: options.body ? options.body : errorMessages[options.type],
|
|
23117
|
+
close: onClose
|
|
23118
|
+
};
|
|
23152
23119
|
|
|
23153
|
-
|
|
23154
|
-
|
|
23155
|
-
|
|
23156
|
-
// title : options.title || "Error",
|
|
23157
|
-
// text : options.body ? options.body : errorMessages[options.type],
|
|
23158
|
-
// activate: focusButton,
|
|
23159
|
-
// close: onClose
|
|
23160
|
-
// });
|
|
23161
|
-
// }
|
|
23120
|
+
currentDialogs.push(dialogOptions);
|
|
23121
|
+
|
|
23122
|
+
this.openDialog(options.type || "message", dialogOptions);
|
|
23162
23123
|
}
|
|
23163
23124
|
|
|
23164
23125
|
destroy() {
|
|
@@ -23995,6 +23956,16 @@
|
|
|
23995
23956
|
}
|
|
23996
23957
|
}
|
|
23997
23958
|
|
|
23959
|
+
class PropertyCleanCommand extends PropertyChangeCommand {
|
|
23960
|
+
exec() {
|
|
23961
|
+
let range = this.range();
|
|
23962
|
+
if (range.enable()) {
|
|
23963
|
+
this.getState();
|
|
23964
|
+
range.clearFormat();
|
|
23965
|
+
}
|
|
23966
|
+
}
|
|
23967
|
+
}
|
|
23968
|
+
|
|
23998
23969
|
class ClearContentCommand extends Command {
|
|
23999
23970
|
exec() {
|
|
24000
23971
|
let values = [], range, rowValues, nullValues, validationState, currentRange;
|
|
@@ -25096,6 +25067,7 @@
|
|
|
25096
25067
|
OpenCommand: OpenCommand,
|
|
25097
25068
|
PasteCommand: PasteCommand,
|
|
25098
25069
|
PropertyChangeCommand: PropertyChangeCommand,
|
|
25070
|
+
PropertyCleanCommand: PropertyCleanCommand,
|
|
25099
25071
|
ReorderDrawingsCommand: ReorderDrawingsCommand,
|
|
25100
25072
|
RowHeightCommand: RowHeightCommand,
|
|
25101
25073
|
SaveAsCommand: SaveAsCommand,
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -580,6 +580,21 @@ export class Range {
|
|
|
580
580
|
wrap(value?: boolean): boolean;
|
|
581
581
|
}
|
|
582
582
|
|
|
583
|
+
/**
|
|
584
|
+
* @hidden
|
|
585
|
+
*/
|
|
586
|
+
export interface SelectedHeaders {
|
|
587
|
+
all: boolean;
|
|
588
|
+
allCols: boolean;
|
|
589
|
+
allRows: boolean;
|
|
590
|
+
cols: {
|
|
591
|
+
[key: number]: 'full' | 'partial';
|
|
592
|
+
};
|
|
593
|
+
rows: {
|
|
594
|
+
[key: number]: 'full' | 'partial';
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
|
|
583
598
|
/**
|
|
584
599
|
* The Sheet object.
|
|
585
600
|
*/
|
|
@@ -614,6 +629,11 @@ export class Sheet {
|
|
|
614
629
|
* @default true
|
|
615
630
|
*/
|
|
616
631
|
showGridLines(value?: any): any;
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* @hidden
|
|
635
|
+
*/
|
|
636
|
+
selectedHeaders(): SelectedHeaders;
|
|
617
637
|
}
|
|
618
638
|
|
|
619
639
|
/**
|