@worktile/theia 16.3.4 → 16.4.0-next.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/editor.module.d.ts +1 -1
- package/esm2022/components/element/element.component.mjs +3 -4
- package/esm2022/components/text/text.component.mjs +3 -4
- package/esm2022/editor.component.mjs +5 -1
- package/esm2022/editor.module.mjs +4 -4
- package/esm2022/plugins/code/code.component.mjs +21 -23
- package/esm2022/plugins/code/code.editor.mjs +7 -18
- package/esm2022/plugins/image/image.component.mjs +18 -17
- package/esm2022/plugins/image/image.editor.mjs +4 -19
- package/esm2022/plugins/image/image.plugin.mjs +3 -3
- package/esm2022/plugins/link/edit/link-edit.component.mjs +15 -4
- package/esm2022/plugins/link/link.component.mjs +7 -8
- package/esm2022/plugins/link/link.editor.mjs +4 -21
- package/esm2022/plugins/link/link.plugin.mjs +3 -3
- package/esm2022/plugins/public-api.mjs +1 -2
- package/esm2022/plugins/table/components/row/row.component.mjs +49 -28
- package/esm2022/plugins/table/components/table.component.mjs +231 -235
- package/esm2022/plugins/table/components/td/td.component.mjs +24 -34
- package/esm2022/plugins/table/components/toolbar/table-options.component.mjs +3 -4
- package/esm2022/plugins/table/table.editor.mjs +24 -24
- package/esm2022/plugins/table/table.pipe.mjs +32 -19
- package/esm2022/plugins/table/table.plugin.mjs +5 -5
- package/esm2022/plugins/table/table.service.mjs +2 -2
- package/esm2022/plugins/table/table.types.mjs +2 -1
- package/esm2022/plugins/table/utils/calculate-table.mjs +17 -10
- package/esm2022/plugins/table/utils/get-grid-columns.mjs +6 -49
- package/esm2022/plugins/table/utils/is-header-row.mjs +3 -2
- package/esm2022/plugins/table/utils/is-legal-table.mjs +11 -1
- package/esm2022/plugins/table/utils/remove-row-column.mjs +3 -4
- package/esm2022/plugins/table/utils/table-position.mjs +11 -1
- package/esm2022/queries/index.mjs +3 -2
- package/esm2022/queries/is-root-path.mjs +2 -0
- package/esm2022/services/context.service.mjs +10 -6
- package/esm2022/transforms/index.mjs +2 -4
- package/fesm2022/worktile-theia.mjs +513 -542
- package/fesm2022/worktile-theia.mjs.map +1 -1
- package/interfaces/editor.d.ts +1 -1
- package/package.json +1 -1
- package/plugins/code/code.component.d.ts +2 -3
- package/plugins/code/code.editor.d.ts +3 -2
- package/plugins/image/image.component.d.ts +6 -4
- package/plugins/image/image.editor.d.ts +7 -4
- package/plugins/link/edit/link-edit.component.d.ts +2 -3
- package/plugins/link/link.component.d.ts +2 -3
- package/plugins/link/link.editor.d.ts +1 -3
- package/plugins/public-api.d.ts +0 -1
- package/plugins/table/components/row/row.component.d.ts +10 -5
- package/plugins/table/components/table.component.d.ts +19 -13
- package/plugins/table/components/table.component.scss +28 -21
- package/plugins/table/components/td/td.component.d.ts +4 -9
- package/plugins/table/table.editor.d.ts +7 -7
- package/plugins/table/table.pipe.d.ts +7 -2
- package/plugins/table/table.types.d.ts +1 -0
- package/plugins/table/utils/calculate-table.d.ts +1 -0
- package/plugins/table/utils/get-grid-columns.d.ts +1 -20
- package/plugins/table/utils/is-header-row.d.ts +1 -1
- package/plugins/table/utils/is-legal-table.d.ts +2 -0
- package/plugins/table/utils/table-position.d.ts +3 -1
- package/queries/index.d.ts +2 -1
- package/queries/is-range-across-blocks.d.ts +1 -1
- package/queries/is-root-path.d.ts +2 -0
- package/transforms/index.d.ts +1 -3
- package/esm2022/transforms/delete-node-by-type.mjs +0 -10
- package/esm2022/transforms/set-node-by-type.mjs +0 -10
- package/transforms/delete-node-by-type.d.ts +0 -3
- package/transforms/set-node-by-type.d.ts +0 -3
package/interfaces/editor.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare const TheEditor: {
|
|
|
53
53
|
findEventRange(editor: AngularEditor, event: any): import("slate").BaseRange;
|
|
54
54
|
isLeafInEditor(editor: AngularEditor, leafNode: globalThis.Element): boolean;
|
|
55
55
|
toSlatePoint(editor: AngularEditor, domPoint: import("slate-angular").DOMPoint): import("slate").BasePoint;
|
|
56
|
-
toSlateRange(editor: AngularEditor, domRange: globalThis.Range | StaticRange
|
|
56
|
+
toSlateRange(editor: AngularEditor, domRange: Selection | globalThis.Range | StaticRange): import("slate").BaseRange;
|
|
57
57
|
isLeafBlock(editor: AngularEditor, node: Node): boolean;
|
|
58
58
|
isBlockCardLeftCursor(editor: AngularEditor): boolean;
|
|
59
59
|
isBlockCardRightCursor(editor: AngularEditor): boolean;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Overlay } from '@angular/cdk/overlay';
|
|
2
|
-
import { AfterViewInit, ChangeDetectorRef, ElementRef, NgZone, OnDestroy, OnInit, TemplateRef
|
|
2
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, NgZone, OnDestroy, OnInit, TemplateRef } from '@angular/core';
|
|
3
3
|
import { CodeMirrorComponent } from 'ng-codemirror';
|
|
4
4
|
import { ThyNotifyService } from 'ngx-tethys/notify';
|
|
5
5
|
import { ThyPopover, ThyPopoverRef } from 'ngx-tethys/popover';
|
|
@@ -19,7 +19,6 @@ export declare class TheCodeComponent extends TheBaseElementComponent<CodeElemen
|
|
|
19
19
|
private contextService;
|
|
20
20
|
private ngZone;
|
|
21
21
|
private thyPopover;
|
|
22
|
-
private viewContainerRef;
|
|
23
22
|
private overlay;
|
|
24
23
|
startRenderCodemirror: boolean;
|
|
25
24
|
dropdownMode: typeof DropdownMode;
|
|
@@ -48,7 +47,7 @@ export declare class TheCodeComponent extends TheBaseElementComponent<CodeElemen
|
|
|
48
47
|
toolbarDropdownComponent: TheToolbarDropdownComponent;
|
|
49
48
|
get code(): string;
|
|
50
49
|
get isToolbarOpen(): boolean;
|
|
51
|
-
constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, thyNotifyService: ThyNotifyService, contextService: TheContextService, ngZone: NgZone, thyPopover: ThyPopover,
|
|
50
|
+
constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, thyNotifyService: ThyNotifyService, contextService: TheContextService, ngZone: NgZone, thyPopover: ThyPopover, overlay: Overlay);
|
|
52
51
|
onContextChange(): void;
|
|
53
52
|
ngOnInit(): void;
|
|
54
53
|
ngAfterViewInit(): void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
2
|
import { CodeElement } from '../../custom-types';
|
|
3
3
|
export declare const CodeEditor: {
|
|
4
|
-
setCodeAttribute(editor: Editor,
|
|
4
|
+
setCodeAttribute(editor: Editor, element: CodeElement, value: {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}): void;
|
|
5
7
|
insertCode(editor: Editor): void;
|
|
6
|
-
removeCode(editor: Editor, code?: CodeElement): void;
|
|
7
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Overlay } from '@angular/cdk/overlay';
|
|
2
|
-
import { AfterViewInit, ChangeDetectorRef, ElementRef, OnDestroy, OnInit, TemplateRef
|
|
2
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, OnDestroy, OnInit, TemplateRef } from '@angular/core';
|
|
3
3
|
import { ThyImageDirective, ThyImageGroupComponent } from 'ngx-tethys/image';
|
|
4
4
|
import { ThyPopover } from 'ngx-tethys/popover';
|
|
5
5
|
import { Editor } from 'slate';
|
|
@@ -17,7 +17,6 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
|
|
|
17
17
|
private theContextService;
|
|
18
18
|
private thyPopover;
|
|
19
19
|
private overlay;
|
|
20
|
-
private viewContainerRef;
|
|
21
20
|
imageGroupComponent: ThyImageGroupComponent;
|
|
22
21
|
naturalWidth: number;
|
|
23
22
|
naturalHeight: number;
|
|
@@ -44,7 +43,7 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
|
|
|
44
43
|
img: ElementRef;
|
|
45
44
|
layoutToolbar: TemplateRef<any>;
|
|
46
45
|
imageDirective: ThyImageDirective;
|
|
47
|
-
constructor(elementRef: ElementRef, imageUploaderService: TheImageUploaderService, cdr: ChangeDetectorRef, theContextService: TheContextService, thyPopover: ThyPopover, overlay: Overlay,
|
|
46
|
+
constructor(elementRef: ElementRef, imageUploaderService: TheImageUploaderService, cdr: ChangeDetectorRef, theContextService: TheContextService, thyPopover: ThyPopover, overlay: Overlay, imageGroupComponent: ThyImageGroupComponent);
|
|
48
47
|
beforeContextChange: (value: SlateElementContext<ImageElement>) => void;
|
|
49
48
|
ngOnInit(): void;
|
|
50
49
|
imageClick(): void;
|
|
@@ -69,7 +68,10 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
|
|
|
69
68
|
openLayoutToolbar(): void;
|
|
70
69
|
closeLayoutToolbar(): void;
|
|
71
70
|
layoutActive(key: Alignment | LayoutTypes): boolean;
|
|
72
|
-
setImageNode(e: MouseEvent,
|
|
71
|
+
setImageNode(e: MouseEvent, partial: {
|
|
72
|
+
layout?: LayoutTypes;
|
|
73
|
+
align?: Alignment;
|
|
74
|
+
}): void;
|
|
73
75
|
setBlockCardLayoutAttr(): void;
|
|
74
76
|
onDelete(event: MouseEvent): void;
|
|
75
77
|
createPositionStrategy(): import("@angular/cdk/overlay").FlexibleConnectedPositionStrategy;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
1
|
+
import { Editor, Path } from 'slate';
|
|
2
|
+
import { Alignment, LayoutTypes } from '../../constants';
|
|
2
3
|
import { ImageElement } from '../../custom-types';
|
|
3
4
|
export declare const ImageEditor: {
|
|
4
5
|
openUpload(editor: Editor): void;
|
|
5
6
|
insertImages(editor: Editor, imageFiles: FileList | File[]): void;
|
|
6
7
|
handleBase64ImageElement(editor: Editor, image: ImageElement): void;
|
|
7
8
|
verifyImage(editor: Editor, image: File): boolean;
|
|
8
|
-
|
|
9
|
-
setImageNode(editor: Editor,
|
|
9
|
+
isImageActive(editor: Editor): boolean;
|
|
10
|
+
setImageNode(editor: Editor, path: Path, partial: {
|
|
11
|
+
layout?: LayoutTypes;
|
|
12
|
+
align?: Alignment;
|
|
13
|
+
}): void;
|
|
10
14
|
isBase64(url: string): boolean;
|
|
11
15
|
/**
|
|
12
16
|
* 设置图片来源
|
|
@@ -14,5 +18,4 @@ export declare const ImageEditor: {
|
|
|
14
18
|
* @param image 图片节点
|
|
15
19
|
*/
|
|
16
20
|
setImageSource(editor: Editor, image: ImageElement): void;
|
|
17
|
-
removeImage(editor: Editor, image?: ImageElement): void;
|
|
18
21
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { ThyPopoverRef } from 'ngx-tethys/popover';
|
|
3
|
-
import { Range, Editor } from 'slate';
|
|
3
|
+
import { Range, Node, Editor } from 'slate';
|
|
4
4
|
import { LinkTags } from '../link.types';
|
|
5
|
-
import { LinkElement } from '../../../custom-types';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
7
6
|
export declare class TheLinkEditComponent implements OnInit {
|
|
8
7
|
thyPopoverRef: ThyPopoverRef<any>;
|
|
9
8
|
className: string;
|
|
10
9
|
tag: LinkTags;
|
|
11
|
-
node:
|
|
10
|
+
node: Node;
|
|
12
11
|
link: string;
|
|
13
12
|
text: string;
|
|
14
13
|
originSelection: Range;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Overlay } from '@angular/cdk/overlay';
|
|
2
|
-
import { OnInit, ElementRef, OnDestroy, ChangeDetectorRef
|
|
2
|
+
import { OnInit, ElementRef, OnDestroy, ChangeDetectorRef } from '@angular/core';
|
|
3
3
|
import { ThyPopover, ThyPopoverRef } from 'ngx-tethys/popover';
|
|
4
4
|
import { Editor } from 'slate';
|
|
5
5
|
import { LinkElement } from '../../custom-types';
|
|
@@ -12,12 +12,11 @@ export declare class TheBaseLinkComponent extends TheBaseElementComponent<LinkEl
|
|
|
12
12
|
cdr: ChangeDetectorRef;
|
|
13
13
|
private thyPopover;
|
|
14
14
|
private overlay;
|
|
15
|
-
private viewContainerRef;
|
|
16
15
|
thyPopoverHoverRef: ThyPopoverRef<any>;
|
|
17
16
|
thyPopoverEditRef: ThyPopoverRef<any>;
|
|
18
17
|
get linkHoverOpened(): boolean;
|
|
19
18
|
get linkEditOpened(): boolean;
|
|
20
|
-
constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, thyPopover: ThyPopover, overlay: Overlay
|
|
19
|
+
constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, thyPopover: ThyPopover, overlay: Overlay);
|
|
21
20
|
ngOnInit(): void;
|
|
22
21
|
closeHoverPopover(): void;
|
|
23
22
|
beforeContextChange: (value: SlateElementContext) => void;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
import { LinkElement } from '../../custom-types';
|
|
3
2
|
export declare const LinkEditor: {
|
|
4
3
|
insertLink(editor: Editor): void;
|
|
5
|
-
|
|
4
|
+
isLinkActive(editor: Editor): boolean;
|
|
6
5
|
wrapLink(editor: Editor, text: string, url: string): void;
|
|
7
6
|
unwrapLink(editor: Editor): void;
|
|
8
|
-
updateLink(editor: Editor, element: LinkElement, url: string, text: string): void;
|
|
9
7
|
};
|
package/plugins/public-api.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export * from './mark/mark.editor';
|
|
|
12
12
|
export * from './mention/index';
|
|
13
13
|
export * from './quick-insert/quick-insert.editor';
|
|
14
14
|
export * from './table/table.editor';
|
|
15
|
-
export * from './table/utils';
|
|
16
15
|
export * from './todo-item/todo-item.editor';
|
|
17
16
|
export * from './vertical-align/vertical-align.editor';
|
|
18
17
|
export * from './inline-code/inline-code.editor';
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import { ChangeDetectorRef, ElementRef, OnInit, Renderer2 } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, OnInit, Renderer2 } from '@angular/core';
|
|
2
2
|
import { TableRowElement } from '../../../../custom-types';
|
|
3
3
|
import { TheBaseElementComponent } from '../../../../interfaces/view-base';
|
|
4
|
-
import {
|
|
4
|
+
import { AfterContextChange } from 'slate-angular';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class TheTableRowComponent extends TheBaseElementComponent<TableRowElement> implements OnInit {
|
|
6
|
+
export declare class TheTableRowComponent extends TheBaseElementComponent<TableRowElement> implements OnInit, AfterViewInit, AfterContextChange {
|
|
7
7
|
elementRef: ElementRef<HTMLElement>;
|
|
8
8
|
cdr: ChangeDetectorRef;
|
|
9
9
|
private renderer;
|
|
10
10
|
height: string;
|
|
11
11
|
numberedColumn: boolean;
|
|
12
12
|
rowNumber: number | string;
|
|
13
|
+
numberedColumnRef: ElementRef<HTMLElement>;
|
|
13
14
|
constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, renderer: Renderer2);
|
|
14
15
|
onContextChange(): void;
|
|
16
|
+
afterContextChange(): void;
|
|
15
17
|
ngOnInit(): void;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
ngAfterViewInit(): void;
|
|
19
|
+
setHeight(): void;
|
|
20
|
+
setStickyRowClass(rowIndex: number): void;
|
|
21
|
+
setNumberColumn(rowIndex: number): void;
|
|
22
|
+
updateNumberedColumnPosition(): void;
|
|
18
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<TheTableRowComponent, never>;
|
|
19
24
|
static ɵcmp: i0.ɵɵComponentDeclaration<TheTableRowComponent, "tr[theTableRow]", never, {}, {}, never, never, false, never>;
|
|
20
25
|
}
|
|
@@ -24,7 +24,6 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
|
|
|
24
24
|
private renderer;
|
|
25
25
|
private contextService;
|
|
26
26
|
private config;
|
|
27
|
-
headerRow: boolean;
|
|
28
27
|
isSelectedAllCell: boolean;
|
|
29
28
|
destroy$: Subject<void>;
|
|
30
29
|
rowControls: {
|
|
@@ -35,15 +34,18 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
|
|
|
35
34
|
isInTable: boolean;
|
|
36
35
|
tablePluginOptions: ThePluginOption<ThePluginTableOption>;
|
|
37
36
|
isStickyTop: boolean;
|
|
38
|
-
|
|
37
|
+
isScrolledXOfScrollContainer: boolean;
|
|
39
38
|
scrollContainerTop: number;
|
|
40
|
-
tableRectLeft: number;
|
|
41
39
|
isRightShadow: boolean;
|
|
42
40
|
isLeftShadow: boolean;
|
|
43
41
|
previousScrollContainer: string;
|
|
44
42
|
columns: TheTableColumn[];
|
|
45
43
|
isMobileMode: boolean;
|
|
46
44
|
selectedCells: TableCellElement[];
|
|
45
|
+
tableWrapperWidth: number;
|
|
46
|
+
tableWrapperLeft: number;
|
|
47
|
+
isFreezeRow: boolean;
|
|
48
|
+
isFreezeColumn: boolean;
|
|
47
49
|
get nativeElement(): HTMLElement;
|
|
48
50
|
get tbodyNativeElement(): HTMLElement;
|
|
49
51
|
tableWrapper: ElementRef<HTMLElement>;
|
|
@@ -58,31 +60,34 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
|
|
|
58
60
|
colgroup: ElementRef<HTMLElement>;
|
|
59
61
|
rowControlsButtonWrapper: QueryList<ElementRef<HTMLElement>>;
|
|
60
62
|
handleMousedown(event: MouseEvent): void;
|
|
63
|
+
getOutletElement: () => any;
|
|
61
64
|
onContextChange(): void;
|
|
62
65
|
constructor(elementRef: ElementRef<HTMLElement>, eventDispatcher: TableCellEventDispatcher, resizeNotifier: ColumnResizeNotifierSource, tableStore: TableStore, cdr: ChangeDetectorRef, ngZone: NgZone, tableService: TableService, theTableContextMenuService: TheTableContextMenuService, freezeColumnPipe: TableFreezeColumnPipe, freezeRowPipe: TableFreezeRowPipe, renderer: Renderer2, contextService: TheContextService, config: TheModeConfig);
|
|
63
66
|
ngOnInit(): void;
|
|
64
|
-
|
|
67
|
+
getWrapperWidthAndLeft(): void;
|
|
65
68
|
ngAfterViewInit(): void;
|
|
66
|
-
getColumnGroups(): void;
|
|
67
69
|
setHeaderRowShadow(): void;
|
|
68
70
|
calcHeaderRowShadow(): {
|
|
69
|
-
height:
|
|
71
|
+
height: number;
|
|
70
72
|
top: number;
|
|
71
73
|
};
|
|
72
|
-
subscribeScrollContainerScroll(): void;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
subscribeScrollContainerScroll(tableWrapperLeft: number): void;
|
|
75
|
+
applyHeaderCellClass(isHeaderCell: boolean, cell: TableCellElement, className: string): void;
|
|
76
|
+
setTableHeaderStyle(): void;
|
|
77
|
+
setHeaderCellClass(): void;
|
|
78
|
+
setHeaderColumnStickyCellClass(): void;
|
|
76
79
|
setHeaderRowStyle(): void;
|
|
77
80
|
setGridColumnsStyle(): void;
|
|
78
81
|
setStickyRowStyle(): void;
|
|
79
82
|
setRowControlButtonStyle(rowControlButton: HTMLElement): void;
|
|
80
|
-
|
|
83
|
+
setTableScrollingShadow(): void;
|
|
84
|
+
setTableLeftShadow(scrollLeft?: number): void;
|
|
85
|
+
setTableRightShadow(scrollLeft?: number): void;
|
|
81
86
|
subscribeCellPositionChange(): void;
|
|
82
87
|
subscribeCellsChange(): void;
|
|
83
88
|
useRowControls(): void;
|
|
84
89
|
detectChanges(): void;
|
|
85
|
-
resolveImage(): Promise<
|
|
90
|
+
resolveImage(): Promise<boolean> | Promise<any[]>;
|
|
86
91
|
getColControls(): void;
|
|
87
92
|
getIsInTable(): void;
|
|
88
93
|
getDefaultCellWidth(): number[];
|
|
@@ -98,9 +103,10 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
|
|
|
98
103
|
listenKeydownEvent(): void;
|
|
99
104
|
listenKeyupEvent(): void;
|
|
100
105
|
private listenSelectstartEvent;
|
|
106
|
+
setStickyRowPointerEvents(pointerEventsStyle: string): void;
|
|
101
107
|
listenTableWrapperScroll(): void;
|
|
102
108
|
updateStickyRowScrollLeft(): void;
|
|
103
|
-
|
|
109
|
+
setStickyElementLeftStyle(): void;
|
|
104
110
|
getColControlButtonWidth: () => number;
|
|
105
111
|
trackByFnRowControls(index: number): number;
|
|
106
112
|
trackByFnColControls(index: number): number;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
$expand-size: 12px;
|
|
7
7
|
$controls-border: 1px solid variables.$gray-300;
|
|
8
8
|
$table-scroll-wrap-padding-top: 31px;
|
|
9
|
-
$dot-
|
|
9
|
+
$dot-z-index: 20;
|
|
10
10
|
$dot-size: 19px;
|
|
11
11
|
$dot-padding-top: 5px;
|
|
12
12
|
$dot-shadow-top: math.div($dot-size - 1, 2);
|
|
@@ -16,6 +16,10 @@ $control-corner-width: 12px;
|
|
|
16
16
|
$header-cell-bg-color: #f3f3f3;
|
|
17
17
|
$top-cell-z-index: 13;
|
|
18
18
|
|
|
19
|
+
.slate-block-card-table {
|
|
20
|
+
z-index: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
.slate-element-table {
|
|
20
24
|
display: block;
|
|
21
25
|
width: calc(100% - 2px);
|
|
@@ -95,6 +99,10 @@ $top-cell-z-index: 13;
|
|
|
95
99
|
border: 1px solid variables.$danger;
|
|
96
100
|
}
|
|
97
101
|
}
|
|
102
|
+
|
|
103
|
+
&.slate-element-table-cell {
|
|
104
|
+
margin: 0;
|
|
105
|
+
}
|
|
98
106
|
}
|
|
99
107
|
|
|
100
108
|
.focused-cell,
|
|
@@ -103,7 +111,6 @@ $top-cell-z-index: 13;
|
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
.the-header-cell {
|
|
106
|
-
margin-bottom: 0;
|
|
107
114
|
background: $header-cell-bg-color;
|
|
108
115
|
}
|
|
109
116
|
|
|
@@ -131,7 +138,6 @@ $top-cell-z-index: 13;
|
|
|
131
138
|
margin: 0 auto 16px;
|
|
132
139
|
.the-table-wrapper {
|
|
133
140
|
position: relative;
|
|
134
|
-
z-index: 0;
|
|
135
141
|
margin-top: -10px;
|
|
136
142
|
padding-top: 10px;
|
|
137
143
|
overflow: auto;
|
|
@@ -219,8 +225,8 @@ $top-cell-z-index: 13;
|
|
|
219
225
|
top: 1px;
|
|
220
226
|
left: 1px;
|
|
221
227
|
}
|
|
222
|
-
.the-
|
|
223
|
-
.the-table-row-
|
|
228
|
+
.the-table-corner-controls,
|
|
229
|
+
.the-table-row-control-button-wrap {
|
|
224
230
|
width: 44px;
|
|
225
231
|
}
|
|
226
232
|
}
|
|
@@ -233,7 +239,7 @@ $top-cell-z-index: 13;
|
|
|
233
239
|
}
|
|
234
240
|
}
|
|
235
241
|
}
|
|
236
|
-
.the-table-row-
|
|
242
|
+
.the-table-row-control-button-wrap {
|
|
237
243
|
&:first-child {
|
|
238
244
|
width: 74px; // width + insert-mask: 55px + 19px
|
|
239
245
|
}
|
|
@@ -241,7 +247,7 @@ $top-cell-z-index: 13;
|
|
|
241
247
|
}
|
|
242
248
|
|
|
243
249
|
.the-table-row-controls-inner {
|
|
244
|
-
.the-table-row-
|
|
250
|
+
.the-table-row-control-button-wrap {
|
|
245
251
|
&:first-child {
|
|
246
252
|
position: fixed;
|
|
247
253
|
z-index: $top-cell-z-index;
|
|
@@ -250,11 +256,11 @@ $top-cell-z-index: 13;
|
|
|
250
256
|
}
|
|
251
257
|
}
|
|
252
258
|
}
|
|
253
|
-
.the-
|
|
259
|
+
.the-table-corner-controls {
|
|
254
260
|
position: fixed;
|
|
255
|
-
z-index: 12;
|
|
256
261
|
width: 11px;
|
|
257
262
|
height: 11px;
|
|
263
|
+
z-index: $top-cell-z-index;
|
|
258
264
|
.the-table-corner-button {
|
|
259
265
|
height: 11px;
|
|
260
266
|
}
|
|
@@ -273,7 +279,7 @@ $top-cell-z-index: 13;
|
|
|
273
279
|
}
|
|
274
280
|
.the-table-row-controls-inner {
|
|
275
281
|
z-index: 4;
|
|
276
|
-
.the-table-row-
|
|
282
|
+
.the-table-row-control-button-wrap {
|
|
277
283
|
&:first-child {
|
|
278
284
|
padding-left: 19px; // insert-mask width: 19px
|
|
279
285
|
margin-left: -19px;
|
|
@@ -310,7 +316,7 @@ $top-cell-z-index: 13;
|
|
|
310
316
|
.the-table-controls-insert-wrapper {
|
|
311
317
|
display: block;
|
|
312
318
|
}
|
|
313
|
-
.the-
|
|
319
|
+
.the-table-corner-controls {
|
|
314
320
|
.the-table-corner-button {
|
|
315
321
|
position: unset;
|
|
316
322
|
}
|
|
@@ -323,7 +329,7 @@ $top-cell-z-index: 13;
|
|
|
323
329
|
}
|
|
324
330
|
}
|
|
325
331
|
|
|
326
|
-
.the-table-col-controls-wrapper .the-table-col-
|
|
332
|
+
.the-table-col-controls-wrapper .the-table-col-control {
|
|
327
333
|
background: variables.$gray-100;
|
|
328
334
|
background-clip: padding-box;
|
|
329
335
|
border-top: $controls-border;
|
|
@@ -469,7 +475,7 @@ $top-cell-z-index: 13;
|
|
|
469
475
|
padding-top: 0;
|
|
470
476
|
}
|
|
471
477
|
.the-table-row-controls-inner {
|
|
472
|
-
.the-table-row-
|
|
478
|
+
.the-table-row-control-button-wrap {
|
|
473
479
|
&:first-child {
|
|
474
480
|
margin-top: 36px;
|
|
475
481
|
}
|
|
@@ -479,8 +485,8 @@ $top-cell-z-index: 13;
|
|
|
479
485
|
.the-table-row-controls {
|
|
480
486
|
left: 0;
|
|
481
487
|
}
|
|
482
|
-
.the-
|
|
483
|
-
.the-table-row-
|
|
488
|
+
.the-table-corner-controls,
|
|
489
|
+
.the-table-row-control-button-wrap {
|
|
484
490
|
width: 55px;
|
|
485
491
|
}
|
|
486
492
|
}
|
|
@@ -488,7 +494,7 @@ $top-cell-z-index: 13;
|
|
|
488
494
|
display: grid;
|
|
489
495
|
}
|
|
490
496
|
.the-table-col-controls-wrapper.the-sticky-row,
|
|
491
|
-
.the-
|
|
497
|
+
.the-table-corner-controls {
|
|
492
498
|
padding-top: 25px;
|
|
493
499
|
background: variables.$white;
|
|
494
500
|
border: none;
|
|
@@ -502,6 +508,7 @@ $top-cell-z-index: 13;
|
|
|
502
508
|
width: 100%;
|
|
503
509
|
height: $control-corner-width;
|
|
504
510
|
visibility: hidden;
|
|
511
|
+
z-index: 11;
|
|
505
512
|
|
|
506
513
|
.the-table-corner-button {
|
|
507
514
|
position: absolute;
|
|
@@ -597,7 +604,7 @@ $top-cell-z-index: 13;
|
|
|
597
604
|
|
|
598
605
|
.the-table-controls-insert-line {
|
|
599
606
|
position: absolute;
|
|
600
|
-
z-index: $dot-
|
|
607
|
+
z-index: $dot-z-index;
|
|
601
608
|
background-color: variables.$primary;
|
|
602
609
|
|
|
603
610
|
&[data-dot-type='column'] {
|
|
@@ -616,17 +623,17 @@ $top-cell-z-index: 13;
|
|
|
616
623
|
|
|
617
624
|
.the-table-row-controls {
|
|
618
625
|
position: relative;
|
|
619
|
-
z-index: 11;
|
|
620
626
|
display: none;
|
|
621
627
|
box-sizing: border-box;
|
|
622
628
|
width: $control-width;
|
|
629
|
+
z-index: 11;
|
|
623
630
|
|
|
624
631
|
.the-table-row-controls-inner {
|
|
625
632
|
display: flex;
|
|
626
633
|
flex-direction: column;
|
|
627
634
|
}
|
|
628
635
|
|
|
629
|
-
.the-table-row-
|
|
636
|
+
.the-table-row-control-button-wrap {
|
|
630
637
|
position: relative;
|
|
631
638
|
margin-top: -1px;
|
|
632
639
|
|
|
@@ -674,7 +681,7 @@ $top-cell-z-index: 13;
|
|
|
674
681
|
height: $control-width;
|
|
675
682
|
line-height: $control-width;
|
|
676
683
|
|
|
677
|
-
.the-table-col-
|
|
684
|
+
.the-table-col-control {
|
|
678
685
|
position: relative;
|
|
679
686
|
margin: 0;
|
|
680
687
|
padding: 0;
|
|
@@ -725,7 +732,7 @@ $top-cell-z-index: 13;
|
|
|
725
732
|
|
|
726
733
|
.the-editor-readonly {
|
|
727
734
|
.the-table-row-controls,
|
|
728
|
-
.the-table-col-
|
|
735
|
+
.the-table-col-control {
|
|
729
736
|
cursor: default;
|
|
730
737
|
}
|
|
731
738
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConnectedPosition, Overlay, OverlayRef, ScrollDispatcher } from '@angular/cdk/overlay';
|
|
2
|
-
import { AfterViewInit, ChangeDetectorRef, ElementRef, Injector, NgZone, OnDestroy, OnInit, Renderer2
|
|
2
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, Injector, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import { Editor } from 'slate';
|
|
5
5
|
import { ColumnResizeNotifierSource } from '../../../../components/column-resize/column-resize-notifier';
|
|
@@ -8,9 +8,7 @@ import { ResizeRef } from '../../../../components/column-resize/resize-ref';
|
|
|
8
8
|
import { ColumnResizingStore } from '../../../../components/column-resize/resizing.store';
|
|
9
9
|
import { TableCellElement } from '../../../../custom-types';
|
|
10
10
|
import { TheBaseElementComponent } from '../../../../interfaces/view-base';
|
|
11
|
-
import { TableFreezeColumnPipe } from '../../table.pipe';
|
|
12
11
|
import { TableOptions } from '../../table.types';
|
|
13
|
-
import { TablePosition } from '../../utils';
|
|
14
12
|
import { TheTableComponent } from '../table.component';
|
|
15
13
|
import * as i0 from "@angular/core";
|
|
16
14
|
export declare const POSITION_MAP: {
|
|
@@ -20,20 +18,18 @@ export declare class TheTdComponent extends TheBaseElementComponent<TableCellEle
|
|
|
20
18
|
elementRef: ElementRef;
|
|
21
19
|
cdr: ChangeDetectorRef;
|
|
22
20
|
private renderer;
|
|
23
|
-
private viewContainerRef;
|
|
24
21
|
private ngZone;
|
|
25
22
|
injector: Injector;
|
|
26
23
|
overlay: Overlay;
|
|
27
24
|
resizingStore: ColumnResizingStore;
|
|
28
25
|
scrollDispatcher: ScrollDispatcher;
|
|
29
|
-
freezeColumnPipe: TableFreezeColumnPipe;
|
|
30
26
|
destroy$: Subject<void>;
|
|
31
|
-
tablePosition: TablePosition;
|
|
32
27
|
tableComponent: TheTableComponent;
|
|
33
28
|
protected overlayRef?: OverlayRef;
|
|
34
29
|
hoveredDirection: Position | null;
|
|
35
30
|
tableOptions: TableOptions;
|
|
36
31
|
cellInnerMinHeight: number;
|
|
32
|
+
cellInner: ElementRef;
|
|
37
33
|
get tableStore(): import("../../table.store").TableStore;
|
|
38
34
|
get tableService(): import("../../table.service").TableService;
|
|
39
35
|
get eventDispatcher(): TableCellEventDispatcher;
|
|
@@ -52,15 +48,14 @@ export declare class TheTdComponent extends TheBaseElementComponent<TableCellEle
|
|
|
52
48
|
rowspan: number;
|
|
53
49
|
display: string;
|
|
54
50
|
onContextChange(): void;
|
|
55
|
-
|
|
51
|
+
getOutletElement: () => any;
|
|
52
|
+
constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, renderer: Renderer2, ngZone: NgZone, injector: Injector, overlay: Overlay, resizingStore: ColumnResizingStore, scrollDispatcher: ScrollDispatcher);
|
|
56
53
|
ngOnInit(): void;
|
|
57
54
|
ngAfterViewInit(): void;
|
|
58
55
|
getInjectionService(): void;
|
|
59
56
|
subscribeSelectedCellsChange(): void;
|
|
60
57
|
subscribeDangerousCellsChange(): void;
|
|
61
|
-
subscribeTableChange(): void;
|
|
62
58
|
useState(): void;
|
|
63
|
-
useTablePosition(): void;
|
|
64
59
|
useBackground(): void;
|
|
65
60
|
useSpan(): void;
|
|
66
61
|
useDisplay(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor, NodeEntry, Path, Range, Location } from 'slate';
|
|
2
|
-
import { TableOptions, TheTableOptions } from './table.types';
|
|
2
|
+
import { CellPosition, TableOptions, TheTableOptions } from './table.types';
|
|
3
3
|
import { Alignment, Indents, MarkTypes, VerticalAlignment } from '../../constants';
|
|
4
4
|
import { TheEditor } from '../../interfaces';
|
|
5
5
|
import { CustomElement, TableCellElement, TableElement } from '../../custom-types';
|
|
@@ -11,17 +11,17 @@ export declare const TableEditor: {
|
|
|
11
11
|
removeRow(editor: Editor, rowIndex?: number, optionsParam?: TableOptions): void;
|
|
12
12
|
removeColumn(editor: Editor, colIndex?: number, optionsParam?: TableOptions): void;
|
|
13
13
|
clearCell(editor: Editor, nodeEntry?: NodeEntry<CustomElement>, optionsParam?: TableOptions): void;
|
|
14
|
-
setCellsBackgroundColor(editor: Editor, color: string,
|
|
14
|
+
setCellsBackgroundColor(editor: Editor, color: string, selectCells?: TableCellElement[]): void;
|
|
15
15
|
mergeCell(editor: Editor): void;
|
|
16
16
|
splitCell(editor: Editor): void;
|
|
17
17
|
setTableOptions(editor: Editor, newOptions: TheTableOptions): void;
|
|
18
18
|
setEquallyColumn(editor: Editor): void;
|
|
19
|
-
clearCellsContent(editor: Editor,
|
|
19
|
+
clearCellsContent(editor: Editor, selectCells?: CellPosition[]): void;
|
|
20
20
|
isActive(editor: Editor): boolean;
|
|
21
|
-
getSelectedCellPositions(editor: Editor):
|
|
21
|
+
getSelectedCellPositions(editor: Editor): CellPosition[];
|
|
22
22
|
getSelectedCells(editor: Editor): TableCellElement[];
|
|
23
|
-
setAlign(editor: Editor, alignment: Alignment
|
|
24
|
-
setVerticalAlign(editor: TheEditor, alignment: VerticalAlignment
|
|
23
|
+
setAlign(editor: Editor, alignment: Alignment): boolean;
|
|
24
|
+
setVerticalAlign(editor: TheEditor, alignment: VerticalAlignment): boolean;
|
|
25
25
|
isVerticalAlignActive(editor: TheEditor, alignment: VerticalAlignment): boolean;
|
|
26
26
|
toggleMark(editor: TheEditor, isActive: boolean, format: string | string[], value?: string | number | boolean): boolean;
|
|
27
27
|
clearMark(editor: TheEditor): boolean;
|
|
@@ -34,7 +34,7 @@ export declare const TableEditor: {
|
|
|
34
34
|
"background-color"?: any;
|
|
35
35
|
"font-size"?: any;
|
|
36
36
|
}): boolean;
|
|
37
|
-
handleSelectedCells(editor: TheEditor, handle: (cellPath: Path, cellRange: Range) => void
|
|
37
|
+
handleSelectedCells(editor: TheEditor, handle: (cellPath: Path, cellRange: Range) => void): boolean;
|
|
38
38
|
hasHeaderRow(editor: TheEditor, location?: Location): boolean;
|
|
39
39
|
hasHeaderColumn(editor: TheEditor, location?: Location): boolean;
|
|
40
40
|
isActiveHeader(editor: TheEditor, location?: Location): boolean;
|
|
@@ -3,12 +3,17 @@ import { ThePluginTableOption } from './table.types';
|
|
|
3
3
|
import { TableElement } from '../../custom-types';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class TableFreezeColumnPipe implements PipeTransform {
|
|
6
|
-
transform(table: TableElement, tablePluginOptions: ThePluginTableOption): boolean;
|
|
6
|
+
transform(table: TableElement, tablePluginOptions: ThePluginTableOption, tableWrapperWidth: number): boolean;
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableFreezeColumnPipe, never>;
|
|
8
8
|
static ɵpipe: i0.ɵɵPipeDeclaration<TableFreezeColumnPipe, "freezeColumn", false>;
|
|
9
9
|
}
|
|
10
10
|
export declare class TableFreezeRowPipe implements PipeTransform {
|
|
11
|
-
transform(table: TableElement,
|
|
11
|
+
transform(table: TableElement, tablePluginOptions: ThePluginTableOption): boolean;
|
|
12
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableFreezeRowPipe, never>;
|
|
13
13
|
static ɵpipe: i0.ɵɵPipeDeclaration<TableFreezeRowPipe, "freezeRow", false>;
|
|
14
14
|
}
|
|
15
|
+
export declare class TableHasHeaderRowPipe implements PipeTransform {
|
|
16
|
+
transform(table: TableElement): boolean;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableHasHeaderRowPipe, never>;
|
|
18
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TableHasHeaderRowPipe, "hasHeaderRow", false>;
|
|
19
|
+
}
|
|
@@ -8,6 +8,7 @@ import type { TheTableComponent } from './components/table.component';
|
|
|
8
8
|
import { TableCellElement, TableElement } from '../../custom-types';
|
|
9
9
|
export declare const THE_TABLE_COMPONENT_TOKEN: InjectionToken<ComponentType<TheTableComponent>>;
|
|
10
10
|
export declare const HEADER_CELL_CLASS = "the-header-cell";
|
|
11
|
+
export declare const STICKY_CELL_CLASS = "the-sticky-cell";
|
|
11
12
|
export declare const TOP_CELL_CLASS = "the-top-cell";
|
|
12
13
|
export declare enum TableOperations {
|
|
13
14
|
headerRow = "headerRow",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { TableElement } from '../../../custom-types';
|
|
2
2
|
import { TheEditor } from '../../../interfaces';
|
|
3
3
|
export declare const calculateRowControls: (editor: TheEditor, element: TableElement) => any[];
|
|
4
|
+
export declare const calculateHeaderRowHeight: (editor: TheEditor, element: TableElement) => number;
|
|
@@ -8,25 +8,6 @@ import { TableElement } from '../../../custom-types';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const getGridColumns: (headerRow: HTMLElement, cellsWidth: number[]) => string;
|
|
10
10
|
export declare const getColumnsWidth: (cellRow: HTMLElement, isColgroup?: boolean) => any[];
|
|
11
|
-
/**
|
|
12
|
-
* 计算表格列宽
|
|
13
|
-
* @param isReadonly
|
|
14
|
-
* @param element
|
|
15
|
-
* @param tableWidth
|
|
16
|
-
* @param mode
|
|
17
|
-
* @returns number[]
|
|
18
|
-
*/
|
|
19
|
-
export declare const calcColumnGroups: (isReadonly: boolean, element: TableElement, tableWidth: number, mode: string) => import("../table.types").TheTableColumn[];
|
|
20
|
-
/**
|
|
21
|
-
* 计算表格列宽
|
|
22
|
-
* @param element
|
|
23
|
-
* @param tableWidth
|
|
24
|
-
* @param minWidthPx
|
|
25
|
-
* @returns number[]
|
|
26
|
-
*/
|
|
27
|
-
export declare const calcColumnWidth: (element: TableElement, tableWidth: number, minWidthPx: number) => {
|
|
28
|
-
width: number;
|
|
29
|
-
}[];
|
|
30
11
|
/**
|
|
31
12
|
* 打印模式下,按照原宽度比例基于当前表格宽度计算列宽
|
|
32
13
|
* 1. 所有列的最小列宽总和大于表格宽度时,所有列返回最小宽度
|
|
@@ -34,6 +15,6 @@ export declare const calcColumnWidth: (element: TableElement, tableWidth: number
|
|
|
34
15
|
* @param minWidthPx
|
|
35
16
|
* @returns number[]
|
|
36
17
|
*/
|
|
37
|
-
export declare const calcPrintColumnWidth: (element: TableElement
|
|
18
|
+
export declare const calcPrintColumnWidth: (element: TableElement) => {
|
|
38
19
|
width: number;
|
|
39
20
|
}[];
|