@worktile/theia 15.2.1 → 15.3.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/constants/default.d.ts +1 -1
- package/esm2020/components/column-resize/column-resize.directive.mjs +5 -1
- package/esm2020/constants/default.mjs +2 -2
- package/esm2020/interfaces/image.mjs +1 -1
- package/esm2020/plugins/image/image.editor.mjs +6 -2
- package/esm2020/plugins/link/edit/link-edit.component.mjs +3 -5
- package/esm2020/plugins/table/components/table.component.mjs +33 -22
- package/esm2020/plugins/table/components/td/td.component.mjs +48 -40
- package/esm2020/plugins/table/components/toolbar/table-options.component.mjs +5 -6
- package/esm2020/plugins/table/components/toolbar/table-toolbar.component.mjs +3 -3
- package/esm2020/plugins/table/table.service.mjs +55 -8
- package/esm2020/plugins/table/table.store.mjs +164 -131
- package/esm2020/plugins/table/utils/cell-position.mjs +31 -10
- package/esm2020/plugins/table/utils/get-min-max-cell-index.mjs +16 -11
- package/esm2020/plugins/table/utils/get-select-cell-node.mjs +8 -1
- package/esm2020/plugins/table/utils/index.mjs +17 -9
- package/esm2020/plugins/table/utils/remove-row-column.mjs +47 -0
- package/esm2020/plugins/table/utils/set-node-options.mjs +11 -0
- package/esm2020/services/table-contextmenu.service.mjs +10 -3
- package/esm2020/utils/dom.mjs +2 -2
- package/esm2020/utils/index.mjs +2 -1
- package/fesm2015/worktile-theia.mjs +1043 -851
- package/fesm2015/worktile-theia.mjs.map +1 -1
- package/fesm2020/worktile-theia.mjs +1047 -857
- package/fesm2020/worktile-theia.mjs.map +1 -1
- package/interfaces/image.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/link/edit/link-edit.component.d.ts +0 -1
- package/plugins/table/components/table.component.d.ts +4 -2
- package/plugins/table/components/td/td.component.d.ts +5 -5
- package/plugins/table/components/toolbar/table-options.component.d.ts +1 -3
- package/plugins/table/table.editor.d.ts +1 -4
- package/plugins/table/table.service.d.ts +22 -4
- package/plugins/table/table.store.d.ts +35 -16
- package/plugins/table/utils/cell-position.d.ts +24 -2
- package/plugins/table/utils/get-min-max-cell-index.d.ts +6 -1
- package/plugins/table/utils/get-select-cell-node.d.ts +1 -0
- package/plugins/table/utils/index.d.ts +16 -8
- package/plugins/table/utils/remove-row-column.d.ts +6 -0
- package/plugins/table/utils/set-node-options.d.ts +3 -0
- package/utils/index.d.ts +1 -0
package/interfaces/image.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export interface ImagePluginOptions {
|
|
|
37
37
|
allowParentTypes?: CustomElementKinds[];
|
|
38
38
|
imageTypes?: string[];
|
|
39
39
|
disablePreview?: ((editor: TheEditor) => boolean) | boolean;
|
|
40
|
+
acceptedUploadSize?: number;
|
|
40
41
|
preview?: (data: {
|
|
41
42
|
editor: TheEditor;
|
|
42
43
|
previewImageInfo: PreviewImageInfo;
|
package/package.json
CHANGED
|
@@ -28,7 +28,6 @@ export declare class TheLinkEditComponent implements OnInit {
|
|
|
28
28
|
handleDocumentMouseDown(event: MouseEvent): void;
|
|
29
29
|
constructor(thyPopoverRef: ThyPopoverRef<any>);
|
|
30
30
|
ngOnInit(): void;
|
|
31
|
-
linkRegExp(val: any): boolean;
|
|
32
31
|
closePopover(type?: string): void;
|
|
33
32
|
applyLink(form: any): void;
|
|
34
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<TheLinkEditComponent, never>;
|
|
@@ -5,11 +5,11 @@ import { TheBaseElementComponent, ThePluginOption, TheModeConfig } from '../../.
|
|
|
5
5
|
import { TableCellElement, TableElement } from '../../../custom-types';
|
|
6
6
|
import { ColumnResizeNotifierSource, TableCellEventDispatcher } from '../../../components';
|
|
7
7
|
import { TheTableContextMenuService } from '../../../services/table-contextmenu.service';
|
|
8
|
+
import { TheContextService } from '../../../services/context.service';
|
|
8
9
|
import { TableStore } from '../table.store';
|
|
9
10
|
import { TableService } from '../table.service';
|
|
10
11
|
import { ThePluginTableOption, TheTableColumn } from '../table.types';
|
|
11
12
|
import { TableFreezeColumnPipe, TableFreezeRowPipe } from '../table.pipe';
|
|
12
|
-
import { TheContextService } from '../../../services/context.service';
|
|
13
13
|
import * as i0 from "@angular/core";
|
|
14
14
|
export declare class TheTableComponent extends TheBaseElementComponent<TableElement, Editor> implements OnInit, AfterViewInit, OnDestroy {
|
|
15
15
|
eventDispatcher: TableCellEventDispatcher;
|
|
@@ -93,7 +93,9 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
|
|
|
93
93
|
onSelectTable(event: MouseEvent): void;
|
|
94
94
|
listenTableContextMenuEvent(): void;
|
|
95
95
|
listenOnSelectedCells(): void;
|
|
96
|
-
|
|
96
|
+
listenKeydownEvent(): void;
|
|
97
|
+
listenKeyupEvent(): void;
|
|
98
|
+
private listenSelectstartEvent;
|
|
97
99
|
listenTableWrapperScroll(): void;
|
|
98
100
|
updateStickyRowScrollLeft(): void;
|
|
99
101
|
setHeaderRowLeftStyle(): void;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { OnInit, ElementRef, OnDestroy, ChangeDetectorRef, NgZone, Renderer2, ViewContainerRef, AfterViewInit, Injector } from '@angular/core';
|
|
2
2
|
import { Editor } from 'slate';
|
|
3
|
-
import { TheTableComponent } from '../table.component';
|
|
4
|
-
import { TablePosition } from '../../utils/table-position';
|
|
5
3
|
import { Subject } from 'rxjs';
|
|
4
|
+
import { ConnectedPosition, Overlay, OverlayRef, ScrollDispatcher } from '@angular/cdk/overlay';
|
|
6
5
|
import { ColumnResizingStore } from '../../../../components/column-resize/resizing.store';
|
|
7
6
|
import { Position, TableCellEventDispatcher } from '../../../../components/column-resize/event-dispatcher';
|
|
8
7
|
import { ColumnResizeNotifierSource } from '../../../../components/column-resize/column-resize-notifier';
|
|
9
|
-
import { ConnectedPosition, Overlay, OverlayRef, ScrollDispatcher } from '@angular/cdk/overlay';
|
|
10
8
|
import { ResizeRef } from '../../../../components/column-resize/resize-ref';
|
|
11
9
|
import { TheBaseElementComponent } from '../../../../interfaces/view-base';
|
|
12
|
-
import { TableOptions } from '../../table.types';
|
|
13
10
|
import { TableCellElement } from '../../../../custom-types';
|
|
11
|
+
import { TableOptions } from '../../table.types';
|
|
14
12
|
import { TableFreezeColumnPipe } from '../../table.pipe';
|
|
13
|
+
import { TheTableComponent } from '../table.component';
|
|
14
|
+
import { TablePosition } from '../../utils';
|
|
15
15
|
import * as i0 from "@angular/core";
|
|
16
16
|
export declare const POSITION_MAP: {
|
|
17
17
|
[key: string]: ConnectedPosition;
|
|
@@ -31,7 +31,7 @@ export declare class TheTdComponent extends TheBaseElementComponent<TableCellEle
|
|
|
31
31
|
tablePosition: TablePosition;
|
|
32
32
|
tableComponent: TheTableComponent;
|
|
33
33
|
protected overlayRef?: OverlayRef;
|
|
34
|
-
|
|
34
|
+
hoveredDirection: Position | null;
|
|
35
35
|
tableOptions: TableOptions;
|
|
36
36
|
cellInnerMinHeight: number;
|
|
37
37
|
get tableStore(): import("../../table.store").TableStore;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { ThyPopoverRef } from 'ngx-tethys/popover';
|
|
3
3
|
import { Editor } from 'slate';
|
|
4
|
-
import { TableStore } from '../../table.store';
|
|
5
4
|
import { TableDropdownOption } from '../../table.types';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
7
6
|
export declare class TheTableOptionsComponent implements OnInit {
|
|
8
7
|
private popoverRef;
|
|
9
|
-
tableStore: TableStore;
|
|
10
8
|
editor: Editor;
|
|
11
9
|
tableDropdownList: TableDropdownOption[];
|
|
12
10
|
constructor(popoverRef: ThyPopoverRef<TheTableOptionsComponent>);
|
|
@@ -15,5 +13,5 @@ export declare class TheTableOptionsComponent implements OnInit {
|
|
|
15
13
|
setColumnOptions(): void;
|
|
16
14
|
setTableOptions(event: MouseEvent, option: TableDropdownOption): void;
|
|
17
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<TheTableOptionsComponent, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TheTableOptionsComponent, "the-table-options", never, { "
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TheTableOptionsComponent, "the-table-options", never, { "editor": "editor"; }, {}, never, never, false, never>;
|
|
19
17
|
}
|
|
@@ -12,10 +12,7 @@ export declare const TableEditor: {
|
|
|
12
12
|
removeColumn(editor: Editor, colIndex?: number, optionsParam?: TableOptions): void;
|
|
13
13
|
clearCell(editor: Editor, nodeEntry?: NodeEntry<CustomElement>, optionsParam?: TableOptions): void;
|
|
14
14
|
isActive(editor: Editor): boolean;
|
|
15
|
-
getSelectedCells(editor: Editor):
|
|
16
|
-
row: number;
|
|
17
|
-
col: number;
|
|
18
|
-
}[];
|
|
15
|
+
getSelectedCells(editor: Editor): import("./table.types").CellPosition[];
|
|
19
16
|
setAlign(editor: Editor, alignment: Alignment): boolean;
|
|
20
17
|
setVerticalAlign(editor: TheEditor, alignment: VerticalAlignment): boolean;
|
|
21
18
|
isVerticalAlignActive(editor: TheEditor, alignment: VerticalAlignment): boolean;
|
|
@@ -3,15 +3,13 @@ import { NgZone } from '@angular/core';
|
|
|
3
3
|
import { ThyPlacement } from 'ngx-tethys/core';
|
|
4
4
|
import { ThyPopover, ThyPopoverRef } from 'ngx-tethys/popover';
|
|
5
5
|
import { TableElement } from '../../custom-types';
|
|
6
|
-
import { TheContextService } from '
|
|
7
|
-
import { TheTableContextMenuService } from '../../services/table-contextmenu.service';
|
|
6
|
+
import { TheContextService } from '../..//services/context.service';
|
|
8
7
|
import { TableStore } from './table.store';
|
|
9
8
|
import * as i0 from "@angular/core";
|
|
10
9
|
export declare class TableService {
|
|
11
10
|
private thyPopover;
|
|
12
11
|
private overlay;
|
|
13
12
|
private tableStore;
|
|
14
|
-
private theTableContextMenuService;
|
|
15
13
|
private ngZone;
|
|
16
14
|
private theContextService;
|
|
17
15
|
backdropClosable: boolean;
|
|
@@ -21,11 +19,31 @@ export declare class TableService {
|
|
|
21
19
|
offset: number;
|
|
22
20
|
toolbarRef: ThyPopoverRef<any>;
|
|
23
21
|
get isOpened(): any;
|
|
24
|
-
constructor(thyPopover: ThyPopover, overlay: Overlay, tableStore: TableStore,
|
|
22
|
+
constructor(thyPopover: ThyPopover, overlay: Overlay, tableStore: TableStore, ngZone: NgZone, theContextService: TheContextService);
|
|
25
23
|
private openToolbar;
|
|
26
24
|
afterSelectedCells(origin: HTMLElement, element: TableElement): void;
|
|
27
25
|
getOrigin(origin: HTMLElement): HTMLElement;
|
|
28
26
|
closeToolbar(): import("rxjs").Observable<unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* 判断是否触发了点选,并处理点选状态
|
|
29
|
+
* @param e 事件对象
|
|
30
|
+
* @param tbody tbody元素
|
|
31
|
+
*/
|
|
32
|
+
handleKeydownForPointerSelection(e: KeyboardEvent, tbody: HTMLElement): void;
|
|
33
|
+
/**
|
|
34
|
+
* 判断是否触发了区域选择,并处理区域选择状态
|
|
35
|
+
* @param e 事件对象
|
|
36
|
+
* @param tbody tbody元素
|
|
37
|
+
*/
|
|
38
|
+
handleKeydownForAreaSelection(e: KeyboardEvent, tbody: HTMLElement): void;
|
|
39
|
+
cancelPointerSelection(): void;
|
|
40
|
+
cancelAreaSelection(): void;
|
|
41
|
+
/**
|
|
42
|
+
* 进行区域选择时,阻止默认的选区事件
|
|
43
|
+
* @param e 事件对象
|
|
44
|
+
* @param editor 编辑器对象
|
|
45
|
+
*/
|
|
46
|
+
selectStartPreventDefault(e: KeyboardEvent): void;
|
|
29
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableService, never>;
|
|
30
48
|
static ɵprov: i0.ɵɵInjectableDeclaration<TableService>;
|
|
31
49
|
}
|
|
@@ -2,7 +2,7 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { Editor } from 'slate';
|
|
3
3
|
import { TablePosition } from './utils';
|
|
4
4
|
import { ColorType } from '../../constants/color-select';
|
|
5
|
-
import { CellPosition
|
|
5
|
+
import { CellPosition } from './table.types';
|
|
6
6
|
import { TableCellElement } from '../../custom-types';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class TableStore {
|
|
@@ -27,33 +27,31 @@ export declare class TableStore {
|
|
|
27
27
|
isRightClicking: boolean;
|
|
28
28
|
isFocusedInput: boolean;
|
|
29
29
|
pointerSelection: boolean;
|
|
30
|
+
areaSelection: boolean;
|
|
30
31
|
maxCol: number;
|
|
31
32
|
get dangerousCells(): CellPosition[];
|
|
32
33
|
constructor();
|
|
33
|
-
|
|
34
|
-
getSelectedCellPositions():
|
|
35
|
-
|
|
36
|
-
col: number;
|
|
37
|
-
}[];
|
|
34
|
+
initEditor(editor: Editor): void;
|
|
35
|
+
getSelectedCellPositions(): CellPosition[];
|
|
36
|
+
publishDangerousCells(value: CellPosition[]): void;
|
|
38
37
|
setSelectedColumnsAndRowIndex(): void;
|
|
39
38
|
setSelectedCells(cells: CellPosition[], pos: TablePosition): void;
|
|
40
|
-
initEditor(editor: Editor): void;
|
|
41
39
|
selectRow(editor: Editor, index: number): void;
|
|
42
40
|
selectColumn(editor: Editor, index: number): void;
|
|
43
41
|
selectTable(editor: Editor): void;
|
|
42
|
+
selectCellStart(cell: HTMLTableCellElement, editor: Editor): void;
|
|
44
43
|
selectCells(editor: Editor): void;
|
|
44
|
+
selectFirstCell(): void;
|
|
45
45
|
selectCell(cell: HTMLTableCellElement, editor: Editor): void;
|
|
46
|
+
selectCellOngoing(cell: HTMLTableCellElement, editor: Editor): void;
|
|
47
|
+
clearSelectedCells(): void;
|
|
48
|
+
clearLastFocusPath(): void;
|
|
46
49
|
selectedCellsChange(): Observable<TableCellElement[]>;
|
|
47
50
|
cellsPositionChange(): Observable<void>;
|
|
48
51
|
changeCells(): void;
|
|
49
52
|
emitTableChange(): void;
|
|
50
53
|
tableChange(): Observable<void>;
|
|
51
|
-
clearSelectedCells(): void;
|
|
52
|
-
clearLastFocusPath(): void;
|
|
53
|
-
selectCellStart(cell: HTMLTableCellElement, editor: Editor): void;
|
|
54
|
-
selectCellOngoing(cell: HTMLTableCellElement, editor: Editor): void;
|
|
55
54
|
selectCellEnd(editor: Editor): void;
|
|
56
|
-
focusCell(editor: Editor, path: number[]): void;
|
|
57
55
|
dangerousCellsChange(): Observable<CellPosition[]>;
|
|
58
56
|
setDangerousCells(): void;
|
|
59
57
|
clearDangerousCells(): void;
|
|
@@ -61,12 +59,33 @@ export declare class TableStore {
|
|
|
61
59
|
setDangerousRows(): void;
|
|
62
60
|
setDangerousColumns(): void;
|
|
63
61
|
setDangerousTable(): void;
|
|
64
|
-
selectFirstCell(): void;
|
|
65
62
|
setSelectedCellsBackgroundColor(backgroundColor: ColorType): void;
|
|
66
63
|
clearSelectedCellsContent(): void;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
/**
|
|
65
|
+
* 聚焦单元格并设置聚焦相关路径及元素
|
|
66
|
+
*/
|
|
67
|
+
focusCell(path: number[]): void;
|
|
68
|
+
/**
|
|
69
|
+
* 区域选择开始
|
|
70
|
+
* @param editor 编辑器对象
|
|
71
|
+
* @param cell 单元格元素
|
|
72
|
+
*/
|
|
73
|
+
areaSelectionStart(cell: HTMLTableCellElement, editor: Editor): void;
|
|
74
|
+
/**
|
|
75
|
+
* 设置区域选择的单元格
|
|
76
|
+
* @param cellElement 单元格元素
|
|
77
|
+
*/
|
|
78
|
+
setAreaSelectionCells(cellElement: TableCellElement): void;
|
|
79
|
+
/**
|
|
80
|
+
* 处理区域选择启用时选择整行/整列
|
|
81
|
+
* @param cells 选择的单元格
|
|
82
|
+
*/
|
|
83
|
+
areaSelectRowAndColumn(cells: CellPosition[]): void;
|
|
84
|
+
/**
|
|
85
|
+
* 设置区域选择触发时的指定 anchorCellPath
|
|
86
|
+
* @param path 路径
|
|
87
|
+
*/
|
|
88
|
+
setAreaAnchorCellPath(path: number[]): void;
|
|
70
89
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableStore, never>;
|
|
71
90
|
static ɵprov: i0.ɵɵInjectableDeclaration<TableStore>;
|
|
72
91
|
}
|
|
@@ -1,14 +1,36 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
2
|
import { TableCellElement } from '../../../custom-types';
|
|
3
3
|
import { CellPosition } from '../table.types';
|
|
4
|
+
/**
|
|
5
|
+
* 判断是否选中了所有的单元格
|
|
6
|
+
* @param editor 编辑器对象
|
|
7
|
+
* @param selectedCellPositions 选中的单元格位置数组
|
|
8
|
+
* @returns 是否选中了所有的单元格
|
|
9
|
+
*/
|
|
4
10
|
export declare const isSelectedAllCell: (editor: Editor, selectedCellPositions: CellPosition[]) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 获取选中的单元格位置数组
|
|
13
|
+
* @param editor 编辑器对象
|
|
14
|
+
* @param selectedCells 选中的单元格
|
|
15
|
+
* @returns 选中的单元格位置
|
|
16
|
+
*/
|
|
5
17
|
export declare const getSelectedCellPositions: (editor: Editor, selectedCells: TableCellElement[]) => {
|
|
6
18
|
row: number;
|
|
7
19
|
col: number;
|
|
8
20
|
}[];
|
|
21
|
+
/**
|
|
22
|
+
* 获取一定范围内所有的单元格位置
|
|
23
|
+
* @param startRow 起始行
|
|
24
|
+
* @param startCol 起始列
|
|
25
|
+
* @param endRow 结束行
|
|
26
|
+
* @param endCol 结束列
|
|
27
|
+
* @returns 单元格位置
|
|
28
|
+
*/
|
|
9
29
|
export declare const getCellPositionsFromRange: (startRow: number, startCol: number, endRow: number, endCol: number) => CellPosition[];
|
|
10
30
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
31
|
+
* 过滤重复的单元格位置
|
|
32
|
+
* @param cells 单元格数组
|
|
33
|
+
* @param selectedCellPositions 选中的单元格位置数组
|
|
34
|
+
* @returns 过滤后的单元格位置数组
|
|
13
35
|
*/
|
|
14
36
|
export declare const uniqueCellPosition: (cells: CellPosition[], selectedCellPositions: CellPosition[]) => CellPosition[];
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
2
|
import { TableElement } from '../../../custom-types';
|
|
3
3
|
import { CellPosition } from '../table.types';
|
|
4
|
-
export declare const getMinAndMaxCellIndex: (editor: Editor, selectedCellPositions: CellPosition[], maxRow: number, maxCol: number, minRow: number, minCol: number, table: TableElement) =>
|
|
4
|
+
export declare const getMinAndMaxCellIndex: (editor: Editor, selectedCellPositions: CellPosition[], maxRow: number, maxCol: number, minRow: number, minCol: number, table: TableElement) => {
|
|
5
|
+
minRow: number;
|
|
6
|
+
maxRow: number;
|
|
7
|
+
minCol: number;
|
|
8
|
+
maxCol: number;
|
|
9
|
+
};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
1
|
+
export * from './create-cell';
|
|
2
|
+
export * from './create-row';
|
|
3
|
+
export * from './create-table';
|
|
4
|
+
export * from './is-range-in-table';
|
|
5
|
+
export * from './is-selection-in-table';
|
|
6
|
+
export * from './table-position';
|
|
7
|
+
export * from './calc-span';
|
|
8
|
+
export * from './is-virtual-key';
|
|
9
|
+
export * from './get-grid-columns';
|
|
10
|
+
export * from './create-table-position';
|
|
11
|
+
export * from './cell-position';
|
|
12
|
+
export * from './calculate-table';
|
|
13
|
+
export * from './is-header-row';
|
|
14
|
+
export * from './table-position';
|
|
15
|
+
export * from './cell-position';
|
|
16
|
+
export * from './get-select-cell-node';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TheEditor } from '../../../interfaces';
|
|
2
|
+
import { TableStore } from '../table.store';
|
|
3
|
+
export declare function removeColumnOrRows(editor: TheEditor, tableStore: TableStore, options?: {
|
|
4
|
+
selectedRowsIndex?: number[];
|
|
5
|
+
selectedColumnsIndex?: number[];
|
|
6
|
+
}): void;
|
package/utils/index.d.ts
CHANGED