@ckeditor/ckeditor5-table 48.2.0-alpha.7 → 48.3.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/dist/augmentation.d.ts +80 -80
- package/dist/commands/insertcolumncommand.d.ts +50 -50
- package/dist/commands/insertrowcommand.d.ts +49 -49
- package/dist/commands/inserttablecommand.d.ts +43 -43
- package/dist/commands/inserttablelayoutcommand.d.ts +34 -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 +38 -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.css.map +1 -1
- package/dist/index.d.ts +98 -98
- package/dist/index.js +12835 -14503
- package/dist/index.js.map +1 -1
- package/dist/plaintableoutput.d.ts +28 -28
- package/dist/table.d.ts +39 -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 +23 -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 +123 -123
- package/dist/tablecellproperties/tablecellpropertiesutils.d.ts +13 -13
- package/dist/tablecellproperties/ui/tablecellpropertiesview.d.ts +257 -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/constants.d.ts +23 -23
- package/dist/tablecolumnresize/converters.d.ts +20 -20
- package/dist/tablecolumnresize/tablecolumnresizeediting.d.ts +184 -184
- package/dist/tablecolumnresize/tablewidthscommand.d.ts +31 -31
- package/dist/tablecolumnresize/utils.d.ts +127 -127
- package/dist/tablecolumnresize.d.ts +25 -25
- package/dist/tableconfig.d.ts +670 -670
- package/dist/tableediting.d.ts +99 -99
- package/dist/tablekeyboard.d.ts +67 -67
- package/dist/tablelayout/commands/tabletypecommand.d.ts +38 -38
- package/dist/tablelayout/tablelayoutediting.d.ts +58 -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 +207 -207
- package/dist/tableproperties.d.ts +29 -29
- package/dist/tableselection.d.ts +106 -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/ui/colorinputview.d.ts +137 -137
- package/dist/ui/inserttableview.d.ts +78 -78
- package/dist/utils/common.d.ts +58 -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 +195 -192
- package/dist/utils/ui/widget.d.ts +22 -22
- package/package.json +9 -9
package/dist/tableconfig.d.ts
CHANGED
|
@@ -1,698 +1,698 @@
|
|
|
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
|
+
* When set to `true` (default), the editor visually displays dashed borders around table elements (`<table>`, `<td>`, `<th>`)
|
|
250
|
+
* that contain inline styles explicitly removing borders (for example: `border: none`, `border-top-style: none`, etc.).
|
|
251
|
+
*
|
|
252
|
+
* This visualization is shown **only in the editing view**.
|
|
253
|
+
* It does not modify the underlying table data or the HTML produced by the editor.
|
|
254
|
+
* When set to `false`, the editor will not render any dashed borders, and elements with `border: none`
|
|
255
|
+
* will remain visually borderless during editing.
|
|
256
|
+
*
|
|
257
|
+
* ```ts
|
|
258
|
+
* const tableConfig = {
|
|
259
|
+
* showHiddenBorders: false
|
|
260
|
+
* };
|
|
261
|
+
* ```
|
|
262
|
+
*
|
|
263
|
+
* @default true
|
|
264
|
+
*/
|
|
265
|
+
showHiddenBorders?: boolean;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
* The configuration of the table properties user interface (balloon).
|
|
269
|
+
*/
|
|
270
270
|
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
|
-
|
|
271
|
+
/**
|
|
272
|
+
* The color palette for the table border color picker.
|
|
273
|
+
*
|
|
274
|
+
* ```ts
|
|
275
|
+
* const tableConfig = {
|
|
276
|
+
* tableProperties: {
|
|
277
|
+
* borderColors: [
|
|
278
|
+
* {
|
|
279
|
+
* color: 'hsl(0, 0%, 0%)',
|
|
280
|
+
* label: 'Black'
|
|
281
|
+
* },
|
|
282
|
+
* {
|
|
283
|
+
* color: 'hsl(0, 0%, 100%)',
|
|
284
|
+
* label: 'White',
|
|
285
|
+
* hasBorder: true
|
|
286
|
+
* }
|
|
287
|
+
* ]
|
|
288
|
+
* }
|
|
289
|
+
* };
|
|
290
|
+
* ```
|
|
291
|
+
*
|
|
292
|
+
* **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
|
|
293
|
+
*
|
|
294
|
+
* Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
|
|
295
|
+
*
|
|
296
|
+
* @see {@link module:table/tableconfig~TableColorConfig}
|
|
297
|
+
*/
|
|
298
|
+
borderColors?: TableColorConfig;
|
|
299
|
+
/**
|
|
300
|
+
* The color palette for the table background color picker.
|
|
301
|
+
*
|
|
302
|
+
* ```ts
|
|
303
|
+
* const tableConfig = {
|
|
304
|
+
* tableProperties: {
|
|
305
|
+
* backgroundColors: [
|
|
306
|
+
* {
|
|
307
|
+
* color: 'hsl(0, 0%, 100%)',
|
|
308
|
+
* label: 'White',
|
|
309
|
+
* hasBorder: true
|
|
310
|
+
* },
|
|
311
|
+
* {
|
|
312
|
+
* color: 'hsl(120, 75%, 60%)',
|
|
313
|
+
* label: 'Green'
|
|
314
|
+
* }
|
|
315
|
+
* ]
|
|
316
|
+
* }
|
|
317
|
+
* };
|
|
318
|
+
* ```
|
|
319
|
+
*
|
|
320
|
+
* **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
|
|
321
|
+
*
|
|
322
|
+
* Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
|
|
323
|
+
*
|
|
324
|
+
* @see {@link module:table/tableconfig~TableColorConfig}
|
|
325
|
+
*/
|
|
326
|
+
backgroundColors?: TableColorConfig;
|
|
327
|
+
/**
|
|
328
|
+
* Default styles for newly created tables.
|
|
329
|
+
*
|
|
330
|
+
* ```ts
|
|
331
|
+
* const tableConfig = {
|
|
332
|
+
* tableProperties: {
|
|
333
|
+
* defaultProperties: {
|
|
334
|
+
* borderStyle: 'dashed',
|
|
335
|
+
* borderColor: 'hsl(0, 0%, 90%)',
|
|
336
|
+
* borderWidth: '3px',
|
|
337
|
+
* alignment: 'left',
|
|
338
|
+
* width: '550px',
|
|
339
|
+
* height: '450px'
|
|
340
|
+
* }
|
|
341
|
+
* }
|
|
342
|
+
* }
|
|
343
|
+
* ```
|
|
344
|
+
*
|
|
345
|
+
* **Note**: The model does not store the default values. The editor will only keep values that differ from the defaults.
|
|
346
|
+
*
|
|
347
|
+
* See {@link module:table/tableconfig~TablePropertiesOptions} for the full list of properties.
|
|
348
|
+
*/
|
|
349
|
+
defaultProperties?: TablePropertiesOptions;
|
|
350
|
+
/**
|
|
351
|
+
* Configuration of the table alignment behavior in the editor output.
|
|
352
|
+
*
|
|
353
|
+
* ```ts
|
|
354
|
+
* const tableConfig = {
|
|
355
|
+
* tableProperties: {
|
|
356
|
+
* alignment: {
|
|
357
|
+
* useInlineStyles: true // Use inline styles instead of CSS classes
|
|
358
|
+
* }
|
|
359
|
+
* }
|
|
360
|
+
* };
|
|
361
|
+
* ```
|
|
362
|
+
*/
|
|
363
|
+
alignment?: TableAlignmentConfig;
|
|
364
|
+
/**
|
|
365
|
+
* Configuration of the color picker in the table properties balloon.
|
|
366
|
+
*
|
|
367
|
+
* If set to `false` the picker will not appear.
|
|
368
|
+
*/
|
|
369
|
+
colorPicker?: false | ColorPickerConfig;
|
|
370
370
|
}
|
|
371
371
|
/**
|
|
372
|
-
|
|
373
|
-
|
|
372
|
+
* The configuration of the table default properties feature.
|
|
373
|
+
*/
|
|
374
374
|
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
|
-
|
|
375
|
+
/**
|
|
376
|
+
* The default `width` of the table.
|
|
377
|
+
*/
|
|
378
|
+
width?: string;
|
|
379
|
+
/**
|
|
380
|
+
* The default `height` of the table.
|
|
381
|
+
*/
|
|
382
|
+
height?: string;
|
|
383
|
+
/**
|
|
384
|
+
* The default `background-color` of the table.
|
|
385
|
+
*/
|
|
386
|
+
backgroundColor?: string;
|
|
387
|
+
/**
|
|
388
|
+
* The default `border-color` of the table.
|
|
389
|
+
*/
|
|
390
|
+
borderColor?: string;
|
|
391
|
+
/**
|
|
392
|
+
* The default `border-width` of the table.
|
|
393
|
+
*/
|
|
394
|
+
borderWidth?: string;
|
|
395
|
+
/**
|
|
396
|
+
* The default `border-style` of the table.
|
|
397
|
+
*
|
|
398
|
+
* @default 'none'
|
|
399
|
+
*/
|
|
400
|
+
borderStyle?: string;
|
|
401
|
+
/**
|
|
402
|
+
* The default `alignment` of the table.
|
|
403
|
+
*
|
|
404
|
+
* @default 'center'
|
|
405
|
+
*/
|
|
406
|
+
alignment?: string;
|
|
407
407
|
}
|
|
408
408
|
/**
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
* The configuration of the table cell properties user interface (balloon).
|
|
410
|
+
*/
|
|
411
411
|
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
|
-
|
|
412
|
+
/**
|
|
413
|
+
* The color palette for the table cell border color picker.
|
|
414
|
+
*
|
|
415
|
+
* ```ts
|
|
416
|
+
* const tableConfig = {
|
|
417
|
+
* tableCellProperties: {
|
|
418
|
+
* borderColors: [
|
|
419
|
+
* {
|
|
420
|
+
* color: 'hsl(0, 0%, 0%)',
|
|
421
|
+
* label: 'Black'
|
|
422
|
+
* },
|
|
423
|
+
* {
|
|
424
|
+
* color: 'hsl(0, 0%, 100%)',
|
|
425
|
+
* label: 'White',
|
|
426
|
+
* hasBorder: true
|
|
427
|
+
* }
|
|
428
|
+
* ]
|
|
429
|
+
* }
|
|
430
|
+
* };
|
|
431
|
+
* ```
|
|
432
|
+
*
|
|
433
|
+
* **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
|
|
434
|
+
*
|
|
435
|
+
* Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
|
|
436
|
+
*
|
|
437
|
+
* @see {@link module:table/tableconfig~TableColorConfig}
|
|
438
|
+
*/
|
|
439
|
+
borderColors?: TableColorConfig;
|
|
440
|
+
/**
|
|
441
|
+
* The color palette for the table cell background color picker.
|
|
442
|
+
*
|
|
443
|
+
* ```ts
|
|
444
|
+
* const tableConfig = {
|
|
445
|
+
* tableCellProperties: {
|
|
446
|
+
* backgroundColors: [
|
|
447
|
+
* {
|
|
448
|
+
* color: 'hsl(0, 0%, 100%)',
|
|
449
|
+
* label: 'White',
|
|
450
|
+
* hasBorder: true
|
|
451
|
+
* },
|
|
452
|
+
* {
|
|
453
|
+
* color: 'hsl(120, 75%, 60%)',
|
|
454
|
+
* label: 'Green'
|
|
455
|
+
* }
|
|
456
|
+
* ]
|
|
457
|
+
* }
|
|
458
|
+
* };
|
|
459
|
+
* ```
|
|
460
|
+
*
|
|
461
|
+
* **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
|
|
462
|
+
*
|
|
463
|
+
* Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
|
|
464
|
+
*
|
|
465
|
+
* @see {@link module:table/tableconfig~TableColorConfig}
|
|
466
|
+
*/
|
|
467
|
+
backgroundColors?: TableColorConfig;
|
|
468
|
+
/**
|
|
469
|
+
* Default styles for newly created table cells.
|
|
470
|
+
*
|
|
471
|
+
* ```ts
|
|
472
|
+
* const tableConfig = {
|
|
473
|
+
* tableCellProperties: {
|
|
474
|
+
* defaultProperties: {
|
|
475
|
+
* borderStyle: 'dashed',
|
|
476
|
+
* borderColor: 'hsl(0, 0%, 90%)',
|
|
477
|
+
* borderWidth: '3px',
|
|
478
|
+
* horizontalAlignment: 'center',
|
|
479
|
+
* verticalAlignment: 'middle',
|
|
480
|
+
* padding: '10px'
|
|
481
|
+
* }
|
|
482
|
+
* }
|
|
483
|
+
* }
|
|
484
|
+
* ```
|
|
485
|
+
*
|
|
486
|
+
* **Note**: The model does not store the default values. The editor will only keep values that differ from the defaults.
|
|
487
|
+
*
|
|
488
|
+
* See {@link module:table/tableconfig~TableCellPropertiesOptions} for the full list of properties.
|
|
489
|
+
*/
|
|
490
|
+
defaultProperties?: TableCellPropertiesOptions;
|
|
491
|
+
/**
|
|
492
|
+
* Configuration of the color picker in the table cell properties balloon.
|
|
493
|
+
*
|
|
494
|
+
* If set to `false` the picker will not appear.
|
|
495
|
+
*/
|
|
496
|
+
colorPicker?: false | ColorPickerConfig;
|
|
497
|
+
/**
|
|
498
|
+
* If set to `true`, the `scope` attribute will be applied to table headers (`<th>`) based on their position in the table.
|
|
499
|
+
*
|
|
500
|
+
* The table cell properties UI will extend a dropdown with two more options that allow manually setting the header scope:
|
|
501
|
+
*
|
|
502
|
+
* * `Column header` — sets `scope="col"` on `<th>`.
|
|
503
|
+
* * `Row header` — sets `scope="row"` on `<th>`.
|
|
504
|
+
*
|
|
505
|
+
* If header cell is both in a heading row and a heading column, the `col` scope will be prioritized by the header rows
|
|
506
|
+
* and columns setting logic. In such case, the user can manually change the scope using the table cell properties UI.
|
|
507
|
+
*
|
|
508
|
+
* To disable this behavior:
|
|
509
|
+
*
|
|
510
|
+
* ```ts
|
|
511
|
+
* const tableConfig = {
|
|
512
|
+
* tableCellProperties: {
|
|
513
|
+
* scopedHeaders: false
|
|
514
|
+
* }
|
|
515
|
+
* };
|
|
516
|
+
* ```
|
|
517
|
+
*
|
|
518
|
+
* @default true
|
|
519
|
+
*/
|
|
520
|
+
scopedHeaders?: boolean;
|
|
521
521
|
}
|
|
522
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
|
-
|
|
548
|
-
|
|
523
|
+
* An array of color definitions (either strings or objects).
|
|
524
|
+
*
|
|
525
|
+
* ```ts
|
|
526
|
+
* const colors = [
|
|
527
|
+
* {
|
|
528
|
+
* color: 'hsl(0, 0%, 60%)',
|
|
529
|
+
* label: 'Grey'
|
|
530
|
+
* },
|
|
531
|
+
* 'hsl(0, 0%, 80%)',
|
|
532
|
+
* {
|
|
533
|
+
* color: 'hsl(0, 0%, 90%)',
|
|
534
|
+
* label: 'Light grey'
|
|
535
|
+
* },
|
|
536
|
+
* {
|
|
537
|
+
* color: 'hsl(0, 0%, 100%)',
|
|
538
|
+
* label: 'White',
|
|
539
|
+
* hasBorder: true
|
|
540
|
+
* },
|
|
541
|
+
* '#FF0000'
|
|
542
|
+
* ]
|
|
543
|
+
* ```
|
|
544
|
+
*
|
|
545
|
+
* Usually used as a configuration parameter, for instance in
|
|
546
|
+
* {@link module:table/tableconfig~TableConfig#tableProperties `config.table.tableProperties`}
|
|
547
|
+
* or {@link module:table/tableconfig~TableConfig#tableCellProperties `config.table.tableCellProperties`}.
|
|
548
|
+
*/
|
|
549
549
|
export type TableColorConfig = Array<ColorOption>;
|
|
550
550
|
/**
|
|
551
|
-
|
|
552
|
-
|
|
551
|
+
* The configuration of the table cell default properties feature.
|
|
552
|
+
*/
|
|
553
553
|
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
|
-
|
|
554
|
+
/**
|
|
555
|
+
* The default `width` of the table cell.
|
|
556
|
+
*/
|
|
557
|
+
width?: string;
|
|
558
|
+
/**
|
|
559
|
+
* The default `height` of the table cell.
|
|
560
|
+
*/
|
|
561
|
+
height?: string;
|
|
562
|
+
/**
|
|
563
|
+
* The default `padding` of the table cell.
|
|
564
|
+
*/
|
|
565
|
+
padding?: string;
|
|
566
|
+
/**
|
|
567
|
+
* The default `background-color` of the table cell.
|
|
568
|
+
*/
|
|
569
|
+
backgroundColor?: string;
|
|
570
|
+
/**
|
|
571
|
+
* The default `border-color` of the table cell.
|
|
572
|
+
*/
|
|
573
|
+
borderColor?: string;
|
|
574
|
+
/**
|
|
575
|
+
* The default `border-width` of the table cell.
|
|
576
|
+
*/
|
|
577
|
+
borderWidth?: string;
|
|
578
|
+
/**
|
|
579
|
+
* The default `border-style` of the table cell.
|
|
580
|
+
*
|
|
581
|
+
* @default 'none'
|
|
582
|
+
*/
|
|
583
|
+
borderStyle?: string;
|
|
584
|
+
/**
|
|
585
|
+
* The default `horizontalAlignment` of the table cell.
|
|
586
|
+
*
|
|
587
|
+
* @default 'center'
|
|
588
|
+
*/
|
|
589
|
+
horizontalAlignment?: string;
|
|
590
|
+
/**
|
|
591
|
+
* The default `verticalAlignment` of the table cell.
|
|
592
|
+
*
|
|
593
|
+
* @default 'middle'
|
|
594
|
+
*/
|
|
595
|
+
verticalAlignment?: string;
|
|
596
596
|
}
|
|
597
597
|
/**
|
|
598
|
-
|
|
599
|
-
|
|
598
|
+
* The configuration of the table layout feature.
|
|
599
|
+
*/
|
|
600
600
|
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
|
-
|
|
601
|
+
/**
|
|
602
|
+
* Sets the preferred type for loading external tables.
|
|
603
|
+
*
|
|
604
|
+
* This setting overrides the default detection method and uses the specified type ('content' or 'layout').
|
|
605
|
+
*
|
|
606
|
+
* ```ts
|
|
607
|
+
* ClassicEditor
|
|
608
|
+
* .create( {
|
|
609
|
+
* table: {
|
|
610
|
+
* tableLayout: {
|
|
611
|
+
* preferredExternalTableType: 'content' // or 'layout'
|
|
612
|
+
* }
|
|
613
|
+
* }
|
|
614
|
+
* } )
|
|
615
|
+
* .then( ... )
|
|
616
|
+
* .catch( ... );
|
|
617
|
+
* ```
|
|
618
|
+
*/
|
|
619
|
+
preferredExternalTableType: TableType;
|
|
620
|
+
/**
|
|
621
|
+
* When set to `true`, the editor strips the `<figure>` tag from the table data with the "content" type.
|
|
622
|
+
*
|
|
623
|
+
* ```ts
|
|
624
|
+
* ClassicEditor
|
|
625
|
+
* .create( {
|
|
626
|
+
* table: {
|
|
627
|
+
* tableLayout: {
|
|
628
|
+
* stripFigureFromContentTable: true // or false
|
|
629
|
+
* }
|
|
630
|
+
* }
|
|
631
|
+
* } )
|
|
632
|
+
* .then( ... )
|
|
633
|
+
* .catch( ... );
|
|
634
|
+
* ```
|
|
635
|
+
*
|
|
636
|
+
* @default false
|
|
637
|
+
*/
|
|
638
|
+
stripFigureFromContentTable?: boolean;
|
|
639
639
|
}
|
|
640
640
|
/**
|
|
641
|
-
|
|
642
|
-
|
|
641
|
+
* The configuration of the table caption feature.
|
|
642
|
+
*/
|
|
643
643
|
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
|
-
|
|
644
|
+
/**
|
|
645
|
+
* Sets the preferred HTML structure for table captions.
|
|
646
|
+
*
|
|
647
|
+
* When this option is `false` (the default) the structure is like this:
|
|
648
|
+
*
|
|
649
|
+
* ```html
|
|
650
|
+
* <figure class="table">
|
|
651
|
+
* <table>
|
|
652
|
+
* <tbody> ... </tbody>
|
|
653
|
+
* </table>
|
|
654
|
+
* <figcaption> ... </figcaption>
|
|
655
|
+
* </figure>
|
|
656
|
+
* ```
|
|
657
|
+
*
|
|
658
|
+
* When this option is `true` the structure is like this:
|
|
659
|
+
*
|
|
660
|
+
* ```html
|
|
661
|
+
* <figure class="table">
|
|
662
|
+
* <table>
|
|
663
|
+
* <tbody> ... </tbody>
|
|
664
|
+
* <caption> ... </caption>
|
|
665
|
+
* </table>
|
|
666
|
+
* </figure>
|
|
667
|
+
* ```
|
|
668
|
+
*
|
|
669
|
+
* ```ts
|
|
670
|
+
* ClassicEditor
|
|
671
|
+
* .create( {
|
|
672
|
+
* table: {
|
|
673
|
+
* tableCaption: {
|
|
674
|
+
* useCaptionElement: true
|
|
675
|
+
* }
|
|
676
|
+
* }
|
|
677
|
+
* } )
|
|
678
|
+
* .then( ... )
|
|
679
|
+
* .catch( ... );
|
|
680
|
+
* ```
|
|
681
|
+
*/
|
|
682
|
+
useCaptionElement?: boolean;
|
|
683
683
|
}
|
|
684
684
|
/**
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
export type TableType =
|
|
685
|
+
* The type of the table.
|
|
686
|
+
*/
|
|
687
|
+
export type TableType = "content" | "layout";
|
|
688
688
|
export interface TableAlignmentConfig {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
689
|
+
/**
|
|
690
|
+
* Whether to use inline styles for table alignment in the editor output.
|
|
691
|
+
*
|
|
692
|
+
* * When `true`, the alignment is rendered as inline styles.
|
|
693
|
+
* * When `false` (default), the alignment is rendered as CSS classes.
|
|
694
|
+
*
|
|
695
|
+
* @default false
|
|
696
|
+
*/
|
|
697
|
+
useInlineStyles?: boolean;
|
|
698
698
|
}
|