@fileverse-dev/fortune-core 1.1.51 → 1.1.53-patch-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.
@@ -7,8 +7,8 @@ exports.handlePaste = handlePaste;
7
7
  exports.handlePasteByClick = handlePasteByClick;
8
8
  exports.parseAsLinkIfUrl = parseAsLinkIfUrl;
9
9
  var _lodash = _interopRequireDefault(require("lodash"));
10
+ var _pasteTableHelpers = require("../paste-table-helpers");
10
11
  var _context = require("../context");
11
- var _locale = require("../locale");
12
12
  var _formula = require("../modules/formula");
13
13
  var _cell = require("../modules/cell");
14
14
  var _format = require("../modules/format");
@@ -18,7 +18,6 @@ var _validation = require("../modules/validation");
18
18
  var _border = require("../modules/border");
19
19
  var _sheet = require("../modules/sheet");
20
20
  var _refresh = require("../modules/refresh");
21
- var _api = require("../api");
22
21
  var _modules = require("../modules");
23
22
  var _clipboard = _interopRequireDefault(require("../modules/clipboard"));
24
23
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1019,9 +1018,75 @@ function parseAsLinkIfUrl(txtdata, ctx) {
1019
1018
  }
1020
1019
  }
1021
1020
  }
1021
+ function autoFitUsingGetCellTextInfo(ctx, sheetId, r1, r2, c1, c2, maxColWidth) {
1022
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1023
+ var _k, _l;
1024
+ if (maxColWidth === void 0) {
1025
+ maxColWidth = 1200;
1026
+ }
1027
+ var sheetIdx = (0, _utils.getSheetIndex)(ctx, sheetId);
1028
+ if (sheetIdx == null) return;
1029
+ var file = ctx.luckysheetfile[sheetIdx];
1030
+ file.config || (file.config = {});
1031
+ var rowlen = (_k = file.config).rowlen || (_k.rowlen = {});
1032
+ var columnlen = (_l = file.config).columnlen || (_l.columnlen = {});
1033
+ var defaultRowH = (_a = file.defaultRowHeight) !== null && _a !== void 0 ? _a : 19;
1034
+ var defaultColW = (_b = ctx.defaultcollen) !== null && _b !== void 0 ? _b : 73;
1035
+ var d = (0, _context.getFlowdata)(ctx) || file.data;
1036
+ var measureCtx = ctx.__offscreenMeasureCtx || document.createElement("canvas").getContext("2d");
1037
+ ctx.__offscreenMeasureCtx = measureCtx;
1038
+ var H_PAD = 8;
1039
+ for (var c = c1; c <= c2; c++) {
1040
+ var curW = (_c = columnlen[c]) !== null && _c !== void 0 ? _c : defaultColW;
1041
+ var wantW = curW;
1042
+ for (var r = r1; r <= r2; r++) {
1043
+ var cell = (_d = d === null || d === void 0 ? void 0 : d[r]) === null || _d === void 0 ? void 0 : _d[c];
1044
+ if ((cell === null || cell === void 0 ? void 0 : cell.mc) && cell.mc.rs == null) continue;
1045
+ var tb = cell === null || cell === void 0 ? void 0 : cell.tb;
1046
+ if (tb === 2 || tb === "2") continue;
1047
+ var info = (0, _modules.getCellTextInfo)(cell, measureCtx, ctx, {
1048
+ r: r,
1049
+ c: c
1050
+ }, ctx);
1051
+ var w = (_e = info === null || info === void 0 ? void 0 : info.textWidthAll) !== null && _e !== void 0 ? _e : 0;
1052
+ if (w + H_PAD > wantW) wantW = w + H_PAD;
1053
+ }
1054
+ if (wantW > curW) {
1055
+ columnlen[c] = Math.min(Math.ceil(wantW), maxColWidth);
1056
+ }
1057
+ }
1058
+ var V_PAD = 4;
1059
+ for (var r = r1; r <= r2; r++) {
1060
+ var curH = (_f = rowlen[r]) !== null && _f !== void 0 ? _f : defaultRowH;
1061
+ var needH = curH;
1062
+ for (var c = c1; c <= c2; c++) {
1063
+ var cell = (_g = d === null || d === void 0 ? void 0 : d[r]) === null || _g === void 0 ? void 0 : _g[c];
1064
+ if ((cell === null || cell === void 0 ? void 0 : cell.mc) && cell.mc.rs == null) continue;
1065
+ var widthForCell = (_h = columnlen[c]) !== null && _h !== void 0 ? _h : defaultColW;
1066
+ var info = (0, _modules.getCellTextInfo)(cell, measureCtx, ctx, {
1067
+ r: r,
1068
+ c: c,
1069
+ cellWidth: widthForCell,
1070
+ cellHeight: curH
1071
+ }, ctx);
1072
+ var h = (_j = info === null || info === void 0 ? void 0 : info.textHeightAll) !== null && _j !== void 0 ? _j : 0;
1073
+ if (h + V_PAD > needH) needH = Math.ceil(h + V_PAD);
1074
+ }
1075
+ if (needH > curH) {
1076
+ rowlen[r] = needH;
1077
+ }
1078
+ }
1079
+ if (typeof window.jfrefreshgrid === "function") {
1080
+ window.jfrefreshgrid(ctx, null, [{
1081
+ row: [r1, r2],
1082
+ column: [c1, c2]
1083
+ }], true, undefined, "resize");
1084
+ }
1085
+ }
1022
1086
  function handlePaste(ctx, e) {
1023
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
1087
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
1024
1088
  var allowEdit = (0, _utils.isAllowEdit)(ctx);
1089
+ console.log("handlePaste -> allowEdit", "jjjj");
1025
1090
  if (!allowEdit) return;
1026
1091
  if (_selection.selectionCache.isPasteAction) {
1027
1092
  ctx.luckysheetCellUpdate = [];
@@ -1105,7 +1170,6 @@ function handlePaste(ctx, e) {
1105
1170
  }
1106
1171
  }
1107
1172
  }
