@leankylin-sheet/core 7.0.27 → 7.0.29

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
@@ -42217,7 +42217,7 @@ function getRangetxt(ctx, sheetId, range, currentId) {
42217
42217
  var index = getSheetIndex(ctx, sheetId);
42218
42218
  if (index == null) return "";
42219
42219
  sheettxt = ctx.luckysheetfile[index].name.replace(/'/g, "''");
42220
- if (/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/.test(sheettxt)) {
42220
+ if (/^[A-Za-z0-9_\u4E00-\u9FFF]+$/.test(sheettxt)) {
42221
42221
  sheettxt += "!";
42222
42222
  } else {
42223
42223
  sheettxt = "'".concat(sheettxt, "'!");
@@ -47268,8 +47268,20 @@ function editSheetName(ctx, editable) {
47268
47268
  var calc_r = calc.r;
47269
47269
  var calc_c = calc.c;
47270
47270
  var f = data === null || data === void 0 ? void 0 : (_data$calc_r = data[calc_r]) === null || _data$calc_r === void 0 ? void 0 : (_data$calc_r$calc_c = _data$calc_r[calc_c]) === null || _data$calc_r$calc_c === void 0 ? void 0 : _data$calc_r$calc_c.f;
47271
- if (f && f.indexOf("".concat(oldtxt, "!"))) {
47272
- data[calc_r][calc_c].f = f === null || f === void 0 ? void 0 : f.replaceAll("".concat(oldtxt, "!"), "".concat(txt, "!"));
47271
+ if (f) {
47272
+ var oldRefQuoted = "'".concat(oldtxt.replace(/'/g, "''"), "'!");
47273
+ var oldRefPlain = "".concat(oldtxt, "!");
47274
+ var newRef = /^[A-Za-z0-9_\u4E00-\u9FFF]+$/.test(txt) ? "".concat(txt, "!") : "'".concat(txt.replace(/'/g, "''"), "'!");
47275
+ var newF = f;
47276
+ if (newF.includes(oldRefQuoted)) {
47277
+ newF = newF.split(oldRefQuoted).join(newRef);
47278
+ }
47279
+ if (newF.includes(oldRefPlain)) {
47280
+ newF = newF.split(oldRefPlain).join(newRef);
47281
+ }
47282
+ if (newF !== f) {
47283
+ data[calc_r][calc_c].f = newF;
47284
+ }
47273
47285
  }
47274
47286
  }
47275
47287
  }
@@ -56013,8 +56025,14 @@ function updateContextWithCanvas(ctx, canvas, placeholder) {
56013
56025
  ctx.cellmainWidth = canvas.clientWidth - ctx.rowHeaderWidth;
56014
56026
  canvas.style.width = "".concat(ctx.luckysheetTableContentHW[0], "px");
56015
56027
  canvas.style.height = "".concat(ctx.luckysheetTableContentHW[1], "px");
56016
- canvas.width = Math.round(ctx.luckysheetTableContentHW[0] * ctx.devicePixelRatio);
56017
- canvas.height = Math.round(ctx.luckysheetTableContentHW[1] * ctx.devicePixelRatio);
56028
+ var width = Math.round(ctx.luckysheetTableContentHW[0] * ctx.devicePixelRatio);
56029
+ var height = Math.round(ctx.luckysheetTableContentHW[1] * ctx.devicePixelRatio);
56030
+ if (canvas.width !== width) {
56031
+ canvas.width = width;
56032
+ }
56033
+ if (canvas.height !== height) {
56034
+ canvas.height = height;
56035
+ }
56018
56036
  }
56019
56037
 
56020
56038
  var addtionalMergeOps = function addtionalMergeOps(ops, id) {
package/dist/index.js CHANGED
@@ -42227,7 +42227,7 @@ function getRangetxt(ctx, sheetId, range, currentId) {
42227
42227
  var index = getSheetIndex(ctx, sheetId);
42228
42228
  if (index == null) return "";
42229
42229
  sheettxt = ctx.luckysheetfile[index].name.replace(/'/g, "''");
42230
- if (/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/.test(sheettxt)) {
42230
+ if (/^[A-Za-z0-9_\u4E00-\u9FFF]+$/.test(sheettxt)) {
42231
42231
  sheettxt += "!";
42232
42232
  } else {
42233
42233
  sheettxt = "'".concat(sheettxt, "'!");
@@ -47278,8 +47278,20 @@ function editSheetName(ctx, editable) {
47278
47278
  var calc_r = calc.r;
47279
47279
  var calc_c = calc.c;
47280
47280
  var f = data === null || data === void 0 ? void 0 : (_data$calc_r = data[calc_r]) === null || _data$calc_r === void 0 ? void 0 : (_data$calc_r$calc_c = _data$calc_r[calc_c]) === null || _data$calc_r$calc_c === void 0 ? void 0 : _data$calc_r$calc_c.f;
47281
- if (f && f.indexOf("".concat(oldtxt, "!"))) {
47282
- data[calc_r][calc_c].f = f === null || f === void 0 ? void 0 : f.replaceAll("".concat(oldtxt, "!"), "".concat(txt, "!"));
47281
+ if (f) {
47282
+ var oldRefQuoted = "'".concat(oldtxt.replace(/'/g, "''"), "'!");
47283
+ var oldRefPlain = "".concat(oldtxt, "!");
47284
+ var newRef = /^[A-Za-z0-9_\u4E00-\u9FFF]+$/.test(txt) ? "".concat(txt, "!") : "'".concat(txt.replace(/'/g, "''"), "'!");
47285
+ var newF = f;
47286
+ if (newF.includes(oldRefQuoted)) {
47287
+ newF = newF.split(oldRefQuoted).join(newRef);
47288
+ }
47289
+ if (newF.includes(oldRefPlain)) {
47290
+ newF = newF.split(oldRefPlain).join(newRef);
47291
+ }
47292
+ if (newF !== f) {
47293
+ data[calc_r][calc_c].f = newF;
47294
+ }
47283
47295
  }
47284
47296
  }
47285
47297
  }
@@ -56023,8 +56035,14 @@ function updateContextWithCanvas(ctx, canvas, placeholder) {
56023
56035
  ctx.cellmainWidth = canvas.clientWidth - ctx.rowHeaderWidth;
56024
56036
  canvas.style.width = "".concat(ctx.luckysheetTableContentHW[0], "px");
56025
56037
  canvas.style.height = "".concat(ctx.luckysheetTableContentHW[1], "px");
56026
- canvas.width = Math.round(ctx.luckysheetTableContentHW[0] * ctx.devicePixelRatio);
56027
- canvas.height = Math.round(ctx.luckysheetTableContentHW[1] * ctx.devicePixelRatio);
56038
+ var width = Math.round(ctx.luckysheetTableContentHW[0] * ctx.devicePixelRatio);
56039
+ var height = Math.round(ctx.luckysheetTableContentHW[1] * ctx.devicePixelRatio);
56040
+ if (canvas.width !== width) {
56041
+ canvas.width = width;
56042
+ }
56043
+ if (canvas.height !== height) {
56044
+ canvas.height = height;
56045
+ }
56028
56046
  }
56029
56047
 
56030
56048
  var addtionalMergeOps = function addtionalMergeOps(ops, id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "7.0.27",
3
+ "version": "7.0.29",
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": "7.0.27",
16
+ "@leankylin-sheet/formula-parser": "7.0.29",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",