@hufe921/canvas-editor 0.9.48 → 0.9.49
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 +22 -0
- package/dist/canvas-editor.es.js +201 -24
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +28 -28
- 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 +3 -0
- package/dist/src/editor/core/draw/control/Control.d.ts +3 -1
- package/dist/src/editor/core/draw/control/checkbox/CheckboxControl.d.ts +2 -2
- package/dist/src/editor/core/draw/control/select/SelectControl.d.ts +3 -3
- package/dist/src/editor/core/draw/control/text/TextControl.d.ts +3 -2
- package/dist/src/editor/interface/Control.d.ts +16 -0
- package/dist/src/editor/utils/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -79,6 +79,7 @@ export declare class Command {
|
|
|
79
79
|
executeSetGroup: CommandAdapt['setGroup'];
|
|
80
80
|
executeDeleteGroup: CommandAdapt['deleteGroup'];
|
|
81
81
|
executeLocationGroup: CommandAdapt['locationGroup'];
|
|
82
|
+
executeSetControlValue: CommandAdapt['setControlValue'];
|
|
82
83
|
getCatalog: CommandAdapt['getCatalog'];
|
|
83
84
|
getImage: CommandAdapt['getImage'];
|
|
84
85
|
getOptions: CommandAdapt['getOptions'];
|
|
@@ -94,5 +95,6 @@ export declare class Command {
|
|
|
94
95
|
getSearchNavigateInfo: CommandAdapt['getSearchNavigateInfo'];
|
|
95
96
|
getLocale: CommandAdapt['getLocale'];
|
|
96
97
|
getGroupIds: CommandAdapt['getGroupIds'];
|
|
98
|
+
getControlValue: CommandAdapt['getControlValue'];
|
|
97
99
|
constructor(adapt: CommandAdapt);
|
|
98
100
|
}
|
|
@@ -7,6 +7,7 @@ import { TitleLevel } from '../../dataset/enum/Title';
|
|
|
7
7
|
import { VerticalAlign } from '../../dataset/enum/VerticalAlign';
|
|
8
8
|
import { ICatalog } from '../../interface/Catalog';
|
|
9
9
|
import { DeepRequired } from '../../interface/Common';
|
|
10
|
+
import { IGetControlValueOption, IGetControlValueResult, ISetControlOption } from '../../interface/Control';
|
|
10
11
|
import { IAppendElementListOption, IDrawImagePayload, IForceUpdateOption, IGetImageOption, IGetValueOption, IPainterOption } from '../../interface/Draw';
|
|
11
12
|
import { IEditorData, IEditorHTML, IEditorOption, IEditorResult, IEditorText } from '../../interface/Editor';
|
|
12
13
|
import { IElement } from '../../interface/Element';
|
|
@@ -123,4 +124,6 @@ export declare class CommandAdapt {
|
|
|
123
124
|
deleteGroup(groupId: string): void;
|
|
124
125
|
getGroupIds(): Promise<string[]>;
|
|
125
126
|
locationGroup(groupId: string): void;
|
|
127
|
+
getControlValue(payload: IGetControlValueOption): IGetControlValueResult | null;
|
|
128
|
+
setControlValue(payload: ISetControlOption): void;
|
|
126
129
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IControlInitOption, IControlInstance } from '../../../interface/Control';
|
|
1
|
+
import { IControlInitOption, IControlInstance, IGetControlValueOption, IGetControlValueResult, ISetControlOption } from '../../../interface/Control';
|
|
2
2
|
import { IEditorData } from '../../../interface/Editor';
|
|
3
3
|
import { IElement, IElementPosition } from '../../../interface/Element';
|
|
4
4
|
import { IRange } from '../../../interface/Range';
|
|
@@ -37,5 +37,7 @@ export declare class Control {
|
|
|
37
37
|
setValue(data: IElement[]): number;
|
|
38
38
|
keydown(evt: KeyboardEvent): number;
|
|
39
39
|
cut(): number;
|
|
40
|
+
getValueByConceptId(payload: IGetControlValueOption): IGetControlValueResult;
|
|
41
|
+
setValueByConceptId(payload: ISetControlOption): void;
|
|
40
42
|
}
|
|
41
43
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IControlInstance } from '../../../../interface/Control';
|
|
1
|
+
import { IControlContext, IControlInstance } from '../../../../interface/Control';
|
|
2
2
|
import { IElement } from '../../../../interface/Element';
|
|
3
3
|
import { Control } from '../Control';
|
|
4
4
|
export declare class CheckboxControl implements IControlInstance {
|
|
@@ -9,7 +9,7 @@ export declare class CheckboxControl implements IControlInstance {
|
|
|
9
9
|
getCode(): string | null;
|
|
10
10
|
getValue(): IElement[];
|
|
11
11
|
setValue(): number;
|
|
12
|
-
setSelect(): void;
|
|
12
|
+
setSelect(context?: IControlContext): void;
|
|
13
13
|
keydown(evt: KeyboardEvent): number;
|
|
14
14
|
cut(): number;
|
|
15
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IControlInstance } from '../../../../interface/Control';
|
|
1
|
+
import { IControlContext, IControlInstance } from '../../../../interface/Control';
|
|
2
2
|
import { IElement } from '../../../../interface/Element';
|
|
3
3
|
import { Control } from '../Control';
|
|
4
4
|
export declare class SelectControl implements IControlInstance {
|
|
@@ -13,8 +13,8 @@ export declare class SelectControl implements IControlInstance {
|
|
|
13
13
|
setValue(): number;
|
|
14
14
|
keydown(evt: KeyboardEvent): number;
|
|
15
15
|
cut(): number;
|
|
16
|
-
clearSelect(): number;
|
|
17
|
-
setSelect(code: string): void;
|
|
16
|
+
clearSelect(context?: IControlContext): number;
|
|
17
|
+
setSelect(code: string, context?: IControlContext): void;
|
|
18
18
|
private _createSelectPopupDom;
|
|
19
19
|
awake(): void;
|
|
20
20
|
destroy(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IControlInstance } from '../../../../interface/Control';
|
|
1
|
+
import { IControlContext, IControlInstance } from '../../../../interface/Control';
|
|
2
2
|
import { IElement } from '../../../../interface/Element';
|
|
3
3
|
import { Control } from '../Control';
|
|
4
4
|
export declare class TextControl implements IControlInstance {
|
|
@@ -7,7 +7,8 @@ export declare class TextControl implements IControlInstance {
|
|
|
7
7
|
constructor(element: IElement, control: Control);
|
|
8
8
|
getElement(): IElement;
|
|
9
9
|
getValue(): IElement[];
|
|
10
|
-
setValue(data: IElement[]): number;
|
|
10
|
+
setValue(data: IElement[], context?: IControlContext): number;
|
|
11
|
+
clearValue(context?: IControlContext): number;
|
|
11
12
|
keydown(evt: KeyboardEvent): number;
|
|
12
13
|
cut(): number;
|
|
13
14
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ControlType } from '../dataset/enum/Control';
|
|
2
2
|
import { ICheckbox } from './Checkbox';
|
|
3
3
|
import { IElement } from './Element';
|
|
4
|
+
import { IRange } from './Range';
|
|
4
5
|
export interface IValueSet {
|
|
5
6
|
value: string;
|
|
6
7
|
code: string;
|
|
@@ -50,3 +51,18 @@ export interface IControlInstance {
|
|
|
50
51
|
keydown(evt: KeyboardEvent): number;
|
|
51
52
|
cut(): number;
|
|
52
53
|
}
|
|
54
|
+
export interface IControlContext {
|
|
55
|
+
range?: IRange;
|
|
56
|
+
elementList?: IElement[];
|
|
57
|
+
}
|
|
58
|
+
export interface IGetControlValueOption {
|
|
59
|
+
conceptId: string;
|
|
60
|
+
}
|
|
61
|
+
export declare type IGetControlValueResult = {
|
|
62
|
+
value: string | null;
|
|
63
|
+
innerText: string | null;
|
|
64
|
+
}[];
|
|
65
|
+
export interface ISetControlOption {
|
|
66
|
+
conceptId: string;
|
|
67
|
+
value: string;
|
|
68
|
+
}
|
|
@@ -12,7 +12,7 @@ export declare function mergeObject<T>(source: T, target: T): T;
|
|
|
12
12
|
export declare function nextTick(fn: Function): void;
|
|
13
13
|
export declare function convertNumberToChinese(num: number): string;
|
|
14
14
|
export declare function cloneProperty<T>(properties: (keyof T)[], sourceElement: T, targetElement: T): void;
|
|
15
|
-
export declare function omitObject<T>(object: T,
|
|
15
|
+
export declare function omitObject<T>(object: T, omitKeys: (keyof T)[]): T;
|
|
16
16
|
export declare function convertStringToBase64(input: string): string;
|
|
17
17
|
export declare function findScrollContainer(element: HTMLElement): HTMLElement;
|
|
18
18
|
export declare function isArrayEqual(arr1: unknown[], arr2: unknown[]): boolean;
|