@atlaskit/editor-tables 2.2.4 → 2.2.6
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/CHANGELOG.md +12 -0
- package/dist/cjs/cell-bookmark.js +0 -10
- package/dist/cjs/cell-selection.js +37 -102
- package/dist/cjs/index.js +0 -4
- package/dist/cjs/pm-plugins/input.js +17 -83
- package/dist/cjs/pm-plugins/plugin-key.js +0 -2
- package/dist/cjs/pm-plugins/table-editing.js +17 -18
- package/dist/cjs/pm-plugins.js +0 -2
- package/dist/cjs/table-map.js +67 -138
- package/dist/cjs/utils/add-column-at.js +0 -9
- package/dist/cjs/utils/add-column.js +8 -24
- package/dist/cjs/utils/add-row-at.js +8 -37
- package/dist/cjs/utils/add-row.js +2 -23
- package/dist/cjs/utils/analytics-helpers.js +4 -15
- package/dist/cjs/utils/cells.js +0 -12
- package/dist/cjs/utils/clone-tr.js +0 -2
- package/dist/cjs/utils/colspan.js +2 -18
- package/dist/cjs/utils/copy-paste.js +51 -139
- package/dist/cjs/utils/create-table.js +14 -28
- package/dist/cjs/utils/draw-cell-selection.js +0 -4
- package/dist/cjs/utils/empty-cells.js +0 -6
- package/dist/cjs/utils/find.js +6 -18
- package/dist/cjs/utils/fix-tables.js +13 -56
- package/dist/cjs/utils/for-each-cell.js +3 -17
- package/dist/cjs/utils/get-cell-selection-ranges.js +2 -9
- package/dist/cjs/utils/get-cells-in-column.js +0 -7
- package/dist/cjs/utils/get-cells-in-row.js +0 -7
- package/dist/cjs/utils/get-cells-in-table.js +0 -8
- package/dist/cjs/utils/get-selection-range-in-column.js +6 -27
- package/dist/cjs/utils/get-selection-range-in-row.js +6 -27
- package/dist/cjs/utils/get-selection-rect.js +0 -7
- package/dist/cjs/utils/go-to-next-cell.js +3 -22
- package/dist/cjs/utils/handle-paste.js +5 -34
- package/dist/cjs/utils/is-selected.js +6 -23
- package/dist/cjs/utils/is-selection-type.js +0 -2
- package/dist/cjs/utils/move-column.js +0 -12
- package/dist/cjs/utils/move-row.js +0 -11
- package/dist/cjs/utils/normalize-selection.js +3 -27
- package/dist/cjs/utils/remove-column.js +10 -46
- package/dist/cjs/utils/remove-row.js +8 -49
- package/dist/cjs/utils/remove-table.js +0 -6
- package/dist/cjs/utils/reorder-utils.js +13 -37
- package/dist/cjs/utils/replace-table.js +0 -8
- package/dist/cjs/utils/select-nodes.js +11 -31
- package/dist/cjs/utils/selection-cell.js +0 -5
- package/dist/cjs/utils/selection-rect.js +0 -10
- package/dist/cjs/utils/set-cell-attrs.js +0 -4
- package/dist/cjs/utils/split-cell-with-type.js +2 -35
- package/dist/cjs/utils/split-cell.js +0 -4
- package/dist/cjs/utils/table-node-types.js +4 -8
- package/dist/cjs/utils/tables.js +0 -4
- package/dist/cjs/utils/test-utils.js +9 -26
- package/dist/cjs/utils/toggle-header.js +3 -16
- package/dist/cjs/utils/uuid.js +0 -3
- package/dist/cjs/utils.js +0 -42
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/cell-bookmark.js +0 -5
- package/dist/es2019/cell-selection.js +37 -81
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/pm-plugins/input.js +15 -67
- package/dist/es2019/pm-plugins/table-editing.js +3 -12
- package/dist/es2019/table-map.js +57 -127
- package/dist/es2019/utils/add-column-at.js +2 -4
- package/dist/es2019/utils/add-column.js +6 -16
- package/dist/es2019/utils/add-row-at.js +8 -22
- package/dist/es2019/utils/add-row.js +2 -17
- package/dist/es2019/utils/analytics-helpers.js +0 -5
- package/dist/es2019/utils/cells.js +4 -9
- package/dist/es2019/utils/colspan.js +6 -11
- package/dist/es2019/utils/copy-paste.js +41 -115
- package/dist/es2019/utils/create-table.js +3 -12
- package/dist/es2019/utils/draw-cell-selection.js +0 -1
- package/dist/es2019/utils/empty-cells.js +2 -3
- package/dist/es2019/utils/find.js +8 -8
- package/dist/es2019/utils/fix-tables.js +17 -47
- package/dist/es2019/utils/for-each-cell.js +6 -11
- package/dist/es2019/utils/get-cell-selection-ranges.js +2 -4
- package/dist/es2019/utils/get-cells-in-column.js +2 -3
- package/dist/es2019/utils/get-cells-in-row.js +2 -3
- package/dist/es2019/utils/get-cells-in-table.js +2 -4
- package/dist/es2019/utils/get-selection-range-in-column.js +8 -22
- package/dist/es2019/utils/get-selection-range-in-row.js +8 -22
- package/dist/es2019/utils/get-selection-rect.js +2 -2
- package/dist/es2019/utils/go-to-next-cell.js +3 -19
- package/dist/es2019/utils/handle-paste.js +3 -14
- package/dist/es2019/utils/is-selected.js +8 -10
- package/dist/es2019/utils/is-selection-type.js +0 -1
- package/dist/es2019/utils/move-column.js +3 -8
- package/dist/es2019/utils/move-row.js +3 -7
- package/dist/es2019/utils/normalize-selection.js +0 -16
- package/dist/es2019/utils/remove-column.js +10 -27
- package/dist/es2019/utils/remove-row.js +12 -32
- package/dist/es2019/utils/remove-table.js +2 -4
- package/dist/es2019/utils/reorder-utils.js +11 -26
- package/dist/es2019/utils/replace-table.js +0 -2
- package/dist/es2019/utils/select-nodes.js +9 -20
- package/dist/es2019/utils/selection-cell.js +0 -2
- package/dist/es2019/utils/selection-rect.js +0 -4
- package/dist/es2019/utils/set-cell-attrs.js +2 -2
- package/dist/es2019/utils/split-cell-with-type.js +8 -28
- package/dist/es2019/utils/split-cell.js +3 -2
- package/dist/es2019/utils/table-node-types.js +4 -7
- package/dist/es2019/utils/tables.js +0 -2
- package/dist/es2019/utils/test-utils.js +12 -16
- package/dist/es2019/utils/toggle-header.js +3 -10
- package/dist/es2019/utils/uuid.js +0 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/cell-bookmark.js +0 -5
- package/dist/esm/cell-selection.js +37 -79
- package/dist/esm/index.js +1 -0
- package/dist/esm/pm-plugins/input.js +17 -71
- package/dist/esm/pm-plugins/table-editing.js +8 -13
- package/dist/esm/table-map.js +68 -133
- package/dist/esm/utils/add-column-at.js +2 -4
- package/dist/esm/utils/add-column.js +8 -20
- package/dist/esm/utils/add-row-at.js +8 -23
- package/dist/esm/utils/add-row.js +2 -21
- package/dist/esm/utils/analytics-helpers.js +4 -10
- package/dist/esm/utils/cells.js +0 -5
- package/dist/esm/utils/colspan.js +2 -14
- package/dist/esm/utils/copy-paste.js +44 -125
- package/dist/esm/utils/create-table.js +14 -25
- package/dist/esm/utils/draw-cell-selection.js +0 -1
- package/dist/esm/utils/empty-cells.js +2 -3
- package/dist/esm/utils/find.js +8 -8
- package/dist/esm/utils/fix-tables.js +13 -49
- package/dist/esm/utils/for-each-cell.js +6 -11
- package/dist/esm/utils/get-cell-selection-ranges.js +2 -4
- package/dist/esm/utils/get-cells-in-column.js +2 -3
- package/dist/esm/utils/get-cells-in-row.js +2 -3
- package/dist/esm/utils/get-cells-in-table.js +2 -4
- package/dist/esm/utils/get-selection-range-in-column.js +8 -24
- package/dist/esm/utils/get-selection-range-in-row.js +8 -24
- package/dist/esm/utils/get-selection-rect.js +2 -2
- package/dist/esm/utils/go-to-next-cell.js +3 -19
- package/dist/esm/utils/handle-paste.js +5 -23
- package/dist/esm/utils/is-selected.js +8 -10
- package/dist/esm/utils/is-selection-type.js +0 -1
- package/dist/esm/utils/move-column.js +3 -8
- package/dist/esm/utils/move-row.js +3 -7
- package/dist/esm/utils/normalize-selection.js +3 -22
- package/dist/esm/utils/remove-column.js +10 -31
- package/dist/esm/utils/remove-row.js +8 -35
- package/dist/esm/utils/remove-table.js +2 -4
- package/dist/esm/utils/reorder-utils.js +11 -26
- package/dist/esm/utils/replace-table.js +0 -2
- package/dist/esm/utils/select-nodes.js +11 -22
- package/dist/esm/utils/selection-cell.js +0 -2
- package/dist/esm/utils/selection-rect.js +0 -4
- package/dist/esm/utils/set-cell-attrs.js +2 -2
- package/dist/esm/utils/split-cell-with-type.js +2 -28
- package/dist/esm/utils/split-cell.js +3 -2
- package/dist/esm/utils/table-node-types.js +4 -7
- package/dist/esm/utils/tables.js +0 -2
- package/dist/esm/utils/test-utils.js +12 -16
- package/dist/esm/utils/toggle-header.js +3 -10
- package/dist/esm/version.json +1 -1
- package/package.json +6 -4
|
@@ -6,11 +6,9 @@ import { findTable } from './find';
|
|
|
6
6
|
import { getCellsInRow } from './get-cells-in-row';
|
|
7
7
|
import { setCellAttrs } from './set-cell-attrs';
|
|
8
8
|
import { tableNodeTypes } from './table-node-types';
|
|
9
|
-
|
|
10
9
|
const filterCellsInRow = (rowIndex, predicate) => tr => {
|
|
11
10
|
let foundCells = [];
|
|
12
11
|
const cells = getCellsInRow(rowIndex)(tr.selection);
|
|
13
|
-
|
|
14
12
|
if (cells) {
|
|
15
13
|
for (let j = cells.length - 1; j >= 0; j--) {
|
|
16
14
|
if (predicate(cells[j], tr)) {
|
|
@@ -18,28 +16,23 @@ const filterCellsInRow = (rowIndex, predicate) => tr => {
|
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
return foundCells;
|
|
23
|
-
};
|
|
24
|
-
|
|
20
|
+
};
|
|
25
21
|
|
|
22
|
+
// Returns a new transaction that adds a new row after `cloneRowIndex`, cloning the row attributes at `cloneRowIndex`.
|
|
26
23
|
export const cloneRowAt = rowIndex => tr => {
|
|
27
24
|
const table = findTable(tr.selection);
|
|
28
|
-
|
|
29
25
|
if (table) {
|
|
30
26
|
const map = TableMap.get(table.node);
|
|
31
|
-
|
|
32
27
|
if (rowIndex >= 0 && rowIndex <= map.height) {
|
|
33
28
|
const tableNode = table.node;
|
|
34
29
|
const tableNodes = tableNodeTypes(tableNode.type.schema);
|
|
35
30
|
let rowPos = table.start;
|
|
36
|
-
|
|
37
31
|
for (let i = 0; i < rowIndex + 1; i++) {
|
|
38
32
|
rowPos += tableNode.child(i).nodeSize;
|
|
39
33
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
const cloneRow = tableNode.child(rowIndex);
|
|
35
|
+
// Re-create the same nodes with same attrs, dropping the node content.
|
|
43
36
|
let cells = [];
|
|
44
37
|
let rowWidth = 0;
|
|
45
38
|
cloneRow.forEach(cell => {
|
|
@@ -48,16 +41,15 @@ export const cloneRowAt = rowIndex => tr => {
|
|
|
48
41
|
if (cell.attrs.rowspan === 1) {
|
|
49
42
|
rowWidth += cell.attrs.colspan;
|
|
50
43
|
const node = tableNodes[cell.type.spec.tableRole].createAndFill(cell.attrs, [], cell.marks);
|
|
51
|
-
|
|
52
44
|
if (node) {
|
|
53
45
|
cells.push(node);
|
|
54
46
|
}
|
|
55
47
|
}
|
|
56
|
-
});
|
|
48
|
+
});
|
|
57
49
|
|
|
50
|
+
// If a higher row spans past our clone row, bump the higher row to cover this new row too.
|
|
58
51
|
if (rowWidth < map.width) {
|
|
59
52
|
let rowSpanCells = [];
|
|
60
|
-
|
|
61
53
|
for (let i = rowIndex; i >= 0; i--) {
|
|
62
54
|
let foundCells = filterCellsInRow(i, (cell, tr) => {
|
|
63
55
|
const rowspan = cell.node.attrs.rowspan;
|
|
@@ -66,7 +58,6 @@ export const cloneRowAt = rowIndex => tr => {
|
|
|
66
58
|
})(tr);
|
|
67
59
|
rowSpanCells.push(...foundCells);
|
|
68
60
|
}
|
|
69
|
-
|
|
70
61
|
if (rowSpanCells.length) {
|
|
71
62
|
rowSpanCells.forEach(cell => {
|
|
72
63
|
tr = setCellAttrs(cell, {
|
|
@@ -75,25 +66,21 @@ export const cloneRowAt = rowIndex => tr => {
|
|
|
75
66
|
});
|
|
76
67
|
}
|
|
77
68
|
}
|
|
78
|
-
|
|
79
69
|
return safeInsert(tableNodes.row.create(cloneRow.attrs, cells), rowPos)(tr);
|
|
80
70
|
}
|
|
81
71
|
}
|
|
82
|
-
|
|
83
72
|
return tr;
|
|
84
|
-
};
|
|
73
|
+
};
|
|
85
74
|
|
|
75
|
+
// Returns a new transaction that adds a new row at index `rowIndex`. Optionally clone the previous row.
|
|
86
76
|
export const addRowAt = (rowIndex, clonePreviousRow) => tr => {
|
|
87
77
|
const table = findTable(tr.selection);
|
|
88
|
-
|
|
89
78
|
if (table) {
|
|
90
79
|
const map = TableMap.get(table.node);
|
|
91
80
|
const cloneRowIndex = rowIndex - 1;
|
|
92
|
-
|
|
93
81
|
if (clonePreviousRow && cloneRowIndex >= 0) {
|
|
94
82
|
return cloneTr(cloneRowAt(cloneRowIndex)(tr));
|
|
95
83
|
}
|
|
96
|
-
|
|
97
84
|
if (rowIndex >= 0 && rowIndex <= map.height) {
|
|
98
85
|
return cloneTr(addRow(tr, {
|
|
99
86
|
map,
|
|
@@ -102,6 +89,5 @@ export const addRowAt = (rowIndex, clonePreviousRow) => tr => {
|
|
|
102
89
|
}, rowIndex));
|
|
103
90
|
}
|
|
104
91
|
}
|
|
105
|
-
|
|
106
92
|
return tr;
|
|
107
93
|
};
|
|
@@ -1,74 +1,59 @@
|
|
|
1
1
|
import { tableNodeTypes } from './table-node-types';
|
|
2
|
-
|
|
3
2
|
function rowIsHeader(map, table, row) {
|
|
4
3
|
const headerCell = tableNodeTypes(table.type.schema).header_cell;
|
|
5
|
-
|
|
6
4
|
for (let col = 0; col < map.width; col++) {
|
|
7
5
|
const cell = table.nodeAt(map.map[col + row * map.width]);
|
|
8
|
-
|
|
9
6
|
if (cell && cell.type !== headerCell) {
|
|
10
7
|
return false;
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
|
|
14
10
|
return true;
|
|
15
11
|
}
|
|
16
|
-
|
|
17
12
|
export function addRow(tr, {
|
|
18
13
|
map,
|
|
19
14
|
tableStart,
|
|
20
15
|
table
|
|
21
16
|
}, row) {
|
|
22
17
|
let rowPos = tableStart;
|
|
23
|
-
|
|
24
18
|
for (let i = 0; i < row; i++) {
|
|
25
19
|
rowPos += table.child(i).nodeSize;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
const cells = [];
|
|
29
22
|
let refRow = row > 0 ? -1 : 0;
|
|
30
|
-
|
|
31
23
|
if (rowIsHeader(map, table, row + refRow)) {
|
|
32
24
|
refRow = row === 0 || row === map.height ? null : 0;
|
|
33
25
|
}
|
|
34
|
-
|
|
35
26
|
for (let col = 0, index = map.width * row; col < map.width; col++, index++) {
|
|
36
27
|
// Covered by a rowspan cell
|
|
37
28
|
if (row > 0 && row < map.height && map.map[index] === map.map[index - map.width]) {
|
|
38
29
|
const pos = map.map[index];
|
|
39
30
|
const node = table.nodeAt(pos);
|
|
40
|
-
|
|
41
31
|
if (!node) {
|
|
42
32
|
throw new Error(`addRow: node not found at pos ${pos}`);
|
|
43
33
|
}
|
|
44
|
-
|
|
45
34
|
const {
|
|
46
35
|
attrs
|
|
47
36
|
} = node;
|
|
48
|
-
tr.setNodeMarkup(tableStart + pos, undefined, {
|
|
37
|
+
tr.setNodeMarkup(tableStart + pos, undefined, {
|
|
38
|
+
...attrs,
|
|
49
39
|
rowspan: attrs.rowspan + 1
|
|
50
40
|
});
|
|
51
41
|
col += attrs.colspan - 1;
|
|
52
42
|
} else {
|
|
53
43
|
let type;
|
|
54
|
-
|
|
55
44
|
if (refRow == null) {
|
|
56
45
|
type = tableNodeTypes(table.type.schema).cell;
|
|
57
46
|
} else {
|
|
58
47
|
const mappedPos = map.map[index + refRow * map.width];
|
|
59
48
|
const cell = table.nodeAt(mappedPos);
|
|
60
|
-
|
|
61
49
|
if (!cell) {
|
|
62
50
|
throw new Error(`addRow: invalid node at mapped pos ${mappedPos}`);
|
|
63
51
|
}
|
|
64
|
-
|
|
65
52
|
type = cell.type;
|
|
66
53
|
}
|
|
67
|
-
|
|
68
54
|
cells.push(type.createAndFill());
|
|
69
55
|
}
|
|
70
56
|
}
|
|
71
|
-
|
|
72
57
|
const rowType = tableNodeTypes(table.type.schema).row;
|
|
73
58
|
const rowCells = rowType.create(null, cells);
|
|
74
59
|
tr.insert(rowPos, rowCells);
|
|
@@ -6,13 +6,11 @@ export function getSelectedTableInfo(selection) {
|
|
|
6
6
|
let totalRowCount = 0;
|
|
7
7
|
let totalColumnCount = 0;
|
|
8
8
|
const table = findTable(selection);
|
|
9
|
-
|
|
10
9
|
if (table) {
|
|
11
10
|
map = TableMap.get(table.node);
|
|
12
11
|
totalRowCount = map.height;
|
|
13
12
|
totalColumnCount = map.width;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
return {
|
|
17
15
|
table,
|
|
18
16
|
map,
|
|
@@ -30,17 +28,14 @@ export function getSelectedCellInfo(selection) {
|
|
|
30
28
|
totalRowCount,
|
|
31
29
|
totalColumnCount
|
|
32
30
|
} = getSelectedTableInfo(selection);
|
|
33
|
-
|
|
34
31
|
if (table && map) {
|
|
35
32
|
const rect = getSelectionRect(selection);
|
|
36
|
-
|
|
37
33
|
if (rect) {
|
|
38
34
|
totalCells = map.cellsInRect(rect).length;
|
|
39
35
|
horizontalCells = rect.right - rect.left;
|
|
40
36
|
verticalCells = rect.bottom - rect.top;
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
|
-
|
|
44
39
|
return {
|
|
45
40
|
totalRowCount,
|
|
46
41
|
totalColumnCount,
|
|
@@ -4,25 +4,21 @@ export function pointsAtCell($pos) {
|
|
|
4
4
|
}
|
|
5
5
|
export function cellNear($pos) {
|
|
6
6
|
for (let after = $pos.nodeAfter, {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
pos
|
|
8
|
+
} = $pos; after; after = after.firstChild, pos++) {
|
|
9
9
|
const role = after.type.spec.tableRole;
|
|
10
|
-
|
|
11
10
|
if (role === 'cell' || role === 'header_cell') {
|
|
12
11
|
return $pos.doc.resolve(pos);
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
for (let before = $pos.nodeBefore, {
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
pos
|
|
16
|
+
} = $pos; before; before = before.lastChild, pos--) {
|
|
19
17
|
const role = before.type.spec.tableRole;
|
|
20
|
-
|
|
21
18
|
if (role === 'cell' || role === 'header_cell') {
|
|
22
19
|
return $pos.doc.resolve(pos - before.nodeSize);
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
return null;
|
|
27
23
|
}
|
|
28
24
|
export function cellAround($pos) {
|
|
@@ -31,7 +27,6 @@ export function cellAround($pos) {
|
|
|
31
27
|
return $pos.node(0).resolve($pos.before(d + 1));
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
|
-
|
|
35
30
|
return null;
|
|
36
31
|
}
|
|
37
32
|
export function nextCell($pos, axis, dir) {
|
|
@@ -2,45 +2,40 @@ export function removeColSpan(attrs, pos, n = 1) {
|
|
|
2
2
|
if (!attrs.colspan) {
|
|
3
3
|
throw new Error('removeColSpan(): attrs.colspan not defined');
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const result = {
|
|
6
|
+
...attrs,
|
|
7
7
|
colspan: attrs.colspan - n
|
|
8
8
|
};
|
|
9
|
-
|
|
10
9
|
if (result.colwidth) {
|
|
11
10
|
result.colwidth = result.colwidth.slice();
|
|
12
11
|
result.colwidth.splice(pos, n);
|
|
13
|
-
|
|
14
12
|
if (!result.colwidth.some(w => w > 0)) {
|
|
15
13
|
result.colwidth = undefined;
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
return result;
|
|
20
17
|
}
|
|
21
18
|
export function assertColspan(attrs) {
|
|
22
19
|
if (typeof attrs.colspan === 'undefined') {
|
|
23
20
|
throw new Error('addColSpan: attrs.colspan is not defined');
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
if (typeof attrs.colspan !== 'number' || Number.isNaN(attrs.colspan) || attrs.colspan < 1) {
|
|
27
23
|
throw new Error(`addColSpan: attrs.colspan must be number >= 1, received: ${attrs.colspan}`);
|
|
28
24
|
}
|
|
29
|
-
}
|
|
25
|
+
}
|
|
30
26
|
|
|
27
|
+
// TODO: replace "addColSpan" from table plugin with this function
|
|
31
28
|
export function addColSpan(attrs, pos, n = 1) {
|
|
32
29
|
assertColspan(attrs);
|
|
33
|
-
const result = {
|
|
30
|
+
const result = {
|
|
31
|
+
...attrs,
|
|
34
32
|
colspan: attrs.colspan + n
|
|
35
33
|
};
|
|
36
|
-
|
|
37
34
|
if (result.colwidth) {
|
|
38
35
|
result.colwidth = result.colwidth.slice();
|
|
39
|
-
|
|
40
36
|
for (let i = 0; i < n; i++) {
|
|
41
37
|
result.colwidth.splice(pos, 0, 0);
|
|
42
38
|
}
|
|
43
39
|
}
|
|
44
|
-
|
|
45
40
|
return result;
|
|
46
41
|
}
|