@fileverse-dev/fortune-core 1.2.42 → 1.2.43
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/merge.js +7 -6
- package/es/modules/text.js +3 -1
- package/lib/modules/merge.js +7 -6
- package/lib/modules/text.js +3 -1
- package/package.json +1 -1
package/es/modules/merge.js
CHANGED
|
@@ -2,6 +2,7 @@ import _ from "lodash";
|
|
|
2
2
|
import { getSheetIndex } from "../utils";
|
|
3
3
|
import { isInlineStringCT } from "./inline-string";
|
|
4
4
|
export function mergeCells(ctx, sheetId, ranges, type) {
|
|
5
|
+
var _a, _b, _c;
|
|
5
6
|
var idx = getSheetIndex(ctx, sheetId);
|
|
6
7
|
if (idx == null) return;
|
|
7
8
|
var sheet = ctx.luckysheetfile[idx];
|
|
@@ -112,8 +113,8 @@ export function mergeCells(ctx, sheetId, ranges, type) {
|
|
|
112
113
|
for (var r = r1; r <= r2; r += 1) {
|
|
113
114
|
for (var c = c1; c <= c2; c += 1) {
|
|
114
115
|
var cell = d[r][c];
|
|
115
|
-
if (cell != null && (isInlineStringCT(cell.ct) || !_.isEmpty(cell.v) || cell.f != null) && !isfirst) {
|
|
116
|
-
fv = _.cloneDeep(cell)
|
|
116
|
+
if (cell != null && (isInlineStringCT(cell.ct) || !_.isEmpty(cell.v) || cell.f != null || cell.s != null || cell.ct && ((_a = cell.ct.s) === null || _a === void 0 ? void 0 : _a.length)) && !isfirst) {
|
|
117
|
+
fv = _.cloneDeep(cell);
|
|
117
118
|
isfirst = true;
|
|
118
119
|
}
|
|
119
120
|
d[r][c] = {
|
|
@@ -145,8 +146,8 @@ export function mergeCells(ctx, sheetId, ranges, type) {
|
|
|
145
146
|
var isfirst = false;
|
|
146
147
|
for (var r = r1; r <= r2; r += 1) {
|
|
147
148
|
var cell = d[r][c];
|
|
148
|
-
if (cell != null && (!_.isEmpty(cell.v) || cell.f != null) && !isfirst) {
|
|
149
|
-
fv = _.cloneDeep(cell)
|
|
149
|
+
if (cell != null && (isInlineStringCT(cell.ct) || !_.isEmpty(cell.v) || cell.f != null || cell.s != null || cell.ct && ((_b = cell.ct.s) === null || _b === void 0 ? void 0 : _b.length)) && !isfirst) {
|
|
150
|
+
fv = _.cloneDeep(cell);
|
|
150
151
|
isfirst = true;
|
|
151
152
|
}
|
|
152
153
|
d[r][c] = {
|
|
@@ -178,8 +179,8 @@ export function mergeCells(ctx, sheetId, ranges, type) {
|
|
|
178
179
|
var isfirst = false;
|
|
179
180
|
for (var c = c1; c <= c2; c += 1) {
|
|
180
181
|
var cell = d[r][c];
|
|
181
|
-
if (cell != null && (!_.isEmpty(cell.v) || cell.f != null) && !isfirst) {
|
|
182
|
-
fv = _.cloneDeep(cell)
|
|
182
|
+
if (cell != null && (isInlineStringCT(cell.ct) || !_.isEmpty(cell.v) || cell.f != null || cell.s != null || cell.ct && ((_c = cell.ct.s) === null || _c === void 0 ? void 0 : _c.length)) && !isfirst) {
|
|
183
|
+
fv = _.cloneDeep(cell);
|
|
183
184
|
isfirst = true;
|
|
184
185
|
}
|
|
185
186
|
d[r][c] = {
|
package/es/modules/text.js
CHANGED
|
@@ -308,7 +308,9 @@ export function getCellTextInfo(cell, renderCtx, sheetCtx, option, ctx) {
|
|
|
308
308
|
});
|
|
309
309
|
similarIndex += 1;
|
|
310
310
|
} else {
|
|
311
|
-
var newValueArray =
|
|
311
|
+
var newValueArray = Array.from(new Intl.Segmenter().segment(newValue), function (s) {
|
|
312
|
+
return s.segment;
|
|
313
|
+
});
|
|
312
314
|
for (var n = 0; n < newValueArray.length; n += 1) {
|
|
313
315
|
var nv = newValueArray[n];
|
|
314
316
|
inlineStringArr.push({
|
package/lib/modules/merge.js
CHANGED
|
@@ -9,6 +9,7 @@ var _utils = require("../utils");
|
|
|
9
9
|
var _inlineString = require("./inline-string");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
function mergeCells(ctx, sheetId, ranges, type) {
|
|
12
|
+
var _a, _b, _c;
|
|
12
13
|
var idx = (0, _utils.getSheetIndex)(ctx, sheetId);
|
|
13
14
|
if (idx == null) return;
|
|
14
15
|
var sheet = ctx.luckysheetfile[idx];
|
|
@@ -119,8 +120,8 @@ function mergeCells(ctx, sheetId, ranges, type) {
|
|
|
119
120
|
for (var r = r1; r <= r2; r += 1) {
|
|
120
121
|
for (var c = c1; c <= c2; c += 1) {
|
|
121
122
|
var cell = d[r][c];
|
|
122
|
-
if (cell != null && ((0, _inlineString.isInlineStringCT)(cell.ct) || !_lodash.default.isEmpty(cell.v) || cell.f != null) && !isfirst) {
|
|
123
|
-
fv = _lodash.default.cloneDeep(cell)
|
|
123
|
+
if (cell != null && ((0, _inlineString.isInlineStringCT)(cell.ct) || !_lodash.default.isEmpty(cell.v) || cell.f != null || cell.s != null || cell.ct && ((_a = cell.ct.s) === null || _a === void 0 ? void 0 : _a.length)) && !isfirst) {
|
|
124
|
+
fv = _lodash.default.cloneDeep(cell);
|
|
124
125
|
isfirst = true;
|
|
125
126
|
}
|
|
126
127
|
d[r][c] = {
|
|
@@ -152,8 +153,8 @@ function mergeCells(ctx, sheetId, ranges, type) {
|
|
|
152
153
|
var isfirst = false;
|
|
153
154
|
for (var r = r1; r <= r2; r += 1) {
|
|
154
155
|
var cell = d[r][c];
|
|
155
|
-
if (cell != null && (!_lodash.default.isEmpty(cell.v) || cell.f != null) && !isfirst) {
|
|
156
|
-
fv = _lodash.default.cloneDeep(cell)
|
|
156
|
+
if (cell != null && ((0, _inlineString.isInlineStringCT)(cell.ct) || !_lodash.default.isEmpty(cell.v) || cell.f != null || cell.s != null || cell.ct && ((_b = cell.ct.s) === null || _b === void 0 ? void 0 : _b.length)) && !isfirst) {
|
|
157
|
+
fv = _lodash.default.cloneDeep(cell);
|
|
157
158
|
isfirst = true;
|
|
158
159
|
}
|
|
159
160
|
d[r][c] = {
|
|
@@ -185,8 +186,8 @@ function mergeCells(ctx, sheetId, ranges, type) {
|
|
|
185
186
|
var isfirst = false;
|
|
186
187
|
for (var c = c1; c <= c2; c += 1) {
|
|
187
188
|
var cell = d[r][c];
|
|
188
|
-
if (cell != null && (!_lodash.default.isEmpty(cell.v) || cell.f != null) && !isfirst) {
|
|
189
|
-
fv = _lodash.default.cloneDeep(cell)
|
|
189
|
+
if (cell != null && ((0, _inlineString.isInlineStringCT)(cell.ct) || !_lodash.default.isEmpty(cell.v) || cell.f != null || cell.s != null || cell.ct && ((_c = cell.ct.s) === null || _c === void 0 ? void 0 : _c.length)) && !isfirst) {
|
|
190
|
+
fv = _lodash.default.cloneDeep(cell);
|
|
190
191
|
isfirst = true;
|
|
191
192
|
}
|
|
192
193
|
d[r][c] = {
|
package/lib/modules/text.js
CHANGED
|
@@ -322,7 +322,9 @@ function getCellTextInfo(cell, renderCtx, sheetCtx, option, ctx) {
|
|
|
322
322
|
});
|
|
323
323
|
similarIndex += 1;
|
|
324
324
|
} else {
|
|
325
|
-
var newValueArray =
|
|
325
|
+
var newValueArray = Array.from(new Intl.Segmenter().segment(newValue), function (s) {
|
|
326
|
+
return s.segment;
|
|
327
|
+
});
|
|
326
328
|
for (var n = 0; n < newValueArray.length; n += 1) {
|
|
327
329
|
var nv = newValueArray[n];
|
|
328
330
|
inlineStringArr.push({
|