@fileverse-dev/fortune-core 1.1.29 → 1.1.31

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.
@@ -1899,7 +1899,7 @@ export function fixColumnStyleOverflowInFreeze(ctx, c1, c2, freeze) {
1899
1899
  return ret;
1900
1900
  }
1901
1901
  export function calcSelectionInfo(ctx, lang) {
1902
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1902
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1903
1903
  var selection = ctx.luckysheet_select_save;
1904
1904
  var numberC = 0;
1905
1905
  var count = 0;
@@ -1916,8 +1916,8 @@ export function calcSelectionInfo(ctx, lang) {
1916
1916
  if ((_f = (_e = (_d = data[r][c]) === null || _d === void 0 ? void 0 : _d.ct) === null || _e === void 0 ? void 0 : _e.fa) === null || _f === void 0 ? void 0 : _f.includes("#,##0")) {
1917
1917
  value = (_g = data[r][c]) === null || _g === void 0 ? void 0 : _g.v;
1918
1918
  }
1919
- if (((_j = (_h = data[r][c]) === null || _h === void 0 ? void 0 : _h.ct) === null || _j === void 0 ? void 0 : _j.t) === 'inlineStr' && (value === null || value === undefined || value === '') && ((_l = (_k = data[r][c]) === null || _k === void 0 ? void 0 : _k.ct) === null || _l === void 0 ? void 0 : _l.s)) {
1920
- value = (_p = (_o = (_m = data[r][c]) === null || _m === void 0 ? void 0 : _m.ct) === null || _o === void 0 ? void 0 : _o.s[0]) === null || _p === void 0 ? void 0 : _p.v;
1919
+ if (((_j = (_h = data[r][c]) === null || _h === void 0 ? void 0 : _h.ct) === null || _j === void 0 ? void 0 : _j.t) === "inlineStr" && (value === null || value === undefined || value === "") && ((_l = (_k = data[r][c]) === null || _k === void 0 ? void 0 : _k.ct) === null || _l === void 0 ? void 0 : _l.s) && !((_p = (_o = (_m = data[r][c]) === null || _m === void 0 ? void 0 : _m.ct) === null || _o === void 0 ? void 0 : _o.s[0]) === null || _p === void 0 ? void 0 : _p.v.includes("\r"))) {
1920
+ value = (_s = (_r = (_q = data[r][c]) === null || _q === void 0 ? void 0 : _q.ct) === null || _r === void 0 ? void 0 : _r.s[0]) === null || _s === void 0 ? void 0 : _s.v;
1921
1921
  }
1922
1922
  if (ct === "n" || ct === "g" && parseFloat(value).toString() !== "NaN" || ct === "inlineStr" && parseFloat(value).toString() !== "NaN") {
1923
1923
  var removeComma = (value === null || value === void 0 ? void 0 : value.replace(/,/g, "")) || "0";
@@ -1933,7 +1933,7 @@ export function calcSelectionInfo(ctx, lang) {
1933
1933
  }
1934
1934
  }
1935
1935
  }
1936
- var formatString = lang && !["zh", "zh_tw"].includes(lang) ? "0.00" : "w0.00";
1936
+ var formatString = lang && !["zh", "zh_tw"].includes(lang) ? "0.00" : "0.00";
1937
1937
  var average = SSF.format(formatString, sum / numberC);
1938
1938
  sum = SSF.format(formatString, sum);
1939
1939
  max = SSF.format(formatString, max);
@@ -15,8 +15,8 @@ import { showLinkCard } from "./hyperlink";
15
15
  import { cfSplitRange } from "./conditionalFormat";
16
16
  import { getCellTextInfo } from "./text";
17
17
  export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col_ed, canvas) {
18
- var _a, _b, _c, _d;
19
- var _e;
18
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
19
+ var _y;
20
20
  if (_.isNil(d) || _.isNil(attr)) {
21
21
  return;
22
22
  }
@@ -52,12 +52,13 @@ export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_
52
52
  }
53
53
  cell.ct.fa = foucsStatus;
54
54
  cell.ct.t = type;
55
- cell.fc = cell.fc || cell.ct.s[0].fc;
56
- cell.bl = cell.bl || cell.ct.s[0].bl;
57
- cell.it = cell.it || cell.ct.s[0].it;
58
- cell.un = cell.un || cell.ct.s[0].un;
59
- cell.fs = cell.fs || cell.ct.s[0].fs;
60
- cell.cl = cell.cl || cell.ct.s[0].cl;
55
+ cell.v = String(value);
56
+ cell.fc = cell.fc || ((_e = (_d = (_c = cell.ct) === null || _c === void 0 ? void 0 : _c.s) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.fc);
57
+ cell.bl = cell.bl || ((_h = (_g = (_f = cell.ct) === null || _f === void 0 ? void 0 : _f.s) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.bl);
58
+ cell.it = cell.it || ((_l = (_k = (_j = cell.ct) === null || _j === void 0 ? void 0 : _j.s) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.it);
59
+ cell.un = cell.un || ((_p = (_o = (_m = cell.ct) === null || _m === void 0 ? void 0 : _m.s) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.un);
60
+ cell.fs = cell.fs || ((_s = (_r = (_q = cell.ct) === null || _q === void 0 ? void 0 : _q.s) === null || _r === void 0 ? void 0 : _r[0]) === null || _s === void 0 ? void 0 : _s.fs);
61
+ cell.cl = cell.cl || ((_v = (_u = (_t = cell.ct) === null || _t === void 0 ? void 0 : _t.s) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.cl);
61
62
  } else {
62
63
  d[r][c] = {
63
64
  ct: {
@@ -123,9 +124,9 @@ export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_
123
124
  if (value && _.isPlainObject(value)) {
124
125
  updateInlineStringFormatOutside(value, attr, foucsStatus);
125
126
  value[attr] = foucsStatus;
126
- (_e = ctx.luckysheetfile[sheetIndex]).config || (_e.config = {});
127
+ (_y = ctx.luckysheetfile[sheetIndex]).config || (_y.config = {});
127
128
  var cfg = ctx.luckysheetfile[sheetIndex].config;
128
- var cellWidth = ((_c = cfg.columnlen) === null || _c === void 0 ? void 0 : _c[c]) || ctx.luckysheetfile[sheetIndex].defaultColWidth;
129
+ var cellWidth = ((_w = cfg.columnlen) === null || _w === void 0 ? void 0 : _w[c]) || ctx.luckysheetfile[sheetIndex].defaultColWidth;
129
130
  if (attr === "fs" && canvas) {
130
131
  var textInfo = getCellTextInfo(d[r][c], canvas, ctx, {
131
132
  r: r,
@@ -134,7 +135,7 @@ export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_
134
135
  });
135
136
  if (!textInfo) continue;
136
137
  var rowHeight = _.round(textInfo.textHeightAll);
137
- var currentRowHeight = ((_d = cfg.rowlen) === null || _d === void 0 ? void 0 : _d[r]) || ctx.luckysheetfile[sheetIndex].defaultRowHeight || 19;
138
+ var currentRowHeight = ((_x = cfg.rowlen) === null || _x === void 0 ? void 0 : _x[r]) || ctx.luckysheetfile[sheetIndex].defaultRowHeight || 19;
138
139
  if (!_.isUndefined(rowHeight) && rowHeight > currentRowHeight && (!cfg.customHeight || cfg.customHeight[r] !== 1)) {
139
140
  if (_.isUndefined(cfg.rowlen)) cfg.rowlen = {};
140
141
  _.set(cfg, "rowlen.".concat(r), rowHeight);
@@ -1934,7 +1934,7 @@ function fixColumnStyleOverflowInFreeze(ctx, c1, c2, freeze) {
1934
1934
  return ret;
1935
1935
  }
1936
1936
  function calcSelectionInfo(ctx, lang) {
1937
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1937
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1938
1938
  var selection = ctx.luckysheet_select_save;
1939
1939
  var numberC = 0;
1940
1940
  var count = 0;
@@ -1951,8 +1951,8 @@ function calcSelectionInfo(ctx, lang) {
1951
1951
  if ((_f = (_e = (_d = data[r][c]) === null || _d === void 0 ? void 0 : _d.ct) === null || _e === void 0 ? void 0 : _e.fa) === null || _f === void 0 ? void 0 : _f.includes("#,##0")) {
1952
1952
  value = (_g = data[r][c]) === null || _g === void 0 ? void 0 : _g.v;
1953
1953
  }
1954
- if (((_j = (_h = data[r][c]) === null || _h === void 0 ? void 0 : _h.ct) === null || _j === void 0 ? void 0 : _j.t) === 'inlineStr' && (value === null || value === undefined || value === '') && ((_l = (_k = data[r][c]) === null || _k === void 0 ? void 0 : _k.ct) === null || _l === void 0 ? void 0 : _l.s)) {
1955
- value = (_p = (_o = (_m = data[r][c]) === null || _m === void 0 ? void 0 : _m.ct) === null || _o === void 0 ? void 0 : _o.s[0]) === null || _p === void 0 ? void 0 : _p.v;
1954
+ if (((_j = (_h = data[r][c]) === null || _h === void 0 ? void 0 : _h.ct) === null || _j === void 0 ? void 0 : _j.t) === "inlineStr" && (value === null || value === undefined || value === "") && ((_l = (_k = data[r][c]) === null || _k === void 0 ? void 0 : _k.ct) === null || _l === void 0 ? void 0 : _l.s) && !((_p = (_o = (_m = data[r][c]) === null || _m === void 0 ? void 0 : _m.ct) === null || _o === void 0 ? void 0 : _o.s[0]) === null || _p === void 0 ? void 0 : _p.v.includes("\r"))) {
1955
+ value = (_s = (_r = (_q = data[r][c]) === null || _q === void 0 ? void 0 : _q.ct) === null || _r === void 0 ? void 0 : _r.s[0]) === null || _s === void 0 ? void 0 : _s.v;
1956
1956
  }
1957
1957
  if (ct === "n" || ct === "g" && parseFloat(value).toString() !== "NaN" || ct === "inlineStr" && parseFloat(value).toString() !== "NaN") {
1958
1958
  var removeComma = (value === null || value === void 0 ? void 0 : value.replace(/,/g, "")) || "0";
@@ -1968,7 +1968,7 @@ function calcSelectionInfo(ctx, lang) {
1968
1968
  }
1969
1969
  }
1970
1970
  }
1971
- var formatString = lang && !["zh", "zh_tw"].includes(lang) ? "0.00" : "w0.00";
1971
+ var formatString = lang && !["zh", "zh_tw"].includes(lang) ? "0.00" : "0.00";
1972
1972
  var average = _ssf.default.format(formatString, sum / numberC);
1973
1973
  sum = _ssf.default.format(formatString, sum);
1974
1974
  max = _ssf.default.format(formatString, max);
@@ -48,8 +48,8 @@ var _conditionalFormat = require("./conditionalFormat");
48
48
  var _text = require("./text");
49
49
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
50
50
  function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col_ed, canvas) {
51
- var _a, _b, _c, _d;
52
- var _e;
51
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
52
+ var _y;
53
53
  if (_lodash.default.isNil(d) || _lodash.default.isNil(attr)) {
54
54
  return;
55
55
  }
@@ -85,12 +85,13 @@ function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col
85
85
  }
86
86
  cell.ct.fa = foucsStatus;
87
87
  cell.ct.t = type;
88
- cell.fc = cell.fc || cell.ct.s[0].fc;
89
- cell.bl = cell.bl || cell.ct.s[0].bl;
90
- cell.it = cell.it || cell.ct.s[0].it;
91
- cell.un = cell.un || cell.ct.s[0].un;
92
- cell.fs = cell.fs || cell.ct.s[0].fs;
93
- cell.cl = cell.cl || cell.ct.s[0].cl;
88
+ cell.v = String(value);
89
+ cell.fc = cell.fc || ((_e = (_d = (_c = cell.ct) === null || _c === void 0 ? void 0 : _c.s) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.fc);
90
+ cell.bl = cell.bl || ((_h = (_g = (_f = cell.ct) === null || _f === void 0 ? void 0 : _f.s) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.bl);
91
+ cell.it = cell.it || ((_l = (_k = (_j = cell.ct) === null || _j === void 0 ? void 0 : _j.s) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.it);
92
+ cell.un = cell.un || ((_p = (_o = (_m = cell.ct) === null || _m === void 0 ? void 0 : _m.s) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.un);
93
+ cell.fs = cell.fs || ((_s = (_r = (_q = cell.ct) === null || _q === void 0 ? void 0 : _q.s) === null || _r === void 0 ? void 0 : _r[0]) === null || _s === void 0 ? void 0 : _s.fs);
94
+ cell.cl = cell.cl || ((_v = (_u = (_t = cell.ct) === null || _t === void 0 ? void 0 : _t.s) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.cl);
94
95
  } else {
95
96
  d[r][c] = {
96
97
  ct: {
@@ -156,9 +157,9 @@ function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col
156
157
  if (value && _lodash.default.isPlainObject(value)) {
157
158
  (0, _inlineString.updateInlineStringFormatOutside)(value, attr, foucsStatus);
158
159
  value[attr] = foucsStatus;
159
- (_e = ctx.luckysheetfile[sheetIndex]).config || (_e.config = {});
160
+ (_y = ctx.luckysheetfile[sheetIndex]).config || (_y.config = {});
160
161
  var cfg = ctx.luckysheetfile[sheetIndex].config;
161
- var cellWidth = ((_c = cfg.columnlen) === null || _c === void 0 ? void 0 : _c[c]) || ctx.luckysheetfile[sheetIndex].defaultColWidth;
162
+ var cellWidth = ((_w = cfg.columnlen) === null || _w === void 0 ? void 0 : _w[c]) || ctx.luckysheetfile[sheetIndex].defaultColWidth;
162
163
  if (attr === "fs" && canvas) {
163
164
  var textInfo = (0, _text.getCellTextInfo)(d[r][c], canvas, ctx, {
164
165
  r: r,
@@ -167,7 +168,7 @@ function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col
167
168
  });
168
169
  if (!textInfo) continue;
169
170
  var rowHeight = _lodash.default.round(textInfo.textHeightAll);
170
- var currentRowHeight = ((_d = cfg.rowlen) === null || _d === void 0 ? void 0 : _d[r]) || ctx.luckysheetfile[sheetIndex].defaultRowHeight || 19;
171
+ var currentRowHeight = ((_x = cfg.rowlen) === null || _x === void 0 ? void 0 : _x[r]) || ctx.luckysheetfile[sheetIndex].defaultRowHeight || 19;
171
172
  if (!_lodash.default.isUndefined(rowHeight) && rowHeight > currentRowHeight && (!cfg.customHeight || cfg.customHeight[r] !== 1)) {
172
173
  if (_lodash.default.isUndefined(cfg.rowlen)) cfg.rowlen = {};
173
174
  _lodash.default.set(cfg, "rowlen.".concat(r), rowHeight);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.1.29",
3
+ "version": "1.1.31",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",