@corbe30/fortune-excel 1.0.3

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.
Files changed (44) hide show
  1. package/.github/workflows/main.yml +30 -0
  2. package/.github/workflows/publish.yml +30 -0
  3. package/.storybook/main.ts +18 -0
  4. package/.storybook/preview.ts +15 -0
  5. package/LICENSE +21 -0
  6. package/README.md +59 -0
  7. package/dist/HandleZip.d.ts +8 -0
  8. package/dist/HandleZip.js +37 -0
  9. package/dist/ICommon.d.ts +34 -0
  10. package/dist/ICommon.js +1 -0
  11. package/dist/ToExcel/ExcelBorder.d.ts +3 -0
  12. package/dist/ToExcel/ExcelBorder.js +1412 -0
  13. package/dist/ToExcel/ExcelConvert.d.ts +16 -0
  14. package/dist/ToExcel/ExcelConvert.js +92 -0
  15. package/dist/ToExcel/ExcelFile.d.ts +1 -0
  16. package/dist/ToExcel/ExcelFile.js +30 -0
  17. package/dist/ToExcel/ExcelImage.d.ts +2 -0
  18. package/dist/ToExcel/ExcelImage.js +64 -0
  19. package/dist/ToExcel/ExcelStyle.d.ts +3 -0
  20. package/dist/ToExcel/ExcelStyle.js +53 -0
  21. package/dist/ToFortuneSheet/FortuneBase.d.ts +133 -0
  22. package/dist/ToFortuneSheet/FortuneBase.js +28 -0
  23. package/dist/ToFortuneSheet/FortuneCell.d.ts +25 -0
  24. package/dist/ToFortuneSheet/FortuneCell.js +782 -0
  25. package/dist/ToFortuneSheet/FortuneFile.d.ts +50 -0
  26. package/dist/ToFortuneSheet/FortuneFile.js +432 -0
  27. package/dist/ToFortuneSheet/FortuneImage.d.ts +20 -0
  28. package/dist/ToFortuneSheet/FortuneImage.js +51 -0
  29. package/dist/ToFortuneSheet/FortuneSheet.d.ts +36 -0
  30. package/dist/ToFortuneSheet/FortuneSheet.js +581 -0
  31. package/dist/ToFortuneSheet/IFortune.d.ts +301 -0
  32. package/dist/ToFortuneSheet/IFortune.js +1 -0
  33. package/dist/ToFortuneSheet/ReadXml.d.ts +61 -0
  34. package/dist/ToFortuneSheet/ReadXml.js +337 -0
  35. package/dist/common/constant.d.ts +25 -0
  36. package/dist/common/constant.js +277 -0
  37. package/dist/common/emf.d.ts +3 -0
  38. package/dist/common/emf.js +1294 -0
  39. package/dist/common/method.d.ts +132 -0
  40. package/dist/common/method.js +1075 -0
  41. package/dist/main.d.ts +2 -0
  42. package/dist/main.js +24 -0
  43. package/package.json +47 -0
  44. package/tsconfig.json +13 -0
