@fileverse-dev/fortune-core 1.1.49 → 1.1.51

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.
@@ -355,7 +355,7 @@ export function handleArrowKey(ctx, e) {
355
355
  var spans = doc.querySelectorAll("span");
356
356
  var lastSpan = spans[spans.length - 1];
357
357
  var notFunctionInit = !((_b = document.getElementById("luckysheet-rich-text-editor")) === null || _b === void 0 ? void 0 : _b.innerText.includes("("));
358
- if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && /^[a-zA-Z]+$/.test(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) && !_.includes(["="], lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
358
+ if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) === '""' || notFunctionInit && /^[a-zA-Z]+$/.test(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) && !_.includes(["="], lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
359
359
  return;
360
360
  }
361
361
  }
@@ -94,7 +94,6 @@ export function getCellValue(r, c, data, attr) {
94
94
  }
95
95
  export function setCellValue(ctx, r, c, d, v) {
96
96
  var _a, _b, _c, _d, _e, _f, _g;
97
- console.log("setCellValue", r, c, v);
98
97
  if (_.isNil(d)) {
99
98
  d = getFlowdata(ctx);
100
99
  }
@@ -285,7 +284,6 @@ export function setCellValue(ctx, r, c, d, v) {
285
284
  format = "0";
286
285
  }
287
286
  cell.m = v.m ? v.m : update(format, cell.v);
288
- console.log("cell.m", cell.m, format, vupdate, v);
289
287
  cell.ht = 2;
290
288
  cell.ct = {
291
289
  fa: format,
@@ -502,7 +500,6 @@ export function cancelNormalSelected(ctx) {
502
500
  }
503
501
  export function updateCell(ctx, r, c, $input, value, canvas) {
504
502
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
505
- console.log("updateCell", r, c, $input, value);
506
503
  var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
507
504
  var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
508
505
  var flowdata = getFlowdata(ctx);
@@ -598,7 +595,6 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
598
595
  if (!isCurInline) {
599
596
  if (_.isString(value) && value.slice(0, 1) === "=" && value.length > 1) {
600
597
  var v = execfunction(ctx, value, r, c, undefined, undefined, true);
601
- console.log("v", v, value);
602
598
  isRunExecFunction = false;
603
599
  curv = _.cloneDeep(((_c = d === null || d === void 0 ? void 0 : d[r]) === null || _c === void 0 ? void 0 : _c[c]) || {});
604
600
  curv.v = v[1], curv.f = v[2];
@@ -28,7 +28,6 @@ import { locale } from "../locale";
28
28
  import { colors } from "./color";
29
29
  import { colLocation, mousePosition, rowLocation } from "./location";
30
30
  import { cancelFunctionrangeSelected, seletedHighlistByindex, spillSortResult } from ".";
31
- import { isLetterNumberPattern, removeLastSpan } from "../utils/index";
32
31
  var functionHTMLIndex = 0;
33
32
  var rangeIndexes = [];
34
33
  var operatorPriority = {
@@ -1949,14 +1948,6 @@ export function functionStrChange(txt, type, rc, orient, stindex, step) {
1949
1948
  }
1950
1949
  export function rangeSetValue(ctx, cellInput, selected, fxInput) {
1951
1950
  var _a, _b, _c, _d, _e;
1952
- var parser = new DOMParser();
1953
- var doc = parser.parseFromString("<div>".concat(cellInput.innerHTML, "</div>"), "text/html");
1954
- var spans = doc.querySelectorAll("span");
1955
- var lastSpan = spans[spans.length - 1];
1956
- if (lastSpan && isLetterNumberPattern(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
1957
- var htmlR = removeLastSpan(cellInput.innerHTML);
1958
- cellInput.innerHTML = "".concat(htmlR);
1959
- }
1960
1951
  var $editor = cellInput;
1961
1952
  var $copyTo = fxInput;
1962
1953
  if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.id) === "luckysheet-functionbox-cell") {
@@ -365,7 +365,7 @@ function handleArrowKey(ctx, e) {
365
365
  var spans = doc.querySelectorAll("span");
366
366
  var lastSpan = spans[spans.length - 1];
367
367
  var notFunctionInit = !((_b = document.getElementById("luckysheet-rich-text-editor")) === null || _b === void 0 ? void 0 : _b.innerText.includes("("));
368
- if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && /^[a-zA-Z]+$/.test(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) && !_lodash.default.includes(["="], lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
368
+ if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) === '""' || notFunctionInit && /^[a-zA-Z]+$/.test(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) && !_lodash.default.includes(["="], lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
369
369
  return;
370
370
  }
371
371
  }
@@ -124,7 +124,6 @@ function getCellValue(r, c, data, attr) {
124
124
  }
125
125
  function setCellValue(ctx, r, c, d, v) {
126
126
  var _a, _b, _c, _d, _e, _f, _g;
127
- console.log("setCellValue", r, c, v);
128
127
  if (_lodash.default.isNil(d)) {
129
128
  d = (0, _context.getFlowdata)(ctx);
130
129
  }
@@ -315,7 +314,6 @@ function setCellValue(ctx, r, c, d, v) {
315
314
  format = "0";
316
315
  }
317
316
  cell.m = v.m ? v.m : (0, _format.update)(format, cell.v);
318
- console.log("cell.m", cell.m, format, vupdate, v);
319
317
  cell.ht = 2;
320
318
  cell.ct = {
321
319
  fa: format,
@@ -532,7 +530,6 @@ function cancelNormalSelected(ctx) {
532
530
  }
533
531
  function updateCell(ctx, r, c, $input, value, canvas) {
534
532
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
535
- console.log("updateCell", r, c, $input, value);
536
533
  var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
537
534
  var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
538
535
  var flowdata = (0, _context.getFlowdata)(ctx);
@@ -628,7 +625,6 @@ function updateCell(ctx, r, c, $input, value, canvas) {
628
625
  if (!isCurInline) {
629
626
  if (_lodash.default.isString(value) && value.slice(0, 1) === "=" && value.length > 1) {
630
627
  var v = (0, _formula.execfunction)(ctx, value, r, c, undefined, undefined, true);
631
- console.log("v", v, value);
632
628
  isRunExecFunction = false;
633
629
  curv = _lodash.default.cloneDeep(((_c = d === null || d === void 0 ? void 0 : d[r]) === null || _c === void 0 ? void 0 : _c[c]) || {});
634
630
  curv.v = v[1], curv.f = v[2];
@@ -38,7 +38,6 @@ 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");
42
41
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
43
42
  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); }
44
43
  var __assign = void 0 && (void 0).__assign || function () {
@@ -1979,14 +1978,6 @@ function functionStrChange(txt, type, rc, orient, stindex, step) {
1979
1978
  }
1980
1979
  function rangeSetValue(ctx, cellInput, selected, fxInput) {
1981
1980
  var _a, _b, _c, _d, _e;
1982
- var parser = new DOMParser();
1983
- var doc = parser.parseFromString("<div>".concat(cellInput.innerHTML, "</div>"), "text/html");
1984
- var spans = doc.querySelectorAll("span");
1985
- var lastSpan = spans[spans.length - 1];
1986
- if (lastSpan && (0, _index.isLetterNumberPattern)(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
1987
- var htmlR = (0, _index.removeLastSpan)(cellInput.innerHTML);
1988
- cellInput.innerHTML = "".concat(htmlR);
1989
- }
1990
1981
  var $editor = cellInput;
1991
1982
  var $copyTo = fxInput;
1992
1983
  if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.id) === "luckysheet-functionbox-cell") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.1.49",
3
+ "version": "1.1.51",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",