@ckeditor/ckeditor5-table 0.0.0-nightly-next-20260127.0 → 0.0.0-nightly-next-20260128.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.
@@ -42,6 +42,31 @@ export interface TableConfig {
42
42
  rows?: number;
43
43
  columns?: number;
44
44
  };
45
+ /**
46
+ * Number of footer rows to render by default when inserting new tables.
47
+ *
48
+ * You can configure it like this:
49
+ *
50
+ * ```ts
51
+ * const tableConfig = {
52
+ * defaultFooters: 1
53
+ * };
54
+ * ```
55
+ *
56
+ * The rows property is optional, defaulting to 0 (no footer).
57
+ * This option is ignored when {@link module:table/tableconfig~TableConfig#enableFooters `config.table.enableFooters`} is `false`.
58
+ */
59
+ defaultFooters?: number;
60
+ /**
61
+ * Enables support for table footers (`<tfoot>`).
62
+ *
63
+ * When set to `true`, the editor will upcast and downcast `<tfoot>` elements, and the footer toggle will be visible
64
+ * in the table row dropdown.
65
+ * When set to `false` (default), footer rows are ignored and the footer toggle is hidden in the table row dropdown.
66
+ *
67
+ * @default false
68
+ */
69
+ enableFooters?: boolean;
45
70
  /**
46
71
  * Items to be placed in the table content toolbar.
47
72
  * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
@@ -76,6 +76,7 @@ export declare class TableUtils extends Plugin {
76
76
  * @param options.columns The number of columns to create. Default value is 2.
77
77
  * @param options.headingRows The number of heading rows. Default value is 0.
78
78
  * @param options.headingColumns The number of heading columns. Default value is 0.
79
+ * @param options.footerRows The number of footer rows. Default value is 0.
79
80
  * @returns The created table element.
80
81
  */
81
82
  createTable(writer: ModelWriter, options: {
@@ -83,6 +84,7 @@ export declare class TableUtils extends Plugin {
83
84
  columns?: number;
84
85
  headingRows?: number;
85
86
  headingColumns?: number;
87
+ footerRows?: number;
86
88
  }): ModelElement;
87
89
  /**
88
90
  * Inserts rows into a table.
@@ -350,44 +352,55 @@ export declare class TableUtils extends Plugin {
350
352
  * {@link #getTableCellsContainingSelection}.
351
353
  */
352
354
  getSelectedTableCells(selection: ModelSelection | ModelDocumentSelection): Array<ModelElement>;
355
+ /**
356
+ * Sets the number of footer rows for the given `table`.
357
+ *
358
+ * * If number of footer rows is greater than the number of rows in the table, it will be truncated to the number of rows.
359
+ * * If footer rows and heading rows overlap, the number of heading rows will be adjusted
360
+ *
361
+ * It'll have no effect if {@link module:table/tableconfig~TableConfig#enableFooters `table.enableFooters`} is set to `false`.
362
+ *
363
+ * @param writer The model writer.
364
+ * @param table The table model element.
365
+ * @param footerRows The number of footer rows to set.
366
+ */
367
+ setFooterRowsCount(writer: ModelWriter, table: ModelElement, footerRows: number): void;
353
368
  /**
354
369
  * Sets the number of heading rows for the given `table`.
355
370
  *
371
+ * If number of heading rows is greater than the number of rows in the table,
372
+ * it will be truncated to the number of rows.
373
+ *
356
374
  * @param writer The model writer.
357
375
  * @param table The table model element.
358
376
  * @param headingRows The number of heading rows to set.
359
377
  * @param options Additional options.
360
- * @param options.shallow If set to `true` it will only update the `headingRows` attribute
361
- * without updating the cell types in the table. Default is `false`.
378
+ * @param options.updateCellType If set to `false` it will only update the `headingRows` attribute
379
+ * without updating the cell types in the table. Default is `true`.
362
380
  * @param options.resetFormerHeadingCells If set to `true`, it will check if the rows that are no longer in the heading section
363
381
  * should be updated to body cells. Default is `true`.
364
382
  * @param options.autoExpand If set to `true`, it will check if the following rows look like a header and expand the heading section.
365
383
  * Default is `true`.
366
384
  */
367
- setHeadingRowsCount(writer: ModelWriter, table: ModelElement, headingRows: number, options?: {
368
- shallow?: boolean;
369
- resetFormerHeadingCells?: boolean;
370
- autoExpand?: boolean;
371
- }): void;
385
+ setHeadingRowsCount(writer: ModelWriter, table: ModelElement, headingRows: number, options?: UpdateTableHeadingsOptions): void;
372
386
  /**
373
387
  * Sets the number of heading columns for the given `table`.
374
388
  *
389
+ * If number of heading columns is greater than the number of columns in the table,
390
+ * it will be truncated to the number of columns.
391
+ *
375
392
  * @param writer The model writer to use.
376
393
  * @param table The table model element.
377
394
  * @param headingColumns The number of heading columns to set.
378
395
  * @param options Additional options.
379
- * @param options.shallow If set to `true` it will only update the `headingColumns` attribute
380
- * without updating the cell types in the table. Default is `false`.
396
+ * @param options.updateCellType If set to `false` it will only update the `headingColumns` attribute
397
+ * without updating the cell types in the table. Default is `true`.
381
398
  * @param options.resetFormerHeadingCells If set to `true`, it will check if the columns that are no longer in the heading section
382
399
  * should be updated to body cells. Default is `true`.
383
400
  * @param options.autoExpand If set to `true`, it will check if the following columns look like a header and expand the heading section.
384
401
  * Default is `true`.
385
402
  */
386
- setHeadingColumnsCount(writer: ModelWriter, table: ModelElement, headingColumns: number, options?: {
387
- shallow?: boolean;
388
- resetFormerHeadingCells?: boolean;
389
- autoExpand?: boolean;
390
- }): void;
403
+ setHeadingColumnsCount(writer: ModelWriter, table: ModelElement, headingColumns: number, options?: UpdateTableHeadingsOptions): void;
391
404
  /**
392
405
  * Returns all model table cells that the provided model selection's ranges
393
406
  * {@link module:engine/model/range~ModelRange#start} inside.
@@ -485,5 +498,44 @@ export declare class TableUtils extends Plugin {
485
498
  /**
486
499
  * Unified check if table rows/columns indexes are in the same heading/body section.
487
500
  */
488
- private _areIndexesInSameSection;
501
+ private _areIndexesInSameHeadingSection;
502
+ /**
503
+ * Unified check if table rows indexes are in the same footer/body section.
504
+ */
505
+ private _areIndexesInSameFooterSection;
489
506
  }
