@ckeditor/ckeditor5-table 41.3.0 → 41.4.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/index-content.css +55 -0
- package/dist/index-editor.css +150 -0
- package/dist/index.css +362 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +10464 -0
- package/dist/index.js.map +1 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +5 -0
- package/dist/translations/az.d.ts +8 -0
- package/dist/translations/az.js +5 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +5 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +5 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +5 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +5 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +5 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +5 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +5 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +5 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +5 -0
- package/dist/translations/en-gb.d.ts +8 -0
- package/dist/translations/en-gb.js +5 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +5 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +5 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +5 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +5 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +5 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +5 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +5 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +5 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +5 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +5 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +5 -0
- package/dist/translations/hy.d.ts +8 -0
- package/dist/translations/hy.js +5 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +5 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +5 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +5 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +5 -0
- package/dist/translations/ku.d.ts +8 -0
- package/dist/translations/ku.js +5 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +5 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +5 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +5 -0
- package/dist/translations/nb.d.ts +8 -0
- package/dist/translations/nb.js +5 -0
- package/dist/translations/ne.d.ts +8 -0
- package/dist/translations/ne.js +5 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +5 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +5 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +5 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +5 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +5 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +5 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +5 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +5 -0
- package/dist/translations/sl.d.ts +8 -0
- package/dist/translations/sl.js +5 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +5 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +5 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +5 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +5 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +5 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +5 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +5 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +5 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +5 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +5 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +5 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +5 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +5 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +5 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +5 -0
- package/dist/types/augmentation.d.ts +80 -0
- package/dist/types/commands/insertcolumncommand.d.ts +59 -0
- package/dist/types/commands/insertrowcommand.d.ts +58 -0
- package/dist/types/commands/inserttablecommand.d.ts +48 -0
- package/dist/types/commands/mergecellcommand.d.ts +72 -0
- package/dist/types/commands/mergecellscommand.d.ts +32 -0
- package/dist/types/commands/removecolumncommand.d.ts +33 -0
- package/dist/types/commands/removerowcommand.d.ts +33 -0
- package/dist/types/commands/selectcolumncommand.d.ts +37 -0
- package/dist/types/commands/selectrowcommand.d.ts +37 -0
- package/dist/types/commands/setheadercolumncommand.d.ts +54 -0
- package/dist/types/commands/setheaderrowcommand.d.ts +57 -0
- package/dist/types/commands/splitcellcommand.d.ts +47 -0
- package/dist/types/converters/downcast.d.ts +67 -0
- package/dist/types/converters/table-caption-post-fixer.d.ts +24 -0
- package/dist/types/converters/table-cell-paragraph-post-fixer.d.ts +36 -0
- package/dist/types/converters/table-cell-refresh-handler.d.ts +22 -0
- package/dist/types/converters/table-headings-refresh-handler.d.ts +21 -0
- package/dist/types/converters/table-layout-post-fixer.d.ts +230 -0
- package/dist/types/converters/tableproperties.d.ts +58 -0
- package/dist/types/converters/upcasttable.d.ts +53 -0
- package/dist/types/index.d.ts +64 -0
- package/dist/types/plaintableoutput.d.ts +30 -0
- package/dist/types/table.d.ts +44 -0
- package/dist/types/tablecaption/tablecaptionediting.d.ts +67 -0
- package/dist/types/tablecaption/tablecaptionui.d.ts +25 -0
- package/dist/types/tablecaption/toggletablecaptioncommand.d.ts +72 -0
- package/dist/types/tablecaption/utils.d.ts +42 -0
- package/dist/types/tablecaption.d.ts +28 -0
- package/dist/types/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +36 -0
- package/dist/types/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +41 -0
- package/dist/types/tablecellproperties/commands/tablecellborderstylecommand.d.ts +41 -0
- package/dist/types/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +55 -0
- package/dist/types/tablecellproperties/commands/tablecellheightcommand.d.ts +50 -0
- package/dist/types/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +36 -0
- package/dist/types/tablecellproperties/commands/tablecellpaddingcommand.d.ts +55 -0
- package/dist/types/tablecellproperties/commands/tablecellpropertycommand.d.ts +66 -0
- package/dist/types/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +44 -0
- package/dist/types/tablecellproperties/tablecellpropertiesediting.d.ts +47 -0
- package/dist/types/tablecellproperties/tablecellpropertiesui.d.ts +116 -0
- package/dist/types/tablecellproperties/ui/tablecellpropertiesview.d.ts +232 -0
- package/dist/types/tablecellproperties.d.ts +34 -0
- package/dist/types/tablecellwidth/commands/tablecellwidthcommand.d.ts +50 -0
- package/dist/types/tablecellwidth/tablecellwidthediting.d.ts +33 -0
- package/dist/types/tableclipboard.d.ts +74 -0
- package/dist/types/tablecolumnresize/constants.d.ts +24 -0
- package/dist/types/tablecolumnresize/converters.d.ts +22 -0
- package/dist/types/tablecolumnresize/tablecolumnresizeediting.d.ts +143 -0
- package/dist/types/tablecolumnresize/tablewidthscommand.d.ts +42 -0
- package/dist/types/tablecolumnresize/utils.d.ts +152 -0
- package/dist/types/tablecolumnresize.d.ts +30 -0
- package/dist/types/tableconfig.d.ts +347 -0
- package/dist/types/tableediting.d.ts +102 -0
- package/dist/types/tablekeyboard.d.ts +72 -0
- package/dist/types/tablemouse/mouseeventsobserver.d.ts +66 -0
- package/dist/types/tablemouse.d.ts +52 -0
- package/dist/types/tableproperties/commands/tablealignmentcommand.d.ts +36 -0
- package/dist/types/tableproperties/commands/tablebackgroundcolorcommand.d.ts +36 -0
- package/dist/types/tableproperties/commands/tablebordercolorcommand.d.ts +41 -0
- package/dist/types/tableproperties/commands/tableborderstylecommand.d.ts +41 -0
- package/dist/types/tableproperties/commands/tableborderwidthcommand.d.ts +55 -0
- package/dist/types/tableproperties/commands/tableheightcommand.d.ts +50 -0
- package/dist/types/tableproperties/commands/tablepropertycommand.d.ts +65 -0
- package/dist/types/tableproperties/commands/tablewidthcommand.d.ts +50 -0
- package/dist/types/tableproperties/tablepropertiesediting.d.ts +44 -0
- package/dist/types/tableproperties/tablepropertiesui.d.ts +118 -0
- package/dist/types/tableproperties/ui/tablepropertiesview.d.ts +211 -0
- package/dist/types/tableproperties.d.ts +34 -0
- package/dist/types/tableselection.d.ts +111 -0
- package/dist/types/tabletoolbar.d.ts +36 -0
- package/dist/types/tableui.d.ts +58 -0
- package/dist/types/tableutils.d.ts +452 -0
- package/dist/types/tablewalker.d.ts +366 -0
- package/dist/types/ui/colorinputview.d.ts +144 -0
- package/dist/types/ui/formrowview.d.ts +65 -0
- package/dist/types/ui/inserttableview.d.ts +85 -0
- package/dist/types/utils/common.d.ts +50 -0
- package/dist/types/utils/structure.d.ts +249 -0
- package/dist/types/utils/table-properties.d.ts +71 -0
- package/dist/types/utils/ui/contextualballoon.d.ts +38 -0
- package/dist/types/utils/ui/table-properties.d.ts +199 -0
- package/dist/types/utils/ui/widget.d.ts +24 -0
- package/package.json +3 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/commands/mergecellcommand
|
|
11
|
+
*/
|
|
12
|
+
import type { Node } from 'ckeditor5/src/engine.js';
|
|
13
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import type { ArrowKeyCodeDirection } from 'ckeditor5/src/utils.js';
|
|
15
|
+
/**
|
|
16
|
+
* The merge cell command.
|
|
17
|
+
*
|
|
18
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCellRight'`, `'mergeTableCellLeft'`,
|
|
19
|
+
* `'mergeTableCellUp'` and `'mergeTableCellDown'` editor commands.
|
|
20
|
+
*
|
|
21
|
+
* To merge a table cell at the current selection with another cell, execute the command corresponding with the preferred direction.
|
|
22
|
+
*
|
|
23
|
+
* For example, to merge with a cell to the right:
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* editor.execute( 'mergeTableCellRight' );
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* **Note**: If a table cell has a different [`rowspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-rowspan)
|
|
30
|
+
* (for `'mergeTableCellRight'` and `'mergeTableCellLeft'`) or [`colspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-colspan)
|
|
31
|
+
* (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.
|
|
32
|
+
*/
|
|
33
|
+
export default class MergeCellCommand extends Command {
|
|
34
|
+
/**
|
|
35
|
+
* The direction that indicates which cell will be merged with the currently selected one.
|
|
36
|
+
*/
|
|
37
|
+
readonly direction: ArrowKeyCodeDirection;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the merge is horizontal (left/right) or vertical (up/down).
|
|
40
|
+
*/
|
|
41
|
+
readonly isHorizontal: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
value: Node | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a new `MergeCellCommand` instance.
|
|
48
|
+
*
|
|
49
|
+
* @param editor The editor on which this command will be used.
|
|
50
|
+
* @param options.direction Indicates which cell to merge with the currently selected one.
|
|
51
|
+
* Possible values are: `'left'`, `'right'`, `'up'` and `'down'`.
|
|
52
|
+
*/
|
|
53
|
+
constructor(editor: Editor, options: {
|
|
54
|
+
direction: ArrowKeyCodeDirection;
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
refresh(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Executes the command.
|
|
62
|
+
*
|
|
63
|
+
* Depending on the command's {@link #direction} value, it will merge the cell that is to the `'left'`, `'right'`, `'up'` or `'down'`.
|
|
64
|
+
*
|
|
65
|
+
* @fires execute
|
|
66
|
+
*/
|
|
67
|
+
execute(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Returns a cell that can be merged with the current cell depending on the command's direction.
|
|
70
|
+
*/
|
|
71
|
+
private _getMergeableCell;
|
|
72
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
10
|
+
/**
|
|
11
|
+
* The merge cells command.
|
|
12
|
+
*
|
|
13
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCells'` editor command.
|
|
14
|
+
*
|
|
15
|
+
* For example, to merge selected table cells:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* editor.execute( 'mergeTableCells' );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export default class MergeCellsCommand extends Command {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
refresh(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Executes the command.
|
|
28
|
+
*
|
|
29
|
+
* @fires execute
|
|
30
|
+
*/
|
|
31
|
+
execute(): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/commands/removecolumncommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The remove column command.
|
|
15
|
+
*
|
|
16
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableColumn'` editor command.
|
|
17
|
+
*
|
|
18
|
+
* To remove the column containing the selected cell, execute the command:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* editor.execute( 'removeTableColumn' );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export default class RemoveColumnCommand extends Command {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
refresh(): void;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
execute(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/commands/removerowcommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The remove row command.
|
|
15
|
+
*
|
|
16
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableRow'` editor command.
|
|
17
|
+
*
|
|
18
|
+
* To remove the row containing the selected cell, execute the command:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* editor.execute( 'removeTableRow' );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export default class RemoveRowCommand extends Command {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
refresh(): void;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
execute(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/commands/selectcolumncommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The select column command.
|
|
15
|
+
*
|
|
16
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableColumn'` editor command.
|
|
17
|
+
*
|
|
18
|
+
* To select the columns containing the selected cells, execute the command:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* editor.execute( 'selectTableColumn' );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export default class SelectColumnCommand extends Command {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
constructor(editor: Editor);
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
refresh(): void;
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
execute(): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/commands/selectrowcommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The select row command.
|
|
15
|
+
*
|
|
16
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableRow'` editor command.
|
|
17
|
+
*
|
|
18
|
+
* To select the rows containing the selected cells, execute the command:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* editor.execute( 'selectTableRow' );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export default class SelectRowCommand extends Command {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
constructor(editor: Editor);
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
refresh(): void;
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
execute(): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/commands/setheadercolumncommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The header column command.
|
|
15
|
+
*
|
|
16
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
|
|
17
|
+
*
|
|
18
|
+
* You can make the column containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element)
|
|
19
|
+
* by executing:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* editor.execute( 'setTableColumnHeader' );
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* **Note:** All preceding columns will also become headers. If the current column is already a header, executing this command
|
|
26
|
+
* will make it a regular column back again (including the following columns).
|
|
27
|
+
*/
|
|
28
|
+
export default class SetHeaderColumnCommand extends Command {
|
|
29
|
+
/**
|
|
30
|
+
* Flag indicating whether the command is active. The command is active when the
|
|
31
|
+
* {@link module:engine/model/selection~Selection} is in a header column.
|
|
32
|
+
*
|
|
33
|
+
* @observable
|
|
34
|
+
*/
|
|
35
|
+
value: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
refresh(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Executes the command.
|
|
42
|
+
*
|
|
43
|
+
* When the selection is in a non-header column, the command will set the `headingColumns` table attribute to cover that column.
|
|
44
|
+
*
|
|
45
|
+
* When the selection is already in a header column, it will set `headingColumns` so the heading section will end before that column.
|
|
46
|
+
*
|
|
47
|
+
* @fires execute
|
|
48
|
+
* @param options.forceValue If set, the command will set (`true`) or unset (`false`) the header columns according to
|
|
49
|
+
* the `forceValue` parameter instead of the current model state.
|
|
50
|
+
*/
|
|
51
|
+
execute(options?: {
|
|
52
|
+
forceValue?: boolean;
|
|
53
|
+
}): void;
|
|
54
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/commands/setheaderrowcommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The header row command.
|
|
15
|
+
*
|
|
16
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
|
|
17
|
+
*
|
|
18
|
+
* You can make the row containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element) by executing:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* editor.execute( 'setTableRowHeader' );
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* **Note:** All preceding rows will also become headers. If the current row is already a header, executing this command
|
|
25
|
+
* will make it a regular row back again (including the following rows).
|
|
26
|
+
*/
|
|
27
|
+
export default class SetHeaderRowCommand extends Command {
|
|
28
|
+
/**
|
|
29
|
+
* Flag indicating whether the command is active. The command is active when the
|
|
30
|
+
* {@link module:engine/model/selection~Selection} is in a header row.
|
|
31
|
+
*
|
|
32
|
+
* @observable
|
|
33
|
+
*/
|
|
34
|
+
value: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
refresh(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Executes the command.
|
|
41
|
+
*
|
|
42
|
+
* When the selection is in a non-header row, the command will set the `headingRows` table attribute to cover that row.
|
|
43
|
+
*
|
|
44
|
+
* When the selection is already in a header row, it will set `headingRows` so the heading section will end before that row.
|
|
45
|
+
*
|
|
46
|
+
* @fires execute
|
|
47
|
+
* @param options.forceValue If set, the command will set (`true`) or unset (`false`) the header rows according to
|
|
48
|
+
* the `forceValue` parameter instead of the current model state.
|
|
49
|
+
*/
|
|
50
|
+
execute(options?: {
|
|
51
|
+
forceValue?: boolean;
|
|
52
|
+
}): void;
|
|
53
|
+
/**
|
|
54
|
+
* Checks if a table cell is in the heading section.
|
|
55
|
+
*/
|
|
56
|
+
private _isInHeading;
|
|
57
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/commands/splitcellcommand
|
|
11
|
+
*/
|
|
12
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* The split cell command.
|
|
15
|
+
*
|
|
16
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'splitTableCellVertically'`
|
|
17
|
+
* and `'splitTableCellHorizontally'` editor commands.
|
|
18
|
+
*
|
|
19
|
+
* You can split any cell vertically or horizontally by executing this command. For example, to split the selected table cell vertically:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* editor.execute( 'splitTableCellVertically' );
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export default class SplitCellCommand extends Command {
|
|
26
|
+
/**
|
|
27
|
+
* The direction that indicates which cell will be split.
|
|
28
|
+
*/
|
|
29
|
+
readonly direction: 'horizontally' | 'vertically';
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new `SplitCellCommand` instance.
|
|
32
|
+
*
|
|
33
|
+
* @param editor The editor on which this command will be used.
|
|
34
|
+
* @param options.direction Indicates whether the command should split cells `'horizontally'` or `'vertically'`.
|
|
35
|
+
*/
|
|
36
|
+
constructor(editor: Editor, options?: {
|
|
37
|
+
direction?: 'horizontally' | 'vertically';
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
refresh(): void;
|
|
43
|
+
/**
|
|
44
|
+
* @inheritDoc
|
|
45
|
+
*/
|
|
46
|
+
execute(): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import type { Element, ElementCreatorFunction } from 'ckeditor5/src/engine.js';
|
|
10
|
+
import type TableUtils from '../tableutils.js';
|
|
11
|
+
import type { AdditionalSlot } from '../tableediting.js';
|
|
12
|
+
/**
|
|
13
|
+
* Model table element to view table element conversion helper.
|
|
14
|
+
*/
|
|
15
|
+
export declare function downcastTable(tableUtils: TableUtils, options: DowncastTableOptions): ElementCreatorFunction;
|
|
16
|
+
/**
|
|
17
|
+
* Model table row element to view `<tr>` element conversion helper.
|
|
18
|
+
*
|
|
19
|
+
* @returns Element creator.
|
|
20
|
+
*/
|
|
21
|
+
export declare function downcastRow(): ElementCreatorFunction;
|
|
22
|
+
/**
|
|
23
|
+
* Model table cell element to view `<td>` or `<th>` element conversion helper.
|
|
24
|
+
*
|
|
25
|
+
* This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column)
|
|
26
|
+
* and `<td>` otherwise.
|
|
27
|
+
*
|
|
28
|
+
* @param options.asWidget If set to `true`, the downcast conversion will produce a widget.
|
|
29
|
+
* @returns Element creator.
|
|
30
|
+
*/
|
|
31
|
+
export declare function downcastCell(options?: {
|
|
32
|
+
asWidget?: boolean;
|
|
33
|
+
}): ElementCreatorFunction;
|
|
34
|
+
/**
|
|
35
|
+
* Overrides paragraph inside table cell conversion.
|
|
36
|
+
*
|
|
37
|
+
* This converter:
|
|
38
|
+
* * should be used to override default paragraph conversion.
|
|
39
|
+
* * It will only convert `<paragraph>` placed directly inside `<tableCell>`.
|
|
40
|
+
* * For a single paragraph without attributes it returns `<span>` to simulate data table.
|
|
41
|
+
* * For all other cases it returns `<p>` element.
|
|
42
|
+
*
|
|
43
|
+
* @param options.asWidget If set to `true`, the downcast conversion will produce a widget.
|
|
44
|
+
* @returns Element creator.
|
|
45
|
+
*/
|
|
46
|
+
export declare function convertParagraphInTableCell(options?: {
|
|
47
|
+
asWidget?: boolean;
|
|
48
|
+
}): ElementCreatorFunction;
|
|
49
|
+
/**
|
|
50
|
+
* Checks if given model `<paragraph>` is an only child of a parent (`<tableCell>`) and if it has any attribute set.
|
|
51
|
+
*
|
|
52
|
+
* The paragraph should be converted in the editing view to:
|
|
53
|
+
*
|
|
54
|
+
* * If returned `true` - to a `<span class="ck-table-bogus-paragraph">`
|
|
55
|
+
* * If returned `false` - to a `<p>`
|
|
56
|
+
*/
|
|
57
|
+
export declare function isSingleParagraphWithoutAttributes(modelElement: Element): boolean;
|
|
58
|
+
export interface DowncastTableOptions {
|
|
59
|
+
/**
|
|
60
|
+
* If set to `true`, the downcast conversion will produce a widget.
|
|
61
|
+
*/
|
|
62
|
+
asWidget?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Array of additional slot handlers.
|
|
65
|
+
*/
|
|
66
|
+
additionalSlots: Array<AdditionalSlot>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/converters/table-caption-post-fixer
|
|
11
|
+
*/
|
|
12
|
+
import type { Model } from 'ckeditor5/src/engine.js';
|
|
13
|
+
/**
|
|
14
|
+
* Injects a table caption post-fixer into the model.
|
|
15
|
+
*
|
|
16
|
+
* The role of the table caption post-fixer is to ensure that the table with caption have the correct structure
|
|
17
|
+
* after a {@link module:engine/model/model~Model#change `change()`} block was executed.
|
|
18
|
+
*
|
|
19
|
+
* The correct structure means that:
|
|
20
|
+
*
|
|
21
|
+
* * If there are many caption model element, they are merged into one model.
|
|
22
|
+
* * A final, merged caption model is placed at the end of the table.
|
|
23
|
+
*/
|
|
24
|
+
export default function injectTableCaptionPostFixer(model: Model): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/converters/table-cell-paragraph-post-fixer
|
|
11
|
+
*/
|
|
12
|
+
import type { Model } from 'ckeditor5/src/engine.js';
|
|
13
|
+
/**
|
|
14
|
+
* Injects a table cell post-fixer into the model which inserts a `paragraph` element into empty table cells.
|
|
15
|
+
*
|
|
16
|
+
* A table cell must contain at least one block element as a child. An empty table cell will have an empty `paragraph` as a child.
|
|
17
|
+
*
|
|
18
|
+
* ```xml
|
|
19
|
+
* <table>
|
|
20
|
+
* <tableRow>
|
|
21
|
+
* <tableCell></tableCell>
|
|
22
|
+
* </tableRow>
|
|
23
|
+
* </table>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Will be fixed to:
|
|
27
|
+
*
|
|
28
|
+
* ```xml
|
|
29
|
+
* <table>
|
|
30
|
+
* <tableRow>
|
|
31
|
+
* <tableCell><paragraph></paragraph></tableCell>
|
|
32
|
+
* </tableRow>
|
|
33
|
+
* </table>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export default function injectTableCellParagraphPostFixer(model: Model): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/converters/table-cell-refresh-handler
|
|
11
|
+
*/
|
|
12
|
+
import type { EditingController, Model } from 'ckeditor5/src/engine.js';
|
|
13
|
+
/**
|
|
14
|
+
* A table cell refresh handler which marks the table cell in the differ to have it re-rendered.
|
|
15
|
+
*
|
|
16
|
+
* Model `paragraph` inside a table cell can be rendered as `<span>` or `<p>`. It is rendered as `<span>` if this is the only block
|
|
17
|
+
* element in that table cell and it does not have any attributes. It is rendered as `<p>` otherwise.
|
|
18
|
+
*
|
|
19
|
+
* When table cell content changes, for example a second `paragraph` element is added, we need to ensure that the first `paragraph` is
|
|
20
|
+
* re-rendered so it changes from `<span>` to `<p>`. The easiest way to do it is to re-render the entire table cell.
|
|
21
|
+
*/
|
|
22
|
+
export default function tableCellRefreshHandler(model: Model, editing: EditingController): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module table/converters/table-headings-refresh-handler
|
|
11
|
+
*/
|
|
12
|
+
import type { EditingController, Model } from 'ckeditor5/src/engine.js';
|
|
13
|
+
/**
|
|
14
|
+
* A table headings refresh handler which marks the table cells or rows in the differ to have it re-rendered
|
|
15
|
+
* if the headings attribute changed.
|
|
16
|
+
*
|
|
17
|
+
* Table heading rows and heading columns are represented in the model by a `headingRows` and `headingColumns` attributes.
|
|
18
|
+
*
|
|
19
|
+
* When table headings attribute changes, all the cells/rows are marked to re-render to change between `<td>` and `<th>`.
|
|
20
|
+
*/
|
|
21
|
+
export default function tableHeadingsRefreshHandler(model: Model, editing: EditingController): void;
|