@ckeditor/ckeditor5-table 48.2.0 → 48.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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
|
@@ -1,160 +1,160 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import type { Editor } from
|
|
9
|
-
import type { ModelElement, Model, ModelWriter } from
|
|
10
|
-
import { type TableUtils } from
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
+
/**
|
|
6
|
+
* @module table/tablecolumnresize/utils
|
|
7
|
+
*/
|
|
8
|
+
import type { Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { ModelElement, Model, ModelWriter } from "@ckeditor/ckeditor5-engine";
|
|
10
|
+
import { type TableUtils } from "../tableutils.js";
|
|
11
|
+
/**
|
|
12
|
+
* Returns all the inserted or changed table model elements in a given change set. Only the tables
|
|
13
|
+
* with 'columnsWidth' attribute are taken into account. The returned set may be empty.
|
|
14
|
+
*
|
|
15
|
+
* Most notably if an entire table is removed it will not be included in returned set.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
* @param model The model to collect the affected elements from.
|
|
19
|
+
* @returns A set of table model elements.
|
|
20
|
+
*/
|
|
21
21
|
export declare function getChangedResizedTables(model: Model): Set<ModelElement>;
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
* Calculates the percentage of the minimum column width given in pixels for a given table.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
* @param modelTable A table model element.
|
|
27
|
+
* @param editor The editor instance.
|
|
28
|
+
* @returns The minimal column width in percentage.
|
|
29
|
+
*/
|
|
30
30
|
export declare function getColumnMinWidthAsPercentage(modelTable: ModelElement, editor: Editor): number;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
* Calculates the table width in pixels.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
35
|
+
* @param modelTable A table model element.
|
|
36
|
+
* @param editor The editor instance.
|
|
37
|
+
* @returns The width of the table in pixels.
|
|
38
|
+
*/
|
|
39
39
|
export declare function getTableWidthInPixels(modelTable: ModelElement, editor: Editor): number;
|
|
40
40
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
* Returns the computed width (in pixels) of the DOM element without padding and borders.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
* @param domElement A DOM element.
|
|
45
|
+
* @returns The width of the DOM element in pixels.
|
|
46
|
+
*/
|
|
47
47
|
export declare function getElementWidthInPixels(domElement: HTMLElement): number;
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
* Returns the column indexes on the left and right edges of a cell. They differ if the cell spans
|
|
50
|
+
* across multiple columns.
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
* @param cell A table cell model element.
|
|
54
|
+
* @param tableUtils The Table Utils plugin instance.
|
|
55
|
+
* @returns An object containing the indexes of the left and right edges of the cell.
|
|
56
|
+
*/
|
|
57
57
|
export declare function getColumnEdgesIndexes(cell: ModelElement, tableUtils: TableUtils): {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
leftEdge: number;
|
|
59
|
+
rightEdge: number;
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
* Rounds the provided value to a fixed-point number with defined number of digits after the decimal point.
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
* @param value A number to be rounded.
|
|
66
|
+
* @returns The rounded number.
|
|
67
|
+
*/
|
|
68
68
|
export declare function toPrecision(value: number | string): number;
|
|
69
69
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
* Clamps the number within the inclusive lower (min) and upper (max) bounds. Returned number is rounded using the
|
|
71
|
+
* {@link ~toPrecision `toPrecision()`} function.
|
|
72
|
+
*
|
|
73
|
+
* @internal
|
|
74
|
+
* @param number A number to be clamped.
|
|
75
|
+
* @param min A lower bound.
|
|
76
|
+
* @param max An upper bound.
|
|
77
|
+
* @returns The clamped number.
|
|
78
|
+
*/
|
|
79
79
|
export declare function clamp(number: number, min: number, max: number): number;
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
* Creates an array with defined length and fills all elements with defined value.
|
|
82
|
+
*
|
|
83
|
+
* @internal
|
|
84
|
+
* @param length The length of the array.
|
|
85
|
+
* @param value The value to fill the array with.
|
|
86
|
+
* @returns An array with defined length and filled with defined value.
|
|
87
|
+
*/
|
|
88
88
|
export declare function createFilledArray<T>(length: number, value: T): Array<T>;
|
|
89
89
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
* Sums all array values that can be parsed to a float.
|
|
91
|
+
*
|
|
92
|
+
* @internal
|
|
93
|
+
* @param array An array of numbers.
|
|
94
|
+
* @returns The sum of all array values.
|
|
95
|
+
*/
|
|
96
96
|
export declare function sumArray(array: Array<number | string>): number;
|
|
97
97
|
/**
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
* Makes sure that the sum of the widths from all columns is 100%. If the sum of all the widths is not equal 100%, all the widths are
|
|
99
|
+
* changed proportionally so that they all sum back to 100%. If there are columns without specified width, the amount remaining
|
|
100
|
+
* after assigning the known widths will be distributed equally between them.
|
|
101
|
+
*
|
|
102
|
+
* @internal
|
|
103
|
+
* @param columnWidths An array of column widths.
|
|
104
|
+
* @returns An array of column widths guaranteed to sum up to 100%.
|
|
105
|
+
*/
|
|
106
106
|
export declare function normalizeColumnWidths(columnWidths: Array<string>): Array<string>;
|
|
107
107
|
/**
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
* Calculates the total horizontal space taken by the cell. That includes:
|
|
109
|
+
* * width,
|
|
110
|
+
* * left and red padding,
|
|
111
|
+
* * border width.
|
|
112
|
+
*
|
|
113
|
+
* @internal
|
|
114
|
+
* @param domCell A DOM cell element.
|
|
115
|
+
* @returns Width in pixels without `px` at the end.
|
|
116
|
+
*/
|
|
117
117
|
export declare function getDomCellOuterWidth(domCell: HTMLElement): number;
|
|
118
118
|
/**
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
* Updates column elements to match columns widths.
|
|
120
|
+
*
|
|
121
|
+
* @internal
|
|
122
|
+
* @param columns
|
|
123
|
+
* @param tableColumnGroup
|
|
124
|
+
* @param normalizedWidths
|
|
125
|
+
* @param writer
|
|
126
|
+
*/
|
|
127
127
|
export declare function updateColumnElements(columns: Array<ModelElement>, tableColumnGroup: ModelElement, normalizedWidths: Array<string>, writer: ModelWriter): void;
|
|
128
128
|
/**
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
* Returns a 'tableColumnGroup' element from the 'table'.
|
|
130
|
+
*
|
|
131
|
+
* @internal
|
|
132
|
+
* @param element A 'table' or 'tableColumnGroup' element.
|
|
133
|
+
* @returns A 'tableColumnGroup' element.
|
|
134
|
+
*/
|
|
135
135
|
export declare function getColumnGroupElement(element: ModelElement): ModelElement;
|
|
136
136
|
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
137
|
+
* Returns an array of 'tableColumn' elements. It may be empty if there's no `tableColumnGroup` element.
|
|
138
|
+
*
|
|
139
|
+
* @internal
|
|
140
|
+
* @param element A 'table' or 'tableColumnGroup' element.
|
|
141
|
+
* @returns An array of 'tableColumn' elements.
|
|
142
|
+
*/
|
|
143
143
|
export declare function getTableColumnElements(element: ModelElement): Array<ModelElement>;
|
|
144
144
|
/**
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
145
|
+
* Returns an array of table column widths.
|
|
146
|
+
*
|
|
147
|
+
* @internal
|
|
148
|
+
* @param element A 'table' or 'tableColumnGroup' element.
|
|
149
|
+
* @returns An array of table column widths.
|
|
150
|
+
*/
|
|
151
151
|
export declare function getTableColumnsWidths(element: ModelElement): Array<string>;
|
|
152
152
|
/**
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
153
|
+
* Translates the `colSpan` model attribute into additional column widths and returns the resulting array.
|
|
154
|
+
*
|
|
155
|
+
* @internal
|
|
156
|
+
* @param element A 'table' or 'tableColumnGroup' element.
|
|
157
|
+
* @param writer A writer instance.
|
|
158
|
+
* @returns An array of table column widths.
|
|
159
|
+
*/
|
|
160
160
|
export declare function translateColSpanAttribute(element: ModelElement, writer: ModelWriter): Array<string>;
|
|
@@ -1,30 +1,30 @@
|
|
|
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 { Plugin } from
|
|
9
|
-
import { TableColumnResizeEditing } from
|
|
10
|
-
import { TableCellWidthEditing } from
|
|
11
|
-
import
|
|
6
|
+
* @module table/tablecolumnresize
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { TableColumnResizeEditing } from "./tablecolumnresize/tablecolumnresizeediting.js";
|
|
10
|
+
import { TableCellWidthEditing } from "./tablecellwidth/tablecellwidthediting.js";
|
|
11
|
+
import "../theme/tablecolumnresize.css";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
* The table column resize feature.
|
|
14
|
+
*
|
|
15
|
+
* It provides the possibility to set the width of each column in a table using a resize handler.
|
|
16
|
+
*/
|
|
17
17
|
export declare class TableColumnResize extends Plugin {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires(): PluginDependenciesOf<[TableColumnResizeEditing, TableCellWidthEditing]>;
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "TableColumnResize";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static override get isOfficialPlugin(): true;
|
|
30
30
|
}
|