@univerjs-pro/docs-table 0.25.1 → 1.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.
Files changed (36) hide show
  1. package/README.md +23 -61
  2. package/lib/cjs/facade.js +1 -1
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/es/facade.js +1 -1
  5. package/lib/es/index.js +1 -1
  6. package/lib/facade.js +1 -1
  7. package/lib/index.js +1 -1
  8. package/lib/types/commands/insert-columns.command.d.ts +2 -2
  9. package/lib/types/commands/insert-rows.command.d.ts +2 -2
  10. package/lib/types/commands/move-columns.command.d.ts +2 -1
  11. package/lib/types/commands/move-rows.command.d.ts +2 -1
  12. package/lib/types/commands/set-table-background.command.d.ts +2 -2
  13. package/lib/types/commands/set-table-border-color.command.d.ts +5 -4
  14. package/lib/types/commands/set-table-vertical-align.command.d.ts +7 -0
  15. package/lib/types/common/actions.d.ts +22 -5
  16. package/lib/types/common/border.d.ts +17 -3
  17. package/lib/types/common/column-compat.d.ts +20 -0
  18. package/lib/types/common/insert-table.d.ts +46 -1
  19. package/lib/types/common/layout.d.ts +18 -0
  20. package/lib/types/common/sort.d.ts +4 -1
  21. package/lib/types/common/type.d.ts +22 -2
  22. package/lib/types/facade/f-document-table-cell.d.ts +162 -0
  23. package/lib/types/facade/f-document-table.d.ts +931 -0
  24. package/lib/types/facade/f-document.d.ts +95 -36
  25. package/lib/types/facade/f-enum.d.ts +114 -0
  26. package/lib/types/facade/index.d.ts +4 -4
  27. package/lib/types/facade/types.d.ts +1 -7
  28. package/lib/types/index.d.ts +23 -17
  29. package/lib/types/plugin.d.ts +1 -1
  30. package/lib/types/services/docs-table-selection.service.d.ts +7 -0
  31. package/lib/umd/facade.js +1 -1
  32. package/lib/umd/index.js +1 -1
  33. package/package.json +7 -8
  34. package/lib/types/facade/f-docs-table-cell.d.ts +0 -83
  35. package/lib/types/facade/f-docs-table.d.ts +0 -130
  36. /package/lib/types/{controllers/config.schema.d.ts → config/config.d.ts} +0 -0
