@ckeditor/ckeditor5-table 44.3.0 → 45.0.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/LICENSE.md +1 -1
- package/build/table.js +2 -2
- package/build/translations/af.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/ast.js +1 -1
- package/build/translations/az.js +1 -1
- package/build/translations/be.js +1 -0
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/bs.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/en-gb.js +1 -1
- package/build/translations/eo.js +1 -1
- package/build/translations/es-co.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/eu.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/gu.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/hy.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/kk.js +1 -1
- package/build/translations/km.js +1 -1
- package/build/translations/kn.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/ku.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nb.js +1 -1
- package/build/translations/ne.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/oc.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/si.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sl.js +1 -1
- package/build/translations/sq.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/ti.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/tt.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/uz.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/ckeditor5-metadata.json +64 -6
- package/dist/index-content.css +50 -25
- package/dist/index-editor.css +115 -16
- package/dist/index.css +226 -60
- package/dist/index.css.map +1 -1
- package/dist/index.js +3128 -2275
- package/dist/index.js.map +1 -1
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.d.ts +8 -0
- package/dist/translations/be.js +5 -0
- package/dist/translations/be.umd.js +11 -0
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/lang/contexts.json +8 -1
- package/lang/translations/af.po +28 -0
- package/lang/translations/ar.po +28 -0
- package/lang/translations/ast.po +28 -0
- package/lang/translations/az.po +28 -0
- package/lang/translations/be.po +296 -0
- package/lang/translations/bg.po +28 -0
- package/lang/translations/bn.po +28 -0
- package/lang/translations/bs.po +28 -0
- package/lang/translations/ca.po +28 -0
- package/lang/translations/cs.po +28 -0
- package/lang/translations/da.po +28 -0
- package/lang/translations/de-ch.po +28 -0
- package/lang/translations/de.po +28 -0
- package/lang/translations/el.po +28 -0
- package/lang/translations/en-au.po +28 -0
- package/lang/translations/en-gb.po +28 -0
- package/lang/translations/en.po +28 -0
- package/lang/translations/eo.po +28 -0
- package/lang/translations/es-co.po +28 -0
- package/lang/translations/es.po +28 -0
- package/lang/translations/et.po +28 -0
- package/lang/translations/eu.po +28 -0
- package/lang/translations/fa.po +28 -0
- package/lang/translations/fi.po +28 -0
- package/lang/translations/fr.po +28 -0
- package/lang/translations/gl.po +28 -0
- package/lang/translations/gu.po +28 -0
- package/lang/translations/he.po +28 -0
- package/lang/translations/hi.po +28 -0
- package/lang/translations/hr.po +28 -0
- package/lang/translations/hu.po +28 -0
- package/lang/translations/hy.po +28 -0
- package/lang/translations/id.po +28 -0
- package/lang/translations/it.po +28 -0
- package/lang/translations/ja.po +28 -0
- package/lang/translations/jv.po +28 -0
- package/lang/translations/kk.po +28 -0
- package/lang/translations/km.po +28 -0
- package/lang/translations/kn.po +28 -0
- package/lang/translations/ko.po +28 -0
- package/lang/translations/ku.po +28 -0
- package/lang/translations/lt.po +28 -0
- package/lang/translations/lv.po +28 -0
- package/lang/translations/ms.po +28 -0
- package/lang/translations/nb.po +28 -0
- package/lang/translations/ne.po +28 -0
- package/lang/translations/nl.po +28 -0
- package/lang/translations/no.po +28 -0
- package/lang/translations/oc.po +28 -0
- package/lang/translations/pl.po +28 -0
- package/lang/translations/pt-br.po +28 -0
- package/lang/translations/pt.po +28 -0
- package/lang/translations/ro.po +28 -0
- package/lang/translations/ru.po +28 -0
- package/lang/translations/si.po +28 -0
- package/lang/translations/sk.po +28 -0
- package/lang/translations/sl.po +28 -0
- package/lang/translations/sq.po +28 -0
- package/lang/translations/sr-latn.po +28 -0
- package/lang/translations/sr.po +28 -0
- package/lang/translations/sv.po +28 -0
- package/lang/translations/th.po +28 -0
- package/lang/translations/ti.po +28 -0
- package/lang/translations/tk.po +28 -0
- package/lang/translations/tr.po +28 -0
- package/lang/translations/tt.po +28 -0
- package/lang/translations/ug.po +28 -0
- package/lang/translations/uk.po +28 -0
- package/lang/translations/ur.po +28 -0
- package/lang/translations/uz.po +28 -0
- package/lang/translations/vi.po +28 -0
- package/lang/translations/zh-cn.po +28 -0
- package/lang/translations/zh.po +28 -0
- package/package.json +10 -9
- package/src/augmentation.d.ts +5 -1
- package/src/commands/insertcolumncommand.js +4 -0
- package/src/commands/insertrowcommand.js +4 -0
- package/src/commands/inserttablelayoutcommand.d.ts +39 -0
- package/src/commands/inserttablelayoutcommand.js +65 -0
- package/src/commands/mergecellcommand.js +8 -0
- package/src/commands/setheadercolumncommand.js +9 -4
- package/src/commands/setheaderrowcommand.js +8 -3
- package/src/commands/splitcellcommand.js +4 -0
- package/src/converters/downcast.js +1 -1
- package/src/converters/tableproperties.js +25 -5
- package/src/index.d.ts +4 -0
- package/src/index.js +2 -0
- package/src/plaintableoutput.d.ts +3 -0
- package/src/plaintableoutput.js +12 -1
- package/src/tablecaption/tablecaptionediting.js +7 -0
- package/src/tablecaption/tablecaptionui.js +3 -2
- package/src/tablecaption/toggletablecaptioncommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellpropertycommand.d.ts +11 -1
- package/src/tablecellproperties/commands/tablecellpropertycommand.js +40 -2
- package/src/tablecellproperties/tablecellpropertiesediting.js +50 -9
- package/src/tablecellproperties/tablecellpropertiesui.d.ts +13 -1
- package/src/tablecellproperties/tablecellpropertiesui.js +60 -11
- package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +2 -1
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +82 -13
- package/src/tableclipboard.d.ts +9 -0
- package/src/tableclipboard.js +28 -1
- package/src/tablecolumnresize/constants.d.ts +4 -0
- package/src/tablecolumnresize/constants.js +4 -0
- package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +8 -0
- package/src/tablecolumnresize/tablecolumnresizeediting.js +50 -10
- package/src/tableconfig.d.ts +38 -0
- package/src/tableediting.js +4 -0
- package/src/tablelayout/commands/tabletypecommand.d.ts +43 -0
- package/src/tablelayout/commands/tabletypecommand.js +68 -0
- package/src/tablelayout/tablelayoutediting.d.ts +54 -0
- package/src/tablelayout/tablelayoutediting.js +276 -0
- package/src/tablelayout/tablelayoutui.d.ts +32 -0
- package/src/tablelayout/tablelayoutui.js +189 -0
- package/src/tablelayout.d.ts +31 -0
- package/src/tablelayout.js +37 -0
- package/src/tablemouse/mouseeventsobserver.js +3 -6
- package/src/tableproperties/commands/tablepropertycommand.d.ts +11 -1
- package/src/tableproperties/commands/tablepropertycommand.js +23 -1
- package/src/tableproperties/tablepropertiesediting.js +49 -11
- package/src/tableproperties/tablepropertiesui.d.ts +21 -3
- package/src/tableproperties/tablepropertiesui.js +73 -26
- package/src/tableproperties/ui/tablepropertiesview.d.ts +4 -3
- package/src/tableproperties/ui/tablepropertiesview.js +70 -9
- package/src/tableselection.js +19 -1
- package/src/tableui.js +7 -9
- package/src/tablewalker.js +99 -4
- package/src/ui/colorinputview.js +34 -0
- package/src/ui/inserttableview.js +12 -0
- package/src/utils/structure.js +7 -1
- package/src/utils/table-properties.d.ts +3 -3
- package/src/utils/table-properties.js +1 -1
- package/src/utils/ui/table-properties.js +7 -1
- package/theme/formrow.css +0 -10
- package/theme/table.css +52 -35
- package/theme/tablecolumnresize.css +5 -0
- package/theme/tableform.css +6 -0
- package/theme/tablelayout.css +62 -0
- package/src/ui/formrowview.d.ts +0 -61
- package/src/ui/formrowview.js +0 -57
- package/theme/form.css +0 -11
- package/theme/icons/table-cell-properties.svg +0 -1
- package/theme/icons/table-column.svg +0 -1
- package/theme/icons/table-merge-cell.svg +0 -1
- package/theme/icons/table-properties.svg +0 -1
- package/theme/icons/table-row.svg +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2025, 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/tablelayout
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import TableLayoutUI from './tablelayout/tablelayoutui.js';
|
|
10
|
+
import TableLayoutEditing from './tablelayout/tablelayoutediting.js';
|
|
11
|
+
import PlainTableOutput from './plaintableoutput.js';
|
|
12
|
+
import TableColumnResize from './tablecolumnresize.js';
|
|
13
|
+
/**
|
|
14
|
+
* The table plugin.
|
|
15
|
+
*
|
|
16
|
+
* For a detailed overview, check the {@glink features/tables/tables-layout Layout table feature documentation}.
|
|
17
|
+
*/
|
|
18
|
+
export default class TableLayout extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName(): "TableLayout";
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get isOfficialPlugin(): true;
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get requires(): readonly [typeof PlainTableOutput, typeof TableColumnResize, typeof TableLayoutEditing, typeof TableLayoutUI];
|
|
31
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2025, 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/tablelayout
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import TableLayoutUI from './tablelayout/tablelayoutui.js';
|
|
10
|
+
import TableLayoutEditing from './tablelayout/tablelayoutediting.js';
|
|
11
|
+
import PlainTableOutput from './plaintableoutput.js';
|
|
12
|
+
import TableColumnResize from './tablecolumnresize.js';
|
|
13
|
+
/**
|
|
14
|
+
* The table plugin.
|
|
15
|
+
*
|
|
16
|
+
* For a detailed overview, check the {@glink features/tables/tables-layout Layout table feature documentation}.
|
|
17
|
+
*/
|
|
18
|
+
export default class TableLayout extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName() {
|
|
23
|
+
return 'TableLayout';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get isOfficialPlugin() {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
static get requires() {
|
|
35
|
+
return [PlainTableOutput, TableColumnResize, TableLayoutEditing, TableLayoutUI];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -20,12 +20,9 @@ import { DomEventObserver } from 'ckeditor5/src/engine.js';
|
|
|
20
20
|
* The observer is registered by the {@link module:table/tableselection~TableSelection} plugin.
|
|
21
21
|
*/
|
|
22
22
|
export default class MouseEventsObserver extends DomEventObserver {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'mousemove', 'mouseleave'
|
|
27
|
-
];
|
|
28
|
-
}
|
|
23
|
+
domEventType = [
|
|
24
|
+
'mousemove', 'mouseleave'
|
|
25
|
+
];
|
|
29
26
|
/**
|
|
30
27
|
* @inheritDoc
|
|
31
28
|
*/
|
|
@@ -26,8 +26,18 @@ export default class TablePropertyCommand extends Command {
|
|
|
26
26
|
readonly attributeName: string;
|
|
27
27
|
/**
|
|
28
28
|
* The default value for the attribute.
|
|
29
|
+
*
|
|
30
|
+
* @readonly
|
|
31
|
+
*/
|
|
32
|
+
protected _defaultValue: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The default value for the attribute for the content table.
|
|
35
|
+
*/
|
|
36
|
+
private readonly _defaultContentTableValue;
|
|
37
|
+
/**
|
|
38
|
+
* The default value for the attribute for the layout table.
|
|
29
39
|
*/
|
|
30
|
-
|
|
40
|
+
private readonly _defaultLayoutTableValue;
|
|
31
41
|
/**
|
|
32
42
|
* Creates a new `TablePropertyCommand` instance.
|
|
33
43
|
*
|
|
@@ -10,6 +10,24 @@ import { getSelectionAffectedTable } from '../../utils/common.js';
|
|
|
10
10
|
* This command is a base command for other table property commands.
|
|
11
11
|
*/
|
|
12
12
|
export default class TablePropertyCommand extends Command {
|
|
13
|
+
/**
|
|
14
|
+
* The attribute that will be set by the command.
|
|
15
|
+
*/
|
|
16
|
+
attributeName;
|
|
17
|
+
/**
|
|
18
|
+
* The default value for the attribute.
|
|
19
|
+
*
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
22
|
+
_defaultValue;
|
|
23
|
+
/**
|
|
24
|
+
* The default value for the attribute for the content table.
|
|
25
|
+
*/
|
|
26
|
+
_defaultContentTableValue;
|
|
27
|
+
/**
|
|
28
|
+
* The default value for the attribute for the layout table.
|
|
29
|
+
*/
|
|
30
|
+
_defaultLayoutTableValue;
|
|
13
31
|
/**
|
|
14
32
|
* Creates a new `TablePropertyCommand` instance.
|
|
15
33
|
*
|
|
@@ -20,7 +38,8 @@ export default class TablePropertyCommand extends Command {
|
|
|
20
38
|
constructor(editor, attributeName, defaultValue) {
|
|
21
39
|
super(editor);
|
|
22
40
|
this.attributeName = attributeName;
|
|
23
|
-
this.
|
|
41
|
+
this._defaultContentTableValue = defaultValue;
|
|
42
|
+
this._defaultLayoutTableValue = attributeName === 'tableBorderStyle' ? 'none' : undefined;
|
|
24
43
|
}
|
|
25
44
|
/**
|
|
26
45
|
* @inheritDoc
|
|
@@ -29,6 +48,9 @@ export default class TablePropertyCommand extends Command {
|
|
|
29
48
|
const editor = this.editor;
|
|
30
49
|
const selection = editor.model.document.selection;
|
|
31
50
|
const table = getSelectionAffectedTable(selection);
|
|
51
|
+
this._defaultValue = !table || table.getAttribute('tableType') !== 'layout' ?
|
|
52
|
+
this._defaultContentTableValue :
|
|
53
|
+
this._defaultLayoutTableValue;
|
|
32
54
|
this.isEnabled = !!table;
|
|
33
55
|
this.value = this._getValue(table);
|
|
34
56
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @module table/tableproperties/tablepropertiesediting
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { first } from 'ckeditor5/src/utils.js';
|
|
9
10
|
import { addBackgroundRules, addBorderRules } from 'ckeditor5/src/engine.js';
|
|
10
11
|
import TableEditing from '../tableediting.js';
|
|
11
12
|
import { downcastAttributeToStyle, downcastTableAttribute, upcastBorderStyles, upcastStyleToAttribute } from '../converters/tableproperties.js';
|
|
@@ -133,15 +134,36 @@ function enableAlignmentProperty(schema, conversion, defaultValue) {
|
|
|
133
134
|
.attributeToAttribute({
|
|
134
135
|
model: {
|
|
135
136
|
name: 'table',
|
|
136
|
-
key: 'tableAlignment'
|
|
137
|
+
key: 'tableAlignment',
|
|
138
|
+
values: ['left', 'center', 'right']
|
|
137
139
|
},
|
|
138
|
-
view:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
view: {
|
|
141
|
+
left: {
|
|
142
|
+
key: 'style',
|
|
143
|
+
value: {
|
|
144
|
+
float: 'left'
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
right: {
|
|
148
|
+
key: 'style',
|
|
149
|
+
value: {
|
|
150
|
+
float: 'right'
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
center: (alignment, conversionApi, data) => {
|
|
154
|
+
const value = data.item.getAttribute('tableType') !== 'layout' ? {
|
|
155
|
+
// Model: `alignment:center` => CSS: `float:none`.
|
|
156
|
+
float: 'none'
|
|
157
|
+
} : {
|
|
158
|
+
'margin-left': 'auto',
|
|
159
|
+
'margin-right': 'auto'
|
|
160
|
+
};
|
|
161
|
+
return {
|
|
162
|
+
key: 'style',
|
|
163
|
+
value
|
|
164
|
+
};
|
|
143
165
|
}
|
|
144
|
-
}
|
|
166
|
+
},
|
|
145
167
|
converterPriority: 'high'
|
|
146
168
|
});
|
|
147
169
|
conversion.for('upcast')
|
|
@@ -155,13 +177,21 @@ function enableAlignmentProperty(schema, conversion, defaultValue) {
|
|
|
155
177
|
},
|
|
156
178
|
model: {
|
|
157
179
|
key: 'tableAlignment',
|
|
158
|
-
value: (viewElement) => {
|
|
180
|
+
value: (viewElement, conversionApi, data) => {
|
|
181
|
+
let localDefaultValue = defaultValue;
|
|
182
|
+
// Adjust default for layout tables.
|
|
183
|
+
if (data.modelRange) {
|
|
184
|
+
const modelElement = first(data.modelRange.getItems({ shallow: true }));
|
|
185
|
+
if (modelElement && modelElement.is('element') && modelElement.getAttribute('tableType') == 'layout') {
|
|
186
|
+
localDefaultValue = '';
|
|
187
|
+
}
|
|
188
|
+
}
|
|
159
189
|
let align = viewElement.getStyle('float');
|
|
160
190
|
// CSS: `float:none` => Model: `alignment:center`.
|
|
161
191
|
if (align === 'none') {
|
|
162
192
|
align = 'center';
|
|
163
193
|
}
|
|
164
|
-
return align ===
|
|
194
|
+
return align === localDefaultValue ? null : align;
|
|
165
195
|
}
|
|
166
196
|
}
|
|
167
197
|
})
|
|
@@ -175,9 +205,17 @@ function enableAlignmentProperty(schema, conversion, defaultValue) {
|
|
|
175
205
|
model: {
|
|
176
206
|
name: 'table',
|
|
177
207
|
key: 'tableAlignment',
|
|
178
|
-
value: (viewElement) => {
|
|
208
|
+
value: (viewElement, conversionApi, data) => {
|
|
209
|
+
let localDefaultValue = defaultValue;
|
|
210
|
+
// Adjust default for layout tables.
|
|
211
|
+
if (data.modelRange) {
|
|
212
|
+
const modelElement = first(data.modelRange.getItems({ shallow: true }));
|
|
213
|
+
if (modelElement && modelElement.is('element') && modelElement.getAttribute('tableType') == 'layout') {
|
|
214
|
+
localDefaultValue = '';
|
|
215
|
+
}
|
|
216
|
+
}
|
|
179
217
|
const align = viewElement.getAttribute('align');
|
|
180
|
-
return align ===
|
|
218
|
+
return align === localDefaultValue ? null : align;
|
|
181
219
|
}
|
|
182
220
|
}
|
|
183
221
|
});
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module table/tableproperties/tablepropertiesui
|
|
7
7
|
*/
|
|
8
|
-
import { type Editor
|
|
9
|
-
import { ContextualBalloon } from 'ckeditor5/src/ui.js';
|
|
8
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { ButtonView, ContextualBalloon } from 'ckeditor5/src/ui.js';
|
|
10
10
|
import TablePropertiesView from './ui/tablepropertiesview.js';
|
|
11
11
|
/**
|
|
12
12
|
* The table properties UI plugin. It introduces the `'tableProperties'` button
|
|
@@ -18,7 +18,11 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
18
18
|
/**
|
|
19
19
|
* The default table properties.
|
|
20
20
|
*/
|
|
21
|
-
private
|
|
21
|
+
private _defaultContentTableProperties;
|
|
22
|
+
/**
|
|
23
|
+
* The default layout table properties.
|
|
24
|
+
*/
|
|
25
|
+
private _defaultLayoutTableProperties;
|
|
22
26
|
/**
|
|
23
27
|
* The contextual balloon plugin instance.
|
|
24
28
|
*/
|
|
@@ -27,6 +31,14 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
27
31
|
* The properties form view displayed inside the balloon.
|
|
28
32
|
*/
|
|
29
33
|
view: TablePropertiesView | null;
|
|
34
|
+
/**
|
|
35
|
+
* The properties form view displayed inside the balloon (content table).
|
|
36
|
+
*/
|
|
37
|
+
private _viewWithContentTableDefaults;
|
|
38
|
+
/**
|
|
39
|
+
* The properties form view displayed inside the balloon (layout table).
|
|
40
|
+
*/
|
|
41
|
+
private _viewWithLayoutTableDefaults;
|
|
30
42
|
/**
|
|
31
43
|
* The batch used to undo all changes made by the form (which are live, as the user types)
|
|
32
44
|
* when "Cancel" was pressed. Each time the view is shown, a new batch is created.
|
|
@@ -57,6 +69,12 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
57
69
|
* @inheritDoc
|
|
58
70
|
*/
|
|
59
71
|
init(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Creates the table properties button.
|
|
74
|
+
*
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
_createTablePropertiesButton(): ButtonView;
|
|
60
78
|
/**
|
|
61
79
|
* @inheritDoc
|
|
62
80
|
*/
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* @module table/tableproperties/tablepropertiesui
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { IconTableProperties } from 'ckeditor5/src/icons.js';
|
|
9
10
|
import { ButtonView, ContextualBalloon, clickOutsideHandler, getLocalizedColorOptions, normalizeColorOptions } from 'ckeditor5/src/ui.js';
|
|
10
|
-
import { debounce } from '
|
|
11
|
+
import { debounce } from 'es-toolkit/compat';
|
|
11
12
|
import TablePropertiesView from './ui/tablepropertiesview.js';
|
|
12
|
-
import tableProperties from './../../theme/icons/table-properties.svg';
|
|
13
13
|
import { colorFieldValidator, getLocalizedColorErrorText, getLocalizedLengthErrorText, lengthFieldValidator, lineWidthFieldValidator, defaultColors } from '../utils/ui/table-properties.js';
|
|
14
14
|
import { getSelectionAffectedTableWidget } from '../utils/ui/widget.js';
|
|
15
15
|
import { getBalloonTablePositionData, repositionContextualBalloon } from '../utils/ui/contextualballoon.js';
|
|
16
|
-
import { getNormalizedDefaultTableProperties } from '../utils/table-properties.js';
|
|
16
|
+
import { getNormalizedDefaultProperties, getNormalizedDefaultTableProperties } from '../utils/table-properties.js';
|
|
17
17
|
const ERROR_TEXT_TIMEOUT = 500;
|
|
18
18
|
// Map of view properties and related commands.
|
|
19
19
|
const propertyToCommandMap = {
|
|
@@ -32,6 +32,40 @@ const propertyToCommandMap = {
|
|
|
32
32
|
* It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
|
|
33
33
|
*/
|
|
34
34
|
export default class TablePropertiesUI extends Plugin {
|
|
35
|
+
/**
|
|
36
|
+
* The default table properties.
|
|
37
|
+
*/
|
|
38
|
+
_defaultContentTableProperties;
|
|
39
|
+
/**
|
|
40
|
+
* The default layout table properties.
|
|
41
|
+
*/
|
|
42
|
+
_defaultLayoutTableProperties;
|
|
43
|
+
/**
|
|
44
|
+
* The contextual balloon plugin instance.
|
|
45
|
+
*/
|
|
46
|
+
_balloon;
|
|
47
|
+
/**
|
|
48
|
+
* The properties form view displayed inside the balloon.
|
|
49
|
+
*/
|
|
50
|
+
view = null;
|
|
51
|
+
/**
|
|
52
|
+
* The properties form view displayed inside the balloon (content table).
|
|
53
|
+
*/
|
|
54
|
+
_viewWithContentTableDefaults = null;
|
|
55
|
+
/**
|
|
56
|
+
* The properties form view displayed inside the balloon (layout table).
|
|
57
|
+
*/
|
|
58
|
+
_viewWithLayoutTableDefaults = null;
|
|
59
|
+
/**
|
|
60
|
+
* The batch used to undo all changes made by the form (which are live, as the user types)
|
|
61
|
+
* when "Cancel" was pressed. Each time the view is shown, a new batch is created.
|
|
62
|
+
*/
|
|
63
|
+
_undoStepBatch;
|
|
64
|
+
/**
|
|
65
|
+
* Flag used to indicate whether view is ready to execute update commands
|
|
66
|
+
* (it finished loading initial data).
|
|
67
|
+
*/
|
|
68
|
+
_isReady;
|
|
35
69
|
/**
|
|
36
70
|
* @inheritDoc
|
|
37
71
|
*/
|
|
@@ -55,10 +89,6 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
55
89
|
*/
|
|
56
90
|
constructor(editor) {
|
|
57
91
|
super(editor);
|
|
58
|
-
/**
|
|
59
|
-
* The properties form view displayed inside the balloon.
|
|
60
|
-
*/
|
|
61
|
-
this.view = null;
|
|
62
92
|
editor.config.define('table.tableProperties', {
|
|
63
93
|
borderColors: defaultColors,
|
|
64
94
|
backgroundColors: defaultColors
|
|
@@ -69,24 +99,32 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
69
99
|
*/
|
|
70
100
|
init() {
|
|
71
101
|
const editor = this.editor;
|
|
72
|
-
|
|
73
|
-
this._defaultTableProperties = getNormalizedDefaultTableProperties(editor.config.get('table.tableProperties.defaultProperties'), {
|
|
102
|
+
this._defaultContentTableProperties = getNormalizedDefaultTableProperties(editor.config.get('table.tableProperties.defaultProperties'), {
|
|
74
103
|
includeAlignmentProperty: true
|
|
75
104
|
});
|
|
105
|
+
this._defaultLayoutTableProperties = getNormalizedDefaultProperties();
|
|
76
106
|
this._balloon = editor.plugins.get(ContextualBalloon);
|
|
77
|
-
editor.ui.componentFactory.add('tableProperties',
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
107
|
+
editor.ui.componentFactory.add('tableProperties', () => this._createTablePropertiesButton());
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates the table properties button.
|
|
111
|
+
*
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
114
|
+
_createTablePropertiesButton() {
|
|
115
|
+
const editor = this.editor;
|
|
116
|
+
const t = editor.t;
|
|
117
|
+
const view = new ButtonView(editor.locale);
|
|
118
|
+
view.set({
|
|
119
|
+
label: t('Table properties'),
|
|
120
|
+
icon: IconTableProperties,
|
|
121
|
+
tooltip: true
|
|
89
122
|
});
|
|
123
|
+
this.listenTo(view, 'execute', () => this._showView());
|
|
124
|
+
const commands = Object.values(propertyToCommandMap)
|
|
125
|
+
.map(commandName => editor.commands.get(commandName));
|
|
126
|
+
view.bind('isEnabled').toMany(commands, 'isEnabled', (...areEnabled) => (areEnabled.some(isCommandEnabled => isCommandEnabled)));
|
|
127
|
+
return view;
|
|
90
128
|
}
|
|
91
129
|
/**
|
|
92
130
|
* @inheritDoc
|
|
@@ -104,7 +142,7 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
104
142
|
*
|
|
105
143
|
* @returns The table properties form view instance.
|
|
106
144
|
*/
|
|
107
|
-
_createPropertiesView() {
|
|
145
|
+
_createPropertiesView(defaultTableProperties) {
|
|
108
146
|
const editor = this.editor;
|
|
109
147
|
const config = editor.config.get('table.tableProperties');
|
|
110
148
|
const borderColorsConfig = normalizeColorOptions(config.borderColors);
|
|
@@ -115,7 +153,7 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
115
153
|
const view = new TablePropertiesView(editor.locale, {
|
|
116
154
|
borderColors: localizedBorderColors,
|
|
117
155
|
backgroundColors: localizedBackgroundColors,
|
|
118
|
-
defaultTableProperties
|
|
156
|
+
defaultTableProperties,
|
|
119
157
|
colorPickerConfig: hasColorPicker ? (config.colorPicker || {}) : false
|
|
120
158
|
});
|
|
121
159
|
const t = editor.t;
|
|
@@ -198,7 +236,9 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
198
236
|
Object.entries(propertyToCommandMap)
|
|
199
237
|
.map(([property, commandName]) => {
|
|
200
238
|
const propertyKey = property;
|
|
201
|
-
const defaultValue = this.
|
|
239
|
+
const defaultValue = this.view === this._viewWithContentTableDefaults ?
|
|
240
|
+
this._defaultContentTableProperties[propertyKey] || '' :
|
|
241
|
+
this._defaultLayoutTableProperties[propertyKey] || '';
|
|
202
242
|
return [propertyKey, (commands.get(commandName).value || defaultValue)];
|
|
203
243
|
})
|
|
204
244
|
.forEach(([property, value]) => {
|
|
@@ -219,9 +259,16 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
219
259
|
*/
|
|
220
260
|
_showView() {
|
|
221
261
|
const editor = this.editor;
|
|
222
|
-
|
|
223
|
-
|
|
262
|
+
const viewTable = getSelectionAffectedTableWidget(editor.editing.view.document.selection);
|
|
263
|
+
const modelTable = viewTable && editor.editing.mapper.toModelElement(viewTable);
|
|
264
|
+
const useDefaults = !modelTable || modelTable.getAttribute('tableType') !== 'layout';
|
|
265
|
+
if (useDefaults && !this._viewWithContentTableDefaults) {
|
|
266
|
+
this._viewWithContentTableDefaults = this._createPropertiesView(this._defaultContentTableProperties);
|
|
267
|
+
}
|
|
268
|
+
else if (!useDefaults && !this._viewWithLayoutTableDefaults) {
|
|
269
|
+
this._viewWithLayoutTableDefaults = this._createPropertiesView(this._defaultLayoutTableProperties);
|
|
224
270
|
}
|
|
271
|
+
this.view = useDefaults ? this._viewWithContentTableDefaults : this._viewWithLayoutTableDefaults;
|
|
225
272
|
this.listenTo(editor.ui, 'update', () => {
|
|
226
273
|
this._updateView();
|
|
227
274
|
});
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { ButtonView, FocusCycler, LabeledFieldView, ToolbarView, View, ViewCollection, type DropdownView, type InputTextView, type NormalizedColorOption, type ColorPickerConfig, type FocusableView } from 'ckeditor5/src/ui.js';
|
|
9
9
|
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
|
|
10
|
-
import '../../../theme/form.css';
|
|
11
|
-
import '../../../theme/tableform.css';
|
|
12
|
-
import '../../../theme/tableproperties.css';
|
|
13
10
|
import type ColorInputView from '../../ui/colorinputview.js';
|
|
14
11
|
import type { TablePropertiesOptions } from '../../tableconfig.js';
|
|
12
|
+
import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
|
|
13
|
+
import '../../../theme/formrow.css';
|
|
14
|
+
import '../../../theme/tableform.css';
|
|
15
|
+
import '../../../theme/tableproperties.css';
|
|
15
16
|
/**
|
|
16
17
|
* Additional configuration of the view.
|
|
17
18
|
*/
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module table/tableproperties/ui/tablepropertiesview
|
|
7
7
|
*/
|
|
8
|
-
import { addListToDropdown, ButtonView, createLabeledDropdown, createLabeledInputText, FocusCycler, FormHeaderView, LabeledFieldView, LabelView, submitHandler, ToolbarView, View, ViewCollection } from 'ckeditor5/src/ui.js';
|
|
8
|
+
import { addListToDropdown, ButtonView, createLabeledDropdown, createLabeledInputText, FocusCycler, FormRowView, FormHeaderView, LabeledFieldView, LabelView, submitHandler, ToolbarView, View, ViewCollection } from 'ckeditor5/src/ui.js';
|
|
9
9
|
import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';
|
|
10
|
-
import {
|
|
10
|
+
import { IconCancel, IconCheck, IconObjectCenter, IconObjectInlineLeft, IconObjectInlineRight } from 'ckeditor5/src/icons.js';
|
|
11
11
|
import { fillToolbar, getBorderStyleDefinitions, getBorderStyleLabels, getLabeledColorInputCreator } from '../../utils/ui/table-properties.js';
|
|
12
|
-
|
|
13
|
-
import '
|
|
12
|
+
// eslint-disable-next-line ckeditor5-rules/ckeditor-imports
|
|
13
|
+
import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
|
|
14
|
+
import '../../../theme/formrow.css';
|
|
14
15
|
import '../../../theme/tableform.css';
|
|
15
16
|
import '../../../theme/tableproperties.css';
|
|
16
17
|
/**
|
|
@@ -18,6 +19,66 @@ import '../../../theme/tableproperties.css';
|
|
|
18
19
|
* certain style aspects of a table, for instance, border, background color, alignment, etc..
|
|
19
20
|
*/
|
|
20
21
|
export default class TablePropertiesView extends View {
|
|
22
|
+
/**
|
|
23
|
+
* Options passed to the view. See {@link #constructor} to learn more.
|
|
24
|
+
*/
|
|
25
|
+
options;
|
|
26
|
+
/**
|
|
27
|
+
* Tracks information about the DOM focus in the form.
|
|
28
|
+
*/
|
|
29
|
+
focusTracker;
|
|
30
|
+
/**
|
|
31
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
32
|
+
*/
|
|
33
|
+
keystrokes;
|
|
34
|
+
/**
|
|
35
|
+
* A collection of child views in the form.
|
|
36
|
+
*/
|
|
37
|
+
children;
|
|
38
|
+
/**
|
|
39
|
+
* A dropdown that allows selecting the style of the table border.
|
|
40
|
+
*/
|
|
41
|
+
borderStyleDropdown;
|
|
42
|
+
/**
|
|
43
|
+
* An input that allows specifying the width of the table border.
|
|
44
|
+
*/
|
|
45
|
+
borderWidthInput;
|
|
46
|
+
/**
|
|
47
|
+
* An input that allows specifying the color of the table border.
|
|
48
|
+
*/
|
|
49
|
+
borderColorInput;
|
|
50
|
+
/**
|
|
51
|
+
* An input that allows specifying the table background color.
|
|
52
|
+
*/
|
|
53
|
+
backgroundInput;
|
|
54
|
+
/**
|
|
55
|
+
* An input that allows specifying the table width.
|
|
56
|
+
*/
|
|
57
|
+
widthInput;
|
|
58
|
+
/**
|
|
59
|
+
* An input that allows specifying the table height.
|
|
60
|
+
*/
|
|
61
|
+
heightInput;
|
|
62
|
+
/**
|
|
63
|
+
* A toolbar with buttons that allow changing the alignment of an entire table.
|
|
64
|
+
*/
|
|
65
|
+
alignmentToolbar;
|
|
66
|
+
/**
|
|
67
|
+
* The "Save" button view.
|
|
68
|
+
*/
|
|
69
|
+
saveButtonView;
|
|
70
|
+
/**
|
|
71
|
+
* The "Cancel" button view.
|
|
72
|
+
*/
|
|
73
|
+
cancelButtonView;
|
|
74
|
+
/**
|
|
75
|
+
* A collection of views that can be focused in the form.
|
|
76
|
+
*/
|
|
77
|
+
_focusables;
|
|
78
|
+
/**
|
|
79
|
+
* Helps cycling over {@link #_focusables} in the form.
|
|
80
|
+
*/
|
|
81
|
+
_focusCycler;
|
|
21
82
|
/**
|
|
22
83
|
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
23
84
|
* @param options Additional configuration of the view.
|
|
@@ -383,9 +444,9 @@ export default class TablePropertiesView extends View {
|
|
|
383
444
|
fillToolbar({
|
|
384
445
|
view: this,
|
|
385
446
|
icons: {
|
|
386
|
-
left:
|
|
387
|
-
center:
|
|
388
|
-
right:
|
|
447
|
+
left: IconObjectInlineLeft,
|
|
448
|
+
center: IconObjectCenter,
|
|
449
|
+
right: IconObjectInlineRight
|
|
389
450
|
},
|
|
390
451
|
toolbar: alignmentToolbar,
|
|
391
452
|
labels: this._alignmentLabels,
|
|
@@ -417,7 +478,7 @@ export default class TablePropertiesView extends View {
|
|
|
417
478
|
];
|
|
418
479
|
saveButtonView.set({
|
|
419
480
|
label: t('Save'),
|
|
420
|
-
icon:
|
|
481
|
+
icon: IconCheck,
|
|
421
482
|
class: 'ck-button-save',
|
|
422
483
|
type: 'submit',
|
|
423
484
|
withText: true
|
|
@@ -427,7 +488,7 @@ export default class TablePropertiesView extends View {
|
|
|
427
488
|
});
|
|
428
489
|
cancelButtonView.set({
|
|
429
490
|
label: t('Cancel'),
|
|
430
|
-
icon:
|
|
491
|
+
icon: IconCancel,
|
|
431
492
|
class: 'ck-button-cancel',
|
|
432
493
|
withText: true
|
|
433
494
|
});
|
package/src/tableselection.js
CHANGED
|
@@ -275,7 +275,25 @@ export default class TableSelection extends Plugin {
|
|
|
275
275
|
const startRow = Math.min(startLocation.row, endLocation.row);
|
|
276
276
|
const endRow = Math.max(startLocation.row, endLocation.row);
|
|
277
277
|
const startColumn = Math.min(startLocation.column, endLocation.column);
|
|
278
|
-
|
|
278
|
+
// Adjust the selection to include the entire row if a cell with colspan is selected.
|
|
279
|
+
// This ensures that the selection covers the full width of the colspan cell.
|
|
280
|
+
//
|
|
281
|
+
// Example:
|
|
282
|
+
// +---+---+---+---+
|
|
283
|
+
// | A | B | C | D |
|
|
284
|
+
// +---+---+---+---+
|
|
285
|
+
// | E |
|
|
286
|
+
// +---+---+---+---+
|
|
287
|
+
//
|
|
288
|
+
// If the selection starts at `B` and ends at `E`, the entire first row should be selected.
|
|
289
|
+
//
|
|
290
|
+
// In other words, the selection will represent the following cells:
|
|
291
|
+
// * Without this adjustment, only `B`, `A` and `E` would be selected.
|
|
292
|
+
// * With this adjustment, `A`, `B`, `C`, `D`, and `E` are selected.
|
|
293
|
+
//
|
|
294
|
+
// See: https://github.com/ckeditor/ckeditor5/issues/17538
|
|
295
|
+
const endColumnExtraColspan = (parseInt(targetCell.getAttribute('colspan') || '1') - 1);
|
|
296
|
+
const endColumn = Math.max(startLocation.column, endLocation.column + endColumnExtraColspan);
|
|
279
297
|
// 2-dimensional array of the selected cells to ease flipping the order of cells for backward selections.
|
|
280
298
|
const selectionMap = new Array(endRow - startRow + 1).fill(null).map(() => []);
|
|
281
299
|
const walkerOptions = {
|