@progress/kendo-spreadsheet-common 1.1.0 → 1.1.1-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 CHANGED
@@ -1621,8 +1621,9 @@ HtmlNode.prototype = {
1621
1621
  }
1622
1622
  }
1623
1623
  };
1624
- let HTML_CONTAINER = document.createElement("div");
1624
+
1625
1625
  function insertHtml(node, html) {
1626
+ const HTML_CONTAINER = document.createElement("div");
1626
1627
  HTML_CONTAINER.innerHTML = html;
1627
1628
  while (HTML_CONTAINER.firstChild) {
1628
1629
  node.appendChild(HTML_CONTAINER.firstChild);
@@ -10438,7 +10439,7 @@ let KEY_NAMES$1 = {
10438
10439
  113: ':edit'
10439
10440
  };
10440
10441
 
10441
- let Mac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
10442
+ const Mac = () => navigator.platform.toUpperCase().indexOf('MAC') >= 0;
10442
10443
 
10443
10444
  let isAlphaNum = function(keyCode) {
10444
10445
  if ((keyCode > 47 && keyCode < 58) || // number keys
@@ -10561,7 +10562,7 @@ class EventListener {
10561
10562
  handleEvent(e, name) {
10562
10563
  let eventKey = "";
10563
10564
 
10564
- e.mod = Mac ? e.metaKey : (e.ctrlKey && !e.altKey);
10565
+ e.mod = Mac() ? e.metaKey : (e.ctrlKey && !e.altKey);
10565
10566
 
10566
10567
  if (e.altKey) {
10567
10568
  eventKey += "alt+";
@@ -10746,9 +10747,13 @@ class Controller {
10746
10747
  this.editor.bind("deactivate", this.onEditorDeactivate.bind(this));
10747
10748
  this.editor.bind("update", this.onEditorUpdate.bind(this));
10748
10749
 
10749
- view.scroller.addEventListener("scroll", this.onScroll.bind(this));
10750
10750
  this.listener = new EventListener(this.container, this, CONTAINER_EVENTS);
10751
- (view.scroller).addEventListener("mousedown", this.onMouseDown.bind(this));
10751
+
10752
+ this.scrollHandler = this.onScroll.bind(this);
10753
+ this.mouseDownHandler = this.onMouseDown.bind(this);
10754
+
10755
+ view.scroller.addEventListener("scroll", this.scrollHandler);
10756
+ view.scroller.addEventListener("mousedown", this.mouseDownHandler);
10752
10757
 
10753
10758
  this._enableEditorEvents();
10754
10759
 
@@ -10891,6 +10896,9 @@ class Controller {
10891
10896
  }
10892
10897
 
10893
10898
  destroy() {
10899
+ this.view.scroller.removeEventListener("scroll", this.scrollHandler);
10900
+ this.view.scroller.removeEventListener("mousedown", this.mouseDownHandler);
10901
+
10894
10902
  this.listener.destroy();
10895
10903
  this._enableEditorEvents(false);
10896
10904
  this.keyListener.destroy();
@@ -14056,14 +14064,15 @@ function looksLikeANumber(str) {
14056
14064
  return !(/^=/.test(str)) && (/number|percent/).test(calc.parse(null, 0, 0, str).type);
14057
14065
  }
14058
14066
 
14059
- const measureBox = document.createElement('div');
14060
- measureBox.setAttribute('style',
14061
- 'position: absolute !important; top: -4000px !important; height: auto !important;' +
14062
- 'padding: 1px 3px !important; box-sizing: border-box; margin: 0 !important; border: 1px solid black !important;' +
14063
- 'line-height: normal !important; visibility: hidden !important;' +
14064
- 'white-space: pre-wrap;');
14065
-
14066
14067
  function getTextHeight(text, width, fontFamily, fontSize, wrap) {
14068
+ const measureBox = document.createElement("div");
14069
+ measureBox.setAttribute(
14070
+ "style",
14071
+ "position: absolute !important; top: -4000px !important; height: auto !important;" +
14072
+ "padding: 1px 3px !important; box-sizing: border-box; margin: 0 !important; border: 1px solid black !important;" +
14073
+ "line-height: normal !important; visibility: hidden !important;" +
14074
+ "white-space: pre-wrap;"
14075
+ );
14067
14076
  let styles = {
14068
14077
  "baselineMarkerSize" : 0,
14069
14078
  "width" : (wrap === true) ? width + "px" : "auto",
@@ -27773,10 +27782,11 @@ class SpreadsheetWidget extends Widget {
27773
27782
  this.refresh();
27774
27783
  this._view.enableClipboard(true);
27775
27784
 
27776
- this._resizeHandler = function() { this.resize(); }.bind(this);
27785
+ this._resizeHandler = this.resize.bind(this);
27777
27786
  window.addEventListener('resize', this._resizeHandler);
27778
27787
 
27779
- this.element.addEventListener("keydown", this._keyDown.bind(this));
27788
+ this._keyDownHandler = this._keyDown.bind(this);
27789
+ this.element.addEventListener("keydown", this._keyDownHandler);
27780
27790
  }
27781
27791
 
27782
27792
  get view() {
@@ -28187,15 +28197,14 @@ class SpreadsheetWidget extends Widget {
28187
28197
  }
28188
28198
 
28189
28199
  destroy() {
28200
+ window.removeEventListener('resize', this._resizeHandler);
28201
+ this.element.removeEventListener("keydown", this._keyDownHandler);
28202
+
28190
28203
  this.unbind();
28191
28204
 
28192
28205
  this._workbook.destroy();
28193
28206
  this._controller.destroy();
28194
28207
  this._view.destroy();
28195
-
28196
- if (this._resizeHandler) {
28197
- window.removeEventListener('resize', this._resizeHandler);
28198
- }
28199
28208
  }
28200
28209
 
28201
28210
  defineName(name, value, hidden) {
package/dist/index.js CHANGED
@@ -1622,8 +1622,9 @@
1622
1622
  }
1623
1623
  }
1624
1624
  };
1625
- let HTML_CONTAINER = document.createElement("div");
1625
+
1626
1626
  function insertHtml(node, html) {
1627
+ const HTML_CONTAINER = document.createElement("div");
1627
1628
  HTML_CONTAINER.innerHTML = html;
1628
1629
  while (HTML_CONTAINER.firstChild) {
1629
1630
  node.appendChild(HTML_CONTAINER.firstChild);
@@ -10439,7 +10440,7 @@
10439
10440
  113: ':edit'
10440
10441
  };
10441
10442
 
10442
- let Mac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
10443
+ const Mac = () => navigator.platform.toUpperCase().indexOf('MAC') >= 0;
10443
10444
 
10444
10445
  let isAlphaNum = function(keyCode) {
10445
10446
  if ((keyCode > 47 && keyCode < 58) || // number keys
@@ -10562,7 +10563,7 @@
10562
10563
  handleEvent(e, name) {
10563
10564
  let eventKey = "";
10564
10565
 
10565
- e.mod = Mac ? e.metaKey : (e.ctrlKey && !e.altKey);
10566
+ e.mod = Mac() ? e.metaKey : (e.ctrlKey && !e.altKey);
10566
10567
 
10567
10568
  if (e.altKey) {
10568
10569
  eventKey += "alt+";
@@ -10747,9 +10748,13 @@
10747
10748
  this.editor.bind("deactivate", this.onEditorDeactivate.bind(this));
10748
10749
  this.editor.bind("update", this.onEditorUpdate.bind(this));
10749
10750
 
10750
- view.scroller.addEventListener("scroll", this.onScroll.bind(this));
10751
10751
  this.listener = new EventListener(this.container, this, CONTAINER_EVENTS);
10752
- (view.scroller).addEventListener("mousedown", this.onMouseDown.bind(this));
10752
+
10753
+ this.scrollHandler = this.onScroll.bind(this);
10754
+ this.mouseDownHandler = this.onMouseDown.bind(this);
10755
+
10756
+ view.scroller.addEventListener("scroll", this.scrollHandler);
10757
+ view.scroller.addEventListener("mousedown", this.mouseDownHandler);
10753
10758
 
10754
10759
  this._enableEditorEvents();
10755
10760
 
@@ -10892,6 +10897,9 @@
10892
10897
  }
10893
10898
 
10894
10899
  destroy() {
10900
+ this.view.scroller.removeEventListener("scroll", this.scrollHandler);
10901
+ this.view.scroller.removeEventListener("mousedown", this.mouseDownHandler);
10902
+
10895
10903
  this.listener.destroy();
10896
10904
  this._enableEditorEvents(false);
10897
10905
  this.keyListener.destroy();
@@ -14057,14 +14065,15 @@
14057
14065
  return !(/^=/.test(str)) && (/number|percent/).test(calc.parse(null, 0, 0, str).type);
14058
14066
  }
14059
14067
 
14060
- const measureBox = document.createElement('div');
14061
- measureBox.setAttribute('style',
14062
- 'position: absolute !important; top: -4000px !important; height: auto !important;' +
14063
- 'padding: 1px 3px !important; box-sizing: border-box; margin: 0 !important; border: 1px solid black !important;' +
14064
- 'line-height: normal !important; visibility: hidden !important;' +
14065
- 'white-space: pre-wrap;');
14066
-
14067
14068
  function getTextHeight(text, width, fontFamily, fontSize, wrap) {
14069
+ const measureBox = document.createElement("div");
14070
+ measureBox.setAttribute(
14071
+ "style",
14072
+ "position: absolute !important; top: -4000px !important; height: auto !important;" +
14073
+ "padding: 1px 3px !important; box-sizing: border-box; margin: 0 !important; border: 1px solid black !important;" +
14074
+ "line-height: normal !important; visibility: hidden !important;" +
14075
+ "white-space: pre-wrap;"
14076
+ );
14068
14077
  let styles = {
14069
14078
  "baselineMarkerSize" : 0,
14070
14079
  "width" : (wrap === true) ? width + "px" : "auto",
@@ -27774,10 +27783,11 @@
27774
27783
  this.refresh();
27775
27784
  this._view.enableClipboard(true);
27776
27785
 
27777
- this._resizeHandler = function() { this.resize(); }.bind(this);
27786
+ this._resizeHandler = this.resize.bind(this);
27778
27787
  window.addEventListener('resize', this._resizeHandler);
27779
27788
 
27780
- this.element.addEventListener("keydown", this._keyDown.bind(this));
27789
+ this._keyDownHandler = this._keyDown.bind(this);
27790
+ this.element.addEventListener("keydown", this._keyDownHandler);
27781
27791
  }
27782
27792
 
27783
27793
  get view() {
@@ -28188,15 +28198,14 @@
28188
28198
  }
28189
28199
 
28190
28200
  destroy() {
28201
+ window.removeEventListener('resize', this._resizeHandler);
28202
+ this.element.removeEventListener("keydown", this._keyDownHandler);
28203
+
28191
28204
  this.unbind();
28192
28205
 
28193
28206
  this._workbook.destroy();
28194
28207
  this._controller.destroy();
28195
28208
  this._view.destroy();
28196
-
28197
- if (this._resizeHandler) {
28198
- window.removeEventListener('resize', this._resizeHandler);
28199
- }
28200
28209
  }
28201
28210
 
28202
28211
  defineName(name, value, hidden) {
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.1.0",
4
+ "version": "1.1.1-develop.1",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],