@leankylin-sheet/core 5.2.21 → 5.2.22

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
@@ -31637,7 +31637,7 @@ function locale(ctx) {
31637
31637
  }
31638
31638
 
31639
31639
  function moveToEnd(obj) {
31640
- if (document.createRange) {
31640
+ if (document.createRange && obj) {
31641
31641
  if (obj.innerHTML !== obj.innerText || obj.innerHTML === "") {
31642
31642
  obj.focus();
31643
31643
  var range = window.getSelection();
@@ -36595,8 +36595,9 @@ function setCaretPosition(ctx, textDom, children, pos) {
36595
36595
  sel === null || sel === void 0 ? void 0 : sel.addRange(range);
36596
36596
  el.focus();
36597
36597
  } catch (err) {
36598
+ var _ctx$formulaCache, _ctx$formulaCache$ran;
36598
36599
  console.error(err);
36599
- moveToEnd(ctx.formulaCache.rangeResizeTo[0]);
36600
+ moveToEnd((_ctx$formulaCache = ctx.formulaCache) === null || _ctx$formulaCache === void 0 ? void 0 : (_ctx$formulaCache$ran = _ctx$formulaCache.rangeResizeTo) === null || _ctx$formulaCache$ran === void 0 ? void 0 : _ctx$formulaCache$ran[0]);
36600
36601
  }
36601
36602
  }
36602
36603
  function functionRange(ctx, obj, v, vp) {
@@ -37310,6 +37311,10 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
37310
37311
  $editor = fxInput;
37311
37312
  $copyTo = cellInput;
37312
37313
  }
37314
+ if (ctx.active_f) {
37315
+ $editor = fxInput;
37316
+ $copyTo = cellInput;
37317
+ }
37313
37318
  var range = "";
37314
37319
  var rf = selected.row[0];
37315
37320
  var cf = selected.column[0];
@@ -37326,6 +37331,7 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
37326
37331
  var span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
37327
37332
  if (span) {
37328
37333
  span.innerHTML = range;
37334
+ console.log(333312);
37329
37335
  setCaretPosition(ctx, span, 0, range.length);
37330
37336
  }
37331
37337
  } else if (ctx.active_f) {
@@ -37339,7 +37345,7 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
37339
37345
  }
37340
37346
  ctx.formulaCache.rangechangeindex = functionHTMLIndex;
37341
37347
  var _span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
37342
- setCaretPosition(ctx, _span, 0, range.length);
37348
+ setCaretPosition(ctx, _span || $editor, 0, range.length);
37343
37349
  functionHTMLIndex += 1;
37344
37350
  } else {
37345
37351
  var _function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
package/dist/index.js CHANGED
@@ -31647,7 +31647,7 @@ function locale(ctx) {
31647
31647
  }
31648
31648
 
31649
31649
  function moveToEnd(obj) {
31650
- if (document.createRange) {
31650
+ if (document.createRange && obj) {
31651
31651
  if (obj.innerHTML !== obj.innerText || obj.innerHTML === "") {
31652
31652
  obj.focus();
31653
31653
  var range = window.getSelection();
@@ -36605,8 +36605,9 @@ function setCaretPosition(ctx, textDom, children, pos) {
36605
36605
  sel === null || sel === void 0 ? void 0 : sel.addRange(range);
36606
36606
  el.focus();
36607
36607
  } catch (err) {
36608
+ var _ctx$formulaCache, _ctx$formulaCache$ran;
36608
36609
  console.error(err);
36609
- moveToEnd(ctx.formulaCache.rangeResizeTo[0]);
36610
+ moveToEnd((_ctx$formulaCache = ctx.formulaCache) === null || _ctx$formulaCache === void 0 ? void 0 : (_ctx$formulaCache$ran = _ctx$formulaCache.rangeResizeTo) === null || _ctx$formulaCache$ran === void 0 ? void 0 : _ctx$formulaCache$ran[0]);
36610
36611
  }
36611
36612
  }
36612
36613
  function functionRange(ctx, obj, v, vp) {
@@ -37320,6 +37321,10 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
37320
37321
  $editor = fxInput;
37321
37322
  $copyTo = cellInput;
37322
37323
  }
37324
+ if (ctx.active_f) {
37325
+ $editor = fxInput;
37326
+ $copyTo = cellInput;
37327
+ }
37323
37328
  var range = "";
37324
37329
  var rf = selected.row[0];
37325
37330
  var cf = selected.column[0];
@@ -37336,6 +37341,7 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
37336
37341
  var span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
37337
37342
  if (span) {
37338
37343
  span.innerHTML = range;
37344
+ console.log(333312);
37339
37345
  setCaretPosition(ctx, span, 0, range.length);
37340
37346
  }
37341
37347
  } else if (ctx.active_f) {
@@ -37349,7 +37355,7 @@ function rangeSetValue(ctx, cellInput, selected, fxInput) {
37349
37355
  }
37350
37356
  ctx.formulaCache.rangechangeindex = functionHTMLIndex;
37351
37357
  var _span = $editor.querySelector("span[rangeindex='".concat(ctx.formulaCache.rangechangeindex, "']"));
37352
- setCaretPosition(ctx, _span, 0, range.length);
37358
+ setCaretPosition(ctx, _span || $editor, 0, range.length);
37353
37359
  functionHTMLIndex += 1;
37354
37360
  } else {
37355
37361
  var _function_str = "<span class=\"leankylin-formula-functionrange-cell\" rangeindex=\"".concat(functionHTMLIndex, "\" dir=\"auto\" style=\"color:").concat(getHLColor(functionHTMLIndex), ";\">").concat(range, "</span>");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "5.2.21",
3
+ "version": "5.2.22",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "build": "father-build"
14
14
  },
15
15
  "dependencies": {
16
- "@leankylin-sheet/formula-parser": "5.2.21",
16
+ "@leankylin-sheet/formula-parser": "5.2.22",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",