@cj-tech-master/excelts 6.0.0-beta.2 → 6.0.0-beta.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.
- package/dist/browser/modules/excel/column.d.ts +2 -2
- package/dist/browser/modules/excel/column.js +24 -26
- package/dist/browser/modules/excel/stream/worksheet-reader.d.ts +1 -1
- package/dist/browser/modules/excel/stream/worksheet-reader.js +1 -4
- package/dist/browser/modules/excel/stream/worksheet-writer.d.ts +1 -1
- package/dist/browser/modules/excel/stream/worksheet-writer.js +1 -4
- package/dist/browser/modules/excel/utils/sheet-utils.js +2 -2
- package/dist/browser/modules/excel/worksheet.d.ts +1 -1
- package/dist/browser/modules/excel/worksheet.js +3 -6
- package/dist/cjs/modules/excel/column.js +24 -26
- package/dist/cjs/modules/excel/stream/worksheet-reader.js +1 -4
- package/dist/cjs/modules/excel/stream/worksheet-writer.js +1 -4
- package/dist/cjs/modules/excel/utils/sheet-utils.js +2 -2
- package/dist/cjs/modules/excel/worksheet.js +3 -6
- package/dist/esm/modules/excel/column.js +24 -26
- package/dist/esm/modules/excel/stream/worksheet-reader.js +1 -4
- package/dist/esm/modules/excel/stream/worksheet-writer.js +1 -4
- package/dist/esm/modules/excel/utils/sheet-utils.js +2 -2
- package/dist/esm/modules/excel/worksheet.js +3 -6
- package/dist/iife/excelts.iife.js +10 -13
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +5 -5
- package/dist/types/modules/excel/column.d.ts +2 -2
- package/dist/types/modules/excel/stream/worksheet-reader.d.ts +1 -1
- package/dist/types/modules/excel/stream/worksheet-writer.d.ts +1 -1
- package/dist/types/modules/excel/worksheet.d.ts +1 -1
- package/package.json +1 -1
|
@@ -121,7 +121,7 @@ declare class Column {
|
|
|
121
121
|
get fill(): Fill | undefined;
|
|
122
122
|
set fill(value: Fill | undefined);
|
|
123
123
|
static toModel(columns: Column[]): ColumnModel[] | undefined;
|
|
124
|
-
static fromModel(cols: ColumnModel[]): Column[]
|
|
125
|
-
static fromModel(worksheet: Worksheet, cols: ColumnModel[]): Column[]
|
|
124
|
+
static fromModel(cols: ColumnModel[]): Column[];
|
|
125
|
+
static fromModel(worksheet: Worksheet, cols: ColumnModel[]): Column[];
|
|
126
126
|
}
|
|
127
127
|
export { Column };
|
|
@@ -304,32 +304,30 @@ class Column {
|
|
|
304
304
|
// Convert array of Column into compressed list cols
|
|
305
305
|
const cols = [];
|
|
306
306
|
let col = null;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
if (
|
|
310
|
-
|
|
311
|
-
col = null;
|
|
312
|
-
}
|
|
307
|
+
columns.forEach((column, index) => {
|
|
308
|
+
if (column.isDefault) {
|
|
309
|
+
if (col) {
|
|
310
|
+
col = null;
|
|
313
311
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
}
|
|
312
|
+
}
|
|
313
|
+
else if (!col || !column.equivalentToModel(col)) {
|
|
314
|
+
col = {
|
|
315
|
+
min: index + 1,
|
|
316
|
+
max: index + 1,
|
|
317
|
+
width: column.width !== undefined ? column.width : DEFAULT_COLUMN_WIDTH,
|
|
318
|
+
style: column.style,
|
|
319
|
+
isCustomWidth: column.isCustomWidth,
|
|
320
|
+
hidden: column.hidden,
|
|
321
|
+
outlineLevel: column.outlineLevel,
|
|
322
|
+
collapsed: column.collapsed,
|
|
323
|
+
bestFit: column.bestFit
|
|
324
|
+
};
|
|
325
|
+
cols.push(col);
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
col.max = index + 1;
|
|
329
|
+
}
|
|
330
|
+
});
|
|
333
331
|
return cols.length ? cols : undefined;
|
|
334
332
|
}
|
|
335
333
|
static fromModel(worksheetOrCols, colsMaybe) {
|
|
@@ -360,7 +358,7 @@ class Column {
|
|
|
360
358
|
columns.push(new Column(worksheet, count++, col));
|
|
361
359
|
}
|
|
362
360
|
}
|
|
363
|
-
return columns
|
|
361
|
+
return columns;
|
|
364
362
|
}
|
|
365
363
|
}
|
|
366
364
|
export { Column };
|
|
@@ -48,7 +48,7 @@ declare class WorksheetReader extends EventEmitter {
|
|
|
48
48
|
constructor({ workbook, id, iterator, options }: WorksheetReaderOptions);
|
|
49
49
|
destroy(): void;
|
|
50
50
|
get dimensions(): Dimensions;
|
|
51
|
-
get columns(): Column[]
|
|
51
|
+
get columns(): Column[];
|
|
52
52
|
getColumn(c: string | number): Column;
|
|
53
53
|
getColumnKey(key: string): Column | undefined;
|
|
54
54
|
setColumnKey(key: string, value: Column): void;
|
|
@@ -22,7 +22,7 @@ class WorksheetReader extends EventEmitter {
|
|
|
22
22
|
// and a name
|
|
23
23
|
this.name = `Sheet${this.id}`;
|
|
24
24
|
// column definitions
|
|
25
|
-
this._columns =
|
|
25
|
+
this._columns = [];
|
|
26
26
|
this._keys = Object.create(null);
|
|
27
27
|
// keep a record of dimensions
|
|
28
28
|
this._dimensions = new Dimensions();
|
|
@@ -54,9 +54,6 @@ class WorksheetReader extends EventEmitter {
|
|
|
54
54
|
// otherwise, assume letter
|
|
55
55
|
c = colCache.l2n(c);
|
|
56
56
|
}
|
|
57
|
-
if (!this._columns) {
|
|
58
|
-
this._columns = [];
|
|
59
|
-
}
|
|
60
57
|
if (c > this._columns.length) {
|
|
61
58
|
let n = this._columns.length + 1;
|
|
62
59
|
while (n <= c) {
|
|
@@ -77,7 +77,7 @@ declare class WorksheetWriter {
|
|
|
77
77
|
commit(): void;
|
|
78
78
|
get dimensions(): Dimensions;
|
|
79
79
|
get views(): Partial<WorksheetView>[];
|
|
80
|
-
get columns(): Column[]
|
|
80
|
+
get columns(): Column[];
|
|
81
81
|
set columns(value: Partial<Column>[]);
|
|
82
82
|
getColumnKey(key: string): Column | undefined;
|
|
83
83
|
setColumnKey(key: string, value: Column): void;
|
|
@@ -71,7 +71,7 @@ class WorksheetWriter {
|
|
|
71
71
|
// when they are committed, they will be deleted.
|
|
72
72
|
this._rows = [];
|
|
73
73
|
// column definitions
|
|
74
|
-
this._columns =
|
|
74
|
+
this._columns = [];
|
|
75
75
|
// column keys (addRow convenience): key ==> this._columns index
|
|
76
76
|
this._keys = {};
|
|
77
77
|
// keep a record of all row and column pageBreaks
|
|
@@ -266,9 +266,6 @@ class WorksheetWriter {
|
|
|
266
266
|
// otherwise, assume letter
|
|
267
267
|
c = colCache.l2n(c);
|
|
268
268
|
}
|
|
269
|
-
if (!this._columns) {
|
|
270
|
-
this._columns = [];
|
|
271
|
-
}
|
|
272
269
|
if (c > this._columns.length) {
|
|
273
270
|
let n = this._columns.length + 1;
|
|
274
271
|
while (n <= c) {
|
|
@@ -510,8 +510,8 @@ export function bookAppendSheet(workbook, worksheet, name) {
|
|
|
510
510
|
});
|
|
511
511
|
});
|
|
512
512
|
// Copy column properties
|
|
513
|
-
worksheet.columns
|
|
514
|
-
if (col && newWs.columns
|
|
513
|
+
worksheet.columns.forEach((col, idx) => {
|
|
514
|
+
if (col && newWs.columns[idx]) {
|
|
515
515
|
if (col.width) {
|
|
516
516
|
newWs.getColumn(idx + 1).width = col.width;
|
|
517
517
|
}
|
|
@@ -33,7 +33,7 @@ class Worksheet {
|
|
|
33
33
|
// Note: _rows is zero based. Must subtract 1 to go from cell.row to index
|
|
34
34
|
this._rows = [];
|
|
35
35
|
// column definitions
|
|
36
|
-
this._columns =
|
|
36
|
+
this._columns = [];
|
|
37
37
|
// column keys (addRow convenience): key ==> this._collumns index
|
|
38
38
|
this._keys = {};
|
|
39
39
|
// keep record of all merges
|
|
@@ -224,9 +224,6 @@ class Worksheet {
|
|
|
224
224
|
else {
|
|
225
225
|
colNum = c;
|
|
226
226
|
}
|
|
227
|
-
if (!this._columns) {
|
|
228
|
-
this._columns = [];
|
|
229
|
-
}
|
|
230
227
|
if (colNum > this._columns.length) {
|
|
231
228
|
let n = this._columns.length + 1;
|
|
232
229
|
while (n <= colNum) {
|
|
@@ -281,7 +278,7 @@ class Worksheet {
|
|
|
281
278
|
// splice column definitions
|
|
282
279
|
const nExpand = inserts.length - count;
|
|
283
280
|
const nKeep = start + count;
|
|
284
|
-
const nEnd = this._columns
|
|
281
|
+
const nEnd = this._columns.length;
|
|
285
282
|
if (nExpand < 0) {
|
|
286
283
|
for (let i = start + inserts.length; i <= nEnd; i++) {
|
|
287
284
|
this.getColumn(i).defn = this.getColumn(i - nExpand).defn;
|
|
@@ -1128,7 +1125,7 @@ class Worksheet {
|
|
|
1128
1125
|
};
|
|
1129
1126
|
// =================================================
|
|
1130
1127
|
// columns
|
|
1131
|
-
model.cols = Column.toModel(this.columns
|
|
1128
|
+
model.cols = Column.toModel(this.columns);
|
|
1132
1129
|
// ==========================================================
|
|
1133
1130
|
// Rows
|
|
1134
1131
|
const rows = (model.rows = []);
|
|
@@ -307,32 +307,30 @@ class Column {
|
|
|
307
307
|
// Convert array of Column into compressed list cols
|
|
308
308
|
const cols = [];
|
|
309
309
|
let col = null;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
if (
|
|
313
|
-
|
|
314
|
-
col = null;
|
|
315
|
-
}
|
|
310
|
+
columns.forEach((column, index) => {
|
|
311
|
+
if (column.isDefault) {
|
|
312
|
+
if (col) {
|
|
313
|
+
col = null;
|
|
316
314
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
}
|
|
315
|
+
}
|
|
316
|
+
else if (!col || !column.equivalentToModel(col)) {
|
|
317
|
+
col = {
|
|
318
|
+
min: index + 1,
|
|
319
|
+
max: index + 1,
|
|
320
|
+
width: column.width !== undefined ? column.width : DEFAULT_COLUMN_WIDTH,
|
|
321
|
+
style: column.style,
|
|
322
|
+
isCustomWidth: column.isCustomWidth,
|
|
323
|
+
hidden: column.hidden,
|
|
324
|
+
outlineLevel: column.outlineLevel,
|
|
325
|
+
collapsed: column.collapsed,
|
|
326
|
+
bestFit: column.bestFit
|
|
327
|
+
};
|
|
328
|
+
cols.push(col);
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
col.max = index + 1;
|
|
332
|
+
}
|
|
333
|
+
});
|
|
336
334
|
return cols.length ? cols : undefined;
|
|
337
335
|
}
|
|
338
336
|
static fromModel(worksheetOrCols, colsMaybe) {
|
|
@@ -363,7 +361,7 @@ class Column {
|
|
|
363
361
|
columns.push(new Column(worksheet, count++, col));
|
|
364
362
|
}
|
|
365
363
|
}
|
|
366
|
-
return columns
|
|
364
|
+
return columns;
|
|
367
365
|
}
|
|
368
366
|
}
|
|
369
367
|
exports.Column = Column;
|
|
@@ -25,7 +25,7 @@ class WorksheetReader extends event_emitter_1.EventEmitter {
|
|
|
25
25
|
// and a name
|
|
26
26
|
this.name = `Sheet${this.id}`;
|
|
27
27
|
// column definitions
|
|
28
|
-
this._columns =
|
|
28
|
+
this._columns = [];
|
|
29
29
|
this._keys = Object.create(null);
|
|
30
30
|
// keep a record of dimensions
|
|
31
31
|
this._dimensions = new range_1.Dimensions();
|
|
@@ -57,9 +57,6 @@ class WorksheetReader extends event_emitter_1.EventEmitter {
|
|
|
57
57
|
// otherwise, assume letter
|
|
58
58
|
c = col_cache_1.colCache.l2n(c);
|
|
59
59
|
}
|
|
60
|
-
if (!this._columns) {
|
|
61
|
-
this._columns = [];
|
|
62
|
-
}
|
|
63
60
|
if (c > this._columns.length) {
|
|
64
61
|
let n = this._columns.length + 1;
|
|
65
62
|
while (n <= c) {
|
|
@@ -74,7 +74,7 @@ class WorksheetWriter {
|
|
|
74
74
|
// when they are committed, they will be deleted.
|
|
75
75
|
this._rows = [];
|
|
76
76
|
// column definitions
|
|
77
|
-
this._columns =
|
|
77
|
+
this._columns = [];
|
|
78
78
|
// column keys (addRow convenience): key ==> this._columns index
|
|
79
79
|
this._keys = {};
|
|
80
80
|
// keep a record of all row and column pageBreaks
|
|
@@ -269,9 +269,6 @@ class WorksheetWriter {
|
|
|
269
269
|
// otherwise, assume letter
|
|
270
270
|
c = col_cache_1.colCache.l2n(c);
|
|
271
271
|
}
|
|
272
|
-
if (!this._columns) {
|
|
273
|
-
this._columns = [];
|
|
274
|
-
}
|
|
275
272
|
if (c > this._columns.length) {
|
|
276
273
|
let n = this._columns.length + 1;
|
|
277
274
|
while (n <= c) {
|
|
@@ -528,8 +528,8 @@ function bookAppendSheet(workbook, worksheet, name) {
|
|
|
528
528
|
});
|
|
529
529
|
});
|
|
530
530
|
// Copy column properties
|
|
531
|
-
worksheet.columns
|
|
532
|
-
if (col && newWs.columns
|
|
531
|
+
worksheet.columns.forEach((col, idx) => {
|
|
532
|
+
if (col && newWs.columns[idx]) {
|
|
533
533
|
if (col.width) {
|
|
534
534
|
newWs.getColumn(idx + 1).width = col.width;
|
|
535
535
|
}
|
|
@@ -36,7 +36,7 @@ class Worksheet {
|
|
|
36
36
|
// Note: _rows is zero based. Must subtract 1 to go from cell.row to index
|
|
37
37
|
this._rows = [];
|
|
38
38
|
// column definitions
|
|
39
|
-
this._columns =
|
|
39
|
+
this._columns = [];
|
|
40
40
|
// column keys (addRow convenience): key ==> this._collumns index
|
|
41
41
|
this._keys = {};
|
|
42
42
|
// keep record of all merges
|
|
@@ -227,9 +227,6 @@ class Worksheet {
|
|
|
227
227
|
else {
|
|
228
228
|
colNum = c;
|
|
229
229
|
}
|
|
230
|
-
if (!this._columns) {
|
|
231
|
-
this._columns = [];
|
|
232
|
-
}
|
|
233
230
|
if (colNum > this._columns.length) {
|
|
234
231
|
let n = this._columns.length + 1;
|
|
235
232
|
while (n <= colNum) {
|
|
@@ -284,7 +281,7 @@ class Worksheet {
|
|
|
284
281
|
// splice column definitions
|
|
285
282
|
const nExpand = inserts.length - count;
|
|
286
283
|
const nKeep = start + count;
|
|
287
|
-
const nEnd = this._columns
|
|
284
|
+
const nEnd = this._columns.length;
|
|
288
285
|
if (nExpand < 0) {
|
|
289
286
|
for (let i = start + inserts.length; i <= nEnd; i++) {
|
|
290
287
|
this.getColumn(i).defn = this.getColumn(i - nExpand).defn;
|
|
@@ -1131,7 +1128,7 @@ class Worksheet {
|
|
|
1131
1128
|
};
|
|
1132
1129
|
// =================================================
|
|
1133
1130
|
// columns
|
|
1134
|
-
model.cols = column_1.Column.toModel(this.columns
|
|
1131
|
+
model.cols = column_1.Column.toModel(this.columns);
|
|
1135
1132
|
// ==========================================================
|
|
1136
1133
|
// Rows
|
|
1137
1134
|
const rows = (model.rows = []);
|
|
@@ -304,32 +304,30 @@ class Column {
|
|
|
304
304
|
// Convert array of Column into compressed list cols
|
|
305
305
|
const cols = [];
|
|
306
306
|
let col = null;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
if (
|
|
310
|
-
|
|
311
|
-
col = null;
|
|
312
|
-
}
|
|
307
|
+
columns.forEach((column, index) => {
|
|
308
|
+
if (column.isDefault) {
|
|
309
|
+
if (col) {
|
|
310
|
+
col = null;
|
|
313
311
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
}
|
|
312
|
+
}
|
|
313
|
+
else if (!col || !column.equivalentToModel(col)) {
|
|
314
|
+
col = {
|
|
315
|
+
min: index + 1,
|
|
316
|
+
max: index + 1,
|
|
317
|
+
width: column.width !== undefined ? column.width : DEFAULT_COLUMN_WIDTH,
|
|
318
|
+
style: column.style,
|
|
319
|
+
isCustomWidth: column.isCustomWidth,
|
|
320
|
+
hidden: column.hidden,
|
|
321
|
+
outlineLevel: column.outlineLevel,
|
|
322
|
+
collapsed: column.collapsed,
|
|
323
|
+
bestFit: column.bestFit
|
|
324
|
+
};
|
|
325
|
+
cols.push(col);
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
col.max = index + 1;
|
|
329
|
+
}
|
|
330
|
+
});
|
|
333
331
|
return cols.length ? cols : undefined;
|
|
334
332
|
}
|
|
335
333
|
static fromModel(worksheetOrCols, colsMaybe) {
|
|
@@ -360,7 +358,7 @@ class Column {
|
|
|
360
358
|
columns.push(new Column(worksheet, count++, col));
|
|
361
359
|
}
|
|
362
360
|
}
|
|
363
|
-
return columns
|
|
361
|
+
return columns;
|
|
364
362
|
}
|
|
365
363
|
}
|
|
366
364
|
export { Column };
|
|
@@ -22,7 +22,7 @@ class WorksheetReader extends EventEmitter {
|
|
|
22
22
|
// and a name
|
|
23
23
|
this.name = `Sheet${this.id}`;
|
|
24
24
|
// column definitions
|
|
25
|
-
this._columns =
|
|
25
|
+
this._columns = [];
|
|
26
26
|
this._keys = Object.create(null);
|
|
27
27
|
// keep a record of dimensions
|
|
28
28
|
this._dimensions = new Dimensions();
|
|
@@ -54,9 +54,6 @@ class WorksheetReader extends EventEmitter {
|
|
|
54
54
|
// otherwise, assume letter
|
|
55
55
|
c = colCache.l2n(c);
|
|
56
56
|
}
|
|
57
|
-
if (!this._columns) {
|
|
58
|
-
this._columns = [];
|
|
59
|
-
}
|
|
60
57
|
if (c > this._columns.length) {
|
|
61
58
|
let n = this._columns.length + 1;
|
|
62
59
|
while (n <= c) {
|
|
@@ -71,7 +71,7 @@ class WorksheetWriter {
|
|
|
71
71
|
// when they are committed, they will be deleted.
|
|
72
72
|
this._rows = [];
|
|
73
73
|
// column definitions
|
|
74
|
-
this._columns =
|
|
74
|
+
this._columns = [];
|
|
75
75
|
// column keys (addRow convenience): key ==> this._columns index
|
|
76
76
|
this._keys = {};
|
|
77
77
|
// keep a record of all row and column pageBreaks
|
|
@@ -266,9 +266,6 @@ class WorksheetWriter {
|
|
|
266
266
|
// otherwise, assume letter
|
|
267
267
|
c = colCache.l2n(c);
|
|
268
268
|
}
|
|
269
|
-
if (!this._columns) {
|
|
270
|
-
this._columns = [];
|
|
271
|
-
}
|
|
272
269
|
if (c > this._columns.length) {
|
|
273
270
|
let n = this._columns.length + 1;
|
|
274
271
|
while (n <= c) {
|
|
@@ -510,8 +510,8 @@ export function bookAppendSheet(workbook, worksheet, name) {
|
|
|
510
510
|
});
|
|
511
511
|
});
|
|
512
512
|
// Copy column properties
|
|
513
|
-
worksheet.columns
|
|
514
|
-
if (col && newWs.columns
|
|
513
|
+
worksheet.columns.forEach((col, idx) => {
|
|
514
|
+
if (col && newWs.columns[idx]) {
|
|
515
515
|
if (col.width) {
|
|
516
516
|
newWs.getColumn(idx + 1).width = col.width;
|
|
517
517
|
}
|
|
@@ -33,7 +33,7 @@ class Worksheet {
|
|
|
33
33
|
// Note: _rows is zero based. Must subtract 1 to go from cell.row to index
|
|
34
34
|
this._rows = [];
|
|
35
35
|
// column definitions
|
|
36
|
-
this._columns =
|
|
36
|
+
this._columns = [];
|
|
37
37
|
// column keys (addRow convenience): key ==> this._collumns index
|
|
38
38
|
this._keys = {};
|
|
39
39
|
// keep record of all merges
|
|
@@ -224,9 +224,6 @@ class Worksheet {
|
|
|
224
224
|
else {
|
|
225
225
|
colNum = c;
|
|
226
226
|
}
|
|
227
|
-
if (!this._columns) {
|
|
228
|
-
this._columns = [];
|
|
229
|
-
}
|
|
230
227
|
if (colNum > this._columns.length) {
|
|
231
228
|
let n = this._columns.length + 1;
|
|
232
229
|
while (n <= colNum) {
|
|
@@ -281,7 +278,7 @@ class Worksheet {
|
|
|
281
278
|
// splice column definitions
|
|
282
279
|
const nExpand = inserts.length - count;
|
|
283
280
|
const nKeep = start + count;
|
|
284
|
-
const nEnd = this._columns
|
|
281
|
+
const nEnd = this._columns.length;
|
|
285
282
|
if (nExpand < 0) {
|
|
286
283
|
for (let i = start + inserts.length; i <= nEnd; i++) {
|
|
287
284
|
this.getColumn(i).defn = this.getColumn(i - nExpand).defn;
|
|
@@ -1128,7 +1125,7 @@ class Worksheet {
|
|
|
1128
1125
|
};
|
|
1129
1126
|
// =================================================
|
|
1130
1127
|
// columns
|
|
1131
|
-
model.cols = Column.toModel(this.columns
|
|
1128
|
+
model.cols = Column.toModel(this.columns);
|
|
1132
1129
|
// ==========================================================
|
|
1133
1130
|
// Rows
|
|
1134
1131
|
const rows = (model.rows = []);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cj-tech-master/excelts v6.0.0-beta.
|
|
2
|
+
* @cj-tech-master/excelts v6.0.0-beta.3
|
|
3
3
|
* TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
|
|
4
4
|
* (c) 2026 cjnoname
|
|
5
5
|
* Released under the MIT License
|
|
@@ -2437,7 +2437,7 @@ var ExcelTS = (function(exports) {
|
|
|
2437
2437
|
static toModel(columns) {
|
|
2438
2438
|
const cols = [];
|
|
2439
2439
|
let col = null;
|
|
2440
|
-
|
|
2440
|
+
columns.forEach((column, index) => {
|
|
2441
2441
|
if (column.isDefault) {
|
|
2442
2442
|
if (col) col = null;
|
|
2443
2443
|
} else if (!col || !column.equivalentToModel(col)) {
|
|
@@ -2476,7 +2476,7 @@ var ExcelTS = (function(exports) {
|
|
|
2476
2476
|
while (count < col.min) columns.push(new Column(worksheet, count++));
|
|
2477
2477
|
while (count <= col.max) columns.push(new Column(worksheet, count++, col));
|
|
2478
2478
|
}
|
|
2479
|
-
return columns
|
|
2479
|
+
return columns;
|
|
2480
2480
|
}
|
|
2481
2481
|
};
|
|
2482
2482
|
//#endregion
|
|
@@ -4323,7 +4323,7 @@ var ExcelTS = (function(exports) {
|
|
|
4323
4323
|
this.name = options.name || `sheet${this.id}`;
|
|
4324
4324
|
this.state = options.state ?? "visible";
|
|
4325
4325
|
this._rows = [];
|
|
4326
|
-
this._columns =
|
|
4326
|
+
this._columns = [];
|
|
4327
4327
|
this._keys = {};
|
|
4328
4328
|
this._merges = {};
|
|
4329
4329
|
this.rowBreaks = [];
|
|
@@ -4470,7 +4470,6 @@ var ExcelTS = (function(exports) {
|
|
|
4470
4470
|
if (col) return col;
|
|
4471
4471
|
colNum = colCache.l2n(c);
|
|
4472
4472
|
} else colNum = c;
|
|
4473
|
-
if (!this._columns) this._columns = [];
|
|
4474
4473
|
if (colNum > this._columns.length) {
|
|
4475
4474
|
let n = this._columns.length + 1;
|
|
4476
4475
|
while (n <= colNum) this._columns.push(new Column(this, n++));
|
|
@@ -4503,7 +4502,7 @@ var ExcelTS = (function(exports) {
|
|
|
4503
4502
|
});
|
|
4504
4503
|
const nExpand = inserts.length - count;
|
|
4505
4504
|
const nKeep = start + count;
|
|
4506
|
-
const nEnd = this._columns
|
|
4505
|
+
const nEnd = this._columns.length;
|
|
4507
4506
|
if (nExpand < 0) for (let i = start + inserts.length; i <= nEnd; i++) this.getColumn(i).defn = this.getColumn(i - nExpand).defn;
|
|
4508
4507
|
else if (nExpand > 0) for (let i = nEnd; i >= nKeep; i--) this.getColumn(i + nExpand).defn = this.getColumn(i).defn;
|
|
4509
4508
|
for (let i = start; i < start + inserts.length; i++) this.getColumn(i).defn = void 0;
|
|
@@ -5083,7 +5082,7 @@ var ExcelTS = (function(exports) {
|
|
|
5083
5082
|
formControls: this.formControls.map((fc) => fc.model),
|
|
5084
5083
|
drawing: this._drawing
|
|
5085
5084
|
};
|
|
5086
|
-
model.cols = Column.toModel(this.columns
|
|
5085
|
+
model.cols = Column.toModel(this.columns);
|
|
5087
5086
|
const rows = model.rows = [];
|
|
5088
5087
|
const dimensions = model.dimensions = new Range();
|
|
5089
5088
|
this._rows.forEach((row) => {
|
|
@@ -29167,7 +29166,7 @@ self.onmessage = async function(event) {
|
|
|
29167
29166
|
this.name = options.name || `Sheet${this.id}`;
|
|
29168
29167
|
this.state = options.state ?? "visible";
|
|
29169
29168
|
this._rows = [];
|
|
29170
|
-
this._columns =
|
|
29169
|
+
this._columns = [];
|
|
29171
29170
|
this._keys = {};
|
|
29172
29171
|
this._merges = [];
|
|
29173
29172
|
this._merges.add = function() {};
|
|
@@ -29315,7 +29314,6 @@ self.onmessage = async function(event) {
|
|
|
29315
29314
|
if (col) return col;
|
|
29316
29315
|
c = colCache.l2n(c);
|
|
29317
29316
|
}
|
|
29318
|
-
if (!this._columns) this._columns = [];
|
|
29319
29317
|
if (c > this._columns.length) {
|
|
29320
29318
|
let n = this._columns.length + 1;
|
|
29321
29319
|
while (n <= c) this._columns.push(new Column(this, n++));
|
|
@@ -31229,7 +31227,7 @@ onmessage = async (ev) => {
|
|
|
31229
31227
|
this.iterator = iterator;
|
|
31230
31228
|
this.options = options || {};
|
|
31231
31229
|
this.name = `Sheet${this.id}`;
|
|
31232
|
-
this._columns =
|
|
31230
|
+
this._columns = [];
|
|
31233
31231
|
this._keys = Object.create(null);
|
|
31234
31232
|
this._dimensions = new Range();
|
|
31235
31233
|
}
|
|
@@ -31248,7 +31246,6 @@ onmessage = async (ev) => {
|
|
|
31248
31246
|
if (col) return col;
|
|
31249
31247
|
c = colCache.l2n(c);
|
|
31250
31248
|
}
|
|
31251
|
-
if (!this._columns) this._columns = [];
|
|
31252
31249
|
if (c > this._columns.length) {
|
|
31253
31250
|
let n = this._columns.length + 1;
|
|
31254
31251
|
while (n <= c) this._columns.push(new Column(this, n++));
|
|
@@ -37054,8 +37051,8 @@ onmessage = async (ev) => {
|
|
|
37054
37051
|
if (cell.style) newCell.style = cell.style;
|
|
37055
37052
|
});
|
|
37056
37053
|
});
|
|
37057
|
-
worksheet.columns
|
|
37058
|
-
if (col && newWs.columns
|
|
37054
|
+
worksheet.columns.forEach((col, idx) => {
|
|
37055
|
+
if (col && newWs.columns[idx]) {
|
|
37059
37056
|
if (col.width) newWs.getColumn(idx + 1).width = col.width;
|
|
37060
37057
|
}
|
|
37061
37058
|
});
|