@ckeditor/ckeditor5-table 46.1.1-alpha.3 → 47.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/table.js +1 -1
- package/dist/index-content.css +0 -34
- package/dist/index.css +25 -29
- package/dist/index.css.map +1 -1
- package/dist/index.js +52 -39
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/src/tablecellproperties/tablecellpropertiesediting.d.ts +9 -0
- package/src/tablecellproperties/tablecellpropertiesediting.js +13 -0
- package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +9 -0
- package/src/tablecolumnresize/tablecolumnresizeediting.js +13 -0
- package/src/tablekeyboard.js +4 -41
- package/src/tablelayout/tablelayoutediting.d.ts +9 -0
- package/src/tablelayout/tablelayoutediting.js +13 -0
- package/src/tableproperties/tablepropertiesediting.d.ts +9 -0
- package/src/tableproperties/tablepropertiesediting.js +13 -0
- package/src/utils/ui/widget.d.ts +7 -1
- package/src/utils/ui/widget.js +4 -2
- package/theme/table.css +20 -21
package/dist/index.js
CHANGED
|
@@ -6111,12 +6111,9 @@ function doVerticalSplit(table, splitColumn, limitRows, writer) {
|
|
|
6111
6111
|
if (!selectedElement || !selectedElement.is('element', 'table')) {
|
|
6112
6112
|
return;
|
|
6113
6113
|
}
|
|
6114
|
-
|
|
6114
|
+
// For backward compatibility stop propagation of this DOM event.
|
|
6115
|
+
// The default tab handling from widgets handles navigation.
|
|
6115
6116
|
domEventData.stopPropagation();
|
|
6116
|
-
bubblingEventInfo.stop();
|
|
6117
|
-
editor.model.change((writer)=>{
|
|
6118
|
-
writer.setSelection(writer.createRangeIn(selectedElement.getChild(0).getChild(0)));
|
|
6119
|
-
});
|
|
6120
6117
|
}
|
|
6121
6118
|
/**
|
|
6122
6119
|
* Handles {@link module:engine/view/document~ViewDocument#event:tab tab} events for the <kbd>Tab</kbd> key executed
|
|
@@ -6134,48 +6131,18 @@ function doVerticalSplit(table, splitColumn, limitRows, writer) {
|
|
|
6134
6131
|
if (!tableCell) {
|
|
6135
6132
|
return;
|
|
6136
6133
|
}
|
|
6137
|
-
|
|
6134
|
+
// For backward compatibility stop propagation of this DOM event.
|
|
6135
|
+
// The default tab handling from widgets handles navigation.
|
|
6138
6136
|
domEventData.stopPropagation();
|
|
6139
|
-
bubblingEventInfo.stop();
|
|
6140
6137
|
const tableRow = tableCell.parent;
|
|
6141
6138
|
const table = tableRow.parent;
|
|
6142
6139
|
const currentRowIndex = table.getChildIndex(tableRow);
|
|
6143
6140
|
const currentCellIndex = tableRow.getChildIndex(tableCell);
|
|
6144
|
-
const isFirstCellInRow = currentCellIndex === 0;
|
|
6145
|
-
if (!isForward && isFirstCellInRow && currentRowIndex === 0) {
|
|
6146
|
-
// Set the selection over the whole table if the selection was in the first table cell.
|
|
6147
|
-
editor.model.change((writer)=>{
|
|
6148
|
-
writer.setSelection(writer.createRangeOn(table));
|
|
6149
|
-
});
|
|
6150
|
-
return;
|
|
6151
|
-
}
|
|
6152
6141
|
const isLastCellInRow = currentCellIndex === tableRow.childCount - 1;
|
|
6153
6142
|
const isLastRow = currentRowIndex === tableUtils.getRows(table) - 1;
|
|
6154
6143
|
if (isForward && isLastRow && isLastCellInRow) {
|
|
6155
6144
|
editor.execute('insertTableRowBelow');
|
|
6156
|
-
// Check if the command actually added a row. If `insertTableRowBelow` execution didn't add a row (because it was disabled
|
|
6157
|
-
// or it got overwritten) set the selection over the whole table to mirror the first cell case.
|
|
6158
|
-
if (currentRowIndex === tableUtils.getRows(table) - 1) {
|
|
6159
|
-
editor.model.change((writer)=>{
|
|
6160
|
-
writer.setSelection(writer.createRangeOn(table));
|
|
6161
|
-
});
|
|
6162
|
-
return;
|
|
6163
|
-
}
|
|
6164
|
-
}
|
|
6165
|
-
let cellToFocus;
|
|
6166
|
-
// Move to the first cell in the next row.
|
|
6167
|
-
if (isForward && isLastCellInRow) {
|
|
6168
|
-
const nextRow = table.getChild(currentRowIndex + 1);
|
|
6169
|
-
cellToFocus = nextRow.getChild(0);
|
|
6170
|
-
} else if (!isForward && isFirstCellInRow) {
|
|
6171
|
-
const previousRow = table.getChild(currentRowIndex - 1);
|
|
6172
|
-
cellToFocus = previousRow.getChild(previousRow.childCount - 1);
|
|
6173
|
-
} else {
|
|
6174
|
-
cellToFocus = tableRow.getChild(currentCellIndex + (isForward ? 1 : -1));
|
|
6175
6145
|
}
|
|
6176
|
-
editor.model.change((writer)=>{
|
|
6177
|
-
writer.setSelection(writer.createRangeIn(cellToFocus));
|
|
6178
|
-
});
|
|
6179
6146
|
}
|
|
6180
6147
|
/**
|
|
6181
6148
|
* Handles {@link module:engine/view/document~ViewDocument#event:keydown keydown} events.
|
|
@@ -6750,8 +6717,10 @@ function haveSameTableParent(cellA, cellB) {
|
|
|
6750
6717
|
}
|
|
6751
6718
|
/**
|
|
6752
6719
|
* Checks if a given view element is a table widget.
|
|
6753
|
-
|
|
6754
|
-
|
|
6720
|
+
*
|
|
6721
|
+
* @internal
|
|
6722
|
+
*/ function isTableWidget(viewNode) {
|
|
6723
|
+
return viewNode.is('element') && !!viewNode.getCustomProperty('table') && isWidget(viewNode);
|
|
6755
6724
|
}
|
|
6756
6725
|
|
|
6757
6726
|
/**
|
|
@@ -9098,11 +9067,22 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9098
9067
|
*/ static get pluginName() {
|
|
9099
9068
|
return 'TableCellPropertiesEditing';
|
|
9100
9069
|
}
|
|
9070
|
+
/**
|
|
9071
|
+
* @inheritDoc
|
|
9072
|
+
* @internal
|
|
9073
|
+
*/ static get licenseFeatureCode() {
|
|
9074
|
+
return 'TCP';
|
|
9075
|
+
}
|
|
9101
9076
|
/**
|
|
9102
9077
|
* @inheritDoc
|
|
9103
9078
|
*/ static get isOfficialPlugin() {
|
|
9104
9079
|
return true;
|
|
9105
9080
|
}
|
|
9081
|
+
/**
|
|
9082
|
+
* @inheritDoc
|
|
9083
|
+
*/ static get isPremiumPlugin() {
|
|
9084
|
+
return true;
|
|
9085
|
+
}
|
|
9106
9086
|
/**
|
|
9107
9087
|
* @inheritDoc
|
|
9108
9088
|
*/ static get requires() {
|
|
@@ -9753,11 +9733,22 @@ const toPx = /* #__PURE__ */ toUnit('px');
|
|
|
9753
9733
|
*/ static get pluginName() {
|
|
9754
9734
|
return 'TableColumnResizeEditing';
|
|
9755
9735
|
}
|
|
9736
|
+
/**
|
|
9737
|
+
* @inheritDoc
|
|
9738
|
+
* @internal
|
|
9739
|
+
*/ static get licenseFeatureCode() {
|
|
9740
|
+
return 'TCR';
|
|
9741
|
+
}
|
|
9756
9742
|
/**
|
|
9757
9743
|
* @inheritDoc
|
|
9758
9744
|
*/ static get isOfficialPlugin() {
|
|
9759
9745
|
return true;
|
|
9760
9746
|
}
|
|
9747
|
+
/**
|
|
9748
|
+
* @inheritDoc
|
|
9749
|
+
*/ static get isPremiumPlugin() {
|
|
9750
|
+
return true;
|
|
9751
|
+
}
|
|
9761
9752
|
/**
|
|
9762
9753
|
* @inheritDoc
|
|
9763
9754
|
*/ constructor(editor){
|
|
@@ -10501,6 +10492,12 @@ const TABLE_TYPES = [
|
|
|
10501
10492
|
*/ static get pluginName() {
|
|
10502
10493
|
return 'TableLayoutEditing';
|
|
10503
10494
|
}
|
|
10495
|
+
/**
|
|
10496
|
+
* @inheritDoc
|
|
10497
|
+
* @internal
|
|
10498
|
+
*/ static get licenseFeatureCode() {
|
|
10499
|
+
return 'TL';
|
|
10500
|
+
}
|
|
10504
10501
|
/**
|
|
10505
10502
|
* @inheritDoc
|
|
10506
10503
|
*/ static get requires() {
|
|
@@ -10513,6 +10510,11 @@ const TABLE_TYPES = [
|
|
|
10513
10510
|
*/ static get isOfficialPlugin() {
|
|
10514
10511
|
return true;
|
|
10515
10512
|
}
|
|
10513
|
+
/**
|
|
10514
|
+
* @inheritDoc
|
|
10515
|
+
*/ static get isPremiumPlugin() {
|
|
10516
|
+
return true;
|
|
10517
|
+
}
|
|
10516
10518
|
/**
|
|
10517
10519
|
* @inheritDoc
|
|
10518
10520
|
*/ init() {
|
|
@@ -11175,11 +11177,22 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
|
|
|
11175
11177
|
*/ static get pluginName() {
|
|
11176
11178
|
return 'TablePropertiesEditing';
|
|
11177
11179
|
}
|
|
11180
|
+
/**
|
|
11181
|
+
* @inheritDoc
|
|
11182
|
+
* @internal
|
|
11183
|
+
*/ static get licenseFeatureCode() {
|
|
11184
|
+
return 'TCP';
|
|
11185
|
+
}
|
|
11178
11186
|
/**
|
|
11179
11187
|
* @inheritDoc
|
|
11180
11188
|
*/ static get isOfficialPlugin() {
|
|
11181
11189
|
return true;
|
|
11182
11190
|
}
|
|
11191
|
+
/**
|
|
11192
|
+
* @inheritDoc
|
|
11193
|
+
*/ static get isPremiumPlugin() {
|
|
11194
|
+
return true;
|
|
11195
|
+
}
|
|
11183
11196
|
/**
|
|
11184
11197
|
* @inheritDoc
|
|
11185
11198
|
*/ static get requires() {
|