@progress/kendo-spreadsheet-common 1.2.1 → 1.2.2-develop.2

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
@@ -18978,9 +18978,10 @@ class Clipboard {
18978
18978
  doc.open();
18979
18979
  doc.write(data.html);
18980
18980
  doc.close();
18981
- let table = doc.querySelector("table");
18981
+ let table = doc.querySelector("table"),
18982
+ program = doc.head.querySelector("meta[name=ProgId]")?.getAttribute("content");
18982
18983
  if (table) {
18983
- let richState = parseHTML(table);
18984
+ let richState = parseHTML(table, program);
18984
18985
 
18985
18986
  // fixup #### values that are sent by Excel when the column is too
18986
18987
  // narrow. It turns out that the plain text clipboard data contains the
@@ -19067,23 +19068,24 @@ function borderObject(element, styles) {
19067
19068
  return obj;
19068
19069
  }
19069
19070
 
19070
- function cellState(row, col, element, hBorders, vBorders) {
19071
- let styles = window.getComputedStyle(element);
19071
+ function cellState(row, col, element, hBorders, vBorders, program) {
19072
+ let styles = window.getComputedStyle(element),
19073
+ isExcel = typeof program === "string" && program.indexOf("Excel") > -1;
19072
19074
  let value, format, formula;
19073
19075
 
19074
19076
  // google sheets
19075
- if ((value = element.getAttribute("data-sheets-value"))) {
19077
+ if (!isExcel && (value = element.getAttribute("data-sheets-value"))) {
19076
19078
  value = JSON.parse(value);
19077
19079
  value = value[value[1]];
19078
19080
  }
19079
- if ((format = element.getAttribute("data-sheets-numberformat"))) {
19081
+ if (!isExcel && (format = element.getAttribute("data-sheets-numberformat"))) {
19080
19082
  format = JSON.parse(format);
19081
19083
  format = format[format[1]];
19082
19084
  }
19083
19085
  formula = element.getAttribute("data-sheets-formula");
19084
19086
 
19085
19087
  // libre office
19086
- if (value == null && format == null && formula == null) {
19088
+ if (!isExcel && value == null && format == null && formula == null) {
19087
19089
  value = element.getAttribute("sdval");
19088
19090
  format = element.getAttribute("sdnum");
19089
19091
  if (format) {
@@ -19159,7 +19161,7 @@ function cellState(row, col, element, hBorders, vBorders) {
19159
19161
  return state;
19160
19162
  }
19161
19163
 
19162
- function parseHTML(table) {
19164
+ function parseHTML(table, program) {
19163
19165
  let state = newState();
19164
19166
 
19165
19167
  let done = [], row = 0, col = 0;
@@ -19187,7 +19189,7 @@ function parseHTML(table) {
19187
19189
  let style = td.getAttribute("style");
19188
19190
  let ignoreColspan = /mso-ignore:colspan/.test(style);
19189
19191
 
19190
- setStateData(state, row, col, cellState(row, col, td, hBorders, vBorders));
19192
+ setStateData(state, row, col, cellState(row, col, td, hBorders, vBorders, program));
19191
19193
  if (rowSpan > 1 || (colSpan > 1 && !ignoreColspan)) {
19192
19194
  state.mergedCells.push(
19193
19195
  new RangeRef(
@@ -19731,6 +19733,11 @@ class BorderChangeCommand extends Command {
19731
19733
  }
19732
19734
  exec() {
19733
19735
  let self = this;
19736
+
19737
+ if (!self._type) {
19738
+ return;
19739
+ }
19740
+
19734
19741
  self.getState();
19735
19742
  self._batch(function(){
19736
19743
  self[self._type](self._style);
@@ -23550,20 +23557,20 @@ class SpreadsheetWidget extends Widget {
23550
23557
  } else if (controlKey && key === keys.U) {
23551
23558
  this._handleTypographicalEmphasis('underline');
23552
23559
  } else if (e.altKey && key === keys.H) {
23553
- this._view.tabstrip?.select(0);
23560
+ this._view.tabstrip?.select("home");
23554
23561
  e.preventDefault();
23555
23562
  return;
23556
23563
  } else if (e.altKey && key === keys.N) {
23557
- this._view.tabstrip?.select(1);
23564
+ this._view.tabstrip?.select("insert");
23558
23565
  e.preventDefault();
23559
23566
  return;
23560
23567
  } else if (e.altKey && key === keys.A) {
23561
- this._view.tabstrip?.select(2);
23568
+ this._view.tabstrip?.select("data");
23562
23569
  e.preventDefault();
23563
23570
  return;
23564
23571
  } else if (key === keys.F10) {
23565
23572
  e.preventDefault();
23566
- this._view.tabstrip?.wrapper?.find(".k-tabstrip-content.k-active .k-toolbar [tabindex=0]").trigger("focus");
23573
+ this._view.tabstrip?.focus();
23567
23574
  }
23568
23575
  }
23569
23576
 
package/dist/index.js CHANGED
@@ -18979,9 +18979,10 @@
18979
18979
  doc.open();
18980
18980
  doc.write(data.html);
18981
18981
  doc.close();
18982
- let table = doc.querySelector("table");
18982
+ let table = doc.querySelector("table"),
18983
+ program = doc.head.querySelector("meta[name=ProgId]")?.getAttribute("content");
18983
18984
  if (table) {
18984
- let richState = parseHTML(table);
18985
+ let richState = parseHTML(table, program);
18985
18986
 
18986
18987
  // fixup #### values that are sent by Excel when the column is too
18987
18988
  // narrow. It turns out that the plain text clipboard data contains the
@@ -19068,23 +19069,24 @@
19068
19069
  return obj;
19069
19070
  }
19070
19071
 
19071
- function cellState(row, col, element, hBorders, vBorders) {
19072
- let styles = window.getComputedStyle(element);
19072
+ function cellState(row, col, element, hBorders, vBorders, program) {
19073
+ let styles = window.getComputedStyle(element),
19074
+ isExcel = typeof program === "string" && program.indexOf("Excel") > -1;
19073
19075
  let value, format, formula;
19074
19076
 
19075
19077
  // google sheets
19076
- if ((value = element.getAttribute("data-sheets-value"))) {
19078
+ if (!isExcel && (value = element.getAttribute("data-sheets-value"))) {
19077
19079
  value = JSON.parse(value);
19078
19080
  value = value[value[1]];
19079
19081
  }
19080
- if ((format = element.getAttribute("data-sheets-numberformat"))) {
19082
+ if (!isExcel && (format = element.getAttribute("data-sheets-numberformat"))) {
19081
19083
  format = JSON.parse(format);
19082
19084
  format = format[format[1]];
19083
19085
  }
19084
19086
  formula = element.getAttribute("data-sheets-formula");
19085
19087
 
19086
19088
  // libre office
19087
- if (value == null && format == null && formula == null) {
19089
+ if (!isExcel && value == null && format == null && formula == null) {
19088
19090
  value = element.getAttribute("sdval");
19089
19091
  format = element.getAttribute("sdnum");
19090
19092
  if (format) {
@@ -19160,7 +19162,7 @@
19160
19162
  return state;
19161
19163
  }
19162
19164
 
19163
- function parseHTML(table) {
19165
+ function parseHTML(table, program) {
19164
19166
  let state = newState();
19165
19167
 
19166
19168
  let done = [], row = 0, col = 0;
@@ -19188,7 +19190,7 @@
19188
19190
  let style = td.getAttribute("style");
19189
19191
  let ignoreColspan = /mso-ignore:colspan/.test(style);
19190
19192
 
19191
- setStateData(state, row, col, cellState(row, col, td, hBorders, vBorders));
19193
+ setStateData(state, row, col, cellState(row, col, td, hBorders, vBorders, program));
19192
19194
  if (rowSpan > 1 || (colSpan > 1 && !ignoreColspan)) {
19193
19195
  state.mergedCells.push(
19194
19196
  new RangeRef(
@@ -19732,6 +19734,11 @@
19732
19734
  }
19733
19735
  exec() {
19734
19736
  let self = this;
19737
+
19738
+ if (!self._type) {
19739
+ return;
19740
+ }
19741
+
19735
19742
  self.getState();
19736
19743
  self._batch(function(){
19737
19744
  self[self._type](self._style);
@@ -23551,20 +23558,20 @@
23551
23558
  } else if (controlKey && key === keys.U) {
23552
23559
  this._handleTypographicalEmphasis('underline');
23553
23560
  } else if (e.altKey && key === keys.H) {
23554
- this._view.tabstrip?.select(0);
23561
+ this._view.tabstrip?.select("home");
23555
23562
  e.preventDefault();
23556
23563
  return;
23557
23564
  } else if (e.altKey && key === keys.N) {
23558
- this._view.tabstrip?.select(1);
23565
+ this._view.tabstrip?.select("insert");
23559
23566
  e.preventDefault();
23560
23567
  return;
23561
23568
  } else if (e.altKey && key === keys.A) {
23562
- this._view.tabstrip?.select(2);
23569
+ this._view.tabstrip?.select("data");
23563
23570
  e.preventDefault();
23564
23571
  return;
23565
23572
  } else if (key === keys.F10) {
23566
23573
  e.preventDefault();
23567
- this._view.tabstrip?.wrapper?.find(".k-tabstrip-content.k-active .k-toolbar [tabindex=0]").trigger("focus");
23574
+ this._view.tabstrip?.focus();
23568
23575
  }
23569
23576
  }
23570
23577
 
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.2.1",
4
+ "version": "1.2.2-develop.2",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],