@corbe30/fortune-excel 1.0.3 → 1.0.5

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.
@@ -1,122 +1,140 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
1
16
  import { getColor, getlineStringAttr, } from "./ReadXml.js";
2
17
  import { getcellrange, escapeCharacter, isChinese, isJapanese, isKoera, } from "../common/method.js";
3
18
  import { ST_CellType, borderTypes, fontFamilys, } from "../common/constant.js";
4
19
  import { FortuneSheetborderInfoCellValueStyle, FortuneSheetborderInfoCellForImp, FortuneSheetborderInfoCellValue, FortuneSheetCelldataBase, FortuneSheetCelldataValue, FortuneSheetCellFormat, } from "./FortuneBase.js";
5
- export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
6
- constructor(cell, styles, sharedStrings, mergeCells, sheetFile, ReadXml) {
20
+ var FortuneSheetCelldata = /** @class */ (function (_super) {
21
+ __extends(FortuneSheetCelldata, _super);
22
+ function FortuneSheetCelldata(cell, styles, sharedStrings, mergeCells, sheetFile, ReadXml) {
7
23
  //Private
8
- super();
9
- this.cell = cell;
10
- this.sheetFile = sheetFile;
11
- this.styles = styles;
12
- this.sharedStrings = sharedStrings;
13
- this.readXml = ReadXml;
14
- this.mergeCells = mergeCells;
15
- let attrList = cell.attributeList;
16
- let r = attrList.r, s = attrList.s, t = attrList.t;
17
- let range = getcellrange(r);
18
- this.r = range.row[0];
19
- this.c = range.column[0];
20
- this.v = this.generateValue(s, t);
24
+ var _this = _super.call(this) || this;
25
+ _this.cell = cell;
26
+ _this.sheetFile = sheetFile;
27
+ _this.styles = styles;
28
+ _this.sharedStrings = sharedStrings;
29
+ _this.readXml = ReadXml;
30
+ _this.mergeCells = mergeCells;
31
+ var attrList = cell.attributeList;
32
+ var r = attrList.r, s = attrList.s, t = attrList.t;
33
+ var range = getcellrange(r);
34
+ _this.r = range.row[0];
35
+ _this.c = range.column[0];
36
+ _this.v = _this.generateValue(s, t);
37
+ return _this;
21
38
  }
22
39
  /**
23
40
  * @param s Style index ,start 1
24
41
  * @param t Cell type, Optional value is ST_CellType, it's found at constat.ts
25
42
  */
26
- generateValue(s, t) {
27
- let v = this.cell.getInnerElements("v");
28
- let f = this.cell.getInnerElements("f");
43
+ FortuneSheetCelldata.prototype.generateValue = function (s, t) {
44
+ var _this = this;
45
+ var v = this.cell.getInnerElements("v");
46
+ var f = this.cell.getInnerElements("f");
29
47
  if (v == null) {
30
48
  v = this.cell.getInnerElements("t");
31
49
  }
32
- let cellXfs = this.styles["cellXfs"];
33
- let cellStyleXfs = this.styles["cellStyleXfs"];
34
- let cellStyles = this.styles["cellStyles"];
35
- let fonts = this.styles["fonts"];
36
- let fills = this.styles["fills"];
37
- let borders = this.styles["borders"];
38
- let numfmts = this.styles["numfmts"];
39
- let clrScheme = this.styles["clrScheme"];
40
- let sharedStrings = this.sharedStrings;
41
- let cellValue = new FortuneSheetCelldataValue();
50
+ var cellXfs = this.styles["cellXfs"];
51
+ var cellStyleXfs = this.styles["cellStyleXfs"];
52
+ var cellStyles = this.styles["cellStyles"];
53
+ var fonts = this.styles["fonts"];
54
+ var fills = this.styles["fills"];
55
+ var borders = this.styles["borders"];
56
+ var numfmts = this.styles["numfmts"];
57
+ var clrScheme = this.styles["clrScheme"];
58
+ var sharedStrings = this.sharedStrings;
59
+ var cellValue = new FortuneSheetCelldataValue();
42
60
  if (f != null) {
43
- let formula = f[0], attrList = formula.attributeList;
44
- let t = attrList.t, ref = attrList.ref, si = attrList.si;
45
- let formulaValue = f[0].value;
46
- if (t == "shared") {
61
+ var formula = f[0], attrList = formula.attributeList;
62
+ var t_1 = attrList.t, ref = attrList.ref, si = attrList.si;
63
+ var formulaValue = f[0].value;
64
+ if (t_1 == "shared") {
47
65
  this._fomulaRef = ref;
48
- this._formulaType = t;
66
+ this._formulaType = t_1;
49
67
  this._formulaSi = si;
50
68
  }
51
69
  // console.log(ref, t, si);
52
70
  if (ref != null || (formulaValue != null && formulaValue.length > 0)) {
53
71
  formulaValue = escapeCharacter(formulaValue);
54
- cellValue.f = "=" + formulaValue;
72
+ cellValue.f = (formulaValue.startsWith('=') ? "" : "=") + formulaValue;
55
73
  }
56
74
  }
57
- let familyFont = null;
58
- let quotePrefix;
75
+ var familyFont = null;
76
+ var quotePrefix;
59
77
  if (s != null) {
60
- let sNum = parseInt(s);
61
- let cellXf = cellXfs[sNum];
62
- let xfId = cellXf.attributeList.xfId;
63
- let numFmtId, fontId, fillId, borderId;
64
- let horizontal, vertical, wrapText, textRotation, shrinkToFit, indent, applyProtection;
78
+ var sNum = parseInt(s);
79
+ var cellXf = cellXfs[sNum];
80
+ var xfId = cellXf.attributeList.xfId;
81
+ var numFmtId = void 0, fontId = void 0, fillId = void 0, borderId = void 0;
82
+ var horizontal = void 0, vertical = void 0, wrapText = void 0, textRotation = void 0, shrinkToFit = void 0, indent = void 0, applyProtection = void 0;
65
83
  if (xfId != null) {
66
- let cellStyleXf = cellStyleXfs[parseInt(xfId)];
67
- let attrList = cellStyleXf.attributeList;
68
- let applyNumberFormat = attrList.applyNumberFormat;
69
- let applyFont = attrList.applyFont;
70
- let applyFill = attrList.applyFill;
71
- let applyBorder = attrList.applyBorder;
72
- let applyAlignment = attrList.applyAlignment;
84
+ var cellStyleXf = cellStyleXfs[parseInt(xfId)];
85
+ var attrList = cellStyleXf.attributeList;
86
+ var applyNumberFormat_1 = attrList.applyNumberFormat;
87
+ var applyFont_1 = attrList.applyFont;
88
+ var applyFill_1 = attrList.applyFill;
89
+ var applyBorder_1 = attrList.applyBorder;
90
+ var applyAlignment_1 = attrList.applyAlignment;
73
91
  // let applyProtection = attrList.applyProtection;
74
92
  applyProtection = attrList.applyProtection;
75
93
  quotePrefix = attrList.quotePrefix;
76
- if (applyNumberFormat != "0" && attrList.numFmtId != null) {
94
+ if (applyNumberFormat_1 != "0" && attrList.numFmtId != null) {
77
95
  // if(attrList.numFmtId!="0"){
78
96
  numFmtId = attrList.numFmtId;
79
97
  // }
80
98
  }
81
- if (applyFont != "0" && attrList.fontId != null) {
99
+ if (applyFont_1 != "0" && attrList.fontId != null) {
82
100
  fontId = attrList.fontId;
83
101
  }
84
- if (applyFill != "0" && attrList.fillId != null) {
102
+ if (applyFill_1 != "0" && attrList.fillId != null) {
85
103
  fillId = attrList.fillId;
86
104
  }
87
- if (applyBorder != "0" && attrList.borderId != null) {
105
+ if (applyBorder_1 != "0" && attrList.borderId != null) {
88
106
  borderId = attrList.borderId;
89
107
  }
90
- if (applyAlignment != null && applyAlignment != "0") {
91
- let alignment = cellStyleXf.getInnerElements("alignment");
108
+ if (applyAlignment_1 != null && applyAlignment_1 != "0") {
109
+ var alignment = cellStyleXf.getInnerElements("alignment");
92
110
  if (alignment != null) {
93
- let attrList = alignment[0].attributeList;
94
- if (attrList.horizontal != null) {
95
- horizontal = attrList.horizontal;
111
+ var attrList_1 = alignment[0].attributeList;
112
+ if (attrList_1.horizontal != null) {
113
+ horizontal = attrList_1.horizontal;
96
114
  }
97
- if (attrList.vertical != null) {
98
- vertical = attrList.vertical;
115
+ if (attrList_1.vertical != null) {
116
+ vertical = attrList_1.vertical;
99
117
  }
100
- if (attrList.wrapText != null) {
101
- wrapText = attrList.wrapText;
118
+ if (attrList_1.wrapText != null) {
119
+ wrapText = attrList_1.wrapText;
102
120
  }
103
- if (attrList.textRotation != null) {
104
- textRotation = attrList.textRotation;
121
+ if (attrList_1.textRotation != null) {
122
+ textRotation = attrList_1.textRotation;
105
123
  }
106
- if (attrList.shrinkToFit != null) {
107
- shrinkToFit = attrList.shrinkToFit;
124
+ if (attrList_1.shrinkToFit != null) {
125
+ shrinkToFit = attrList_1.shrinkToFit;
108
126
  }
109
- if (attrList.indent != null) {
110
- indent = attrList.indent;
127
+ if (attrList_1.indent != null) {
128
+ indent = attrList_1.indent;
111
129
  }
112
130
  }
113
131
  }
114
132
  }
115
- let applyNumberFormat = cellXf.attributeList.applyNumberFormat;
116
- let applyFont = cellXf.attributeList.applyFont;
117
- let applyFill = cellXf.attributeList.applyFill;
118
- let applyBorder = cellXf.attributeList.applyBorder;
119
- let applyAlignment = cellXf.attributeList.applyAlignment;
133
+ var applyNumberFormat = cellXf.attributeList.applyNumberFormat;
134
+ var applyFont = cellXf.attributeList.applyFont;
135
+ var applyFill = cellXf.attributeList.applyFill;
136
+ var applyBorder = cellXf.attributeList.applyBorder;
137
+ var applyAlignment = cellXf.attributeList.applyAlignment;
120
138
  if (cellXf.attributeList.applyProtection != null) {
121
139
  applyProtection = cellXf.attributeList.applyProtection;
122
140
  }
@@ -136,9 +154,9 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
136
154
  borderId = cellXf.attributeList.borderId;
137
155
  }
138
156
  if (applyAlignment != "0") {
139
- let alignment = cellXf.getInnerElements("alignment");
157
+ var alignment = cellXf.getInnerElements("alignment");
140
158
  if (alignment != null && alignment.length > 0) {
141
- let attrList = alignment[0].attributeList;
159
+ var attrList = alignment[0].attributeList;
142
160
  if (attrList.horizontal != null) {
143
161
  horizontal = attrList.horizontal;
144
162
  }
@@ -160,62 +178,62 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
160
178
  }
161
179
  }
162
180
  if (numFmtId != undefined) {
163
- let numf = numfmts[parseInt(numFmtId)];
164
- let cellFormat = new FortuneSheetCellFormat();
181
+ var numf = numfmts[parseInt(numFmtId)];
182
+ var cellFormat = new FortuneSheetCellFormat();
165
183
  cellFormat.fa = escapeCharacter(numf);
166
184
  // console.log(numf, numFmtId, this.v);
167
185
  cellFormat.t = t || "n";
168
186
  cellValue.ct = cellFormat;
169
187
  }
170
188
  if (fillId != undefined) {
171
- let fillIdNum = parseInt(fillId);
172
- let fill = fills[fillIdNum];
189
+ var fillIdNum = parseInt(fillId);
190
+ var fill = fills[fillIdNum];
173
191
  // console.log(cellValue.v);
174
- let bg = this.getBackgroundByFill(fill, clrScheme);
192
+ var bg = this.getBackgroundByFill(fill, clrScheme);
175
193
  if (bg != null) {
176
194
  cellValue.bg = bg;
177
195
  }
178
196
  }
179
197
  if (fontId != undefined) {
180
- let fontIdNum = parseInt(fontId);
181
- let font = fonts[fontIdNum];
198
+ var fontIdNum = parseInt(fontId);
199
+ var font = fonts[fontIdNum];
182
200
  if (font != null) {
183
- let sz = font.getInnerElements("sz"); //font size
184
- let colors = font.getInnerElements("color"); //font color
185
- let family = font.getInnerElements("name"); //font family
186
- let familyOverrides = font.getInnerElements("family"); //font family will be overrided by name
187
- let charset = font.getInnerElements("charset"); //font charset
188
- let bolds = font.getInnerElements("b"); //font bold
189
- let italics = font.getInnerElements("i"); //font italic
190
- let strikes = font.getInnerElements("strike"); //font italic
191
- let underlines = font.getInnerElements("u"); //font italic
201
+ var sz = font.getInnerElements("sz"); //font size
202
+ var colors = font.getInnerElements("color"); //font color
203
+ var family = font.getInnerElements("name"); //font family
204
+ var familyOverrides = font.getInnerElements("family"); //font family will be overrided by name
205
+ var charset = font.getInnerElements("charset"); //font charset
206
+ var bolds = font.getInnerElements("b"); //font bold
207
+ var italics = font.getInnerElements("i"); //font italic
208
+ var strikes = font.getInnerElements("strike"); //font italic
209
+ var underlines = font.getInnerElements("u"); //font italic
192
210
  if (sz != null && sz.length > 0) {
193
- let fs = sz[0].attributeList.val;
211
+ var fs = sz[0].attributeList.val;
194
212
  if (fs != null) {
195
213
  cellValue.fs = parseInt(fs);
196
214
  }
197
215
  }
198
216
  if (colors != null && colors.length > 0) {
199
- let color = colors[0];
200
- let fc = getColor(color, this.styles, "t");
217
+ var color = colors[0];
218
+ var fc = getColor(color, this.styles, "t");
201
219
  if (fc != null) {
202
220
  cellValue.fc = fc;
203
221
  }
204
222
  }
205
223
  if (familyOverrides != null && familyOverrides.length > 0) {
206
- let val = familyOverrides[0].attributeList.val;
224
+ var val = familyOverrides[0].attributeList.val;
207
225
  if (val != null) {
208
226
  familyFont = fontFamilys[val];
209
227
  }
210
228
  }
211
229
  if (family != null && family.length > 0) {
212
- let val = family[0].attributeList.val;
230
+ var val = family[0].attributeList.val;
213
231
  if (val != null) {
214
232
  cellValue.ff = val;
215
233
  }
216
234
  }
217
235
  if (bolds != null && bolds.length > 0) {
218
- let bold = bolds[0].attributeList.val;
236
+ var bold = bolds[0].attributeList.val;
219
237
  if (bold == "0") {
220
238
  cellValue.bl = 0;
221
239
  }
@@ -224,7 +242,7 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
224
242
  }
225
243
  }
226
244
  if (italics != null && italics.length > 0) {
227
- let italic = italics[0].attributeList.val;
245
+ var italic = italics[0].attributeList.val;
228
246
  if (italic == "0") {
229
247
  cellValue.it = 0;
230
248
  }
@@ -233,7 +251,7 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
233
251
  }
234
252
  }
235
253
  if (strikes != null && strikes.length > 0) {
236
- let strike = strikes[0].attributeList.val;
254
+ var strike = strikes[0].attributeList.val;
237
255
  if (strike == "0") {
238
256
  cellValue.cl = 0;
239
257
  }
@@ -242,7 +260,7 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
242
260
  }
243
261
  }
244
262
  if (underlines != null && underlines.length > 0) {
245
- let underline = underlines[0].attributeList.val;
263
+ var underline = underlines[0].attributeList.val;
246
264
  if (underline == "single") {
247
265
  cellValue.un = 1;
248
266
  }
@@ -361,30 +379,30 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
361
379
  //fortunesheet unsupport
362
380
  }
363
381
  if (borderId != undefined) {
364
- let borderIdNum = parseInt(borderId);
365
- let border = borders[borderIdNum];
382
+ var borderIdNum = parseInt(borderId);
383
+ var border = borders[borderIdNum];
366
384
  // this._borderId = borderIdNum;
367
- let borderObject = new FortuneSheetborderInfoCellForImp();
385
+ var borderObject = new FortuneSheetborderInfoCellForImp();
368
386
  borderObject.rangeType = "cell";
369
387
  // borderObject.cells = [];
370
- let borderCellValue = new FortuneSheetborderInfoCellValue();
388
+ var borderCellValue = new FortuneSheetborderInfoCellValue();
371
389
  borderCellValue.row_index = this.r;
372
390
  borderCellValue.col_index = this.c;
373
- let lefts = border.getInnerElements("left");
374
- let rights = border.getInnerElements("right");
375
- let tops = border.getInnerElements("top");
376
- let bottoms = border.getInnerElements("bottom");
377
- let diagonals = border.getInnerElements("diagonal");
378
- let starts = border.getInnerElements("start");
379
- let ends = border.getInnerElements("end");
380
- let left = this.getBorderInfo(lefts);
381
- let right = this.getBorderInfo(rights);
382
- let top = this.getBorderInfo(tops);
383
- let bottom = this.getBorderInfo(bottoms);
384
- let diagonal = this.getBorderInfo(diagonals);
385
- let start = this.getBorderInfo(starts);
386
- let end = this.getBorderInfo(ends);
387
- let isAdd = false;
391
+ var lefts = border.getInnerElements("left");
392
+ var rights = border.getInnerElements("right");
393
+ var tops = border.getInnerElements("top");
394
+ var bottoms = border.getInnerElements("bottom");
395
+ var diagonals = border.getInnerElements("diagonal");
396
+ var starts = border.getInnerElements("start");
397
+ var ends = border.getInnerElements("end");
398
+ var left = this.getBorderInfo(lefts);
399
+ var right = this.getBorderInfo(rights);
400
+ var top_1 = this.getBorderInfo(tops);
401
+ var bottom = this.getBorderInfo(bottoms);
402
+ var diagonal = this.getBorderInfo(diagonals);
403
+ var start = this.getBorderInfo(starts);
404
+ var end = this.getBorderInfo(ends);
405
+ var isAdd = false;
388
406
  if (start != null && start.color != null) {
389
407
  borderCellValue.l = start;
390
408
  isAdd = true;
@@ -401,8 +419,8 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
401
419
  borderCellValue.r = right;
402
420
  isAdd = true;
403
421
  }
404
- if (top != null && top.color != null) {
405
- borderCellValue.t = top;
422
+ if (top_1 != null && top_1.color != null) {
423
+ borderCellValue.t = top_1;
406
424
  isAdd = true;
407
425
  }
408
426
  if (bottom != null && bottom.color != null) {
@@ -420,40 +438,40 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
420
438
  cellValue.tb = 1;
421
439
  }
422
440
  if (v != null) {
423
- let value = v[0].value;
441
+ var value = v[0].value;
424
442
  if (/&#\d+;/.test(value)) {
425
443
  value = this.htmlDecode(value);
426
444
  }
427
445
  if (t == ST_CellType["SharedString"]) {
428
- let siIndex = parseInt(v[0].value);
429
- let sharedSI = sharedStrings[siIndex];
430
- let rFlag = sharedSI.getInnerElements("r");
446
+ var siIndex = parseInt(v[0].value);
447
+ var sharedSI = sharedStrings[siIndex];
448
+ var rFlag = sharedSI.getInnerElements("r");
431
449
  if (rFlag == null) {
432
- let tFlag = sharedSI.getInnerElements("t");
450
+ var tFlag = sharedSI.getInnerElements("t");
433
451
  if (tFlag != null) {
434
- let text = "";
435
- tFlag.forEach((t) => {
436
- text += t.value;
452
+ var text_1 = "";
453
+ tFlag.forEach(function (t) {
454
+ text_1 += t.value;
437
455
  });
438
- text = escapeCharacter(text);
456
+ text_1 = escapeCharacter(text_1);
439
457
  //isContainMultiType(text) &&
440
- if (familyFont == "Roman" && text.length > 0) {
441
- let textArray = text.split("");
442
- let preWordType = null, wordText = "", preWholef = null;
443
- let wholef = "Times New Roman";
458
+ if (familyFont == "Roman" && text_1.length > 0) {
459
+ var textArray = text_1.split("");
460
+ var preWordType = null, wordText = "", preWholef = null;
461
+ var wholef = "Times New Roman";
444
462
  if (cellValue.ff != null) {
445
463
  wholef = cellValue.ff;
446
464
  }
447
- let cellFormat = cellValue.ct;
465
+ var cellFormat = cellValue.ct;
448
466
  if (cellFormat == null) {
449
467
  cellFormat = new FortuneSheetCellFormat();
450
468
  }
451
469
  if (cellFormat.s == null) {
452
470
  cellFormat.s = [];
453
471
  }
454
- for (let i = 0; i < textArray.length; i++) {
455
- let w = textArray[i];
456
- let type = null, ff = wholef;
472
+ for (var i = 0; i < textArray.length; i++) {
473
+ var w = textArray[i];
474
+ var type = null, ff = wholef;
457
475
  if (isChinese(w)) {
458
476
  type = "c";
459
477
  ff = "宋体";
@@ -471,7 +489,7 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
471
489
  }
472
490
  if ((type != preWordType && preWordType != null) ||
473
491
  i == textArray.length - 1) {
474
- let InlineString = {};
492
+ var InlineString = {};
475
493
  InlineString.ff = preWholef;
476
494
  if (cellValue.fc != null) {
477
495
  InlineString.fc = cellValue.fc;
@@ -500,7 +518,7 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
500
518
  InlineString.ff = preWholef;
501
519
  InlineString.v = wordText;
502
520
  cellFormat.s.push(InlineString);
503
- let InlineStringLast = {};
521
+ var InlineStringLast = {};
504
522
  InlineStringLast.ff = ff;
505
523
  InlineStringLast.v = w;
506
524
  if (cellValue.fc != null) {
@@ -543,11 +561,11 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
543
561
  // console.log(cellValue);
544
562
  }
545
563
  else {
546
- text = this.replaceSpecialWrap(text);
547
- if (text.indexOf("\r\n") > -1 || text.indexOf("\n") > -1) {
548
- let InlineString = {};
549
- InlineString.v = text;
550
- let cellFormat = cellValue.ct;
564
+ text_1 = this.replaceSpecialWrap(text_1);
565
+ if (text_1.indexOf("\r\n") > -1 || text_1.indexOf("\n") > -1) {
566
+ var InlineString = {};
567
+ InlineString.v = text_1;
568
+ var cellFormat = cellValue.ct;
551
569
  if (cellFormat == null) {
552
570
  cellFormat = new FortuneSheetCellFormat();
553
571
  }
@@ -577,32 +595,32 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
577
595
  cellValue.ct = cellFormat;
578
596
  }
579
597
  else {
580
- cellValue.v = text;
598
+ cellValue.v = text_1;
581
599
  quotePrefix = "1";
582
600
  }
583
601
  }
584
602
  }
585
603
  }
586
604
  else {
587
- let styles = [];
588
- rFlag.forEach((r) => {
589
- let tFlag = r.getInnerElements("t");
590
- let rPr = r.getInnerElements("rPr");
591
- let InlineString = {};
605
+ var styles_1 = [];
606
+ rFlag.forEach(function (r) {
607
+ var tFlag = r.getInnerElements("t");
608
+ var rPr = r.getInnerElements("rPr");
609
+ var InlineString = {};
592
610
  if (tFlag != null && tFlag.length > 0) {
593
- let text = tFlag[0].value;
594
- text = this.replaceSpecialWrap(text);
611
+ var text = tFlag[0].value;
612
+ text = _this.replaceSpecialWrap(text);
595
613
  text = escapeCharacter(text);
596
614
  InlineString.v = text;
597
615
  }
598
616
  if (rPr != null && rPr.length > 0) {
599
- let frpr = rPr[0];
600
- let sz = getlineStringAttr(frpr, "sz"), rFont = getlineStringAttr(frpr, "rFont"), family = getlineStringAttr(frpr, "family"), charset = getlineStringAttr(frpr, "charset"), scheme = getlineStringAttr(frpr, "scheme"), b = getlineStringAttr(frpr, "b"), i = getlineStringAttr(frpr, "i"), u = getlineStringAttr(frpr, "u"), strike = getlineStringAttr(frpr, "strike"), vertAlign = getlineStringAttr(frpr, "vertAlign"), color;
601
- let cEle = frpr.getInnerElements("color");
617
+ var frpr = rPr[0];
618
+ var sz = getlineStringAttr(frpr, "sz"), rFont = getlineStringAttr(frpr, "rFont"), family = getlineStringAttr(frpr, "family"), charset = getlineStringAttr(frpr, "charset"), scheme = getlineStringAttr(frpr, "scheme"), b = getlineStringAttr(frpr, "b"), i = getlineStringAttr(frpr, "i"), u = getlineStringAttr(frpr, "u"), strike = getlineStringAttr(frpr, "strike"), vertAlign = getlineStringAttr(frpr, "vertAlign"), color = void 0;
619
+ var cEle = frpr.getInnerElements("color");
602
620
  if (cEle != null && cEle.length > 0) {
603
- color = getColor(cEle[0], this.styles, "t");
621
+ color = getColor(cEle[0], _this.styles, "t");
604
622
  }
605
- let ff;
623
+ var ff = void 0;
606
624
  // if(family!=null){
607
625
  // ff = fontFamilys[family];
608
626
  // }
@@ -686,14 +704,14 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
686
704
  InlineString.it = cellValue.it;
687
705
  }
688
706
  }
689
- styles.push(InlineString);
707
+ styles_1.push(InlineString);
690
708
  });
691
- let cellFormat = cellValue.ct;
709
+ var cellFormat = cellValue.ct;
692
710
  if (cellFormat == null) {
693
711
  cellFormat = new FortuneSheetCellFormat();
694
712
  }
695
713
  cellFormat.t = "inlineStr";
696
- cellFormat.s = styles;
714
+ cellFormat.s = styles_1;
697
715
  cellValue.ct = cellFormat;
698
716
  }
699
717
  }
@@ -710,28 +728,28 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
710
728
  cellValue.qp = parseInt(quotePrefix);
711
729
  }
712
730
  return cellValue;
713
- }
714
- replaceSpecialWrap(text) {
731
+ };
732
+ FortuneSheetCelldata.prototype.replaceSpecialWrap = function (text) {
715
733
  text = text
716
734
  .replace(/_x000D_/g, "")
717
735
  .replace(/&#13;&#10;/g, "\r\n")
718
736
  .replace(/&#13;/g, "\r")
719
737
  .replace(/&#10;/g, "\n");
720
738
  return text;
721
- }
722
- getBackgroundByFill(fill, clrScheme) {
723
- let patternFills = fill.getInnerElements("patternFill");
739
+ };
740
+ FortuneSheetCelldata.prototype.getBackgroundByFill = function (fill, clrScheme) {
741
+ var patternFills = fill.getInnerElements("patternFill");
724
742
  if (patternFills != null) {
725
- let patternFill = patternFills[0];
726
- let fgColors = patternFill.getInnerElements("fgColor");
727
- let bgColors = patternFill.getInnerElements("bgColor");
728
- let fg, bg;
743
+ var patternFill = patternFills[0];
744
+ var fgColors = patternFill.getInnerElements("fgColor");
745
+ var bgColors = patternFill.getInnerElements("bgColor");
746
+ var fg = void 0, bg = void 0;
729
747
  if (fgColors != null) {
730
- let fgColor = fgColors[0];
748
+ var fgColor = fgColors[0];
731
749
  fg = getColor(fgColor, this.styles);
732
750
  }
733
751
  if (bgColors != null) {
734
- let bgColor = bgColors[0];
752
+ var bgColor = bgColors[0];
735
753
  bg = getColor(bgColor, this.styles);
736
754
  }
737
755
  // console.log(fgColors,bgColors,clrScheme);
@@ -743,40 +761,42 @@ export class FortuneSheetCelldata extends FortuneSheetCelldataBase {
743
761
  }
744
762
  }
745
763
  else {
746
- let gradientfills = fill.getInnerElements("gradientFill");
764
+ var gradientfills = fill.getInnerElements("gradientFill");
747
765
  if (gradientfills != null) {
748
766
  //graient color fill handler
749
767
  return null;
750
768
  }
751
769
  }
752
- }
753
- getBorderInfo(borders) {
770
+ };
771
+ FortuneSheetCelldata.prototype.getBorderInfo = function (borders) {
754
772
  if (borders == null) {
755
773
  return null;
756
774
  }
757
- let border = borders[0], attrList = border.attributeList;
758
- let clrScheme = this.styles["clrScheme"];
759
- let style = attrList.style;
775
+ var border = borders[0], attrList = border.attributeList;
776
+ var clrScheme = this.styles["clrScheme"];
777
+ var style = attrList.style;
760
778
  if (style == null || style == "none") {
761
779
  return null;
762
780
  }
763
- let colors = border.getInnerElements("color");
764
- let colorRet = "#000000";
781
+ var colors = border.getInnerElements("color");
782
+ var colorRet = "#000000";
765
783
  if (colors != null) {
766
- let color = colors[0];
784
+ var color = colors[0];
767
785
  colorRet = getColor(color, this.styles, "b");
768
786
  if (colorRet == null) {
769
787
  colorRet = "#000000";
770
788
  }
771
789
  }
772
- let ret = new FortuneSheetborderInfoCellValueStyle();
790
+ var ret = new FortuneSheetborderInfoCellValueStyle();
773
791
  ret.style = borderTypes[style];
774
792
  ret.color = colorRet;
775
793
  return ret;
776
- }
777
- htmlDecode(str) {
794
+ };
795
+ FortuneSheetCelldata.prototype.htmlDecode = function (str) {
778
796
  return str.replace(/&#(x)?([^&]{1,5});/g, function ($, $1, $2) {
779
797
  return String.fromCharCode(parseInt($2, $1 ? 16 : 10));
780
798
  });
781
- }
782
- }
799
+ };
800
+ return FortuneSheetCelldata;
801
+ }(FortuneSheetCelldataBase));
802
+ export { FortuneSheetCelldata };