@progress/kendo-spreadsheet-common 1.0.0-develop.13 → 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 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() { // openDialog(name, options) {
23087
- // let sheet = this._sheet;
23088
- // return sheet.withCultureDecimals(function() {
23089
- // let dialog = kendo.spreadsheet.dialogs.create(name, options);
23090
-
23091
- // if (dialog) {
23092
- // dialog.bind("action", this._executeCommand.bind(this));
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() { // showError(options, reopenEditor) {
23106
- // let currentDialogs = this._dialogs;
23107
- // let errorMessages = this.options.messages.errors;
23108
- // let hasOpenedError = false;
23096
+ showError(options, reopenEditor) {
23097
+ let currentDialogs = this._dialogs;
23098
+ let errorMessages = this.options.messages.errors;
23109
23099
 
23110
- // if (currentDialogs.length > 0) {
23111
- // currentDialogs.forEach(function(dialog) {
23112
- // if (dialog.options && dialog.options.title === ERROR) {
23113
- // hasOpenedError = true;
23114
- // }
23115
- // });
23116
- // }
23117
- // if (hasOpenedError) {
23118
- // return;
23119
- // }
23100
+ if (currentDialogs.length > 0) {
23101
+ return;
23102
+ }
23120
23103
 
23121
- // let focusButton = function(e) {
23122
- // let cont = e.sender.dialog().element;
23123
- // cont.find(".k-button").first().trigger("focus");
23124
- // cont.find(".k-button, input").on("keydown", function(ev) {
23125
- // if (ev.keyCode === kendo.keys.ESC) {
23126
- // e.sender.close();
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
- // let onClose = function(e) {
23132
- // let dlg = e.sender;
23133
- // this.selectClipboardContents();
23134
- // if (dlg._retry && reopenEditor) {
23135
- // reopenEditor();
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
- // this.openDialog(options.type, dialogOptions);
23153
- // } else {
23154
- // this.openDialog("message", {
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() {
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() { // openDialog(name, options) {
23088
- // let sheet = this._sheet;
23089
- // return sheet.withCultureDecimals(function() {
23090
- // let dialog = kendo.spreadsheet.dialogs.create(name, options);
23091
-
23092
- // if (dialog) {
23093
- // dialog.bind("action", this._executeCommand.bind(this));
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() { // showError(options, reopenEditor) {
23107
- // let currentDialogs = this._dialogs;
23108
- // let errorMessages = this.options.messages.errors;
23109
- // let hasOpenedError = false;
23097
+ showError(options, reopenEditor) {
23098
+ let currentDialogs = this._dialogs;
23099
+ let errorMessages = this.options.messages.errors;
23110
23100
 
23111
- // if (currentDialogs.length > 0) {
23112
- // currentDialogs.forEach(function(dialog) {
23113
- // if (dialog.options && dialog.options.title === ERROR) {
23114
- // hasOpenedError = true;
23115
- // }
23116
- // });
23117
- // }
23118
- // if (hasOpenedError) {
23119
- // return;
23120
- // }
23101
+ if (currentDialogs.length > 0) {
23102
+ return;
23103
+ }
23121
23104
 
23122
- // let focusButton = function(e) {
23123
- // let cont = e.sender.dialog().element;
23124
- // cont.find(".k-button").first().trigger("focus");
23125
- // cont.find(".k-button, input").on("keydown", function(ev) {
23126
- // if (ev.keyCode === kendo.keys.ESC) {
23127
- // e.sender.close();
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
- // let onClose = function(e) {
23133
- // let dlg = e.sender;
23134
- // this.selectClipboardContents();
23135
- // if (dlg._retry && reopenEditor) {
23136
- // reopenEditor();
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
- // this.openDialog(options.type, dialogOptions);
23154
- // } else {
23155
- // this.openDialog("message", {
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() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-spreadsheet-common",
3
3
  "description": "Kendo UI platform-independent Spreadsheet library",
4
- "version": "1.0.0-develop.13",
4
+ "version": "1.0.0-develop.14",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],
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
  /**