@progress/kendo-spreadsheet-common 1.2.2-develop.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 +11 -9
- package/dist/index.js +11 -9
- package/package.json +1 -1
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(
|
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(
|