@@ -1,88 +1,147 @@
1
- import type { IDocsTableFindQuery, IDocsTableInsertFacadeOptions } from './types';
2
- import { FDocsTable } from './f-docs-table';
3
- export interface IFDocumentDocsTableMixin {
1
+ import type { IDocsTableInsertOptions } from '@univerjs-pro/docs-table';
2
+ import type { IDocsTableFindQuery } from './types';
3
+ import { FDocument } from '@univerjs/docs/facade';
4
+ import { FDocumentTable } from './f-document-table';
5
+ export interface IFDocumentTableMixin {
4
6
  /**
5
7
  * Returns all enhanced docs tables in this document.
6
- * @returns {FDocsTable[]} The table facade instances.
8
+ * @returns {FDocumentTable[]} An array of FDocumentTable instances, or an empty array if the document contains no tables.
7
9
  * @example
8
10
  * ```ts
9
- * import '@univerjs-pro/docs-table/facade';
10
- *
11
- * const doc = univerAPI.getActiveDocument();
12
- * const tables = doc?.getTables() ?? [];
11
+ * const fDocument = univerAPI.getActiveDocument();
12
+ * const tables = fDocument.getTables();
13
+ * console.log(tables);
13
14
  * ```
14
15
  */
15
- getTables(): FDocsTable[];
16
+ getTables(): FDocumentTable[];
16
17
  /**
17
18
  * Returns a table by table id.
18
19
  * @param {string} tableId The table id stored in the document snapshot.
19
- * @returns {FDocsTable | null} The table facade, or `null` if it does not exist.
20
+ * @returns {FDocumentTable | null} The FDocumentTable instance, or `null` if no table with the given id exists in the document.
20
21
  * @example
21
22
  * ```ts
22
- * const table = doc.getTable('table-1');
23
+ * const fDocument = univerAPI.getActiveDocument();
24
+ * const table = fDocument.getTable('table-1');
25
+ * console.log(table);
23
26
  * ```
24
27
  */
25
- getTable(tableId: string): FDocsTable | null;
28
+ getTable(tableId: string): FDocumentTable | null;
26
29
  /**
27
30
  * Returns a table by its order in the document.
28
31
  * @param {number} index The zero-based table index.
29
- * @returns {FDocsTable | null} The table facade, or `null` if the index is out of range.
32
+ * @returns {FDocumentTable | null} The FDocumentTable instance, or `null` if the index is out of bounds.
33
+ * @example
34
+ * ```ts
35
+ * const fDocument = univerAPI.getActiveDocument();
36
+ * const firstTable = fDocument.getTableAt(0);
37
+ * console.log(firstTable);
38
+ * ```
30
39
  */
31
- getTableAt(index: number): FDocsTable | null;
40
+ getTableAt(index: number): FDocumentTable | null;
32
41
  /**
33
42
  * Returns the table currently selected by the docs table selection service.
34
- * @returns {FDocsTable | null} The selected table facade, or `null` if the selection is not in a table.
43
+ * @returns {FDocumentTable | null} The FDocumentTable instance, or `null` if there is no current table selection.
44
+ * @example
45
+ * ```ts
46
+ * const fDocument = univerAPI.getActiveDocument();
47
+ * const selectedTable = fDocument.getTableAtSelection();
48
+ * console.log(selectedTable);
49
+ * ```
35
50
  */
36
- getTableAtSelection(): FDocsTable | null;
51
+ getTableAtSelection(): FDocumentTable | null;
37
52
  /**
38
53
  * Finds the first table whose data stream contains the given text.
39
54
  * @param {string} text Text to search inside table cells.
40
- * @returns {FDocsTable | null} The first matching table facade, or `null`.
55
+ * @returns {FDocumentTable | null} The first FDocumentTable instance matching the query, or `null` if no matches are found.
41
56
  * @example
42
57
  * ```ts
43
- * const table = doc.findTableByText('Revenue');
58
+ * const fDocument = univerAPI.getActiveDocument();
59
+ * const table = fDocument.findTableByText('Revenue');
60
+ * console.log(table);
44
61
  * ```
45
62
  */
46
- findTableByText(text: string): FDocsTable | null;
63
+ findTableByText(text: string): FDocumentTable | null;
47
64
  /**
48
65
  * Finds tables by text, id, header text, or title text.
49
66
  * @param {string | IDocsTableFindQuery} query A plain text query or a structured table query.
50
- * @returns {FDocsTable[]} Matching table facades.
67
+ * @returns {FDocumentTable[]} An array of FDocumentTable instances matching the query, or an empty array if no matches are found.
51
68
  * @example
52
69
  * ```ts
53
- * const tables = doc.findTables({ headerText: 'Status' });
70
+ * const fDocument = univerAPI.getActiveDocument();
71
+ * const tablesWithText = fDocument.findTables('Revenue');
72
+ * const tablesWithId = fDocument.findTables({ tableId: 'table-1' });
73
+ * const tablesWithHeader = fDocument.findTables({ headerText: 'Q1' });
74
+ * const tablesWithTitle = fDocument.findTables({ titleText: 'Sales Data' });
75
+ * console.log(tablesWithText, tablesWithId, tablesWithHeader, tablesWithTitle);
54
76
  * ```
55
77
  */
56
- findTables(query: string | IDocsTableFindQuery): FDocsTable[];
78
+ findTables(query: string | IDocsTableFindQuery): FDocumentTable[];
57
79
  /**
58
80
  * Inserts an empty table at the current document selection or at the position provided in options.
59
81
  * @param {number} rows The row count.
60
82
  * @param {number} columns The column count.
61
- * @param {IDocsTableInsertFacadeOptions} [options] Optional table id, position, metadata, and layout options.
62
- * @returns {FDocsTable | null} The inserted table facade when the command succeeds.
83
+ * @param {IDocsTableInsertOptions} [options] Optional table id, position, metadata, and layout options.
84
+ * @returns {FDocumentTable | null} The inserted FDocumentTable instance, or `null` if the insert table failed.
63
85
  * @example
64
86
  * ```ts
65
- * const table = doc.insertTable(3, 4, { tableId: 'agent-table' });
66
- * table?.setCellText(0, 0, 'Name');
87
+ * const fDocument = univerAPI.getActiveDocument();
88
+ *
89
+ * // Insert a 3x4 table at the default position (document end)
90
+ * const table = fDocument.insertTable(3, 4);
91
+ *
92
+ * // Insert a 3x4 table at the current selection
93
+ * const table2 = fDocument.insertTable(3, 4, {
94
+ * position: univerAPI.Enum.DocsTableInsertTablePosition.Selection,
95
+ * });
96
+ *
97
+ * // Insert a 3x4 table with cell values at a specific offset
98
+ * const table3 = fDocument.insertTable(3, 4, {
99
+ * position: univerAPI.Enum.DocsTableInsertTablePosition.Offset,
100
+ * offset: 1000,
101
+ * values: [
102
+ * ['A1', 'B1', 'C1', 'D1'],
103
+ * ['A2', 'B2', 'C2', 'D2'],
104
+ * ['A3', 'B3', 'C3', 'D3'],
105
+ * ],
106
+ * });
67
107
  * ```
68
108
  */
69
- insertTable(rows: number, columns: number, options?: IDocsTableInsertFacadeOptions): FDocsTable | null;
109
+ insertTable(rows: number, columns: number, options?: IDocsTableInsertOptions): FDocumentTable | null;
70
110
  /**
71
111
  * Inserts a table and fills it with plain text cell data.
72
112
  * @param {string[][]} data Two-dimensional cell text data.
73
- * @param {IDocsTableInsertFacadeOptions} [options] Optional table id, position, metadata, and layout options.
74
- * @returns {FDocsTable | null} The inserted table facade when the command succeeds.
113
+ * @param {IDocsTableInsertOptions} [options] Optional table id, position, metadata, and layout options.
114
+ * @returns {FDocumentTable | null} The inserted FDocumentTable instance, or `null` if the insert table failed.
75
115
  * @example
76
116
  * ```ts
77
- * doc.insertTableFromData([
78
- * ['Name', 'Status'],
79
- * ['Facade', 'Ready'],
80
- * ], { headerRowCount: 1 });
117
+ * const fDocument = univerAPI.getActiveDocument();
118
+ *
119
+ * // Insert a table with 2 rows and 3 columns, and fill it with data
120
+ * const table = fDocument.insertTableFromData([
121
+ * ['Name', 'Status', 'Version'],
122
+ * ['Facade', 'Ready', '0.26.0'],
123
+ * ], {
124
+ * headerRowCount: 1,
125
+ * });
81
126
  * ```
82
127
  */
83
- insertTableFromData(data: string[][], options?: IDocsTableInsertFacadeOptions): FDocsTable | null;
128
+ insertTableFromData(data: string[][], options?: IDocsTableInsertOptions): FDocumentTable | null;
129
+ }
130
+ export declare class FDocumentTableMixin extends FDocument implements IFDocumentTableMixin {
131
+ getTables(): FDocumentTable[];
132
+ getTable(tableId: string): FDocumentTable | null;
133
+ getTableAt(index: number): FDocumentTable | null;
134
+ getTableAtSelection(): FDocumentTable | null;
135
+ findTableByText(text: string): FDocumentTable | null;
136
+ findTables(query: string | IDocsTableFindQuery): FDocumentTable[];
137
+ insertTable(rows: number, columns: number, options?: IDocsTableInsertOptions): FDocumentTable | null;
138
+ insertTableFromData(data: string[][], options?: IDocsTableInsertOptions): FDocumentTable | null;
139
+ private _getTables;
140
+ private _createFDocumentTable;
141
+ private _tableContainsText;
142
+ private _rowContainsText;
84
143
  }
85
- declare module '@univerjs/docs-ui/facade' {
86
- interface FDocument extends IFDocumentDocsTableMixin {
144
+ declare module '@univerjs/docs/facade' {
145
+ interface FDocument extends IFDocumentTableMixin {
87
146
  }
88
147
  }
@@ -0,0 +1,114 @@
1
+ import { DocsTableBorderPreset, DocsTableColumnInsertPosition, DocsTableColumnType, DocsTableInsertTablePosition, DocsTableRowInsertPosition, DocsTableSelectionKind, DocsTableSortDirection } from '@univerjs-pro/docs-table';
2
+ import { DashStyleType } from '@univerjs/core';
3
+ import { FEnum } from '@univerjs/core/facade';
4
+ /**
5
+ * @ignore
6
+ */
7
+ export interface IFDocumentTableEnumMixin {
8
+ /**
9
+ * Represents the insertion positions used by docs table creation.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const fDocument = univerAPI.getActiveDocument();
14
+ * const table = fDocument.insertTable(3, 4, {
15
+ * position: univerAPI.Enum.DocsTableInsertTablePosition.Selection,
16
+ * });
17
+ * ```
18
+ */
19
+ DocsTableInsertTablePosition: typeof DocsTableInsertTablePosition;
20
+ /**
21
+ * Represents the logical column types used by docs table metadata.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const fDocument = univerAPI.getActiveDocument();
26
+ * const table = fDocument.getTable('table-1');
27
+ * table?.setColumnType(1, {
28
+ * type: univerAPI.Enum.DocsTableColumnType.Number,
29
+ * });
30
+ * ```
31
+ */
32
+ DocsTableColumnType: typeof DocsTableColumnType;
33
+ /**
34
+ * Represents docs table selection scopes and modes.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const fDocument = univerAPI.getActiveDocument();
39
+ * const table = fDocument.getTable('table-1');
40
+ * const tableRange = table?.getTableRange();
41
+ * if (tableRange) {
42
+ * table.selectRange(tableRange, univerAPI.Enum.DocsTableSelectionKind.Table);
43
+ * }
44
+ * ```
45
+ */
46
+ DocsTableSelectionKind: typeof DocsTableSelectionKind;
47
+ /**
48
+ * Represents row insertion positions used by docs table row operations.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * univerAPI.Enum.DocsTableRowInsertPosition.Above;
53
+ * ```
54
+ */
55
+ DocsTableRowInsertPosition: typeof DocsTableRowInsertPosition;
56
+ /**
57
+ * Represents column insertion positions used by docs table column operations.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * univerAPI.Enum.DocsTableColumnInsertPosition.Right;
62
+ * ```
63
+ */
64
+ DocsTableColumnInsertPosition: typeof DocsTableColumnInsertPosition;
65
+ /**
66
+ * Represents border presets used by docs table border operations.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const table = univerAPI.getActiveDocument()?.getTable('table-1');
71
+ * table?.setTableBorder({
72
+ * preset: univerAPI.Enum.DocsTableBorderPreset.Outer,
73
+ * });
74
+ * ```
75
+ */
76
+ DocsTableBorderPreset: typeof DocsTableBorderPreset;
77
+ /**
78
+ * Represents sort directions used by docs table sort operations.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * const table = univerAPI.getActiveDocument()?.getTable('table-1');
83
+ * table?.sortByColumn(1, univerAPI.Enum.DocsTableSortDirection.Asc);
84
+ * ```
85
+ */
86
+ DocsTableSortDirection: typeof DocsTableSortDirection;
87
+ /**
88
+ * Represents dash styles used by table borders.
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * const table = univerAPI.getActiveDocument()?.getTable('table-1');
93
+ * table?.setTableBorder({
94
+ * preset: univerAPI.Enum.DocsTableBorderPreset.All,
95
+ * border: { dashStyle: univerAPI.Enum.DashStyleType.DASH },
96
+ * });
97
+ * ```
98
+ */
99
+ DashStyleType: typeof DashStyleType;
100
+ }
101
+ export declare class FDocumentTableEnumMixin extends FEnum implements IFDocumentTableEnumMixin {
102
+ get DocsTableInsertTablePosition(): typeof DocsTableInsertTablePosition;
103
+ get DocsTableColumnType(): typeof DocsTableColumnType;
104
+ get DocsTableSelectionKind(): typeof DocsTableSelectionKind;
105
+ get DocsTableRowInsertPosition(): typeof DocsTableRowInsertPosition;
106
+ get DocsTableColumnInsertPosition(): typeof DocsTableColumnInsertPosition;
107
+ get DocsTableBorderPreset(): typeof DocsTableBorderPreset;
108
+ get DocsTableSortDirection(): typeof DocsTableSortDirection;
109
+ get DashStyleType(): typeof DashStyleType;
110
+ }
111
+ declare module '@univerjs/core/facade' {
112
+ interface FEnum extends IFDocumentTableEnumMixin {
113
+ }
114
+ }
@@ -1,5 +1,5 @@
1
+ import './f-enum';
1
2
  import './f-document';
2
- export { FDocsTable } from './f-docs-table';
3
- export { FDocsTableCell } from './f-docs-table-cell';
4
- export type { IFDocumentDocsTableMixin } from './f-document';
5
- export type { IDocsTableBorderOptions, IDocsTableCellContentRange, IDocsTableCellStyle, IDocsTableDescription, IDocsTableFindQuery, IDocsTableInfo, IDocsTableInsertFacadeOptions, IDocsTableRange, IDocsTableStyle } from './types';
3
+ export { FDocumentTable } from './f-document-table';
4
+ export { FDocumentTableCell } from './f-document-table-cell';
5
+ export * from './types';
@@ -1,8 +1,5 @@
1
+ import type { DocsTableBorderPreset, IDocsTableMetadata } from '@univerjs-pro/docs-table';
1
2
  import type { ITable, ITableCellBorder } from '@univerjs/core';
2
- import type { DocsTableBorderPreset } from '../common/border';
3
- import type { IDocsTableInsertOptions } from '../common/insert-table';
4
- import type { IDocsTableCellRange, IDocsTableColumnTypeConfig, IDocsTableMetadata } from '../common/type';
5
- export type IDocsTableRange = IDocsTableCellRange;
6
3
  export interface IDocsTableFindQuery {
7
4
  tableId?: string;
8
5
  text?: string;
@@ -47,6 +44,3 @@ export interface IDocsTableStyle {
47
44
  backgroundColor?: string;
48
45
  border?: IDocsTableBorderOptions;
49
46
  }
50
- export interface IDocsTableInsertFacadeOptions extends IDocsTableInsertOptions {
51
- }
52
- export type { IDocsTableColumnTypeConfig };
@@ -46,34 +46,40 @@ export { DocsTableSetTableBorderWidthCommand } from './commands/set-table-border
46
46
  export type { IDocsTableSetTableBorderWidthCommandParams } from './commands/set-table-border-width.command';
47
47
  export { DocsTableSetTableBorderCommand } from './commands/set-table-border.command';
48
48
  export type { IDocsTableSetTableBorderCommandParams } from './commands/set-table-border.command';
49
+ export { DocsTableSetTableVerticalAlignCommand } from './commands/set-table-vertical-align.command';
50
+ export type { IDocsTableSetTableVerticalAlignCommandParams } from './commands/set-table-vertical-align.command';
49
51
  export { DocsTableSortTableCommand } from './commands/sort-table.command';
50
52
  export type { IDocsTableSortTableCommandParams } from './commands/sort-table.command';
51
53
  export { DocsTableUnmergeCellsCommand } from './commands/unmerge-cells.command';
52
54
  export type { IDocsTableUnmergeCellsCommandParams } from './commands/unmerge-cells.command';
53
- export { buildDeleteColumnsActions, buildDeleteRowsActions, buildDeleteTableActions, buildInsertColumnsActions, buildInsertRowsActions, buildMoveColumnsActions, buildMoveRowsActions, } from './common/actions';
54
- export type { DocsTableInsertPosition, IDeleteColumnsActionParams, IDeleteRowsActionParams, IDeleteTableActionParams, IDocsTableActionBuildResult, IDocsTableActionCursor, IInsertColumnsActionParams, IInsertRowsActionParams, IMoveColumnsActionParams, IMoveRowsActionParams, } from './common/actions';
55
- export { buildSetTableBorderActions, buildSetTableCellBackgroundActions, buildUpdateTableBorderStyleActions } from './common/border';
56
- export type { DocsTableBorderPreset, ISetTableBorderActionParams, ISetTableBorderActionResult, ISetTableCellBackgroundActionParams, IUpdateTableBorderStyleActionParams } from './common/border';
55
+ export { executeRichTextTableMutation } from './commands/utils';
56
+ export { buildDeleteColumnsActions, buildDeleteRowsActions, buildDeleteTableActions, buildInsertColumnsActions, buildInsertRowsActions, buildMoveColumnsActions, buildMoveRowsActions, DocsTableColumnInsertPosition, DocsTableInsertPosition, DocsTableRowInsertPosition, } from './common/actions';
57
+ export type { IDeleteColumnsActionParams, IDeleteRowsActionParams, IDeleteTableActionParams, IDocsTableActionBuildResult, IDocsTableActionCursor, IInsertColumnsActionParams, IInsertRowsActionParams, IMoveColumnsActionParams, IMoveRowsActionParams, } from './common/actions';
58
+ export { buildSetTableBorderActions, buildSetTableCellBackgroundActions, buildUpdateTableBorderStyleActions, DocsTableBorderPreset, } from './common/border';
59
+ export type { ISetTableBorderActionParams, ISetTableBorderActionResult, ISetTableCellBackgroundActionParams, IUpdateTableBorderStyleActionParams, } from './common/border';
57
60
  export { buildSetTableCellTextActions } from './common/cell-text';
58
61
  export type { ISetTableCellTextActionParams, ISetTableCellTextActionResult } from './common/cell-text';
59
- export { buildPasteHtmlTableActions, buildPastePlainTextTableActions, parseHtmlTableClipboard, parseHtmlTablesClipboard, serializeTableSelectionAsHtml, serializeTableSelectionAsPlainText } from './common/clipboard';
60
- export type { IParsedHtmlTableCell, IParsedHtmlTableClipboard, IParsedHtmlTableRow, IPasteHtmlTableParams, IPasteHtmlTableResult, IPastePlainTextTableParams, IPastePlainTextTableResult, ITableClipboardParams } from './common/clipboard';
62
+ export { buildPasteHtmlTableActions, buildPastePlainTextTableActions, parseHtmlTableClipboard, parseHtmlTablesClipboard, serializeTableSelectionAsHtml, serializeTableSelectionAsPlainText, } from './common/clipboard';
63
+ export type { IParsedHtmlTableCell, IParsedHtmlTableClipboard, IParsedHtmlTableRow, IPasteHtmlTableParams, IPasteHtmlTableResult, IPastePlainTextTableParams, IPastePlainTextTableResult, ITableClipboardParams, } from './common/clipboard';
61
64
  export { DOCS_TABLE_PLUGIN, DOCS_TABLE_RESOURCE_NAME } from './common/const';
62
- export { buildInsertTableActions } from './common/insert-table';
63
- export type { IDocsTableInsertActionParams, IDocsTableInsertActionResult, IDocsTableInsertOptions } from './common/insert-table';
64
- export { buildDistributeColumnsActions, buildDistributeRowsActions, buildInsertTitleRowActions, buildResizeColumnActions, buildResizeRowActions, buildSetHeaderRowCountActions, getPinnedHeaderRowCount } from './common/layout';
65
- export type { IDistributeColumnsActionParams, IDistributeRowsActionParams, IDocsTableLayoutActionResult, IInsertTitleRowActionParams, IResizeColumnActionParams, IResizeRowActionParams, ISetHeaderRowCountActionParams } from './common/layout';
66
- export { buildMergeCellsActions, buildUnmergeCellsActions, canMergeCells, canUnmergeCells, findMergeRange } from './common/merge';
65
+ export { buildInsertTableActions, DocsTableInsertTablePosition } from './common/insert-table';
66
+ export type { IDocsTableInsertActionParams, IDocsTableInsertActionResult, IDocsTableInsertOptions, } from './common/insert-table';
67
+ export { buildDistributeColumnsActions, buildDistributeRowsActions, buildInsertTitleRowActions, buildResizeColumnActions, buildResizeRowActions, buildSetHeaderRowCountActions, getPinnedHeaderRowCount, } from './common/layout';
68
+ export type { IDistributeColumnsActionParams, IDistributeRowsActionParams, IDocsTableLayoutActionResult, IInsertTitleRowActionParams, IResizeColumnActionParams, IResizeRowActionParams, ISetHeaderRowCountActionParams, } from './common/layout';
69
+ export { buildMoveTableActions } from './common/layout';
70
+ export type { IMoveTableActionParams } from './common/layout';
71
+ export { buildMergeCellsActions, buildUnmergeCellsActions, canMergeCells, canUnmergeCells, findMergeRange, } from './common/merge';
67
72
  export type { IDocsTableMergeActionParams, IDocsTableMergeActionResult } from './common/merge';
68
- export { normalizeDocsTableMetadataResource, setColumnTypeInMetadata, setHeaderRowCountInMetadata, setTitleRowInMetadata } from './common/metadata';
73
+ export { normalizeDocsTableMetadataResource, setColumnTypeInMetadata, setHeaderRowCountInMetadata, setTitleRowInMetadata, } from './common/metadata';
69
74
  export { remapDocsTableSelection } from './common/selection-remap';
70
75
  export type { DocsTableSelectionRemapOperation } from './common/selection-remap';
71
- export { buildSortTableActions } from './common/sort';
72
- export type { DocsTableSortDirection, ISortTableActionParams, ISortTableActionResult } from './common/sort';
76
+ export { buildSortTableActions, DocsTableSortDirection } from './common/sort';
77
+ export type { ISortTableActionParams, ISortTableActionResult } from './common/sort';
73
78
  export { getColumnRange, getRowRange, getTableRangeById } from './common/table-range';
74
- export type { IDocsTableCellOffsetRange, IDocsTableColumnOffsetRange, IDocsTableOffsetRange, IDocsTableRowOffsetRange } from './common/table-range';
75
- export type { DocsTableColumnType, DocsTableSelectionKind, IDocsTableCellRange, IDocsTableColumnTypeConfig, IDocsTableDropdownOption, IDocsTableMetadata, IDocsTableMetadataResource, IDocsTableSelection } from './common/type';
76
- export type { IUniverDocsTableConfig } from './controllers/config.schema';
79
+ export type { IDocsTableCellOffsetRange, IDocsTableColumnOffsetRange, IDocsTableOffsetRange, IDocsTableRowOffsetRange, } from './common/table-range';
80
+ export { DocsTableColumnType, DocsTableSelectionKind, DocsTableSelectionSource } from './common/type';
81
+ export type { IDocsTableCellRange, IDocsTableColumnTypeConfig, IDocsTableDropdownOption, IDocsTableMetadata, IDocsTableMetadataResource, IDocsTableSelection, } from './common/type';
82
+ export type { IUniverDocsTableConfig } from './config/config';
77
83
  export { DocsTableResourceController } from './controllers/docs-table-resource.controller';
78
84
  export { DocsTableModel } from './models/docs-table-model';
79
85
  export { UniverDocsTablePlugin } from './plugin';
@@ -1,4 +1,4 @@
1
- import type { IUniverDocsTableConfig } from './controllers/config.schema';
1
+ import type { IUniverDocsTableConfig } from './config/config';
2
2
  import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
3
  export declare class UniverDocsTablePlugin extends Plugin {
4
4
  private readonly _config;
@@ -5,16 +5,19 @@ import { DocSelectionManagerService } from '@univerjs/docs';
5
5
  export type IDocsTableStructuralSelectionInput = Pick<IDocsTableSelection, 'kind' | 'tableId' | 'startRow' | 'endRow' | 'startColumn' | 'endColumn'> & Partial<Pick<IDocsTableSelection, 'segmentId' | 'startOffset' | 'endOffset'>>;
6
6
  export interface IDocsTableStructuralSelectionOptions {
7
7
  clearNativeSelection?: boolean;
8
+ preserveOnTextSelection?: boolean;
8
9
  }
9
10
  export interface IDocsTableClearSelectionOptions {
10
11
  clearNativeSelection?: boolean;
11
12
  }
13
+ type DocsTableStructuralAxis = 'row' | 'column';
12
14
  export declare class DocsTableSelectionService extends Disposable {
13
15
  private readonly _univerInstanceService;
14
16
  private readonly _docSelectionManagerService;
15
17
  private readonly _selectionChange$;
16
18
  private _structuralSelection;
17
19
  private _nativeSelectionSuppressed;
20
+ private _preserveStructuralSelectionOnNextTextSelection;
18
21
  readonly selectionChange$: import("rxjs").Observable<Nullable<IDocsTableSelection>>;
19
22
  constructor(_univerInstanceService: IUniverInstanceService, _docSelectionManagerService: DocSelectionManagerService);
20
23
  getCurrentSelection(): Nullable<IDocsTableSelection>;
@@ -22,11 +25,15 @@ export declare class DocsTableSelectionService extends Disposable {
22
25
  getStableTableSelection(): Nullable<IDocsTableSelection>;
23
26
  emitCurrentSelection(): void;
24
27
  setStructuralSelection(selection: IDocsTableStructuralSelectionInput, options?: IDocsTableStructuralSelectionOptions): void;
28
+ setStructuralHeaderSelection(tableId: string, axis: DocsTableStructuralAxis, anchorIndex: number, currentIndex: number, options?: IDocsTableStructuralSelectionOptions): void;
25
29
  clearStructuralSelection(options?: IDocsTableClearSelectionOptions): void;
26
30
  setNativeSelectionSuppressed(suppressed: boolean): void;
27
31
  dispose(): void;
28
32
  private _getCurrentDoc;
33
+ private _restoreNativeSelectionForTextFocus;
34
+ private _setDirectStructuralSelection;
29
35
  private _getSelectionFromActiveTextRange;
30
36
  private _getSelectionFromRectRanges;
31
37
  private _canCombineRectRanges;
32
38
  }
39
+ export {};