quill-table-up 3.1.2 → 3.2.1
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/README.md +15 -8
- package/dist/index.css +1 -1
- package/dist/index.d.ts +168 -146
- package/dist/index.js +47 -47
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +52 -52
- package/dist/index.umd.js.map +1 -1
- package/package.json +22 -24
- package/src/__tests__/e2e/custom-creator.test.ts +44 -44
- package/src/__tests__/e2e/editor-page.ts +77 -77
- package/src/__tests__/e2e/table-align.test.ts +104 -104
- package/src/__tests__/e2e/table-blots.test.ts +169 -169
- package/src/__tests__/e2e/table-caption.test.ts +134 -134
- package/src/__tests__/e2e/table-clipboard.test.ts +20 -20
- package/src/__tests__/e2e/table-hack.test.ts +151 -151
- package/src/__tests__/e2e/table-keyboard-handler.test.ts +20 -4
- package/src/__tests__/e2e/table-menu.test.ts +172 -172
- package/src/__tests__/e2e/table-resize.test.ts +654 -9
- package/src/__tests__/e2e/table-scrollbar.test.ts +144 -144
- package/src/__tests__/e2e/table-selection.test.ts +563 -563
- package/src/__tests__/e2e/types.d.ts +8 -7
- package/src/__tests__/e2e/utils.ts +52 -52
- package/src/__tests__/unit/table-blots.test.ts +720 -720
- package/src/__tests__/unit/table-caption.test.ts +234 -234
- package/src/__tests__/unit/table-cell-merge.test.ts +713 -724
- package/src/__tests__/unit/table-clipboard.test.ts +2176 -2176
- package/src/__tests__/unit/table-hack.test.ts +1014 -1014
- package/src/__tests__/unit/table-insert.test.ts +915 -926
- package/src/__tests__/unit/table-redo-undo.test.ts +2429 -2429
- package/src/__tests__/unit/table-remove.test.ts +313 -343
- package/src/__tests__/unit/utils.test-d.ts +49 -49
- package/src/__tests__/unit/utils.test.ts +711 -711
- package/src/__tests__/unit/utils.ts +307 -307
- package/src/__tests__/unit/vitest.d.ts +14 -14
- package/src/formats/container-format.ts +107 -107
- package/src/formats/overrides/block-embed.ts +72 -72
- package/src/formats/overrides/block.ts +95 -95
- package/src/formats/overrides/index.ts +3 -3
- package/src/formats/overrides/scroll.ts +70 -70
- package/src/formats/table-body-format.ts +52 -52
- package/src/formats/table-caption-format.ts +116 -116
- package/src/formats/table-cell-format.ts +304 -304
- package/src/formats/table-cell-inner-format.ts +403 -398
- package/src/formats/table-colgroup-format.ts +136 -136
- package/src/formats/table-foot-format.ts +7 -7
- package/src/formats/table-head-format.ts +7 -7
- package/src/formats/table-main-format.ts +1 -1
- package/src/formats/table-row-format.ts +218 -210
- package/src/formats/utils.ts +6 -6
- package/src/index.ts +19 -19
- package/src/modules/index.ts +7 -7
- package/src/modules/table-align.ts +131 -131
- package/src/modules/table-clipboard/table-clipboard.ts +6 -8
- package/src/modules/table-dom-selector.ts +33 -33
- package/src/modules/table-menu/constants.ts +223 -223
- package/src/modules/table-menu/index.ts +4 -4
- package/src/modules/table-menu/table-menu-common.ts +330 -329
- package/src/modules/table-menu/table-menu-contextmenu.ts +111 -118
- package/src/modules/table-menu/table-menu-select.ts +96 -94
- package/src/modules/table-resize/index.ts +5 -5
- package/src/modules/table-resize/table-resize-box.ts +714 -363
- package/src/modules/table-resize/table-resize-common.ts +246 -382
- package/src/modules/table-resize/table-resize-drag.ts +241 -0
- package/src/modules/table-resize/table-resize-line.ts +244 -182
- package/src/modules/table-resize/table-resize-scale.ts +174 -173
- package/src/modules/table-resize/utils.ts +84 -3
- package/src/modules/table-scrollbar.ts +292 -292
- package/src/modules/table-selection.ts +613 -669
- package/src/style/button.less +45 -45
- package/src/style/color-picker.less +136 -136
- package/src/style/dialog.less +53 -53
- package/src/style/functions.less +9 -9
- package/src/style/index.less +120 -120
- package/src/style/input.less +64 -64
- package/src/style/select-box.less +52 -52
- package/src/style/table-creator.less +56 -56
- package/src/style/table-menu.less +125 -125
- package/src/style/table-resize-scale.less +31 -31
- package/src/style/table-resize.less +249 -202
- package/src/style/table-scrollbar.less +49 -49
- package/src/style/table-selection.less +23 -23
- package/src/style/tooltip.less +19 -19
- package/src/style/variables.less +1 -1
- package/src/svg/arrow-up-down.svg +11 -11
- package/src/svg/convert-cell.svg +7 -7
- package/src/table-up.ts +1363 -1360
- package/src/types.d.ts +4 -4
- package/src/utils/bem.ts +23 -23
- package/src/utils/blot-helper.ts +101 -105
- package/src/utils/color.ts +109 -109
- package/src/utils/components/button.ts +22 -22
- package/src/utils/components/color-picker.ts +236 -236
- package/src/utils/components/dialog.ts +83 -41
- package/src/utils/components/index.ts +6 -6
- package/src/utils/components/input.ts +74 -74
- package/src/utils/components/table/creator.ts +89 -89
- package/src/utils/components/table/index.ts +2 -2
- package/src/utils/components/table/select-box.ts +78 -78
- package/src/utils/components/tooltip.ts +179 -189
- package/src/utils/constants.ts +125 -124
- package/src/utils/drag-helper.ts +112 -0
- package/src/utils/index.ts +15 -14
- package/src/utils/is.ts +9 -9
- package/src/utils/position.ts +60 -60
- package/src/utils/resize-observer-helper.ts +47 -47
- package/src/utils/scroll.ts +145 -47
- package/src/utils/style-helper.ts +47 -47
- package/src/utils/transformer.ts +10 -10
- package/src/utils/transition-event-helper.ts +8 -8
- package/src/utils/types.ts +156 -157
- package/src/utils/utils.ts +12 -12
|
@@ -1,118 +1,111 @@
|
|
|
1
|
-
import type Quill from 'quill';
|
|
2
|
-
import type { TableUp } from '../../table-up';
|
|
3
|
-
import type { InternalTableSelectionModule,
|
|
4
|
-
import type { TableSelection } from '../table-selection';
|
|
5
|
-
import { limitDomInViewPort, tableUpEvent } from '../../utils';
|
|
6
|
-
import { menuColorSelectClassName } from './constants';
|
|
7
|
-
import { TableMenuCommon } from './table-menu-common';
|
|
8
|
-
|
|
9
|
-
type TableMenuOptionsInput = Partial<Omit<TableMenuOptions, 'texts'>>;
|
|
10
|
-
export class TableMenuContextmenu extends TableMenuCommon {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor(public tableModule: TableUp, public quill: Quill, options: TableMenuOptionsInput) {
|
|
16
|
-
super(tableModule, quill, options);
|
|
17
|
-
|
|
18
|
-
this.quill.root.addEventListener('contextmenu', this.listenContextmenu);
|
|
19
|
-
this.quill.on(tableUpEvent.TABLE_SELECTION_CHANGE, this.tableSelectioChange);
|
|
20
|
-
this.quill.on(tableUpEvent.TABLE_SELECTION_DISPLAY_CHANGE, this.tableSelectioChange);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
tableSelectioChange = (tableSelection: InternalTableSelectionModule) => {
|
|
24
|
-
if (tableSelection.selectedTds.length <= 0) {
|
|
25
|
-
this.hide();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
listenContextmenu = (e: MouseEvent) => {
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
|
|
32
|
-
const path = e.composedPath() as HTMLElement[];
|
|
33
|
-
if (!path || path.length <= 0) return;
|
|
34
|
-
|
|
35
|
-
const tableNode = path.find(node => node.tagName && node.tagName.toUpperCase() === 'TABLE' && node.classList.contains('ql-table'));
|
|
36
|
-
|
|
37
|
-
const tableSelection = this.tableModule.getModule<TableSelection>(
|
|
38
|
-
if (tableNode && tableSelection?.selectedTds?.length) {
|
|
39
|
-
if (!this.menu) {
|
|
40
|
-
this.menu = this.buildTools();
|
|
41
|
-
}
|
|
42
|
-
// manual call menu show
|
|
43
|
-
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
menu.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
tipTextDom
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
show()
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
destroy() {
|
|
113
|
-
this.quill.root.removeEventListener('contextmenu', this.listenContextmenu);
|
|
114
|
-
super.destroy();
|
|
115
|
-
this.quill.off(tableUpEvent.TABLE_SELECTION_CHANGE, this.tableSelectioChange);
|
|
116
|
-
this.quill.off(tableUpEvent.TABLE_SELECTION_DISPLAY_CHANGE, this.tableSelectioChange);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
1
|
+
import type Quill from 'quill';
|
|
2
|
+
import type { TableUp } from '../../table-up';
|
|
3
|
+
import type { InternalTableSelectionModule, Position, TableMenuOptions } from '../../utils';
|
|
4
|
+
import type { TableSelection } from '../table-selection';
|
|
5
|
+
import { addScrollEvent, clearScrollEvent, limitDomInViewPort, tableUpEvent, tableUpInternal } from '../../utils';
|
|
6
|
+
import { menuColorSelectClassName } from './constants';
|
|
7
|
+
import { TableMenuCommon } from './table-menu-common';
|
|
8
|
+
|
|
9
|
+
type TableMenuOptionsInput = Partial<Omit<TableMenuOptions, 'texts'>>;
|
|
10
|
+
export class TableMenuContextmenu extends TableMenuCommon {
|
|
11
|
+
static moduleName = 'table-menu-contextmenu';
|
|
12
|
+
|
|
13
|
+
scrollHandler: [HTMLElement, (e: Event) => void][] = [];
|
|
14
|
+
|
|
15
|
+
constructor(public tableModule: TableUp, public quill: Quill, options: TableMenuOptionsInput) {
|
|
16
|
+
super(tableModule, quill, options);
|
|
17
|
+
|
|
18
|
+
this.quill.root.addEventListener('contextmenu', this.listenContextmenu);
|
|
19
|
+
this.quill.on(tableUpEvent.TABLE_SELECTION_CHANGE, this.tableSelectioChange);
|
|
20
|
+
this.quill.on(tableUpEvent.TABLE_SELECTION_DISPLAY_CHANGE, this.tableSelectioChange);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
tableSelectioChange = (tableSelection: InternalTableSelectionModule) => {
|
|
24
|
+
if (tableSelection.selectedTds.length <= 0) {
|
|
25
|
+
this.hide();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
listenContextmenu = (e: MouseEvent) => {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
|
|
32
|
+
const path = e.composedPath() as HTMLElement[];
|
|
33
|
+
if (!path || path.length <= 0) return;
|
|
34
|
+
|
|
35
|
+
const tableNode = path.find(node => node.tagName && node.tagName.toUpperCase() === 'TABLE' && node.classList.contains('ql-table'));
|
|
36
|
+
|
|
37
|
+
const tableSelection = this.tableModule.getModule<TableSelection>(tableUpInternal.tableSelectionName);
|
|
38
|
+
if (tableNode && tableSelection?.selectedTds?.length) {
|
|
39
|
+
if (!this.menu) {
|
|
40
|
+
this.menu = this.buildTools();
|
|
41
|
+
}
|
|
42
|
+
// manual call menu show
|
|
43
|
+
this.isMenuDisplay = true;
|
|
44
|
+
this.update({ x: e.clientX, y: e.clientY });
|
|
45
|
+
const tempHide = () => {
|
|
46
|
+
this.hide();
|
|
47
|
+
clearScrollEvent.call(this);
|
|
48
|
+
};
|
|
49
|
+
addScrollEvent.call(this, this.quill.root, tempHide);
|
|
50
|
+
document.addEventListener('click', tempHide, { once: true });
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.hide();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
buildTools(): HTMLElement {
|
|
58
|
+
const menu = super.buildTools();
|
|
59
|
+
menu.classList.add(this.bem.is('contextmenu'));
|
|
60
|
+
const items = menu.getElementsByClassName(menuColorSelectClassName);
|
|
61
|
+
for (const item of Array.from(items)) {
|
|
62
|
+
item.addEventListener('click', e => e.stopPropagation());
|
|
63
|
+
}
|
|
64
|
+
this.quill.container.appendChild(menu);
|
|
65
|
+
return menu;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
createTipText(item: HTMLElement, text: string): void {
|
|
69
|
+
const tipTextDom = document.createElement('span');
|
|
70
|
+
tipTextDom.textContent = text;
|
|
71
|
+
item.appendChild(tipTextDom);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// override show. because TableSelection will call tableMenu.show() after select td
|
|
75
|
+
show() {}
|
|
76
|
+
|
|
77
|
+
update(position?: Position) {
|
|
78
|
+
super.update();
|
|
79
|
+
const tableSelection = this.tableModule.getModule<TableSelection>(tableUpInternal.tableSelectionName);
|
|
80
|
+
if (!this.table || !this.isMenuDisplay || !this.menu) {
|
|
81
|
+
this.hide();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (!position || !tableSelection?.isDisplaySelection) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const rootRect = this.quill.container.getBoundingClientRect();
|
|
89
|
+
Object.assign(this.menu.style, {
|
|
90
|
+
left: `${position.x - rootRect.x}px`,
|
|
91
|
+
top: `${position.y - rootRect.y}px`,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// limit menu in viewport
|
|
95
|
+
const menuRect = this.menu.getBoundingClientRect();
|
|
96
|
+
const { left: limitLeft, top: limitTop } = limitDomInViewPort(menuRect);
|
|
97
|
+
const diffX = menuRect.left - limitLeft;
|
|
98
|
+
const diffY = menuRect.top - limitTop;
|
|
99
|
+
Object.assign(this.menu.style, {
|
|
100
|
+
left: `${position.x - rootRect.x - diffX}px`,
|
|
101
|
+
top: `${position.y - rootRect.y - diffY}px`,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
destroy() {
|
|
106
|
+
this.quill.root.removeEventListener('contextmenu', this.listenContextmenu);
|
|
107
|
+
super.destroy();
|
|
108
|
+
this.quill.off(tableUpEvent.TABLE_SELECTION_CHANGE, this.tableSelectioChange);
|
|
109
|
+
this.quill.off(tableUpEvent.TABLE_SELECTION_DISPLAY_CHANGE, this.tableSelectioChange);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -1,94 +1,96 @@
|
|
|
1
|
-
import type Quill from 'quill';
|
|
2
|
-
import type { TableCellInnerFormat } from '../../formats';
|
|
3
|
-
import type { TableUp } from '../../table-up';
|
|
4
|
-
import type { InternalTableSelectionModule } from '../../utils';
|
|
5
|
-
import type { TableSelection } from '../table-selection';
|
|
6
|
-
import type { TableMenuOptionsInput } from './table-menu-common';
|
|
7
|
-
import { computePosition, flip, limitShift, offset, shift } from '@floating-ui/dom';
|
|
8
|
-
import { tableUpEvent } from '../../utils';
|
|
9
|
-
import { TableMenuCommon } from './table-menu-common';
|
|
10
|
-
|
|
11
|
-
export class TableMenuSelect extends TableMenuCommon {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.quill.on(tableUpEvent.
|
|
18
|
-
this.quill.on(tableUpEvent.
|
|
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
|
-
this.
|
|
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
|
-
|
|
1
|
+
import type Quill from 'quill';
|
|
2
|
+
import type { TableCellInnerFormat } from '../../formats';
|
|
3
|
+
import type { TableUp } from '../../table-up';
|
|
4
|
+
import type { InternalTableSelectionModule } from '../../utils';
|
|
5
|
+
import type { TableSelection } from '../table-selection';
|
|
6
|
+
import type { TableMenuOptionsInput } from './table-menu-common';
|
|
7
|
+
import { computePosition, flip, limitShift, offset, shift } from '@floating-ui/dom';
|
|
8
|
+
import { tableUpEvent, tableUpInternal } from '../../utils';
|
|
9
|
+
import { TableMenuCommon } from './table-menu-common';
|
|
10
|
+
|
|
11
|
+
export class TableMenuSelect extends TableMenuCommon {
|
|
12
|
+
static moduleName = 'table-menu-select';
|
|
13
|
+
|
|
14
|
+
constructor(public tableModule: TableUp, public quill: Quill, options: TableMenuOptionsInput) {
|
|
15
|
+
super(tableModule, quill, options);
|
|
16
|
+
|
|
17
|
+
this.quill.on(tableUpEvent.TABLE_SELECTION_DRAG_START, this.tableSelectionDragStart);
|
|
18
|
+
this.quill.on(tableUpEvent.TABLE_SELECTION_DRAG_END, this.tableSelectionDragEnd);
|
|
19
|
+
this.quill.on(tableUpEvent.TABLE_SELECTION_CHANGE, this.tableSelectioChange);
|
|
20
|
+
this.quill.on(tableUpEvent.TABLE_SELECTION_DISPLAY_CHANGE, this.tableSelectionDisplayChange);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
tableSelectionDragStart = () => {
|
|
24
|
+
this.hide();
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
tableSelectionDragEnd = (tableSelection: InternalTableSelectionModule) => {
|
|
28
|
+
if (tableSelection.selectedTds.length > 0) {
|
|
29
|
+
this.show();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
tableSelectioChange = (tableSelection: InternalTableSelectionModule, selectedTds: TableCellInnerFormat[]) => {
|
|
34
|
+
if (selectedTds.length <= 0) {
|
|
35
|
+
this.hide();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
tableSelectionDisplayChange = (tableSelection: InternalTableSelectionModule) => {
|
|
40
|
+
if (!tableSelection.dragging) {
|
|
41
|
+
this.update();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
buildTools(): HTMLElement {
|
|
46
|
+
const menu = super.buildTools();
|
|
47
|
+
this.tableModule.addContainer(menu);
|
|
48
|
+
return menu;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
show() {
|
|
52
|
+
super.show();
|
|
53
|
+
this.update();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
update() {
|
|
57
|
+
super.update();
|
|
58
|
+
if (!this.menu && this.table) {
|
|
59
|
+
this.show();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const selectedTds = this.getSelectedTds();
|
|
63
|
+
if (!this.menu || !this.table || selectedTds.length === 0) {
|
|
64
|
+
if (this.menu || !this.table) {
|
|
65
|
+
this.isMenuDisplay = false;
|
|
66
|
+
this.menu?.classList.add(this.bem.is('hidden'));
|
|
67
|
+
this.hide();
|
|
68
|
+
}
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.isMenuDisplay = true;
|
|
72
|
+
this.menu.classList.remove(this.bem.is('hidden'));
|
|
73
|
+
|
|
74
|
+
const tableSelection = this.tableModule.getModule<TableSelection>(tableUpInternal.tableSelectionName);
|
|
75
|
+
if (tableSelection?.isDisplaySelection) {
|
|
76
|
+
computePosition(tableSelection.cellSelect, this.menu, {
|
|
77
|
+
placement: 'bottom',
|
|
78
|
+
middleware: [flip(), shift({ limiter: limitShift() }), offset(20)],
|
|
79
|
+
}).then(({ x, y }) => {
|
|
80
|
+
if (this.menu) {
|
|
81
|
+
Object.assign(this.menu.style, {
|
|
82
|
+
left: `${x}px`,
|
|
83
|
+
top: `${y}px`,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
destroy(): void {
|
|
91
|
+
super.destroy();
|
|
92
|
+
|
|
93
|
+
this.quill.off(tableUpEvent.TABLE_SELECTION_DRAG_START, this.tableSelectionDragStart);
|
|
94
|
+
this.quill.off(tableUpEvent.TABLE_SELECTION_DRAG_END, this.tableSelectionDragEnd);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './table-resize-box';
|
|
2
|
-
export * from './table-resize-common';
|
|
3
|
-
export * from './table-resize-line';
|
|
4
|
-
export * from './table-resize-scale';
|
|
5
|
-
export * from './utils';
|
|
1
|
+
export * from './table-resize-box';
|
|
2
|
+
export * from './table-resize-common';
|
|
3
|
+
export * from './table-resize-line';
|
|
4
|
+
export * from './table-resize-scale';
|
|
5
|
+
export * from './utils';
|