@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
package/dist/tableconfig.d.ts
CHANGED
|
@@ -1,698 +1,764 @@
|
|
|
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 { ToolbarConfigItem } from
|
|
9
|
-
import type { ColorOption, ColorPickerConfig } from
|
|
6
|
+
* @module table/tableconfig
|
|
7
|
+
*/
|
|
8
|
+
import type { ToolbarConfigItem } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { ColorOption, ColorPickerConfig } from "@ckeditor/ckeditor5-ui";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
* The configuration of the table feature. Used by the table feature in the `@ckeditor/ckeditor5-table` package.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* ClassicEditor
|
|
15
|
+
* .create( {
|
|
16
|
+
* table: ... // Table feature options.
|
|
17
|
+
* } )
|
|
18
|
+
* .then( ... )
|
|
19
|
+
* .catch( ... );
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
23
|
+
*/
|
|
24
24
|
export interface TableConfig {
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Number of rows and columns to render by the table heading when inserting new tables.
|
|
27
|
+
*
|
|
28
|
+
* You can configure it like this:
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* const tableConfig = {
|
|
32
|
+
* defaultHeadings: {
|
|
33
|
+
* rows: 1,
|
|
34
|
+
* columns: 1
|
|
35
|
+
* }
|
|
36
|
+
* };
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* Both rows and columns properties are optional, defaulting to 0 (no heading).
|
|
40
|
+
*/
|
|
41
|
+
defaultHeadings?: {
|
|
42
|
+
rows?: number;
|
|
43
|
+
columns?: number;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Number of footer rows to render by default when inserting new tables.
|
|
47
|
+
*
|
|
48
|
+
* You can configure it like this:
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* const tableConfig = {
|
|
52
|
+
* defaultFooters: 1
|
|
53
|
+
* };
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* The rows property is optional, defaulting to 0 (no footer).
|
|
57
|
+
* This option is ignored when {@link module:table/tableconfig~TableConfig#enableFooters `config.table.enableFooters`} is `false`.
|
|
58
|
+
*/
|
|
59
|
+
defaultFooters?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Enables support for table footers (`<tfoot>`).
|
|
62
|
+
*
|
|
63
|
+
* When set to `true`, the editor will upcast and downcast `<tfoot>` elements, and the footer toggle will be visible
|
|
64
|
+
* in the table row dropdown.
|
|
65
|
+
* When set to `false` (default), footer rows are ignored and the footer toggle is hidden in the table row dropdown.
|
|
66
|
+
*
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
enableFooters?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Items to be placed in the table content toolbar.
|
|
72
|
+
* The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
|
|
73
|
+
*
|
|
74
|
+
* Assuming that you use the {@link module:table/tableui~TableUI} feature, the following toolbar items will be available
|
|
75
|
+
* in {@link module:ui/componentfactory~ComponentFactory}:
|
|
76
|
+
*
|
|
77
|
+
* * `'tableRow'`,
|
|
78
|
+
* * `'tableColumn'`,
|
|
79
|
+
* * `'mergeTableCells'`.
|
|
80
|
+
*
|
|
81
|
+
* You can thus configure the toolbar like this:
|
|
82
|
+
*
|
|
83
|
+
* ```ts
|
|
84
|
+
* const tableConfig = {
|
|
85
|
+
* contentToolbar: [ 'tableRow', 'tableColumn', 'mergeTableCells' ]
|
|
86
|
+
* };
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* Of course, the same buttons can also be used in the
|
|
90
|
+
* {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
|
|
91
|
+
*
|
|
92
|
+
* Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
|
|
93
|
+
*/
|
|
94
|
+
contentToolbar?: Array<ToolbarConfigItem>;
|
|
95
|
+
/**
|
|
96
|
+
* Items to be placed in the table toolbar.
|
|
97
|
+
* The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
|
|
98
|
+
*
|
|
99
|
+
* You can thus configure the toolbar like this:
|
|
100
|
+
*
|
|
101
|
+
* ```ts
|
|
102
|
+
* const tableConfig = {
|
|
103
|
+
* tableToolbar: [ 'blockQuote' ]
|
|
104
|
+
* };
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* Of course, the same buttons can also be used in the
|
|
108
|
+
* {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
|
|
109
|
+
*
|
|
110
|
+
* Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
|
|
111
|
+
*/
|
|
112
|
+
tableToolbar?: Array<ToolbarConfigItem>;
|
|
113
|
+
/**
|
|
114
|
+
* The configuration of the table properties user interface (balloon). It allows us to define:
|
|
115
|
+
*
|
|
116
|
+
* * The color palette for the table border color style field (`tableProperties.borderColors`),
|
|
117
|
+
* * The color palette for the table background style field (`tableProperties.backgroundColors`).
|
|
118
|
+
*
|
|
119
|
+
* ```ts
|
|
120
|
+
* const tableConfig = {
|
|
121
|
+
* tableProperties: {
|
|
122
|
+
* borderColors: [
|
|
123
|
+
* {
|
|
124
|
+
* color: 'hsl(0, 0%, 90%)',
|
|
125
|
+
* label: 'Light grey'
|
|
126
|
+
* },
|
|
127
|
+
* // ...
|
|
128
|
+
* ],
|
|
129
|
+
* backgroundColors: [
|
|
130
|
+
* {
|
|
131
|
+
* color: 'hsl(120, 75%, 60%)',
|
|
132
|
+
* label: 'Green'
|
|
133
|
+
* },
|
|
134
|
+
* // ...
|
|
135
|
+
* ]
|
|
136
|
+
* }
|
|
137
|
+
* };
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* * The default styles for tables (`tableProperties.defaultProperties`):
|
|
141
|
+
*
|
|
142
|
+
* ```
|
|
143
|
+
* const tableConfig = {
|
|
144
|
+
* tableProperties: {
|
|
145
|
+
* defaultProperties: {
|
|
146
|
+
* borderStyle: 'dashed',
|
|
147
|
+
* borderColor: 'hsl(0, 0%, 90%)',
|
|
148
|
+
* borderWidth: '3px',
|
|
149
|
+
* alignment: 'left'
|
|
150
|
+
* }
|
|
151
|
+
* }
|
|
152
|
+
* }
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* {@link module:table/tableconfig~TablePropertiesOptions Read more about the supported properties.}
|
|
156
|
+
*
|
|
157
|
+
* **Note**: The `borderColors` and `backgroundColors` options do not impact the data loaded into the editor,
|
|
158
|
+
* i.e., they do not limit or filter the colors in the data. They are used only in the user interface,
|
|
159
|
+
* allowing users to pick colors more conveniently. The `defaultProperties` option does impact the data.
|
|
160
|
+
* The editor model will not keep the default values.
|
|
161
|
+
*
|
|
162
|
+
* The default color palettes for the table background and the table border are the same
|
|
163
|
+
* ({@link module:table/utils/ui/table-properties#defaultColors check out their content}).
|
|
164
|
+
*
|
|
165
|
+
* Both color palette configurations must follow the
|
|
166
|
+
* {@link module:table/tableconfig~TableColorConfig table color configuration format}.
|
|
167
|
+
*
|
|
168
|
+
* Read more about configuring the table feature in {@link module:table/tableconfig~TableConfig}.
|
|
169
|
+
*/
|
|
170
|
+
tableProperties?: TablePropertiesConfig;
|
|
171
|
+
/**
|
|
172
|
+
* The configuration of the table cell properties user interface (balloon). It allows us to define:
|
|
173
|
+
*
|
|
174
|
+
* * The color palette for the cell border color style field (`tableCellProperties.borderColors`),
|
|
175
|
+
* * The color palette for the cell background style field (`tableCellProperties.backgroundColors`).
|
|
176
|
+
*
|
|
177
|
+
* ```ts
|
|
178
|
+
* const tableConfig = {
|
|
179
|
+
* tableCellProperties: {
|
|
180
|
+
* borderColors: [
|
|
181
|
+
* {
|
|
182
|
+
* color: 'hsl(0, 0%, 90%)',
|
|
183
|
+
* label: 'Light grey'
|
|
184
|
+
* },
|
|
185
|
+
* // ...
|
|
186
|
+
* ],
|
|
187
|
+
* backgroundColors: [
|
|
188
|
+
* {
|
|
189
|
+
* color: 'hsl(120, 75%, 60%)',
|
|
190
|
+
* label: 'Green'
|
|
191
|
+
* },
|
|
192
|
+
* // ...
|
|
193
|
+
* ]
|
|
194
|
+
* }
|
|
195
|
+
* };
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* * The default styles for table cells (`tableCellProperties.defaultProperties`):
|
|
199
|
+
*
|
|
200
|
+
* ```ts
|
|
201
|
+
* const tableConfig = {
|
|
202
|
+
* tableCellProperties: {
|
|
203
|
+
* defaultProperties: {
|
|
204
|
+
* horizontalAlignment: 'right',
|
|
205
|
+
* verticalAlignment: 'bottom',
|
|
206
|
+
* padding: '5px'
|
|
207
|
+
* }
|
|
208
|
+
* }
|
|
209
|
+
* }
|
|
210
|
+
* ```
|
|
211
|
+
*
|
|
212
|
+
* {@link module:table/tableconfig~TablePropertiesOptions Read more about the supported properties.}
|
|
213
|
+
*
|
|
214
|
+
* **Note**: The `borderColors` and `backgroundColors` options do not impact the data loaded into the editor,
|
|
215
|
+
* i.e., they do not limit or filter the colors in the data. They are used only in the user interface,
|
|
216
|
+
* allowing users to pick colors in a more convenient way. The `defaultProperties` option does impact the data.
|
|
217
|
+
* The editor model will not keep the default values.
|
|
218
|
+
*
|
|
219
|
+
* The default color palettes for the cell background and the cell border are identical
|
|
220
|
+
* ({@link module:table/utils/ui/table-properties#defaultColors check out their content}).
|
|
221
|
+
*
|
|
222
|
+
* Both color palette configurations must follow the
|
|
223
|
+
* {@link module:table/tableconfig~TableColorConfig table color configuration format}.
|
|
224
|
+
*
|
|
225
|
+
* Read more about configuring the table feature in {@link module:table/tableconfig~TableConfig}.
|
|
226
|
+
*/
|
|
227
|
+
tableCellProperties?: TableCellPropertiesConfig;
|
|
228
|
+
/**
|
|
229
|
+
* Configuration of the table layout feature.
|
|
230
|
+
*
|
|
231
|
+
* ```ts
|
|
232
|
+
* const tableConfig = {
|
|
233
|
+
* tableLayout: ... // Table layout feature config.
|
|
234
|
+
* };
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
tableLayout?: TableLayoutConfig;
|
|
238
|
+
/**
|
|
239
|
+
* Configuration of the table caption feature.
|
|
240
|
+
*
|
|
241
|
+
* ```ts
|
|
242
|
+
* const tableConfig = {
|
|
243
|
+
* tableCaption: ... // Table caption feature config.
|
|
244
|
+
* };
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
247
|
+
tableCaption?: TableCaptionConfig;
|
|
248
|
+
/**
|
|
249
|
+
* Configuration of the table scroll feature.
|
|
250
|
+
*
|
|
251
|
+
* ```ts
|
|
252
|
+
* const tableConfig = {
|
|
253
|
+
* tableScroll: ... // Table scroll feature config.
|
|
254
|
+
* };
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
tableScroll?: TableScrollConfig;
|
|
258
|
+
/**
|
|
259
|
+
* When set to `true` (default), the editor visually displays dashed borders around table elements (`<table>`, `<td>`, `<th>`)
|
|
260
|
+
* that contain inline styles explicitly removing borders (for example: `border: none`, `border-top-style: none`, etc.).
|
|
261
|
+
*
|
|
262
|
+
* This visualization is shown **only in the editing view**.
|
|
263
|
+
* It does not modify the underlying table data or the HTML produced by the editor.
|
|
264
|
+
* When set to `false`, the editor will not render any dashed borders, and elements with `border: none`
|
|
265
|
+
* will remain visually borderless during editing.
|
|
266
|
+
*
|
|
267
|
+
* ```ts
|
|
268
|
+
* const tableConfig = {
|
|
269
|
+
* showHiddenBorders: false
|
|
270
|
+
* };
|
|
271
|
+
* ```
|
|
272
|
+
*
|
|
273
|
+
* @default true
|
|
274
|
+
*/
|
|
275
|
+
showHiddenBorders?: boolean;
|
|
266
276
|
}
|
|
267
277
|
/**
|
|
268
|
-
|
|
269
|
-
|
|
278
|
+
* The configuration of the table properties user interface (balloon).
|
|
279
|
+
*/
|
|
270
280
|
export interface TablePropertiesConfig {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
281
|
+
/**
|
|
282
|
+
* The color palette for the table border color picker.
|
|
283
|
+
*
|
|
284
|
+
* ```ts
|
|
285
|
+
* const tableConfig = {
|
|
286
|
+
* tableProperties: {
|
|
287
|
+
* borderColors: [
|
|
288
|
+
* {
|
|
289
|
+
* color: 'hsl(0, 0%, 0%)',
|
|
290
|
+
* label: 'Black'
|
|
291
|
+
* },
|
|
292
|
+
* {
|
|
293
|
+
* color: 'hsl(0, 0%, 100%)',
|
|
294
|
+
* label: 'White',
|
|
295
|
+
* hasBorder: true
|
|
296
|
+
* }
|
|
297
|
+
* ]
|
|
298
|
+
* }
|
|
299
|
+
* };
|
|
300
|
+
* ```
|
|
301
|
+
*
|
|
302
|
+
* **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
|
|
303
|
+
*
|
|
304
|
+
* Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
|
|
305
|
+
*
|
|
306
|
+
* @see {@link module:table/tableconfig~TableColorConfig}
|
|
307
|
+
*/
|
|
308
|
+
borderColors?: TableColorConfig;
|
|
309
|
+
/**
|
|
310
|
+
* The color palette for the table background color picker.
|
|
311
|
+
*
|
|
312
|
+
* ```ts
|
|
313
|
+
* const tableConfig = {
|
|
314
|
+
* tableProperties: {
|
|
315
|
+
* backgroundColors: [
|
|
316
|
+
* {
|
|
317
|
+
* color: 'hsl(0, 0%, 100%)',
|
|
318
|
+
* label: 'White',
|
|
319
|
+
* hasBorder: true
|
|
320
|
+
* },
|
|
321
|
+
* {
|
|
322
|
+
* color: 'hsl(120, 75%, 60%)',
|
|
323
|
+
* label: 'Green'
|
|
324
|
+
* }
|
|
325
|
+
* ]
|
|
326
|
+
* }
|
|
327
|
+
* };
|
|
328
|
+
* ```
|
|
329
|
+
*
|
|
330
|
+
* **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
|
|
331
|
+
*
|
|
332
|
+
* Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
|
|
333
|
+
*
|
|
334
|
+
* @see {@link module:table/tableconfig~TableColorConfig}
|
|
335
|
+
*/
|
|
336
|
+
backgroundColors?: TableColorConfig;
|
|
337
|
+
/**
|
|
338
|
+
* Default styles for newly created tables.
|
|
339
|
+
*
|
|
340
|
+
* ```ts
|
|
341
|
+
* const tableConfig = {
|
|
342
|
+
* tableProperties: {
|
|
343
|
+
* defaultProperties: {
|
|
344
|
+
* borderStyle: 'dashed',
|
|
345
|
+
* borderColor: 'hsl(0, 0%, 90%)',
|
|
346
|
+
* borderWidth: '3px',
|
|
347
|
+
* alignment: 'left',
|
|
348
|
+
* width: '550px',
|
|
349
|
+
* height: '450px'
|
|
350
|
+
* }
|
|
351
|
+
* }
|
|
352
|
+
* }
|
|
353
|
+
* ```
|
|
354
|
+
*
|
|
355
|
+
* **Note**: The model does not store the default values. The editor will only keep values that differ from the defaults.
|
|
356
|
+
*
|
|
357
|
+
* See {@link module:table/tableconfig~TablePropertiesOptions} for the full list of properties.
|
|
358
|
+
*/
|
|
359
|
+
defaultProperties?: TablePropertiesOptions;
|
|
360
|
+
/**
|
|
361
|
+
* Configuration of the table alignment behavior in the editor output.
|
|
362
|
+
*
|
|
363
|
+
* ```ts
|
|
364
|
+
* const tableConfig = {
|
|
365
|
+
* tableProperties: {
|
|
366
|
+
* alignment: {
|
|
367
|
+
* useInlineStyles: true // Use inline styles instead of CSS classes
|
|
368
|
+
* }
|
|
369
|
+
* }
|
|
370
|
+
* };
|
|
371
|
+
* ```
|
|
372
|
+
*/
|
|
373
|
+
alignment?: TableAlignmentConfig;
|
|
374
|
+
/**
|
|
375
|
+
* The number of columns in the `borderColors` and `backgroundColors` palettes of the table properties balloon.
|
|
376
|
+
*
|
|
377
|
+
* ```ts
|
|
378
|
+
* const tableConfig = {
|
|
379
|
+
* tableProperties: {
|
|
380
|
+
* colorGridColumns: 8
|
|
381
|
+
* }
|
|
382
|
+
* };
|
|
383
|
+
* ```
|
|
384
|
+
*
|
|
385
|
+
* Defaults to {@link module:ui/colorgrid/colors~defaultColorGridColumns}.
|
|
386
|
+
*/
|
|
387
|
+
colorGridColumns?: number;
|
|
388
|
+
/**
|
|
389
|
+
* Configuration of the color picker in the table properties balloon.
|
|
390
|
+
*
|
|
391
|
+
* If set to `false` the picker will not appear.
|
|
392
|
+
*/
|
|
393
|
+
colorPicker?: false | ColorPickerConfig;
|
|
370
394
|
}
|
|
371
395
|
/**
|
|
372
|
-
|
|
373
|
-
|
|
396
|
+
* The configuration of the table default properties feature.
|
|
397
|
+
*/
|
|
374
398
|
export interface TablePropertiesOptions {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
399
|
+
/**
|
|
400
|
+
* The default `width` of the table.
|
|
401
|
+
*/
|
|
402
|
+
width?: string;
|
|
403
|
+
/**
|
|
404
|
+
* The default `height` of the table.
|
|
405
|
+
*/
|
|
406
|
+
height?: string;
|
|
407
|
+
/**
|
|
408
|
+
* The default `background-color` of the table.
|
|
409
|
+
*/
|
|
410
|
+
backgroundColor?: string;
|
|
411
|
+
/**
|
|
412
|
+
* The default `border-color` of the table.
|
|
413
|
+
*/
|
|
414
|
+
borderColor?: string;
|
|
415
|
+
/**
|
|
416
|
+
* The default `border-width` of the table.
|
|
417
|
+
*/
|
|
418
|
+
borderWidth?: string;
|
|
419
|
+
/**
|
|
420
|
+
* The default `border-style` of the table.
|
|
421
|
+
*
|
|
422
|
+
* @default 'none'
|
|
423
|
+
*/
|
|
424
|
+
borderStyle?: string;
|
|
425
|
+
/**
|
|
426
|
+
* The default `alignment` of the table.
|
|
427
|
+
*
|
|
428
|
+
* @default 'center'
|
|
429
|
+
*/
|
|
430
|
+
alignment?: string;
|
|
407
431
|
}
|
|
408
432
|
/**
|
|
409
|
-
|
|
410
|
-
|
|
433
|
+
* The configuration of the table cell properties user interface (balloon).
|
|
434
|
+
*/
|
|
411
435
|
export interface TableCellPropertiesConfig {
|
|
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
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
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
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
436
|
+
/**
|
|
437
|
+
* The color palette for the table cell border color picker.
|
|
438
|
+
*
|
|
439
|
+
* ```ts
|
|
440
|
+
* const tableConfig = {
|
|
441
|
+
* tableCellProperties: {
|
|
442
|
+
* borderColors: [
|
|
443
|
+
* {
|
|
444
|
+
* color: 'hsl(0, 0%, 0%)',
|
|
445
|
+
* label: 'Black'
|
|
446
|
+
* },
|
|
447
|
+
* {
|
|
448
|
+
* color: 'hsl(0, 0%, 100%)',
|
|
449
|
+
* label: 'White',
|
|
450
|
+
* hasBorder: true
|
|
451
|
+
* }
|
|
452
|
+
* ]
|
|
453
|
+
* }
|
|
454
|
+
* };
|
|
455
|
+
* ```
|
|
456
|
+
*
|
|
457
|
+
* **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
|
|
458
|
+
*
|
|
459
|
+
* Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
|
|
460
|
+
*
|
|
461
|
+
* @see {@link module:table/tableconfig~TableColorConfig}
|
|
462
|
+
*/
|
|
463
|
+
borderColors?: TableColorConfig;
|
|
464
|
+
/**
|
|
465
|
+
* The color palette for the table cell background color picker.
|
|
466
|
+
*
|
|
467
|
+
* ```ts
|
|
468
|
+
* const tableConfig = {
|
|
469
|
+
* tableCellProperties: {
|
|
470
|
+
* backgroundColors: [
|
|
471
|
+
* {
|
|
472
|
+
* color: 'hsl(0, 0%, 100%)',
|
|
473
|
+
* label: 'White',
|
|
474
|
+
* hasBorder: true
|
|
475
|
+
* },
|
|
476
|
+
* {
|
|
477
|
+
* color: 'hsl(120, 75%, 60%)',
|
|
478
|
+
* label: 'Green'
|
|
479
|
+
* }
|
|
480
|
+
* ]
|
|
481
|
+
* }
|
|
482
|
+
* };
|
|
483
|
+
* ```
|
|
484
|
+
*
|
|
485
|
+
* **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
|
|
486
|
+
*
|
|
487
|
+
* Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
|
|
488
|
+
*
|
|
489
|
+
* @see {@link module:table/tableconfig~TableColorConfig}
|
|
490
|
+
*/
|
|
491
|
+
backgroundColors?: TableColorConfig;
|
|
492
|
+
/**
|
|
493
|
+
* Default styles for newly created table cells.
|
|
494
|
+
*
|
|
495
|
+
* ```ts
|
|
496
|
+
* const tableConfig = {
|
|
497
|
+
* tableCellProperties: {
|
|
498
|
+
* defaultProperties: {
|
|
499
|
+
* borderStyle: 'dashed',
|
|
500
|
+
* borderColor: 'hsl(0, 0%, 90%)',
|
|
501
|
+
* borderWidth: '3px',
|
|
502
|
+
* horizontalAlignment: 'center',
|
|
503
|
+
* verticalAlignment: 'middle',
|
|
504
|
+
* padding: '10px'
|
|
505
|
+
* }
|
|
506
|
+
* }
|
|
507
|
+
* }
|
|
508
|
+
* ```
|
|
509
|
+
*
|
|
510
|
+
* **Note**: The model does not store the default values. The editor will only keep values that differ from the defaults.
|
|
511
|
+
*
|
|
512
|
+
* See {@link module:table/tableconfig~TableCellPropertiesOptions} for the full list of properties.
|
|
513
|
+
*/
|
|
514
|
+
defaultProperties?: TableCellPropertiesOptions;
|
|
515
|
+
/**
|
|
516
|
+
* The number of columns in the `borderColors` and `backgroundColors` palettes of the table cell properties balloon.
|
|
517
|
+
*
|
|
518
|
+
* ```ts
|
|
519
|
+
* const tableConfig = {
|
|
520
|
+
* tableCellProperties: {
|
|
521
|
+
* colorGridColumns: 8
|
|
522
|
+
* }
|
|
523
|
+
* };
|
|
524
|
+
* ```
|
|
525
|
+
*
|
|
526
|
+
* Defaults to {@link module:ui/colorgrid/colors~defaultColorGridColumns}.
|
|
527
|
+
*/
|
|
528
|
+
colorGridColumns?: number;
|
|
529
|
+
/**
|
|
530
|
+
* Configuration of the color picker in the table cell properties balloon.
|
|
531
|
+
*
|
|
532
|
+
* If set to `false` the picker will not appear.
|
|
533
|
+
*/
|
|
534
|
+
colorPicker?: false | ColorPickerConfig;
|
|
535
|
+
/**
|
|
536
|
+
* If set to `true`, the `scope` attribute will be applied to table headers (`<th>`) based on their position in the table.
|
|
537
|
+
*
|
|
538
|
+
* The table cell properties UI will extend a dropdown with two more options that allow manually setting the header scope:
|
|
539
|
+
*
|
|
540
|
+
* * `Column header` — sets `scope="col"` on `<th>`.
|
|
541
|
+
* * `Row header` — sets `scope="row"` on `<th>`.
|
|
542
|
+
*
|
|
543
|
+
* If header cell is both in a heading row and a heading column, the `col` scope will be prioritized by the header rows
|
|
544
|
+
* and columns setting logic. In such case, the user can manually change the scope using the table cell properties UI.
|
|
545
|
+
*
|
|
546
|
+
* To disable this behavior:
|
|
547
|
+
*
|
|
548
|
+
* ```ts
|
|
549
|
+
* const tableConfig = {
|
|
550
|
+
* tableCellProperties: {
|
|
551
|
+
* scopedHeaders: false
|
|
552
|
+
* }
|
|
553
|
+
* };
|
|
554
|
+
* ```
|
|
555
|
+
*
|
|
556
|
+
* @default true
|
|
557
|
+
*/
|
|
558
|
+
scopedHeaders?: boolean;
|
|
521
559
|
}
|
|
522
560
|
/**
|
|
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
|
-
|
|
548
|
-
|
|
561
|
+
* An array of color definitions (either strings or objects).
|
|
562
|
+
*
|
|
563
|
+
* ```ts
|
|
564
|
+
* const colors = [
|
|
565
|
+
* {
|
|
566
|
+
* color: 'hsl(0, 0%, 60%)',
|
|
567
|
+
* label: 'Grey'
|
|
568
|
+
* },
|
|
569
|
+
* 'hsl(0, 0%, 80%)',
|
|
570
|
+
* {
|
|
571
|
+
* color: 'hsl(0, 0%, 90%)',
|
|
572
|
+
* label: 'Light grey'
|
|
573
|
+
* },
|
|
574
|
+
* {
|
|
575
|
+
* color: 'hsl(0, 0%, 100%)',
|
|
576
|
+
* label: 'White',
|
|
577
|
+
* hasBorder: true
|
|
578
|
+
* },
|
|
579
|
+
* '#FF0000'
|
|
580
|
+
* ]
|
|
581
|
+
* ```
|
|
582
|
+
*
|
|
583
|
+
* Usually used as a configuration parameter, for instance in
|
|
584
|
+
* {@link module:table/tableconfig~TableConfig#tableProperties `config.table.tableProperties`}
|
|
585
|
+
* or {@link module:table/tableconfig~TableConfig#tableCellProperties `config.table.tableCellProperties`}.
|
|
586
|
+
*/
|
|
549
587
|
export type TableColorConfig = Array<ColorOption>;
|
|
550
588
|
/**
|
|
551
|
-
|
|
552
|
-
|
|
589
|
+
* The configuration of the table cell default properties feature.
|
|
590
|
+
*/
|
|
553
591
|
export interface TableCellPropertiesOptions {
|
|
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
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
592
|
+
/**
|
|
593
|
+
* The default `width` of the table cell.
|
|
594
|
+
*/
|
|
595
|
+
width?: string;
|
|
596
|
+
/**
|
|
597
|
+
* The default `height` of the table cell.
|
|
598
|
+
*/
|
|
599
|
+
height?: string;
|
|
600
|
+
/**
|
|
601
|
+
* The default `padding` of the table cell.
|
|
602
|
+
*/
|
|
603
|
+
padding?: string;
|
|
604
|
+
/**
|
|
605
|
+
* The default `background-color` of the table cell.
|
|
606
|
+
*/
|
|
607
|
+
backgroundColor?: string;
|
|
608
|
+
/**
|
|
609
|
+
* The default `border-color` of the table cell.
|
|
610
|
+
*/
|
|
611
|
+
borderColor?: string;
|
|
612
|
+
/**
|
|
613
|
+
* The default `border-width` of the table cell.
|
|
614
|
+
*/
|
|
615
|
+
borderWidth?: string;
|
|
616
|
+
/**
|
|
617
|
+
* The default `border-style` of the table cell.
|
|
618
|
+
*
|
|
619
|
+
* @default 'none'
|
|
620
|
+
*/
|
|
621
|
+
borderStyle?: string;
|
|
622
|
+
/**
|
|
623
|
+
* The default `horizontalAlignment` of the table cell.
|
|
624
|
+
*
|
|
625
|
+
* @default 'center'
|
|
626
|
+
*/
|
|
627
|
+
horizontalAlignment?: string;
|
|
628
|
+
/**
|
|
629
|
+
* The default `verticalAlignment` of the table cell.
|
|
630
|
+
*
|
|
631
|
+
* @default 'middle'
|
|
632
|
+
*/
|
|
633
|
+
verticalAlignment?: string;
|
|
596
634
|
}
|
|
597
635
|
/**
|
|
598
|
-
|
|
599
|
-
|
|
636
|
+
* The configuration of the table layout feature.
|
|
637
|
+
*/
|
|
600
638
|
export interface TableLayoutConfig {
|
|
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
|
+
* Sets the preferred type for loading external tables.
|
|
641
|
+
*
|
|
642
|
+
* This setting overrides the default detection method and uses the specified type ('content' or 'layout').
|
|
643
|
+
*
|
|
644
|
+
* ```ts
|
|
645
|
+
* ClassicEditor
|
|
646
|
+
* .create( {
|
|
647
|
+
* table: {
|
|
648
|
+
* tableLayout: {
|
|
649
|
+
* preferredExternalTableType: 'content' // or 'layout'
|
|
650
|
+
* }
|
|
651
|
+
* }
|
|
652
|
+
* } )
|
|
653
|
+
* .then( ... )
|
|
654
|
+
* .catch( ... );
|
|
655
|
+
* ```
|
|
656
|
+
*/
|
|
657
|
+
preferredExternalTableType: TableType;
|
|
658
|
+
/**
|
|
659
|
+
* When set to `true`, the editor strips the `<figure>` tag from the table data with the "content" type.
|
|
660
|
+
*
|
|
661
|
+
* ```ts
|
|
662
|
+
* ClassicEditor
|
|
663
|
+
* .create( {
|
|
664
|
+
* table: {
|
|
665
|
+
* tableLayout: {
|
|
666
|
+
* stripFigureFromContentTable: true // or false
|
|
667
|
+
* }
|
|
668
|
+
* }
|
|
669
|
+
* } )
|
|
670
|
+
* .then( ... )
|
|
671
|
+
* .catch( ... );
|
|
672
|
+
* ```
|
|
673
|
+
*
|
|
674
|
+
* @default false
|
|
675
|
+
*/
|
|
676
|
+
stripFigureFromContentTable?: boolean;
|
|
639
677
|
}
|
|
640
678
|
/**
|
|
641
|
-
|
|
642
|
-
|
|
679
|
+
* The configuration of the table caption feature.
|
|
680
|
+
*/
|
|
643
681
|
export interface TableCaptionConfig {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
682
|
+
/**
|
|
683
|
+
* Sets the preferred HTML structure for table captions.
|
|
684
|
+
*
|
|
685
|
+
* When this option is `false` (the default) the structure is like this:
|
|
686
|
+
*
|
|
687
|
+
* ```html
|
|
688
|
+
* <figure class="table">
|
|
689
|
+
* <table>
|
|
690
|
+
* <tbody> ... </tbody>
|
|
691
|
+
* </table>
|
|
692
|
+
* <figcaption> ... </figcaption>
|
|
693
|
+
* </figure>
|
|
694
|
+
* ```
|
|
695
|
+
*
|
|
696
|
+
* When this option is `true` the structure is like this:
|
|
697
|
+
*
|
|
698
|
+
* ```html
|
|
699
|
+
* <figure class="table">
|
|
700
|
+
* <table>
|
|
701
|
+
* <tbody> ... </tbody>
|
|
702
|
+
* <caption> ... </caption>
|
|
703
|
+
* </table>
|
|
704
|
+
* </figure>
|
|
705
|
+
* ```
|
|
706
|
+
*
|
|
707
|
+
* ```ts
|
|
708
|
+
* ClassicEditor
|
|
709
|
+
* .create( {
|
|
710
|
+
* table: {
|
|
711
|
+
* tableCaption: {
|
|
712
|
+
* useCaptionElement: true
|
|
713
|
+
* }
|
|
714
|
+
* }
|
|
715
|
+
* } )
|
|
716
|
+
* .then( ... )
|
|
717
|
+
* .catch( ... );
|
|
718
|
+
* ```
|
|
719
|
+
*/
|
|
720
|
+
useCaptionElement?: boolean;
|
|
683
721
|
}
|
|
684
722
|
/**
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
export
|
|
723
|
+
* The configuration of the table scroll feature.
|
|
724
|
+
*/
|
|
725
|
+
export interface TableScrollConfig {
|
|
726
|
+
/**
|
|
727
|
+
* The list of table types for which a table that is wider than its container is allowed to become
|
|
728
|
+
* horizontally scrollable, and for which the column resize handle is allowed to drag the table's width
|
|
729
|
+
* past 100% of the container width.
|
|
730
|
+
*
|
|
731
|
+
* By default, only `'content'` tables are scrollable. Layout tables are not included by default, since
|
|
732
|
+
* letting a layout table grow past the container width can easily break the intended page layout - to
|
|
733
|
+
* allow it anyway, add `'layout'` to the list:
|
|
734
|
+
*
|
|
735
|
+
* ```ts
|
|
736
|
+
* const tableConfig = {
|
|
737
|
+
* tableScroll: {
|
|
738
|
+
* tableTypes: [ 'content', 'layout' ]
|
|
739
|
+
* }
|
|
740
|
+
* };
|
|
741
|
+
* ```
|
|
742
|
+
*
|
|
743
|
+
* Note that regardless of this setting, only a table that is a direct child of the editing root can become
|
|
744
|
+
* scrollable - a table nested inside another table, a block quote, or any other container never scrolls.
|
|
745
|
+
*
|
|
746
|
+
* @default [ 'content' ]
|
|
747
|
+
*/
|
|
748
|
+
tableTypes?: Array<TableType>;
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* The type of the table.
|
|
752
|
+
*/
|
|
753
|
+
export type TableType = "content" | "layout";
|
|
688
754
|
export interface TableAlignmentConfig {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
755
|
+
/**
|
|
756
|
+
* Whether to use inline styles for table alignment in the editor output.
|
|
757
|
+
*
|
|
758
|
+
* * When `true`, the alignment is rendered as inline styles.
|
|
759
|
+
* * When `false` (default), the alignment is rendered as CSS classes.
|
|
760
|
+
*
|
|
761
|
+
* @default false
|
|
762
|
+
*/
|
|
763
|
+
useInlineStyles?: boolean;
|
|
698
764
|
}
|