quill-table-up 2.3.0 → 2.3.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/dist/index.css +1 -1
- package/dist/index.d.ts +978 -937
- package/dist/index.js +136 -2
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +136 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +22 -23
- package/src/__tests__/e2e/table-menu.test.ts +9 -8
- package/src/__tests__/unit/table-blots.test.ts +102 -1
- package/src/__tests__/unit/table-cell-merge.test.ts +76 -1
- package/src/formats/table-wrapper-format.ts +7 -2
- package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/src/style/index.less +1 -0
- package/src/table-up.ts +12 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,1078 +1,1119 @@
|
|
|
1
|
-
import Quill, { Parchment, Range
|
|
2
|
-
import { Context } from
|
|
3
|
-
import TypeScroll from
|
|
4
|
-
import TypeBlock, { BlockEmbed
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
1
|
+
import Quill, { EmitterSource, Parchment, Range } from "quill";
|
|
2
|
+
import { Context } from "quill/modules/keyboard";
|
|
3
|
+
import TypeScroll from "quill/blots/scroll";
|
|
4
|
+
import TypeBlock, { BlockEmbed } from "quill/blots/block";
|
|
5
|
+
import TypeInline from "quill/blots/inline";
|
|
6
|
+
import TypeText from "quill/blots/text";
|
|
7
|
+
import BaseTheme from "quill/themes/base";
|
|
8
|
+
import Picker from "quill/ui/picker";
|
|
9
|
+
import { Delta } from "quill/core";
|
|
10
|
+
import TypeClipboard from "quill/modules/clipboard";
|
|
11
11
|
|
|
12
|
+
//#region src/formats/container-format.d.ts
|
|
12
13
|
declare const Container: typeof Parchment.ContainerBlot;
|
|
13
14
|
declare class ContainerFormat extends Container {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
static tagName: string;
|
|
16
|
+
static blotName: string;
|
|
17
|
+
static scope: Parchment.Scope;
|
|
18
|
+
static allowedChildren?: Parchment.BlotConstructor[];
|
|
19
|
+
static requiredContainer: Parchment.BlotConstructor;
|
|
20
|
+
static defaultChild?: Parchment.BlotConstructor;
|
|
21
|
+
static create(_value?: unknown): HTMLElement;
|
|
22
|
+
optimize(_context: Record<string, any>): void;
|
|
23
|
+
enforceAllowedChildren(): void;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
declare
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/formats/table-col-format.d.ts
|
|
27
|
+
declare const BlockEmbed$1: typeof BlockEmbed;
|
|
28
|
+
declare class TableColFormat extends BlockEmbed$1 {
|
|
29
|
+
static blotName: "table-up-col";
|
|
30
|
+
static tagName: string;
|
|
31
|
+
static validWidth(width: string | number, full: boolean): string;
|
|
32
|
+
static create(value: TableColValue): HTMLElement;
|
|
33
|
+
static value(domNode: HTMLElement): Record<string, any>;
|
|
34
|
+
get width(): number;
|
|
35
|
+
set width(value: string | number);
|
|
36
|
+
get tableId(): string;
|
|
37
|
+
get colId(): string;
|
|
38
|
+
get full(): boolean;
|
|
39
|
+
set full(value: boolean);
|
|
40
|
+
get align(): string;
|
|
41
|
+
set align(value: string);
|
|
42
|
+
checkMerge(): boolean;
|
|
43
|
+
optimize(context: Record<string, any>): void;
|
|
44
|
+
insertAt(index: number, value: string, def?: any): void;
|
|
43
45
|
}
|
|
44
|
-
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/formats/table-cell-inner-format.d.ts
|
|
45
48
|
declare class TableCellInnerFormat extends ContainerFormat {
|
|
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
|
-
|
|
49
|
+
static blotName: "table-up-cell-inner";
|
|
50
|
+
static tagName: string;
|
|
51
|
+
static className: string;
|
|
52
|
+
static allowDataAttrs: Set<string>;
|
|
53
|
+
static defaultChild: Parchment.BlotConstructor;
|
|
54
|
+
parent: TableCellFormat;
|
|
55
|
+
static allowStyle: Set<string>;
|
|
56
|
+
static isAllowStyle(str: string): boolean;
|
|
57
|
+
static create(value: TableCellValue): HTMLElement;
|
|
58
|
+
static formats(domNode: HTMLElement): Record<string, any>;
|
|
59
|
+
constructor(scroll: TypeScroll, domNode: HTMLElement, _value: TableCellValue);
|
|
60
|
+
setFormatValue(name: string, value: any, isStyle?: boolean): void;
|
|
61
|
+
get tableId(): string;
|
|
62
|
+
get rowId(): string;
|
|
63
|
+
set rowId(value: string);
|
|
64
|
+
get colId(): string;
|
|
65
|
+
set colId(value: string);
|
|
66
|
+
get rowspan(): number;
|
|
67
|
+
set rowspan(value: number);
|
|
68
|
+
get colspan(): number;
|
|
69
|
+
set colspan(value: number);
|
|
70
|
+
getColumnIndex(): number;
|
|
71
|
+
formatAt(index: number, length: number, name: string, value: any): void;
|
|
72
|
+
insertAt(index: number, value: string, def?: any): void;
|
|
73
|
+
formats(): Record<string, any>;
|
|
74
|
+
checkMerge(): boolean;
|
|
75
|
+
optimize(): void;
|
|
76
|
+
insertBefore(blot: Parchment.Blot, ref?: Parchment.Blot | null): void;
|
|
74
77
|
}
|
|
75
|
-
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/formats/table-cell-format.d.ts
|
|
76
80
|
declare class TableCellFormat extends ContainerFormat {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
static blotName: "table-up-cell";
|
|
82
|
+
static tagName: string;
|
|
83
|
+
static className: string;
|
|
84
|
+
static allowDataAttrs: Set<string>;
|
|
85
|
+
static allowAttrs: Set<string>;
|
|
86
|
+
static allowStyle: Set<string>;
|
|
87
|
+
static isAllowStyle(str: string): boolean;
|
|
88
|
+
static create(value: TableCellValue): HTMLElement;
|
|
89
|
+
static formats(domNode: HTMLElement): Record<string, any>;
|
|
90
|
+
setFormatValue(name: string, value?: any): void;
|
|
91
|
+
setStyleBoder(name: string, value?: any): void;
|
|
92
|
+
getNearByCell(direction: 'left' | 'top'): TableCellFormat[];
|
|
93
|
+
get tableId(): string;
|
|
94
|
+
get rowId(): string;
|
|
95
|
+
get colId(): string;
|
|
96
|
+
get rowspan(): number;
|
|
97
|
+
get colspan(): number;
|
|
98
|
+
getColumnIndex(): number;
|
|
99
|
+
getCellInner(): TableCellInnerFormat;
|
|
100
|
+
checkMerge(): boolean;
|
|
101
|
+
optimize(context: Record<string, any>): void;
|
|
98
102
|
}
|
|
99
|
-
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/formats/table-row-format.d.ts
|
|
100
105
|
type SkipRowCount = number[] & {
|
|
101
|
-
|
|
106
|
+
skipRowNum?: number;
|
|
102
107
|
};
|
|
103
108
|
declare class TableRowFormat extends ContainerFormat {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
static blotName: "table-up-row";
|
|
110
|
+
static tagName: string;
|
|
111
|
+
static className: string;
|
|
112
|
+
static create(value: TableRowValue): HTMLElement;
|
|
113
|
+
children: Parchment.LinkedList<TableCellFormat>;
|
|
114
|
+
get rowId(): string;
|
|
115
|
+
get tableId(): string;
|
|
116
|
+
setHeight(value: string): void;
|
|
117
|
+
getCellByColId(colId: string, direction: 'next' | 'prev'): TableCellFormat | null;
|
|
118
|
+
insertCell(targetIndex: number, value: TableCellValue): SkipRowCount;
|
|
119
|
+
getCellByColumIndex(stopIndex: number): [null | TableCellFormat, number, number[]];
|
|
120
|
+
removeCell(targetIndex: number): SkipRowCount;
|
|
121
|
+
foreachCellInner(func: (tableCell: TableCellInnerFormat, index: number) => boolean | void): void;
|
|
122
|
+
checkMerge(): boolean;
|
|
123
|
+
optimize(context: Record<string, any>): void;
|
|
119
124
|
}
|
|
120
|
-
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/formats/table-main-format.d.ts
|
|
121
127
|
declare class TableMainFormat extends ContainerFormat {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
128
|
+
scroll: TypeScroll;
|
|
129
|
+
static blotName: "table-up-main";
|
|
130
|
+
static tagName: string;
|
|
131
|
+
static className: string;
|
|
132
|
+
static create(value: TableValue): HTMLElement;
|
|
133
|
+
constructor(scroll: TypeScroll, domNode: HTMLElement, _value: unknown);
|
|
134
|
+
colWidthFillTable(): number | undefined;
|
|
135
|
+
get tableId(): string;
|
|
136
|
+
get full(): boolean;
|
|
137
|
+
set full(value: boolean);
|
|
138
|
+
get align(): string;
|
|
139
|
+
set align(value: string);
|
|
140
|
+
setFull(): void;
|
|
141
|
+
cancelFull(): void;
|
|
142
|
+
updateAlign(): void;
|
|
143
|
+
getRows(): TableRowFormat[];
|
|
144
|
+
getRowIds(): string[];
|
|
145
|
+
getCols(): TableColFormat[];
|
|
146
|
+
getColIds(): string[];
|
|
147
|
+
checkMerge(): boolean;
|
|
148
|
+
optimize(context: Record<string, any>): void;
|
|
149
|
+
sortMergeChildren(): void;
|
|
144
150
|
}
|
|
145
|
-
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/formats/table-body-format.d.ts
|
|
146
153
|
declare class TableBodyFormat extends ContainerFormat {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
static blotName: "table-up-body";
|
|
155
|
+
static tagName: string;
|
|
156
|
+
static create(value: string): HTMLElement;
|
|
157
|
+
get tableId(): string;
|
|
158
|
+
insertRow(targetIndex: number): void;
|
|
159
|
+
checkMerge(): boolean;
|
|
160
|
+
optimize(context: Record<string, any>): void;
|
|
154
161
|
}
|
|
155
|
-
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/formats/overrides/block.d.ts
|
|
156
164
|
declare const Block: typeof TypeBlock;
|
|
157
165
|
declare class BlockOverride extends Block {
|
|
158
|
-
|
|
159
|
-
|
|
166
|
+
replaceWith(name: string | Parchment.Blot, value?: any): Parchment.Blot;
|
|
167
|
+
format(name: string, value: any): void;
|
|
160
168
|
}
|
|
161
|
-
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/formats/overrides/scroll.d.ts
|
|
162
171
|
declare const ScrollBlot: any;
|
|
163
172
|
declare class ScrollOverride extends ScrollBlot {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
173
|
+
domNode: HTMLElement;
|
|
174
|
+
enable(enabled?: boolean): void;
|
|
175
|
+
createBlock(attributes: Record<string, any>, refBlot?: Parchment.Blot): Parchment.ParentBlot | TableCellInnerFormat;
|
|
167
176
|
}
|
|
168
|
-
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/formats/table-caption-format.d.ts
|
|
169
179
|
declare class TableCaptionFormat extends BlockOverride {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
static blotName: "table-up-caption";
|
|
181
|
+
static tagName: string;
|
|
182
|
+
static className: string;
|
|
183
|
+
static allowedChildren: (typeof TypeInline | typeof TypeText)[];
|
|
184
|
+
static create(value: TableCaptionValue): HTMLElement;
|
|
185
|
+
static formats(domNode: HTMLElement): TableCaptionValue;
|
|
186
|
+
scroll: TypeScroll;
|
|
187
|
+
uiNode: HTMLElement;
|
|
188
|
+
constructor(scroll: TypeScroll, domNode: HTMLElement, _value: TableCaptionValue);
|
|
189
|
+
createUI(): HTMLElement;
|
|
190
|
+
get tableId(): string;
|
|
191
|
+
set side(value: TableCaptionValue['side']);
|
|
192
|
+
get side(): TableCaptionValue["side"];
|
|
193
|
+
format(name: string, value: any): void;
|
|
194
|
+
checkMerge(): boolean;
|
|
195
|
+
optimize(context: Record<string, any>): void;
|
|
186
196
|
}
|
|
187
|
-
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/formats/table-colgroup-format.d.ts
|
|
188
199
|
declare class TableColgroupFormat extends ContainerFormat {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
static blotName: "table-up-colgroup";
|
|
201
|
+
static tagName: string;
|
|
202
|
+
children: Parchment.LinkedList<TableColFormat>;
|
|
203
|
+
static create(value: TableValue): HTMLElement;
|
|
204
|
+
get tableId(): string;
|
|
205
|
+
get full(): boolean;
|
|
206
|
+
set full(value: boolean);
|
|
207
|
+
get align(): string;
|
|
208
|
+
set align(value: string);
|
|
209
|
+
findCol(index: number): TableColFormat | null;
|
|
210
|
+
insertColByIndex(index: number, value: TableColValue): void;
|
|
211
|
+
removeColByIndex(index: number): void;
|
|
212
|
+
checkMerge(): boolean;
|
|
213
|
+
optimize(context: Record<string, any>): void;
|
|
203
214
|
}
|
|
204
|
-
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/formats/table-wrapper-format.d.ts
|
|
205
217
|
declare class TableWrapperFormat extends ContainerFormat {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
scroll: any;
|
|
219
|
+
static blotName: "table-up";
|
|
220
|
+
static tagName: string;
|
|
221
|
+
static className: string;
|
|
222
|
+
static create(value: string): HTMLElement;
|
|
223
|
+
constructor(scroll: any, node: Node, _value: string);
|
|
224
|
+
get tableId(): string;
|
|
225
|
+
checkMerge(): boolean;
|
|
226
|
+
deleteAt(index: number, length: number): void;
|
|
227
|
+
remove(): void;
|
|
228
|
+
isBlockLine(blot: Parchment.Blot): boolean;
|
|
229
|
+
insertLineAround: () => void;
|
|
217
230
|
}
|
|
218
|
-
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/formats/index.d.ts
|
|
219
233
|
declare function getTableMainRect(tableMainBlot: TableMainFormat): {
|
|
220
|
-
|
|
221
|
-
|
|
234
|
+
body: TableBodyFormat;
|
|
235
|
+
rect: DOMRect;
|
|
222
236
|
};
|
|
223
|
-
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/utils/constants.d.ts
|
|
224
239
|
declare const blotName: {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
240
|
+
readonly container: "table-up-container";
|
|
241
|
+
readonly tableCaption: "table-up-caption";
|
|
242
|
+
readonly tableWrapper: "table-up";
|
|
243
|
+
readonly tableMain: "table-up-main";
|
|
244
|
+
readonly tableColgroup: "table-up-colgroup";
|
|
245
|
+
readonly tableCol: "table-up-col";
|
|
246
|
+
readonly tableBody: "table-up-body";
|
|
247
|
+
readonly tableRow: "table-up-row";
|
|
248
|
+
readonly tableCell: "table-up-cell";
|
|
249
|
+
readonly tableCellInner: "table-up-cell-inner";
|
|
235
250
|
};
|
|
236
251
|
declare const tableUpSize: {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
252
|
+
colMinWidthPre: number;
|
|
253
|
+
colMinWidthPx: number;
|
|
254
|
+
colDefaultWidth: number;
|
|
255
|
+
rowMinHeightPx: number;
|
|
241
256
|
};
|
|
242
257
|
declare const tableUpEvent: {
|
|
243
|
-
|
|
258
|
+
AFTER_TABLE_RESIZE: string;
|
|
244
259
|
};
|
|
245
260
|
declare const tableUpInternal: {
|
|
246
|
-
|
|
261
|
+
moduleName: string;
|
|
247
262
|
};
|
|
248
|
-
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/modules/table-align.d.ts
|
|
249
265
|
declare class TableAlign {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
266
|
+
tableModule: TableUp;
|
|
267
|
+
table: HTMLElement;
|
|
268
|
+
quill: Quill;
|
|
269
|
+
tableBlot: TableMainFormat;
|
|
270
|
+
tableWrapperBlot: TableWrapperFormat;
|
|
271
|
+
alignBox?: HTMLElement;
|
|
272
|
+
cleanup?: () => void;
|
|
273
|
+
bem: {
|
|
274
|
+
b: () => string;
|
|
275
|
+
be: (e?: string) => string;
|
|
276
|
+
bm: (m?: string) => string;
|
|
277
|
+
bem: (e?: string, m?: string) => string;
|
|
278
|
+
ns: (s?: string) => string;
|
|
279
|
+
bs: (s?: string) => string;
|
|
280
|
+
cv: (v?: string) => string;
|
|
281
|
+
is: (n: string) => string;
|
|
282
|
+
};
|
|
283
|
+
resizeObserver: ResizeObserver;
|
|
284
|
+
constructor(tableModule: TableUp, table: HTMLElement, quill: Quill);
|
|
285
|
+
updateWhenTextChange: () => void;
|
|
286
|
+
buildTool(): HTMLElement;
|
|
287
|
+
setTableAlign(tableBlot: TableMainFormat, align: string): void;
|
|
288
|
+
show(): void;
|
|
289
|
+
hide(): void;
|
|
290
|
+
update(): void;
|
|
291
|
+
destroy(): void;
|
|
276
292
|
}
|
|
277
|
-
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/modules/table-clipboard.d.ts
|
|
278
295
|
declare const Clipboard: typeof TypeClipboard;
|
|
279
296
|
type Selector = string | Node['TEXT_NODE'] | Node['ELEMENT_NODE'];
|
|
280
297
|
type Matcher = (node: Node, delta: Delta, scroll: Parchment.ScrollBlot) => Delta;
|
|
281
298
|
interface ClipboardOptions {
|
|
282
|
-
|
|
299
|
+
matchers: [Selector, Matcher][];
|
|
283
300
|
}
|
|
284
301
|
declare class TableClipboard extends Clipboard {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
302
|
+
quill: Quill;
|
|
303
|
+
tableId: string;
|
|
304
|
+
rowId: string;
|
|
305
|
+
rowIds: string[];
|
|
306
|
+
colIds: string[];
|
|
307
|
+
emptyRowCount: number[];
|
|
308
|
+
rowspanCount: {
|
|
309
|
+
rowspan: number;
|
|
310
|
+
colspan: number;
|
|
311
|
+
}[];
|
|
312
|
+
cellCount: number;
|
|
313
|
+
colCount: number;
|
|
314
|
+
constructor(quill: Quill, options: Partial<ClipboardOptions>);
|
|
315
|
+
matchTable(node: Node, delta: Delta): Delta;
|
|
316
|
+
matchTbody(node: Node, delta: Delta): Delta;
|
|
317
|
+
matchColgroup(node: Node, delta: Delta): Delta;
|
|
318
|
+
matchCol(node: Node, _delta: Delta): Delta;
|
|
319
|
+
matchTr(node: Node, delta: Delta): Delta;
|
|
320
|
+
matchTd(node: Node, delta: Delta): Delta;
|
|
321
|
+
matchTdAttributor(node: Node, delta: Delta): Delta;
|
|
322
|
+
convert({
|
|
323
|
+
html,
|
|
324
|
+
text
|
|
325
|
+
}: {
|
|
326
|
+
html?: string;
|
|
327
|
+
text?: string;
|
|
328
|
+
}, formats?: Record<string, unknown>): Delta;
|
|
329
|
+
matchCaption(node: Node, delta: Delta): Delta;
|
|
310
330
|
}
|
|
311
|
-
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region src/modules/table-menu/constants.d.ts
|
|
312
333
|
declare const tableMenuTools: Record<string, Tool>;
|
|
313
|
-
|
|
314
|
-
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/modules/table-menu/table-menu-common.d.ts
|
|
336
|
+
type TableMenuOptionsInput = Partial<Omit<TableMenuOptions, 'texts'>>;
|
|
315
337
|
interface MenuTooltipInstance extends TooltipInstance {
|
|
316
|
-
|
|
338
|
+
isColorPick?: boolean;
|
|
317
339
|
}
|
|
318
340
|
declare class TableMenuCommon {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
341
|
+
tableModule: TableUp;
|
|
342
|
+
quill: Quill;
|
|
343
|
+
usedColors: Set<string>;
|
|
344
|
+
options: TableMenuOptions;
|
|
345
|
+
menu: HTMLElement | null;
|
|
346
|
+
isMenuDisplay: boolean;
|
|
347
|
+
isColorPicking: boolean;
|
|
348
|
+
updateUsedColor: (this: any, color?: string) => void;
|
|
349
|
+
tooltipItem: MenuTooltipInstance[];
|
|
350
|
+
activeTooltip: MenuTooltipInstance | null;
|
|
351
|
+
bem: {
|
|
352
|
+
b: () => string;
|
|
353
|
+
be: (e?: string) => string;
|
|
354
|
+
bm: (m?: string) => string;
|
|
355
|
+
bem: (e?: string, m?: string) => string;
|
|
356
|
+
ns: (s?: string) => string;
|
|
357
|
+
bs: (s?: string) => string;
|
|
358
|
+
cv: (v?: string) => string;
|
|
359
|
+
is: (n: string) => string;
|
|
360
|
+
};
|
|
361
|
+
colorItemClass: string;
|
|
362
|
+
colorChooseTooltipOption: ToolTipOptions;
|
|
363
|
+
constructor(tableModule: TableUp, quill: Quill, options: TableMenuOptionsInput);
|
|
364
|
+
updateWhenTextChange: () => void;
|
|
365
|
+
resolveOptions(options: TableMenuOptionsInput): TableMenuOptions;
|
|
366
|
+
buildTools(): HTMLElement;
|
|
367
|
+
createColorChoose(item: HTMLElement, {
|
|
368
|
+
handle,
|
|
369
|
+
key
|
|
370
|
+
}: ToolOption): MenuTooltipInstance;
|
|
371
|
+
setActiveTooltip(tooltip: MenuTooltipInstance | null): void;
|
|
372
|
+
getSelectedTds(): TableCellInnerFormat[];
|
|
373
|
+
createTipText(item: HTMLElement, text: string): void;
|
|
374
|
+
show(): void;
|
|
375
|
+
update(): void;
|
|
376
|
+
hide(): void;
|
|
377
|
+
destroy(): void;
|
|
353
378
|
}
|
|
354
|
-
|
|
355
|
-
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region src/modules/table-menu/table-menu-contextmenu.d.ts
|
|
381
|
+
type TableMenuOptionsInput$1 = Partial<Omit<TableMenuOptions, 'texts'>>;
|
|
356
382
|
declare class TableMenuContextmenu extends TableMenuCommon {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
383
|
+
tableModule: TableUp;
|
|
384
|
+
quill: Quill;
|
|
385
|
+
colorChooseTooltipOption: ToolTipOptions;
|
|
386
|
+
constructor(tableModule: TableUp, quill: Quill, options: TableMenuOptionsInput$1);
|
|
387
|
+
listenContextmenu: (e: MouseEvent) => void;
|
|
388
|
+
buildTools(): HTMLElement;
|
|
389
|
+
createTipText(item: HTMLElement, text: string): void;
|
|
390
|
+
show(): void;
|
|
391
|
+
update(position?: {
|
|
392
|
+
x: number;
|
|
393
|
+
y: number;
|
|
394
|
+
}): void;
|
|
395
|
+
destroy(): void;
|
|
370
396
|
}
|
|
371
|
-
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/modules/table-menu/table-menu-select.d.ts
|
|
372
399
|
declare class TableMenuSelect extends TableMenuCommon {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
400
|
+
tableModule: TableUp;
|
|
401
|
+
quill: Quill;
|
|
402
|
+
constructor(tableModule: TableUp, quill: Quill, options: TableMenuOptionsInput);
|
|
403
|
+
update(): void;
|
|
377
404
|
}
|
|
378
|
-
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/modules/table-resize/table-resize-common.d.ts
|
|
379
407
|
interface sizeChangeValue {
|
|
380
|
-
|
|
381
|
-
|
|
408
|
+
px: number;
|
|
409
|
+
pre: number;
|
|
382
410
|
}
|
|
383
411
|
declare class TableResizeCommon {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
412
|
+
tableModule: TableUp;
|
|
413
|
+
quill: Quill;
|
|
414
|
+
colIndex: number;
|
|
415
|
+
tableMain?: TableMainFormat;
|
|
416
|
+
dragging: boolean;
|
|
417
|
+
dragColBreak: HTMLElement | null;
|
|
418
|
+
handleColMouseUpFunc: () => Promise<void>;
|
|
419
|
+
handleColMouseMoveFunc: (e: MouseEvent) => {
|
|
420
|
+
left: number;
|
|
421
|
+
width: number;
|
|
422
|
+
} | undefined;
|
|
423
|
+
handleColMouseDownFunc: (e: MouseEvent) => {
|
|
424
|
+
top: number;
|
|
425
|
+
left: number;
|
|
426
|
+
height: number;
|
|
427
|
+
} | undefined;
|
|
428
|
+
rowIndex: number;
|
|
429
|
+
dragRowBreak: HTMLElement | null;
|
|
430
|
+
handleRowMouseUpFunc: () => void;
|
|
431
|
+
handleRowMouseMoveFunc: (e: MouseEvent) => {
|
|
432
|
+
top: number;
|
|
433
|
+
height: number;
|
|
434
|
+
} | undefined;
|
|
435
|
+
handleRowMouseDownFunc: (e: MouseEvent) => {
|
|
436
|
+
top: number;
|
|
437
|
+
left: number;
|
|
438
|
+
width: number;
|
|
439
|
+
} | undefined;
|
|
440
|
+
dragBEM: {
|
|
441
|
+
b: () => string;
|
|
442
|
+
be: (e?: string) => string;
|
|
443
|
+
bm: (m?: string) => string;
|
|
444
|
+
bem: (e?: string, m?: string) => string;
|
|
445
|
+
ns: (s?: string) => string;
|
|
446
|
+
bs: (s?: string) => string;
|
|
447
|
+
cv: (v?: string) => string;
|
|
448
|
+
is: (n: string) => string;
|
|
449
|
+
};
|
|
450
|
+
constructor(tableModule: TableUp, quill: Quill);
|
|
451
|
+
findCurrentColIndex(_e: MouseEvent): number;
|
|
452
|
+
colWidthChange(_i: number, _w: sizeChangeValue, _isFull: boolean): void;
|
|
453
|
+
createConfirmDialog({
|
|
454
|
+
message,
|
|
455
|
+
confirm,
|
|
456
|
+
cancel
|
|
457
|
+
}: {
|
|
458
|
+
message: string;
|
|
459
|
+
confirm: string;
|
|
460
|
+
cancel: string;
|
|
461
|
+
}): Promise<boolean>;
|
|
462
|
+
handleColMouseUp(): Promise<void>;
|
|
463
|
+
getColumnRect(columnIndex: number): {
|
|
464
|
+
left: number;
|
|
465
|
+
right: number;
|
|
466
|
+
width: number;
|
|
467
|
+
} | null;
|
|
468
|
+
handleColMouseMove(e: MouseEvent): {
|
|
469
|
+
left: number;
|
|
470
|
+
width: number;
|
|
471
|
+
} | undefined;
|
|
472
|
+
handleColMouseDown(e: MouseEvent): {
|
|
473
|
+
top: number;
|
|
474
|
+
left: number;
|
|
475
|
+
height: number;
|
|
476
|
+
} | undefined;
|
|
477
|
+
findCurrentRowIndex(_e: MouseEvent): number;
|
|
478
|
+
rowHeightChange(_i: number, _h: number): void;
|
|
479
|
+
handleRowMouseUp(): void;
|
|
480
|
+
handleRowMouseMove(e: MouseEvent): {
|
|
481
|
+
top: number;
|
|
482
|
+
height: number;
|
|
483
|
+
} | undefined;
|
|
484
|
+
handleRowMouseDown(e: MouseEvent): {
|
|
485
|
+
top: number;
|
|
486
|
+
left: number;
|
|
487
|
+
width: number;
|
|
488
|
+
} | undefined;
|
|
489
|
+
update(): void;
|
|
490
|
+
destroy(): void;
|
|
459
491
|
}
|
|
460
|
-
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region src/modules/table-resize/table-resize-box.d.ts
|
|
461
494
|
declare class TableResizeBox extends TableResizeCommon {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
495
|
+
tableModule: TableUp;
|
|
496
|
+
table: HTMLElement;
|
|
497
|
+
root: HTMLElement;
|
|
498
|
+
tableMain: TableMainFormat;
|
|
499
|
+
tableWrapper: Parchment.Parent;
|
|
500
|
+
resizeObserver: ResizeObserver;
|
|
501
|
+
tableCols: TableColFormat[];
|
|
502
|
+
tableRows: TableRowFormat[];
|
|
503
|
+
rowHeadWrapper: HTMLElement | null;
|
|
504
|
+
colHeadWrapper: HTMLElement | null;
|
|
505
|
+
corner: HTMLElement | null;
|
|
506
|
+
scrollHandler: [HTMLElement, (e: Event) => void][];
|
|
507
|
+
lastHeaderSelect: {
|
|
508
|
+
isX: boolean;
|
|
509
|
+
index: number;
|
|
510
|
+
} | null;
|
|
511
|
+
size: number;
|
|
512
|
+
bem: {
|
|
513
|
+
b: () => string;
|
|
514
|
+
be: (e?: string) => string;
|
|
515
|
+
bm: (m?: string) => string;
|
|
516
|
+
bem: (e?: string, m?: string) => string;
|
|
517
|
+
ns: (s?: string) => string;
|
|
518
|
+
bs: (s?: string) => string;
|
|
519
|
+
cv: (v?: string) => string;
|
|
520
|
+
is: (n: string) => string;
|
|
521
|
+
};
|
|
522
|
+
constructor(tableModule: TableUp, table: HTMLElement, quill: Quill);
|
|
523
|
+
updateWhenTextChange: () => void;
|
|
524
|
+
handleResizerHeader(isX: boolean, index: number, e: MouseEvent): void;
|
|
525
|
+
findCurrentColIndex(e: MouseEvent): number;
|
|
526
|
+
colWidthChange(i: number, w: sizeChangeValue, isFull: boolean): void;
|
|
527
|
+
handleColMouseDownFunc: (e: MouseEvent) => {
|
|
528
|
+
top: number;
|
|
529
|
+
left: number;
|
|
530
|
+
height: number;
|
|
531
|
+
} | undefined;
|
|
532
|
+
bindColEvents(): void;
|
|
533
|
+
findCurrentRowIndex(e: MouseEvent): number;
|
|
534
|
+
rowHeightChange(i: number, h: number): void;
|
|
535
|
+
handleRowMouseDownFunc: (e: MouseEvent) => {
|
|
536
|
+
top: number;
|
|
537
|
+
left: number;
|
|
538
|
+
width: number;
|
|
539
|
+
} | undefined;
|
|
540
|
+
bindRowEvents(): void;
|
|
541
|
+
update(): void;
|
|
542
|
+
show(): void;
|
|
543
|
+
hide(): void;
|
|
544
|
+
destroy(): void;
|
|
512
545
|
}
|
|
513
|
-
|
|
546
|
+
//#endregion
|
|
547
|
+
//#region src/modules/table-resize/table-resize-line.d.ts
|
|
514
548
|
declare class TableResizeLine extends TableResizeCommon {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
549
|
+
tableModule: TableUp;
|
|
550
|
+
table: HTMLElement;
|
|
551
|
+
colResizer: HTMLElement;
|
|
552
|
+
rowResizer: HTMLElement;
|
|
553
|
+
currentTableCell?: HTMLElement;
|
|
554
|
+
dragging: boolean;
|
|
555
|
+
curColIndex: number;
|
|
556
|
+
curRowIndex: number;
|
|
557
|
+
tableCellBlot?: TableCellFormat;
|
|
558
|
+
bem: {
|
|
559
|
+
b: () => string;
|
|
560
|
+
be: (e?: string) => string;
|
|
561
|
+
bm: (m?: string) => string;
|
|
562
|
+
bem: (e?: string, m?: string) => string;
|
|
563
|
+
ns: (s?: string) => string;
|
|
564
|
+
bs: (s?: string) => string;
|
|
565
|
+
cv: (v?: string) => string;
|
|
566
|
+
is: (n: string) => string;
|
|
567
|
+
};
|
|
568
|
+
constructor(tableModule: TableUp, table: HTMLElement, quill: Quill);
|
|
569
|
+
mousemoveHandler: (e: MouseEvent) => void;
|
|
570
|
+
hideWhenTextChange: () => void;
|
|
571
|
+
findTableCell(e: MouseEvent): HTMLElement | null;
|
|
572
|
+
findCurrentColIndex(): number;
|
|
573
|
+
handleColMouseUpFunc: () => Promise<void>;
|
|
574
|
+
updateColResizer(): void;
|
|
575
|
+
findCurrentRowIndex(): number;
|
|
576
|
+
handleRowMouseUpFunc: () => void;
|
|
577
|
+
updateRowResizer(): void;
|
|
578
|
+
show(): void;
|
|
579
|
+
hide(): void;
|
|
580
|
+
update(): void;
|
|
581
|
+
destroy(): void;
|
|
548
582
|
}
|
|
549
|
-
|
|
583
|
+
//#endregion
|
|
584
|
+
//#region src/modules/table-resize/table-resize-scale.d.ts
|
|
550
585
|
declare class TableResizeScale {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
586
|
+
tableModule: TableUp;
|
|
587
|
+
table: HTMLElement;
|
|
588
|
+
quill: Quill;
|
|
589
|
+
scrollHandler: [HTMLElement, (e: Event) => void][];
|
|
590
|
+
tableMainBlot: TableMainFormat | null;
|
|
591
|
+
tableWrapperBlot: TableWrapperFormat | null;
|
|
592
|
+
bem: {
|
|
593
|
+
b: () => string;
|
|
594
|
+
be: (e?: string) => string;
|
|
595
|
+
bm: (m?: string) => string;
|
|
596
|
+
bem: (e?: string, m?: string) => string;
|
|
597
|
+
ns: (s?: string) => string;
|
|
598
|
+
bs: (s?: string) => string;
|
|
599
|
+
cv: (v?: string) => string;
|
|
600
|
+
is: (n: string) => string;
|
|
601
|
+
};
|
|
602
|
+
startX: number;
|
|
603
|
+
startY: number;
|
|
604
|
+
offset: number;
|
|
605
|
+
options: TableResizeScaleOptions;
|
|
606
|
+
root?: HTMLElement;
|
|
607
|
+
block?: HTMLElement;
|
|
608
|
+
resizeobserver: ResizeObserver;
|
|
609
|
+
constructor(tableModule: TableUp, table: HTMLElement, quill: Quill, options: Partial<TableResizeScaleOptions>);
|
|
610
|
+
updateWhenTextChange: () => void;
|
|
611
|
+
resolveOptions(options: Partial<TableResizeScaleOptions>): {
|
|
612
|
+
blockSize: number;
|
|
613
|
+
} & Partial<TableResizeScaleOptions>;
|
|
614
|
+
buildResizer(): void;
|
|
615
|
+
isTableOutofEditor(): boolean;
|
|
616
|
+
update(): void;
|
|
617
|
+
show(): void;
|
|
618
|
+
hide(): void;
|
|
619
|
+
destroy(): void;
|
|
585
620
|
}
|
|
586
|
-
|
|
621
|
+
//#endregion
|
|
622
|
+
//#region src/modules/table-resize/utils.d.ts
|
|
587
623
|
declare const isTableAlignRight: (tableMainBlot: TableMainFormat) => boolean;
|
|
588
|
-
|
|
624
|
+
//#endregion
|
|
625
|
+
//#region src/modules/table-scrollbar.d.ts
|
|
589
626
|
declare class Scrollbar {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
627
|
+
quill: Quill;
|
|
628
|
+
isVertical: boolean;
|
|
629
|
+
table: HTMLElement;
|
|
630
|
+
scrollbarContainer: HTMLElement;
|
|
631
|
+
minSize: number;
|
|
632
|
+
gap: number;
|
|
633
|
+
move: number;
|
|
634
|
+
cursorDown: boolean;
|
|
635
|
+
cursorLeave: boolean;
|
|
636
|
+
ratioY: number;
|
|
637
|
+
ratioX: number;
|
|
638
|
+
sizeWidth: string;
|
|
639
|
+
sizeHeight: string;
|
|
640
|
+
size: string;
|
|
641
|
+
thumbState: {
|
|
642
|
+
X: number;
|
|
643
|
+
Y: number;
|
|
644
|
+
};
|
|
645
|
+
ob: ResizeObserver;
|
|
646
|
+
container: HTMLElement;
|
|
647
|
+
scrollbar: HTMLElement;
|
|
648
|
+
thumb: HTMLElement;
|
|
649
|
+
scrollHandler: [HTMLElement, (e: Event) => void][];
|
|
650
|
+
propertyMap: {
|
|
651
|
+
readonly size: 'height';
|
|
652
|
+
readonly offset: 'offsetHeight';
|
|
653
|
+
readonly scrollDirection: 'scrollTop';
|
|
654
|
+
readonly scrollSize: 'scrollHeight';
|
|
655
|
+
readonly axis: 'Y';
|
|
656
|
+
readonly direction: 'top';
|
|
657
|
+
readonly client: 'clientY';
|
|
658
|
+
} | {
|
|
659
|
+
readonly size: 'width';
|
|
660
|
+
readonly offset: 'offsetWidth';
|
|
661
|
+
readonly scrollDirection: 'scrollLeft';
|
|
662
|
+
readonly scrollSize: 'scrollWidth';
|
|
663
|
+
readonly axis: 'X';
|
|
664
|
+
readonly direction: 'left';
|
|
665
|
+
readonly client: 'clientX';
|
|
666
|
+
};
|
|
667
|
+
bem: {
|
|
668
|
+
b: () => string;
|
|
669
|
+
be: (e?: string) => string;
|
|
670
|
+
bm: (m?: string) => string;
|
|
671
|
+
bem: (e?: string, m?: string) => string;
|
|
672
|
+
ns: (s?: string) => string;
|
|
673
|
+
bs: (s?: string) => string;
|
|
674
|
+
cv: (v?: string) => string;
|
|
675
|
+
is: (n: string) => string;
|
|
676
|
+
};
|
|
677
|
+
tableMainBlot: TableMainFormat;
|
|
678
|
+
constructor(quill: Quill, isVertical: boolean, table: HTMLElement, scrollbarContainer: HTMLElement);
|
|
679
|
+
update(): void;
|
|
680
|
+
setScrollbarPosition(): void;
|
|
681
|
+
calculateSize(): void;
|
|
682
|
+
createScrollbar(): HTMLDivElement;
|
|
683
|
+
containerScrollHandler(wrap: HTMLElement): void;
|
|
684
|
+
showScrollbar: (this: any) => void;
|
|
685
|
+
hideScrollbar: (this: any) => void;
|
|
686
|
+
hideScrollbarTransitionend: () => void;
|
|
687
|
+
destroy(): void;
|
|
651
688
|
}
|
|
652
689
|
declare class TableVirtualScrollbar {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
690
|
+
tableModule: TableUp;
|
|
691
|
+
table: HTMLElement;
|
|
692
|
+
quill: Quill;
|
|
693
|
+
scrollbarContainer: HTMLElement;
|
|
694
|
+
scrollbar: Scrollbar[];
|
|
695
|
+
bem: {
|
|
696
|
+
b: () => string;
|
|
697
|
+
be: (e?: string) => string;
|
|
698
|
+
bm: (m?: string) => string;
|
|
699
|
+
bem: (e?: string, m?: string) => string;
|
|
700
|
+
ns: (s?: string) => string;
|
|
701
|
+
bs: (s?: string) => string;
|
|
702
|
+
cv: (v?: string) => string;
|
|
703
|
+
is: (n: string) => string;
|
|
704
|
+
};
|
|
705
|
+
constructor(tableModule: TableUp, table: HTMLElement, quill: Quill);
|
|
706
|
+
updateWhenTextChange: () => void;
|
|
707
|
+
hide(): void;
|
|
708
|
+
show(): void;
|
|
709
|
+
update(): void;
|
|
710
|
+
destroy(): void;
|
|
674
711
|
}
|
|
675
|
-
|
|
712
|
+
//#endregion
|
|
713
|
+
//#region src/modules/table-selection.d.ts
|
|
676
714
|
interface SelectionData {
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
715
|
+
anchorNode: Node | null;
|
|
716
|
+
anchorOffset: number;
|
|
717
|
+
focusNode: Node | null;
|
|
718
|
+
focusOffset: number;
|
|
681
719
|
}
|
|
682
720
|
declare class TableSelection {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
721
|
+
tableModule: TableUp;
|
|
722
|
+
quill: Quill;
|
|
723
|
+
options: TableSelectionOptions;
|
|
724
|
+
boundary: RelactiveRect | null;
|
|
725
|
+
startScrollX: number;
|
|
726
|
+
startScrollY: number;
|
|
727
|
+
selectedTableScrollX: number;
|
|
728
|
+
selectedTableScrollY: number;
|
|
729
|
+
selectedEditorScrollX: number;
|
|
730
|
+
selectedEditorScrollY: number;
|
|
731
|
+
selectedTds: TableCellInnerFormat[];
|
|
732
|
+
cellSelectWrap: HTMLElement;
|
|
733
|
+
cellSelect: HTMLElement;
|
|
734
|
+
dragging: boolean;
|
|
735
|
+
scrollHandler: [HTMLElement, (...args: any[]) => void][];
|
|
736
|
+
tableMenu?: InternalTableMenuModule;
|
|
737
|
+
resizeObserver: ResizeObserver;
|
|
738
|
+
table?: HTMLTableElement;
|
|
739
|
+
isDisplaySelection: boolean;
|
|
740
|
+
bem: {
|
|
741
|
+
b: () => string;
|
|
742
|
+
be: (e?: string) => string;
|
|
743
|
+
bm: (m?: string) => string;
|
|
744
|
+
bem: (e?: string, m?: string) => string;
|
|
745
|
+
ns: (s?: string) => string;
|
|
746
|
+
bs: (s?: string) => string;
|
|
747
|
+
cv: (v?: string) => string;
|
|
748
|
+
is: (n: string) => string;
|
|
749
|
+
};
|
|
750
|
+
lastSelection: SelectionData;
|
|
751
|
+
constructor(tableModule: TableUp, quill: Quill, options?: Partial<TableSelectionOptions>);
|
|
752
|
+
updateAfterEvent: () => void;
|
|
753
|
+
getFirstTextNode(dom: HTMLElement | Node): Node;
|
|
754
|
+
getLastTextNode(dom: HTMLElement | Node): Node;
|
|
755
|
+
getNodeTailOffset(node: Node): number;
|
|
756
|
+
quillSelectionChangeHandler: (range: Range | null, _oldRange: Range | null, source: EmitterSource) => void;
|
|
757
|
+
setSelectionData(selection: Selection, selectionData: SelectionData): void;
|
|
758
|
+
selectionDirectionUp(selection: SelectionData): boolean;
|
|
759
|
+
findWrapSelection(points: {
|
|
760
|
+
node: Node | null;
|
|
761
|
+
offset: number;
|
|
762
|
+
}[]): {
|
|
763
|
+
startNode: Node | null;
|
|
764
|
+
startOffset: number;
|
|
765
|
+
endNode: Node | null;
|
|
766
|
+
endOffset: number;
|
|
767
|
+
};
|
|
768
|
+
resolveOptions(options: Partial<TableSelectionOptions>): TableSelectionOptions;
|
|
769
|
+
selectionChangeHandler: () => void;
|
|
770
|
+
helpLinesInitial(): HTMLDivElement;
|
|
771
|
+
computeSelectedTds(startPoint: {
|
|
772
|
+
x: number;
|
|
773
|
+
y: number;
|
|
774
|
+
}, endPoint: {
|
|
775
|
+
x: number;
|
|
776
|
+
y: number;
|
|
777
|
+
}): TableCellInnerFormat[];
|
|
778
|
+
mouseDownHandler: (mousedownEvent: MouseEvent) => void;
|
|
779
|
+
updateWithSelectedTds(): void;
|
|
780
|
+
update(): void;
|
|
781
|
+
getQuillViewScroll(): {
|
|
782
|
+
x: number;
|
|
783
|
+
y: number;
|
|
784
|
+
};
|
|
785
|
+
getTableViewScroll(): {
|
|
786
|
+
x: number;
|
|
787
|
+
y: number;
|
|
788
|
+
};
|
|
789
|
+
setSelectionTable(table: HTMLTableElement | undefined): void;
|
|
790
|
+
removeCell: (e: KeyboardEvent) => void;
|
|
791
|
+
showDisplay(): void;
|
|
792
|
+
show(): void;
|
|
793
|
+
hideDisplay(): void;
|
|
794
|
+
hide(): void;
|
|
795
|
+
destroy(): void;
|
|
758
796
|
}
|
|
759
|
-
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region src/utils/types.d.ts
|
|
760
799
|
type QuillThemePicker = (Picker & {
|
|
761
|
-
|
|
800
|
+
options: HTMLElement;
|
|
762
801
|
});
|
|
763
802
|
interface QuillTheme extends BaseTheme {
|
|
764
|
-
|
|
803
|
+
pickers: QuillThemePicker[];
|
|
765
804
|
}
|
|
766
805
|
interface ToolOption {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
806
|
+
name: string;
|
|
807
|
+
icon: string | ((tableModule: TableUp) => HTMLElement);
|
|
808
|
+
tip?: string;
|
|
809
|
+
isColorChoose?: boolean;
|
|
810
|
+
key?: string;
|
|
811
|
+
handle: (tableModule: TableUp, selectedTds: TableCellInnerFormat[], e: Event | string | null) => void;
|
|
773
812
|
}
|
|
774
813
|
interface ToolOptionBreak {
|
|
775
|
-
|
|
814
|
+
name: 'break';
|
|
776
815
|
}
|
|
777
816
|
type Tool = ToolOption | ToolOptionBreak;
|
|
778
817
|
interface TableMenuOptions {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
818
|
+
tipText: boolean;
|
|
819
|
+
tools: Tool[];
|
|
820
|
+
localstorageKey: string;
|
|
821
|
+
defaultColorMap: string[];
|
|
783
822
|
}
|
|
784
823
|
interface TableSelectionOptions {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
824
|
+
selectColor: string;
|
|
825
|
+
tableMenu?: Constructor<InternalTableMenuModule, [TableUp, Quill, Partial<TableMenuOptions>]>;
|
|
826
|
+
tableMenuOptions: TableMenuOptions;
|
|
788
827
|
}
|
|
789
828
|
interface TableResizeScaleOptions {
|
|
790
|
-
|
|
829
|
+
blockSize: number;
|
|
791
830
|
}
|
|
792
831
|
interface TableCreatorTextOptions {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
832
|
+
fullCheckboxText: string;
|
|
833
|
+
customBtnText: string;
|
|
834
|
+
confirmText: string;
|
|
835
|
+
cancelText: string;
|
|
836
|
+
rowText: string;
|
|
837
|
+
colText: string;
|
|
838
|
+
notPositiveNumberError: string;
|
|
839
|
+
perWidthInsufficient: string;
|
|
801
840
|
}
|
|
802
841
|
type TableMenuTexts = Record<string, string>;
|
|
803
842
|
interface TableTextOptions extends TableCreatorTextOptions, TableMenuTexts {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
843
|
+
custom: string;
|
|
844
|
+
clear: string;
|
|
845
|
+
transparent: string;
|
|
846
|
+
perWidthInsufficient: string;
|
|
808
847
|
}
|
|
809
848
|
interface TableUpOptions {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
849
|
+
customSelect?: (tableModule: TableUp, picker: QuillThemePicker) => Promise<HTMLElement> | HTMLElement;
|
|
850
|
+
full: boolean;
|
|
851
|
+
fullSwitch: boolean;
|
|
852
|
+
customBtn: boolean;
|
|
853
|
+
texts: TableTextOptions;
|
|
854
|
+
icon: string;
|
|
855
|
+
selection?: Constructor<InternalTableSelectionModule, [TableUp, Quill, Partial<TableSelectionOptions>]>;
|
|
856
|
+
selectionOptions: Partial<TableSelectionOptions>;
|
|
857
|
+
resize?: Constructor<InternalModule, [TableUp, HTMLElement, Quill, any]>;
|
|
858
|
+
resizeOptions: any;
|
|
859
|
+
scrollbar?: Constructor<InternalModule, [TableUp, HTMLElement, Quill, any]>;
|
|
860
|
+
scrollbarOptions: any;
|
|
861
|
+
align?: Constructor<InternalModule, [TableUp, HTMLElement, Quill, any]>;
|
|
862
|
+
alignOptions: any;
|
|
863
|
+
resizeScale?: Constructor<InternalModule, [TableUp, HTMLElement, Quill, Partial<TableResizeScaleOptions>]>;
|
|
864
|
+
resizeScaleOptions: Partial<TableResizeScaleOptions>;
|
|
826
865
|
}
|
|
827
866
|
interface TableColValue {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
867
|
+
tableId: string;
|
|
868
|
+
colId: string;
|
|
869
|
+
width: number;
|
|
870
|
+
full?: boolean;
|
|
871
|
+
align?: string;
|
|
833
872
|
}
|
|
834
873
|
interface TableCellValue {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
874
|
+
tableId: string;
|
|
875
|
+
rowId: string;
|
|
876
|
+
colId: string;
|
|
877
|
+
rowspan: number;
|
|
878
|
+
colspan: number;
|
|
879
|
+
style?: string;
|
|
841
880
|
}
|
|
842
881
|
interface TableRowValue {
|
|
843
|
-
|
|
844
|
-
|
|
882
|
+
tableId: string;
|
|
883
|
+
rowId: string;
|
|
845
884
|
}
|
|
846
885
|
interface TableCaptionValue {
|
|
847
|
-
|
|
848
|
-
|
|
886
|
+
tableId: string;
|
|
887
|
+
side: 'top' | 'bottom';
|
|
849
888
|
}
|
|
850
889
|
interface TableValue {
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
890
|
+
tableId: string;
|
|
891
|
+
full?: boolean;
|
|
892
|
+
align?: string;
|
|
854
893
|
}
|
|
855
894
|
interface RelactiveRect {
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
895
|
+
x: number;
|
|
896
|
+
y: number;
|
|
897
|
+
x1: number;
|
|
898
|
+
y1: number;
|
|
899
|
+
width: number;
|
|
900
|
+
height: number;
|
|
862
901
|
}
|
|
863
902
|
interface InternalModule {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
903
|
+
show: () => void;
|
|
904
|
+
hide: () => void;
|
|
905
|
+
update: () => void;
|
|
906
|
+
destroy: () => void;
|
|
868
907
|
}
|
|
869
908
|
type Constructor<T = any, U extends Array<any> = any[]> = new (...args: U) => T;
|
|
870
909
|
interface InternalTableSelectionModule extends InternalModule {
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
910
|
+
table?: HTMLElement;
|
|
911
|
+
dragging: boolean;
|
|
912
|
+
boundary: RelactiveRect | null;
|
|
913
|
+
selectedTds: TableCellInnerFormat[];
|
|
914
|
+
cellSelect: HTMLElement;
|
|
915
|
+
isDisplaySelection: boolean;
|
|
916
|
+
tableMenu?: InternalModule;
|
|
917
|
+
computeSelectedTds: (startPoint: {
|
|
918
|
+
x: number;
|
|
919
|
+
y: number;
|
|
920
|
+
}, endPoint: {
|
|
921
|
+
x: number;
|
|
922
|
+
y: number;
|
|
923
|
+
}) => TableCellInnerFormat[];
|
|
924
|
+
updateWithSelectedTds: () => void;
|
|
925
|
+
showDisplay: () => void;
|
|
926
|
+
hideDisplay: () => void;
|
|
888
927
|
}
|
|
889
928
|
interface InternalTableMenuModule extends InternalModule {
|
|
890
|
-
|
|
891
|
-
|
|
929
|
+
isMenuDisplay: boolean;
|
|
930
|
+
activeTooltip: MenuTooltipInstance | null;
|
|
892
931
|
}
|
|
893
|
-
type Writable<T> = {
|
|
894
|
-
-readonly [P in keyof T]: T[P];
|
|
895
|
-
};
|
|
932
|
+
type Writable<T> = { -readonly [P in keyof T]: T[P] };
|
|
896
933
|
interface TableConstantsData {
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
934
|
+
blotName: Partial<Record<keyof Writable<typeof blotName>, string>>;
|
|
935
|
+
tableUpSize: Partial<typeof tableUpSize>;
|
|
936
|
+
tableUpEvent: Partial<typeof tableUpEvent>;
|
|
937
|
+
tableUpInternal: Partial<typeof tableUpInternal>;
|
|
901
938
|
}
|
|
902
|
-
|
|
939
|
+
//#endregion
|
|
940
|
+
//#region src/utils/blot-helper.d.ts
|
|
903
941
|
interface ParentBlotReturnMap {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
942
|
+
[blotName.tableWrapper]: TableWrapperFormat;
|
|
943
|
+
[blotName.tableMain]: TableMainFormat;
|
|
944
|
+
[blotName.tableCol]: TableColFormat;
|
|
945
|
+
[blotName.tableColgroup]: TableColgroupFormat;
|
|
946
|
+
[blotName.tableBody]: TableBodyFormat;
|
|
947
|
+
[blotName.tableRow]: TableRowFormat;
|
|
948
|
+
[blotName.tableCell]: TableCellFormat;
|
|
949
|
+
[blotName.tableCellInner]: TableCellInnerFormat;
|
|
912
950
|
}
|
|
913
951
|
type ParentBlotReturn = {
|
|
914
|
-
|
|
952
|
+
[key: string]: Parchment.Parent;
|
|
915
953
|
} & ParentBlotReturnMap;
|
|
916
954
|
declare function findParentBlot<T extends Parchment.Parent, U extends string = string>(blot: Parchment.Blot, targetBlotName: U): U extends keyof ParentBlotReturn ? ParentBlotReturn[U] : T;
|
|
917
|
-
declare function findParentBlots<T extends (keyof ParentBlotReturnMap | string)[]>(blot: Parchment.Blot, targetBlotNames: T): {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
955
|
+
declare function findParentBlots<T extends (keyof ParentBlotReturnMap | string)[]>(blot: Parchment.Blot, targetBlotNames: T): { [K in keyof T]: ParentBlotReturn[T[K]] };
|
|
956
|
+
//#endregion
|
|
957
|
+
//#region src/utils/components/color-picker.d.ts
|
|
921
958
|
interface ColorPickerOptions {
|
|
922
|
-
|
|
923
|
-
|
|
959
|
+
color: string;
|
|
960
|
+
onChange: (color: string) => void;
|
|
924
961
|
}
|
|
925
962
|
declare function createColorPicker(options?: Partial<ColorPickerOptions>): HTMLDivElement;
|
|
926
|
-
|
|
963
|
+
//#endregion
|
|
964
|
+
//#region src/utils/components/table/select-box.d.ts
|
|
927
965
|
interface TableSelectOptions {
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
966
|
+
row: number;
|
|
967
|
+
col: number;
|
|
968
|
+
onSelect: (row: number, col: number) => void;
|
|
969
|
+
customBtn: boolean;
|
|
970
|
+
texts: Partial<TableCreatorTextOptions>;
|
|
933
971
|
}
|
|
934
972
|
declare function createSelectBox(options?: Partial<TableSelectOptions>): HTMLDivElement;
|
|
935
|
-
|
|
973
|
+
//#endregion
|
|
974
|
+
//#region src/utils/components/tooltip.d.ts
|
|
936
975
|
interface ToolTipOptions {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
976
|
+
direction?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
|
|
977
|
+
msg?: string;
|
|
978
|
+
delay?: number;
|
|
979
|
+
content?: HTMLElement;
|
|
980
|
+
container?: HTMLElement;
|
|
981
|
+
type?: 'hover' | 'click';
|
|
982
|
+
onOpen?: (force?: boolean) => boolean;
|
|
983
|
+
onClose?: (force?: boolean) => boolean;
|
|
984
|
+
closed?: () => void;
|
|
985
|
+
onDestroy?: () => void;
|
|
947
986
|
}
|
|
948
987
|
interface TooltipInstance {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
988
|
+
destroy: () => void;
|
|
989
|
+
show: (force?: boolean) => void;
|
|
990
|
+
hide: (force?: boolean) => void;
|
|
952
991
|
}
|
|
953
992
|
declare function createTooltip(target: HTMLElement, options?: ToolTipOptions): TooltipInstance | null;
|
|
954
|
-
|
|
993
|
+
//#endregion
|
|
994
|
+
//#region src/utils/utils.d.ts
|
|
955
995
|
declare const randomId: () => string;
|
|
956
|
-
|
|
996
|
+
//#endregion
|
|
997
|
+
//#region src/table-up.d.ts
|
|
957
998
|
declare function updateTableConstants(data: Partial<TableConstantsData>): void;
|
|
958
999
|
declare function defaultCustomSelect(tableModule: TableUp, picker: QuillThemePicker): HTMLDivElement;
|
|
959
1000
|
declare class TableUp {
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
};
|
|
989
|
-
'table down': {
|
|
990
|
-
bindInHead: boolean;
|
|
991
|
-
key: string;
|
|
992
|
-
collapsed: boolean;
|
|
993
|
-
format: "table-up-cell-inner"[];
|
|
994
|
-
handler(this: {
|
|
995
|
-
quill: Quill;
|
|
996
|
-
}, range: Range, context: Context): boolean;
|
|
997
|
-
};
|
|
998
|
-
'table caption break': {
|
|
999
|
-
bindInHead: boolean;
|
|
1000
|
-
key: string;
|
|
1001
|
-
shiftKey: null;
|
|
1002
|
-
format: "table-up-caption"[];
|
|
1003
|
-
handler(this: {
|
|
1004
|
-
quill: Quill;
|
|
1005
|
-
}, _range: Range, _context: Context): boolean;
|
|
1006
|
-
};
|
|
1001
|
+
static moduleName: string;
|
|
1002
|
+
static toolName: string;
|
|
1003
|
+
static keyboradHandler: {
|
|
1004
|
+
'forbid remove table by backspace': {
|
|
1005
|
+
bindInHead: boolean;
|
|
1006
|
+
key: string;
|
|
1007
|
+
collapsed: boolean;
|
|
1008
|
+
offset: number;
|
|
1009
|
+
handler(this: {
|
|
1010
|
+
quill: Quill;
|
|
1011
|
+
}, range: Range, context: Context): boolean;
|
|
1012
|
+
};
|
|
1013
|
+
'forbid remove table by delete': {
|
|
1014
|
+
bindInHead: boolean;
|
|
1015
|
+
key: string;
|
|
1016
|
+
collapsed: boolean;
|
|
1017
|
+
handler(this: {
|
|
1018
|
+
quill: Quill;
|
|
1019
|
+
}, range: Range, context: Context): boolean;
|
|
1020
|
+
};
|
|
1021
|
+
'table up': {
|
|
1022
|
+
bindInHead: boolean;
|
|
1023
|
+
key: string;
|
|
1024
|
+
collapsed: boolean;
|
|
1025
|
+
format: "table-up-cell-inner"[];
|
|
1026
|
+
handler(this: {
|
|
1027
|
+
quill: Quill;
|
|
1028
|
+
}, range: Range, context: Context): boolean;
|
|
1007
1029
|
};
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1030
|
+
'table down': {
|
|
1031
|
+
bindInHead: boolean;
|
|
1032
|
+
key: string;
|
|
1033
|
+
collapsed: boolean;
|
|
1034
|
+
format: "table-up-cell-inner"[];
|
|
1035
|
+
handler(this: {
|
|
1036
|
+
quill: Quill;
|
|
1037
|
+
}, range: Range, context: Context): boolean;
|
|
1038
|
+
};
|
|
1039
|
+
'table caption break': {
|
|
1040
|
+
bindInHead: boolean;
|
|
1041
|
+
key: string;
|
|
1042
|
+
shiftKey: null;
|
|
1043
|
+
format: "table-up-caption"[];
|
|
1044
|
+
handler(this: {
|
|
1045
|
+
quill: Quill;
|
|
1046
|
+
}, _range: Range, _context: Context): boolean;
|
|
1047
|
+
};
|
|
1048
|
+
};
|
|
1049
|
+
static register(): void;
|
|
1050
|
+
quill: Quill;
|
|
1051
|
+
options: TableUpOptions;
|
|
1052
|
+
toolBox: HTMLDivElement;
|
|
1053
|
+
fixTableByLisenter: (this: any) => void;
|
|
1054
|
+
selector?: HTMLElement;
|
|
1055
|
+
table?: HTMLElement;
|
|
1056
|
+
tableSelection?: InternalTableSelectionModule;
|
|
1057
|
+
tableResize?: InternalModule;
|
|
1058
|
+
tableScrollbar?: InternalModule;
|
|
1059
|
+
tableAlign?: InternalModule;
|
|
1060
|
+
tableResizeScale?: InternalModule;
|
|
1061
|
+
resizeOb: ResizeObserver;
|
|
1062
|
+
get statics(): any;
|
|
1063
|
+
constructor(quill: Quill, options: Partial<TableUpOptions>);
|
|
1064
|
+
initialContainer(): HTMLDivElement;
|
|
1065
|
+
addContainer(classes: string | HTMLElement): HTMLElement;
|
|
1066
|
+
resolveOptions(options: Partial<TableUpOptions>): TableUpOptions;
|
|
1067
|
+
resolveTexts(options: Partial<TableTextOptions>): {
|
|
1068
|
+
fullCheckboxText: string;
|
|
1069
|
+
customBtnText: string;
|
|
1070
|
+
confirmText: string;
|
|
1071
|
+
cancelText: string;
|
|
1072
|
+
rowText: string;
|
|
1073
|
+
colText: string;
|
|
1074
|
+
notPositiveNumberError: string;
|
|
1075
|
+
custom: string;
|
|
1076
|
+
clear: string;
|
|
1077
|
+
transparent: string;
|
|
1078
|
+
perWidthInsufficient: string;
|
|
1079
|
+
CopyCell: string;
|
|
1080
|
+
CutCell: string;
|
|
1081
|
+
InsertTop: string;
|
|
1082
|
+
InsertRight: string;
|
|
1083
|
+
InsertBottom: string;
|
|
1084
|
+
InsertLeft: string;
|
|
1085
|
+
MergeCell: string;
|
|
1086
|
+
SplitCell: string;
|
|
1087
|
+
DeleteRow: string;
|
|
1088
|
+
DeleteColumn: string;
|
|
1089
|
+
DeleteTable: string;
|
|
1090
|
+
BackgroundColor: string;
|
|
1091
|
+
BorderColor: string;
|
|
1092
|
+
} & Partial<TableTextOptions>;
|
|
1093
|
+
quillHack(): void;
|
|
1094
|
+
showTableTools(table: HTMLElement): void;
|
|
1095
|
+
hideTableTools(): void;
|
|
1096
|
+
buildCustomSelect(customSelect: ((module: TableUp, picker: QuillThemePicker) => HTMLElement | Promise<HTMLElement>) | undefined, picker: QuillThemePicker): Promise<void>;
|
|
1097
|
+
setCellAttrs(selectedTds: TableCellInnerFormat[], attr: string, value?: any, isStyle?: boolean): void;
|
|
1098
|
+
getTextByCell(tds: TableCellInnerFormat[]): string;
|
|
1099
|
+
getHTMLByCell(tds: TableCellInnerFormat[], isCut?: boolean): string;
|
|
1100
|
+
insertTable(rows: number, columns: number): void;
|
|
1101
|
+
calculateTableCellBorderWidth(): number;
|
|
1102
|
+
fixUnusuaDeletelTable(tableBlot: TableMainFormat): void;
|
|
1103
|
+
balanceTables(): void;
|
|
1104
|
+
listenBalanceCells(): void;
|
|
1105
|
+
deleteTable(selectedTds: TableCellInnerFormat[]): void;
|
|
1106
|
+
appendRow(selectedTds: TableCellInnerFormat[], isDown: boolean): void;
|
|
1107
|
+
appendCol(selectedTds: TableCellInnerFormat[], isRight: boolean): void;
|
|
1108
|
+
/**
|
|
1109
|
+
* after insert or remove cell. handle cell colspan and rowspan merge
|
|
1110
|
+
*/
|
|
1111
|
+
fixTableByRemove(tableBlot: TableMainFormat): void;
|
|
1112
|
+
removeRow(selectedTds: TableCellInnerFormat[]): void;
|
|
1113
|
+
removeCol(selectedTds: TableCellInnerFormat[]): void;
|
|
1114
|
+
mergeCells(selectedTds: TableCellInnerFormat[]): void;
|
|
1115
|
+
splitCell(selectedTds: TableCellInnerFormat[]): void;
|
|
1075
1116
|
}
|
|
1076
|
-
|
|
1077
|
-
export { BlockOverride, ContainerFormat, ScrollOverride, Scrollbar, TableAlign, TableBodyFormat, TableCaptionFormat, TableCellFormat, TableCellInnerFormat, TableClipboard, TableColFormat, TableColgroupFormat, TableMainFormat, TableMenuCommon, TableMenuContextmenu, TableMenuSelect, TableResizeBox, TableResizeCommon, TableResizeLine, TableResizeScale, TableRowFormat, TableSelection, TableUp, TableVirtualScrollbar, TableWrapperFormat, blotName, createColorPicker, createSelectBox, createTooltip, TableUp as default, defaultCustomSelect, findParentBlot, findParentBlots, getTableMainRect, isTableAlignRight, randomId, tableMenuTools, tableUpEvent, tableUpInternal, tableUpSize, updateTableConstants };
|
|
1078
|
-
|
|
1117
|
+
//#endregion
|
|
1118
|
+
export { BlockOverride, ClipboardOptions, Constructor, ContainerFormat, InternalModule, InternalTableMenuModule, InternalTableSelectionModule, Matcher, MenuTooltipInstance, QuillTheme, QuillThemePicker, RelactiveRect, ScrollOverride, Scrollbar, SelectionData, Selector, SkipRowCount, TableAlign, TableBodyFormat, TableCaptionFormat, TableCaptionValue, TableCellFormat, TableCellInnerFormat, TableCellValue, TableClipboard, TableColFormat, TableColValue, TableColgroupFormat, TableConstantsData, TableCreatorTextOptions, TableMainFormat, TableMenuCommon, TableMenuContextmenu, TableMenuOptions, TableMenuOptionsInput, TableMenuSelect, TableMenuTexts, TableResizeBox, TableResizeCommon, TableResizeLine, TableResizeScale, TableResizeScaleOptions, TableRowFormat, TableRowValue, TableSelection, TableSelectionOptions, TableTextOptions, TableUp, TableUpOptions, TableValue, TableVirtualScrollbar, TableWrapperFormat, Tool, ToolOption, ToolOptionBreak, Writable, blotName, createColorPicker, createSelectBox, createTooltip, TableUp as default, defaultCustomSelect, findParentBlot, findParentBlots, getTableMainRect, isTableAlignRight, randomId, sizeChangeValue, tableMenuTools, tableUpEvent, tableUpInternal, tableUpSize, updateTableConstants };
|
|
1119
|
+
//# sourceMappingURL=index.d.ts.map
|