@opentiny/fluent-editor 3.25.4 → 4.0.0-alpha.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/es/attributors/font-style.es.js +1 -1
- package/es/attributors/font-style.es.js.map +1 -1
- package/es/attributors/line-height.es.js +1 -1
- package/es/attributors/line-height.es.js.map +1 -1
- package/es/config/editor.config.es.js +0 -7
- package/es/config/editor.config.es.js.map +1 -1
- package/es/config/editor.utils.es.js +0 -9
- package/es/config/editor.utils.es.js.map +1 -1
- package/es/config/i18n/en-us.es.js +33 -17
- package/es/config/i18n/en-us.es.js.map +1 -1
- package/es/config/i18n/zh-cn.es.js +33 -17
- package/es/config/i18n/zh-cn.es.js.map +1 -1
- package/es/config/index.es.js +7 -13
- package/es/config/index.es.js.map +1 -1
- package/es/core/fluent-editor.es.js +6 -4
- package/es/core/fluent-editor.es.js.map +1 -1
- package/es/fluent-editor.es.js +24 -12
- package/es/fluent-editor.es.js.map +1 -1
- package/es/formats/video.es.js +2 -2
- package/es/formats/video.es.js.map +1 -1
- package/es/index.es.js +8 -4
- package/es/index.es.js.map +1 -1
- package/es/modules/custom-clipboard.es.js +3 -61
- package/es/modules/custom-clipboard.es.js.map +1 -1
- package/es/modules/custom-image/BlotFormatter.es.js +1 -2
- package/es/modules/custom-image/BlotFormatter.es.js.map +1 -1
- package/es/modules/custom-image/image.es.js +4 -16
- package/es/modules/custom-image/image.es.js.map +1 -1
- package/es/modules/custom-uploader.es.js +60 -193
- package/es/modules/custom-uploader.es.js.map +1 -1
- package/es/modules/file/formats/file.es.js +12 -14
- package/es/modules/file/formats/file.es.js.map +1 -1
- package/es/modules/file/index.es.js +6 -7
- package/es/modules/file/index.es.js.map +1 -1
- package/es/modules/i18n.es.js +32 -12
- package/es/modules/i18n.es.js.map +1 -1
- package/es/modules/link/index.es.js +0 -17
- package/es/modules/link/index.es.js.map +1 -1
- package/es/modules/link/modules/tooltip.es.js +3 -2
- package/es/modules/link/modules/tooltip.es.js.map +1 -1
- package/es/modules/shortcut-key/index.es.js +229 -0
- package/es/modules/shortcut-key/index.es.js.map +1 -0
- package/es/modules/table-up/index.es.js +64 -0
- package/es/modules/table-up/index.es.js.map +1 -0
- package/es/modules/toolbar/better-picker.es.js +21 -269
- package/es/modules/toolbar/better-picker.es.js.map +1 -1
- package/es/modules/toolbar/index.es.js +0 -1
- package/es/modules/toolbar/index.es.js.map +1 -1
- package/es/modules/toolbar/toolbar-tip.es.js +44 -9
- package/es/modules/toolbar/toolbar-tip.es.js.map +1 -1
- package/es/themes/snow.es.js +198 -50
- package/es/themes/snow.es.js.map +1 -1
- package/es/ui/icons.config.es.js +6 -5
- package/es/ui/icons.config.es.js.map +1 -1
- package/es/ui/icons.es.js +3 -12
- package/es/ui/icons.es.js.map +1 -1
- package/es/utils/is.es.js +4 -0
- package/es/utils/is.es.js.map +1 -1
- package/lib/attributors/font-style.cjs.js +1 -1
- package/lib/attributors/font-style.cjs.js.map +1 -1
- package/lib/attributors/line-height.cjs.js +1 -1
- package/lib/attributors/line-height.cjs.js.map +1 -1
- package/lib/config/editor.config.cjs.js +0 -7
- package/lib/config/editor.config.cjs.js.map +1 -1
- package/lib/config/editor.utils.cjs.js +0 -9
- package/lib/config/editor.utils.cjs.js.map +1 -1
- package/lib/config/i18n/en-us.cjs.js +33 -17
- package/lib/config/i18n/en-us.cjs.js.map +1 -1
- package/lib/config/i18n/zh-cn.cjs.js +33 -17
- package/lib/config/i18n/zh-cn.cjs.js.map +1 -1
- package/lib/config/index.cjs.js +5 -11
- package/lib/config/index.cjs.js.map +1 -1
- package/lib/core/fluent-editor.cjs.js +5 -3
- package/lib/core/fluent-editor.cjs.js.map +1 -1
- package/lib/fluent-editor.cjs.js +23 -11
- package/lib/fluent-editor.cjs.js.map +1 -1
- package/lib/formats/video.cjs.js +2 -2
- package/lib/formats/video.cjs.js.map +1 -1
- package/lib/index.cjs.js +9 -2
- package/lib/index.cjs.js.map +1 -1
- package/lib/modules/custom-clipboard.cjs.js +2 -60
- package/lib/modules/custom-clipboard.cjs.js.map +1 -1
- package/lib/modules/custom-image/BlotFormatter.cjs.js +0 -1
- package/lib/modules/custom-image/BlotFormatter.cjs.js.map +1 -1
- package/lib/modules/custom-image/image.cjs.js +4 -16
- package/lib/modules/custom-image/image.cjs.js.map +1 -1
- package/lib/modules/custom-uploader.cjs.js +61 -194
- package/lib/modules/custom-uploader.cjs.js.map +1 -1
- package/lib/modules/file/formats/file.cjs.js +12 -14
- package/lib/modules/file/formats/file.cjs.js.map +1 -1
- package/lib/modules/file/index.cjs.js +6 -7
- package/lib/modules/file/index.cjs.js.map +1 -1
- package/lib/modules/i18n.cjs.js +31 -11
- package/lib/modules/i18n.cjs.js.map +1 -1
- package/lib/modules/link/index.cjs.js +0 -17
- package/lib/modules/link/index.cjs.js.map +1 -1
- package/lib/modules/link/modules/tooltip.cjs.js +2 -1
- package/lib/modules/link/modules/tooltip.cjs.js.map +1 -1
- package/lib/modules/shortcut-key/index.cjs.js +229 -0
- package/lib/modules/shortcut-key/index.cjs.js.map +1 -0
- package/lib/modules/table-up/index.cjs.js +64 -0
- package/lib/modules/table-up/index.cjs.js.map +1 -0
- package/lib/modules/toolbar/better-picker.cjs.js +21 -270
- package/lib/modules/toolbar/better-picker.cjs.js.map +1 -1
- package/lib/modules/toolbar/index.cjs.js +0 -1
- package/lib/modules/toolbar/index.cjs.js.map +1 -1
- package/lib/modules/toolbar/toolbar-tip.cjs.js +44 -9
- package/lib/modules/toolbar/toolbar-tip.cjs.js.map +1 -1
- package/lib/themes/snow.cjs.js +200 -52
- package/lib/themes/snow.cjs.js.map +1 -1
- package/lib/ui/icons.cjs.js +2 -11
- package/lib/ui/icons.cjs.js.map +1 -1
- package/lib/ui/icons.config.cjs.js +6 -5
- package/lib/ui/icons.config.cjs.js.map +1 -1
- package/lib/utils/is.cjs.js +4 -0
- package/lib/utils/is.cjs.js.map +1 -1
- package/package.json +4 -2
- package/style.css +316 -2149
- package/types/attributors/font-style.d.ts +1 -1
- package/types/config/editor.config.d.ts +0 -218
- package/types/config/editor.utils.d.ts +0 -1
- package/types/config/i18n/en-us.d.ts +31 -16
- package/types/config/i18n/zh-cn.d.ts +31 -16
- package/types/config/index.d.ts +1 -1
- package/types/config/types/editor-config.interface.d.ts +0 -19
- package/types/config/types/editor-modules.interface.d.ts +2 -0
- package/types/config/types/toolbar-item.interface.d.ts +11 -11
- package/types/core/fluent-editor.d.ts +4 -1
- package/types/index.d.ts +3 -0
- package/types/modules/counter.d.ts +1 -1
- package/types/modules/custom-clipboard.d.ts +1 -1
- package/types/modules/custom-image/image.d.ts +8 -11
- package/types/modules/file/formats/file.d.ts +12 -8
- package/types/modules/file/index.d.ts +5 -5
- package/types/modules/i18n.d.ts +4 -4
- package/types/modules/shortcut-key/index.d.ts +68 -0
- package/types/modules/table-up/index.d.ts +66 -0
- package/types/modules/toolbar/better-picker.d.ts +15 -0
- package/types/themes/snow.d.ts +10 -2
- package/types/ui/icons.config.d.ts +2 -2
- package/types/utils/is.d.ts +2 -0
- package/es/modules/global-link/constants.es.js +0 -9
- package/es/modules/global-link/constants.es.js.map +0 -1
- package/es/modules/global-link/formats/customer-widget-link.es.js +0 -28
- package/es/modules/global-link/formats/customer-widget-link.es.js.map +0 -1
- package/es/modules/global-link/formats/doc-link.es.js +0 -42
- package/es/modules/global-link/formats/doc-link.es.js.map +0 -1
- package/es/modules/global-link/formats/wiki-link.es.js +0 -34
- package/es/modules/global-link/formats/wiki-link.es.js.map +0 -1
- package/es/modules/global-link/formats/work-item-link.es.js +0 -36
- package/es/modules/global-link/formats/work-item-link.es.js.map +0 -1
- package/es/modules/global-link/global-link-panel.es.js +0 -2
- package/es/modules/global-link/global-link-panel.es.js.map +0 -1
- package/es/modules/global-link/index.es.js +0 -139
- package/es/modules/global-link/index.es.js.map +0 -1
- package/es/modules/global-link/utils/createTable.es.js +0 -50
- package/es/modules/global-link/utils/createTable.es.js.map +0 -1
- package/es/modules/quick-menu.es.js +0 -82
- package/es/modules/quick-menu.es.js.map +0 -1
- package/es/modules/table/better-table.es.js +0 -485
- package/es/modules/table/better-table.es.js.map +0 -1
- package/es/modules/table/formats/header.es.js +0 -94
- package/es/modules/table/formats/header.es.js.map +0 -1
- package/es/modules/table/formats/list.es.js +0 -163
- package/es/modules/table/formats/list.es.js.map +0 -1
- package/es/modules/table/formats/table.es.js +0 -969
- package/es/modules/table/formats/table.es.js.map +0 -1
- package/es/modules/table/modules/table-column-tool.es.js +0 -400
- package/es/modules/table/modules/table-column-tool.es.js.map +0 -1
- package/es/modules/table/modules/table-operation-menu.es.js +0 -475
- package/es/modules/table/modules/table-operation-menu.es.js.map +0 -1
- package/es/modules/table/modules/table-scroll-bar.es.js +0 -190
- package/es/modules/table/modules/table-scroll-bar.es.js.map +0 -1
- package/es/modules/table/modules/table-selection.es.js +0 -305
- package/es/modules/table/modules/table-selection.es.js.map +0 -1
- package/es/modules/table/modules/table-selector.es.js +0 -158
- package/es/modules/table/modules/table-selector.es.js.map +0 -1
- package/es/modules/table/table-config.es.js +0 -74
- package/es/modules/table/table-config.es.js.map +0 -1
- package/es/modules/table/utils/index.es.js +0 -54
- package/es/modules/table/utils/index.es.js.map +0 -1
- package/es/modules/table/utils/node-matchers.es.js +0 -292
- package/es/modules/table/utils/node-matchers.es.js.map +0 -1
- package/lib/modules/global-link/constants.cjs.js +0 -9
- package/lib/modules/global-link/constants.cjs.js.map +0 -1
- package/lib/modules/global-link/formats/customer-widget-link.cjs.js +0 -28
- package/lib/modules/global-link/formats/customer-widget-link.cjs.js.map +0 -1
- package/lib/modules/global-link/formats/doc-link.cjs.js +0 -42
- package/lib/modules/global-link/formats/doc-link.cjs.js.map +0 -1
- package/lib/modules/global-link/formats/wiki-link.cjs.js +0 -34
- package/lib/modules/global-link/formats/wiki-link.cjs.js.map +0 -1
- package/lib/modules/global-link/formats/work-item-link.cjs.js +0 -36
- package/lib/modules/global-link/formats/work-item-link.cjs.js.map +0 -1
- package/lib/modules/global-link/global-link-panel.cjs.js +0 -2
- package/lib/modules/global-link/global-link-panel.cjs.js.map +0 -1
- package/lib/modules/global-link/index.cjs.js +0 -139
- package/lib/modules/global-link/index.cjs.js.map +0 -1
- package/lib/modules/global-link/utils/createTable.cjs.js +0 -50
- package/lib/modules/global-link/utils/createTable.cjs.js.map +0 -1
- package/lib/modules/quick-menu.cjs.js +0 -82
- package/lib/modules/quick-menu.cjs.js.map +0 -1
- package/lib/modules/table/better-table.cjs.js +0 -485
- package/lib/modules/table/better-table.cjs.js.map +0 -1
- package/lib/modules/table/formats/header.cjs.js +0 -94
- package/lib/modules/table/formats/header.cjs.js.map +0 -1
- package/lib/modules/table/formats/list.cjs.js +0 -163
- package/lib/modules/table/formats/list.cjs.js.map +0 -1
- package/lib/modules/table/formats/table.cjs.js +0 -969
- package/lib/modules/table/formats/table.cjs.js.map +0 -1
- package/lib/modules/table/modules/table-column-tool.cjs.js +0 -400
- package/lib/modules/table/modules/table-column-tool.cjs.js.map +0 -1
- package/lib/modules/table/modules/table-operation-menu.cjs.js +0 -475
- package/lib/modules/table/modules/table-operation-menu.cjs.js.map +0 -1
- package/lib/modules/table/modules/table-scroll-bar.cjs.js +0 -190
- package/lib/modules/table/modules/table-scroll-bar.cjs.js.map +0 -1
- package/lib/modules/table/modules/table-selection.cjs.js +0 -305
- package/lib/modules/table/modules/table-selection.cjs.js.map +0 -1
- package/lib/modules/table/modules/table-selector.cjs.js +0 -158
- package/lib/modules/table/modules/table-selector.cjs.js.map +0 -1
- package/lib/modules/table/table-config.cjs.js +0 -74
- package/lib/modules/table/table-config.cjs.js.map +0 -1
- package/lib/modules/table/utils/index.cjs.js +0 -54
- package/lib/modules/table/utils/index.cjs.js.map +0 -1
- package/lib/modules/table/utils/node-matchers.cjs.js +0 -292
- package/lib/modules/table/utils/node-matchers.cjs.js.map +0 -1
- package/types/modules/custom-uploader.d.ts +0 -31
- package/types/modules/global-link/constants.d.ts +0 -3
- package/types/modules/global-link/formats/customer-widget-link.d.ts +0 -14
- package/types/modules/global-link/formats/doc-link.d.ts +0 -17
- package/types/modules/global-link/formats/wiki-link.d.ts +0 -16
- package/types/modules/global-link/formats/work-item-link.d.ts +0 -16
- package/types/modules/global-link/global-link-panel.d.ts +0 -19
- package/types/modules/global-link/index.d.ts +0 -18
- package/types/modules/global-link/utils/createTable.d.ts +0 -1
- package/types/modules/quick-menu.d.ts +0 -22
- package/types/modules/table/better-table.d.ts +0 -35
- package/types/modules/table/formats/header.d.ts +0 -23
- package/types/modules/table/formats/list.d.ts +0 -34
- package/types/modules/table/formats/table.d.ts +0 -147
- package/types/modules/table/modules/table-column-tool.d.ts +0 -23
- package/types/modules/table/modules/table-operation-menu.d.ts +0 -38
- package/types/modules/table/modules/table-scroll-bar.d.ts +0 -33
- package/types/modules/table/modules/table-selection.d.ts +0 -37
- package/types/modules/table/modules/table-selector.d.ts +0 -22
- package/types/modules/table/table-config.d.ts +0 -38
- package/types/modules/table/utils/index.d.ts +0 -17
- package/types/modules/table/utils/node-matchers.d.ts +0 -9
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const tableConfig = require("../table-config.cjs.js");
|
|
4
|
-
const index = require("../utils/index.cjs.js");
|
|
5
|
-
class TableScrollBar {
|
|
6
|
-
// 表格是否溢出开关,判断开关值后只改变样式一次,不重复修改
|
|
7
|
-
constructor(table, quill, dom) {
|
|
8
|
-
if (!table) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
this.table = table;
|
|
12
|
-
this.quill = quill;
|
|
13
|
-
this.modulesContainer = dom;
|
|
14
|
-
this.domNode = null;
|
|
15
|
-
this.oldRootScrollTop = this.quill.root.scrollTop;
|
|
16
|
-
this.prev = 0;
|
|
17
|
-
const betterTableModule = this.quill.getModule("better-table");
|
|
18
|
-
const tableColumnTool = betterTableModule.columnTool;
|
|
19
|
-
this.columnToolDomNode = tableColumnTool.domNode;
|
|
20
|
-
this.columnCtrlPanel = tableColumnTool.columnCtrlPanel;
|
|
21
|
-
this.leftMask = tableColumnTool.leftMask;
|
|
22
|
-
this.updateScrollBar();
|
|
23
|
-
if (this.quill.root === this.quill.scrollingContainer) {
|
|
24
|
-
this.quill.root.addEventListener("scroll", this.handleQuillRootScroll.bind(this));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
handleQuillRootScroll() {
|
|
28
|
-
if (!this.domNode) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const curTableRect = this.table.getBoundingClientRect();
|
|
32
|
-
const curContainerRect = this.quill.root.parentNode.getBoundingClientRect();
|
|
33
|
-
const tableTop = curTableRect.top + tableConfig.SCROLL_BAR_PANEL_HEIGHT;
|
|
34
|
-
const tableBottom = curTableRect.top + curTableRect.height - 1;
|
|
35
|
-
const containerBottom = curContainerRect.top + curContainerRect.height;
|
|
36
|
-
if (containerBottom < tableBottom && containerBottom > tableTop) {
|
|
37
|
-
if (!this.isTableOverflow) {
|
|
38
|
-
this.isTableOverflow = true;
|
|
39
|
-
index.css(this.domNode, {
|
|
40
|
-
display: "block",
|
|
41
|
-
top: `${this.containerRect.height - tableConfig.SCROLL_BAR_PANEL_HEIGHT}px`,
|
|
42
|
-
marginTop: "0px"
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
} else if (containerBottom <= tableTop) {
|
|
46
|
-
this.isTableOverflow = false;
|
|
47
|
-
this.domNode.style.display = "none";
|
|
48
|
-
} else {
|
|
49
|
-
this.setScrollBarToBottom();
|
|
50
|
-
index.css(this.domNode, { marginTop: `${this.oldRootScrollTop - this.quill.root.scrollTop}px` });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
setScrollBarToBottom() {
|
|
54
|
-
if (this.isTableOverflow) {
|
|
55
|
-
this.isTableOverflow = false;
|
|
56
|
-
const barPos = this.tableRect.top + this.tableRect.height - this.containerRect.top - 1;
|
|
57
|
-
index.css(this.domNode, { display: "block", top: `${barPos}px` });
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
resetTableHeight(table) {
|
|
61
|
-
if (this.domNode) {
|
|
62
|
-
this.tableRect.height = table.getBoundingClientRect().height;
|
|
63
|
-
this.isTableOverflow = !this.isTableOverflow;
|
|
64
|
-
this.handleQuillRootScroll();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
setScrollBarMove(pos, isMouse) {
|
|
68
|
-
const currentBarLeft = Number.parseInt(getComputedStyle(this.scrollBar).left, 10);
|
|
69
|
-
let left = isMouse ? pos - this.prev + currentBarLeft : currentBarLeft + pos;
|
|
70
|
-
this.showMask(left);
|
|
71
|
-
left = this.getLimitedDistance(left);
|
|
72
|
-
const scale = this.tableViewRect.width / this.tableRect.width;
|
|
73
|
-
const move = left / scale;
|
|
74
|
-
const columnCtrlPanelLeft = this.tableViewRect.left - this.containerRect.left - move;
|
|
75
|
-
index.css(this.scrollBar, { left: `${left}px` });
|
|
76
|
-
index.css(this.columnCtrlPanel, { left: `${columnCtrlPanelLeft}px` });
|
|
77
|
-
this.table.parentNode.scrollLeft = move;
|
|
78
|
-
if (isMouse) {
|
|
79
|
-
this.prev = pos;
|
|
80
|
-
}
|
|
81
|
-
const tableSelection = this.quill.getModule("better-table").tableSelection;
|
|
82
|
-
if (tableSelection && tableSelection.selectedTds.length) {
|
|
83
|
-
tableSelection.refreshHelpLinesPosition();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
handleScrollBarMouseDown(mouseDownEvent) {
|
|
87
|
-
mouseDownEvent.preventDefault();
|
|
88
|
-
this.prev = mouseDownEvent.clientX;
|
|
89
|
-
this.subscriber = (mouseMoveEvent) => {
|
|
90
|
-
mouseMoveEvent.preventDefault();
|
|
91
|
-
mouseMoveEvent.stopPropagation();
|
|
92
|
-
this.setScrollBarMove(mouseMoveEvent.clientX, true);
|
|
93
|
-
};
|
|
94
|
-
this.quill.root.parentNode.addEventListener("mousemove", this.subscriber, false);
|
|
95
|
-
document.addEventListener("mouseup", this.handleScrollBarMouseup.bind(this), false);
|
|
96
|
-
}
|
|
97
|
-
handleScrollBarMouseup(event) {
|
|
98
|
-
event.preventDefault();
|
|
99
|
-
this.quill.root.parentNode.removeEventListener("mousemove", this.subscriber);
|
|
100
|
-
document.removeEventListener("mouseup", this.handleScrollBarMouseup.bind(this), false);
|
|
101
|
-
}
|
|
102
|
-
handleWheel(event) {
|
|
103
|
-
if (event.shiftKey) {
|
|
104
|
-
const { deltaY } = event;
|
|
105
|
-
this.setScrollBarMove(deltaY, false);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
showMask(distance) {
|
|
109
|
-
if (distance >= Math.floor(this.maxBarLeft)) {
|
|
110
|
-
index.css(this.leftMask, { display: "block" });
|
|
111
|
-
} else if (distance <= 0) {
|
|
112
|
-
index.css(this.leftMask, { display: "none" });
|
|
113
|
-
} else {
|
|
114
|
-
index.css(this.leftMask, { display: "block" });
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
getLimitedDistance(distance) {
|
|
118
|
-
if (distance >= Math.floor(this.maxBarLeft)) {
|
|
119
|
-
distance = this.maxBarLeft;
|
|
120
|
-
} else if (distance <= 0) {
|
|
121
|
-
distance = 0;
|
|
122
|
-
}
|
|
123
|
-
return distance;
|
|
124
|
-
}
|
|
125
|
-
updateScrollBar() {
|
|
126
|
-
var _a;
|
|
127
|
-
if (!((_a = this.table) == null ? void 0 : _a.parentNode)) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
const tableRect = this.table.getBoundingClientRect();
|
|
131
|
-
const tableViewRect = this.table.parentNode.getBoundingClientRect();
|
|
132
|
-
const tableMoveDistance = tableRect.width - tableViewRect.width;
|
|
133
|
-
this.tableRect = tableRect;
|
|
134
|
-
this.tableViewRect = tableViewRect;
|
|
135
|
-
this.tableMoveDistance = tableMoveDistance;
|
|
136
|
-
this.oldRootScrollTop = this.quill.root.scrollTop;
|
|
137
|
-
if (tableMoveDistance > 0) {
|
|
138
|
-
this.createScrollBar();
|
|
139
|
-
} else {
|
|
140
|
-
this.destroyScrollBar();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
createScrollBar() {
|
|
144
|
-
const parent = this.quill.root.parentNode;
|
|
145
|
-
const containerRect = parent.getBoundingClientRect();
|
|
146
|
-
this.containerRect = containerRect;
|
|
147
|
-
index.css(this.columnCtrlPanel, {
|
|
148
|
-
left: `${this.tableViewRect.left - containerRect.left - this.table.parentNode.scrollLeft}px`
|
|
149
|
-
});
|
|
150
|
-
if (this.domNode) {
|
|
151
|
-
this.domNode.remove();
|
|
152
|
-
}
|
|
153
|
-
this.domNode = document.createElement("div");
|
|
154
|
-
this.domNode.classList.add("qlbt-table-scroll-bar-panel");
|
|
155
|
-
this.scrollBar = document.createElement("div");
|
|
156
|
-
this.scrollBar.classList.add("qlbt-table-scroll-bar");
|
|
157
|
-
this.scrollBar.addEventListener("mousedown", this.handleScrollBarMouseDown.bind(this), false);
|
|
158
|
-
const scale = this.tableViewRect.width / this.tableRect.width;
|
|
159
|
-
const barWidth = this.tableViewRect.width - this.tableMoveDistance * scale;
|
|
160
|
-
index.css(this.scrollBar, { width: `${barWidth}px` });
|
|
161
|
-
this.domNode.appendChild(this.scrollBar);
|
|
162
|
-
const tableScrollLeft = this.table.parentNode.scrollLeft;
|
|
163
|
-
this.maxBarLeft = this.tableMoveDistance * scale;
|
|
164
|
-
if (tableScrollLeft) {
|
|
165
|
-
const barLeft = tableScrollLeft * scale;
|
|
166
|
-
this.showMask(barLeft);
|
|
167
|
-
index.css(this.scrollBar, { left: `${this.getLimitedDistance(barLeft)}px` });
|
|
168
|
-
}
|
|
169
|
-
const barPos = this.tableRect.top + this.tableRect.height - containerRect.top - 1;
|
|
170
|
-
this.isTableOverflow = containerRect.top + containerRect.height < this.tableRect.top + this.tableRect.height;
|
|
171
|
-
this.modulesContainer.appendChild(this.domNode);
|
|
172
|
-
index.css(this.domNode, { top: `${Math.min(containerRect.height - tableConfig.SCROLL_BAR_PANEL_HEIGHT, barPos)}px` });
|
|
173
|
-
document.addEventListener("wheel", this.handleWheel.bind(this));
|
|
174
|
-
}
|
|
175
|
-
destroyScrollBar() {
|
|
176
|
-
index.css(this.leftMask, { display: "none" });
|
|
177
|
-
this.columnCtrlPanel.removeAttribute("style");
|
|
178
|
-
this.maxBarLeft = null;
|
|
179
|
-
this.destroy();
|
|
180
|
-
}
|
|
181
|
-
destroy() {
|
|
182
|
-
if (this.domNode) {
|
|
183
|
-
this.domNode.remove();
|
|
184
|
-
}
|
|
185
|
-
this.quill.root.removeEventListener("scroll", this.handleQuillRootScroll.bind(this));
|
|
186
|
-
document.removeEventListener("wheel", this.handleWheel.bind(this));
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
exports.default = TableScrollBar;
|
|
190
|
-
//# sourceMappingURL=table-scroll-bar.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table-scroll-bar.cjs.js","sources":["../../../../../src/modules/table/modules/table-scroll-bar.ts"],"sourcesContent":["import { SCROLL_BAR_PANEL_HEIGHT } from '../table-config'\r\nimport { css } from '../utils'\r\n\r\nexport default class TableScrollBar {\r\n table: any\r\n quill: any\r\n modulesContainer: any\r\n domNode: any\r\n oldRootScrollTop: any\r\n // @ts-ignore\r\n prev: number\r\n columnToolDomNode: any\r\n columnCtrlPanel: any\r\n leftMask: any\r\n tableViewRect: any\r\n tableRect: any\r\n containerRect: any\r\n subscriber: any\r\n // @ts-ignore\r\n tableMoveDistance: number\r\n // @ts-ignore\r\n maxBarLeft: number\r\n // @ts-ignore\r\n scrollBar: Element\r\n // @ts-ignore\r\n isTableOverflow: boolean // 表格是否溢出开关,判断开关值后只改变样式一次,不重复修改\r\n\r\n constructor(table, quill, dom) {\r\n if (!table) {\r\n return\r\n }\r\n this.table = table\r\n this.quill = quill\r\n this.modulesContainer = dom\r\n this.domNode = null\r\n this.oldRootScrollTop = this.quill.root.scrollTop\r\n this.prev = 0\r\n\r\n const betterTableModule = this.quill.getModule('better-table')\r\n const tableColumnTool = betterTableModule.columnTool\r\n this.columnToolDomNode = tableColumnTool.domNode\r\n this.columnCtrlPanel = tableColumnTool.columnCtrlPanel\r\n this.leftMask = tableColumnTool.leftMask\r\n\r\n this.updateScrollBar()\r\n\r\n if (this.quill.root === this.quill.scrollingContainer) {\r\n this.quill.root.addEventListener('scroll', this.handleQuillRootScroll.bind(this))\r\n }\r\n }\r\n\r\n handleQuillRootScroll() {\r\n if (!this.domNode) {\r\n return\r\n }\r\n const curTableRect = this.table.getBoundingClientRect()\r\n const curContainerRect = this.quill.root.parentNode.getBoundingClientRect()\r\n const tableTop = curTableRect.top + SCROLL_BAR_PANEL_HEIGHT\r\n const tableBottom = curTableRect.top + curTableRect.height - 1\r\n const containerBottom = curContainerRect.top + curContainerRect.height\r\n if (containerBottom < tableBottom && containerBottom > tableTop) { // 表格下端溢出容器下端\r\n if (!this.isTableOverflow) {\r\n this.isTableOverflow = true\r\n css(this.domNode, {\r\n display: 'block',\r\n top: `${this.containerRect.height - SCROLL_BAR_PANEL_HEIGHT}px`,\r\n marginTop: '0px',\r\n })\r\n }\r\n }\r\n else if (containerBottom <= tableTop) { // 表格上端溢出容器下端\r\n this.isTableOverflow = false\r\n this.domNode.style.display = 'none'\r\n }\r\n else { // 表格下端在容器内\r\n this.setScrollBarToBottom()\r\n css(this.domNode, { marginTop: `${this.oldRootScrollTop - this.quill.root.scrollTop}px` })\r\n }\r\n }\r\n\r\n setScrollBarToBottom() {\r\n if (this.isTableOverflow) {\r\n this.isTableOverflow = false\r\n const barPos = this.tableRect.top + this.tableRect.height - this.containerRect.top - 1\r\n css(this.domNode, { display: 'block', top: `${barPos}px` })\r\n }\r\n }\r\n\r\n resetTableHeight(table) {\r\n if (this.domNode) {\r\n // 表格的高度改变,重置初始化tableRect的高度,但不重置其他坐标值\r\n this.tableRect.height = table.getBoundingClientRect().height\r\n this.isTableOverflow = !this.isTableOverflow\r\n this.handleQuillRootScroll()\r\n }\r\n }\r\n\r\n setScrollBarMove(pos, isMouse) {\r\n // 获取当前滑块左边距和鼠标两次事件节点之间的位移差,计算当前滑块位置及是否显示左右遮罩层,通过比例计算表格位移并赋值\r\n const currentBarLeft = Number.parseInt(getComputedStyle(this.scrollBar).left, 10)\r\n let left = isMouse ? pos - this.prev + currentBarLeft : currentBarLeft + pos\r\n this.showMask(left)\r\n left = this.getLimitedDistance(left)\r\n const scale = this.tableViewRect.width / this.tableRect.width\r\n const move = left / scale\r\n const columnCtrlPanelLeft = this.tableViewRect.left - this.containerRect.left - move\r\n css(this.scrollBar, { left: `${left}px` }) // 移动表格滚动条\r\n css(this.columnCtrlPanel, { left: `${columnCtrlPanelLeft}px` }) // 移动顶部列宽控制条\r\n this.table.parentNode.scrollLeft = move // 移动表格\r\n if (isMouse) {\r\n this.prev = pos\r\n }\r\n\r\n // fix: 拖动滚动条时修正选区位置\r\n const tableSelection = this.quill.getModule('better-table').tableSelection\r\n if (tableSelection && tableSelection.selectedTds.length) {\r\n tableSelection.refreshHelpLinesPosition()\r\n }\r\n }\r\n\r\n handleScrollBarMouseDown(mouseDownEvent) {\r\n mouseDownEvent.preventDefault()\r\n\r\n this.prev = mouseDownEvent.clientX\r\n this.subscriber = (mouseMoveEvent: any) => {\r\n mouseMoveEvent.preventDefault()\r\n mouseMoveEvent.stopPropagation()\r\n this.setScrollBarMove(mouseMoveEvent.clientX, true)\r\n }\r\n this.quill.root.parentNode.addEventListener('mousemove', this.subscriber, false)\r\n document.addEventListener('mouseup', this.handleScrollBarMouseup.bind(this), false)\r\n }\r\n\r\n handleScrollBarMouseup(event) {\r\n event.preventDefault()\r\n this.quill.root.parentNode.removeEventListener('mousemove', this.subscriber)\r\n document.removeEventListener('mouseup', this.handleScrollBarMouseup.bind(this), false)\r\n }\r\n\r\n handleWheel(event) {\r\n // 按住 Shift 滚动鼠标滚轮,可以对表格进行横向滚动\r\n if (event.shiftKey) {\r\n const { deltaY } = event // 每次滚动鼠标滚轮移动的距离\r\n this.setScrollBarMove(deltaY, false)\r\n }\r\n }\r\n\r\n showMask(distance) {\r\n // 根据当前滑块左边距判断是否显示左右遮罩层\r\n if (distance >= Math.floor(this.maxBarLeft)) {\r\n css(this.leftMask, { display: 'block' })\r\n }\r\n else if (distance <= 0) {\r\n css(this.leftMask, { display: 'none' })\r\n }\r\n else {\r\n css(this.leftMask, { display: 'block' })\r\n }\r\n }\r\n\r\n getLimitedDistance(distance) {\r\n if (distance >= Math.floor(this.maxBarLeft)) {\r\n distance = this.maxBarLeft\r\n }\r\n else if (distance <= 0) {\r\n distance = 0\r\n }\r\n return distance\r\n }\r\n\r\n updateScrollBar() {\r\n if (!this.table?.parentNode) {\r\n return\r\n }\r\n // 获取表格尺寸和表格容器尺寸\r\n const tableRect = this.table.getBoundingClientRect()\r\n const tableViewRect = this.table.parentNode.getBoundingClientRect()\r\n const tableMoveDistance = tableRect.width - tableViewRect.width // 表格最大移动距离\r\n this.tableRect = tableRect\r\n this.tableViewRect = tableViewRect\r\n this.tableMoveDistance = tableMoveDistance\r\n this.oldRootScrollTop = this.quill.root.scrollTop\r\n\r\n if (tableMoveDistance > 0) {\r\n this.createScrollBar()\r\n }\r\n else {\r\n this.destroyScrollBar()\r\n }\r\n }\r\n\r\n createScrollBar() {\r\n // 列控制条增加表格相应位移\r\n const parent = this.quill.root.parentNode\r\n const containerRect = parent.getBoundingClientRect() // 编辑器容器宽度\r\n this.containerRect = containerRect\r\n css(this.columnCtrlPanel, {\r\n left: `${this.tableViewRect.left - containerRect.left - this.table.parentNode.scrollLeft}px`,\r\n })\r\n\r\n // 创建滚动条\r\n if (this.domNode) {\r\n this.domNode.remove()\r\n }\r\n this.domNode = document.createElement('div')\r\n this.domNode.classList.add('qlbt-table-scroll-bar-panel')\r\n this.scrollBar = document.createElement('div')\r\n this.scrollBar.classList.add('qlbt-table-scroll-bar')\r\n this.scrollBar.addEventListener('mousedown', this.handleScrollBarMouseDown.bind(this), false)\r\n const scale = this.tableViewRect.width / this.tableRect.width\r\n const barWidth = this.tableViewRect.width - this.tableMoveDistance * scale // 滑块宽度\r\n css(this.scrollBar, { width: `${barWidth}px` })\r\n this.domNode.appendChild(this.scrollBar)\r\n\r\n // 判断当前表格是否存在位移,如存在通过比例计算滑块当前位移并赋值\r\n const tableScrollLeft = this.table.parentNode.scrollLeft\r\n this.maxBarLeft = this.tableMoveDistance * scale // 滑块最大移动距离\r\n if (tableScrollLeft) {\r\n const barLeft = tableScrollLeft * scale\r\n this.showMask(barLeft)\r\n css(this.scrollBar, { left: `${this.getLimitedDistance(barLeft)}px` })\r\n }\r\n\r\n // 将滚动条插入到 table control panel 中\r\n const barPos = this.tableRect.top + this.tableRect.height - containerRect.top - 1\r\n this.isTableOverflow = containerRect.top + containerRect.height < this.tableRect.top + this.tableRect.height\r\n this.modulesContainer.appendChild(this.domNode)\r\n css(this.domNode, { top: `${Math.min(containerRect.height - SCROLL_BAR_PANEL_HEIGHT, barPos)}px` })\r\n\r\n // 绑定鼠标滚轮事件:Shift+鼠标滚轮,滚动表格横向滚动条\r\n document.addEventListener('wheel', this.handleWheel.bind(this))\r\n }\r\n\r\n destroyScrollBar() {\r\n css(this.leftMask, { display: 'none' })\r\n this.columnCtrlPanel.removeAttribute('style')\r\n this.maxBarLeft = null\r\n this.destroy()\r\n }\r\n\r\n destroy() {\r\n if (this.domNode) {\r\n this.domNode.remove()\r\n }\r\n this.quill.root.removeEventListener('scroll', this.handleQuillRootScroll.bind(this))\r\n document.removeEventListener('wheel', this.handleWheel.bind(this))\r\n }\r\n}\r\n"],"names":["SCROLL_BAR_PANEL_HEIGHT","css"],"mappings":";;;;AAGA,MAAqB,eAAe;AAAA;AAAA,EAwBlC,YAAY,OAAO,OAAO,KAAK;AAC7B,QAAI,CAAC,OAAO;AACV;AAAA,IAAA;AAEF,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,mBAAmB;AACxB,SAAK,UAAU;AACV,SAAA,mBAAm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AK,OAAO;AAC9CA,UAAAA,IAAI,KAAK,SAAS,EAAE,KAAK,GAAG,KAAK,IAAI,cAAc,SAASD,YAAA,yBAAyB,MAAM,CAAC,MAAM;AAGlG,aAAS,iBAAiB,SAAS,KAAK,YAAY,KAAK,IAAI,CAAC;AAAA,EAAA;AAAA,EAGhE,mBAAmB;AACjBC,UAAAA,IAAI,KAAK,UAAU,EAAE,SAAS,QAAQ;AACjC,SAAA,gBAAgB,gBAAgB,OAAO;AAC5C,SAAK,aAAa;AAClB,SAAK,QAAQ;AAAA,EAAA;AAAA,EAGf,UAAU;AACR,QAAI,KAAK,SAAS;AAChB,WAAK,QAAQ,OAAO;AAAA,IAAA;AAEjB,SAAA,MAAM,KAAK,oBAAoB,UAAU,KAAK,sBAAsB,KAAK,IAAI,CAAC;AACnF,aAAS,oBAAoB,SAAS,KAAK,YAAY,KAAK,IAAI,CAAC;AAAA,EAAA;AAErE;;"}
|
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const Quill = require("quill");
|
|
4
|
-
const table = require("../formats/table.cjs.js");
|
|
5
|
-
const tableConfig = require("../table-config.cjs.js");
|
|
6
|
-
const index = require("../utils/index.cjs.js");
|
|
7
|
-
class TableSelection {
|
|
8
|
-
constructor(table2, quill, dom) {
|
|
9
|
-
if (!table2) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
this.table = table2;
|
|
13
|
-
this.quill = quill;
|
|
14
|
-
this.modulesContainer = dom;
|
|
15
|
-
this.parent = this.quill.root.parentNode;
|
|
16
|
-
this.boundary = {};
|
|
17
|
-
this.selectedTds = [];
|
|
18
|
-
this.dragging = false;
|
|
19
|
-
this.preSelectedTable = null;
|
|
20
|
-
this.oldRootScrollTop = this.quill.root.scrollTop;
|
|
21
|
-
this.selectingHandler = this.mouseDownHandler.bind(this);
|
|
22
|
-
this.tdEditHandler = this.setTdEditable.bind(this);
|
|
23
|
-
this.tdResizeHandler = this.resizeTd.bind(this);
|
|
24
|
-
this.helpLinesInitial();
|
|
25
|
-
this.isEditorHasScrollBar();
|
|
26
|
-
this.quill.root.parentNode.addEventListener("mousedown", this.selectingHandler, false);
|
|
27
|
-
this.quill.on("text-change", this.tdResizeHandler);
|
|
28
|
-
if (this.quill.root === this.quill.scrollingContainer) {
|
|
29
|
-
this.quill.root.addEventListener("scroll", this.handleQuillRootScroll.bind(this));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
handleQuillRootScroll() {
|
|
33
|
-
tableConfig.LINE_POSITIONS.forEach((direction) => {
|
|
34
|
-
const selectionLine = this[direction];
|
|
35
|
-
if (selectionLine) {
|
|
36
|
-
selectionLine.style.marginTop = `${this.oldRootScrollTop - this.quill.root.scrollTop}px`;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
isEditorHasScrollBar() {
|
|
41
|
-
if (this.quill.root.scrollHeight > this.quill.root.clientHeight) {
|
|
42
|
-
index.css(this.modulesContainer, { width: "calc(100% - 23px)" });
|
|
43
|
-
} else {
|
|
44
|
-
this.modulesContainer.removeAttribute("style");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
helpLinesInitial() {
|
|
48
|
-
tableConfig.LINE_POSITIONS.forEach((direction) => {
|
|
49
|
-
this[direction] = document.createElement("div");
|
|
50
|
-
this[direction].classList.add("qlbt-selection-line");
|
|
51
|
-
if (direction === "left") {
|
|
52
|
-
this[direction].classList.add("qlbt-selection-line-first");
|
|
53
|
-
const ctrlPointLeft = document.createElement("div");
|
|
54
|
-
this[direction].appendChild(ctrlPointLeft);
|
|
55
|
-
}
|
|
56
|
-
if (direction === "bottom") {
|
|
57
|
-
this[direction].classList.add("qlbt-selection-line-last");
|
|
58
|
-
const ctrlPointRight = document.createElement("div");
|
|
59
|
-
this[direction].appendChild(ctrlPointRight);
|
|
60
|
-
}
|
|
61
|
-
index.css(this[direction], {
|
|
62
|
-
"position": "absolute",
|
|
63
|
-
"display": "none",
|
|
64
|
-
"background-color": tableConfig.PRIMARY_COLOR
|
|
65
|
-
});
|
|
66
|
-
this.modulesContainer.appendChild(this[direction]);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
mouseDownHandler(e) {
|
|
70
|
-
if (e.button !== 0) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const self = this;
|
|
74
|
-
const betterTableModule = this.quill.getModule("better-table");
|
|
75
|
-
const tableColumnTool = betterTableModule.columnTool;
|
|
76
|
-
if (tableColumnTool.activeToolCell) {
|
|
77
|
-
tableColumnTool.activeToolCell.classList.remove("qlbt-tool-cell-on");
|
|
78
|
-
tableColumnTool.activeToolCell = null;
|
|
79
|
-
}
|
|
80
|
-
if (e.target.closest(".quill-better-table")) {
|
|
81
|
-
if (e.shiftKey) {
|
|
82
|
-
this.endTd = e.target.closest("td[data-row]");
|
|
83
|
-
this.drawSelection(this, true);
|
|
84
|
-
if (this.startTd !== this.endTd) {
|
|
85
|
-
this.quill.blur();
|
|
86
|
-
}
|
|
87
|
-
} else {
|
|
88
|
-
this.startTd = e.target.closest("td[data-row]");
|
|
89
|
-
this.drawSelection(this, false);
|
|
90
|
-
this.dragging = true;
|
|
91
|
-
this.parent.addEventListener("mousemove", mouseMoveHandler, false);
|
|
92
|
-
document.addEventListener("mouseup", mouseUpHandler, false);
|
|
93
|
-
}
|
|
94
|
-
} else if (e.target.closest(".qlbt-selection-line")) {
|
|
95
|
-
this.parent.addEventListener("mousemove", mouseMoveHandler, false);
|
|
96
|
-
document.addEventListener("mouseup", mouseUpHandler, false);
|
|
97
|
-
}
|
|
98
|
-
function mouseMoveHandler(event) {
|
|
99
|
-
event.stopPropagation();
|
|
100
|
-
if (event.button !== 0 || !event.target.closest(".quill-better-table")) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
self.endTd = event.target.closest("td[data-row]");
|
|
104
|
-
if (!self.endTd) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
self.drawSelection(self, true);
|
|
108
|
-
if (self.startTd !== self.endTd) {
|
|
109
|
-
self.quill.blur();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
function mouseUpHandler() {
|
|
113
|
-
self.parent.removeEventListener("mousemove", mouseMoveHandler, false);
|
|
114
|
-
document.removeEventListener("mouseup", mouseUpHandler, false);
|
|
115
|
-
self.dragging = false;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
drawSelection(self, end) {
|
|
119
|
-
self.startTdRect = index.getRelativeRect(self.startTd.getBoundingClientRect(), self.quill.root.parentNode);
|
|
120
|
-
let endTdRect = self.startTdRect;
|
|
121
|
-
if (end) {
|
|
122
|
-
self.endTdRect = index.getRelativeRect(self.endTd.getBoundingClientRect(), self.quill.root.parentNode);
|
|
123
|
-
endTdRect = self.endTdRect;
|
|
124
|
-
}
|
|
125
|
-
self.boundary = computeBoundaryFromRects(self.startTdRect, endTdRect);
|
|
126
|
-
self.selectedTds = self.computeSelectedTds();
|
|
127
|
-
self.repositionHelpLines();
|
|
128
|
-
}
|
|
129
|
-
setTdEditable(e) {
|
|
130
|
-
if (!this.editTd) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
this.parent.removeEventListener("keypress", this.tdEditHandler, false);
|
|
134
|
-
const dom = this.editTd.domNode;
|
|
135
|
-
dom.removeEventListener("click", this.tdEditHandler, false);
|
|
136
|
-
dom.classList.add("editing-select-able");
|
|
137
|
-
dom.setAttribute("contenteditable", true);
|
|
138
|
-
if (e.type === "keypress") {
|
|
139
|
-
if (dom.childNodes.length > 1 || dom.firstChild.innerHTML !== "<br>") {
|
|
140
|
-
const blank = dom.firstChild.cloneNode();
|
|
141
|
-
blank.innerHTML = "<br>";
|
|
142
|
-
dom.innerHTML = "";
|
|
143
|
-
dom.appendChild(blank);
|
|
144
|
-
}
|
|
145
|
-
dom.focus();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
resizeTd() {
|
|
149
|
-
if (!this.editTd || this.left && !this.left.offsetParent) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
if (this.selectedTds.length > 1) {
|
|
153
|
-
this.refreshHelpLinesPosition();
|
|
154
|
-
} else {
|
|
155
|
-
const dom = this.editTd.domNode;
|
|
156
|
-
const domRect = index.getRelativeRect(dom.getBoundingClientRect(), this.quill.root.parentNode);
|
|
157
|
-
this.boundary = computeBoundaryFromRects(domRect, domRect);
|
|
158
|
-
this.repositionHelpLines();
|
|
159
|
-
}
|
|
160
|
-
this.isEditorHasScrollBar();
|
|
161
|
-
const betterTableModule = this.quill.getModule("better-table");
|
|
162
|
-
const tableColumnTool = betterTableModule.columnTool;
|
|
163
|
-
if (tableColumnTool) {
|
|
164
|
-
tableColumnTool.updateRowToolCells();
|
|
165
|
-
const tableViewRect = this.table.parentNode.getBoundingClientRect();
|
|
166
|
-
if (tableColumnTool.leftMask) {
|
|
167
|
-
index.css(tableColumnTool.leftMask, { height: `${tableViewRect.height + 50}px` });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
const tableScrollBar = betterTableModule.tableScrollBar;
|
|
171
|
-
tableScrollBar.resetTableHeight(this.table);
|
|
172
|
-
}
|
|
173
|
-
resetTd(e) {
|
|
174
|
-
const dom = e.target;
|
|
175
|
-
dom.classList.remove("editing-select-able");
|
|
176
|
-
dom.setAttribute("contenteditable", false);
|
|
177
|
-
dom.removeAttribute("contenteditable");
|
|
178
|
-
}
|
|
179
|
-
correctBoundary() {
|
|
180
|
-
const tableContainer = Quill.find(this.table);
|
|
181
|
-
const tableCells = tableContainer.descendants(table.TableCell);
|
|
182
|
-
tableCells.forEach((tableCell) => {
|
|
183
|
-
const { x, y, width, height } = index.getRelativeRect(tableCell.domNode.getBoundingClientRect(), this.quill.root.parentNode);
|
|
184
|
-
const isCellIntersected = (x + tableConfig.ERROR_LIMIT >= this.boundary.x && x + tableConfig.ERROR_LIMIT <= this.boundary.x1 || x - tableConfig.ERROR_LIMIT + width >= this.boundary.x && x - tableConfig.ERROR_LIMIT + width <= this.boundary.x1) && (y + tableConfig.ERROR_LIMIT >= this.boundary.y && y + tableConfig.ERROR_LIMIT <= this.boundary.y1 || y - tableConfig.ERROR_LIMIT + height >= this.boundary.y && y - tableConfig.ERROR_LIMIT + height <= this.boundary.y1);
|
|
185
|
-
if (isCellIntersected) {
|
|
186
|
-
this.boundary = computeBoundaryFromRects(this.boundary, { x, y, width, height });
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
computeSelectedTds() {
|
|
191
|
-
const tableContainer = Quill.find(this.table);
|
|
192
|
-
const tableCells = tableContainer.descendants(table.TableCell);
|
|
193
|
-
const result = tableCells.reduce((selectedCells, tableCell) => {
|
|
194
|
-
const { x, y, width, height } = index.getRelativeRect(tableCell.domNode.getBoundingClientRect(), this.quill.root.parentNode);
|
|
195
|
-
const isCellIncluded = x + tableConfig.ERROR_LIMIT >= this.boundary.x && x - tableConfig.ERROR_LIMIT + width <= this.boundary.x1 && y + tableConfig.ERROR_LIMIT >= this.boundary.y && y - tableConfig.ERROR_LIMIT + height <= this.boundary.y1;
|
|
196
|
-
if (isCellIncluded) {
|
|
197
|
-
selectedCells.push(tableCell);
|
|
198
|
-
}
|
|
199
|
-
return selectedCells;
|
|
200
|
-
}, []);
|
|
201
|
-
if (result.length === 1 && this.editTd !== result[0]) {
|
|
202
|
-
const resetTds = this.table.querySelectorAll("td[contenteditable=true]");
|
|
203
|
-
resetTds.forEach((td) => this.resetTd({ target: td }));
|
|
204
|
-
this.editTd = result[0];
|
|
205
|
-
this.editTd.domNode.addEventListener("mousedown", this.tdEditHandler, false);
|
|
206
|
-
this.parent.addEventListener("keypress", this.tdEditHandler, false);
|
|
207
|
-
}
|
|
208
|
-
return result;
|
|
209
|
-
}
|
|
210
|
-
repositionHelpLines() {
|
|
211
|
-
this.oldRootScrollTop = this.quill.root.scrollTop;
|
|
212
|
-
if (!this.left) {
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
index.css(this.left, {
|
|
216
|
-
"display": "block",
|
|
217
|
-
"left": `${this.boundary.x - 1}px`,
|
|
218
|
-
"top": `${this.boundary.y}px`,
|
|
219
|
-
"height": `${this.boundary.height + 1}px`,
|
|
220
|
-
"width": "1px",
|
|
221
|
-
"margin-top": "0px"
|
|
222
|
-
});
|
|
223
|
-
index.css(this.right, {
|
|
224
|
-
"display": "block",
|
|
225
|
-
"left": `${this.boundary.x1}px`,
|
|
226
|
-
"top": `${this.boundary.y - 1}px`,
|
|
227
|
-
"height": `${this.boundary.height + 1}px`,
|
|
228
|
-
"width": "1px",
|
|
229
|
-
"margin-top": "0px"
|
|
230
|
-
});
|
|
231
|
-
index.css(this.top, {
|
|
232
|
-
"display": "block",
|
|
233
|
-
"left": `${this.boundary.x - 1}px`,
|
|
234
|
-
"top": `${this.boundary.y - 1}px`,
|
|
235
|
-
"width": `${this.boundary.width + 1}px`,
|
|
236
|
-
"height": "1px",
|
|
237
|
-
"margin-top": "0px"
|
|
238
|
-
});
|
|
239
|
-
index.css(this.bottom, {
|
|
240
|
-
"display": "block",
|
|
241
|
-
"left": `${this.boundary.x - 1}px`,
|
|
242
|
-
"top": `${this.boundary.y1}px`,
|
|
243
|
-
"width": `${this.boundary.width + 1}px`,
|
|
244
|
-
"height": "1px",
|
|
245
|
-
"margin-top": "0px"
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
// based on selectedTds compute positions of help lines
|
|
249
|
-
// It is useful when selectedTds are not changed
|
|
250
|
-
refreshHelpLinesPosition() {
|
|
251
|
-
const startRect = index.getRelativeRect(this.selectedTds[0].domNode.getBoundingClientRect(), this.quill.root.parentNode);
|
|
252
|
-
const endRect = index.getRelativeRect(
|
|
253
|
-
this.selectedTds[this.selectedTds.length - 1].domNode.getBoundingClientRect(),
|
|
254
|
-
this.quill.root.parentNode
|
|
255
|
-
);
|
|
256
|
-
this.boundary = computeBoundaryFromRects(startRect, endRect);
|
|
257
|
-
this.repositionHelpLines();
|
|
258
|
-
}
|
|
259
|
-
destroy() {
|
|
260
|
-
const resetTds = this.table.querySelectorAll("td[contenteditable=true]");
|
|
261
|
-
resetTds.forEach((td) => this.resetTd({ target: td }));
|
|
262
|
-
tableConfig.LINE_POSITIONS.forEach((direction) => {
|
|
263
|
-
if (this[direction]) {
|
|
264
|
-
this[direction].remove();
|
|
265
|
-
this[direction] = null;
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
this.quill.root.parentNode.removeEventListener("mousedown", this.selectingHandler, false);
|
|
269
|
-
delete this.editTd;
|
|
270
|
-
return null;
|
|
271
|
-
}
|
|
272
|
-
setSelection(startRect, endRect) {
|
|
273
|
-
this.boundary = computeBoundaryFromRects(
|
|
274
|
-
index.getRelativeRect(startRect, this.quill.root.parentNode),
|
|
275
|
-
index.getRelativeRect(endRect, this.quill.root.parentNode)
|
|
276
|
-
);
|
|
277
|
-
this.correctBoundary();
|
|
278
|
-
this.selectedTds = this.computeSelectedTds();
|
|
279
|
-
this.repositionHelpLines();
|
|
280
|
-
}
|
|
281
|
-
clearSelection() {
|
|
282
|
-
const resetTds = this.table.querySelectorAll("td[contenteditable=true]");
|
|
283
|
-
resetTds.forEach((td) => this.resetTd({ target: td }));
|
|
284
|
-
this.boundary = {};
|
|
285
|
-
this.selectedTds = [];
|
|
286
|
-
tableConfig.LINE_POSITIONS.forEach((direction) => {
|
|
287
|
-
if (this[direction]) {
|
|
288
|
-
index.css(this[direction], {
|
|
289
|
-
display: "none"
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
function computeBoundaryFromRects(startRect, endRect) {
|
|
296
|
-
const x = Math.min(startRect.x, endRect.x, startRect.x + startRect.width - 1, endRect.x + endRect.width - 1);
|
|
297
|
-
const x1 = Math.max(startRect.x, endRect.x, startRect.x + startRect.width - 1, endRect.x + endRect.width - 1);
|
|
298
|
-
const y = Math.min(startRect.y, endRect.y, startRect.y + startRect.height - 1, endRect.y + endRect.height - 1);
|
|
299
|
-
const y1 = Math.max(startRect.y, endRect.y, startRect.y + startRect.height - 1, endRect.y + endRect.height - 1);
|
|
300
|
-
const width = x1 - x;
|
|
301
|
-
const height = y1 - y;
|
|
302
|
-
return { x, x1, y, y1, width, height };
|
|
303
|
-
}
|
|
304
|
-
exports.default = TableSelection;
|
|
305
|
-
//# sourceMappingURL=table-selection.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table-selection.cjs.js","sources":["../../../../../src/modules/table/modules/table-selection.ts"],"sourcesContent":["import Quill from 'quill'\r\nimport { TableCell } from '../formats/table'\r\nimport { ERROR_LIMIT, LINE_POSITIONS, PRIMARY_COLOR } from '../table-config'\r\nimport { css, getRelativeRect } from '../utils'\r\n\r\nexport default class TableSelection {\r\n table: any\r\n quill: any\r\n modulesContainer: any\r\n parent: any\r\n boundary: any\r\n // @ts-ignore\r\n selectedTds: any[]\r\n // @ts-ignore\r\n dragging: boolean\r\n preSelectedTable: any\r\n oldRootScrollTop: any\r\n selectingHandler: any\r\n tdEditHandler: any\r\n tdResizeHandler: any\r\n endTd: any\r\n startTd: any\r\n editTd: any\r\n left: any\r\n bottom: any\r\n top: any\r\n right: any\r\n\r\n constructor(table, quill, dom) {\r\n if (!table) {\r\n return null\r\n }\r\n this.table = table\r\n this.quill = quill\r\n this.modulesContainer = dom\r\n this.parent = this.quill.root.parentNode\r\n this.boundary = {} // params for selected square\r\n this.selectedTds = [] // array for selected table-cells\r\n this.dragging = false\r\n this.preSelectedTable = null\r\n this.oldRootScrollTop = this.quill.root.scrollTop\r\n\r\n this.selectingHandler = this.mouseDownHandler.bind(this)\r\n\r\n this.tdEditHandler = this.setTdEditable.bind(this)\r\n this.tdResizeHandler = this.resizeTd.bind(this)\r\n\r\n this.helpLinesInitial()\r\n this.isEditorHasScrollBar()\r\n\r\n this.quill.root.parentNode.addEventListener('mousedown', this.selectingHandler, false)\r\n this.quill.on('text-change', this.tdResizeHandler)\r\n if (this.quill.root === this.quill.scrollingContainer) {\r\n this.quill.root.addEventListener('scroll', this.handleQuillRootScroll.bind(this))\r\n }\r\n }\r\n\r\n handleQuillRootScroll() {\r\n LINE_POSITIONS.forEach((direction) => {\r\n const selectionLine = this[direction]\r\n if (selectionLine) {\r\n selectionLine.style.marginTop = `${this.oldRootScrollTop - this.quill.root.scrollTop}px`\r\n }\r\n })\r\n }\r\n\r\n isEditorHasScrollBar() {\r\n if (this.quill.root.scrollHeight > this.quill.root.clientHeight) {\r\n css(this.modulesContainer, { width: 'calc(100% - 23px)' })\r\n }\r\n else {\r\n this.modulesContainer.removeAttribute('style')\r\n }\r\n }\r\n\r\n helpLinesInitial() {\r\n LINE_POSITIONS.forEach((direction) => {\r\n this[direction] = document.createElement('div')\r\n this[direction].classList.add('qlbt-selection-line')\r\n if (direction === 'left') {\r\n this[direction].classList.add('qlbt-selection-line-first')\r\n const ctrlPointLeft = document.createElement('div')\r\n this[direction].appendChild(ctrlPointLeft)\r\n }\r\n if (direction === 'bottom') {\r\n this[direction].classList.add('qlbt-selection-line-last')\r\n const ctrlPointRight = document.createElement('div')\r\n this[direction].appendChild(ctrlPointRight)\r\n }\r\n css(this[direction], {\r\n 'position': 'absolute',\r\n 'display': 'none',\r\n 'background-color': PRIMARY_COLOR,\r\n })\r\n this.modulesContainer.appendChild(this[direction])\r\n })\r\n }\r\n\r\n mouseDownHandler(e) {\r\n if (e.button !== 0) {\r\n return\r\n }\r\n const self: any = this\r\n const betterTableModule = this.quill.getModule('better-table')\r\n const tableColumnTool = betterTableModule.columnTool\r\n if (tableColumnTool.activeToolCell) {\r\n tableColumnTool.activeToolCell.classList.remove('qlbt-tool-cell-on')\r\n tableColumnTool.activeToolCell = null\r\n }\r\n if (e.target.closest('.quill-better-table')) {\r\n if (e.shiftKey) {\r\n this.endTd = e.target.closest('td[data-row]')\r\n this.drawSelection(this, true)\r\n // avoid select text in multiple table-cell\r\n if (this.startTd !== this.endTd) {\r\n this.quill.blur()\r\n }\r\n }\r\n else {\r\n this.startTd = e.target.closest('td[data-row]')\r\n this.drawSelection(this, false)\r\n this.dragging = true\r\n\r\n this.parent.addEventListener('mousemove', mouseMoveHandler, false)\r\n document.addEventListener('mouseup', mouseUpHandler, false)\r\n }\r\n }\r\n else if (e.target.closest('.qlbt-selection-line')) {\r\n this.parent.addEventListener('mousemove', mouseMoveHandler, false)\r\n document.addEventListener('mouseup', mouseUpHandler, false)\r\n }\r\n\r\n function mouseMoveHandler(event) {\r\n event.stopPropagation()\r\n\r\n if (event.button !== 0 || !event.target.closest('.quill-better-table')) {\r\n return\r\n }\r\n self.endTd = event.target.closest('td[data-row]')\r\n if (!self.endTd) {\r\n return\r\n }\r\n self.drawSelection(self, true)\r\n // avoid select text in multiple table-cell\r\n if (self.startTd !== self.endTd) {\r\n self.quill.blur()\r\n }\r\n }\r\n\r\n function mouseUpHandler() {\r\n self.parent.removeEventListener('mousemove', mouseMoveHandler, false)\r\n document.removeEventListener('mouseup', mouseUpHandler, false)\r\n self.dragging = false\r\n }\r\n }\r\n\r\n drawSelection(self, end) {\r\n // fix: 如果滚动条拖动,startTd的位置已经改变了,需要重置startTdRect\r\n self.startTdRect = getRelativeRect(self.startTd.getBoundingClientRect(), self.quill.root.parentNode)\r\n let endTdRect = self.startTdRect\r\n if (end) {\r\n self.endTdRect = getRelativeRect(self.endTd.getBoundingClientRect(), self.quill.root.parentNode)\r\n endTdRect = self.endTdRect\r\n }\r\n self.boundary = computeBoundaryFromRects(self.startTdRect, endTdRect)\r\n self.selectedTds = self.computeSelectedTds()\r\n self.repositionHelpLines()\r\n }\r\n\r\n setTdEditable(e) {\r\n if (!this.editTd) {\r\n return\r\n }\r\n this.parent.removeEventListener('keypress', this.tdEditHandler, false)\r\n const dom = this.editTd.domNode\r\n dom.removeEventListener('click', this.tdEditHandler, false)\r\n dom.classList.add('editing-select-able')\r\n dom.setAttribute('contenteditable', true)\r\n if (e.type === 'keypress') {\r\n if (dom.childNodes.length > 1 || dom.firstChild.innerHTML !== '<br>') {\r\n const blank = dom.firstChild.cloneNode()\r\n blank.innerHTML = '<br>'\r\n dom.innerHTML = ''\r\n dom.appendChild(blank)\r\n }\r\n dom.focus()\r\n }\r\n }\r\n\r\n resizeTd() {\r\n if (!this.editTd || (this.left && !this.left.offsetParent)) {\r\n return\r\n }\r\n if (this.selectedTds.length > 1) {\r\n this.refreshHelpLinesPosition()\r\n }\r\n else {\r\n const dom = this.editTd.domNode\r\n const domRect = getRelativeRect(dom.getBoundingClientRect(), this.quill.root.parentNode)\r\n this.boundary = computeBoundaryFromRects(domRect, domRect)\r\n this.repositionHelpLines()\r\n }\r\n\r\n // 判断编辑器是否有滚动条,调整遮罩宽度\r\n this.isEditorHasScrollBar()\r\n\r\n // 更新行高 更新滑块位置\r\n const betterTableModule = this.quill.getModule('better-table')\r\n const tableColumnTool = betterTableModule.columnTool\r\n if (tableColumnTool) {\r\n tableColumnTool.updateRowToolCells()\r\n const tableViewRect = this.table.parentNode.getBoundingClientRect()\r\n if (tableColumnTool.leftMask) {\r\n css(tableColumnTool.leftMask, { height: `${tableViewRect.height + 50}px` })\r\n }\r\n }\r\n\r\n const tableScrollBar = betterTableModule.tableScrollBar\r\n tableScrollBar.resetTableHeight(this.table)\r\n }\r\n\r\n resetTd(e) {\r\n const dom = e.target\r\n dom.classList.remove('editing-select-able')\r\n dom.setAttribute('contenteditable', false)\r\n dom.removeAttribute('contenteditable')\r\n }\r\n\r\n correctBoundary() {\r\n const tableContainer = Quill.find(this.table)\r\n const tableCells = tableContainer.descendants(TableCell)\r\n\r\n tableCells.forEach((tableCell) => {\r\n const { x, y, width, height } = getRelativeRect(tableCell.domNode.getBoundingClientRect(), this.quill.root.parentNode)\r\n const isCellIntersected\r\n = ((x + ERROR_LIMIT >= this.boundary.x && x + ERROR_LIMIT <= this.boundary.x1)\r\n || (x - ERROR_LIMIT + width >= this.boundary.x && x - ERROR_LIMIT + width <= this.boundary.x1))\r\n && ((y + ERROR_LIMIT >= this.boundary.y && y + ERROR_LIMIT <= this.boundary.y1)\r\n || (y - ERROR_LIMIT + height >= this.boundary.y && y - ERROR_LIMIT + height <= this.boundary.y1))\r\n if (isCellIntersected) {\r\n this.boundary = computeBoundaryFromRects(this.boundary, { x, y, width, height })\r\n }\r\n })\r\n }\r\n\r\n computeSelectedTds() {\r\n const tableContainer = Quill.find(this.table)\r\n const tableCells = tableContainer.descendants(TableCell)\r\n\r\n const result = tableCells.reduce((selectedCells, tableCell) => {\r\n const { x, y, width, height } = getRelativeRect(tableCell.domNode.getBoundingClientRect(), this.quill.root.parentNode)\r\n const isCellIncluded\r\n = x + ERROR_LIMIT >= this.boundary.x\r\n && x - ERROR_LIMIT + width <= this.boundary.x1\r\n && y + ERROR_LIMIT >= this.boundary.y\r\n && y - ERROR_LIMIT + height <= this.boundary.y1\r\n\r\n if (isCellIncluded) {\r\n selectedCells.push(tableCell)\r\n }\r\n\r\n return selectedCells\r\n }, [])\r\n\r\n if (result.length === 1 && this.editTd !== result[0]) {\r\n const resetTds = this.table.querySelectorAll('td[contenteditable=true]')\r\n resetTds.forEach(td => this.resetTd({ target: td }))\r\n this.editTd = result[0]\r\n this.editTd.domNode.addEventListener('mousedown', this.tdEditHandler, false)\r\n this.parent.addEventListener('keypress', this.tdEditHandler, false)\r\n }\r\n\r\n return result\r\n }\r\n\r\n repositionHelpLines() {\r\n this.oldRootScrollTop = this.quill.root.scrollTop\r\n if (!this.left) {\r\n return\r\n }\r\n\r\n css(this.left, {\r\n 'display': 'block',\r\n 'left': `${this.boundary.x - 1}px`,\r\n 'top': `${this.boundary.y}px`,\r\n 'height': `${this.boundary.height + 1}px`,\r\n 'width': '1px',\r\n 'margin-top': '0px',\r\n })\r\n\r\n css(this.right, {\r\n 'display': 'block',\r\n 'left': `${this.boundary.x1}px`,\r\n 'top': `${this.boundary.y - 1}px`,\r\n 'height': `${this.boundary.height + 1}px`,\r\n 'width': '1px',\r\n 'margin-top': '0px',\r\n })\r\n\r\n css(this.top, {\r\n 'display': 'block',\r\n 'left': `${this.boundary.x - 1}px`,\r\n 'top': `${this.boundary.y - 1}px`,\r\n 'width': `${this.boundary.width + 1}px`,\r\n 'height': '1px',\r\n 'margin-top': '0px',\r\n })\r\n\r\n css(this.bottom, {\r\n 'display': 'block',\r\n 'left': `${this.boundary.x - 1}px`,\r\n 'top': `${this.boundary.y1}px`,\r\n 'width': `${this.boundary.width + 1}px`,\r\n 'height': '1px',\r\n 'margin-top': '0px',\r\n })\r\n }\r\n\r\n // based on selectedTds compute positions of help lines\r\n // It is useful when selectedTds are not changed\r\n refreshHelpLinesPosition() {\r\n const startRect = getRelativeRect(this.selectedTds[0].domNode.getBoundingClientRect(), this.quill.root.parentNode)\r\n const endRect = getRelativeRect(\r\n this.selectedTds[this.selectedTds.length - 1].domNode.getBoundingClientRect(),\r\n this.quill.root.parentNode,\r\n )\r\n this.boundary = computeBoundaryFromRects(startRect, endRect)\r\n this.repositionHelpLines()\r\n }\r\n\r\n destroy() {\r\n const resetTds = this.table.querySelectorAll('td[contenteditable=true]')\r\n resetTds.forEach(td => this.resetTd({ target: td }))\r\n\r\n LINE_POSITIONS.forEach((direction) => {\r\n if (this[direction]) {\r\n this[direction].remove()\r\n this[direction] = null\r\n }\r\n })\r\n\r\n this.quill.root.parentNode.removeEventListener('mousedown', this.selectingHandler, false)\r\n\r\n delete this.editTd\r\n\r\n return null\r\n }\r\n\r\n setSelection(startRect, endRect) {\r\n this.boundary = computeBoundaryFromRects(\r\n getRelativeRect(startRect, this.quill.root.parentNode),\r\n getRelativeRect(endRect, this.quill.root.parentNode),\r\n )\r\n this.correctBoundary()\r\n this.selectedTds = this.computeSelectedTds()\r\n this.repositionHelpLines()\r\n }\r\n\r\n clearSelection() {\r\n const resetTds = this.table.querySelectorAll('td[contenteditable=true]')\r\n resetTds.forEach(td => this.resetTd({ target: td }))\r\n this.boundary = {}\r\n this.selectedTds = []\r\n LINE_POSITIONS.forEach((direction) => {\r\n if (this[direction]) {\r\n css(this[direction], {\r\n display: 'none',\r\n })\r\n }\r\n })\r\n }\r\n}\r\n\r\nfunction computeBoundaryFromRects(startRect, endRect) {\r\n const x = Math.min(startRect.x, endRect.x, startRect.x + startRect.width - 1, endRect.x + endRect.width - 1)\r\n\r\n const x1 = Math.max(startRect.x, endRect.x, startRect.x + startRect.width - 1, endRect.x + endRect.width - 1)\r\n\r\n const y = Math.min(startRect.y, endRect.y, startRect.y + startRect.height - 1, endRect.y + endRect.height - 1)\r\n\r\n const y1 = Math.max(startRect.y, endRect.y, startRect.y + startRect.height - 1, endRect.y + endRect.height - 1)\r\n\r\n const width = x1 - x\r\n const height = y1 - y\r\n\r\n return { x, x1, y, y1, width, height }\r\n}\r\n"],"names":["table","LINE_POSITIONS","css","PRIMARY_COLOR","getRelativeRect","TableCell","ERROR_LIMIT"],"mappings":";;;;;;AAKA,MAAqB,eAAe;AAAA,EAuBlC,YAAYA,QAAO,OAAO,KAAK;AAC7B,QAAI,CAACA,QAAO;AACH,aAAA;AAAA,IAAA;AAET,SAAK,QAAQA;AACb,SAAK,QAAQ;AACb,SAAK,mBAAmB;AACnB,SAAA,SAAS,KAAK,MAAM,KAAK;AAC9B,SAAK,WAAW,CAAC;AACjB,SAAK,cAAc,CAAC;AACpB,SAAK,WAAW;AAChB,SAAK,mBAAmB;AACnB,SAAA,mBAAmB,KAAK,MAAM,KAAK;AAExC,SAAK,mBAAmB,KAAK,iBAAiB,KAAK,IAAI;AAEvD,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,kBAAkB,KAAK,SAAS,KAAK,IAAI;AAE9C,SAAK,iBAAiB;AACtB,SAAK,qBAAqB;AAE1B,SAAK,MAAM,KAAK,WAAW,iBAAiB,aAAa,KAAK,kBAAkB,KAAK;AACrF,SAAK,MAAM,GAAG,eAAe,KAAK,eAAe;AACjD,QAAI,KAAK,MAAM,SAAS,KAAK,MAAM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