jodit 3.9.2 → 3.9.3
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/.idea/workspace.xml +40 -26
- package/CHANGELOG.MD +11 -5
- package/README.md +0 -1
- package/build/jodit.css +2 -3
- package/build/jodit.es2018.css +1 -2
- package/build/jodit.es2018.en.css +1 -2
- package/build/jodit.es2018.en.js +63 -46
- package/build/jodit.es2018.en.min.css +1 -1
- package/build/jodit.es2018.en.min.js +1 -1
- package/build/jodit.es2018.js +63 -46
- package/build/jodit.es2018.min.css +1 -1
- package/build/jodit.es2018.min.js +1 -1
- package/build/jodit.js +63 -46
- package/build/jodit.min.css +2 -2
- package/build/jodit.min.js +1 -1
- package/package.json +1 -1
- package/src/modules/table.ts +122 -98
- package/src/plugins/table/config.ts +3 -1
- package/src/plugins/table/table.less +0 -1
- package/types/modules/table.d.ts +2 -2
package/.idea/workspace.xml
CHANGED
|
@@ -10,6 +10,19 @@
|
|
|
10
10
|
<component name="ChangeListManager">
|
|
11
11
|
<list default="true" id="5da7ff7f-03a8-49de-9fbb-8f8640d83b83" name="Default Changelist" comment="">
|
|
12
12
|
<change beforePath="$PROJECT_DIR$/CHANGELOG.MD" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.MD" afterDir="false" />
|
|
13
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.css" beforeDir="false" />
|
|
14
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.es2018.css" beforeDir="false" />
|
|
15
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.es2018.en.css" beforeDir="false" />
|
|
16
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.es2018.en.js" beforeDir="false" />
|
|
17
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.es2018.en.min.css" beforeDir="false" />
|
|
18
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.es2018.en.min.js" beforeDir="false" />
|
|
19
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.es2018.js" beforeDir="false" />
|
|
20
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.es2018.min.css" beforeDir="false" />
|
|
21
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.es2018.min.js" beforeDir="false" />
|
|
22
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.js" beforeDir="false" />
|
|
23
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.min.css" beforeDir="false" />
|
|
24
|
+
<change beforePath="$PROJECT_DIR$/build/jodit.min.js" beforeDir="false" />
|
|
25
|
+
<change beforePath="$PROJECT_DIR$/test/tests/acceptance/tableTest.js" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/acceptance/tableTest.js" afterDir="false" />
|
|
13
26
|
</list>
|
|
14
27
|
<list id="5049e1d4-15bc-4e3a-b46b-d2ce7537fc13" name="Revert "Some small fixes"" comment="Revert "Some small fixes" This reverts commit bc391ec6" />
|
|
15
28
|
<option name="SHOW_DIALOG" value="false" />
|
|
@@ -715,28 +728,8 @@
|
|
|
715
728
|
<workItem from="1634910036285" duration="662000" />
|
|
716
729
|
<workItem from="1634943329348" duration="2687000" />
|
|
717
730
|
<workItem from="1635075276233" duration="6076000" />
|
|
718
|
-
<workItem from="1635150885789" duration="
|
|
719
|
-
|
|
720
|
-
<task id="LOCAL-00819" summary="In EventEmiter added mute/unmute/isMuted methods">
|
|
721
|
-
<created>1634313215564</created>
|
|
722
|
-
<option name="number" value="00819" />
|
|
723
|
-
<option name="presentableId" value="LOCAL-00819" />
|
|
724
|
-
<option name="project" value="LOCAL" />
|
|
725
|
-
<updated>1634313215564</updated>
|
|
726
|
-
</task>
|
|
727
|
-
<task id="LOCAL-00820" summary="Added static markTemporary isTemporary in Dom module">
|
|
728
|
-
<created>1634313334803</created>
|
|
729
|
-
<option name="number" value="00820" />
|
|
730
|
-
<option name="presentableId" value="LOCAL-00820" />
|
|
731
|
-
<option name="project" value="LOCAL" />
|
|
732
|
-
<updated>1634313334804</updated>
|
|
733
|
-
</task>
|
|
734
|
-
<task id="LOCAL-00821" summary="Misspeling">
|
|
735
|
-
<created>1634313348854</created>
|
|
736
|
-
<option name="number" value="00821" />
|
|
737
|
-
<option name="presentableId" value="LOCAL-00821" />
|
|
738
|
-
<option name="project" value="LOCAL" />
|
|
739
|
-
<updated>1634313348854</updated>
|
|
731
|
+
<workItem from="1635150885789" duration="62089000" />
|
|
732
|
+
<workItem from="1635274751066" duration="4725000" />
|
|
740
733
|
</task>
|
|
741
734
|
<task id="LOCAL-00822" summary="Allow use attr with dictionary">
|
|
742
735
|
<created>1634313365187</created>
|
|
@@ -1060,7 +1053,28 @@
|
|
|
1060
1053
|
<option name="project" value="LOCAL" />
|
|
1061
1054
|
<updated>1635267402759</updated>
|
|
1062
1055
|
</task>
|
|
1063
|
-
<
|
|
1056
|
+
<task id="LOCAL-00868" summary="Fixed tests in FF">
|
|
1057
|
+
<created>1635267507492</created>
|
|
1058
|
+
<option name="number" value="00868" />
|
|
1059
|
+
<option name="presentableId" value="LOCAL-00868" />
|
|
1060
|
+
<option name="project" value="LOCAL" />
|
|
1061
|
+
<updated>1635267507492</updated>
|
|
1062
|
+
</task>
|
|
1063
|
+
<task id="LOCAL-00869" summary="Remove gitter">
|
|
1064
|
+
<created>1635268743480</created>
|
|
1065
|
+
<option name="number" value="00869" />
|
|
1066
|
+
<option name="presentableId" value="LOCAL-00869" />
|
|
1067
|
+
<option name="project" value="LOCAL" />
|
|
1068
|
+
<updated>1635268743480</updated>
|
|
1069
|
+
</task>
|
|
1070
|
+
<task id="LOCAL-00870" summary="Fixed tables resizing">
|
|
1071
|
+
<created>1635278972581</created>
|
|
1072
|
+
<option name="number" value="00870" />
|
|
1073
|
+
<option name="presentableId" value="LOCAL-00870" />
|
|
1074
|
+
<option name="project" value="LOCAL" />
|
|
1075
|
+
<updated>1635278972581</updated>
|
|
1076
|
+
</task>
|
|
1077
|
+
<option name="localTasksCounter" value="871" />
|
|
1064
1078
|
<servers />
|
|
1065
1079
|
</component>
|
|
1066
1080
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -1201,8 +1215,6 @@
|
|
|
1201
1215
|
</component>
|
|
1202
1216
|
<component name="VcsManagerConfiguration">
|
|
1203
1217
|
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
|
|
1204
|
-
<MESSAGE value="Fixed work in IE11 toolbar menus are almost not visible on IE11 #458 Issue: https://github.com/xdan/jodit/issues/458" />
|
|
1205
|
-
<MESSAGE value="Rename events-native to event-emitter" />
|
|
1206
1218
|
<MESSAGE value="Fixed build system for child project" />
|
|
1207
1219
|
<MESSAGE value="Rename events-native.ts to event-emitter.ts" />
|
|
1208
1220
|
<MESSAGE value="ReBuild" />
|
|
@@ -1226,7 +1238,9 @@
|
|
|
1226
1238
|
<MESSAGE value="Added test for issue https://github.com/xdan/jodit/issues/522" />
|
|
1227
1239
|
<MESSAGE value="Goodbye Travis! You were a good helper" />
|
|
1228
1240
|
<MESSAGE value="Fixed tests in FF" />
|
|
1229
|
-
<
|
|
1241
|
+
<MESSAGE value="Remove gitter" />
|
|
1242
|
+
<MESSAGE value="Fixed tables resizing" />
|
|
1243
|
+
<option name="LAST_COMMIT_MESSAGE" value="Fixed tables resizing" />
|
|
1230
1244
|
</component>
|
|
1231
1245
|
<component name="XDebuggerManager">
|
|
1232
1246
|
<breakpoint-manager>
|
package/CHANGELOG.MD
CHANGED
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
> - :house: [Internal]
|
|
10
10
|
> - :nail_care: [Polish]
|
|
11
11
|
|
|
12
|
+
## 3.9.3
|
|
13
|
+
|
|
14
|
+
#### :boom: Breaking Change
|
|
15
|
+
|
|
16
|
+
- The style `table-layout: fixed` has been removed from tables. When inserting a table, the width of the columns is immediately set for it.
|
|
17
|
+
|
|
12
18
|
## 3.9.1
|
|
13
19
|
|
|
14
20
|
#### :boom: Breaking Change
|
|
@@ -709,11 +715,11 @@ Related with https://github.com/xdan/jodit/issues/574. In some cases need to lim
|
|
|
709
715
|
- @property {number} link.selectSizeClassName=3 The size of the select (to use with modeClassName="select")
|
|
710
716
|
- @property {IUIOption[]} link.selectOptionsClassName=[] The list of the option for the select (to use with modeClassName="select")
|
|
711
717
|
- ex: [
|
|
712
|
-
-
|
|
713
|
-
-
|
|
714
|
-
-
|
|
715
|
-
-
|
|
716
|
-
-
|
|
718
|
+
- { value: "", text: "" },
|
|
719
|
+
- { value: "val1", text: "text1" },
|
|
720
|
+
- { value: "val2", text: "text2" },
|
|
721
|
+
- { value: "val3", text: "text3" }
|
|
722
|
+
- ]
|
|
717
723
|
PR: https://github.com/xdan/jodit/pull/577 Thanks @s-renier-taonix-fr
|
|
718
724
|
|
|
719
725
|
##### New option `statusbar: boolean = true`
|
package/README.md
CHANGED
|
@@ -6,7 +6,6 @@ An excellent WYSIWYG editor written in pure TypeScript without the use of additi
|
|
|
6
6
|
[](https://github.com/xdan/jodit/actions/workflows/tests.yml)
|
|
7
7
|
[](https://badge.fury.io/js/jodit)
|
|
8
8
|
[](https://www.npmjs.com/package/jodit)
|
|
9
|
-
[](https://gitter.im/xdan/jodit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
|
10
9
|
|
|
11
10
|
* [Demo and Official site](https://xdsoft.net/jodit/)
|
|
12
11
|
* [PRO Version](https://xdsoft.net/jodit/pro/)
|
package/build/jodit.css
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
|
|
4
|
-
* Version: v3.9.
|
|
4
|
+
* Version: v3.9.3
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
8
|
/*!
|
|
9
9
|
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
|
|
10
10
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
|
|
11
|
-
* Version: v3.9.
|
|
11
|
+
* Version: v3.9.3
|
|
12
12
|
* Url: https://xdsoft.net/jodit/
|
|
13
13
|
* License(s): MIT
|
|
14
14
|
*/
|
|
@@ -5391,7 +5391,6 @@ html.jodit_fullsize-box_true {
|
|
|
5391
5391
|
margin-bottom: 1em;
|
|
5392
5392
|
border-collapse: collapse;
|
|
5393
5393
|
empty-cells: show;
|
|
5394
|
-
table-layout: fixed;
|
|
5395
5394
|
}
|
|
5396
5395
|
.jodit-wysiwyg table tr {
|
|
5397
5396
|
-webkit-user-select: none;
|
package/build/jodit.es2018.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
|
|
4
|
-
* Version: v3.9.
|
|
4
|
+
* Version: v3.9.3
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -4497,7 +4497,6 @@ html.jodit_fullsize-box_true {
|
|
|
4497
4497
|
margin-bottom: 1em;
|
|
4498
4498
|
border-collapse: collapse;
|
|
4499
4499
|
empty-cells: show;
|
|
4500
|
-
table-layout: fixed;
|
|
4501
4500
|
}
|
|
4502
4501
|
.jodit-wysiwyg table tr {
|
|
4503
4502
|
user-select: none;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
|
|
4
|
-
* Version: v3.9.
|
|
4
|
+
* Version: v3.9.3
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -4497,7 +4497,6 @@ html.jodit_fullsize-box_true {
|
|
|
4497
4497
|
margin-bottom: 1em;
|
|
4498
4498
|
border-collapse: collapse;
|
|
4499
4499
|
empty-cells: show;
|
|
4500
|
-
table-layout: fixed;
|
|
4501
4500
|
}
|
|
4502
4501
|
.jodit-wysiwyg table tr {
|
|
4503
4502
|
user-select: none;
|
package/build/jodit.es2018.en.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
|
|
4
|
-
* Version: v3.9.
|
|
4
|
+
* Version: v3.9.3
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -10567,7 +10567,7 @@ class View extends component/* Component */.wA {
|
|
|
10567
10567
|
this.isView = true;
|
|
10568
10568
|
this.mods = {};
|
|
10569
10569
|
this.components = new Set();
|
|
10570
|
-
this.version = "3.9.
|
|
10570
|
+
this.version = "3.9.3";
|
|
10571
10571
|
this.async = new Async();
|
|
10572
10572
|
this.buffer = Storage.makeStorage();
|
|
10573
10573
|
this.storage = Storage.makeStorage(true, this.componentName);
|
|
@@ -10665,10 +10665,10 @@ class View extends component/* Component */.wA {
|
|
|
10665
10665
|
return this.__isFullSize;
|
|
10666
10666
|
}
|
|
10667
10667
|
getVersion() {
|
|
10668
|
-
return "3.9.
|
|
10668
|
+
return "3.9.3";
|
|
10669
10669
|
}
|
|
10670
10670
|
static getVersion() {
|
|
10671
|
-
return "3.9.
|
|
10671
|
+
return "3.9.3";
|
|
10672
10672
|
}
|
|
10673
10673
|
initOptions(options) {
|
|
10674
10674
|
this.options = (0,helpers.ConfigProto)(options || {}, (0,helpers.ConfigProto)(this.options || {}, View.defaultOptions));
|
|
@@ -14690,6 +14690,7 @@ class StatusBar extends component/* ViewComponent */.Hr {
|
|
|
14690
14690
|
|
|
14691
14691
|
|
|
14692
14692
|
|
|
14693
|
+
const markedValue = new WeakMap();
|
|
14693
14694
|
class Table extends component/* ViewComponent */.Hr {
|
|
14694
14695
|
constructor() {
|
|
14695
14696
|
super(...arguments);
|
|
@@ -14842,14 +14843,13 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
14842
14843
|
const box = Table.formalMatrix(table);
|
|
14843
14844
|
let dec;
|
|
14844
14845
|
const row = table.rows[rowIndex];
|
|
14845
|
-
|
|
14846
|
+
box[rowIndex].forEach((cell, j) => {
|
|
14846
14847
|
dec = false;
|
|
14847
14848
|
if (rowIndex - 1 >= 0 && box[rowIndex - 1][j] === cell) {
|
|
14848
14849
|
dec = true;
|
|
14849
14850
|
}
|
|
14850
14851
|
else if (box[rowIndex + 1] && box[rowIndex + 1][j] === cell) {
|
|
14851
|
-
if (cell.parentNode === row &&
|
|
14852
|
-
cell.parentNode.nextSibling) {
|
|
14852
|
+
if (cell.parentNode === row && cell.parentNode.nextSibling) {
|
|
14853
14853
|
dec = true;
|
|
14854
14854
|
let nextCell = j + 1;
|
|
14855
14855
|
while (box[rowIndex + 1][nextCell] === cell) {
|
|
@@ -14914,7 +14914,7 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
14914
14914
|
static removeColumn(table, j) {
|
|
14915
14915
|
const box = Table.formalMatrix(table);
|
|
14916
14916
|
let dec;
|
|
14917
|
-
|
|
14917
|
+
box.forEach((cells, i) => {
|
|
14918
14918
|
const td = cells[j];
|
|
14919
14919
|
dec = false;
|
|
14920
14920
|
if (j - 1 >= 0 && box[i][j - 1] === td) {
|
|
@@ -14999,7 +14999,7 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
14999
14999
|
if (box[i][j] === undefined) {
|
|
15000
15000
|
continue;
|
|
15001
15001
|
}
|
|
15002
|
-
Table.
|
|
15002
|
+
Table.mark(box[i][j], 'colspan', box[i][j].colSpan - min + 1, __marked);
|
|
15003
15003
|
}
|
|
15004
15004
|
}
|
|
15005
15005
|
}
|
|
@@ -15021,7 +15021,7 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
15021
15021
|
if (box[i][j] === undefined) {
|
|
15022
15022
|
continue;
|
|
15023
15023
|
}
|
|
15024
|
-
Table.
|
|
15024
|
+
Table.mark(box[i][j], 'rowspan', box[i][j].rowSpan - min + 1, __marked);
|
|
15025
15025
|
}
|
|
15026
15026
|
}
|
|
15027
15027
|
}
|
|
@@ -15044,21 +15044,21 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
15044
15044
|
}
|
|
15045
15045
|
}
|
|
15046
15046
|
}
|
|
15047
|
-
Table.
|
|
15047
|
+
Table.unmark(__marked);
|
|
15048
15048
|
}
|
|
15049
15049
|
static mergeSelected(table, jodit) {
|
|
15050
15050
|
const html = [], bound = Table.getSelectedBound(table, Table.getSelectedCellsByTable(table));
|
|
15051
15051
|
let w = 0, first = null, first_j = 0, td, cols = 0, rows = 0;
|
|
15052
|
-
const __marked = [];
|
|
15052
|
+
const alreadyMerged = new Set(), __marked = [];
|
|
15053
15053
|
if (bound && (bound[0][0] - bound[1][0] || bound[0][1] - bound[1][1])) {
|
|
15054
15054
|
Table.formalMatrix(table, (cell, i, j, cs, rs) => {
|
|
15055
15055
|
if (i >= bound[0][0] && i <= bound[1][0]) {
|
|
15056
15056
|
if (j >= bound[0][1] && j <= bound[1][1]) {
|
|
15057
15057
|
td = cell;
|
|
15058
|
-
if (td
|
|
15058
|
+
if (alreadyMerged.has(td)) {
|
|
15059
15059
|
return;
|
|
15060
15060
|
}
|
|
15061
|
-
td
|
|
15061
|
+
alreadyMerged.add(td);
|
|
15062
15062
|
if (i === bound[0][0] && td.style.width) {
|
|
15063
15063
|
w += td.offsetWidth;
|
|
15064
15064
|
}
|
|
@@ -15076,7 +15076,7 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
15076
15076
|
first_j = j;
|
|
15077
15077
|
}
|
|
15078
15078
|
else {
|
|
15079
|
-
Table.
|
|
15079
|
+
Table.mark(td, 'remove', 1, __marked);
|
|
15080
15080
|
instance(jodit).removeSelection(td);
|
|
15081
15081
|
}
|
|
15082
15082
|
}
|
|
@@ -15086,23 +15086,23 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
15086
15086
|
rows = bound[1][0] - bound[0][0] + 1;
|
|
15087
15087
|
if (first) {
|
|
15088
15088
|
if (cols > 1) {
|
|
15089
|
-
Table.
|
|
15089
|
+
Table.mark(first, 'colspan', cols, __marked);
|
|
15090
15090
|
}
|
|
15091
15091
|
if (rows > 1) {
|
|
15092
|
-
Table.
|
|
15092
|
+
Table.mark(first, 'rowspan', rows, __marked);
|
|
15093
15093
|
}
|
|
15094
15094
|
if (w) {
|
|
15095
|
-
Table.
|
|
15095
|
+
Table.mark(first, 'width', ((w / table.offsetWidth) * 100).toFixed(constants.ACCURACY) + '%', __marked);
|
|
15096
15096
|
if (first_j) {
|
|
15097
15097
|
Table.setColumnWidthByDelta(table, first_j, 0, true, __marked);
|
|
15098
15098
|
}
|
|
15099
15099
|
}
|
|
15100
15100
|
first.innerHTML = html.join('<br/>');
|
|
15101
15101
|
instance(jodit).addSelection(first);
|
|
15102
|
-
delete
|
|
15103
|
-
Table.
|
|
15102
|
+
alreadyMerged.delete(first);
|
|
15103
|
+
Table.unmark(__marked);
|
|
15104
15104
|
Table.normalizeTable(table);
|
|
15105
|
-
(0,helpers.
|
|
15105
|
+
(0,helpers.toArray)(table.rows).forEach((tr, index) => {
|
|
15106
15106
|
if (!tr.cells.length) {
|
|
15107
15107
|
dom/* Dom.safeRemove */.i.safeRemove(tr);
|
|
15108
15108
|
}
|
|
@@ -15123,14 +15123,14 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
15123
15123
|
if (coord[0] === i &&
|
|
15124
15124
|
coord[1] !== j &&
|
|
15125
15125
|
tdElm !== cell) {
|
|
15126
|
-
Table.
|
|
15126
|
+
Table.mark(tdElm, 'rowspan', tdElm.rowSpan + 1, __marked);
|
|
15127
15127
|
}
|
|
15128
15128
|
});
|
|
15129
15129
|
dom/* Dom.after */.i.after(dom/* Dom.closest */.i.closest(cell, 'tr', table), tr);
|
|
15130
15130
|
tr.appendChild(td);
|
|
15131
15131
|
}
|
|
15132
15132
|
else {
|
|
15133
|
-
Table.
|
|
15133
|
+
Table.mark(cell, 'rowspan', cell.rowSpan - 1, __marked);
|
|
15134
15134
|
Table.formalMatrix(table, (tdElm, i, j) => {
|
|
15135
15135
|
if (i > coord[0] &&
|
|
15136
15136
|
i < coord[0] + cell.rowSpan &&
|
|
@@ -15151,9 +15151,9 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
15151
15151
|
}
|
|
15152
15152
|
}
|
|
15153
15153
|
if (cell.colSpan > 1) {
|
|
15154
|
-
Table.
|
|
15154
|
+
Table.mark(td, 'colspan', cell.colSpan, __marked);
|
|
15155
15155
|
}
|
|
15156
|
-
Table.
|
|
15156
|
+
Table.unmark(__marked);
|
|
15157
15157
|
instance(jodit).removeSelection(cell);
|
|
15158
15158
|
});
|
|
15159
15159
|
this.normalizeTable(table);
|
|
@@ -15166,30 +15166,31 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
15166
15166
|
if (cell.colSpan < 2) {
|
|
15167
15167
|
Table.formalMatrix(table, (tdElm, i, j) => {
|
|
15168
15168
|
if (coord[1] === j && coord[0] !== i && tdElm !== cell) {
|
|
15169
|
-
Table.
|
|
15169
|
+
Table.mark(tdElm, 'colspan', tdElm.colSpan + 1, __marked);
|
|
15170
15170
|
}
|
|
15171
15171
|
});
|
|
15172
15172
|
}
|
|
15173
15173
|
else {
|
|
15174
|
-
Table.
|
|
15174
|
+
Table.mark(cell, 'colspan', cell.colSpan - 1, __marked);
|
|
15175
15175
|
}
|
|
15176
15176
|
td = jodit.createInside.element('td');
|
|
15177
15177
|
td.appendChild(jodit.createInside.element('br'));
|
|
15178
15178
|
if (cell.rowSpan > 1) {
|
|
15179
|
-
Table.
|
|
15179
|
+
Table.mark(td, 'rowspan', cell.rowSpan, __marked);
|
|
15180
15180
|
}
|
|
15181
15181
|
const oldWidth = cell.offsetWidth;
|
|
15182
15182
|
dom/* Dom.after */.i.after(cell, td);
|
|
15183
15183
|
percentage = oldWidth / table.offsetWidth / 2;
|
|
15184
|
-
Table.
|
|
15185
|
-
Table.
|
|
15186
|
-
Table.
|
|
15184
|
+
Table.mark(cell, 'width', (percentage * 100).toFixed(constants.ACCURACY) + '%', __marked);
|
|
15185
|
+
Table.mark(td, 'width', (percentage * 100).toFixed(constants.ACCURACY) + '%', __marked);
|
|
15186
|
+
Table.unmark(__marked);
|
|
15187
15187
|
instance(jodit).removeSelection(cell);
|
|
15188
15188
|
});
|
|
15189
15189
|
Table.normalizeTable(table);
|
|
15190
15190
|
}
|
|
15191
15191
|
static setColumnWidthByDelta(table, column, delta, noUnmark, marked) {
|
|
15192
15192
|
const box = Table.formalMatrix(table);
|
|
15193
|
+
let clearWidthIndex = 0;
|
|
15193
15194
|
for (let i = 0; i < box.length; i += 1) {
|
|
15194
15195
|
const cell = box[i][column];
|
|
15195
15196
|
if (cell.colSpan > 1 && box.length > 1) {
|
|
@@ -15197,41 +15198,56 @@ class Table extends component/* ViewComponent */.Hr {
|
|
|
15197
15198
|
}
|
|
15198
15199
|
const w = cell.offsetWidth;
|
|
15199
15200
|
const percent = ((w + delta) / table.offsetWidth) * 100;
|
|
15200
|
-
Table.
|
|
15201
|
+
Table.mark(cell, 'width', percent.toFixed(constants.ACCURACY) + '%', marked);
|
|
15202
|
+
clearWidthIndex = i;
|
|
15201
15203
|
break;
|
|
15202
15204
|
}
|
|
15205
|
+
for (let i = clearWidthIndex + 1; i < box.length; i += 1) {
|
|
15206
|
+
const cell = box[i][column];
|
|
15207
|
+
Table.mark(cell, 'width', null, marked);
|
|
15208
|
+
}
|
|
15203
15209
|
if (!noUnmark) {
|
|
15204
|
-
Table.
|
|
15210
|
+
Table.unmark(marked);
|
|
15205
15211
|
}
|
|
15206
15212
|
}
|
|
15207
|
-
static
|
|
15213
|
+
static mark(cell, key, value, marked) {
|
|
15214
|
+
var _a;
|
|
15208
15215
|
marked.push(cell);
|
|
15209
|
-
|
|
15210
|
-
|
|
15211
|
-
|
|
15212
|
-
cell.__marked_value[key] = value === undefined ? 1 : value;
|
|
15216
|
+
const dict = (_a = markedValue.get(cell)) !== null && _a !== void 0 ? _a : {};
|
|
15217
|
+
dict[key] = value === undefined ? 1 : value;
|
|
15218
|
+
markedValue.set(cell, dict);
|
|
15213
15219
|
}
|
|
15214
|
-
static
|
|
15220
|
+
static unmark(marked) {
|
|
15215
15221
|
marked.forEach(cell => {
|
|
15216
|
-
|
|
15217
|
-
|
|
15222
|
+
const dict = markedValue.get(cell);
|
|
15223
|
+
if (dict) {
|
|
15224
|
+
Object.keys(dict).forEach((key) => {
|
|
15225
|
+
const value = dict[key];
|
|
15218
15226
|
switch (key) {
|
|
15219
15227
|
case 'remove':
|
|
15220
15228
|
dom/* Dom.safeRemove */.i.safeRemove(cell);
|
|
15221
15229
|
break;
|
|
15222
15230
|
case 'rowspan':
|
|
15223
|
-
(0,helpers.attr)(cell, 'rowspan', value > 1 ? value : null);
|
|
15231
|
+
(0,helpers.attr)(cell, 'rowspan', (0,helpers.isNumber)(value) && value > 1 ? value : null);
|
|
15224
15232
|
break;
|
|
15225
15233
|
case 'colspan':
|
|
15226
|
-
(0,helpers.attr)(cell, 'colspan', value > 1 ? value : null);
|
|
15234
|
+
(0,helpers.attr)(cell, 'colspan', (0,helpers.isNumber)(value) && value > 1 ? value : null);
|
|
15227
15235
|
break;
|
|
15228
15236
|
case 'width':
|
|
15229
|
-
|
|
15237
|
+
if (value == null) {
|
|
15238
|
+
cell.style.removeProperty('width');
|
|
15239
|
+
if (!(0,helpers.attr)(cell, 'style')) {
|
|
15240
|
+
(0,helpers.attr)(cell, 'style', null);
|
|
15241
|
+
}
|
|
15242
|
+
}
|
|
15243
|
+
else {
|
|
15244
|
+
cell.style.width = value.toString();
|
|
15245
|
+
}
|
|
15230
15246
|
break;
|
|
15231
15247
|
}
|
|
15232
|
-
delete
|
|
15248
|
+
delete dict[key];
|
|
15233
15249
|
});
|
|
15234
|
-
delete
|
|
15250
|
+
markedValue.delete(cell);
|
|
15235
15251
|
}
|
|
15236
15252
|
});
|
|
15237
15253
|
}
|
|
@@ -24741,6 +24757,7 @@ config/* Config.prototype.controls.table */.D.prototype.controls.table = {
|
|
|
24741
24757
|
if (!first_td) {
|
|
24742
24758
|
first_td = td;
|
|
24743
24759
|
}
|
|
24760
|
+
(0,helpers.css)(td, 'width', (100 / cols_count).toFixed(4) + '%');
|
|
24744
24761
|
td.appendChild(crt.element('br'));
|
|
24745
24762
|
tr.appendChild(crt.text('\n'));
|
|
24746
24763
|
tr.appendChild(crt.text('\t'));
|