@hufe921/canvas-editor 0.9.137 → 1.0.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/CHANGELOG.md +58 -0
- package/README.md +11 -8
- package/dist/assets/catalog-B-cbxN0s.js.map +1 -1
- package/dist/assets/value-CLcLo2uw.js.map +1 -0
- package/dist/assets/wordCount-BWZRHbSB.js.map +1 -0
- package/dist/canvas-editor.js +5783 -2872
- package/dist/canvas-editor.js.map +1 -1
- package/dist/canvas-editor.umd.cjs +54 -38
- package/dist/canvas-editor.umd.cjs.map +1 -1
- package/dist/src/editor/core/cascade/CascadeManager.d.ts +28 -0
- package/dist/src/editor/core/cascade/expression/evaluator.d.ts +14 -0
- package/dist/src/editor/core/cascade/expression/parser.d.ts +36 -0
- package/dist/src/editor/core/cascade/expression/tokenizer.d.ts +19 -0
- package/dist/src/editor/core/command/Command.d.ts +11 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +10 -1
- package/dist/src/editor/core/draw/Draw.d.ts +54 -9
- package/dist/src/editor/core/draw/column/ColumnManager.d.ts +4 -3
- package/dist/src/editor/core/draw/control/Control.d.ts +4 -0
- package/dist/src/editor/core/draw/frame/Footer.d.ts +9 -7
- package/dist/src/editor/core/draw/frame/Header.d.ts +9 -7
- package/dist/src/editor/core/draw/frame/PageBorder.d.ts +1 -1
- package/dist/src/editor/core/draw/frame/Watermark.d.ts +1 -1
- package/dist/src/editor/core/draw/interactive/Search.d.ts +1 -0
- package/dist/src/editor/core/draw/particle/HintParticle.d.ts +23 -0
- package/dist/src/editor/core/draw/particle/ListParticle.d.ts +10 -0
- package/dist/src/editor/core/draw/particle/TraceParticle.d.ts +40 -0
- package/dist/src/editor/core/draw/particle/table/TableOperate.d.ts +3 -0
- package/dist/src/editor/core/draw/particle/table/TablePaging.d.ts +13 -0
- package/dist/src/editor/core/draw/particle/table/TableParticle.d.ts +19 -2
- package/dist/src/editor/core/draw/particle/table/TableTool.d.ts +2 -0
- package/dist/src/editor/core/draw/ruler/Ruler.d.ts +43 -0
- package/dist/src/editor/core/event/GlobalEvent.d.ts +1 -0
- package/dist/src/editor/core/macro/MacroManager.d.ts +25 -0
- package/dist/src/editor/core/position/Position.d.ts +8 -1
- package/dist/src/editor/core/validate/Validate.d.ts +19 -0
- package/dist/src/editor/dataset/constant/ContextMenu.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Element.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Hint.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Ruler.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Trace.d.ts +2 -0
- package/dist/src/editor/dataset/enum/Editor.d.ts +2 -1
- package/dist/src/editor/dataset/enum/Macro.d.ts +4 -0
- package/dist/src/editor/dataset/enum/Trace.d.ts +4 -0
- package/dist/src/editor/index.d.ts +4 -1
- package/dist/src/editor/interface/Compare.d.ts +5 -0
- package/dist/src/editor/interface/Control.d.ts +46 -0
- package/dist/src/editor/interface/Draw.d.ts +1 -0
- package/dist/src/editor/interface/Editor.d.ts +6 -1
- package/dist/src/editor/interface/Element.d.ts +28 -3
- package/dist/src/editor/interface/Hint.d.ts +7 -0
- package/dist/src/editor/interface/Macro.d.ts +19 -0
- package/dist/src/editor/interface/Row.d.ts +10 -1
- package/dist/src/editor/interface/Ruler.d.ts +4 -0
- package/dist/src/editor/interface/Trace.d.ts +11 -0
- package/dist/src/editor/interface/i18n/I18n.d.ts +4 -0
- package/dist/src/editor/interface/i18n/Trace.d.ts +7 -0
- package/dist/src/editor/interface/i18n/Validate.d.ts +15 -0
- package/dist/src/editor/interface/table/Td.d.ts +1 -0
- package/dist/src/editor/utils/diff.d.ts +7 -0
- package/dist/src/editor/utils/element.d.ts +21 -2
- package/dist/src/editor/utils/print.d.ts +1 -0
- package/dist/src/editor/utils/table.d.ts +4 -0
- package/package.json +9 -9
- package/dist/assets/value-DeIsXod0.js.map +0 -1
- package/dist/assets/wordCount-Osi0e4qK.js.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Draw } from '../draw/Draw';
|
|
2
|
+
export declare class CascadeManager {
|
|
3
|
+
private draw;
|
|
4
|
+
private control;
|
|
5
|
+
private eventBus;
|
|
6
|
+
private baselines;
|
|
7
|
+
private controlBaselines;
|
|
8
|
+
private valueCache;
|
|
9
|
+
private isExecuting;
|
|
10
|
+
private needsRerun;
|
|
11
|
+
constructor(draw: Draw);
|
|
12
|
+
private getZoneElementLists;
|
|
13
|
+
private collectAll;
|
|
14
|
+
private resolveIdentifier;
|
|
15
|
+
private resolveIdentifierUncached;
|
|
16
|
+
private resolveByControlId;
|
|
17
|
+
private normalizeGetValueResult;
|
|
18
|
+
private findTitleRangeElements;
|
|
19
|
+
private recordBaseline;
|
|
20
|
+
private writeWithBaseline;
|
|
21
|
+
private restoreBaseline;
|
|
22
|
+
private recordControlBaseline;
|
|
23
|
+
private restoreControlBaseline;
|
|
24
|
+
private applyAction;
|
|
25
|
+
private applyComputes;
|
|
26
|
+
executeAll(): void;
|
|
27
|
+
private executePass;
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IAstNode } from './parser';
|
|
2
|
+
export interface IResolvedValue {
|
|
3
|
+
code?: string | null;
|
|
4
|
+
codes?: string[];
|
|
5
|
+
text?: string | null;
|
|
6
|
+
isDate?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type ResolveIdentifier = (name: string) => IResolvedValue | undefined;
|
|
9
|
+
export interface IEvalContext {
|
|
10
|
+
resolve: ResolveIdentifier;
|
|
11
|
+
resolveSelf?: () => IResolvedValue | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function evaluate(node: IAstNode, context: IEvalContext): boolean;
|
|
14
|
+
export declare function evaluateValue(node: IAstNode, context: IEvalContext): string | number | null;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IToken } from './tokenizer';
|
|
2
|
+
export type IAstNode = {
|
|
3
|
+
type: 'logical';
|
|
4
|
+
op: '&&' | '||';
|
|
5
|
+
left: IAstNode;
|
|
6
|
+
right: IAstNode;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'not';
|
|
9
|
+
argument: IAstNode;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'compare';
|
|
12
|
+
op: string;
|
|
13
|
+
left: IAstNode;
|
|
14
|
+
right: IAstNode;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'arithmetic';
|
|
17
|
+
op: string;
|
|
18
|
+
left: IAstNode;
|
|
19
|
+
right: IAstNode;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'literal';
|
|
22
|
+
value: unknown;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'getValue';
|
|
25
|
+
target: {
|
|
26
|
+
kind: 'id';
|
|
27
|
+
value: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'self';
|
|
30
|
+
};
|
|
31
|
+
} | {
|
|
32
|
+
type: 'call';
|
|
33
|
+
name: string;
|
|
34
|
+
args: IAstNode[];
|
|
35
|
+
};
|
|
36
|
+
export declare function parse(tokens: IToken[]): IAstNode;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum TokenType {
|
|
2
|
+
IDENT = "IDENT",
|
|
3
|
+
STRING = "STRING",
|
|
4
|
+
NUMBER = "NUMBER",
|
|
5
|
+
BOOLEAN = "BOOLEAN",
|
|
6
|
+
NULL = "NULL",
|
|
7
|
+
SELF = "SELF",
|
|
8
|
+
OP = "OP",
|
|
9
|
+
LPAREN = "LPAREN",
|
|
10
|
+
RPAREN = "RPAREN",
|
|
11
|
+
LBRACKET = "LBRACKET",
|
|
12
|
+
RBRACKET = "RBRACKET",
|
|
13
|
+
COMMA = "COMMA"
|
|
14
|
+
}
|
|
15
|
+
export interface IToken {
|
|
16
|
+
type: TokenType;
|
|
17
|
+
value: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function tokenize(source: string): IToken[];
|
|
@@ -51,6 +51,8 @@ export declare class Command {
|
|
|
51
51
|
executeTableTdBorderType: CommandAdapt['tableTdBorderType'];
|
|
52
52
|
executeTableTdSlashType: CommandAdapt['tableTdSlashType'];
|
|
53
53
|
executeTableTdBackgroundColor: CommandAdapt['tableTdBackgroundColor'];
|
|
54
|
+
executeTableAutoFitToContent: CommandAdapt['tableAutoFitToContent'];
|
|
55
|
+
executeTableAutoFitToPage: CommandAdapt['tableAutoFitToPage'];
|
|
54
56
|
executeTableSelectAll: CommandAdapt['tableSelectAll'];
|
|
55
57
|
executeImage: CommandAdapt['image'];
|
|
56
58
|
executeHyperlink: CommandAdapt['hyperlink'];
|
|
@@ -79,6 +81,7 @@ export declare class Command {
|
|
|
79
81
|
executePageScaleAdd: CommandAdapt['pageScaleAdd'];
|
|
80
82
|
executePaperSize: CommandAdapt['paperSize'];
|
|
81
83
|
executePaperDirection: CommandAdapt['paperDirection'];
|
|
84
|
+
executePageDirection: CommandAdapt['pageDirection'];
|
|
82
85
|
executeSetPaperMargin: CommandAdapt['setPaperMargin'];
|
|
83
86
|
executeSetMainBadge: CommandAdapt['setMainBadge'];
|
|
84
87
|
executeSetAreaBadge: CommandAdapt['setAreaBadge'];
|
|
@@ -89,6 +92,9 @@ export declare class Command {
|
|
|
89
92
|
executeDeleteArea: CommandAdapt['deleteArea'];
|
|
90
93
|
executeLocationArea: CommandAdapt['locationArea'];
|
|
91
94
|
executeClearGraffiti: CommandAdapt['clearGraffiti'];
|
|
95
|
+
executeToggleTrace: CommandAdapt['toggleTrace'];
|
|
96
|
+
executeCompare: CommandAdapt['compare'];
|
|
97
|
+
executeToggleRuler: CommandAdapt['toggleRuler'];
|
|
92
98
|
executeAppendElementList: CommandAdapt['appendElementList'];
|
|
93
99
|
executeUpdateElementById: CommandAdapt['updateElementById'];
|
|
94
100
|
executeDeleteElementById: CommandAdapt['deleteElementById'];
|
|
@@ -110,6 +116,8 @@ export declare class Command {
|
|
|
110
116
|
executeSetControlProperties: CommandAdapt['setControlProperties'];
|
|
111
117
|
executeSetControlPropertiesList: CommandAdapt['setControlPropertiesList'];
|
|
112
118
|
executeSetControlHighlight: CommandAdapt['setControlHighlight'];
|
|
119
|
+
executeValidate: CommandAdapt['validate'];
|
|
120
|
+
executeClearValidate: CommandAdapt['clearValidate'];
|
|
113
121
|
executeLocationControl: CommandAdapt['locationControl'];
|
|
114
122
|
executeInsertControl: CommandAdapt['insertControl'];
|
|
115
123
|
executeJumpControl: CommandAdapt['jumpControl'];
|
|
@@ -146,5 +154,8 @@ export declare class Command {
|
|
|
146
154
|
getTitleValue: CommandAdapt['getTitleValue'];
|
|
147
155
|
getPositionContextByEvent: CommandAdapt['getPositionContextByEvent'];
|
|
148
156
|
getElementById: CommandAdapt['getElementById'];
|
|
157
|
+
private interceptor?;
|
|
158
|
+
setInterceptor(fn?: (name: string, args: unknown[]) => void): void;
|
|
159
|
+
private wrap;
|
|
149
160
|
constructor(adapt: CommandAdapt);
|
|
150
161
|
}
|
|
@@ -8,7 +8,8 @@ import { TitleLevel } from '../../dataset/enum/Title';
|
|
|
8
8
|
import { VerticalAlign } from '../../dataset/enum/VerticalAlign';
|
|
9
9
|
import { ICatalog } from '../../interface/Catalog';
|
|
10
10
|
import { DeepRequired } from '../../interface/Common';
|
|
11
|
-
import {
|
|
11
|
+
import { IComparePayload } from '../../interface/Compare';
|
|
12
|
+
import { IControlValidateResult, IGetControlValueOption, IGetControlValueResult, ILocationControlOption, IRemoveControlOption, ISetControlExtensionOption, ISetControlHighlightOption, ISetControlProperties, ISetControlValueOption, IValidateOption } from '../../interface/Control';
|
|
12
13
|
import { IAppendElementListOption, IDrawImagePayload, IForceUpdateOption, IGetImageOption, IGetValueOption, IPainterOption } from '../../interface/Draw';
|
|
13
14
|
import { IEditorData, IEditorHTML, IEditorOption, IEditorResult, IEditorText, IFocusOption, ISetValueOption, IUpdateOption } from '../../interface/Editor';
|
|
14
15
|
import { IColumnOption } from '../../interface/Column';
|
|
@@ -91,6 +92,8 @@ export declare class CommandAdapt {
|
|
|
91
92
|
tableTdBorderType(payload: TdBorder): void;
|
|
92
93
|
tableTdSlashType(payload: TdSlash): void;
|
|
93
94
|
tableTdBackgroundColor(payload: string): void;
|
|
95
|
+
tableAutoFitToContent(): void;
|
|
96
|
+
tableAutoFitToPage(): void;
|
|
94
97
|
tableSelectAll(): void;
|
|
95
98
|
hyperlink(payload: Pick<IElement, 'valueList' | 'hyperlinkId' | 'url'>): void;
|
|
96
99
|
getHyperlinkRange(): [number, number] | null;
|
|
@@ -143,6 +146,7 @@ export declare class CommandAdapt {
|
|
|
143
146
|
pageScaleAdd(): void;
|
|
144
147
|
paperSize(width: number, height: number): void;
|
|
145
148
|
paperDirection(payload: PaperDirection): void;
|
|
149
|
+
pageDirection(payload: PaperDirection | null): void;
|
|
146
150
|
getPaperMargin(): number[];
|
|
147
151
|
setPaperMargin(payload: IMargin): void;
|
|
148
152
|
setMainBadge(payload: IBadge | null): void;
|
|
@@ -173,6 +177,8 @@ export declare class CommandAdapt {
|
|
|
173
177
|
setControlExtensionList(payload: ISetControlExtensionOption[]): void;
|
|
174
178
|
setControlProperties(payload: ISetControlProperties): void;
|
|
175
179
|
setControlPropertiesList(payload: ISetControlProperties[]): void;
|
|
180
|
+
validate(payload?: IValidateOption): IControlValidateResult[];
|
|
181
|
+
clearValidate(): void;
|
|
176
182
|
setControlHighlight(payload: ISetControlHighlightOption): void;
|
|
177
183
|
updateOptions(payload: IUpdateOption): void;
|
|
178
184
|
getControlList(): IElement[];
|
|
@@ -192,4 +198,7 @@ export declare class CommandAdapt {
|
|
|
192
198
|
deleteArea(options?: IDeleteAreaOption): void;
|
|
193
199
|
locationArea(areaId: string, options?: ILocationAreaOption): void;
|
|
194
200
|
clearGraffiti(): void;
|
|
201
|
+
toggleTrace(payload?: boolean): void;
|
|
202
|
+
compare(payload: IComparePayload): void;
|
|
203
|
+
toggleRuler(payload?: boolean): void;
|
|
195
204
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAppendElementListOption, IComputeRowListPayload, IDrawOption, IDrawRowPayload, IGetImageOption, IGetOriginValueOption, IGetValueOption, IPainterOption } from '../../interface/Draw';
|
|
2
2
|
import { IEditorData, IEditorOption, IEditorResult, ISetValueOption } from '../../interface/Editor';
|
|
3
3
|
import { IElement, IElementStyle, ISpliceElementListOption, IInsertElementListOption } from '../../interface/Element';
|
|
4
|
+
import { IMarkElementListDeletedOption } from '../../interface/Trace';
|
|
4
5
|
import { IRow } from '../../interface/Row';
|
|
5
6
|
import { IColumnLayout, IColumnOption } from '../../interface/Column';
|
|
6
7
|
import { ColumnManager } from './column/ColumnManager';
|
|
@@ -12,14 +13,23 @@ import { Listener } from '../listener/Listener';
|
|
|
12
13
|
import { Position } from '../position/Position';
|
|
13
14
|
import { RangeManager } from '../range/RangeManager';
|
|
14
15
|
import { Search } from './interactive/Search';
|
|
16
|
+
import { Strikeout } from './richtext/Strikeout';
|
|
17
|
+
import { Underline } from './richtext/Underline';
|
|
15
18
|
import { ImageParticle } from './particle/ImageParticle';
|
|
16
19
|
import { TextParticle } from './particle/TextParticle';
|
|
17
20
|
import { TableParticle } from './particle/table/TableParticle';
|
|
18
21
|
import { TableTool } from './particle/table/TableTool';
|
|
22
|
+
import { Ruler } from './ruler/Ruler';
|
|
19
23
|
import { HyperlinkParticle } from './particle/HyperlinkParticle';
|
|
24
|
+
import { HintParticle } from './particle/HintParticle';
|
|
25
|
+
import { TraceParticle } from './particle/TraceParticle';
|
|
20
26
|
import { Header } from './frame/Header';
|
|
27
|
+
import { SuperscriptParticle } from './particle/SuperscriptParticle';
|
|
28
|
+
import { SubscriptParticle } from './particle/SubscriptParticle';
|
|
21
29
|
import { EditorMode, PageMode, PaperDirection } from '../../dataset/enum/Editor';
|
|
22
30
|
import { Control } from './control/Control';
|
|
31
|
+
import { CascadeManager } from '../cascade/CascadeManager';
|
|
32
|
+
import { Validate } from '../validate/Validate';
|
|
23
33
|
import { CheckboxParticle } from './particle/CheckboxParticle';
|
|
24
34
|
import { RadioParticle } from './particle/RadioParticle';
|
|
25
35
|
import { DeepRequired, IPadding } from '../../interface/Common';
|
|
@@ -82,6 +92,7 @@ export declare class Draw {
|
|
|
82
92
|
private laTexParticle;
|
|
83
93
|
private textParticle;
|
|
84
94
|
private tableParticle;
|
|
95
|
+
private tablePaging;
|
|
85
96
|
private tableTool;
|
|
86
97
|
private tableOperate;
|
|
87
98
|
private pageNumber;
|
|
@@ -91,6 +102,8 @@ export declare class Draw {
|
|
|
91
102
|
private header;
|
|
92
103
|
private footer;
|
|
93
104
|
private hyperlinkParticle;
|
|
105
|
+
private hintParticle;
|
|
106
|
+
private traceParticle;
|
|
94
107
|
private labelParticle;
|
|
95
108
|
private dateParticle;
|
|
96
109
|
private separatorParticle;
|
|
@@ -104,6 +117,8 @@ export declare class Draw {
|
|
|
104
117
|
private lineBreakParticle;
|
|
105
118
|
private whiteSpaceParticle;
|
|
106
119
|
private control;
|
|
120
|
+
private cascadeManager;
|
|
121
|
+
private validate;
|
|
107
122
|
private pageBorder;
|
|
108
123
|
private workerManager;
|
|
109
124
|
private scrollObserver;
|
|
@@ -115,6 +130,7 @@ export declare class Draw {
|
|
|
115
130
|
private WORD_LIKE_REG;
|
|
116
131
|
private rowList;
|
|
117
132
|
private pageRowList;
|
|
133
|
+
private pageDirectionList;
|
|
118
134
|
private painterStyle;
|
|
119
135
|
private painterOptions;
|
|
120
136
|
private visiblePageNoList;
|
|
@@ -123,6 +139,7 @@ export declare class Draw {
|
|
|
123
139
|
private printModeData;
|
|
124
140
|
private controlMinWidthPlaceholderElementListSet;
|
|
125
141
|
private columnManager;
|
|
142
|
+
private ruler;
|
|
126
143
|
constructor(rootContainer: HTMLElement, options: DeepRequired<IEditorOption>, data: IEditorData, listener: Listener, eventBus: EventBus<EventBusMap>, override: Override);
|
|
127
144
|
setPrintData(): void;
|
|
128
145
|
clearPrintData(): void;
|
|
@@ -135,21 +152,38 @@ export declare class Draw {
|
|
|
135
152
|
isPrintMode(): boolean;
|
|
136
153
|
isAreaHideDisabled(): boolean;
|
|
137
154
|
isGraffitiMode(): boolean;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
155
|
+
isTraceMode(): boolean;
|
|
156
|
+
setTraceEnabled(enabled: boolean): void;
|
|
157
|
+
setRulerEnabled(enabled: boolean): void;
|
|
158
|
+
deleteElementList(elementList: IElement[], index: number, count?: number, options?: IMarkElementListDeletedOption): IElement[];
|
|
159
|
+
getOriginalWidth(direction?: PaperDirection): number;
|
|
160
|
+
getOriginalHeight(direction?: PaperDirection): number;
|
|
161
|
+
getWidth(direction?: PaperDirection): number;
|
|
162
|
+
getHeight(direction?: PaperDirection): number;
|
|
142
163
|
getMainHeight(): number;
|
|
143
|
-
getMainOuterHeight(pageNo?: number): number;
|
|
164
|
+
getMainOuterHeight(pageNo?: number, direction?: PaperDirection): number;
|
|
144
165
|
getCanvasWidth(pageNo?: number): number;
|
|
145
166
|
getCanvasHeight(pageNo?: number): number;
|
|
146
|
-
getInnerWidth(): number;
|
|
147
|
-
getColumnLayout(): IColumnLayout | null;
|
|
167
|
+
getInnerWidth(direction?: PaperDirection): number;
|
|
168
|
+
getColumnLayout(direction?: PaperDirection): IColumnLayout | null;
|
|
148
169
|
setColumnConfig(config: IColumnOption | null): void;
|
|
149
170
|
getOriginalInnerWidth(): number;
|
|
150
171
|
getContextInnerWidth(): number;
|
|
151
|
-
getMargins(): IMargin;
|
|
152
|
-
getOriginalMargins(): number[];
|
|
172
|
+
getMargins(direction?: PaperDirection): IMargin;
|
|
173
|
+
getOriginalMargins(direction?: PaperDirection): number[];
|
|
174
|
+
getPageDirection(pageNo: number): PaperDirection;
|
|
175
|
+
getPageDirectionList(): PaperDirection[];
|
|
176
|
+
getPageSize(pageNo: number): {
|
|
177
|
+
width: number;
|
|
178
|
+
height: number;
|
|
179
|
+
margins: IMargin;
|
|
180
|
+
innerWidth: number;
|
|
181
|
+
};
|
|
182
|
+
getPageOffset(pageNo: number, isOriginal?: boolean): {
|
|
183
|
+
x: number;
|
|
184
|
+
y: number;
|
|
185
|
+
};
|
|
186
|
+
private _getPageMaxWidth;
|
|
153
187
|
getPageGap(): number;
|
|
154
188
|
getOriginalPageGap(): number;
|
|
155
189
|
getPageNumberBottom(): number;
|
|
@@ -187,6 +221,10 @@ export declare class Draw {
|
|
|
187
221
|
getRange(): RangeManager;
|
|
188
222
|
getLineBreakParticle(): LineBreakParticle;
|
|
189
223
|
getTextParticle(): TextParticle;
|
|
224
|
+
getStrikeout(): Strikeout;
|
|
225
|
+
getUnderline(): Underline;
|
|
226
|
+
getSubscriptParticle(): SubscriptParticle;
|
|
227
|
+
getSuperscriptParticle(): SuperscriptParticle;
|
|
190
228
|
getHeaderElementList(): IElement[];
|
|
191
229
|
getTableElementList(sourceElementList: IElement[]): IElement[];
|
|
192
230
|
getElementList(): IElement[];
|
|
@@ -207,17 +245,22 @@ export declare class Draw {
|
|
|
207
245
|
getPreviewer(): Previewer;
|
|
208
246
|
getImageParticle(): ImageParticle;
|
|
209
247
|
getTableTool(): TableTool;
|
|
248
|
+
getRuler(): Ruler;
|
|
210
249
|
getTableOperate(): TableOperate;
|
|
211
250
|
getTableParticle(): TableParticle;
|
|
212
251
|
getBlockParticle(): BlockParticle;
|
|
213
252
|
getHeader(): Header;
|
|
214
253
|
getFooter(): Footer;
|
|
215
254
|
getHyperlinkParticle(): HyperlinkParticle;
|
|
255
|
+
getHintParticle(): HintParticle;
|
|
256
|
+
getTraceParticle(): TraceParticle;
|
|
216
257
|
getDateParticle(): DateParticle;
|
|
217
258
|
getListParticle(): ListParticle;
|
|
218
259
|
getCheckboxParticle(): CheckboxParticle;
|
|
219
260
|
getRadioParticle(): RadioParticle;
|
|
220
261
|
getControl(): Control;
|
|
262
|
+
getCascadeManager(): CascadeManager;
|
|
263
|
+
getValidate(): Validate;
|
|
221
264
|
getWorkerManager(): WorkerManager;
|
|
222
265
|
getImageObserver(): ImageObserver;
|
|
223
266
|
getI18n(): I18n;
|
|
@@ -237,6 +280,7 @@ export declare class Draw {
|
|
|
237
280
|
setPageDevicePixel(): void;
|
|
238
281
|
setPaperSize(width: number, height: number): void;
|
|
239
282
|
setPaperDirection(payload: PaperDirection): void;
|
|
283
|
+
setPageDirection(payload: PaperDirection | null): void;
|
|
240
284
|
setPaperMargin(payload: IMargin): void;
|
|
241
285
|
getOriginValue(options?: IGetOriginValueOption): Required<IEditorData>;
|
|
242
286
|
getValue(options?: IGetValueOption): IEditorResult;
|
|
@@ -246,6 +290,7 @@ export declare class Draw {
|
|
|
246
290
|
private _formatContainer;
|
|
247
291
|
private _createPageContainer;
|
|
248
292
|
private _createPage;
|
|
293
|
+
private _updatePageSizes;
|
|
249
294
|
private _initPageContext;
|
|
250
295
|
getElementFont(el: IElement, scale?: number): string;
|
|
251
296
|
getElementSize(el: IElement): number;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { IColumnLayout, IColumnOption } from '../../../interface/Column';
|
|
2
|
+
import { PaperDirection } from '../../../dataset/enum/Editor';
|
|
2
3
|
import { Draw } from '../Draw';
|
|
3
4
|
export declare class ColumnManager {
|
|
4
5
|
private draw;
|
|
5
6
|
private options;
|
|
6
|
-
private
|
|
7
|
+
private layoutMap;
|
|
7
8
|
constructor(draw: Draw);
|
|
8
9
|
computeLayout(innerWidth: number, config: IColumnOption | undefined): IColumnLayout | null;
|
|
9
10
|
compute(): void;
|
|
10
|
-
getLayout(): IColumnLayout | null;
|
|
11
|
+
getLayout(direction?: PaperDirection): IColumnLayout | null;
|
|
11
12
|
setConfig(config: IColumnOption | null | undefined): void;
|
|
12
|
-
getOffset(columnIndex: number | undefined): number;
|
|
13
|
+
getOffset(columnIndex: number | undefined, direction?: PaperDirection): number;
|
|
13
14
|
drawSeparator(ctx: CanvasRenderingContext2D, pageNo: number): void;
|
|
14
15
|
}
|
|
@@ -37,6 +37,7 @@ export declare class Control {
|
|
|
37
37
|
getElementList(): IElement[];
|
|
38
38
|
getPosition(): IElementPosition | null;
|
|
39
39
|
getPreY(): number;
|
|
40
|
+
getPreX(): number;
|
|
40
41
|
getRange(): IRange;
|
|
41
42
|
getValueRange(context?: IControlContext): IRange | null;
|
|
42
43
|
shrinkBoundary(context?: IControlContext): void;
|
|
@@ -51,8 +52,11 @@ export declare class Control {
|
|
|
51
52
|
reAwakeControl(): void;
|
|
52
53
|
selectValue(): boolean;
|
|
53
54
|
moveCursor(position: IControlInitOption): IMoveCursorResult;
|
|
55
|
+
getControlStartIndex(elementList: IElement[], startIndex: number, controlId: string): number;
|
|
56
|
+
getControlEndIndex(elementList: IElement[], startIndex: number, controlId: string): number;
|
|
54
57
|
removeControl(startIndex: number, context?: IControlContext): number | null;
|
|
55
58
|
removePlaceholder(startIndex: number, context?: IControlContext): void;
|
|
59
|
+
removePlaceholderInRange(elementList: IElement[], startIndex: number, count: number): number;
|
|
56
60
|
addPlaceholder(startIndex: number, context?: IControlContext): void;
|
|
57
61
|
setValue(data: IElement[]): number;
|
|
58
62
|
setControlProperties(properties: Partial<IControl>, context?: IControlContext): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PaperDirection } from '../../../dataset/enum/Editor';
|
|
1
2
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
2
3
|
import { IRow } from '../../../interface/Row';
|
|
3
4
|
import { Draw } from '../Draw';
|
|
@@ -7,22 +8,23 @@ export declare class Footer {
|
|
|
7
8
|
private zone;
|
|
8
9
|
private options;
|
|
9
10
|
private elementList;
|
|
10
|
-
private
|
|
11
|
-
private positionList;
|
|
11
|
+
private layoutMap;
|
|
12
12
|
constructor(draw: Draw, data?: IElement[]);
|
|
13
13
|
getRowList(): IRow[];
|
|
14
14
|
setElementList(elementList: IElement[]): void;
|
|
15
15
|
getElementList(): IElement[];
|
|
16
|
-
getPositionList(): IElementPosition[];
|
|
16
|
+
getPositionList(direction?: PaperDirection): IElementPosition[];
|
|
17
17
|
compute(): void;
|
|
18
18
|
recovery(): void;
|
|
19
|
+
private _getLayoutByDirection;
|
|
19
20
|
private _computeRowList;
|
|
20
21
|
private _computePositionList;
|
|
21
22
|
getFooterBottom(pageNo?: number): number;
|
|
22
|
-
getMaxHeight(): number;
|
|
23
|
-
getHeight(pageNo?: number): number;
|
|
24
|
-
getRowHeight(): number;
|
|
25
|
-
getExtraHeight(pageNo?: number): number;
|
|
23
|
+
getMaxHeight(direction?: PaperDirection): number;
|
|
24
|
+
getHeight(pageNo?: number, direction?: PaperDirection): number;
|
|
25
|
+
getRowHeight(direction?: PaperDirection): number;
|
|
26
|
+
getExtraHeight(pageNo?: number, direction?: PaperDirection): number;
|
|
27
|
+
private _resolveDirection;
|
|
26
28
|
isDisabled(pageNo?: number): boolean;
|
|
27
29
|
render(ctx: CanvasRenderingContext2D, pageNo: number): void;
|
|
28
30
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PaperDirection } from '../../../dataset/enum/Editor';
|
|
1
2
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
2
3
|
import { IRow } from '../../../interface/Row';
|
|
3
4
|
import { Draw } from '../Draw';
|
|
@@ -7,22 +8,23 @@ export declare class Header {
|
|
|
7
8
|
private zone;
|
|
8
9
|
private options;
|
|
9
10
|
private elementList;
|
|
10
|
-
private
|
|
11
|
-
private positionList;
|
|
11
|
+
private layoutMap;
|
|
12
12
|
constructor(draw: Draw, data?: IElement[]);
|
|
13
13
|
getRowList(): IRow[];
|
|
14
14
|
setElementList(elementList: IElement[]): void;
|
|
15
15
|
getElementList(): IElement[];
|
|
16
|
-
getPositionList(): IElementPosition[];
|
|
16
|
+
getPositionList(direction?: PaperDirection): IElementPosition[];
|
|
17
17
|
compute(): void;
|
|
18
18
|
recovery(): void;
|
|
19
|
+
private _getLayoutByDirection;
|
|
19
20
|
private _computeRowList;
|
|
20
21
|
private _computePositionList;
|
|
21
22
|
getHeaderTop(pageNo?: number): number;
|
|
22
|
-
getMaxHeight(): number;
|
|
23
|
-
getHeight(pageNo?: number): number;
|
|
24
|
-
getRowHeight(): number;
|
|
25
|
-
getExtraHeight(pageNo?: number): number;
|
|
23
|
+
getMaxHeight(direction?: PaperDirection): number;
|
|
24
|
+
getHeight(pageNo?: number, direction?: PaperDirection): number;
|
|
25
|
+
getRowHeight(direction?: PaperDirection): number;
|
|
26
|
+
getExtraHeight(pageNo?: number, direction?: PaperDirection): number;
|
|
27
|
+
private _resolveDirection;
|
|
26
28
|
isDisabled(pageNo?: number): boolean;
|
|
27
29
|
render(ctx: CanvasRenderingContext2D, pageNo: number): void;
|
|
28
30
|
}
|
|
@@ -5,6 +5,6 @@ export declare class Watermark {
|
|
|
5
5
|
private imageCache;
|
|
6
6
|
constructor(draw: Draw);
|
|
7
7
|
renderText(ctx: CanvasRenderingContext2D, pageNo: number): void;
|
|
8
|
-
renderImage(ctx: CanvasRenderingContext2D): void;
|
|
8
|
+
renderImage(ctx: CanvasRenderingContext2D, pageNo: number): void;
|
|
9
9
|
render(ctx: CanvasRenderingContext2D, pageNo: number): void;
|
|
10
10
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IElementPosition } from '../../../interface/Element';
|
|
2
|
+
import { ITd } from '../../../interface/table/Td';
|
|
3
|
+
import { Draw } from '../Draw';
|
|
4
|
+
interface IHintHit {
|
|
5
|
+
hint: string;
|
|
6
|
+
position?: IElementPosition;
|
|
7
|
+
td?: ITd;
|
|
8
|
+
}
|
|
9
|
+
export declare class HintParticle {
|
|
10
|
+
private draw;
|
|
11
|
+
private options;
|
|
12
|
+
private container;
|
|
13
|
+
private hintPopupContainer;
|
|
14
|
+
private hintDom;
|
|
15
|
+
private lastHoverKey;
|
|
16
|
+
constructor(draw: Draw);
|
|
17
|
+
private _createHintPopupDom;
|
|
18
|
+
private _getElementHint;
|
|
19
|
+
drawHintPopup(hit: IHintHit, pageNo: number): void;
|
|
20
|
+
clearHintPopup(): void;
|
|
21
|
+
handleMouseMove(evt: MouseEvent): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -9,9 +9,19 @@ export declare class ListParticle {
|
|
|
9
9
|
private readonly UN_COUNT_STYLE_WIDTH;
|
|
10
10
|
private readonly MEASURE_BASE_TEXT;
|
|
11
11
|
private readonly LIST_GAP;
|
|
12
|
+
readonly LIST_INDENT_WIDTH = 30;
|
|
13
|
+
private readonly MAX_LEVEL;
|
|
12
14
|
constructor(draw: Draw);
|
|
13
15
|
setList(listType: ListType | null, listStyle?: ListStyle): void;
|
|
14
16
|
unsetList(): void;
|
|
17
|
+
increaseListLevel(): void;
|
|
18
|
+
decreaseListLevel(): void;
|
|
19
|
+
private applySegmentLevel;
|
|
20
|
+
private findPreviousListId;
|
|
21
|
+
private isParagraphStart;
|
|
22
|
+
private clearListInfo;
|
|
23
|
+
private clearPreviousEmptyListItems;
|
|
24
|
+
private extractListSegments;
|
|
15
25
|
computeListStyle(ctx: CanvasRenderingContext2D, elementList: IElement[]): Map<string, number>;
|
|
16
26
|
private findStyledElement;
|
|
17
27
|
private getListFontStyle;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IElement, IElementMetrics, IElementPosition } from '../../../interface/Element';
|
|
2
|
+
import { IRow, IRowElement } from '../../../interface/Row';
|
|
3
|
+
import { IMarkElementListDeletedOption } from '../../../interface/Trace';
|
|
4
|
+
import { Draw } from '../Draw';
|
|
5
|
+
interface ITraceRenderContext {
|
|
6
|
+
ctx: CanvasRenderingContext2D;
|
|
7
|
+
element: IRowElement;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
curRow: IRow;
|
|
11
|
+
metrics: IElementMetrics;
|
|
12
|
+
offsetY: number;
|
|
13
|
+
scale: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class TraceParticle {
|
|
16
|
+
private draw;
|
|
17
|
+
private options;
|
|
18
|
+
private container;
|
|
19
|
+
private tracePopupContainer;
|
|
20
|
+
private listDom;
|
|
21
|
+
private lastHoverKey;
|
|
22
|
+
private strikeoutState;
|
|
23
|
+
private underlineState;
|
|
24
|
+
private currentRow;
|
|
25
|
+
constructor(draw: Draw);
|
|
26
|
+
private _createTracePopupDom;
|
|
27
|
+
drawTracePopup(element: IElement, position: IElementPosition | undefined, pageNo: number): void;
|
|
28
|
+
clearTracePopup(): void;
|
|
29
|
+
handleMouseMove(evt: MouseEvent): void;
|
|
30
|
+
private _getTraceFlags;
|
|
31
|
+
render(context: ITraceRenderContext): void;
|
|
32
|
+
flush(ctx: CanvasRenderingContext2D): void;
|
|
33
|
+
private _flushStrikeout;
|
|
34
|
+
private _flushUnderline;
|
|
35
|
+
isTraceHidden(element: IElement): boolean;
|
|
36
|
+
private _markElementList;
|
|
37
|
+
markElementListInserted(elementList: IElement[]): void;
|
|
38
|
+
markElementListDeleted(elementList: IElement[], options?: IMarkElementListDeletedOption): IElement[];
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -28,5 +28,8 @@ export declare class TableOperate {
|
|
|
28
28
|
tableTdBorderType(payload: TdBorder): void;
|
|
29
29
|
tableTdSlashType(payload: TdSlash): void;
|
|
30
30
|
tableTdBackgroundColor(payload: string): void;
|
|
31
|
+
private _measureTdContentWidth;
|
|
32
|
+
tableAutoFitToContent(): void;
|
|
33
|
+
tableAutoFitToPage(): void;
|
|
31
34
|
tableSelectAll(): void;
|
|
32
35
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IElement, ITableRowFragment } from '../../../../interface/Element';
|
|
2
|
+
import { IRow } from '../../../../interface/Row';
|
|
3
|
+
import { Draw } from '../../Draw';
|
|
4
|
+
export declare class TablePaging {
|
|
5
|
+
private draw;
|
|
6
|
+
private options;
|
|
7
|
+
private tableParticle;
|
|
8
|
+
constructor(draw: Draw);
|
|
9
|
+
splitTableRowAcrossPages(rowList: IRow[]): IRow[];
|
|
10
|
+
truncateTableByFragment(element: IElement, fragment: ITableRowFragment, elementList: IElement[]): boolean;
|
|
11
|
+
private _trimTdContentToWindow;
|
|
12
|
+
private _repairTableContextAfterTruncate;
|
|
13
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IElement } from '../../../..';
|
|
2
|
+
import { ITableRowFragment } from '../../../../interface/Element';
|
|
3
|
+
import { IRow } from '../../../../interface/Row';
|
|
2
4
|
import { ITd } from '../../../../interface/table/Td';
|
|
3
5
|
import { ITr } from '../../../../interface/table/Tr';
|
|
4
6
|
import { Draw } from '../../Draw';
|
|
@@ -6,19 +8,34 @@ export declare class TableParticle {
|
|
|
6
8
|
private draw;
|
|
7
9
|
private range;
|
|
8
10
|
private options;
|
|
11
|
+
private fragmentContentHeightCache;
|
|
12
|
+
private tdLineHeightPrefixCache;
|
|
13
|
+
private fragmentTdListCache;
|
|
9
14
|
constructor(draw: Draw);
|
|
10
15
|
getTrListGroupByCol(payload: ITr[]): ITr[];
|
|
11
16
|
getRangeRowCol(): ITd[][] | null;
|
|
12
17
|
private _drawOuterBorder;
|
|
18
|
+
getFragmentTdList(element: IElement, fragment: ITableRowFragment): ITd[];
|
|
19
|
+
private _getDrawTdList;
|
|
13
20
|
private _drawSlash;
|
|
14
21
|
private _drawBorder;
|
|
15
22
|
private _drawBackgroundColor;
|
|
16
23
|
getTableWidth(element: IElement): number;
|
|
24
|
+
getFragmentTrHeight(tr: ITr, trIndex: number, fragment?: ITableRowFragment): number;
|
|
25
|
+
getFragmentContentHeight(element: IElement, fragment: Pick<ITableRowFragment, 'startTrIndex' | 'endTrIndex' | 'startSplitTrOffset' | 'endSplitTrHeight'>): number;
|
|
26
|
+
getTdWindowInFragment(td: ITd, element: IElement, fragment: ITableRowFragment): [number, number];
|
|
27
|
+
getTdWindowOffsetY(windowStart: number, fragment: ITableRowFragment): number;
|
|
28
|
+
getTdVisibleRowListByWindow(td: ITd, windowStart: number, windowEnd: number): {
|
|
29
|
+
rowList: IRow[];
|
|
30
|
+
startIndex: number;
|
|
31
|
+
startRowIndex: number;
|
|
32
|
+
};
|
|
33
|
+
getTdLineRangeBySplitWindow(td: ITd, windowStart: number, windowEnd: number): [number, number];
|
|
17
34
|
getTableHeight(element: IElement): number;
|
|
18
35
|
getRowCountByColIndex(trList: ITr[], colIndex: number): number;
|
|
19
36
|
getTdListByColIndex(trList: ITr[], colIndex: number): ITd[];
|
|
20
37
|
getTdListByRowIndex(trList: ITr[], rowIndex: number): ITd[];
|
|
21
38
|
computeRowColInfo(element: IElement): void;
|
|
22
|
-
drawRange(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
|
|
23
|
-
render(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
|
|
39
|
+
drawRange(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number, fragment?: ITableRowFragment): void;
|
|
40
|
+
render(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number, fragment?: ITableRowFragment): void;
|
|
24
41
|
}
|