@@ -0,0 +1,1412 @@
1
+ import { getObjType, rgb2hex } from "../common/method.js";
2
+ var setBorder = function (lucksheetfile, worksheet) {
3
+ if (!lucksheetfile)
4
+ return;
5
+ const luckyToExcel = {
6
+ style: {
7
+ 0: "none",
8
+ 1: "thin",
9
+ 2: "hair",
10
+ 3: "dotted",
11
+ 4: "dashDot", // 'Dashed',
12
+ 5: "dashDot",
13
+ 6: "dashDotDot",
14
+ 7: "double",
15
+ 8: "medium",
16
+ 9: "mediumDashed",
17
+ 10: "mediumDashDot",
18
+ 11: "mediumDashDotDot",
19
+ 12: "slantDashDot",
20
+ 13: "thick",
21
+ },
22
+ };
23
+ //获取所有的单元格边框的信息
24
+ const borderInfoCompute = getBorderInfo(lucksheetfile);
25
+ for (let x in borderInfoCompute) {
26
+ let border = {};
27
+ let info = borderInfoCompute[x];
28
+ let row = parseInt(x.substr(0, x.indexOf("_")));
29
+ let column = parseInt(x.substr(x.indexOf("_") + 1));
30
+ if (info.t != undefined) {
31
+ const tcolor = info.t.color.indexOf("rgb") > -1 ? rgb2hex(info.t.color) : info.t.color;
32
+ border["top"] = {
33
+ style: luckyToExcel.style[info.t.style],
34
+ color: { argb: tcolor.replace("#", "") },
35
+ };
36
+ }
37
+ if (info.r != undefined) {
38
+ const rcolor = info.r.color.indexOf("rgb") > -1 ? rgb2hex(info.r.color) : info.r.color;
39
+ border["right"] = {
40
+ style: luckyToExcel.style[info.r.style],
41
+ color: { argb: rcolor.replace("#", "") },
42
+ };
43
+ }
44
+ if (info.b != undefined) {
45
+ const bcolor = info.b.color.indexOf("rgb") > -1 ? rgb2hex(info.b.color) : info.b.color;
46
+ border["bottom"] = {
47
+ style: luckyToExcel.style[info.b.style],
48
+ color: { argb: bcolor.replace("#", "") },
49
+ };
50
+ }
51
+ if (info.l != undefined) {
52
+ const lcolor = info.l.color.indexOf("rgb") > -1 ? rgb2hex(info.l.color) : info.l.color;
53
+ border["left"] = {
54
+ style: luckyToExcel.style[info.l.style],
55
+ color: { argb: lcolor.replace("#", "") },
56
+ };
57
+ }
58
+ worksheet.getCell(row + 1, column + 1).border = border;
59
+ }
60
+ };
61
+ var getBorderInfo = function (luckysheetfile) {
62
+ var _a, _b, _c, _d;
63
+ let borderInfoCompute = {};
64
+ let cfg = luckysheetfile.config;
65
+ let data = luckysheetfile.data;
66
+ if (!cfg || !data)
67
+ return {};
68
+ let borderInfo = cfg["borderInfo"];
69
+ //设置需要计算边框的区域
70
+ let dataset_row_st = 0, dataset_row_ed = data.length, dataset_col_st = 0, dataset_col_ed = data[0].length;
71
+ if (borderInfo != null && borderInfo.length > 0) {
72
+ for (let i = 0; i < borderInfo.length; i++) {
73
+ let rangeType = borderInfo[i].rangeType;
74
+ if (rangeType == "range") {
75
+ let borderType = borderInfo[i].borderType;
76
+ let borderColor = borderInfo[i].color;
77
+ let borderStyle = borderInfo[i].style;
78
+ let borderRange = borderInfo[i].range;
79
+ for (let j = 0; j < borderRange.length; j++) {
80
+ let bd_r1 = borderRange[j].row[0], bd_r2 = borderRange[j].row[1];
81
+ let bd_c1 = borderRange[j].column[0], bd_c2 = borderRange[j].column[1];
82
+ if (bd_r1 < dataset_row_st) {
83
+ bd_r1 = dataset_row_st;
84
+ }
85
+ if (bd_r2 > dataset_row_ed) {
86
+ bd_r2 = dataset_row_ed;
87
+ }
88
+ if (bd_c1 < dataset_col_st) {
89
+ bd_c1 = dataset_col_st;
90
+ }
91
+ if (bd_c2 > dataset_col_ed) {
92
+ bd_c2 = dataset_col_ed;
93
+ }
94
+ if (borderType == "border-left") {
95
+ for (let bd_r = bd_r1; bd_r <= bd_r2; bd_r++) {
96
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r] != null) {
97
+ continue;
98
+ }
99
+ if (borderInfoCompute[bd_r + "_" + bd_c1] == null) {
100
+ borderInfoCompute[bd_r + "_" + bd_c1] = {};
101
+ }
102
+ borderInfoCompute[bd_r + "_" + bd_c1].l = {
103
+ color: borderColor,
104
+ style: borderStyle,
105
+ };
106
+ let bd_c_left = bd_c1 - 1;
107
+ if (bd_c_left >= 0 && borderInfoCompute[bd_r + "_" + bd_c_left]) {
108
+ if (data[bd_r] != null &&
109
+ getObjType(data[bd_r][bd_c_left]) == "object" &&
110
+ data[bd_r][bd_c_left].mc != null) {
111
+ let cell_left = data[bd_r][bd_c_left];
112
+ let mc = cfg["merge"][((_a = cell_left === null || cell_left === void 0 ? void 0 : cell_left.mc) === null || _a === void 0 ? void 0 : _a.r) + "_" + ((_b = cell_left === null || cell_left === void 0 ? void 0 : cell_left.mc) === null || _b === void 0 ? void 0 : _b.c)];
113
+ if (mc.c + mc.cs - 1 == bd_c_left) {
114
+ borderInfoCompute[bd_r + "_" + bd_c_left].r = {
115
+ color: borderColor,
116
+ style: borderStyle,
117
+ };
118
+ }
119
+ }
120
+ else {
121
+ borderInfoCompute[bd_r + "_" + bd_c_left].r = {
122
+ color: borderColor,
123
+ style: borderStyle,
124
+ };
125
+ }
126
+ }
127
+ let mc = cfg["merge"] || {};
128
+ for (const key in mc) {
129
+ let { c, r, cs, rs } = mc[key];
130
+ if (bd_c1 <= c + cs - 1 &&
131
+ bd_c1 > c &&
132
+ bd_r >= r &&
133
+ bd_r <= r + rs - 1) {
134
+ borderInfoCompute[bd_r + "_" + bd_c1].l = null;
135
+ }
136
+ }
137
+ }
138
+ }
139
+ else if (borderType == "border-right") {
140
+ for (let bd_r = bd_r1; bd_r <= bd_r2; bd_r++) {
141
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r] != null) {
142
+ continue;
143
+ }
144
+ if (borderInfoCompute[bd_r + "_" + bd_c2] == null) {
145
+ borderInfoCompute[bd_r + "_" + bd_c2] = {};
146
+ }
147
+ borderInfoCompute[bd_r + "_" + bd_c2].r = {
148
+ color: borderColor,
149
+ style: borderStyle,
150
+ };
151
+ let bd_c_right = bd_c2 + 1;
152
+ if (bd_c_right < data[0].length &&
153
+ borderInfoCompute[bd_r + "_" + bd_c_right]) {
154
+ if (data[bd_r] != null &&
155
+ getObjType(data[bd_r][bd_c_right]) == "object" &&
156
+ data[bd_r][bd_c_right].mc != null) {
157
+ let cell_right = data[bd_r][bd_c_right];
158
+ let mc = cfg["merge"][cell_right.mc.r + "_" + cell_right.mc.c];
159
+ if (mc.c == bd_c_right) {
160
+ borderInfoCompute[bd_r + "_" + bd_c_right].l = {
161
+ color: borderColor,
162
+ style: borderStyle,
163
+ };
164
+ }
165
+ }
166
+ else {
167
+ borderInfoCompute[bd_r + "_" + bd_c_right].l = {
168
+ color: borderColor,
169
+ style: borderStyle,
170
+ };
171
+ }
172
+ }
173
+ let mc = cfg["merge"] || {};
174
+ for (const key in mc) {
175
+ let { c, r, cs, rs } = mc[key];
176
+ if (bd_c2 < c + cs - 1 &&
177
+ bd_c2 >= c &&
178
+ bd_r >= r &&
179
+ bd_r <= r + rs - 1) {
180
+ borderInfoCompute[bd_r + "_" + bd_c2].r = null;
181
+ }
182
+ }
183
+ }
184
+ }
185
+ else if (borderType == "border-top") {
186
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r1] != null) {
187
+ continue;
188
+ }
189
+ for (let bd_c = bd_c1; bd_c <= bd_c2; bd_c++) {
190
+ if (borderInfoCompute[bd_r1 + "_" + bd_c] == null) {
191
+ borderInfoCompute[bd_r1 + "_" + bd_c] = {};
192
+ }
193
+ borderInfoCompute[bd_r1 + "_" + bd_c].t = {
194
+ color: borderColor,
195
+ style: borderStyle,
196
+ };
197
+ let bd_r_top = bd_r1 - 1;
198
+ if (bd_r_top >= 0 && borderInfoCompute[bd_r_top + "_" + bd_c]) {
199
+ if (data[bd_r_top] != null &&
200
+ getObjType(data[bd_r_top][bd_c]) == "object" &&
201
+ data[bd_r_top][bd_c].mc != null) {
202
+ let cell_top = data[bd_r_top][bd_c];
203
+ let mc = cfg["merge"][cell_top.mc.r + "_" + cell_top.mc.c];
204
+ if (mc.r + mc.rs - 1 == bd_r_top) {
205
+ borderInfoCompute[bd_r_top + "_" + bd_c].b = {
206
+ color: borderColor,
207
+ style: borderStyle,
208
+ };
209
+ }
210
+ }
211
+ else {
212
+ borderInfoCompute[bd_r_top + "_" + bd_c].b = {
213
+ color: borderColor,
214
+ style: borderStyle,
215
+ };
216
+ }
217
+ }
218
+ let mc = cfg["merge"] || {};
219
+ for (const key in mc) {
220
+ let { c, r, cs, rs } = mc[key];
221
+ if (bd_r1 <= r + rs - 1 &&
222
+ bd_r1 > r &&
223
+ bd_c >= c &&
224
+ bd_c <= c + cs - 1) {
225
+ borderInfoCompute[bd_r1 + "_" + bd_c].t = null;
226
+ }
227
+ }
228
+ }
229
+ }
230
+ else if (borderType == "border-bottom") {
231
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r2] != null) {
232
+ continue;
233
+ }
234
+ for (let bd_c = bd_c1; bd_c <= bd_c2; bd_c++) {
235
+ if (borderInfoCompute[bd_r2 + "_" + bd_c] == null) {
236
+ borderInfoCompute[bd_r2 + "_" + bd_c] = {};
237
+ }
238
+ borderInfoCompute[bd_r2 + "_" + bd_c].b = {
239
+ color: borderColor,
240
+ style: borderStyle,
241
+ };
242
+ let bd_r_bottom = bd_r2 + 1;
243
+ if (bd_r_bottom < data.length &&
244
+ borderInfoCompute[bd_r_bottom + "_" + bd_c]) {
245
+ if (data[bd_r_bottom] != null &&
246
+ getObjType(data[bd_r_bottom][bd_c]) == "object" &&
247
+ data[bd_r_bottom][bd_c].mc != null) {
248
+ let cell_bottom = data[bd_r_bottom][bd_c];
249
+ let mc = cfg["merge"][cell_bottom.mc.r + "_" + cell_bottom.mc.c];
250
+ if (mc.r == bd_r_bottom) {
251
+ borderInfoCompute[bd_r_bottom + "_" + bd_c].t = {
252
+ color: borderColor,
253
+ style: borderStyle,
254
+ };
255
+ }
256
+ }
257
+ else {
258
+ borderInfoCompute[bd_r_bottom + "_" + bd_c].t = {
259
+ color: borderColor,
260
+ style: borderStyle,
261
+ };
262
+ }
263
+ }
264
+ let mc = cfg["merge"] || {};
265
+ for (const key in mc) {
266
+ let { c, r, cs, rs } = mc[key];
267
+ if (bd_r2 < r + rs - 1 &&
268
+ bd_r2 >= r &&
269
+ bd_c >= c &&
270
+ bd_c <= c + cs - 1) {
271
+ borderInfoCompute[bd_r2 + "_" + bd_c].b = null;
272
+ }
273
+ }
274
+ }
275
+ }
276
+ else if (borderType == "border-all") {
277
+ for (let bd_r = bd_r1; bd_r <= bd_r2; bd_r++) {
278
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r] != null) {
279
+ continue;
280
+ }
281
+ for (let bd_c = bd_c1; bd_c <= bd_c2; bd_c++) {
282
+ if (data[bd_r] != null &&
283
+ getObjType(data[bd_r][bd_c]) == "object" &&
284
+ data[bd_r][bd_c].mc != null) {
285
+ let cell = data[bd_r][bd_c];
286
+ let mc = cfg["merge"][cell.mc.r + "_" + cell.mc.c];
287
+ if (mc == undefined || mc == null) {
288
+ continue;
289
+ }
290
+ if (mc.r == bd_r) {
291
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
292
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
293
+ }
294
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
295
+ color: borderColor,
296
+ style: borderStyle,
297
+ };
298
+ }
299
+ if (mc.r + mc.rs - 1 == bd_r) {
300
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
301
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
302
+ }
303
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
304
+ color: borderColor,
305
+ style: borderStyle,
306
+ };
307
+ }
308
+ if (mc.c == bd_c) {
309
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
310
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
311
+ }
312
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
313
+ color: borderColor,
314
+ style: borderStyle,
315
+ };
316
+ }
317
+ if (mc.c + mc.cs - 1 == bd_c) {
318
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
319
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
320
+ }
321
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
322
+ color: borderColor,
323
+ style: borderStyle,
324
+ };
325
+ }
326
+ }
327
+ else {
328
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
329
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
330
+ }
331
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
332
+ color: borderColor,
333
+ style: borderStyle,
334
+ };
335
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
336
+ color: borderColor,
337
+ style: borderStyle,
338
+ };
339
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
340
+ color: borderColor,
341
+ style: borderStyle,
342
+ };
343
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
344
+ color: borderColor,
345
+ style: borderStyle,
346
+ };
347
+ }
348
+ if (bd_r == bd_r1) {
349
+ let bd_r_top = bd_r1 - 1;
350
+ if (bd_r_top >= 0 &&
351
+ borderInfoCompute[bd_r_top + "_" + bd_c]) {
352
+ if (data[bd_r_top] != null &&
353
+ getObjType(data[bd_r_top][bd_c]) == "object" &&
354
+ data[bd_r_top][bd_c].mc != null) {
355
+ let cell_top = data[bd_r_top][bd_c];
356
+ let mc = cfg["merge"][cell_top.mc.r + "_" + cell_top.mc.c];
357
+ if (mc.r + mc.rs - 1 == bd_r_top) {
358
+ borderInfoCompute[bd_r_top + "_" + bd_c].b = {
359
+ color: borderColor,
360
+ style: borderStyle,
361
+ };
362
+ }
363
+ }
364
+ else {
365
+ borderInfoCompute[bd_r_top + "_" + bd_c].b = {
366
+ color: borderColor,
367
+ style: borderStyle,
368
+ };
369
+ }
370
+ }
371
+ }
372
+ if (bd_r == bd_r2) {
373
+ let bd_r_bottom = bd_r2 + 1;
374
+ if (bd_r_bottom < data.length &&
375
+ borderInfoCompute[bd_r_bottom + "_" + bd_c]) {
376
+ if (data[bd_r_bottom] != null &&
377
+ getObjType(data[bd_r_bottom][bd_c]) == "object" &&
378
+ data[bd_r_bottom][bd_c].mc != null) {
379
+ let cell_bottom = data[bd_r_bottom][bd_c];
380
+ let mc = cfg["merge"][cell_bottom.mc.r + "_" + cell_bottom.mc.c];
381
+ if (mc.r == bd_r_bottom) {
382
+ borderInfoCompute[bd_r_bottom + "_" + bd_c].t = {
383
+ color: borderColor,
384
+ style: borderStyle,
385
+ };
386
+ }
387
+ }
388
+ else {
389
+ borderInfoCompute[bd_r_bottom + "_" + bd_c].t = {
390
+ color: borderColor,
391
+ style: borderStyle,
392
+ };
393
+ }
394
+ }
395
+ }
396
+ if (bd_c == bd_c1) {
397
+ let bd_c_left = bd_c1 - 1;
398
+ if (bd_c_left >= 0 &&
399
+ borderInfoCompute[bd_r + "_" + bd_c_left]) {
400
+ if (data[bd_r] != null &&
401
+ getObjType(data[bd_r][bd_c_left]) == "object" &&
402
+ data[bd_r][bd_c_left].mc != null) {
403
+ let cell_left = data[bd_r][bd_c_left];
404
+ let mc = cfg["merge"][cell_left.mc.r + "_" + cell_left.mc.c];
405
+ if (mc.c + mc.cs - 1 == bd_c_left) {
406
+ borderInfoCompute[bd_r + "_" + bd_c_left].r = {
407
+ color: borderColor,
408
+ style: borderStyle,
409
+ };
410
+ }
411
+ }
412
+ else {
413
+ borderInfoCompute[bd_r + "_" + bd_c_left].r = {
414
+ color: borderColor,
415
+ style: borderStyle,
416
+ };
417
+ }
418
+ }
419
+ }
420
+ if (bd_c == bd_c2) {
421
+ let bd_c_right = bd_c2 + 1;
422
+ if (bd_c_right < data[0].length &&
423
+ borderInfoCompute[bd_r + "_" + bd_c_right]) {
424
+ if (data[bd_r] != null &&
425
+ getObjType(data[bd_r][bd_c_right]) == "object" &&
426
+ data[bd_r][bd_c_right].mc != null) {
427
+ let cell_right = data[bd_r][bd_c_right];
428
+ let mc = cfg["merge"][cell_right.mc.r + "_" + cell_right.mc.c];
429
+ if (mc.c == bd_c_right) {
430
+ borderInfoCompute[bd_r + "_" + bd_c_right].l = {
431
+ color: borderColor,
432
+ style: borderStyle,
433
+ };
434
+ }
435
+ }
436
+ else {
437
+ borderInfoCompute[bd_r + "_" + bd_c_right].l = {
438
+ color: borderColor,
439
+ style: borderStyle,
440
+ };
441
+ }
442
+ }
443
+ }
444
+ }
445
+ }
446
+ }
447
+ else if (borderType == "border-outside") {
448
+ for (let bd_r = bd_r1; bd_r <= bd_r2; bd_r++) {
449
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r] != null) {
450
+ continue;
451
+ }
452
+ for (let bd_c = bd_c1; bd_c <= bd_c2; bd_c++) {
453
+ if (!(bd_r == bd_r1 ||
454
+ bd_r == bd_r2 ||
455
+ bd_c == bd_c1 ||
456
+ bd_c == bd_c2)) {
457
+ continue;
458
+ }
459
+ if (bd_r == bd_r1) {
460
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
461
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
462
+ }
463
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
464
+ color: borderColor,
465
+ style: borderStyle,
466
+ };
467
+ let bd_r_top = bd_r1 - 1;
468
+ if (bd_r_top >= 0 &&
469
+ borderInfoCompute[bd_r_top + "_" + bd_c]) {
470
+ if (data[bd_r_top] != null &&
471
+ getObjType(data[bd_r_top][bd_c]) == "object" &&
472
+ data[bd_r_top][bd_c].mc != null) {
473
+ let cell_top = data[bd_r_top][bd_c];
474
+ let mc = cfg["merge"][((_c = cell_top === null || cell_top === void 0 ? void 0 : cell_top.mc) === null || _c === void 0 ? void 0 : _c.r) + "_" + ((_d = cell_top === null || cell_top === void 0 ? void 0 : cell_top.mc) === null || _d === void 0 ? void 0 : _d.c)];
475
+ if (mc.r + mc.rs - 1 == bd_r_top) {
476
+ borderInfoCompute[bd_r_top + "_" + bd_c].b = {
477
+ color: borderColor,
478
+ style: borderStyle,
479
+ };
480
+ }
481
+ }
482
+ else {
483
+ borderInfoCompute[bd_r_top + "_" + bd_c].b = {
484
+ color: borderColor,
485
+ style: borderStyle,
486
+ };
487
+ }
488
+ }
489
+ }
490
+ if (bd_r == bd_r2) {
491
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
492
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
493
+ }
494
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
495
+ color: borderColor,
496
+ style: borderStyle,
497
+ };
498
+ let bd_r_bottom = bd_r2 + 1;
499
+ if (bd_r_bottom < data.length &&
500
+ borderInfoCompute[bd_r_bottom + "_" + bd_c]) {
501
+ if (data[bd_r_bottom] != null &&
502
+ getObjType(data[bd_r_bottom][bd_c]) == "object" &&
503
+ data[bd_r_bottom][bd_c].mc != null) {
504
+ let cell_bottom = data[bd_r_bottom][bd_c];
505
+ let mc = cfg["merge"][cell_bottom.mc.r + "_" + cell_bottom.mc.c];
506
+ if (mc.r == bd_r_bottom) {
507
+ borderInfoCompute[bd_r_bottom + "_" + bd_c].t = {
508
+ color: borderColor,
509
+ style: borderStyle,
510
+ };
511
+ }
512
+ }
513
+ else {
514
+ borderInfoCompute[bd_r_bottom + "_" + bd_c].t = {
515
+ color: borderColor,
516
+ style: borderStyle,
517
+ };
518
+ }
519
+ }
520
+ }
521
+ if (bd_c == bd_c1) {
522
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
523
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
524
+ }
525
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
526
+ color: borderColor,
527
+ style: borderStyle,
528
+ };
529
+ let bd_c_left = bd_c1 - 1;
530
+ if (bd_c_left >= 0 &&
531
+ borderInfoCompute[bd_r + "_" + bd_c_left]) {
532
+ if (data[bd_r] != null &&
533
+ getObjType(data[bd_r][bd_c_left]) == "object" &&
534
+ data[bd_r][bd_c_left].mc != null) {
535
+ let cell_left = data[bd_r][bd_c_left];
536
+ let mc = cfg["merge"][cell_left.mc.r + "_" + cell_left.mc.c];
537
+ if (mc.c + mc.cs - 1 == bd_c_left) {
538
+ borderInfoCompute[bd_r + "_" + bd_c_left].r = {
539
+ color: borderColor,
540
+ style: borderStyle,
541
+ };
542
+ }
543
+ }
544
+ else {
545
+ borderInfoCompute[bd_r + "_" + bd_c_left].r = {
546
+ color: borderColor,
547
+ style: borderStyle,
548
+ };
549
+ }
550
+ }
551
+ }
552
+ if (bd_c == bd_c2) {
553
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
554
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
555
+ }
556
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
557
+ color: borderColor,
558
+ style: borderStyle,
559
+ };
560
+ let bd_c_right = bd_c2 + 1;
561
+ if (bd_c_right < data[0].length &&
562
+ borderInfoCompute[bd_r + "_" + bd_c_right]) {
563
+ if (data[bd_r] != null &&
564
+ getObjType(data[bd_r][bd_c_right]) == "object" &&
565
+ data[bd_r][bd_c_right].mc != null) {
566
+ let cell_right = data[bd_r][bd_c_right];
567
+ let mc = cfg["merge"][cell_right.mc.r + "_" + cell_right.mc.c];
568
+ if (mc.c == bd_c_right) {
569
+ borderInfoCompute[bd_r + "_" + bd_c_right].l = {
570
+ color: borderColor,
571
+ style: borderStyle,
572
+ };
573
+ }
574
+ }
575
+ else {
576
+ borderInfoCompute[bd_r + "_" + bd_c_right].l = {
577
+ color: borderColor,
578
+ style: borderStyle,
579
+ };
580
+ }
581
+ }
582
+ }
583
+ }
584
+ }
585
+ }
586
+ else if (borderType == "border-inside") {
587
+ for (let bd_r = bd_r1; bd_r <= bd_r2; bd_r++) {
588
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r] != null) {
589
+ continue;
590
+ }
591
+ for (let bd_c = bd_c1; bd_c <= bd_c2; bd_c++) {
592
+ if (bd_r == bd_r1 && bd_c == bd_c1) {
593
+ if (data[bd_r] != null &&
594
+ getObjType(data[bd_r][bd_c]) == "object" &&
595
+ data[bd_r][bd_c].mc != null) {
596
+ }
597
+ else {
598
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
599
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
600
+ }
601
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
602
+ color: borderColor,
603
+ style: borderStyle,
604
+ };
605
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
606
+ color: borderColor,
607
+ style: borderStyle,
608
+ };
609
+ }
610
+ }
611
+ else if (bd_r == bd_r2 && bd_c == bd_c1) {
612
+ if (data[bd_r] != null &&
613
+ getObjType(data[bd_r][bd_c]) == "object" &&
614
+ data[bd_r][bd_c].mc != null) {
615
+ }
616
+ else {
617
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
618
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
619
+ }
620
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
621
+ color: borderColor,
622
+ style: borderStyle,
623
+ };
624
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
625
+ color: borderColor,
626
+ style: borderStyle,
627
+ };
628
+ }
629
+ }
630
+ else if (bd_r == bd_r1 && bd_c == bd_c2) {
631
+ if (data[bd_r] != null &&
632
+ getObjType(data[bd_r][bd_c]) == "object" &&
633
+ data[bd_r][bd_c].mc != null) {
634
+ }
635
+ else {
636
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
637
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
638
+ }
639
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
640
+ color: borderColor,
641
+ style: borderStyle,
642
+ };
643
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
644
+ color: borderColor,
645
+ style: borderStyle,
646
+ };
647
+ }
648
+ }
649
+ else if (bd_r == bd_r2 && bd_c == bd_c2) {
650
+ if (data[bd_r] != null &&
651
+ getObjType(data[bd_r][bd_c]) == "object" &&
652
+ data[bd_r][bd_c].mc != null) {
653
+ }
654
+ else {
655
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
656
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
657
+ }
658
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
659
+ color: borderColor,
660
+ style: borderStyle,
661
+ };
662
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
663
+ color: borderColor,
664
+ style: borderStyle,
665
+ };
666
+ }
667
+ }
668
+ else if (bd_r == bd_r1) {
669
+ if (data[bd_r] != null &&
670
+ getObjType(data[bd_r][bd_c]) == "object" &&
671
+ data[bd_r][bd_c].mc != null) {
672
+ let cell = data[bd_r][bd_c];
673
+ let mc = cfg["merge"][cell.mc.r + "_" + cell.mc.c];
674
+ if (mc.c == bd_c) {
675
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
676
+ borderInfoCompute[bd_r + "_" + bd_c] =
677
+ {};
678
+ }
679
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
680
+ color: borderColor,
681
+ style: borderStyle,
682
+ };
683
+ }
684
+ else if (mc.c + mc.cs - 1 == bd_c) {
685
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
686
+ borderInfoCompute[bd_r + "_" + bd_c] =
687
+ {};
688
+ }
689
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
690
+ color: borderColor,
691
+ style: borderStyle,
692
+ };
693
+ }
694
+ }
695
+ else {
696
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
697
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
698
+ }
699
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
700
+ color: borderColor,
701
+ style: borderStyle,
702
+ };
703
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
704
+ color: borderColor,
705
+ style: borderStyle,
706
+ };
707
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
708
+ color: borderColor,
709
+ style: borderStyle,
710
+ };
711
+ }
712
+ }
713
+ else if (bd_r == bd_r2) {
714
+ if (data[bd_r] != null &&
715
+ getObjType(data[bd_r][bd_c]) == "object" &&
716
+ data[bd_r][bd_c].mc != null) {
717
+ let cell = data[bd_r][bd_c];
718
+ let mc = cfg["merge"][cell.mc.r + "_" + cell.mc.c];
719
+ if (mc.c == bd_c) {
720
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
721
+ borderInfoCompute[bd_r + "_" + bd_c] =
722
+ {};
723
+ }
724
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
725
+ color: borderColor,
726
+ style: borderStyle,
727
+ };
728
+ }
729
+ else if (mc.c + mc.cs - 1 == bd_c) {
730
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
731
+ borderInfoCompute[bd_r + "_" + bd_c] =
732
+ {};
733
+ }
734
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
735
+ color: borderColor,
736
+ style: borderStyle,
737
+ };
738
+ }
739
+ }
740
+ else {
741
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
742
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
743
+ }
744
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
745
+ color: borderColor,
746
+ style: borderStyle,
747
+ };
748
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
749
+ color: borderColor,
750
+ style: borderStyle,
751
+ };
752
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
753
+ color: borderColor,
754
+ style: borderStyle,
755
+ };
756
+ }
757
+ }
758
+ else if (bd_c == bd_c1) {
759
+ if (data[bd_r] != null &&
760
+ getObjType(data[bd_r][bd_c]) == "object" &&
761
+ data[bd_r][bd_c].mc != null) {
762
+ let cell = data[bd_r][bd_c];
763
+ let mc = cfg["merge"][cell.mc.r + "_" + cell.mc.c];
764
+ if (mc.r == bd_r) {
765
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
766
+ borderInfoCompute[bd_r + "_" + bd_c] =
767
+ {};
768
+ }
769
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
770
+ color: borderColor,
771
+ style: borderStyle,
772
+ };
773
+ }
774
+ else if (mc.r + mc.rs - 1 == bd_r) {
775
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
776
+ borderInfoCompute[bd_r + "_" + bd_c] =
777
+ {};
778
+ }
779
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
780
+ color: borderColor,
781
+ style: borderStyle,
782
+ };
783
+ }
784
+ }
785
+ else {
786
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
787
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
788
+ }
789
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
790
+ color: borderColor,
791
+ style: borderStyle,
792
+ };
793
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
794
+ color: borderColor,
795
+ style: borderStyle,
796
+ };
797
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
798
+ color: borderColor,
799
+ style: borderStyle,
800
+ };
801
+ }
802
+ }
803
+ else if (bd_c == bd_c2) {
804
+ if (data[bd_r] != null &&
805
+ getObjType(data[bd_r][bd_c]) == "object" &&
806
+ data[bd_r][bd_c].mc != null) {
807
+ let cell = data[bd_r][bd_c];
808
+ let mc = cfg["merge"][cell.mc.r + "_" + cell.mc.c];
809
+ if (mc.r == bd_r) {
810
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
811
+ borderInfoCompute[bd_r + "_" + bd_c] =
812
+ {};
813
+ }
814
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
815
+ color: borderColor,
816
+ style: borderStyle,
817
+ };
818
+ }
819
+ else if (mc.r + mc.rs - 1 == bd_r) {
820
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
821
+ borderInfoCompute[bd_r + "_" + bd_c] =
822
+ {};
823
+ }
824
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
825
+ color: borderColor,
826
+ style: borderStyle,
827
+ };
828
+ }
829
+ }
830
+ else {
831
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
832
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
833
+ }
834
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
835
+ color: borderColor,
836
+ style: borderStyle,
837
+ };
838
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
839
+ color: borderColor,
840
+ style: borderStyle,
841
+ };
842
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
843
+ color: borderColor,
844
+ style: borderStyle,
845
+ };
846
+ }
847
+ }
848
+ else {
849
+ if (data[bd_r] != null &&
850
+ getObjType(data[bd_r][bd_c]) == "object" &&
851
+ data[bd_r][bd_c].mc != null) {
852
+ let cell = data[bd_r][bd_c];
853
+ let mc = cfg["merge"][cell.mc.r + "_" + cell.mc.c];
854
+ if (mc.r == bd_r) {
855
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
856
+ borderInfoCompute[bd_r + "_" + bd_c] =
857
+ {};
858
+ }
859
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
860
+ color: borderColor,
861
+ style: borderStyle,
862
+ };
863
+ }
864
+ else if (mc.r + mc.rs - 1 == bd_r) {
865
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
866
+ borderInfoCompute[bd_r + "_" + bd_c] =
867
+ {};
868
+ }
869
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
870
+ color: borderColor,
871
+ style: borderStyle,
872
+ };
873
+ }
874
+ if (mc.c == bd_c) {
875
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
876
+ borderInfoCompute[bd_r + "_" + bd_c] =
877
+ {};
878
+ }
879
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
880
+ color: borderColor,
881
+ style: borderStyle,
882
+ };
883
+ }
884
+ else if (mc.c + mc.cs - 1 == bd_c) {
885
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
886
+ borderInfoCompute[bd_r + "_" + bd_c] =
887
+ {};
888
+ }
889
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
890
+ color: borderColor,
891
+ style: borderStyle,
892
+ };
893
+ }
894
+ }
895
+ else {
896
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
897
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
898
+ }
899
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
900
+ color: borderColor,
901
+ style: borderStyle,
902
+ };
903
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
904
+ color: borderColor,
905
+ style: borderStyle,
906
+ };
907
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
908
+ color: borderColor,
909
+ style: borderStyle,
910
+ };
911
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
912
+ color: borderColor,
913
+ style: borderStyle,
914
+ };
915
+ }
916
+ }
917
+ }
918
+ }
919
+ }
920
+ else if (borderType == "border-horizontal") {
921
+ for (let bd_r = bd_r1; bd_r <= bd_r2; bd_r++) {
922
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r] != null) {
923
+ continue;
924
+ }
925
+ for (let bd_c = bd_c1; bd_c <= bd_c2; bd_c++) {
926
+ if (bd_r == bd_r1) {
927
+ if (data[bd_r] != null &&
928
+ getObjType(data[bd_r][bd_c]) == "object" &&
929
+ data[bd_r][bd_c].mc != null) {
930
+ }
931
+ else {
932
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
933
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
934
+ }
935
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
936
+ color: borderColor,
937
+ style: borderStyle,
938
+ };
939
+ }
940
+ }
941
+ else if (bd_r == bd_r2) {
942
+ if (data[bd_r] != null &&
943
+ getObjType(data[bd_r][bd_c]) == "object" &&
944
+ data[bd_r][bd_c].mc != null) {
945
+ }
946
+ else {
947
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
948
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
949
+ }
950
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
951
+ color: borderColor,
952
+ style: borderStyle,
953
+ };
954
+ }
955
+ }
956
+ else {
957
+ if (data[bd_r] != null &&
958
+ getObjType(data[bd_r][bd_c]) == "object" &&
959
+ data[bd_r][bd_c].mc != null) {
960
+ let cell = data[bd_r][bd_c];
961
+ let mc = cfg["merge"][cell.mc.r + "_" + cell.mc.c];
962
+ if (mc.r == bd_r) {
963
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
964
+ borderInfoCompute[bd_r + "_" + bd_c] =
965
+ {};
966
+ }
967
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
968
+ color: borderColor,
969
+ style: borderStyle,
970
+ };
971
+ }
972
+ else if (mc.r + mc.rs - 1 == bd_r) {
973
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
974
+ borderInfoCompute[bd_r + "_" + bd_c] =
975
+ {};
976
+ }
977
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
978
+ color: borderColor,
979
+ style: borderStyle,
980
+ };
981
+ }
982
+ }
983
+ else {
984
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
985
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
986
+ }
987
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
988
+ color: borderColor,
989
+ style: borderStyle,
990
+ };
991
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
992
+ color: borderColor,
993
+ style: borderStyle,
994
+ };
995
+ }
996
+ }
997
+ }
998
+ }
999
+ }
1000
+ else if (borderType == "border-vertical") {
1001
+ for (let bd_r = bd_r1; bd_r <= bd_r2; bd_r++) {
1002
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r] != null) {
1003
+ continue;
1004
+ }
1005
+ for (let bd_c = bd_c1; bd_c <= bd_c2; bd_c++) {
1006
+ if (bd_c == bd_c1) {
1007
+ if (data[bd_r] != null &&
1008
+ getObjType(data[bd_r][bd_c]) == "object" &&
1009
+ data[bd_r][bd_c].mc != null) {
1010
+ }
1011
+ else {
1012
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
1013
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
1014
+ }
1015
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
1016
+ color: borderColor,
1017
+ style: borderStyle,
1018
+ };
1019
+ }
1020
+ }
1021
+ else if (bd_c == bd_c2) {
1022
+ if (data[bd_r] != null &&
1023
+ getObjType(data[bd_r][bd_c]) == "object" &&
1024
+ data[bd_r][bd_c].mc != null) {
1025
+ }
1026
+ else {
1027
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
1028
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
1029
+ }
1030
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
1031
+ color: borderColor,
1032
+ style: borderStyle,
1033
+ };
1034
+ }
1035
+ }
1036
+ else {
1037
+ if (data[bd_r] != null &&
1038
+ getObjType(data[bd_r][bd_c]) == "object" &&
1039
+ data[bd_r][bd_c].mc != null) {
1040
+ let cell = data[bd_r][bd_c];
1041
+ let mc = cfg["merge"][cell.mc.r + "_" + cell.mc.c] ||
1042
+ {};
1043
+ if (mc.c == bd_c) {
1044
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
1045
+ borderInfoCompute[bd_r + "_" + bd_c] =
1046
+ {};
1047
+ }
1048
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
1049
+ color: borderColor,
1050
+ style: borderStyle,
1051
+ };
1052
+ }
1053
+ else if (mc.c + mc.cs - 1 == bd_c) {
1054
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
1055
+ borderInfoCompute[bd_r + "_" + bd_c] =
1056
+ {};
1057
+ }
1058
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
1059
+ color: borderColor,
1060
+ style: borderStyle,
1061
+ };
1062
+ }
1063
+ }
1064
+ else {
1065
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
1066
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
1067
+ }
1068
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
1069
+ color: borderColor,
1070
+ style: borderStyle,
1071
+ };
1072
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
1073
+ color: borderColor,
1074
+ style: borderStyle,
1075
+ };
1076
+ }
1077
+ }
1078
+ }
1079
+ }
1080
+ }
1081
+ else if (borderType == "border-none") {
1082
+ for (let bd_r = bd_r1; bd_r <= bd_r2; bd_r++) {
1083
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r] != null) {
1084
+ continue;
1085
+ }
1086
+ for (let bd_c = bd_c1; bd_c <= bd_c2; bd_c++) {
1087
+ if (borderInfoCompute[bd_r + "_" + bd_c] != null) {
1088
+ delete borderInfoCompute[bd_r + "_" + bd_c];
1089
+ }
1090
+ if (bd_r == bd_r1) {
1091
+ let bd_r_top = bd_r1 - 1;
1092
+ if (bd_r_top >= 0 &&
1093
+ borderInfoCompute[bd_r_top + "_" + bd_c]) {
1094
+ delete borderInfoCompute[bd_r_top + "_" + bd_c].b;
1095
+ }
1096
+ }
1097
+ if (bd_r == bd_r2) {
1098
+ let bd_r_bottom = bd_r2 + 1;
1099
+ if (bd_r_bottom < data.length &&
1100
+ borderInfoCompute[bd_r_bottom + "_" + bd_c]) {
1101
+ delete borderInfoCompute[bd_r_bottom + "_" + bd_c].t;
1102
+ }
1103
+ }
1104
+ if (bd_c == bd_c1) {
1105
+ let bd_c_left = bd_c1 - 1;
1106
+ if (bd_c_left >= 0 &&
1107
+ borderInfoCompute[bd_r + "_" + bd_c_left]) {
1108
+ delete borderInfoCompute[bd_r + "_" + bd_c_left].r;
1109
+ }
1110
+ }
1111
+ if (bd_c == bd_c2) {
1112
+ let bd_c_right = bd_c2 + 1;
1113
+ if (bd_c_right < data[0].length &&
1114
+ borderInfoCompute[bd_r + "_" + bd_c_right]) {
1115
+ delete borderInfoCompute[bd_r + "_" + bd_c_right].l;
1116
+ }
1117
+ }
1118
+ }
1119
+ }
1120
+ }
1121
+ }
1122
+ }
1123
+ else if (rangeType == "cell") {
1124
+ let value = borderInfo[i].value;
1125
+ let bd_r = value.row_index, bd_c = value.col_index;
1126
+ if (bd_r < dataset_row_st ||
1127
+ bd_r > dataset_row_ed ||
1128
+ bd_c < dataset_col_st ||
1129
+ bd_c > dataset_col_ed) {
1130
+ continue;
1131
+ }
1132
+ if (cfg["rowhidden"] != null && cfg["rowhidden"][bd_r] != null) {
1133
+ continue;
1134
+ }
1135
+ if (value.l != null ||
1136
+ value.r != null ||
1137
+ value.t != null ||
1138
+ value.b != null) {
1139
+ if (borderInfoCompute[bd_r + "_" + bd_c] == null) {
1140
+ borderInfoCompute[bd_r + "_" + bd_c] = {};
1141
+ }
1142
+ if (data[bd_r] != null &&
1143
+ getObjType(data[bd_r][bd_c]) == "object" &&
1144
+ data[bd_r][bd_c].mc != null) {
1145
+ let cell = data[bd_r][bd_c];
1146
+ let mc = cfg["merge"][cell.mc.r + "_" + cell.mc.c] ||
1147
+ {};
1148
+ if (value.l != null && bd_c == mc.c) {
1149
+ //左边框
1150
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
1151
+ color: value.l.color,
1152
+ style: value.l.style,
1153
+ };
1154
+ let bd_c_left = bd_c - 1;
1155
+ if (bd_c_left >= 0 && borderInfoCompute[bd_r + "_" + bd_c_left]) {
1156
+ if (data[bd_r] != null &&
1157
+ getObjType(data[bd_r][bd_c_left]) == "object" &&
1158
+ data[bd_r][bd_c_left].mc != null) {
1159
+ let cell_left = data[bd_r][bd_c_left];
1160
+ let mc_l = cfg["merge"][cell_left.mc.r + "_" + cell_left.mc.c];
1161
+ if (mc_l.c + mc_l.cs - 1 == bd_c_left) {
1162
+ borderInfoCompute[bd_r + "_" + bd_c_left].r = {
1163
+ color: value.l.color,
1164
+ style: value.l.style,
1165
+ };
1166
+ }
1167
+ }
1168
+ else {
1169
+ borderInfoCompute[bd_r + "_" + bd_c_left].r = {
1170
+ color: value.l.color,
1171
+ style: value.l.style,
1172
+ };
1173
+ }
1174
+ }
1175
+ }
1176
+ else {
1177
+ borderInfoCompute[bd_r + "_" + bd_c].l = null;
1178
+ }
1179
+ if (value.r != null && bd_c == mc.c + mc.cs - 1) {
1180
+ //右边框
1181
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
1182
+ color: value.r.color,
1183
+ style: value.r.style,
1184
+ };
1185
+ let bd_c_right = bd_c + 1;
1186
+ if (bd_c_right < data[0].length &&
1187
+ borderInfoCompute[bd_r + "_" + bd_c_right]) {
1188
+ if (data[bd_r] != null &&
1189
+ getObjType(data[bd_r][bd_c_right]) == "object" &&
1190
+ data[bd_r][bd_c_right].mc != null) {
1191
+ let cell_right = data[bd_r][bd_c_right];
1192
+ let mc_r = cfg["merge"][cell_right.mc.r + "_" + cell_right.mc.c];
1193
+ if (mc_r.c == bd_c_right) {
1194
+ borderInfoCompute[bd_r + "_" + bd_c_right].l = {
1195
+ color: value.r.color,
1196
+ style: value.r.style,
1197
+ };
1198
+ }
1199
+ }
1200
+ else {
1201
+ borderInfoCompute[bd_r + "_" + bd_c_right].l = {
1202
+ color: value.r.color,
1203
+ style: value.r.style,
1204
+ };
1205
+ }
1206
+ }
1207
+ }
1208
+ else {
1209
+ borderInfoCompute[bd_r + "_" + bd_c].r = null;
1210
+ }
1211
+ if (value.t != null && bd_r == mc.r) {
1212
+ //上边框
1213
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
1214
+ color: value.t.color,
1215
+ style: value.t.style,
1216
+ };
1217
+ let bd_r_top = bd_r - 1;
1218
+ if (bd_r_top >= 0 && borderInfoCompute[bd_r_top + "_" + bd_c]) {
1219
+ if (data[bd_r_top] != null &&
1220
+ getObjType(data[bd_r_top][bd_c]) == "object" &&
1221
+ data[bd_r_top][bd_c].mc != null) {
1222
+ let cell_top = data[bd_r_top][bd_c];
1223
+ let mc_t = cfg["merge"][cell_top.mc.r + "_" + cell_top.mc.c];
1224
+ if (mc_t.r + mc_t.rs - 1 == bd_r_top) {
1225
+ borderInfoCompute[bd_r_top + "_" + bd_c].b = {
1226
+ color: value.t.color,
1227
+ style: value.t.style,
1228
+ };
1229
+ }
1230
+ }
1231
+ else {
1232
+ borderInfoCompute[bd_r_top + "_" + bd_c].b = {
1233
+ color: value.t.color,
1234
+ style: value.t.style,
1235
+ };
1236
+ }
1237
+ }
1238
+ }
1239
+ else {
1240
+ borderInfoCompute[bd_r + "_" + bd_c].t = null;
1241
+ }
1242
+ if (value.b != null && bd_r == mc.r + mc.rs - 1) {
1243
+ //下边框
1244
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
1245
+ color: value.b.color,
1246
+ style: value.b.style,
1247
+ };
1248
+ let bd_r_bottom = bd_r + 1;
1249
+ if (bd_r_bottom < data.length &&
1250
+ borderInfoCompute[bd_r_bottom + "_" + bd_c]) {
1251
+ if (data[bd_r_bottom] != null &&
1252
+ getObjType(data[bd_r_bottom][bd_c]) == "object" &&
1253
+ data[bd_r_bottom][bd_c].mc != null) {
1254
+ let cell_bottom = data[bd_r_bottom][bd_c];
1255
+ let mc_b = cfg["merge"][cell_bottom.mc.r + "_" + cell_bottom.mc.c];
1256
+ if (mc_b.r == bd_r_bottom) {
1257
+ borderInfoCompute[bd_r_bottom + "_" + bd_c].t = {
1258
+ color: value.b.color,
1259
+ style: value.b.style,
1260
+ };
1261
+ }
1262
+ }
1263
+ else {
1264
+ borderInfoCompute[bd_r_bottom + "_" + bd_c].t = {
1265
+ color: value.b.color,
1266
+ style: value.b.style,
1267
+ };
1268
+ }
1269
+ }
1270
+ }
1271
+ else {
1272
+ borderInfoCompute[bd_r + "_" + bd_c].b = null;
1273
+ }
1274
+ }
1275
+ else {
1276
+ if (value.l != null) {
1277
+ //左边框
1278
+ borderInfoCompute[bd_r + "_" + bd_c].l = {
1279
+ color: value.l.color,
1280
+ style: value.l.style,
1281
+ };
1282
+ let bd_c_left = bd_c - 1;
1283
+ if (bd_c_left >= 0 && borderInfoCompute[bd_r + "_" + bd_c_left]) {
1284
+ if (data[bd_r] != null &&
1285
+ getObjType(data[bd_r][bd_c_left]) == "object" &&
1286
+ data[bd_r][bd_c_left].mc != null) {
1287
+ let cell_left = data[bd_r][bd_c_left];
1288
+ let mc_l = cfg["merge"][cell_left.mc.r + "_" + cell_left.mc.c];
1289
+ if (mc_l.c + mc_l.cs - 1 == bd_c_left) {
1290
+ borderInfoCompute[bd_r + "_" + bd_c_left].r = {
1291
+ color: value.l.color,
1292
+ style: value.l.style,
1293
+ };
1294
+ }
1295
+ }
1296
+ else {
1297
+ borderInfoCompute[bd_r + "_" + bd_c_left].r = {
1298
+ color: value.l.color,
1299
+ style: value.l.style,
1300
+ };
1301
+ }
1302
+ }
1303
+ }
1304
+ else {
1305
+ borderInfoCompute[bd_r + "_" + bd_c].l = null;
1306
+ }
1307
+ if (value.r != null) {
1308
+ //右边框
1309
+ borderInfoCompute[bd_r + "_" + bd_c].r = {
1310
+ color: value.r.color,
1311
+ style: value.r.style,
1312
+ };
1313
+ let bd_c_right = bd_c + 1;
1314
+ if (bd_c_right < data[0].length &&
1315
+ borderInfoCompute[bd_r + "_" + bd_c_right]) {
1316
+ if (data[bd_r] != null &&
1317
+ getObjType(data[bd_r][bd_c_right]) == "object" &&
1318
+ data[bd_r][bd_c_right].mc != null) {
1319
+ let cell_right = data[bd_r][bd_c_right];
1320
+ let mc_r = cfg["merge"][cell_right.mc.r + "_" + cell_right.mc.c];
1321
+ if (mc_r.c == bd_c_right) {
1322
+ borderInfoCompute[bd_r + "_" + bd_c_right].l = {
1323
+ color: value.r.color,
1324
+ style: value.r.style,
1325
+ };
1326
+ }
1327
+ }
1328
+ else {
1329
+ borderInfoCompute[bd_r + "_" + bd_c_right].l = {
1330
+ color: value.r.color,
1331
+ style: value.r.style,
1332
+ };
1333
+ }
1334
+ }
1335
+ }
1336
+ else {
1337
+ borderInfoCompute[bd_r + "_" + bd_c].r = null;
1338
+ }
1339
+ if (value.t != null) {
1340
+ //上边框
1341
+ borderInfoCompute[bd_r + "_" + bd_c].t = {
1342
+ color: value.t.color,
1343
+ style: value.t.style,
1344
+ };
1345
+ let bd_r_top = bd_r - 1;
1346
+ if (bd_r_top >= 0 && borderInfoCompute[bd_r_top + "_" + bd_c]) {
1347
+ if (data[bd_r_top] != null &&
1348
+ getObjType(data[bd_r_top][bd_c]) == "object" &&
1349
+ data[bd_r_top][bd_c].mc != null) {
1350
+ let cell_top = data[bd_r_top][bd_c];
1351
+ let mc_t = cfg["merge"][cell_top.mc.r + "_" + cell_top.mc.c];
1352
+ if (mc_t.r + mc_t.rs - 1 == bd_r_top) {
1353
+ borderInfoCompute[bd_r_top + "_" + bd_c].b = {
1354
+ color: value.t.color,
1355
+ style: value.t.style,
1356
+ };
1357
+ }
1358
+ }
1359
+ else {
1360
+ borderInfoCompute[bd_r_top + "_" + bd_c].b = {
1361
+ color: value.t.color,
1362
+ style: value.t.style,
1363
+ };
1364
+ }
1365
+ }
1366
+ }
1367
+ else {
1368
+ borderInfoCompute[bd_r + "_" + bd_c].t = null;
1369
+ }
1370
+ if (value.b != null) {
1371
+ //下边框
1372
+ borderInfoCompute[bd_r + "_" + bd_c].b = {
1373
+ color: value.b.color,
1374
+ style: value.b.style,
1375
+ };
1376
+ let bd_r_bottom = bd_r + 1;
1377
+ if (bd_r_bottom < data.length &&
1378
+ borderInfoCompute[bd_r_bottom + "_" + bd_c]) {
1379
+ if (data[bd_r_bottom] != null &&
1380
+ getObjType(data[bd_r_bottom][bd_c]) == "object" &&
1381
+ data[bd_r_bottom][bd_c].mc != null) {
1382
+ let cell_bottom = data[bd_r_bottom][bd_c];
1383
+ let mc_b = cfg["merge"][cell_bottom.mc.r + "_" + cell_bottom.mc.c];
1384
+ if (mc_b.r == bd_r_bottom) {
1385
+ borderInfoCompute[bd_r_bottom + "_" + bd_c].t = {
1386
+ color: value.b.color,
1387
+ style: value.b.style,
1388
+ };
1389
+ }
1390
+ }
1391
+ else {
1392
+ borderInfoCompute[bd_r_bottom + "_" + bd_c].t = {
1393
+ color: value.b.color,
1394
+ style: value.b.style,
1395
+ };
1396
+ }
1397
+ }
1398
+ }
1399
+ else {
1400
+ borderInfoCompute[bd_r + "_" + bd_c].b = null;
1401
+ }
1402
+ }
1403
+ }
1404
+ else {
1405
+ delete borderInfoCompute[bd_r + "_" + bd_c];
1406
+ }
1407
+ }
1408
+ }
1409
+ }
1410
+ return borderInfoCompute;
1411
+ };
1412
+ export { setBorder };