next-element-vue 0.6.3 → 0.6.4
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/dist/index.css +1 -1
- package/dist/index.js +3 -3
- package/dist/packages/components/labelme/src/core/CreateCircle.d.ts +29 -0
- package/dist/packages/components/labelme/src/core/EditCircle.d.ts +30 -0
- package/dist/packages/components/labelme/src/core/EditPolygon.d.ts +1 -1
- package/dist/packages/components/labelme/src/core/utils.d.ts +9 -0
- package/dist/packages/components/labelme/src/hooks/canvas-content-hook.d.ts +9 -0
- package/dist/packages/components/labelme/src/widgets/canvas-context.d.ts +2 -1
- package/dist/packages/components/labelme/src/widgets/right-label.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default class CreateCircle {
|
|
2
|
+
canvas: HTMLCanvasElement;
|
|
3
|
+
ctx: CanvasRenderingContext2D;
|
|
4
|
+
private isDrawing;
|
|
5
|
+
private mouseOffset;
|
|
6
|
+
vertexes: [number, number][];
|
|
7
|
+
private vertexesObservers;
|
|
8
|
+
private drawCompleteCallback;
|
|
9
|
+
constructor(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D);
|
|
10
|
+
subscribeVertexesChange(listener: (vertexes: [number, number][], mouseOffset: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}) => void): void;
|
|
14
|
+
private notifyVertexesChange;
|
|
15
|
+
subscribeDrawComplete(callback: (vertexes: [number, number][], mouseOffset: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}) => void): void;
|
|
19
|
+
private notifyDrawComplete;
|
|
20
|
+
private transformMousePoint;
|
|
21
|
+
start(): void;
|
|
22
|
+
reset(): void;
|
|
23
|
+
stop(): void;
|
|
24
|
+
private canvasMouseDown;
|
|
25
|
+
private canvasMouseMove;
|
|
26
|
+
private canvasMouseUp;
|
|
27
|
+
drawCircle(vertexes: [number, number][]): void;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ShapesProps } from '../config';
|
|
2
|
+
export default class EditCircle {
|
|
3
|
+
canvas: HTMLCanvasElement;
|
|
4
|
+
ctx: CanvasRenderingContext2D;
|
|
5
|
+
shape: ShapesProps;
|
|
6
|
+
private anchorRadius;
|
|
7
|
+
private anchorVertexIndex;
|
|
8
|
+
private isMoveEditing;
|
|
9
|
+
private mouseMoveOffset;
|
|
10
|
+
private isEditing;
|
|
11
|
+
private vertexes;
|
|
12
|
+
private editingObservers;
|
|
13
|
+
private editedObserver?;
|
|
14
|
+
constructor(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D);
|
|
15
|
+
onEditing(observer: (vertexes: [number, number][]) => void): void;
|
|
16
|
+
offEditing(observer: (vertexes: [number, number][]) => void): void;
|
|
17
|
+
private notifyEditing;
|
|
18
|
+
onEditCompleted(callback: (vertexes: [number, number][]) => void): void;
|
|
19
|
+
private notifyEditCompleted;
|
|
20
|
+
private getTransformPoint;
|
|
21
|
+
drawCircle(vertexes: [number, number][]): void;
|
|
22
|
+
private drawVertexAnchors;
|
|
23
|
+
private pointInVertexAnchors;
|
|
24
|
+
private updateCanvasCursor;
|
|
25
|
+
private canvasMouseDown;
|
|
26
|
+
private canvasMouseMove;
|
|
27
|
+
private canvasMouseUp;
|
|
28
|
+
render(): void;
|
|
29
|
+
destroy(): void;
|
|
30
|
+
}
|
|
@@ -33,8 +33,8 @@ export default class EditPolygon {
|
|
|
33
33
|
private notifyObservers;
|
|
34
34
|
updatePolygon(callback: (vertexes: [number, number][]) => void): void;
|
|
35
35
|
canvasMousedown(e: MouseEvent): void;
|
|
36
|
-
canvasMouseup(e: MouseEvent): void;
|
|
37
36
|
canvasMousemove(e: MouseEvent): void;
|
|
37
|
+
canvasMouseup(e: MouseEvent): void;
|
|
38
38
|
canvasMouseClick(e: MouseEvent): void;
|
|
39
39
|
destroy(): void;
|
|
40
40
|
}
|
|
@@ -23,6 +23,15 @@ export declare const isPointInPath: (px: number, py: number, vertexes: [number,
|
|
|
23
23
|
* @returns
|
|
24
24
|
*/
|
|
25
25
|
export declare const isPointInRectangle: (px: number, py: number, vertexes: [number, number][], ctx: CanvasRenderingContext2D) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 点是否在图形圆内
|
|
28
|
+
* @param px 鼠标x坐标
|
|
29
|
+
* @param py 鼠标y坐标
|
|
30
|
+
* @param vertexes 点位数据
|
|
31
|
+
* @param ctx 上下文
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
export declare const isPointInCircleShape: (px: number, py: number, vertexes: [number, number][], ctx: CanvasRenderingContext2D) => boolean;
|
|
26
35
|
/**
|
|
27
36
|
* 点是否在折线内
|
|
28
37
|
* @param px 鼠标x坐标
|
|
@@ -25,11 +25,14 @@ export declare class CreateDrawCanvas {
|
|
|
25
25
|
private editDrawPolygon;
|
|
26
26
|
private createRectangle;
|
|
27
27
|
private editDrawRectangle;
|
|
28
|
+
private createCircle;
|
|
29
|
+
private editDrawCircle;
|
|
28
30
|
private addVertexes;
|
|
29
31
|
private createCompleteSubscribers;
|
|
30
32
|
private editingShape;
|
|
31
33
|
private editVertexes;
|
|
32
34
|
private editingSubscribers;
|
|
35
|
+
private activeShapeObserver;
|
|
33
36
|
constructor(options: DrawBaseCanvasProps);
|
|
34
37
|
subscribeCreateComplete(callback: (vertexes: [number, number][], mouseOffset: {
|
|
35
38
|
x: number;
|
|
@@ -44,7 +47,11 @@ export declare class CreateDrawCanvas {
|
|
|
44
47
|
subscribeEditing(callback: (vertexes: [number, number][], shape: ShapesProps) => void): void;
|
|
45
48
|
unsubscribeEditing(callback: (vertexes: [number, number][], shape: ShapesProps) => void): void;
|
|
46
49
|
private notifyEditing;
|
|
50
|
+
subscribeActiveShape(callback: (shape: ShapesProps | null) => void): void;
|
|
51
|
+
unsubscribeActiveShape(): void;
|
|
52
|
+
private notifyActiveShape;
|
|
47
53
|
onStartCreateRectangle(): void;
|
|
54
|
+
onStartCreateCircle(): void;
|
|
48
55
|
resetAllInstance(): void;
|
|
49
56
|
closeCreateOrEditor(): void;
|
|
50
57
|
drawShapes(shapes: ShapesProps[]): void;
|
|
@@ -55,6 +62,7 @@ export declare class CreateDrawCanvas {
|
|
|
55
62
|
render: () => void;
|
|
56
63
|
private mouseHitShape;
|
|
57
64
|
triggerShapeEdit(shape: ShapesProps): void;
|
|
65
|
+
onSelectShape(shape: ShapesProps): void;
|
|
58
66
|
private onResetHitShape;
|
|
59
67
|
private onMouseDoubleClick;
|
|
60
68
|
private onMouseClick;
|
|
@@ -63,5 +71,6 @@ export declare class CreateDrawCanvas {
|
|
|
63
71
|
private onMouseUp;
|
|
64
72
|
onEditorStart(): void;
|
|
65
73
|
onEditorEnd(): void;
|
|
74
|
+
onCreateEnd(): void;
|
|
66
75
|
destroy(): void;
|
|
67
76
|
}
|
|
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
7
7
|
type: ObjectConstructor;
|
|
8
8
|
default: () => {};
|
|
9
9
|
};
|
|
10
|
-
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("editPolygon" | "changePolygon" | "updateLabelInfo")[], "editPolygon" | "changePolygon" | "updateLabelInfo", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
+
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("editPolygon" | "changePolygon" | "updateLabelInfo" | "selectShape")[], "editPolygon" | "changePolygon" | "updateLabelInfo" | "selectShape", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
11
|
contextClientHeight: {
|
|
12
12
|
type: NumberConstructor;
|
|
13
13
|
default: any;
|
|
@@ -20,6 +20,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
20
20
|
onEditPolygon?: (...args: any[]) => any;
|
|
21
21
|
onChangePolygon?: (...args: any[]) => any;
|
|
22
22
|
onUpdateLabelInfo?: (...args: any[]) => any;
|
|
23
|
+
onSelectShape?: (...args: any[]) => any;
|
|
23
24
|
}>, {
|
|
24
25
|
contextClientHeight: number;
|
|
25
26
|
labelInfo: Record<string, any>;
|
|
@@ -5,7 +5,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
5
5
|
type: PropType<ShapesProps[]>;
|
|
6
6
|
default: () => any[];
|
|
7
7
|
};
|
|
8
|
-
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("delete" | "update")[], "delete" | "update", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("delete" | "update" | "select")[], "delete" | "update" | "select", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
9
|
shapes: {
|
|
10
10
|
type: PropType<ShapesProps[]>;
|
|
11
11
|
default: () => any[];
|
|
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
13
13
|
}>> & Readonly<{
|
|
14
14
|
onDelete?: (...args: any[]) => any;
|
|
15
15
|
onUpdate?: (...args: any[]) => any;
|
|
16
|
+
onSelect?: (...args: any[]) => any;
|
|
16
17
|
}>, {
|
|
17
18
|
shapes: ShapesProps[];
|
|
18
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|