@ckeditor/ckeditor5-table 48.8.1-alpha.4 → 49.0.0-alpha.0
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/LICENSE.md +1 -1
- package/ckeditor5-metadata.json +12 -1
- package/dist/augmentation.d.ts +83 -80
- package/dist/commands/insertcolumncommand.d.ts +50 -50
- package/dist/commands/insertrowcommand.d.ts +49 -49
- package/dist/commands/inserttablecommand.d.ts +48 -43
- package/dist/commands/inserttablelayoutcommand.d.ts +39 -34
- package/dist/commands/mergecellcommand.d.ts +63 -63
- package/dist/commands/mergecellscommand.d.ts +24 -24
- package/dist/commands/removecolumncommand.d.ts +24 -24
- package/dist/commands/removerowcommand.d.ts +24 -24
- package/dist/commands/selectcolumncommand.d.ts +28 -28
- package/dist/commands/selectrowcommand.d.ts +28 -28
- package/dist/commands/setfooterrowcommand.d.ts +48 -48
- package/dist/commands/setheadercolumncommand.d.ts +45 -45
- package/dist/commands/setheaderrowcommand.d.ts +48 -48
- package/dist/commands/splitcellcommand.d.ts +39 -38
- package/dist/converters/downcast.d.ts +77 -77
- package/dist/converters/table-caption-post-fixer.d.ts +18 -18
- package/dist/converters/table-cell-paragraph-post-fixer.d.ts +30 -30
- package/dist/converters/table-cell-refresh-handler.d.ts +16 -16
- package/dist/converters/table-layout-post-fixer.d.ts +224 -224
- package/dist/converters/table-structure-post-fixer.d.ts +16 -16
- package/dist/converters/table-structure-refresh-handler.d.ts +15 -15
- package/dist/converters/tableproperties.d.ts +98 -98
- package/dist/converters/upcasttable.d.ts +47 -47
- package/dist/index-content.css +116 -105
- package/dist/index-content.css.map +1 -0
- package/dist/index-editor.css +718 -601
- package/dist/index-editor.css.map +1 -0
- package/dist/index.css +781 -650
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +103 -98
- package/dist/index.js +13669 -14491
- package/dist/index.js.map +1 -1
- package/dist/plaintableoutput.d.ts +28 -28
- package/dist/table.d.ts +38 -39
- package/dist/tablecaption/tablecaptionediting.d.ts +62 -62
- package/dist/tablecaption/tablecaptionui.d.ts +18 -18
- package/dist/tablecaption/toggletablecaptioncommand.d.ts +61 -61
- package/dist/tablecaption/utils.d.ts +31 -31
- package/dist/tablecaption.d.ts +22 -23
- package/dist/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +27 -27
- package/dist/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +32 -32
- package/dist/tablecellproperties/commands/tablecellborderstylecommand.d.ts +32 -32
- package/dist/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +46 -46
- package/dist/tablecellproperties/commands/tablecellheightcommand.d.ts +41 -41
- package/dist/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +27 -27
- package/dist/tablecellproperties/commands/tablecellpaddingcommand.d.ts +46 -46
- package/dist/tablecellproperties/commands/tablecellpropertycommand.d.ts +79 -79
- package/dist/tablecellproperties/commands/tablecelltypecommand.d.ts +42 -42
- package/dist/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +35 -35
- package/dist/tablecellproperties/tablecellpropertiesediting.d.ts +49 -49
- package/dist/tablecellproperties/tablecellpropertiesui.d.ts +130 -123
- package/dist/tablecellproperties/tablecellpropertiesutils.d.ts +13 -13
- package/dist/tablecellproperties/ui/tablecellpropertiesview.d.ts +255 -257
- package/dist/tablecellproperties.d.ts +29 -29
- package/dist/tablecellwidth/commands/tablecellwidthcommand.d.ts +41 -41
- package/dist/tablecellwidth/tablecellwidthediting.d.ts +28 -28
- package/dist/tableclipboard.d.ts +79 -79
- package/dist/tablecolumnresize/commands/tablecolumnwidthcommand.d.ts +56 -0
- package/dist/tablecolumnresize/constants.d.ts +40 -25
- package/dist/tablecolumnresize/converters.d.ts +20 -20
- package/dist/tablecolumnresize/tablecolumnresizeediting.d.ts +263 -184
- package/dist/tablecolumnresize/tablewidthscommand.d.ts +31 -31
- package/dist/tablecolumnresize/utils.d.ts +166 -127
- package/dist/tablecolumnresize.d.ts +24 -25
- package/dist/tableconfig.d.ts +736 -670
- package/dist/tableediting.d.ts +98 -99
- package/dist/tablekeyboard.d.ts +67 -67
- package/dist/tablelayout/commands/tabletypecommand.d.ts +38 -38
- package/dist/tablelayout/tablelayoutediting.d.ts +57 -58
- package/dist/tablelayout/tablelayoutui.d.ts +27 -27
- package/dist/tablelayout.d.ts +25 -25
- package/dist/tablemouse/mouseeventsobserver.d.ts +54 -54
- package/dist/tablemouse.d.ts +47 -47
- package/dist/tableproperties/commands/tablealignmentcommand.d.ts +27 -27
- package/dist/tableproperties/commands/tablebackgroundcolorcommand.d.ts +27 -27
- package/dist/tableproperties/commands/tablebordercolorcommand.d.ts +32 -32
- package/dist/tableproperties/commands/tableborderstylecommand.d.ts +32 -32
- package/dist/tableproperties/commands/tableborderwidthcommand.d.ts +46 -46
- package/dist/tableproperties/commands/tableheightcommand.d.ts +41 -41
- package/dist/tableproperties/commands/tablepropertycommand.d.ts +64 -64
- package/dist/tableproperties/commands/tablewidthcommand.d.ts +41 -41
- package/dist/tableproperties/tablepropertiesediting.d.ts +48 -48
- package/dist/tableproperties/tablepropertiesui.d.ts +131 -131
- package/dist/tableproperties/ui/tablepropertiesview.d.ts +210 -207
- package/dist/tableproperties.d.ts +29 -29
- package/dist/tablescroll/tablescrollediting.d.ts +91 -0
- package/dist/tablescroll/watchers.d.ts +29 -0
- package/dist/tablescroll.d.ts +23 -0
- package/dist/tableselection.d.ts +105 -106
- package/dist/tabletoolbar.d.ts +31 -31
- package/dist/tableui.d.ts +53 -53
- package/dist/tableutils.d.ts +532 -532
- package/dist/tablewalker.d.ts +342 -350
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +5 -3
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +5 -3
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +5 -3
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +5 -3
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +5 -3
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +5 -3
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +5 -3
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +5 -3
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +5 -3
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +5 -3
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +5 -3
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +5 -3
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +5 -3
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +5 -3
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +5 -3
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +5 -3
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +5 -3
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +5 -3
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +5 -3
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +5 -3
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +5 -3
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +5 -3
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +5 -3
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +5 -3
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +5 -3
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +5 -3
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +5 -3
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +5 -3
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +5 -3
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +5 -3
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +5 -3
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +5 -3
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +5 -3
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +5 -3
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +5 -3
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +5 -3
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +5 -3
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +5 -3
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +5 -3
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +5 -3
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +5 -3
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +5 -3
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +5 -3
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +5 -3
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +5 -3
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +5 -3
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +5 -3
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +5 -3
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +5 -3
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +5 -3
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +5 -3
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +5 -3
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +5 -3
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +5 -3
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +5 -3
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +5 -3
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +5 -3
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +5 -3
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +5 -3
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +5 -3
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +5 -3
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +5 -3
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +5 -3
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +5 -3
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +5 -3
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +5 -3
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +5 -3
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +5 -3
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +5 -3
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +5 -3
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +5 -3
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +5 -3
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +5 -3
- package/dist/ui/colorinputview.d.ts +136 -137
- package/dist/ui/inserttableview.d.ts +77 -78
- package/dist/utils/common.d.ts +64 -58
- package/dist/utils/structure.d.ts +229 -229
- package/dist/utils/table-properties.d.ts +92 -92
- package/dist/utils/ui/contextualballoon.d.ts +28 -28
- package/dist/utils/ui/table-properties.d.ts +130 -192
- package/dist/utils/ui/widget.d.ts +22 -22
- package/package.json +11 -10
|
@@ -1,188 +1,267 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { Plugin, type Editor } from
|
|
6
|
-
import type { ModelElement } from
|
|
7
|
-
import { TableEditing } from
|
|
8
|
-
import { TableUtils } from
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
6
|
+
import type { ViewDowncastWriter, ModelElement, ModelWriter, ViewElement } from "@ckeditor/ckeditor5-engine";
|
|
7
|
+
import { TableEditing } from "../tableediting.js";
|
|
8
|
+
import { TableUtils } from "../tableutils.js";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* The table column resize editing plugin.
|
|
11
|
+
*/
|
|
12
12
|
export declare class TableColumnResizeEditing extends Plugin {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
13
|
+
/**
|
|
14
|
+
* A flag indicating if the column resizing is in progress.
|
|
15
|
+
*
|
|
16
|
+
* @observable
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
_isResizingActive: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* A flag indicating if the column resizing is allowed. It is not allowed if the editor is in read-only
|
|
22
|
+
* or comments-only mode or the `TableColumnResize` plugin is disabled.
|
|
23
|
+
*
|
|
24
|
+
* @observable
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
_isResizingAllowed: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* A temporary storage for the required data needed to correctly calculate the widths of the resized columns. This storage is
|
|
30
|
+
* initialized when column resizing begins, and is purged upon completion.
|
|
31
|
+
*/
|
|
32
|
+
private _resizingData;
|
|
33
|
+
/**
|
|
34
|
+
* DOM emitter.
|
|
35
|
+
*/
|
|
36
|
+
private _domEmitter;
|
|
37
|
+
/**
|
|
38
|
+
* A local reference to the {@link module:table/tableutils~TableUtils} plugin.
|
|
39
|
+
*/
|
|
40
|
+
private _tableUtilsPlugin;
|
|
41
|
+
/**
|
|
42
|
+
* Starting mouse position data used to add a threshold to the resizing process.
|
|
43
|
+
*/
|
|
44
|
+
private _initialMouseEventData;
|
|
45
|
+
/**
|
|
46
|
+
* @inheritDoc
|
|
47
|
+
*/
|
|
48
|
+
static get requires(): PluginDependenciesOf<[TableEditing, TableUtils]>;
|
|
49
|
+
/**
|
|
50
|
+
* @inheritDoc
|
|
51
|
+
*/
|
|
52
|
+
static get pluginName(): "TableColumnResizeEditing";
|
|
53
|
+
/**
|
|
54
|
+
* @inheritDoc
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
static get licenseFeatureCode(): string;
|
|
58
|
+
/**
|
|
59
|
+
* @inheritDoc
|
|
60
|
+
*/
|
|
61
|
+
static override get isOfficialPlugin(): true;
|
|
62
|
+
/**
|
|
63
|
+
* @inheritDoc
|
|
64
|
+
*/
|
|
65
|
+
static override get isPremiumPlugin(): true;
|
|
66
|
+
/**
|
|
67
|
+
* @inheritDoc
|
|
68
|
+
*/
|
|
69
|
+
constructor(editor: Editor);
|
|
70
|
+
/**
|
|
71
|
+
* @inheritDoc
|
|
72
|
+
*/
|
|
73
|
+
init(): void;
|
|
74
|
+
/**
|
|
75
|
+
* @inheritDoc
|
|
76
|
+
*/
|
|
77
|
+
afterInit(): void;
|
|
78
|
+
/**
|
|
79
|
+
* @inheritDoc
|
|
80
|
+
*/
|
|
81
|
+
override destroy(): void;
|
|
82
|
+
/**
|
|
83
|
+
* The table for which a column resize is currently in progress, or `null` if no resize is active.
|
|
84
|
+
* Only one table can be resized at a time.
|
|
85
|
+
*/
|
|
86
|
+
get resizingTable(): ModelElement | null;
|
|
87
|
+
/**
|
|
88
|
+
* Returns a 'tableColumnGroup' element from the 'table'.
|
|
89
|
+
*
|
|
90
|
+
* @param element A 'table' or 'tableColumnGroup' element.
|
|
91
|
+
* @returns A 'tableColumnGroup' element.
|
|
92
|
+
*/
|
|
93
|
+
getColumnGroupElement(element: ModelElement): ModelElement | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Returns an array of 'tableColumn' elements.
|
|
96
|
+
*
|
|
97
|
+
* @param element A 'table' or 'tableColumnGroup' element.
|
|
98
|
+
* @returns An array of 'tableColumn' elements.
|
|
99
|
+
*/
|
|
100
|
+
getTableColumnElements(element: ModelElement): Array<ModelElement>;
|
|
101
|
+
/**
|
|
102
|
+
* Returns an array of table column widths.
|
|
103
|
+
*
|
|
104
|
+
* @param element A 'table' or 'tableColumnGroup' element.
|
|
105
|
+
* @returns An array of table column widths.
|
|
106
|
+
*/
|
|
107
|
+
getTableColumnsWidths(element: ModelElement): Array<string>;
|
|
108
|
+
/**
|
|
109
|
+
* Returns the table and the sorted, unique indexes of the columns covered by the given cells (a `colspan` cell
|
|
110
|
+
* covers several columns). Returns `null` when the selection cannot be mapped onto columns - a non-resized table
|
|
111
|
+
* or an irregular column structure.
|
|
112
|
+
*
|
|
113
|
+
* @param cells An array of 'tableCell' model elements.
|
|
114
|
+
*/
|
|
115
|
+
getColumnIndexesForCells(cells: Array<ModelElement>): {
|
|
116
|
+
table: ModelElement;
|
|
117
|
+
columnIndexes: Array<number>;
|
|
118
|
+
} | null;
|
|
119
|
+
/**
|
|
120
|
+
* Applies the given width to every column in `columnIndexes`, keeping the whole table's width mode consistent
|
|
121
|
+
* (see {@link module:table/tablecolumnresize/utils~isTableWidthInPixels}).
|
|
122
|
+
*
|
|
123
|
+
* @param writer A model writer instance.
|
|
124
|
+
* @param table A 'table' model element.
|
|
125
|
+
* @param columnIndexes Indexes of the columns the width is applied to.
|
|
126
|
+
* @param value The width to apply. May be expressed in pixels or as a percentage.
|
|
127
|
+
*/
|
|
128
|
+
applyColumnWidths(writer: ModelWriter, table: ModelElement, columnIndexes: Array<number>, value: string): void;
|
|
129
|
+
/**
|
|
130
|
+
* Converts the column widths of a resized table to the unit of the table's own width (`px` or `%`), so a table
|
|
131
|
+
* width change (in the table properties) also switches the columns' unit. It is a no-op when the table is not
|
|
132
|
+
* resized or the columns already use that unit.
|
|
133
|
+
*/
|
|
134
|
+
private _reconcileColumnUnits;
|
|
135
|
+
/**
|
|
136
|
+
* Applies a column width in the percentage mode: the target column gets the (clamped) percentage and the remaining
|
|
137
|
+
* columns are redistributed proportionally so that all the widths keep summing up to 100%.
|
|
138
|
+
*/
|
|
139
|
+
private _applyPercentageColumnWidths;
|
|
140
|
+
/**
|
|
141
|
+
* Applies a width to the target columns in the percentage mode when the selection reaches the last column. As
|
|
142
|
+
* there is no next column to balance against, the table itself grows or shrinks (like dragging the last column's
|
|
143
|
+
* right edge): every other column keeps its absolute width, so expressed against the resized table their
|
|
144
|
+
* percentages scale, and the table's own width scales by the inverse.
|
|
145
|
+
*/
|
|
146
|
+
private _growTableToColumnWidths;
|
|
147
|
+
/**
|
|
148
|
+
* Applies `width` to whichever element currently represents the table's actual width - by default the
|
|
149
|
+
* widget's `<figure>`. Passing `null` clears it instead of setting anything.
|
|
150
|
+
*
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
_setResizingTableWidth(writer: ViewDowncastWriter, viewFigure: ViewElement, width: string | null): void;
|
|
154
|
+
/**
|
|
155
|
+
* Returns the table's current actual width, read from whichever element holds it - by default the
|
|
156
|
+
* widget's `<figure>`.
|
|
157
|
+
*
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
_getResizingTableWidth(viewFigure: ViewElement): string;
|
|
161
|
+
/**
|
|
162
|
+
* Registers new attributes for a table model element.
|
|
163
|
+
*/
|
|
164
|
+
private _extendSchema;
|
|
165
|
+
/**
|
|
166
|
+
* Registers table column resize post-fixer.
|
|
167
|
+
*
|
|
168
|
+
* It checks if the change from the differ concerns a table-related element or attribute. For detected changes it:
|
|
169
|
+
* * Adjusts the `columnWidths` attribute to guarantee that the sum of the widths from all columns is 100%.
|
|
170
|
+
* * Checks if the `columnWidths` attribute gets updated accordingly after columns have been added or removed.
|
|
171
|
+
*/
|
|
172
|
+
private _registerPostFixer;
|
|
173
|
+
/**
|
|
174
|
+
* Registers table column resize converters.
|
|
175
|
+
*/
|
|
176
|
+
private _registerConverters;
|
|
177
|
+
/**
|
|
178
|
+
* Registers listeners to handle resizing process.
|
|
179
|
+
*/
|
|
180
|
+
private _registerResizingListeners;
|
|
181
|
+
/**
|
|
182
|
+
* Calculate and set `top` and `bottom` styles to the column resizer element to fit the height of the table.
|
|
183
|
+
*
|
|
184
|
+
* @param viewResizer The column resizer element.
|
|
185
|
+
*/
|
|
186
|
+
private _recalculateResizerElement;
|
|
187
|
+
/**
|
|
188
|
+
* Remove `top` and `bottom` styles of the column resizer element.
|
|
189
|
+
*
|
|
190
|
+
* @param viewResizer The column resizer element.
|
|
191
|
+
*/
|
|
192
|
+
private _resetResizerStyles;
|
|
193
|
+
/**
|
|
194
|
+
* Handles the `mouseover` event on column resizer element.
|
|
195
|
+
* Recalculates the `top` and `bottom` styles of the column resizer element to fit the height of the table.
|
|
196
|
+
*
|
|
197
|
+
* @param eventInfo An object containing information about the fired event.
|
|
198
|
+
* @param domEventData The data related to the DOM event.
|
|
199
|
+
*/
|
|
200
|
+
private _onMouseOverHandler;
|
|
201
|
+
/**
|
|
202
|
+
* Handles the `mouseout` event on column resizer element.
|
|
203
|
+
* When resizing is not active, it resets the `top` and `bottom` styles of the column resizer element.
|
|
204
|
+
*
|
|
205
|
+
* @param eventInfo An object containing information about the fired event.
|
|
206
|
+
* @param domEventData The data related to the DOM event.
|
|
207
|
+
*/
|
|
208
|
+
private _onMouseOutHandler;
|
|
209
|
+
/**
|
|
210
|
+
* Handles the `mousedown` event on column resizer element:
|
|
211
|
+
* * calculates the initial column pixel widths,
|
|
212
|
+
* * inserts the `<colgroup>` element if it is not present in the `<table>`,
|
|
213
|
+
* * puts the necessary data in the temporary storage,
|
|
214
|
+
* * applies the attributes to the `<table>` view element.
|
|
215
|
+
*
|
|
216
|
+
* @param eventInfo An object containing information about the fired event.
|
|
217
|
+
* @param domEventData The data related to the DOM event.
|
|
218
|
+
*/
|
|
219
|
+
private _onMouseDownHandler;
|
|
220
|
+
/**
|
|
221
|
+
* Starts the resizing process after the threshold is reached.
|
|
222
|
+
*/
|
|
223
|
+
private _startResizingAfterThreshold;
|
|
224
|
+
/**
|
|
225
|
+
* Handles the `mousemove` event.
|
|
226
|
+
* * If resizing process is not in progress, it does nothing.
|
|
227
|
+
* * If resizing is active but not allowed, it stops the resizing process instantly calling the `mousedown` event handler.
|
|
228
|
+
* * Otherwise it dynamically updates the widths of the resized columns.
|
|
229
|
+
*
|
|
230
|
+
* @param eventInfo An object containing information about the fired event.
|
|
231
|
+
* @param mouseEventData The native DOM event.
|
|
232
|
+
*/
|
|
233
|
+
private _onMouseMoveHandler;
|
|
234
|
+
/**
|
|
235
|
+
* Handles the `mouseup` event.
|
|
236
|
+
* * If resizing process is not in progress, it does nothing.
|
|
237
|
+
* * If resizing is active but not allowed, it cancels the resizing process restoring the original widths.
|
|
238
|
+
* * Otherwise it propagates the changes from view to the model by executing the adequate commands.
|
|
239
|
+
*/
|
|
240
|
+
private _onMouseUpHandler;
|
|
241
|
+
/**
|
|
242
|
+
* Retrieves and returns required data needed for the resizing process.
|
|
243
|
+
*
|
|
244
|
+
* @param domEventData The data of the `mousedown` event.
|
|
245
|
+
* @param columnWidths The current widths of the columns.
|
|
246
|
+
* @returns The data needed for the resizing process.
|
|
247
|
+
*/
|
|
248
|
+
private _getResizingData;
|
|
249
|
+
/**
|
|
250
|
+
* Registers a listener ensuring that each resizable cell have a resizer handle.
|
|
251
|
+
*/
|
|
252
|
+
private _registerResizerInserter;
|
|
188
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Given the table width a drag would naturally produce, returns the width that should actually be applied
|
|
256
|
+
* once snapping and growth resistance around the container's width are taken into account:
|
|
257
|
+
*
|
|
258
|
+
* * if the natural width lands close to the container's width (on either side), it's pulled to exactly
|
|
259
|
+
* match it,
|
|
260
|
+
* * if the natural width is past the container's width, it stays pinned at the container's width until the
|
|
261
|
+
* drag has gone far enough beyond it (the "resistance" zone) - past that point it keeps growing 1:1,
|
|
262
|
+
* continuing smoothly from where the resistance was overcome instead of jumping,
|
|
263
|
+
* * shrinking below the container's width is never resisted, only snapped when close.
|
|
264
|
+
*
|
|
265
|
+
* @internal
|
|
266
|
+
*/
|
|
267
|
+
export declare function applyContainerWidthResistance(naturalTableWidth: number, containerWidth: number): number;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import type { ModelElement } from
|
|
9
|
-
import { Command } from
|
|
6
|
+
* @module table/tablecolumnresize/tablewidthscommand
|
|
7
|
+
*/
|
|
8
|
+
import type { ModelElement } from "@ckeditor/ckeditor5-engine";
|
|
9
|
+
import { Command } from "@ckeditor/ckeditor5-core";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
* Command used by the {@link module:table/tablecolumnresize~TableColumnResize Table column resize feature} that
|
|
12
|
+
* updates the width of the whole table as well as its individual columns.
|
|
13
|
+
*/
|
|
14
14
|
export declare class TableWidthsCommand extends Command {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
override refresh(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Updated the `tableWidth` attribute of the table and the `columnWidth` attribute of the columns of that table.
|
|
21
|
+
*/
|
|
22
|
+
override execute(options?: TableWidthsCommandOptions): void;
|
|
23
23
|
}
|
|
24
24
|
export interface TableWidthsCommandOptions {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
/**
|
|
26
|
+
* New value of the `columnWidths` attribute. Must be array of strings or string with comma-separated values.
|
|
27
|
+
* If skipped, the column widths information will be deleted.
|
|
28
|
+
*/
|
|
29
|
+
columnWidths?: Array<string> | string;
|
|
30
|
+
/**
|
|
31
|
+
* The new table width. If skipped, the model attribute will be removed.
|
|
32
|
+
*/
|
|
33
|
+
tableWidth?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The table that is having the columns resized.
|
|
36
|
+
*/
|
|
37
|
+
table?: ModelElement;
|
|
38
38
|
}
|