1108
- var locale_fontjson_1 = (0, _locale.locale)(ctx).fontjson;
1109
1173
  if (((_o = (_m = ctx.hooks).beforePaste) === null || _o === void 0 ? void 0 : _o.call(_m, ctx.luckysheet_select_save, txtdata)) === false) {
1110
1174
  return;
1111
1175
  }
@@ -1117,256 +1181,35 @@ function handlePaste(ctx, e) {
1117
1181
  } else {
1118
1182
  pasteHandlerOfCopyPaste(ctx, ctx.luckysheet_copy_save);
1119
1183
  }
1184
+ var last = (_q = ctx.luckysheet_select_save) === null || _q === void 0 ? void 0 : _q[ctx.luckysheet_select_save.length - 1];
1185
+ if (last) {
1186
+ autoFitUsingGetCellTextInfo(ctx, ctx.currentSheetId, last.row[0], last.row[1], last.column[0], last.column[1]);
1187
+ }
1120
1188
  } else if (txtdata.indexOf("fortune-copy-action-image") > -1) {} else {
1121
1189
  if (txtdata.indexOf("table") > -1) {
1122
- var ele = document.createElement("div");
1123
- ele.innerHTML = txtdata;
1124
- var trList = ele.querySelectorAll("table tr");
1125
- if (trList.length === 0) {
1126
- ele.remove();
1127
- return;
1128
- }
1129
- var data_1 = new Array(trList.length);
1130
- var colLen_1 = 0;
1131
- _lodash.default.forEach(trList[0].querySelectorAll("td, th"), function (td) {
1132
- var colspan = td.colSpan;
1133
- if (Number.isNaN(colspan)) {
1134
- colspan = 1;
1135
- }
1136
- colLen_1 += colspan;
1137
- });
1138
- for (var i = 0; i < data_1.length; i += 1) {
1139
- data_1[i] = new Array(colLen_1);
1140
- }
1141
- var r_1 = 0;
1142
- var borderInfo_1 = {};
1143
- var styleInner = ((_q = ele.querySelectorAll("style")[0]) === null || _q === void 0 ? void 0 : _q.innerHTML) || "";
1144
- var patternReg = /{([^}]*)}/g;
1145
- var patternStyle = styleInner.match(patternReg);
1146
- var nameReg = /^[^\t].*/gm;
1147
- var patternName = _lodash.default.initial(styleInner.match(nameReg));
1148
- var allStyleList_1 = patternName.length === (patternStyle === null || patternStyle === void 0 ? void 0 : patternStyle.length) && _typeof(patternName) === _typeof(patternStyle) ? _lodash.default.fromPairs(_lodash.default.zip(patternName, patternStyle)) : {};
1149
- var index_1 = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
1150
- if (!_lodash.default.isNil(index_1)) {
1151
- if (_lodash.default.isNil(ctx.luckysheetfile[index_1].config)) {
1152
- ctx.luckysheetfile[index_1].config = {};
1153
- }
1154
- if (_lodash.default.isNil(ctx.luckysheetfile[index_1].config.rowlen)) {
1155
- ctx.luckysheetfile[index_1].config.rowlen = {};
1156
- }
1157
- var rowHeightList_1 = ctx.luckysheetfile[index_1].config.rowlen;
1158
- _lodash.default.forEach(trList, function (tr) {
1159
- var c = 0;
1160
- var targetR = ctx.luckysheet_select_save[0].row[0] + r_1;
1161
- var targetRowHeight = !_lodash.default.isNil(tr.getAttribute("height")) ? parseInt(tr.getAttribute("height"), 10) : null;
1162
- if (_lodash.default.has(ctx.luckysheetfile[index_1].config.rowlen, targetR) && ctx.luckysheetfile[index_1].config.rowlen[targetR] !== targetRowHeight || !_lodash.default.has(ctx.luckysheetfile[index_1].config.rowlen, targetR) && ctx.luckysheetfile[index_1].defaultRowHeight !== targetRowHeight) {
1163
- rowHeightList_1[targetR] = targetRowHeight;
1164
- }
1165
- _lodash.default.forEach(tr.querySelectorAll("td, th"), function (element) {
1166
- var td = element;
1167
- var className = td.className;
1168
- var cell = {};
1169
- var txt = td.innerText || td.innerHTML;
1170
- if (_lodash.default.trim(txt).length === 0) {
1171
- cell.v = undefined;
1172
- cell.m = "";
1173
- } else {
1174
- var mask = (0, _format.genarate)(txt);
1175
- cell.m = mask[0], cell.ct = mask[1], cell.v = mask[2];
1176
- if (/^0x?[a-fA-F0-9]+$/.test(txt)) {
1177
- cell.ct = {
1178
- fa: "@",
1179
- t: "s"
1180
- };
1181
- cell.m = txt;
1182
- cell.v = txt;
1183
- }
1184
- }
1185
- var styleString = typeof allStyleList_1[".".concat(className)] === "string" ? allStyleList_1[".".concat(className)].substring(1, allStyleList_1[".".concat(className)].length - 1).split("\n\t") : [];
1186
- var styles = {};
1187
- _lodash.default.forEach(styleString, function (s) {
1188
- var styleList = s.split(":");
1189
- styles[styleList[0]] = styleList === null || styleList === void 0 ? void 0 : styleList[1].replace(";", "");
1190
- });
1191
- if (!_lodash.default.isNil(styles.border)) td.style.border = styles.border;
1192
- var bg = td.style.backgroundColor || styles.background;
1193
- if (bg === "rgba(0, 0, 0, 0)" || _lodash.default.isEmpty(bg)) {
1194
- bg = undefined;
1195
- }
1196
- cell.bg = bg;
1197
- var fontWight = td.style.fontWeight;
1198
- cell.bl = (fontWight.toString() === "400" || fontWight === "normal" || _lodash.default.isEmpty(fontWight)) && !_lodash.default.includes(styles["font-style"], "bold") && (!styles["font-weight"] || styles["font-weight"] === "400") ? 0 : 1;
1199
- cell.it = (td.style.fontStyle === "normal" || _lodash.default.isEmpty(td.style.fontStyle)) && !_lodash.default.includes(styles["font-style"], "italic") ? 0 : 1;
1200
- cell.un = !_lodash.default.includes(styles["text-decoration"], "underline") ? undefined : 1;
1201
- cell.cl = !_lodash.default.includes(td.innerHTML, "<s>") ? undefined : 1;
1202
- var ff = td.style.fontFamily || styles["font-family"] || "";
1203
- var ffs = ff.split(",");
1204
- for (var i = 0; i < ffs.length; i += 1) {
1205
- var fa = _lodash.default.trim(ffs[i].toLowerCase());
1206
- fa = locale_fontjson_1[fa];
1207
- if (_lodash.default.isNil(fa)) {
1208
- cell.ff = 0;
1209
- } else {
1210
- cell.ff = fa;
1211
- break;
1212
- }
1213
- }
1214
- var fs = Math.round(styles["font-size"] ? parseInt(styles["font-size"].replace("pt", ""), 10) : parseInt(td.style.fontSize || "13", 10) * 72 / 96);
1215
- cell.fs = fs;
1216
- cell.fc = td.style.color || styles.color;
1217
- var ht = td.style.textAlign || styles["text-align"] || "left";
1218
- if (ht === "center") {
1219
- cell.ht = 0;
1220
- } else if (ht === "right") {
1221
- cell.ht = 2;
1222
- } else {
1223
- cell.ht = 1;
1224
- }
1225
- var regex = /vertical-align:\s*(.*?);/;
1226
- var vt = td.style.verticalAlign || styles["vertical-align"] || !_lodash.default.isNil(allStyleList_1.td) && allStyleList_1.td.match(regex).length > 0 && allStyleList_1.td.match(regex)[1] || "top";
1227
- if (vt === "middle") {
1228
- cell.vt = 0;
1229
- } else if (vt === "top" || vt === "text-top") {
1230
- cell.vt = 1;
1231
- } else {
1232
- cell.vt = 2;
1233
- }
1234
- if ("mso-rotate" in styles) {
1235
- var rt = styles["mso-rotate"];
1236
- cell.rt = parseFloat(rt);
1237
- }
1238
- while (c < colLen_1 && !_lodash.default.isNil(data_1[r_1][c])) {
1239
- c += 1;
1240
- }
1241
- if (c === colLen_1) {
1242
- return true;
1243
- }
1244
- if (_lodash.default.isNil(data_1[r_1][c])) {
1245
- data_1[r_1][c] = cell;
1246
- var rowspan = parseInt(td.getAttribute("rowspan"), 10);
1247
- var colspan = parseInt(td.getAttribute("colspan"), 10);
1248
- if (Number.isNaN(rowspan)) {
1249
- rowspan = 1;
1250
- }
1251
- if (Number.isNaN(colspan)) {
1252
- colspan = 1;
1253
- }
1254
- var r_ab = ctx.luckysheet_select_save[0].row[0] + r_1;
1255
- var c_ab = ctx.luckysheet_select_save[0].column[0] + c;
1256
- for (var rp = 0; rp < rowspan; rp += 1) {
1257
- for (var cp = 0; cp < colspan; cp += 1) {
1258
- if (rp === 0) {
1259
- var bt = td.style.borderTop;
1260
- if (!_lodash.default.isEmpty(bt) && bt.substring(0, 3).toLowerCase() !== "0px") {
1261
- var width = td.style.borderTopWidth;
1262
- var type = td.style.borderTopStyle;
1263
- var color = td.style.borderTopColor;
1264
- var borderconfig = (0, _cell.getQKBorder)(width, type, color);
1265
- if (!borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)]) {
1266
- borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)] = {};
1267
- }
1268
- borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)].t = {
1269
- style: borderconfig[0],
1270
- color: borderconfig[1]
1271
- };
1272
- }
1273
- }
1274
- if (rp === rowspan - 1) {
1275
- var bb = td.style.borderBottom;
1276
- if (!_lodash.default.isEmpty(bb) && bb.substring(0, 3).toLowerCase() !== "0px") {
1277
- var width = td.style.borderBottomWidth;
1278
- var type = td.style.borderBottomStyle;
1279
- var color = td.style.borderBottomColor;
1280
- var borderconfig = (0, _cell.getQKBorder)(width, type, color);
1281
- if (!borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)]) {
1282
- borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)] = {};
1283
- }
1284
- borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)].b = {
1285
- style: borderconfig[0],
1286
- color: borderconfig[1]
1287
- };
1288
- }
1289
- }
1290
- if (cp === 0) {
1291
- var bl = td.style.borderLeft;
1292
- if (!_lodash.default.isEmpty(bl) && bl.substring(0, 3).toLowerCase() !== "0px") {
1293
- var width = td.style.borderLeftWidth;
1294
- var type = td.style.borderLeftStyle;
1295
- var color = td.style.borderLeftColor;
1296
- var borderconfig = (0, _cell.getQKBorder)(width, type, color);
1297
- if (!borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)]) {
1298
- borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)] = {};
1299
- }
1300
- borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)].l = {
1301
- style: borderconfig[0],
1302
- color: borderconfig[1]
1303
- };
1304
- }
1305
- }
1306
- if (cp === colspan - 1) {
1307
- var br = td.style.borderLeft;
1308
- if (!_lodash.default.isEmpty(br) && br.substring(0, 3).toLowerCase() !== "0px") {
1309
- var width = td.style.borderRightWidth;
1310
- var type = td.style.borderRightStyle;
1311
- var color = td.style.borderRightColor;
1312
- var borderconfig = (0, _cell.getQKBorder)(width, type, color);
1313
- if (!borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)]) {
1314
- borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)] = {};
1315
- }
1316
- borderInfo_1["".concat(r_1 + rp, "_").concat(c + cp)].r = {
1317
- style: borderconfig[0],
1318
- color: borderconfig[1]
1319
- };
1320
- }
1321
- }
1322
- if (rp === 0 && cp === 0) {
1323
- continue;
1324
- }
1325
- data_1[r_1 + rp][c + cp] = {
1326
- mc: {
1327
- r: r_ab,
1328
- c: c_ab
1329
- }
1330
- };
1331
- }
1332
- }
1333
- if (rowspan > 1 || colspan > 1) {
1334
- var first = {
1335
- rs: rowspan,
1336
- cs: colspan,
1337
- r: r_ab,
1338
- c: c_ab
1339
- };
1340
- data_1[r_1][c].mc = first;
1341
- }
1342
- }
1343
- c += 1;
1344
- if (c === colLen_1) {
1345
- return true;
1346
- }
1347
- return true;
1348
- });
1349
- r_1 += 1;
1350
- });
1351
- (0, _api.setRowHeight)(ctx, rowHeightList_1);
1352
- }
1353
- ctx.luckysheet_selection_range = [];
1354
- pasteHandler(ctx, data_1, borderInfo_1);
1355
- ele.remove();
1190
+ (0, _pasteTableHelpers.pasteHtmlTableAndAutoFit)(ctx, txtdata, pasteHandler);
1356
1191
  } else if (clipboardData.files.length === 1 && clipboardData.files[0].type.indexOf("image") > -1) {} else {
1357
1192
  txtdata = clipboardData.getData("text/plain");
1358
1193
  var isExcelFormula = txtdata.startsWith("=");
1359
1194
  if (isExcelFormula) {
1360
1195
  handleFormulaStringPaste(ctx, txtdata);
1196
+ var last = (_r = ctx.luckysheet_select_save) === null || _r === void 0 ? void 0 : _r[ctx.luckysheet_select_save.length - 1];
1197
+ if (last) {
1198
+ autoFitUsingGetCellTextInfo(ctx, ctx.currentSheetId, last.row[0], last.row[1], last.column[0], last.column[1]);
1199
+ }
1361
1200
  } else {
1362
1201
  pasteHandler(ctx, txtdata);
1202
+ var last = (_s = ctx.luckysheet_select_save) === null || _s === void 0 ? void 0 : _s[ctx.luckysheet_select_save.length - 1];
1203
+ if (last) {
1204
+ autoFitUsingGetCellTextInfo(ctx, ctx.currentSheetId, last.row[0], last.row[1], last.column[0], last.column[1]);
1205
+ }
1363
1206
  var _txtdata = clipboardData.getData("text/html") || clipboardData.getData("text/plain");
1364
1207
  var embedUrl = (0, _modules.sanitizeDuneUrl)(_txtdata);
1365
1208
  if (embedUrl) {
1366
- var last = (_r = ctx.luckysheet_select_save) === null || _r === void 0 ? void 0 : _r[ctx.luckysheet_select_save.length - 1];
1367
- if (last) {
1368
- var rowIndex = (_u = (_s = last.row_focus) !== null && _s !== void 0 ? _s : (_t = last.row) === null || _t === void 0 ? void 0 : _t[0]) !== null && _u !== void 0 ? _u : 0;
1369
- var colIndex = (_x = (_v = last.column_focus) !== null && _v !== void 0 ? _v : (_w = last.column) === null || _w === void 0 ? void 0 : _w[0]) !== null && _x !== void 0 ? _x : 0;
1209
+ var _last = (_t = ctx.luckysheet_select_save) === null || _t === void 0 ? void 0 : _t[ctx.luckysheet_select_save.length - 1];
1210
+ if (_last) {
1211
+ var rowIndex = (_w = (_u = _last.row_focus) !== null && _u !== void 0 ? _u : (_v = _last.row) === null || _v === void 0 ? void 0 : _v[0]) !== null && _w !== void 0 ? _w : 0;
1212
+ var colIndex = (_z = (_x = _last.column_focus) !== null && _x !== void 0 ? _x : (_y = _last.column) === null || _y === void 0 ? void 0 : _y[0]) !== null && _z !== void 0 ? _z : 0;
1370
1213
  var left = colIndex === 0 ? 0 : ctx.visibledatacolumn[colIndex - 1];
1371
1214
  var top_1 = rowIndex === 0 ? 0 : ctx.visibledatarow[rowIndex + 5];
1372
1215
  ctx.showDunePreview = {
@@ -38,6 +38,7 @@ var _locale = require("../locale");
38
38
  var _color = require("./color");
39
39
  var _location = require("./location");
40
40
  var _2 = require(".");
41
+ var _index = require("../utils/index");
41
42
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
42
43
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
43
44
  var __assign = void 0 && (void 0).__assign || function () {
@@ -1276,7 +1277,9 @@ function setCaretPosition(ctx, textDom, children, pos) {
1276
1277
  el.focus();
1277
1278
  } catch (err) {
1278
1279
  console.error(err);
1279
- moveCursorToEnd(textDom);
1280
+ setTimeout(function () {
1281
+ moveCursorToEnd(textDom);
1282
+ }, 10);
1280
1283
  }
1281
1284
  }
1282
1285
  function functionRange(ctx, obj, v, vp) {
@@ -1978,6 +1981,14 @@ function functionStrChange(txt, type, rc, orient, stindex, step) {
1978
1981
  }
1979
1982
  function rangeSetValue(ctx, cellInput, selected, fxInput) {
1980
1983
  var _a, _b, _c, _d, _e;
1984
+ var parser = new DOMParser();
1985
+ var doc = parser.parseFromString("<div>".concat(cellInput.innerHTML, "</div>"), "text/html");
1986
+ var spans = doc.querySelectorAll("span");
1987
+ var lastSpan = spans[spans.length - 1];
1988
+ if (lastSpan && (0, _index.isLetterNumberPattern)(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
1989
+ var htmlR = (0, _index.removeLastSpan)(cellInput.innerHTML);
1990
+ cellInput.innerHTML = "".concat(htmlR);
1991
+ }
1981
1992
  var $editor = cellInput;
1982
1993
  var $copyTo = fxInput;
1983
1994
  if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.id) === "luckysheet-functionbox-cell") {
@@ -0,0 +1,2 @@
1
+ import { Context } from "./context";
2
+ export declare function pasteHtmlTableAndAutoFit(ctx: Context, html: string, pasteHandler: (context: Context, data: any, borderInfo?: any) => void): void;