Jelajahi Sumber

Docs: Update table documentation.

Maciej Gołaszewski 7 tahun lalu
induk
melakukan
ae2b75d37b

+ 5 - 1
packages/ckeditor5-table/src/commands/insertcolumncommand.js

@@ -49,7 +49,11 @@ export default class InsertColumnCommand extends Command {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Executes the command.
+	 *
+	 * Depending on command's {@link #order} value it inserts a column `'before'` or `'after'` the column in which selection is set.
+	 *
+	 * @fires execute
 	 */
 	execute() {
 		const editor = this.editor;

+ 5 - 1
packages/ckeditor5-table/src/commands/insertrowcommand.js

@@ -49,7 +49,11 @@ export default class InsertRowCommand extends Command {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Executes the command.
+	 *
+	 * Depending on command's {@link #order} value it inserts a row `'below'` or `'above'` the row in which selection is set.
+	 *
+	 * @fires execute
 	 */
 	execute() {
 		const editor = this.editor;

+ 8 - 1
packages/ckeditor5-table/src/commands/inserttablecommand.js

@@ -31,7 +31,14 @@ export default class InsertTableCommand extends Command {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Executes the command.
+	 *
+	 * Inserts table of given rows and columns into the editor.
+	 *
+	 * @param {Object} options
+	 * @param {Number} [options.rows=2] Number of rows to create in inserted table.
+	 * @param {Number} [options.columns=2] Number of columns to create in inserted table.
+	 * @fires execute
 	 */
 	execute( options = {} ) {
 		const model = this.editor.model;

+ 5 - 1
packages/ckeditor5-table/src/commands/mergecellcommand.js

@@ -59,7 +59,11 @@ export default class MergeCellCommand extends Command {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Executes the command.
+	 *
+	 * Depending on command's {@link #direction} value it will merge a cell that is to the `'left'`, `'right'`, `'up'` or `'down'`.
+	 *
+	 * @fires execute
 	 */
 	execute() {
 		const model = this.editor.model;

+ 1 - 1
packages/ckeditor5-table/src/commands/removecolumncommand.js

@@ -14,7 +14,7 @@ import TableUtils from '../tableutils';
 import { updateNumericAttribute } from './utils';
 
 /**
- * The split cell command.
+ * The remove column command.
  *
  * @extends module:core/command~Command
  */

+ 8 - 2
packages/ckeditor5-table/src/commands/setheadercolumncommand.js

@@ -44,7 +44,13 @@ export default class SetHeaderColumnCommand extends Command {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Executes the command.
+	 *
+	 * When the selection is non-header column, the command will set `headingColumns` table's attribute to cover that column.
+	 *
+	 * When selection is already in a header column then it will set `headingColumns` so the heading section will end before that column.
+	 *
+	 * @fires execute
 	 */
 	execute() {
 		const model = this.editor.model;
@@ -71,7 +77,7 @@ export default class SetHeaderColumnCommand extends Command {
 	}
 
 	/**
-	 * Checks if table cell is in heading section.
+	 * Checks if a table cell is in the heading section.
 	 *
 	 * @param {module:engine/model/element~Element} tableCell
 	 * @param {module:engine/model/element~Element} table

+ 7 - 1
packages/ckeditor5-table/src/commands/setheaderrowcommand.js

@@ -46,7 +46,13 @@ export default class SetHeaderRowCommand extends Command {
 	}
 
 	/**
-	 * @inheritDoc
+	 * Executes the command.
+	 *
+	 * When the selection is non-header row, the command will set `headingRows` table's attribute to cover that row.
+	 *
+	 * When selection is already in a header row then it will set `headingRows` so the heading section will end before that row.
+	 *
+	 * @fires execute
 	 */
 	execute() {
 		const model = this.editor.model;

+ 15 - 0
packages/ckeditor5-table/src/table.js

@@ -33,3 +33,18 @@ export default class Table extends Plugin {
 		return 'Table';
 	}
 }
+
+/**
+ * The configuration of the table features. Used by the table features in the `@ckeditor/ckeditor5-table` package.
+ *
+ *		ClassicEditor
+ *			.create( editorElement, {
+ * 				table: ... // Table feature options.
+ *			} )
+ *			.then( ... )
+ *			.catch( ... );
+ *
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
+ *
+ * @interface TableConfig
+ */

+ 2 - 2
packages/ckeditor5-table/src/tabletoolbar.js

@@ -16,7 +16,7 @@ import { repositionContextualBalloon, getBalloonPositionData } from './ui/utils'
 const balloonClassName = 'ck-toolbar-container';
 
 /**
- * The table toolbar class. Creates an table toolbar that shows up when the table widget is selected.
+ * The table toolbar class. Creates a table toolbar that shows up when the table widget is selected.
  *
  * Toolbar components are created using the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}
  * based on the {@link module:core/editor/editor~Editor#config configuration} stored under `table.toolbar`.
@@ -171,7 +171,7 @@ export default class TableToolbar extends Plugin {
  * Items to be placed in the table toolbar.
  * This option is used by the {@link module:table/tabletoolbar~TableToolbar} feature.
  *
- * Assuming that you use the {@link module:table/tableui~TableUI} feature below toolbar items will be available
+ * Assuming that you use the {@link module:table/tableui~TableUI} feature the following toolbar items will be available
  * in {@link module:ui/componentfactory~ComponentFactory}:
  *
  * * `'tableRow'`,

+ 1 - 1
packages/ckeditor5-table/src/tableui.js

@@ -27,7 +27,7 @@ import tableMergeCellIcon from './../theme/icons/table-merge-cell.svg';
  * * The `'tableRow'` dropdown,
  * * The `'mergeCell'` dropdown.
  *
- * The `'tableColumn'`, `'tableRow'`, `'mergeCell'` are best to be used in conjunction with {@link module:table/tabletoolbar~TableToolbar}.
+ * The `'tableColumn'`, `'tableRow'`, `'mergeCell'` work best with {@link module:table/tabletoolbar~TableToolbar}.
  *
  * @extends module:core/plugin~Plugin
  */

+ 3 - 1
packages/ckeditor5-table/src/ui/inserttableview.js

@@ -144,7 +144,9 @@ export default class InsertTableView extends View {
 }
 
 /**
- * Single grid box view element.
+ * A single grid box view element.
+ *
+ * This class is used to render table size selection grid in {@link module:table/ui/inserttableview~InsertTableView}
  *
  * @private
  */

+ 1 - 1
packages/ckeditor5-table/src/ui/utils.js

@@ -24,7 +24,7 @@ export function repositionContextualBalloon( editor ) {
 }
 
 /**
- * Returns the positioning options that control the geometry of the
+ * Returns the positioning options that controls the geometry of the
  * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
  * to the selected element in the editor content.
  *

+ 2 - 2
packages/ckeditor5-table/src/utils.js

@@ -29,7 +29,7 @@ export function toTableWidget( viewElement, writer ) {
 }
 
 /**
- * Checks if a given view element is an table widget.
+ * Checks if a given view element is a table widget.
  *
  * @param {module:engine/view/element~Element} viewElement
  * @returns {Boolean}
@@ -39,7 +39,7 @@ export function isTableWidget( viewElement ) {
 }
 
 /**
- * Checks if an table widget is the only selected element.
+ * Checks if a table widget is the only selected element.
  *
  * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
  * @returns {Boolean}