@atlaskit/editor-plugin-table 0.2.0 → 0.2.2
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 +21 -0
- package/commands/package.json +1 -0
- package/dist/cjs/plugins/table/create-plugin-config.js +0 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +3 -5
- package/dist/cjs/plugins/table/ui/common-styles.js +8 -1
- package/dist/cjs/plugins/table/ui/ui-styles.js +1 -1
- package/dist/cjs/plugins/table/utils/column-controls.js +1 -1
- package/dist/cjs/version.json +2 -1
- package/dist/es2019/plugins/table/create-plugin-config.js +0 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +3 -8
- package/dist/es2019/plugins/table/ui/common-styles.js +16 -8
- package/dist/es2019/plugins/table/ui/ui-styles.js +1 -6
- package/dist/es2019/plugins/table/utils/column-controls.js +1 -1
- package/dist/es2019/version.json +2 -1
- package/dist/esm/plugins/table/create-plugin-config.js +0 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +3 -8
- package/dist/esm/plugins/table/ui/common-styles.js +8 -1
- package/dist/esm/plugins/table/ui/ui-styles.js +2 -2
- package/dist/esm/plugins/table/utils/column-controls.js +1 -1
- package/dist/esm/version.json +2 -1
- package/dist/types/plugins/table/types.d.ts +0 -1
- package/package.json +2 -1
- package/plugin-key/package.json +1 -0
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +8 -0
- package/src/__tests__/visual-regression/__fixtures__/sticky-header-with-horizontal-scroll.json +5228 -0
- package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-1-snap.png +3 -0
- package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-2-snap.png +3 -0
- package/src/__tests__/visual-regression/cell-options-menu.ts +110 -99
- package/src/__tests__/visual-regression/index.ts +56 -44
- package/src/__tests__/visual-regression/sticky-header.ts +55 -0
- package/src/plugins/table/create-plugin-config.ts +0 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +5 -11
- package/src/plugins/table/types.ts +0 -1
- package/src/plugins/table/ui/common-styles.ts +16 -8
- package/src/plugins/table/ui/ui-styles.ts +0 -6
- package/src/plugins/table/utils/column-controls.ts +1 -1
- package/types/package.json +1 -0
- package/ui/common-styles/package.json +1 -0
- package/ui/consts/package.json +1 -0
|
@@ -1,99 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
//
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
1
|
+
import {
|
|
2
|
+
PuppeteerPage,
|
|
3
|
+
waitForNoTooltip,
|
|
4
|
+
} from '@atlaskit/visual-regression/helper';
|
|
5
|
+
import { insertTable } from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
6
|
+
import {
|
|
7
|
+
snapshot,
|
|
8
|
+
initFullPageEditorWithAdf,
|
|
9
|
+
} from '@atlaskit/editor-test-helpers/vr-utils/base-utils';
|
|
10
|
+
|
|
11
|
+
const firstCellSelector = 'table tbody th p';
|
|
12
|
+
const cellOptionsSelector = '[aria-label="Cell options"]';
|
|
13
|
+
const deleteColumnCellOptionSelector = '[aria-label="Delete column"]';
|
|
14
|
+
const deleteRowCellOptionSelector = '[aria-label="Delete row"]';
|
|
15
|
+
|
|
16
|
+
const emptyDocAdf = {
|
|
17
|
+
version: 1,
|
|
18
|
+
type: 'doc',
|
|
19
|
+
content: [],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
describe('Table cell options menu', () => {
|
|
23
|
+
let page: PuppeteerPage;
|
|
24
|
+
|
|
25
|
+
beforeEach(async () => {
|
|
26
|
+
page = global.page;
|
|
27
|
+
await initFullPageEditorWithAdf(
|
|
28
|
+
page,
|
|
29
|
+
emptyDocAdf,
|
|
30
|
+
undefined,
|
|
31
|
+
undefined,
|
|
32
|
+
{},
|
|
33
|
+
undefined,
|
|
34
|
+
undefined,
|
|
35
|
+
true,
|
|
36
|
+
false,
|
|
37
|
+
undefined,
|
|
38
|
+
{
|
|
39
|
+
group: 'editor',
|
|
40
|
+
packageName: 'editor-plugin-table',
|
|
41
|
+
exampleName: 'testing',
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
await insertTable(page);
|
|
45
|
+
page.waitForSelector(firstCellSelector);
|
|
46
|
+
|
|
47
|
+
// move the focus to the first table cell
|
|
48
|
+
await page.type(firstCellSelector, 'focus table cell');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe('delete column menu item', () => {
|
|
52
|
+
it('visual hints should be added to the table column on hover', async () => {
|
|
53
|
+
// open the table cell options menu
|
|
54
|
+
await page.waitForSelector(cellOptionsSelector);
|
|
55
|
+
await page.click(cellOptionsSelector);
|
|
56
|
+
|
|
57
|
+
// hover over the table cell options Delete column entry
|
|
58
|
+
await page.waitForSelector(deleteColumnCellOptionSelector);
|
|
59
|
+
await page.hover(deleteColumnCellOptionSelector);
|
|
60
|
+
|
|
61
|
+
await waitForNoTooltip(page);
|
|
62
|
+
|
|
63
|
+
await snapshot(page);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('should remove the table column on click', async () => {
|
|
67
|
+
// open the table cell options menu
|
|
68
|
+
await page.waitForSelector(cellOptionsSelector);
|
|
69
|
+
await page.click(cellOptionsSelector);
|
|
70
|
+
|
|
71
|
+
// click the table cell options Delete column entry
|
|
72
|
+
await page.waitForSelector(deleteColumnCellOptionSelector);
|
|
73
|
+
await page.click(deleteColumnCellOptionSelector);
|
|
74
|
+
|
|
75
|
+
await waitForNoTooltip(page);
|
|
76
|
+
|
|
77
|
+
await snapshot(page);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe('delete row menu item', () => {
|
|
82
|
+
it('visual hints should be added to the table row on hover', async () => {
|
|
83
|
+
// open the table cell options menu
|
|
84
|
+
await page.waitForSelector(cellOptionsSelector);
|
|
85
|
+
await page.click(cellOptionsSelector);
|
|
86
|
+
|
|
87
|
+
// hover over the table cell options Delete row entry
|
|
88
|
+
await page.waitForSelector(deleteRowCellOptionSelector);
|
|
89
|
+
await page.hover(deleteRowCellOptionSelector);
|
|
90
|
+
|
|
91
|
+
await waitForNoTooltip(page);
|
|
92
|
+
|
|
93
|
+
await snapshot(page);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('should remove the table row on click', async () => {
|
|
97
|
+
// open the table cell options menu
|
|
98
|
+
await page.waitForSelector(cellOptionsSelector);
|
|
99
|
+
await page.click(cellOptionsSelector);
|
|
100
|
+
|
|
101
|
+
// click the table cell options Delete row entry
|
|
102
|
+
await page.waitForSelector(deleteColumnCellOptionSelector);
|
|
103
|
+
await page.click(deleteRowCellOptionSelector);
|
|
104
|
+
|
|
105
|
+
await waitForNoTooltip(page);
|
|
106
|
+
|
|
107
|
+
await snapshot(page);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -1,44 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
//
|
|
1
|
+
import { PuppeteerPage } from '@atlaskit/visual-regression/helper';
|
|
2
|
+
import { Device } from '@atlaskit/editor-test-helpers/vr-utils/device-viewport';
|
|
3
|
+
import {
|
|
4
|
+
snapshot,
|
|
5
|
+
initFullPageEditorWithAdf,
|
|
6
|
+
} from '@atlaskit/editor-test-helpers/vr-utils/base-utils';
|
|
7
|
+
import tableWith100ListItemsADF from './__fixtures__/table-with-100-numbered-list-items.json';
|
|
8
|
+
import {
|
|
9
|
+
scrollToBottom,
|
|
10
|
+
scrollToElement,
|
|
11
|
+
} from '@atlaskit/editor-test-helpers/page-objects/editor';
|
|
12
|
+
|
|
13
|
+
async function initEditor(page: PuppeteerPage, adf: Object) {
|
|
14
|
+
await initFullPageEditorWithAdf(
|
|
15
|
+
page,
|
|
16
|
+
adf,
|
|
17
|
+
Device.LaptopMDPI,
|
|
18
|
+
undefined,
|
|
19
|
+
{},
|
|
20
|
+
undefined,
|
|
21
|
+
undefined,
|
|
22
|
+
true,
|
|
23
|
+
false,
|
|
24
|
+
undefined,
|
|
25
|
+
{
|
|
26
|
+
group: 'editor',
|
|
27
|
+
packageName: 'editor-plugin-table',
|
|
28
|
+
exampleName: 'testing',
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
describe('Snapshot Test: Table', () => {
|
|
34
|
+
let page: PuppeteerPage;
|
|
35
|
+
|
|
36
|
+
beforeAll(async () => {
|
|
37
|
+
page = global.page;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe('numbered list', () => {
|
|
41
|
+
it('should not overflow table cell, when there are more than 100 ordered list items', async () => {
|
|
42
|
+
await initEditor(page, tableWith100ListItemsADF);
|
|
43
|
+
|
|
44
|
+
// initial elements
|
|
45
|
+
await snapshot(page);
|
|
46
|
+
|
|
47
|
+
// 100th elements
|
|
48
|
+
await scrollToElement(page, 'ol > li:nth-of-type(120)');
|
|
49
|
+
await snapshot(page);
|
|
50
|
+
|
|
51
|
+
// 1000th elements
|
|
52
|
+
await scrollToBottom(page);
|
|
53
|
+
await snapshot(page);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { PuppeteerPage } from '@atlaskit/visual-regression/helper';
|
|
2
|
+
import {
|
|
3
|
+
snapshot,
|
|
4
|
+
initEditorWithAdf,
|
|
5
|
+
Appearance,
|
|
6
|
+
} from '@atlaskit/editor-test-helpers/vr-utils/base-utils';
|
|
7
|
+
import stickyHeaderWithHorizontalScroll from './__fixtures__/sticky-header-with-horizontal-scroll.json';
|
|
8
|
+
import { scrollToElement } from '@atlaskit/editor-test-helpers/page-objects/editor';
|
|
9
|
+
import { clickFirstCell } from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
10
|
+
|
|
11
|
+
const initEditor = async (page: PuppeteerPage, adf: any) => {
|
|
12
|
+
await initEditorWithAdf(
|
|
13
|
+
page,
|
|
14
|
+
{
|
|
15
|
+
appearance: Appearance.fullPage,
|
|
16
|
+
adf,
|
|
17
|
+
viewport: { width: 1280, height: 868 },
|
|
18
|
+
editorProps: {
|
|
19
|
+
allowTables: {
|
|
20
|
+
stickyHeaders: true,
|
|
21
|
+
allowColumnResizing: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
group: 'editor',
|
|
27
|
+
packageName: 'editor-plugin-table',
|
|
28
|
+
exampleName: 'testing',
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
describe('Snapshot Test: Table', () => {
|
|
34
|
+
let page: PuppeteerPage;
|
|
35
|
+
|
|
36
|
+
beforeEach(async () => {
|
|
37
|
+
page = global.page;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe('sticky header', () => {
|
|
41
|
+
it('should align with table cell when active', async () => {
|
|
42
|
+
await initEditor(page, stickyHeaderWithHorizontalScroll);
|
|
43
|
+
|
|
44
|
+
await clickFirstCell(page, true);
|
|
45
|
+
|
|
46
|
+
// scroll to bottom center to see scroll shadows
|
|
47
|
+
await scrollToElement(page, 'ol > li');
|
|
48
|
+
await snapshot(page);
|
|
49
|
+
|
|
50
|
+
// scroll to bottom right
|
|
51
|
+
await scrollToElement(page, 'ul > li');
|
|
52
|
+
await snapshot(page);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -9,7 +9,6 @@ export const pluginConfig = (config: PluginConfig = {}) => {
|
|
|
9
9
|
allowHeaderRow: true,
|
|
10
10
|
allowMergeCells: true,
|
|
11
11
|
allowNumberColumn: true,
|
|
12
|
-
stickToolbarToBottom: true,
|
|
13
12
|
permittedLayouts: 'all' as PermittedLayoutsDescriptor,
|
|
14
13
|
allowControls: true,
|
|
15
14
|
...config,
|
|
@@ -4,10 +4,8 @@ import { EditorView } from 'prosemirror-view';
|
|
|
4
4
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
5
|
import {
|
|
6
6
|
tableCellBorderWidth,
|
|
7
|
-
tableCellPadding,
|
|
8
7
|
tableMarginTop,
|
|
9
8
|
} from '@atlaskit/editor-common/styles';
|
|
10
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
11
9
|
|
|
12
10
|
import {
|
|
13
11
|
closestElement,
|
|
@@ -114,15 +112,11 @@ export const updateStickyMargins = (table: HTMLElement) => {
|
|
|
114
112
|
|
|
115
113
|
const paddingTop =
|
|
116
114
|
parsePx(window.getComputedStyle(row).paddingTop || '') || 0;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
table.style.marginTop = `${
|
|
122
|
-
browser.gecko
|
|
123
|
-
? firstRowHeight + tableCellPadding - tableCellBorderWidth
|
|
124
|
-
: tableMarginTop + firstRowHeight
|
|
125
|
-
}px`;
|
|
115
|
+
|
|
116
|
+
const firstRowHeight =
|
|
117
|
+
row.getBoundingClientRect().height - paddingTop - tableCellBorderWidth;
|
|
118
|
+
|
|
119
|
+
table.style.marginTop = `${tableMarginTop + firstRowHeight}px`;
|
|
126
120
|
};
|
|
127
121
|
|
|
128
122
|
export const applyColWidthsToStickyRow = (
|
|
@@ -46,7 +46,6 @@ export interface PluginConfig {
|
|
|
46
46
|
allowAddColumnWithCustomStep?: boolean;
|
|
47
47
|
allowCollapse?: boolean;
|
|
48
48
|
isHeaderRowRequired?: boolean;
|
|
49
|
-
stickToolbarToBottom?: boolean;
|
|
50
49
|
permittedLayouts?: PermittedLayoutsDescriptor;
|
|
51
50
|
allowControls?: boolean;
|
|
52
51
|
stickyHeaders?: boolean;
|
|
@@ -67,6 +67,13 @@ import { token } from '@atlaskit/tokens';
|
|
|
67
67
|
|
|
68
68
|
const cornerControlHeight = tableToolbarSize + 1;
|
|
69
69
|
|
|
70
|
+
/*
|
|
71
|
+
compensating for half of the insert column button
|
|
72
|
+
that is aligned to the right edge initially on hover of the top right column control when table overflown,
|
|
73
|
+
its center should be aligned with the edge
|
|
74
|
+
*/
|
|
75
|
+
const insertColumnButtonOffset = tableInsertColumnButtonSize / 2;
|
|
76
|
+
|
|
70
77
|
const rangeSelectionStyles = `
|
|
71
78
|
.${ClassName.NODEVIEW_WRAPPER}.${akEditorSelectedNodeClassName} table tbody tr {
|
|
72
79
|
th,td {
|
|
@@ -280,7 +287,7 @@ export const tableStyles = (props: ThemeProps) => css`
|
|
|
280
287
|
/* add a little bit so the scroll lines up with the table */
|
|
281
288
|
.${ClassName.TABLE_STICKY} tr.sticky::after {
|
|
282
289
|
content: ' ';
|
|
283
|
-
width:
|
|
290
|
+
width: ${insertColumnButtonOffset + 1}px;
|
|
284
291
|
}
|
|
285
292
|
|
|
286
293
|
/* To fix jumpiness caused in Chrome Browsers for sticky headers */
|
|
@@ -580,6 +587,12 @@ export const tableStyles = (props: ThemeProps) => css`
|
|
|
580
587
|
/* Table */
|
|
581
588
|
.${ClassName.TABLE_NODE_WRAPPER} > table {
|
|
582
589
|
table-layout: fixed;
|
|
590
|
+
white-space: normal;
|
|
591
|
+
border-top: none;
|
|
592
|
+
|
|
593
|
+
> tbody > tr {
|
|
594
|
+
white-space: pre-wrap;
|
|
595
|
+
}
|
|
583
596
|
|
|
584
597
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS} + * {
|
|
585
598
|
margin-top: 0;
|
|
@@ -664,13 +677,8 @@ export const tableStyles = (props: ThemeProps) => css`
|
|
|
664
677
|
left: -${tableToolbarSize}px;
|
|
665
678
|
}
|
|
666
679
|
.${ClassName.TABLE_NODE_WRAPPER} {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
that is aligned to the right edge initially on hover of the top right column control when table overflown,
|
|
670
|
-
its center should be aligned with the edge
|
|
671
|
-
*/
|
|
672
|
-
padding-right: ${tableInsertColumnButtonSize / 2}px;
|
|
673
|
-
margin-right: -${tableInsertColumnButtonSize / 2}px;
|
|
680
|
+
padding-right: ${insertColumnButtonOffset}px;
|
|
681
|
+
margin-right: -${insertColumnButtonOffset}px;
|
|
674
682
|
padding-bottom: ${tableScrollbarOffset}px;
|
|
675
683
|
margin-bottom: -${tableScrollbarOffset}px;
|
|
676
684
|
/* fixes gap cursor height */
|
|
@@ -38,7 +38,6 @@ import {
|
|
|
38
38
|
tableToolbarSize,
|
|
39
39
|
tableInsertColumnButtonSize,
|
|
40
40
|
tableDeleteButtonSize,
|
|
41
|
-
tableControlsSpacing,
|
|
42
41
|
} from './consts';
|
|
43
42
|
|
|
44
43
|
import { TableCssClassName as ClassName } from '../types';
|
|
@@ -273,11 +272,6 @@ export const OverflowShadow = (props: ThemeProps) => css`
|
|
|
273
272
|
border-left: 1px solid ${tableBorderColor(props)};
|
|
274
273
|
}
|
|
275
274
|
}
|
|
276
|
-
.${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY} {
|
|
277
|
-
.${ClassName.TABLE_RIGHT_SHADOW}, .${ClassName.TABLE_LEFT_SHADOW} {
|
|
278
|
-
top: ${tableControlsSpacing}px;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
275
|
`;
|
|
282
276
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
283
277
|
|
|
@@ -195,7 +195,7 @@ export const colWidthsForRow = (
|
|
|
195
195
|
if (copyTarget) {
|
|
196
196
|
// either from the first row while it's still in the table
|
|
197
197
|
const cellInfos = maphElem(copyTarget, (cell) => ({
|
|
198
|
-
width: cell.
|
|
198
|
+
width: cell.getBoundingClientRect().width,
|
|
199
199
|
colspan: Number(cell.getAttribute('colspan') || 1),
|
|
200
200
|
colwidth: cell.dataset.colwidth,
|
|
201
201
|
}));
|
package/types/package.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"main": "../dist/cjs/plugins/table/types.js",
|
|
4
4
|
"module": "../dist/esm/plugins/table/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/plugins/table/types.js",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"types": "../dist/types/plugins/table/types.d.ts",
|
|
7
8
|
"typesVersions": {
|
|
8
9
|
">=4.0 <4.5": {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"main": "../../dist/cjs/plugins/table/ui/common-styles.js",
|
|
4
4
|
"module": "../../dist/esm/plugins/table/ui/common-styles.js",
|
|
5
5
|
"module:es2019": "../../dist/es2019/plugins/table/ui/common-styles.js",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"types": "../../dist/types/plugins/table/ui/common-styles.d.ts",
|
|
7
8
|
"typesVersions": {
|
|
8
9
|
">=4.0 <4.5": {
|
package/ui/consts/package.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"main": "../../dist/cjs/plugins/table/ui/consts.js",
|
|
4
4
|
"module": "../../dist/esm/plugins/table/ui/consts.js",
|
|
5
5
|
"module:es2019": "../../dist/es2019/plugins/table/ui/consts.js",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"types": "../../dist/types/plugins/table/ui/consts.d.ts",
|
|
7
8
|
"typesVersions": {
|
|
8
9
|
">=4.0 <4.5": {
|