@fileverse-dev/fortune-core 1.1.54-patch-4 → 1.1.54
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/es/modules/toolbar.js +12 -15
- package/es/modules/validation.js +1 -1
- package/lib/modules/toolbar.js +12 -15
- package/lib/modules/validation.js +1 -1
- package/package.json +1 -1
package/es/modules/toolbar.js
CHANGED
|
@@ -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, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
19
|
-
var
|
|
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
|
}
|
|
@@ -29,13 +29,10 @@ export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_
|
|
|
29
29
|
var cell = d[r][c];
|
|
30
30
|
var value = void 0;
|
|
31
31
|
if (_.isPlainObject(cell)) {
|
|
32
|
-
value = (cell === null || cell === void 0 ? void 0 : cell.v) || ((
|
|
32
|
+
value = (cell === null || cell === void 0 ? void 0 : cell.v) || ((_b = (_a = cell === null || cell === void 0 ? void 0 : cell.ct) === null || _a === void 0 ? void 0 : _a.s[0]) === null || _b === void 0 ? void 0 : _b.v);
|
|
33
33
|
} else {
|
|
34
34
|
value = cell;
|
|
35
35
|
}
|
|
36
|
-
if (_.isNil(value)) {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
36
|
if (foucsStatus !== "@" && isRealNum(value)) {
|
|
40
37
|
value = Number(value);
|
|
41
38
|
}
|
|
@@ -56,12 +53,12 @@ export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_
|
|
|
56
53
|
cell.ct.fa = foucsStatus;
|
|
57
54
|
cell.ct.t = type;
|
|
58
55
|
cell.v = String(value);
|
|
59
|
-
cell.fc = cell.fc || ((
|
|
60
|
-
cell.bl = cell.bl || ((
|
|
61
|
-
cell.it = cell.it || ((
|
|
62
|
-
cell.un = cell.un || ((
|
|
63
|
-
cell.fs = cell.fs || ((
|
|
64
|
-
cell.cl = cell.cl || ((
|
|
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);
|
|
65
62
|
} else {
|
|
66
63
|
d[r][c] = {
|
|
67
64
|
ct: {
|
|
@@ -127,9 +124,9 @@ export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_
|
|
|
127
124
|
if (value && _.isPlainObject(value)) {
|
|
128
125
|
updateInlineStringFormatOutside(value, attr, foucsStatus);
|
|
129
126
|
value[attr] = foucsStatus;
|
|
130
|
-
(
|
|
127
|
+
(_y = ctx.luckysheetfile[sheetIndex]).config || (_y.config = {});
|
|
131
128
|
var cfg = ctx.luckysheetfile[sheetIndex].config;
|
|
132
|
-
var cellWidth = ((
|
|
129
|
+
var cellWidth = ((_w = cfg.columnlen) === null || _w === void 0 ? void 0 : _w[c]) || ctx.luckysheetfile[sheetIndex].defaultColWidth;
|
|
133
130
|
if (attr === "fs" && canvas) {
|
|
134
131
|
var textInfo = getCellTextInfo(d[r][c], canvas, ctx, {
|
|
135
132
|
r: r,
|
|
@@ -138,7 +135,7 @@ export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_
|
|
|
138
135
|
});
|
|
139
136
|
if (!textInfo) continue;
|
|
140
137
|
var rowHeight = _.round(textInfo.textHeightAll);
|
|
141
|
-
var currentRowHeight = ((
|
|
138
|
+
var currentRowHeight = ((_x = cfg.rowlen) === null || _x === void 0 ? void 0 : _x[r]) || ctx.luckysheetfile[sheetIndex].defaultRowHeight || 19;
|
|
142
139
|
if (!_.isUndefined(rowHeight) && rowHeight > currentRowHeight && (!cfg.customHeight || cfg.customHeight[r] !== 1)) {
|
|
143
140
|
if (_.isUndefined(cfg.rowlen)) cfg.rowlen = {};
|
|
144
141
|
_.set(cfg, "rowlen.".concat(r), rowHeight);
|
package/es/modules/validation.js
CHANGED
|
@@ -22,7 +22,7 @@ export function isHexValue(str) {
|
|
|
22
22
|
return /^0x?[a-fA-F0-9]+$/.test(str);
|
|
23
23
|
}
|
|
24
24
|
export function isRealNum(val) {
|
|
25
|
-
if (isHexValue(val
|
|
25
|
+
if (isHexValue(val.toString())) {
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
28
|
if (_.isNil(val) || val.toString().replace(/\s/g, "") === "") {
|
package/lib/modules/toolbar.js
CHANGED
|
@@ -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, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
52
|
-
var
|
|
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
|
}
|
|
@@ -62,13 +62,10 @@ function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col
|
|
|
62
62
|
var cell = d[r][c];
|
|
63
63
|
var value = void 0;
|
|
64
64
|
if (_lodash.default.isPlainObject(cell)) {
|
|
65
|
-
value = (cell === null || cell === void 0 ? void 0 : cell.v) || ((
|
|
65
|
+
value = (cell === null || cell === void 0 ? void 0 : cell.v) || ((_b = (_a = cell === null || cell === void 0 ? void 0 : cell.ct) === null || _a === void 0 ? void 0 : _a.s[0]) === null || _b === void 0 ? void 0 : _b.v);
|
|
66
66
|
} else {
|
|
67
67
|
value = cell;
|
|
68
68
|
}
|
|
69
|
-
if (_lodash.default.isNil(value)) {
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
69
|
if (foucsStatus !== "@" && (0, _validation.isRealNum)(value)) {
|
|
73
70
|
value = Number(value);
|
|
74
71
|
}
|
|
@@ -89,12 +86,12 @@ function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col
|
|
|
89
86
|
cell.ct.fa = foucsStatus;
|
|
90
87
|
cell.ct.t = type;
|
|
91
88
|
cell.v = String(value);
|
|
92
|
-
cell.fc = cell.fc || ((
|
|
93
|
-
cell.bl = cell.bl || ((
|
|
94
|
-
cell.it = cell.it || ((
|
|
95
|
-
cell.un = cell.un || ((
|
|
96
|
-
cell.fs = cell.fs || ((
|
|
97
|
-
cell.cl = cell.cl || ((
|
|
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);
|
|
98
95
|
} else {
|
|
99
96
|
d[r][c] = {
|
|
100
97
|
ct: {
|
|
@@ -160,9 +157,9 @@ function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col
|
|
|
160
157
|
if (value && _lodash.default.isPlainObject(value)) {
|
|
161
158
|
(0, _inlineString.updateInlineStringFormatOutside)(value, attr, foucsStatus);
|
|
162
159
|
value[attr] = foucsStatus;
|
|
163
|
-
(
|
|
160
|
+
(_y = ctx.luckysheetfile[sheetIndex]).config || (_y.config = {});
|
|
164
161
|
var cfg = ctx.luckysheetfile[sheetIndex].config;
|
|
165
|
-
var cellWidth = ((
|
|
162
|
+
var cellWidth = ((_w = cfg.columnlen) === null || _w === void 0 ? void 0 : _w[c]) || ctx.luckysheetfile[sheetIndex].defaultColWidth;
|
|
166
163
|
if (attr === "fs" && canvas) {
|
|
167
164
|
var textInfo = (0, _text.getCellTextInfo)(d[r][c], canvas, ctx, {
|
|
168
165
|
r: r,
|
|
@@ -171,7 +168,7 @@ function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col
|
|
|
171
168
|
});
|
|
172
169
|
if (!textInfo) continue;
|
|
173
170
|
var rowHeight = _lodash.default.round(textInfo.textHeightAll);
|
|
174
|
-
var currentRowHeight = ((
|
|
171
|
+
var currentRowHeight = ((_x = cfg.rowlen) === null || _x === void 0 ? void 0 : _x[r]) || ctx.luckysheetfile[sheetIndex].defaultRowHeight || 19;
|
|
175
172
|
if (!_lodash.default.isUndefined(rowHeight) && rowHeight > currentRowHeight && (!cfg.customHeight || cfg.customHeight[r] !== 1)) {
|
|
176
173
|
if (_lodash.default.isUndefined(cfg.rowlen)) cfg.rowlen = {};
|
|
177
174
|
_lodash.default.set(cfg, "rowlen.".concat(r), rowHeight);
|
|
@@ -38,7 +38,7 @@ function isHexValue(str) {
|
|
|
38
38
|
return /^0x?[a-fA-F0-9]+$/.test(str);
|
|
39
39
|
}
|
|
40
40
|
function isRealNum(val) {
|
|
41
|
-
if (isHexValue(val
|
|
41
|
+
if (isHexValue(val.toString())) {
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
if (_lodash.default.isNil(val) || val.toString().replace(/\s/g, "") === "") {
|