@hufe921/canvas-editor 0.9.97 → 0.9.98
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 +24 -0
- package/dist/canvas-editor.es.js +359 -97
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +36 -35
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/command/Command.d.ts +2 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +4 -2
- package/dist/src/editor/core/draw/control/Control.d.ts +2 -1
- package/dist/src/editor/core/draw/control/select/SelectControl.d.ts +5 -2
- package/dist/src/editor/core/draw/particle/table/TableOperate.d.ts +1 -0
- package/dist/src/editor/core/event/CanvasEvent.d.ts +2 -1
- package/dist/src/editor/core/event/handlers/copy.d.ts +2 -1
- package/dist/src/editor/dataset/enum/Control.d.ts +2 -0
- package/dist/src/editor/interface/Control.d.ts +7 -0
- package/dist/src/editor/interface/Element.d.ts +1 -0
- package/dist/src/editor/interface/Event.d.ts +3 -0
- package/dist/src/editor/interface/table/Table.d.ts +1 -0
- package/dist/src/editor/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ export declare class Command {
|
|
|
44
44
|
executeCancelMergeTableCell: CommandAdapt['cancelMergeTableCell'];
|
|
45
45
|
executeTableTdVerticalAlign: CommandAdapt['tableTdVerticalAlign'];
|
|
46
46
|
executeTableBorderType: CommandAdapt['tableBorderType'];
|
|
47
|
+
executeTableBorderColor: CommandAdapt['tableBorderColor'];
|
|
47
48
|
executeTableTdBorderType: CommandAdapt['tableTdBorderType'];
|
|
48
49
|
executeTableTdSlashType: CommandAdapt['tableTdSlashType'];
|
|
49
50
|
executeTableTdBackgroundColor: CommandAdapt['tableTdBackgroundColor'];
|
|
@@ -66,6 +67,7 @@ export declare class Command {
|
|
|
66
67
|
executeSaveAsImageElement: CommandAdapt['saveAsImageElement'];
|
|
67
68
|
executeChangeImageDisplay: CommandAdapt['changeImageDisplay'];
|
|
68
69
|
executePageMode: CommandAdapt['pageMode'];
|
|
70
|
+
executePageScale: CommandAdapt['pageScale'];
|
|
69
71
|
executePageScaleRecovery: CommandAdapt['pageScaleRecovery'];
|
|
70
72
|
executePageScaleMinus: CommandAdapt['pageScaleMinus'];
|
|
71
73
|
executePageScaleAdd: CommandAdapt['pageScaleAdd'];
|
|
@@ -11,7 +11,7 @@ import { IGetControlValueOption, IGetControlValueResult, ILocationControlOption,
|
|
|
11
11
|
import { IAppendElementListOption, IDrawImagePayload, IForceUpdateOption, IGetImageOption, IGetValueOption, IPainterOption } from '../../interface/Draw';
|
|
12
12
|
import { IEditorData, IEditorHTML, IEditorOption, IEditorResult, IEditorText, IFocusOption, ISetValueOption, IUpdateOption } from '../../interface/Editor';
|
|
13
13
|
import { IElement, IElementPosition, IGetElementByIdOption, IUpdateElementByIdOption } from '../../interface/Element';
|
|
14
|
-
import { IPasteOption, IPositionContextByEvent } from '../../interface/Event';
|
|
14
|
+
import { ICopyOption, IPasteOption, IPositionContextByEvent } from '../../interface/Event';
|
|
15
15
|
import { IMargin } from '../../interface/Margin';
|
|
16
16
|
import { IRange, RangeContext } from '../../interface/Range';
|
|
17
17
|
import { ISearchResultContext } from '../../interface/Search';
|
|
@@ -37,7 +37,7 @@ export declare class CommandAdapt {
|
|
|
37
37
|
constructor(draw: Draw);
|
|
38
38
|
mode(payload: EditorMode): void;
|
|
39
39
|
cut(): void;
|
|
40
|
-
copy(): void;
|
|
40
|
+
copy(payload?: ICopyOption): void;
|
|
41
41
|
paste(payload?: IPasteOption): void;
|
|
42
42
|
selectAll(): void;
|
|
43
43
|
backspace(): void;
|
|
@@ -79,6 +79,7 @@ export declare class CommandAdapt {
|
|
|
79
79
|
cancelMergeTableCell(): void;
|
|
80
80
|
tableTdVerticalAlign(payload: VerticalAlign): void;
|
|
81
81
|
tableBorderType(payload: TableBorder): void;
|
|
82
|
+
tableBorderColor(payload: string): void;
|
|
82
83
|
tableTdBorderType(payload: TdBorder): void;
|
|
83
84
|
tableTdSlashType(payload: TdSlash): void;
|
|
84
85
|
tableTdBackgroundColor(payload: string): void;
|
|
@@ -118,6 +119,7 @@ export declare class CommandAdapt {
|
|
|
118
119
|
getKeywordRangeList(payload: string): IRange[];
|
|
119
120
|
getKeywordContext(payload: string): ISearchResultContext[] | null;
|
|
120
121
|
pageMode(payload: PageMode): void;
|
|
122
|
+
pageScale(scale: number): void;
|
|
121
123
|
pageScaleRecovery(): void;
|
|
122
124
|
pageScaleMinus(): void;
|
|
123
125
|
pageScaleAdd(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IControlContext, IControlHighlight, IControlInitOption, IControlInstance, IDestroyControlOption, IGetControlValueOption, IGetControlValueResult, IInitNextControlOption, INextControlContext, IRepaintControlOption, ISetControlExtensionOption, ISetControlProperties, ISetControlRowFlexOption, ISetControlValueOption } from '../../../interface/Control';
|
|
1
|
+
import { IControl, IControlContext, IControlHighlight, IControlInitOption, IControlInstance, IDestroyControlOption, IGetControlValueOption, IGetControlValueResult, IInitNextControlOption, INextControlContext, IRepaintControlOption, ISetControlExtensionOption, ISetControlProperties, ISetControlRowFlexOption, ISetControlValueOption } from '../../../interface/Control';
|
|
2
2
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
3
3
|
import { IRange } from '../../../interface/Range';
|
|
4
4
|
import { Draw } from '../Draw';
|
|
@@ -46,6 +46,7 @@ export declare class Control {
|
|
|
46
46
|
removePlaceholder(startIndex: number, context?: IControlContext): void;
|
|
47
47
|
addPlaceholder(startIndex: number, context?: IControlContext): void;
|
|
48
48
|
setValue(data: IElement[]): number;
|
|
49
|
+
setControlProperties(properties: Partial<IControl>, context?: IControlContext): void;
|
|
49
50
|
keydown(evt: KeyboardEvent): number | null;
|
|
50
51
|
cut(): number;
|
|
51
52
|
getValueById(payload: IGetControlValueOption): IGetControlValueResult;
|
|
@@ -7,13 +7,16 @@ export declare class SelectControl implements IControlInstance {
|
|
|
7
7
|
private isPopup;
|
|
8
8
|
private selectDom;
|
|
9
9
|
private options;
|
|
10
|
+
private VALUE_DELIMITER;
|
|
11
|
+
private DEFAULT_MULTI_SELECT_DELIMITER;
|
|
10
12
|
constructor(element: IElement, control: Control);
|
|
11
13
|
setElement(element: IElement): void;
|
|
12
14
|
getElement(): IElement;
|
|
13
15
|
getIsPopup(): boolean;
|
|
14
|
-
|
|
16
|
+
getCodes(): string[];
|
|
17
|
+
getText(codes: string[]): string | null;
|
|
15
18
|
getValue(context?: IControlContext): IElement[];
|
|
16
|
-
setValue(): number;
|
|
19
|
+
setValue(data: IElement[], context?: IControlContext, options?: IControlRuleOption): number;
|
|
17
20
|
keydown(evt: KeyboardEvent): number | null;
|
|
18
21
|
cut(): number;
|
|
19
22
|
clearSelect(context?: IControlContext, options?: IControlRuleOption): number;
|
|
@@ -22,6 +22,7 @@ export declare class TableOperate {
|
|
|
22
22
|
cancelMergeTableCell(): void;
|
|
23
23
|
tableTdVerticalAlign(payload: VerticalAlign): void;
|
|
24
24
|
tableBorderType(payload: TableBorder): void;
|
|
25
|
+
tableBorderColor(payload: string): void;
|
|
25
26
|
tableTdBorderType(payload: TdBorder): void;
|
|
26
27
|
tableTdSlashType(payload: TdSlash): void;
|
|
27
28
|
tableTdBackgroundColor(payload: string): void;
|
|
@@ -2,6 +2,7 @@ import { IElement, IElementPosition } from '../../interface/Element';
|
|
|
2
2
|
import { ICurrentPosition, IPositionContext } from '../../interface/Position';
|
|
3
3
|
import { Draw } from '../draw/Draw';
|
|
4
4
|
import { IRange } from '../../interface/Range';
|
|
5
|
+
import { ICopyOption } from '../../interface/Event';
|
|
5
6
|
export interface ICompositionInfo {
|
|
6
7
|
elementList: IElement[];
|
|
7
8
|
startIndex: number;
|
|
@@ -42,7 +43,7 @@ export declare class CanvasEvent {
|
|
|
42
43
|
threeClick(): void;
|
|
43
44
|
input(data: string): void;
|
|
44
45
|
cut(): void;
|
|
45
|
-
copy(): void;
|
|
46
|
+
copy(options?: ICopyOption): void;
|
|
46
47
|
compositionstart(): void;
|
|
47
48
|
compositionend(evt: CompositionEvent): void;
|
|
48
49
|
drop(evt: DragEvent): void;
|
|
@@ -15,6 +15,11 @@ export interface IValueSet {
|
|
|
15
15
|
export interface IControlSelect {
|
|
16
16
|
code: string | null;
|
|
17
17
|
valueSets: IValueSet[];
|
|
18
|
+
isMultiSelect?: boolean;
|
|
19
|
+
multiSelectDelimiter?: string;
|
|
20
|
+
selectExclusiveOptions?: {
|
|
21
|
+
inputAble?: boolean;
|
|
22
|
+
};
|
|
18
23
|
}
|
|
19
24
|
export interface IControlCheckbox {
|
|
20
25
|
code: string | null;
|
|
@@ -57,6 +62,8 @@ export interface IControlBasic {
|
|
|
57
62
|
extension?: unknown;
|
|
58
63
|
indentation?: ControlIndentation;
|
|
59
64
|
rowFlex?: RowFlex;
|
|
65
|
+
preText?: string;
|
|
66
|
+
postText?: string;
|
|
60
67
|
}
|
|
61
68
|
export interface IControlStyle {
|
|
62
69
|
font?: string;
|
|
@@ -23,3 +23,4 @@ export declare function isArrayEqual(arr1: unknown[], arr2: unknown[]): boolean;
|
|
|
23
23
|
export declare function isObjectEqual(obj1: unknown, obj2: unknown): boolean;
|
|
24
24
|
export declare function isRectIntersect(rect1: IElementFillRect, rect2: IElementFillRect): boolean;
|
|
25
25
|
export declare function isNonValue(value: unknown): boolean;
|
|
26
|
+
export declare function normalizeLineBreak(text: string): string;
|