507
+ /**
508
+ * Options for the {@link module:table/tableutils~TableUtils#setHeadingRowsCount} and
509
+ * {@link module:table/tableutils~TableUtils#setHeadingColumnsCount} methods.
510
+ */
511
+ export type UpdateTableHeadingsOptions = {
512
+ /**
513
+ * If set to `false` it will only update the `headingRows`/`headingColumns` attribute
514
+ * without updating the cell types in the table.
515
+ *
516
+ * This option has no effect if {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing}
517
+ * is not loaded.
518
+ *
519
+ * @default true
520
+ */
521
+ updateCellType?: boolean;
522
+ /**
523
+ * If set to `true`, it will check if the rows/columns that are no longer in the heading section
524
+ * should be updated to body cells.
525
+ *
526
+ * This option has no effect if {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing}
527
+ * is not loaded.
528
+ *
529
+ * @default true
530
+ */
531
+ resetFormerHeadingCells?: boolean;
532
+ /**
533
+ * If set to `true`, it will check if the following rows/columns look like a header and expand the heading section.
534
+ *
535
+ * This option has no effect if {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing}
536
+ * is not loaded.
537
+ *
538
+ * @default true
539
+ */
540
+ autoExpand?: boolean;
541
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-table",
3
- "version": "0.0.0-nightly-next-20260127.0",
3
+ "version": "0.0.0-nightly-next-20260128.0",
4
4
  "description": "Table feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -26,14 +26,14 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@ckeditor/ckeditor5-clipboard": "0.0.0-nightly-next-20260127.0",
30
- "@ckeditor/ckeditor5-core": "0.0.0-nightly-next-20260127.0",
31
- "@ckeditor/ckeditor5-engine": "0.0.0-nightly-next-20260127.0",
32
- "@ckeditor/ckeditor5-icons": "0.0.0-nightly-next-20260127.0",
33
- "@ckeditor/ckeditor5-typing": "0.0.0-nightly-next-20260127.0",
34
- "@ckeditor/ckeditor5-ui": "0.0.0-nightly-next-20260127.0",
35
- "@ckeditor/ckeditor5-utils": "0.0.0-nightly-next-20260127.0",
36
- "@ckeditor/ckeditor5-widget": "0.0.0-nightly-next-20260127.0",
29
+ "@ckeditor/ckeditor5-clipboard": "0.0.0-nightly-next-20260128.0",
30
+ "@ckeditor/ckeditor5-core": "0.0.0-nightly-next-20260128.0",
31
+ "@ckeditor/ckeditor5-engine": "0.0.0-nightly-next-20260128.0",
32
+ "@ckeditor/ckeditor5-icons": "0.0.0-nightly-next-20260128.0",
33
+ "@ckeditor/ckeditor5-typing": "0.0.0-nightly-next-20260128.0",
34
+ "@ckeditor/ckeditor5-ui": "0.0.0-nightly-next-20260128.0",
35
+ "@ckeditor/ckeditor5-utils": "0.0.0-nightly-next-20260128.0",
36
+ "@ckeditor/ckeditor5-widget": "0.0.0-nightly-next-20260128.0",
37
37
  "es-toolkit": "1.39.5"
38
38
  },
39
39
  "files": [