@leankylin-sheet/excel 5.1.6 → 5.1.8
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 +20 -7
- package/dist/index.js +20 -7
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -5084,13 +5084,24 @@ var setStyleAndValue = function setStyleAndValue(table, worksheet) {
|
|
|
5084
5084
|
var dbrow = worksheet.getRow(rowid + 1);
|
|
5085
5085
|
dbrow.height = (((_table$config = table.config) === null || _table$config === void 0 ? void 0 : (_table$config$rowlen = _table$config.rowlen) === null || _table$config$rowlen === void 0 ? void 0 : _table$config$rowlen[rowid]) || 19) / 1.2;
|
|
5086
5086
|
row.every(function (cell, columnid) {
|
|
5087
|
-
var _cell$
|
|
5087
|
+
var _cell$ct4;
|
|
5088
5088
|
if (rowid === 0) {
|
|
5089
5089
|
var _table$config2, _table$config2$column;
|
|
5090
5090
|
var dobCol = worksheet.getColumn(columnid + 1);
|
|
5091
5091
|
dobCol.width = (((_table$config2 = table.config) === null || _table$config2 === void 0 ? void 0 : (_table$config2$column = _table$config2.columnlen) === null || _table$config2$column === void 0 ? void 0 : _table$config2$column[columnid]) || 73) / 8;
|
|
5092
5092
|
}
|
|
5093
5093
|
if (!cell) return true;
|
|
5094
|
+
function getFa() {
|
|
5095
|
+
return cell.ct.fa;
|
|
5096
|
+
}
|
|
5097
|
+
function getT() {
|
|
5098
|
+
var _cell$ct, _cell$ct2, _cell$ct2$fa, _cell$ct3;
|
|
5099
|
+
if ((cell === null || cell === void 0 ? void 0 : (_cell$ct = cell.ct) === null || _cell$ct === void 0 ? void 0 : _cell$ct.t) !== "n" && (cell === null || cell === void 0 ? void 0 : (_cell$ct2 = cell.ct) === null || _cell$ct2 === void 0 ? void 0 : (_cell$ct2$fa = _cell$ct2.fa) === null || _cell$ct2$fa === void 0 ? void 0 : _cell$ct2$fa.includes("leanky_"))) {
|
|
5100
|
+
return "n";
|
|
5101
|
+
}
|
|
5102
|
+
return cell === null || cell === void 0 ? void 0 : (_cell$ct3 = cell.ct) === null || _cell$ct3 === void 0 ? void 0 : _cell$ct3.t;
|
|
5103
|
+
}
|
|
5104
|
+
var ctT = getT();
|
|
5094
5105
|
var fill = fillConvert(cell.bg);
|
|
5095
5106
|
var font = fontConvert(cell.ff, cell.fc, cell.bl, cell.it, cell.fs, cell.cl, cell.un);
|
|
5096
5107
|
var alignment = alignmentConvert(cell.vt, cell.ht, cell.tb && parseInt(cell.tb, 10), cell.tr && parseInt(cell.tr, 10));
|
|
@@ -5098,7 +5109,7 @@ var setStyleAndValue = function setStyleAndValue(table, worksheet) {
|
|
|
5098
5109
|
target.fill = fill;
|
|
5099
5110
|
target.font = font;
|
|
5100
5111
|
target.alignment = alignment;
|
|
5101
|
-
if ((_.isNil(cell.v) || _.isNaN(cell.v)) && (cell === null || cell === void 0 ? void 0 : (_cell$
|
|
5112
|
+
if ((_.isNil(cell.v) || _.isNaN(cell.v)) && (cell === null || cell === void 0 ? void 0 : (_cell$ct4 = cell.ct) === null || _cell$ct4 === void 0 ? void 0 : _cell$ct4.t) !== "inlineStr") return true;
|
|
5102
5113
|
var value;
|
|
5103
5114
|
var v = "";
|
|
5104
5115
|
var numFmt = "";
|
|
@@ -5117,21 +5128,23 @@ var setStyleAndValue = function setStyleAndValue(table, worksheet) {
|
|
|
5117
5128
|
hyperlink: formatHyperlink(hlData === null || hlData === void 0 ? void 0 : hlData.linkAddress)
|
|
5118
5129
|
};
|
|
5119
5130
|
}
|
|
5120
|
-
} else if (cell.ct &&
|
|
5131
|
+
} else if (cell.ct && ctT === "inlineStr") {
|
|
5121
5132
|
var s = cell.ct.s;
|
|
5122
5133
|
s.forEach(function (val) {
|
|
5123
5134
|
v += val.v;
|
|
5124
5135
|
});
|
|
5125
|
-
} else if (cell.ct &&
|
|
5136
|
+
} else if (cell.ct && ctT === "n") {
|
|
5126
5137
|
if (v !== undefined) {
|
|
5127
5138
|
var _cell$v;
|
|
5128
5139
|
v = (_cell$v = cell.v) !== null && _cell$v !== void 0 ? _cell$v : +cell.v;
|
|
5129
5140
|
}
|
|
5130
|
-
if (cell.ct !== "General")
|
|
5131
|
-
|
|
5141
|
+
if (cell.ct !== "General") {
|
|
5142
|
+
numFmt = getFa();
|
|
5143
|
+
}
|
|
5144
|
+
} else if (cell.ct && ctT === "d") {
|
|
5132
5145
|
var mockDate = isTime(cell.ct.fa) ? "2000-01-01 " : "";
|
|
5133
5146
|
v = new Date(mockDate + cell.m);
|
|
5134
|
-
numFmt =
|
|
5147
|
+
numFmt = getFa();
|
|
5135
5148
|
} else {
|
|
5136
5149
|
v = cell.v;
|
|
5137
5150
|
}
|
package/dist/index.js
CHANGED
|
@@ -5096,13 +5096,24 @@ var setStyleAndValue = function setStyleAndValue(table, worksheet) {
|
|
|
5096
5096
|
var dbrow = worksheet.getRow(rowid + 1);
|
|
5097
5097
|
dbrow.height = (((_table$config = table.config) === null || _table$config === void 0 ? void 0 : (_table$config$rowlen = _table$config.rowlen) === null || _table$config$rowlen === void 0 ? void 0 : _table$config$rowlen[rowid]) || 19) / 1.2;
|
|
5098
5098
|
row.every(function (cell, columnid) {
|
|
5099
|
-
var _cell$
|
|
5099
|
+
var _cell$ct4;
|
|
5100
5100
|
if (rowid === 0) {
|
|
5101
5101
|
var _table$config2, _table$config2$column;
|
|
5102
5102
|
var dobCol = worksheet.getColumn(columnid + 1);
|
|
5103
5103
|
dobCol.width = (((_table$config2 = table.config) === null || _table$config2 === void 0 ? void 0 : (_table$config2$column = _table$config2.columnlen) === null || _table$config2$column === void 0 ? void 0 : _table$config2$column[columnid]) || 73) / 8;
|
|
5104
5104
|
}
|
|
5105
5105
|
if (!cell) return true;
|
|
5106
|
+
function getFa() {
|
|
5107
|
+
return cell.ct.fa;
|
|
5108
|
+
}
|
|
5109
|
+
function getT() {
|
|
5110
|
+
var _cell$ct, _cell$ct2, _cell$ct2$fa, _cell$ct3;
|
|
5111
|
+
if ((cell === null || cell === void 0 ? void 0 : (_cell$ct = cell.ct) === null || _cell$ct === void 0 ? void 0 : _cell$ct.t) !== "n" && (cell === null || cell === void 0 ? void 0 : (_cell$ct2 = cell.ct) === null || _cell$ct2 === void 0 ? void 0 : (_cell$ct2$fa = _cell$ct2.fa) === null || _cell$ct2$fa === void 0 ? void 0 : _cell$ct2$fa.includes("leanky_"))) {
|
|
5112
|
+
return "n";
|
|
5113
|
+
}
|
|
5114
|
+
return cell === null || cell === void 0 ? void 0 : (_cell$ct3 = cell.ct) === null || _cell$ct3 === void 0 ? void 0 : _cell$ct3.t;
|
|
5115
|
+
}
|
|
5116
|
+
var ctT = getT();
|
|
5106
5117
|
var fill = fillConvert(cell.bg);
|
|
5107
5118
|
var font = fontConvert(cell.ff, cell.fc, cell.bl, cell.it, cell.fs, cell.cl, cell.un);
|
|
5108
5119
|
var alignment = alignmentConvert(cell.vt, cell.ht, cell.tb && parseInt(cell.tb, 10), cell.tr && parseInt(cell.tr, 10));
|
|
@@ -5110,7 +5121,7 @@ var setStyleAndValue = function setStyleAndValue(table, worksheet) {
|
|
|
5110
5121
|
target.fill = fill;
|
|
5111
5122
|
target.font = font;
|
|
5112
5123
|
target.alignment = alignment;
|
|
5113
|
-
if ((___default['default'].isNil(cell.v) || ___default['default'].isNaN(cell.v)) && (cell === null || cell === void 0 ? void 0 : (_cell$
|
|
5124
|
+
if ((___default['default'].isNil(cell.v) || ___default['default'].isNaN(cell.v)) && (cell === null || cell === void 0 ? void 0 : (_cell$ct4 = cell.ct) === null || _cell$ct4 === void 0 ? void 0 : _cell$ct4.t) !== "inlineStr") return true;
|
|
5114
5125
|
var value;
|
|
5115
5126
|
var v = "";
|
|
5116
5127
|
var numFmt = "";
|
|
@@ -5129,21 +5140,23 @@ var setStyleAndValue = function setStyleAndValue(table, worksheet) {
|
|
|
5129
5140
|
hyperlink: formatHyperlink(hlData === null || hlData === void 0 ? void 0 : hlData.linkAddress)
|
|
5130
5141
|
};
|
|
5131
5142
|
}
|
|
5132
|
-
} else if (cell.ct &&
|
|
5143
|
+
} else if (cell.ct && ctT === "inlineStr") {
|
|
5133
5144
|
var s = cell.ct.s;
|
|
5134
5145
|
s.forEach(function (val) {
|
|
5135
5146
|
v += val.v;
|
|
5136
5147
|
});
|
|
5137
|
-
} else if (cell.ct &&
|
|
5148
|
+
} else if (cell.ct && ctT === "n") {
|
|
5138
5149
|
if (v !== undefined) {
|
|
5139
5150
|
var _cell$v;
|
|
5140
5151
|
v = (_cell$v = cell.v) !== null && _cell$v !== void 0 ? _cell$v : +cell.v;
|
|
5141
5152
|
}
|
|
5142
|
-
if (cell.ct !== "General")
|
|
5143
|
-
|
|
5153
|
+
if (cell.ct !== "General") {
|
|
5154
|
+
numFmt = getFa();
|
|
5155
|
+
}
|
|
5156
|
+
} else if (cell.ct && ctT === "d") {
|
|
5144
5157
|
var mockDate = isTime(cell.ct.fa) ? "2000-01-01 " : "";
|
|
5145
5158
|
v = new Date(mockDate + cell.m);
|
|
5146
|
-
numFmt =
|
|
5159
|
+
numFmt = getFa();
|
|
5147
5160
|
} else {
|
|
5148
5161
|
v = cell.v;
|
|
5149
5162
|
}
|