@mx-sose-front/mx-sose-graph 1.2.7 → 1.2.8
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.d.ts +3 -5259
- package/dist/index.esm.js +18 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/src/components/Common/index.d.ts +3 -0
- package/dist/src/components/Common/index.d.ts.map +1 -0
- package/dist/src/components/ContextMenu/ContextMenu.vue.d.ts +55 -0
- package/dist/src/components/ContextMenu/ContextMenu.vue.d.ts.map +1 -0
- package/dist/src/components/Diagram/StrategicTaxonomyDiagram.vue.d.ts +21 -0
- package/dist/src/components/Diagram/StrategicTaxonomyDiagram.vue.d.ts.map +1 -0
- package/dist/src/components/DiagramListTooltip/DiagramListTooltip.vue.d.ts +32 -0
- package/dist/src/components/DiagramListTooltip/DiagramListTooltip.vue.d.ts.map +1 -0
- package/dist/src/components/Edge/Edge.vue.d.ts +36 -0
- package/dist/src/components/Edge/Edge.vue.d.ts.map +1 -0
- package/dist/src/components/Gantt/Gantt.vue.d.ts +17 -0
- package/dist/src/components/Gantt/Gantt.vue.d.ts.map +1 -0
- package/dist/src/components/GanttContextMenu/GanttContextMenu.vue.d.ts +37 -0
- package/dist/src/components/GanttContextMenu/GanttContextMenu.vue.d.ts.map +1 -0
- package/dist/src/components/InteractionLayer.vue.d.ts +28 -0
- package/dist/src/components/InteractionLayer.vue.d.ts.map +1 -0
- package/dist/src/components/LineStyle/ConnectionLine.vue.d.ts +30 -0
- package/dist/src/components/LineStyle/ConnectionLine.vue.d.ts.map +1 -0
- package/dist/src/components/LineStyle/LineStyleMarker.vue.d.ts +15 -0
- package/dist/src/components/LineStyle/LineStyleMarker.vue.d.ts.map +1 -0
- package/dist/src/components/Matrix/Matrix.vue.d.ts +9 -0
- package/dist/src/components/Matrix/Matrix.vue.d.ts.map +1 -0
- package/dist/src/components/Matrix/index.d.ts +34 -0
- package/dist/src/components/Matrix/index.d.ts.map +1 -0
- package/dist/src/components/MatrixContextMenu/MatrixContextMenu.vue.d.ts +31 -0
- package/dist/src/components/MatrixContextMenu/MatrixContextMenu.vue.d.ts.map +1 -0
- package/dist/src/components/NameEditor/NameEditor.vue.d.ts +30 -0
- package/dist/src/components/NameEditor/NameEditor.vue.d.ts.map +1 -0
- package/dist/src/components/Pin/Pin.vue.d.ts +25 -0
- package/dist/src/components/Pin/Pin.vue.d.ts.map +1 -0
- package/dist/src/components/Pin/Port.vue.d.ts +23 -0
- package/dist/src/components/Pin/Port.vue.d.ts.map +1 -0
- package/dist/src/components/SelectionBox/SelectionBox.vue.d.ts +30 -0
- package/dist/src/components/SelectionBox/SelectionBox.vue.d.ts.map +1 -0
- package/dist/src/components/Shape/Action.vue.d.ts +25 -0
- package/dist/src/components/Shape/Action.vue.d.ts.map +1 -0
- package/dist/src/components/Shape/ActivityAction.vue.d.ts +25 -0
- package/dist/src/components/Shape/ActivityAction.vue.d.ts.map +1 -0
- package/dist/src/components/Shape/Block.vue.d.ts +25 -0
- package/dist/src/components/Shape/Block.vue.d.ts.map +1 -0
- package/dist/src/components/Shape/ConceptualRole.vue.d.ts +25 -0
- package/dist/src/components/Shape/ConceptualRole.vue.d.ts.map +1 -0
- package/dist/src/components/Shape/Diagram.vue.d.ts +25 -0
- package/dist/src/components/Shape/Diagram.vue.d.ts.map +1 -0
- package/dist/src/components/Shape/DividingLine.vue.d.ts +36 -0
- package/dist/src/components/Shape/DividingLine.vue.d.ts.map +1 -0
- package/dist/src/components/Shape/DogEar.vue.d.ts +25 -0
- package/dist/src/components/Shape/DogEar.vue.d.ts.map +1 -0
- package/dist/src/components/Shape/Package.vue.d.ts +25 -0
- package/dist/src/components/Shape/Package.vue.d.ts.map +1 -0
- package/dist/src/components/Table/Table.vue.d.ts +20 -0
- package/dist/src/components/Table/Table.vue.d.ts.map +1 -0
- package/dist/src/constants/edgeShapeKeys.d.ts +46 -0
- package/dist/src/constants/edgeShapeKeys.d.ts.map +1 -0
- package/dist/src/constants/index.d.ts +668 -0
- package/dist/src/constants/index.d.ts.map +1 -0
- package/dist/src/hooks/index.d.ts +6 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/useChartRowSelection.d.ts +89 -0
- package/dist/src/hooks/useChartRowSelection.d.ts.map +1 -0
- package/dist/src/hooks/useHighlight.d.ts +82 -0
- package/dist/src/hooks/useHighlight.d.ts.map +1 -0
- package/dist/src/hooks/useNameEdit.d.ts +76 -0
- package/dist/src/hooks/useNameEdit.d.ts.map +1 -0
- package/dist/src/hooks/useResize.d.ts +65 -0
- package/dist/src/hooks/useResize.d.ts.map +1 -0
- package/dist/src/hooks/useVirtualScroll.d.ts +110 -0
- package/dist/src/hooks/useVirtualScroll.d.ts.map +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/render/shape-registry.d.ts +9 -0
- package/dist/src/render/shape-registry.d.ts.map +1 -0
- package/dist/src/render/shape-renderer.d.ts +12 -0
- package/dist/src/render/shape-renderer.d.ts.map +1 -0
- package/dist/src/store/eventBus.d.ts +10 -0
- package/dist/src/store/eventBus.d.ts.map +1 -0
- package/dist/src/store/graphStore.d.ts +4644 -0
- package/dist/src/store/graphStore.d.ts.map +1 -0
- package/dist/src/store/index.d.ts +3 -0
- package/dist/src/store/index.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +279 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/interactionLayer.d.ts +23 -0
- package/dist/src/types/interactionLayer.d.ts.map +1 -0
- package/dist/src/utils/autoExpandParent.d.ts +38 -0
- package/dist/src/utils/autoExpandParent.d.ts.map +1 -0
- package/dist/src/utils/batchAutoExpand.d.ts +12 -0
- package/dist/src/utils/batchAutoExpand.d.ts.map +1 -0
- package/dist/src/utils/colorUtils.d.ts +38 -0
- package/dist/src/utils/colorUtils.d.ts.map +1 -0
- package/dist/src/utils/compartment.d.ts +92 -0
- package/dist/src/utils/compartment.d.ts.map +1 -0
- package/dist/src/utils/containers.d.ts +119 -0
- package/dist/src/utils/containers.d.ts.map +1 -0
- package/dist/src/utils/contextMenuUtils.d.ts +108 -0
- package/dist/src/utils/contextMenuUtils.d.ts.map +1 -0
- package/dist/src/utils/dateUtils.d.ts +77 -0
- package/dist/src/utils/dateUtils.d.ts.map +1 -0
- package/dist/src/utils/diagram.d.ts +289 -0
- package/dist/src/utils/diagram.d.ts.map +1 -0
- package/dist/src/utils/dom.d.ts +2 -0
- package/dist/src/utils/dom.d.ts.map +1 -0
- package/dist/src/utils/drag.d.ts +65 -0
- package/dist/src/utils/drag.d.ts.map +1 -0
- package/dist/src/utils/edgeUtils.d.ts +326 -0
- package/dist/src/utils/edgeUtils.d.ts.map +1 -0
- package/dist/src/utils/edgeWorker.d.ts +182 -0
- package/dist/src/utils/edgeWorker.d.ts.map +1 -0
- package/dist/src/utils/geom.d.ts +103 -0
- package/dist/src/utils/geom.d.ts.map +1 -0
- package/dist/src/utils/graphDragService.d.ts +62 -0
- package/dist/src/utils/graphDragService.d.ts.map +1 -0
- package/dist/src/utils/hittest.d.ts +27 -0
- package/dist/src/utils/hittest.d.ts.map +1 -0
- package/dist/src/utils/iconLoader.d.ts +16 -0
- package/dist/src/utils/iconLoader.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +8 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/keyboardUtils.d.ts +25 -0
- package/dist/src/utils/keyboardUtils.d.ts.map +1 -0
- package/dist/src/utils/license-guard.d.ts +10 -0
- package/dist/src/utils/license-guard.d.ts.map +1 -0
- package/dist/src/utils/packageOutline.d.ts +32 -0
- package/dist/src/utils/packageOutline.d.ts.map +1 -0
- package/dist/src/utils/pinUtils.d.ts +79 -0
- package/dist/src/utils/pinUtils.d.ts.map +1 -0
- package/dist/src/utils/policy.d.ts +44 -0
- package/dist/src/utils/policy.d.ts.map +1 -0
- package/dist/src/utils/rafThrottle.d.ts +63 -0
- package/dist/src/utils/rafThrottle.d.ts.map +1 -0
- package/dist/src/utils/shapeOps/shapeOps.d.ts +21 -0
- package/dist/src/utils/shapeOps/shapeOps.d.ts.map +1 -0
- package/dist/src/utils/viewportCulling.d.ts +73 -0
- package/dist/src/utils/viewportCulling.d.ts.map +1 -0
- package/dist/src/utils/workerManager.d.ts +86 -0
- package/dist/src/utils/workerManager.d.ts.map +1 -0
- package/dist/src/utils/zorder.d.ts +4 -0
- package/dist/src/utils/zorder.d.ts.map +1 -0
- package/dist/src/view/graph.vue.d.ts +180 -0
- package/dist/src/view/graph.vue.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/ContextMenu/ContextMenu.vue +2 -2
- package/src/utils/workerManager.ts +4 -1
- package/src/vite-env.d.ts +2 -2
- package/dist/assets/edgeWorker-b57ca007.js +0 -2
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Shape } from '../types';
|
|
2
|
+
|
|
3
|
+
/** 统一的几何矩形类型 */
|
|
4
|
+
export type Rect = {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
/** 更新回调签名( */
|
|
11
|
+
export type Updater = (id: string, updates: Partial<Shape>) => void;
|
|
12
|
+
/** 读取内边距(padding)。支持 style.padding 为数字;默认 20 */
|
|
13
|
+
export declare const readPadding: (s?: Shape) => {
|
|
14
|
+
top: number;
|
|
15
|
+
right: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
left: number;
|
|
18
|
+
};
|
|
19
|
+
/** 获取父容器的“内容区”(内边距之后的可放置区域) */
|
|
20
|
+
export declare const getContentRect: (parent: Shape) => {
|
|
21
|
+
left: number;
|
|
22
|
+
top: number;
|
|
23
|
+
right: number;
|
|
24
|
+
bottom: number;
|
|
25
|
+
};
|
|
26
|
+
/** 判断 childId 是否是 ancestorId 的后代 */
|
|
27
|
+
export declare const isDescendant: (shapes: Shape[], childId: string, ancestorId: string) => boolean;
|
|
28
|
+
/** 收集整棵子树(仅 id) */
|
|
29
|
+
export declare const collectDescendantIds: (shapes: Shape[], parentId: string) => string[];
|
|
30
|
+
/** 计算 child 与 region 的相交面积(region 是一个 {left,top,right,bottom}) */
|
|
31
|
+
export declare const intersectArea: (child: Rect, region: {
|
|
32
|
+
left: number;
|
|
33
|
+
top: number;
|
|
34
|
+
right: number;
|
|
35
|
+
bottom: number;
|
|
36
|
+
}) => number;
|
|
37
|
+
/** 计算子矩形在父“内容区”内的覆盖率(0~1) */
|
|
38
|
+
export declare const coverageIn: (child: Rect, parent: Shape) => number;
|
|
39
|
+
/** 把 child 夹回 parent 的内容区(不改变尺寸) */
|
|
40
|
+
export declare const clampChildIntoParent: (parent: Shape, child: Rect, alignLarge?: 'center' | 'start' | 'end') => Rect;
|
|
41
|
+
/**
|
|
42
|
+
* 让 parent “刚好包下所有直接子 + padding”
|
|
43
|
+
* - 仅增大,不缩小;必要时向左/上扩张(同时移动 x/y)
|
|
44
|
+
* - 采用 floor-ε 抑制抖动:避免 0.x 的毛刺每次都向上取整导致“慢慢变大”
|
|
45
|
+
*/
|
|
46
|
+
export declare const ensureParentFitsChildren: (shapes: Shape[], parent: Shape, updateShape: Updater, overrideRects?: Record<string, Rect>) => void;
|
|
47
|
+
/** 从当前父开始,逐层向上做 ensureParentFitsChildren */
|
|
48
|
+
export declare const bubbleAutoFitUp: (shapes: Shape[], startParentId: string | null | undefined, updateShape: Updater) => void;
|
|
49
|
+
/**
|
|
50
|
+
* 挂接:把 child 挂到 parent 下,同时把“整棵子树的 zIndex”平移为 parent.z + 1(相对层级不变)
|
|
51
|
+
* - 注意:这里只负责数据层,不做归一化(normalizeZOrder 建议在调用方统一执行)
|
|
52
|
+
*/
|
|
53
|
+
export declare const attachToParent: (shapes: Shape[], childId: string, parentId: string, updateShape: Updater) => void;
|
|
54
|
+
/** 脱离父子关系(仅清 parenShapeId) */
|
|
55
|
+
export declare const detachFromParent: (shapes: Shape[], childId: string, updateShape: Updater) => void;
|
|
56
|
+
/**
|
|
57
|
+
* (旧)自某节点起,强制“子 = 父+1”
|
|
58
|
+
*/
|
|
59
|
+
export declare const cascadeZIndexFrom: (shapes: Shape[], startId: string, updateShape: Updater) => void;
|
|
60
|
+
/** 计算“直接子元素”的联合包围盒 */
|
|
61
|
+
export declare const childrenUnionBounds: (shapes: Shape[], parentId: string, overrideRects?: Record<string, Rect>) => {
|
|
62
|
+
L: number;
|
|
63
|
+
T: number;
|
|
64
|
+
R: number;
|
|
65
|
+
B: number;
|
|
66
|
+
} | null;
|
|
67
|
+
/**
|
|
68
|
+
* 在“缩放父元素”手势中,约束 next:content(next) 覆盖 childrenUnion ± gap
|
|
69
|
+
* - dir 决定修正哪条边:左/上需要改 x/y 和宽高;右/下只改宽高
|
|
70
|
+
*/
|
|
71
|
+
export declare const clampParentRectToChildrenGap: (shapes: Shape[], parent: Shape, next: Rect, dir: 'nw' | 'ne' | 'sw' | 'se', gap?: number, minW?: number, minH?: number, overrideRects?: Record<string, Rect>) => Rect;
|
|
72
|
+
/**
|
|
73
|
+
* 直接把 parent 扩到“刚好 ≥ 子并集 + gap”(对称扩容)
|
|
74
|
+
* - 注意:这是“立即扩父”的版本,通常用于非交互状态下的矫正或强制收口
|
|
75
|
+
*/
|
|
76
|
+
export declare const ensureParentCoversChildrenWithGap: (shapes: Shape[], parent: Shape, updateShape: Updater, gap?: number, overrideRects?: Record<string, Rect>) => void;
|
|
77
|
+
/** 从当前父起,逐层把所有祖先都扩到“刚好 ≥ 子并集 + gap” */
|
|
78
|
+
export declare const bubbleCoverWithGapUp: (shapes: Shape[], startParentId: string | null | undefined, updateShape: Updater, gap?: number) => void;
|
|
79
|
+
/** 轻微越界容忍(px) */
|
|
80
|
+
export declare const CONTENT_EPS = 3;
|
|
81
|
+
/** 计算“最终矩形”(ghost 优先,兜底实体 bounds) */
|
|
82
|
+
export declare const finalRectOf: (ghost: Record<string, Rect>, s: Shape) => Rect;
|
|
83
|
+
/** 计算 childRect 相对 parent 内容区的“最大越界量”(>0 表示越界) */
|
|
84
|
+
export declare const overflowIn: (parent: Shape, childRect: Rect) => number;
|
|
85
|
+
/** 轻微越界 → 夹回;显著越界 → 扩父(并向上冒泡) */
|
|
86
|
+
export declare const clampOrGrowIntoParent: (parent: Shape, childRect: Rect, shapes: Shape[], updateShape: Updater, childId: string, eps?: number) => void;
|
|
87
|
+
/** 组拖辅助:该节点是否有“正在拖动”的祖先(有则禁止 reparent) */
|
|
88
|
+
export declare const hasDraggedAncestor: (shapes: Shape[], sid: string, draggingSet: Set<string>) => boolean;
|
|
89
|
+
/** 哪些图元一旦挂上父,就不允许脱离父(拖动时只能让父扩容) */
|
|
90
|
+
export declare const isStickyChild: (s: Shape) => boolean;
|
|
91
|
+
export declare const resolveParentAfterDrag: (shapes: Shape[], s: Shape, finalRect: Rect, draggingIds: string[], diagramId: string | null | undefined, updateShape: (id: string, updates: Partial<Shape>) => void, _minCoverage?: number, hoverCandidateId?: string | null, options?: {
|
|
92
|
+
/** 当发生“换父(嵌套)”时,是否只更新父子关系与位置,不立刻扩父,留给外部在接口成功后再扩父 */
|
|
93
|
+
deferExpandOnReparent?: boolean;
|
|
94
|
+
}) => boolean;
|
|
95
|
+
/**
|
|
96
|
+
* 只返回“视觉上最上面”的命中容器:
|
|
97
|
+
* - 命中条件:指针在 shape.bounds 内(不强制内容区)
|
|
98
|
+
* - 先找候选里 zIndex 的最大值,只在这个 z 层里挑一个
|
|
99
|
+
* - 同 z 打平:更深(层级大)> 内容区更小 > id 稳定
|
|
100
|
+
*/
|
|
101
|
+
export declare const pickContainerByPointerTopmost: (shapes: Shape[], pointer: {
|
|
102
|
+
x: number;
|
|
103
|
+
y: number;
|
|
104
|
+
}, draggingId: string, diagramId: string, excludeIds?: string[], boundsMargin?: number) => Shape | null;
|
|
105
|
+
export declare function hitContainerAtPoint(shapes: Shape[], pointer: {
|
|
106
|
+
x: number;
|
|
107
|
+
y: number;
|
|
108
|
+
}, diagramId: string, excludeIds?: string[]): Shape | null;
|
|
109
|
+
/**
|
|
110
|
+
* 根据某个子元素的最终矩形,自动扩容父元素,并在必要时把子元素夹回父元素内部。
|
|
111
|
+
* 注意:
|
|
112
|
+
* - 这个方法可以在拖拽逻辑之外单独调用(比如:后端嵌套接口成功后,再调用它来扩父)
|
|
113
|
+
* - 仅依赖当前 shapes + parent + childRect,不改变父子关系
|
|
114
|
+
*/
|
|
115
|
+
export declare const expandParentToFitChildBounds: (shapes: Shape[], parent: Shape, childId: string, childRect: Rect, updateShape: (id: string, updates: Partial<Shape>) => void) => {
|
|
116
|
+
expanded: boolean;
|
|
117
|
+
affectedIds: string[];
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=containers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containers.d.ts","sourceRoot":"","sources":["../../../src/utils/containers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAWrC,gBAAgB;AAChB,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAC1E,cAAc;AACd,MAAM,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;AAiBnE,gDAAgD;AAChD,eAAO,MAAM,WAAW,OAAQ,KAAK;;;;;CAmBpC,CAAA;AAED,+BAA+B;AAC/B,eAAO,MAAM,cAAc,WAAY,KAAK;;;;;CAY3C,CAAA;AAID,oCAAoC;AACpC,eAAO,MAAM,YAAY,WAAY,KAAK,EAAE,WAAW,MAAM,cAAc,MAAM,YAUhF,CAAA;AAED,mBAAmB;AACnB,eAAO,MAAM,oBAAoB,WAAY,KAAK,EA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,eACL,MAAM,EAAE,4BAEnB,KAAK,GAAG,IAuCV,CAAA;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,KAAK,EAAE,EACf,OAAO,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACjC,SAAS,EAAE,MAAM,EACjB,UAAU,GAAE,MAAM,EAAO,gBAW1B;AACD;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,WAC/B,KAAK,EAAE,UACP,KAAK,WACJ,MAAM,aACJ,IAAI,oBACG,MAAM,WAAW,QAAQ,KAAK,CAAC,KAAK,IAAI;cAC7C,OAAO;iBAAe,MAAM,EAAE;CAkH5C,CAAA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare class ContextMenuUtils {
|
|
4
|
+
private static copiedShapes;
|
|
5
|
+
private static operationType;
|
|
6
|
+
/**
|
|
7
|
+
* 处理右键菜单点击事件
|
|
8
|
+
* @param event 鼠标事件
|
|
9
|
+
* @param layerRef 图层引用
|
|
10
|
+
* @param pickTarget 命中测试函数
|
|
11
|
+
* @param shapes 图元列表
|
|
12
|
+
* @param selectShape 选中图元函数
|
|
13
|
+
* @param isDragging 是否正在拖拽
|
|
14
|
+
* @param isResizing 是否正在缩放
|
|
15
|
+
* @returns 命中的图元(如果有)
|
|
16
|
+
*/
|
|
17
|
+
static handleContextMenuClick(event: MouseEvent, layerRef: Ref<HTMLElement | null>, pickTarget: (shapes: any[], point: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
}) => {
|
|
21
|
+
kind: string;
|
|
22
|
+
shape?: any;
|
|
23
|
+
}, shapes: any[], selectShape?: (shape: any) => void, isDragging?: boolean, isResizing?: boolean, scale?: number): any | null;
|
|
24
|
+
/**
|
|
25
|
+
* 将鼠标事件坐标转换为本地坐标
|
|
26
|
+
* 注意:需要考虑画布的缩放比例
|
|
27
|
+
*/
|
|
28
|
+
static toLocalPoint(event: MouseEvent, layerRef: HTMLElement | null, scale?: number): {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* 检查点击是否在菜单外部
|
|
34
|
+
*/
|
|
35
|
+
static isClickOutsideMenu(event: MouseEvent, menuSelector?: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 计算菜单位置(避免超出屏幕边界)
|
|
38
|
+
*/
|
|
39
|
+
static calculateMenuPosition(x: number, y: number, menuWidth?: number, menuHeight?: number, safeMargin?: number): {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 处理删除操作
|
|
45
|
+
*/
|
|
46
|
+
static handleDelete(target: any): void;
|
|
47
|
+
/**
|
|
48
|
+
* 处理属性配置 (暂时不用)
|
|
49
|
+
*/
|
|
50
|
+
static handleShowPropertyPanel(target: any): void;
|
|
51
|
+
/**
|
|
52
|
+
* 处理树上高亮
|
|
53
|
+
*/
|
|
54
|
+
static handleHighlight(target: any): void;
|
|
55
|
+
/**
|
|
56
|
+
* 处理所在图表
|
|
57
|
+
*/
|
|
58
|
+
static handleLocateChart(target: any): void;
|
|
59
|
+
/**
|
|
60
|
+
* 设置复制的图元
|
|
61
|
+
*/
|
|
62
|
+
static setCopiedShapes(shapes: any[]): void;
|
|
63
|
+
/**
|
|
64
|
+
* 获取复制的图元
|
|
65
|
+
*/
|
|
66
|
+
static getCopiedShapes(): any[];
|
|
67
|
+
/**
|
|
68
|
+
* 检查剪贴板是否有内容
|
|
69
|
+
*/
|
|
70
|
+
static hasClipboardContent(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* 清空剪贴板(粘贴完成后调用)
|
|
73
|
+
*/
|
|
74
|
+
static clearClipboard(): void;
|
|
75
|
+
/**
|
|
76
|
+
* 清除剪切状态(只清除SVG遮盖层,不清除剪贴板数据)
|
|
77
|
+
* 当点击空白处时调用
|
|
78
|
+
*/
|
|
79
|
+
static clearCutState(): void;
|
|
80
|
+
/**
|
|
81
|
+
* 完全清除剪切状态和剪贴板数据
|
|
82
|
+
* 当需要完全重置时调用(如按ESC取消操作)
|
|
83
|
+
*/
|
|
84
|
+
static clearAll(): void;
|
|
85
|
+
/**
|
|
86
|
+
* 收集图元及其所有子图元的 ID
|
|
87
|
+
* @param shapes 要收集的图元数组
|
|
88
|
+
* @returns 所有图元 ID 的数组(包括子图元)
|
|
89
|
+
*/
|
|
90
|
+
private static collectShapeAndChildrenIds;
|
|
91
|
+
/**
|
|
92
|
+
* 处理复制
|
|
93
|
+
*/
|
|
94
|
+
static handleCopy(targets: any[]): void;
|
|
95
|
+
/**
|
|
96
|
+
* 处理粘贴
|
|
97
|
+
*/
|
|
98
|
+
static handlePaste(_target?: any): void;
|
|
99
|
+
/**
|
|
100
|
+
* 处理剪切
|
|
101
|
+
*/
|
|
102
|
+
static handleCut(targets: any[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* 记录日志
|
|
105
|
+
*/
|
|
106
|
+
static logSelectedShape(target: any): void;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=contextMenuUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextMenuUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/contextMenuUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAM/B,qBAAa,gBAAgB;IAE3B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAa;IAExC,OAAO,CAAC,MAAM,CAAC,aAAa,CAA0B;IAEtD;;;;;;;;;;OAUG;IACH,MAAM,CAAC,sBAAsB,CAC3B,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,EACjC,UAAU,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE;QAAE,CAAC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;IAI/B;;OAEG;IACH,MAAM,CAAC,mBAAmB,IAAI,OAAO;IAIrC;;OAEG;IACH,MAAM,CAAC,cAAc;IAUrB;;;OAGG;IACH,MAAM,CAAC,aAAa;IASpB;;;OAGG;IACH,MAAM,CAAC,QAAQ;IAaf;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAkBzC;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE;IAgBhC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG;IAyBhC;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE;IAiB/B;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG;CAGpC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 日期工具类
|
|
3
|
+
* 提供统一的日期解析、格式化和计算功能
|
|
4
|
+
*/
|
|
5
|
+
export declare class DateUtils {
|
|
6
|
+
/**
|
|
7
|
+
* 解析日期字符串为 Date 对象
|
|
8
|
+
* @param dateStr - 日期字符串,支持 ISO 格式(带 T 或空格)
|
|
9
|
+
* @returns Date 对象,解析失败返回 null
|
|
10
|
+
* @example
|
|
11
|
+
* DateUtils.parse('2024-03-05T14:30:25') // Date 对象
|
|
12
|
+
* DateUtils.parse('2024-03-05 14:30:25') // Date 对象
|
|
13
|
+
* DateUtils.parse('invalid') // null
|
|
14
|
+
*/
|
|
15
|
+
static parse(dateStr: string | null | undefined): Date | null;
|
|
16
|
+
/**
|
|
17
|
+
* 获取日期的时间戳
|
|
18
|
+
* @param dateStr - 日期字符串
|
|
19
|
+
* @returns 时间戳(毫秒),解析失败返回 null
|
|
20
|
+
* @example
|
|
21
|
+
* DateUtils.getTimestamp('2024-03-05T14:30:25') // 1709641825000
|
|
22
|
+
*/
|
|
23
|
+
static getTimestamp(dateStr: string | null | undefined): number | null;
|
|
24
|
+
/**
|
|
25
|
+
* 格式化日期为字符串
|
|
26
|
+
* @param dateStr - 日期字符串或 Date 对象
|
|
27
|
+
* @param format - 格式类型:'date' 只显示日期,'datetime' 显示日期和时间
|
|
28
|
+
* @returns 格式化后的字符串,解析失败返回原字符串
|
|
29
|
+
* @example
|
|
30
|
+
* DateUtils.format('2024-03-05T14:30:25', 'date') // '2024-03-05'
|
|
31
|
+
* DateUtils.format('2024-03-05T14:30:25', 'datetime') // '2024-03-05 14:30:25'
|
|
32
|
+
*/
|
|
33
|
+
static format(dateStr: string | Date | null | undefined, format?: 'date' | 'datetime'): string;
|
|
34
|
+
/**
|
|
35
|
+
* 格式化日期为中文格式
|
|
36
|
+
* @param dateStr - 日期字符串
|
|
37
|
+
* @returns 中文格式的日期字符串
|
|
38
|
+
* @example
|
|
39
|
+
* DateUtils.formatChinese('2024-03-05') // '2024年3月5日'
|
|
40
|
+
*/
|
|
41
|
+
static formatChinese(dateStr: string | null | undefined): string;
|
|
42
|
+
/**
|
|
43
|
+
* 数字补零(小于 10 的数字前面补 0)
|
|
44
|
+
* @param value - 数字
|
|
45
|
+
* @returns 补零后的字符串
|
|
46
|
+
* @example
|
|
47
|
+
* DateUtils.pad(5) // '05'
|
|
48
|
+
* DateUtils.pad(12) // '12'
|
|
49
|
+
*/
|
|
50
|
+
static pad(value: number): string;
|
|
51
|
+
/**
|
|
52
|
+
* 检查日期字符串是否有效
|
|
53
|
+
* @param dateStr - 日期字符串
|
|
54
|
+
* @returns 是否有效
|
|
55
|
+
* @example
|
|
56
|
+
* DateUtils.isValid('2024-03-05') // true
|
|
57
|
+
* DateUtils.isValid('invalid') // false
|
|
58
|
+
*/
|
|
59
|
+
static isValid(dateStr: string | null | undefined): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 比较两个日期的大小
|
|
62
|
+
* @param date1 - 日期1
|
|
63
|
+
* @param date2 - 日期2
|
|
64
|
+
* @returns date1 < date2 返回 -1,date1 > date2 返回 1,相等返回 0,任一无效返回 null
|
|
65
|
+
*/
|
|
66
|
+
static compare(date1: string | null | undefined, date2: string | null | undefined): number | null;
|
|
67
|
+
/**
|
|
68
|
+
* 获取日期范围(最小和最大日期)
|
|
69
|
+
* @param dates - 日期字符串数组
|
|
70
|
+
* @returns { min: Date | null, max: Date | null }
|
|
71
|
+
*/
|
|
72
|
+
static getRange(dates: (string | null | undefined)[]): {
|
|
73
|
+
min: Date | null;
|
|
74
|
+
max: Date | null;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=dateUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/dateUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,SAAS;IACpB;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI;IAW7D;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI;IAKtE;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAM,CACX,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,EACzC,MAAM,GAAE,MAAM,GAAG,UAAuB,GACvC,MAAM;IAqBT;;;;;;OAMG;IACH,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM;IAShE;;;;;;;OAOG;IACH,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIjC;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO;IAI3D;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,GAAG,IAAI;IAchB;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG;QACrD,GAAG,EAAE,IAAI,GAAG,IAAI,CAAA;QAChB,GAAG,EAAE,IAAI,GAAG,IAAI,CAAA;KACjB;CAkBF"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { Shape } from '../types';
|
|
2
|
+
|
|
3
|
+
export type HandlePos = "nw" | "ne" | "sw" | "se";
|
|
4
|
+
export declare const HANDLE_SIZE = 10;
|
|
5
|
+
export declare const SELECTION_PADDING = 6;
|
|
6
|
+
export declare const ShapeConfig: {
|
|
7
|
+
SHAPE_TYPE: string;
|
|
8
|
+
CANVAS_PADDING: number;
|
|
9
|
+
MIN_CANVAS_WIDTH: number;
|
|
10
|
+
MIN_CANVAS_HEIGHT: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const selectionBoxStyle: (shape: Shape) => {
|
|
13
|
+
position: "absolute";
|
|
14
|
+
left: string;
|
|
15
|
+
top: string;
|
|
16
|
+
width: string;
|
|
17
|
+
height: string;
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 计算手柄样式 —— 以 selection-box 内部为参照系
|
|
22
|
+
* 默认让红点“贴在 shape 四角”(即离选框边内缩 padding,且点心落在角上)
|
|
23
|
+
*/
|
|
24
|
+
export declare const handleStyle: (pos: HandlePos, shape: Shape) => {
|
|
25
|
+
position: "absolute";
|
|
26
|
+
width: string;
|
|
27
|
+
height: string;
|
|
28
|
+
backgroundColor: string;
|
|
29
|
+
border: string;
|
|
30
|
+
borderRadius: string;
|
|
31
|
+
cursor: string;
|
|
32
|
+
pointerEvents: "auto";
|
|
33
|
+
left: string;
|
|
34
|
+
top: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* 获取画布形状
|
|
38
|
+
*/
|
|
39
|
+
export declare const getCanvasShape: () => {
|
|
40
|
+
id: string;
|
|
41
|
+
diagramId: string;
|
|
42
|
+
parenShapeId: string;
|
|
43
|
+
shapeKey: string;
|
|
44
|
+
shapeType: "shape" | "edge" | "pin" | "diagram" | "gantt" | "table" | "matrix";
|
|
45
|
+
bounds: {
|
|
46
|
+
x?: number | undefined;
|
|
47
|
+
y?: number | undefined;
|
|
48
|
+
width?: number | undefined;
|
|
49
|
+
height?: number | undefined;
|
|
50
|
+
};
|
|
51
|
+
style?: {
|
|
52
|
+
fontSize?: number | undefined;
|
|
53
|
+
fontFamily?: string | undefined;
|
|
54
|
+
fontWeight?: string | undefined;
|
|
55
|
+
color?: string | undefined;
|
|
56
|
+
backgroundColor?: string | undefined;
|
|
57
|
+
borderColor?: string | undefined;
|
|
58
|
+
borderWidth?: number | undefined;
|
|
59
|
+
borderRadius?: number | undefined;
|
|
60
|
+
padding?: number | {
|
|
61
|
+
top: number;
|
|
62
|
+
right: number;
|
|
63
|
+
bottom: number;
|
|
64
|
+
left: number;
|
|
65
|
+
} | undefined;
|
|
66
|
+
margin?: number | undefined;
|
|
67
|
+
zIndex?: number | undefined;
|
|
68
|
+
canvasBorderWidth?: number | undefined;
|
|
69
|
+
canvasBorderColor?: string | undefined;
|
|
70
|
+
canvasBorderStyle?: "dashed" | "solid" | "dotted" | undefined;
|
|
71
|
+
canvasNameFontSize?: number | undefined;
|
|
72
|
+
canvasNameFontFamily?: string | undefined;
|
|
73
|
+
canvasNameFontColor?: string | undefined;
|
|
74
|
+
gradientLeftColor?: string | undefined;
|
|
75
|
+
gradientRightColor?: string | undefined;
|
|
76
|
+
textAnchor?: string | undefined;
|
|
77
|
+
dominantBaseline?: string | undefined;
|
|
78
|
+
} | undefined;
|
|
79
|
+
keywords: string;
|
|
80
|
+
keywordsBounds?: {
|
|
81
|
+
x?: number | undefined;
|
|
82
|
+
y?: number | undefined;
|
|
83
|
+
width?: number | undefined;
|
|
84
|
+
height?: number | undefined;
|
|
85
|
+
} | undefined;
|
|
86
|
+
keywordsStyle?: {
|
|
87
|
+
fontSize?: number | undefined;
|
|
88
|
+
fontFamily?: string | undefined;
|
|
89
|
+
fontWeight?: string | undefined;
|
|
90
|
+
color?: string | undefined;
|
|
91
|
+
backgroundColor?: string | undefined;
|
|
92
|
+
borderColor?: string | undefined;
|
|
93
|
+
borderWidth?: number | undefined;
|
|
94
|
+
borderRadius?: number | undefined;
|
|
95
|
+
padding?: number | {
|
|
96
|
+
top: number;
|
|
97
|
+
right: number;
|
|
98
|
+
bottom: number;
|
|
99
|
+
left: number;
|
|
100
|
+
} | undefined;
|
|
101
|
+
margin?: number | undefined;
|
|
102
|
+
zIndex?: number | undefined;
|
|
103
|
+
canvasBorderWidth?: number | undefined;
|
|
104
|
+
canvasBorderColor?: string | undefined;
|
|
105
|
+
canvasBorderStyle?: "dashed" | "solid" | "dotted" | undefined;
|
|
106
|
+
canvasNameFontSize?: number | undefined;
|
|
107
|
+
canvasNameFontFamily?: string | undefined;
|
|
108
|
+
canvasNameFontColor?: string | undefined;
|
|
109
|
+
gradientLeftColor?: string | undefined;
|
|
110
|
+
gradientRightColor?: string | undefined;
|
|
111
|
+
textAnchor?: string | undefined;
|
|
112
|
+
dominantBaseline?: string | undefined;
|
|
113
|
+
} | undefined;
|
|
114
|
+
icon?: string | undefined;
|
|
115
|
+
modelId: string;
|
|
116
|
+
modelName: string;
|
|
117
|
+
names: string;
|
|
118
|
+
name: string;
|
|
119
|
+
nameBounds?: {
|
|
120
|
+
x?: number | undefined;
|
|
121
|
+
y?: number | undefined;
|
|
122
|
+
width?: number | undefined;
|
|
123
|
+
height?: number | undefined;
|
|
124
|
+
} | undefined;
|
|
125
|
+
nameStyle?: {
|
|
126
|
+
fontSize?: number | undefined;
|
|
127
|
+
fontFamily?: string | undefined;
|
|
128
|
+
fontWeight?: string | undefined;
|
|
129
|
+
color?: string | undefined;
|
|
130
|
+
backgroundColor?: string | undefined;
|
|
131
|
+
borderColor?: string | undefined;
|
|
132
|
+
borderWidth?: number | undefined;
|
|
133
|
+
borderRadius?: number | undefined;
|
|
134
|
+
padding?: number | {
|
|
135
|
+
top: number;
|
|
136
|
+
right: number;
|
|
137
|
+
bottom: number;
|
|
138
|
+
left: number;
|
|
139
|
+
} | undefined;
|
|
140
|
+
margin?: number | undefined;
|
|
141
|
+
zIndex?: number | undefined;
|
|
142
|
+
canvasBorderWidth?: number | undefined;
|
|
143
|
+
canvasBorderColor?: string | undefined;
|
|
144
|
+
canvasBorderStyle?: "dashed" | "solid" | "dotted" | undefined;
|
|
145
|
+
canvasNameFontSize?: number | undefined;
|
|
146
|
+
canvasNameFontFamily?: string | undefined;
|
|
147
|
+
canvasNameFontColor?: string | undefined;
|
|
148
|
+
gradientLeftColor?: string | undefined;
|
|
149
|
+
gradientRightColor?: string | undefined;
|
|
150
|
+
textAnchor?: string | undefined;
|
|
151
|
+
dominantBaseline?: string | undefined;
|
|
152
|
+
} | undefined;
|
|
153
|
+
direction?: string | undefined;
|
|
154
|
+
sourceId?: string | undefined;
|
|
155
|
+
targetId?: string | undefined;
|
|
156
|
+
waypointId?: string | undefined;
|
|
157
|
+
waypoints?: {
|
|
158
|
+
x: number;
|
|
159
|
+
y: number;
|
|
160
|
+
}[] | undefined;
|
|
161
|
+
showKeywords: boolean;
|
|
162
|
+
showIcon: boolean;
|
|
163
|
+
showName: boolean;
|
|
164
|
+
showTaggedValues: boolean;
|
|
165
|
+
showComparents: boolean;
|
|
166
|
+
taggedValueLabels?: {
|
|
167
|
+
id: string;
|
|
168
|
+
modelId: string;
|
|
169
|
+
modelName: string;
|
|
170
|
+
names: string;
|
|
171
|
+
name: string;
|
|
172
|
+
nameBounds?: string | undefined;
|
|
173
|
+
nameStyle?: string | undefined;
|
|
174
|
+
}[] | undefined;
|
|
175
|
+
comparents?: {
|
|
176
|
+
bounds: {
|
|
177
|
+
x?: number | undefined;
|
|
178
|
+
y?: number | undefined;
|
|
179
|
+
width?: number | undefined;
|
|
180
|
+
height?: number | undefined;
|
|
181
|
+
};
|
|
182
|
+
modelId: string;
|
|
183
|
+
modelName: string;
|
|
184
|
+
comparentShapes: any[];
|
|
185
|
+
}[] | undefined;
|
|
186
|
+
meta?: any;
|
|
187
|
+
scenarioMenus?: {
|
|
188
|
+
[x: string]: any;
|
|
189
|
+
code: string;
|
|
190
|
+
name: string;
|
|
191
|
+
icon: string;
|
|
192
|
+
sourceModels: string[];
|
|
193
|
+
targetCreateModel: string;
|
|
194
|
+
targetModels: string[];
|
|
195
|
+
}[] | undefined;
|
|
196
|
+
inert?: boolean | undefined;
|
|
197
|
+
isCut?: boolean | undefined;
|
|
198
|
+
sourceModels?: string[] | undefined;
|
|
199
|
+
targetModels?: string[] | undefined;
|
|
200
|
+
modelTypePropertyId: string;
|
|
201
|
+
targetCreateModel?: string | undefined;
|
|
202
|
+
sourceModelId?: string | undefined;
|
|
203
|
+
isMovableComparents: boolean;
|
|
204
|
+
ganttData?: {
|
|
205
|
+
[x: string]: any;
|
|
206
|
+
id: string;
|
|
207
|
+
modelId: string;
|
|
208
|
+
ganttOrTableModelId: string;
|
|
209
|
+
projectId: string;
|
|
210
|
+
type: string;
|
|
211
|
+
sort: string;
|
|
212
|
+
}[] | undefined;
|
|
213
|
+
attributeColumns?: {
|
|
214
|
+
id?: number | undefined;
|
|
215
|
+
propertyId?: number | undefined;
|
|
216
|
+
projectId?: string | undefined;
|
|
217
|
+
modelId?: string | undefined;
|
|
218
|
+
configId: string;
|
|
219
|
+
name: string;
|
|
220
|
+
isShow: boolean;
|
|
221
|
+
isReadonly: boolean;
|
|
222
|
+
}[] | undefined;
|
|
223
|
+
ganttContainsModels?: {
|
|
224
|
+
projectId: string;
|
|
225
|
+
ownerId: string;
|
|
226
|
+
type: string;
|
|
227
|
+
name: string;
|
|
228
|
+
isChart: boolean;
|
|
229
|
+
icon: string;
|
|
230
|
+
}[] | undefined;
|
|
231
|
+
} | undefined;
|
|
232
|
+
/**
|
|
233
|
+
* 计算所有子图元的边界范围
|
|
234
|
+
* */
|
|
235
|
+
export declare const calculateShapesBounds: () => {
|
|
236
|
+
minX: number;
|
|
237
|
+
minY: number;
|
|
238
|
+
maxX: number;
|
|
239
|
+
maxY: number;
|
|
240
|
+
} | null;
|
|
241
|
+
/**
|
|
242
|
+
* 调整画布大小
|
|
243
|
+
* */
|
|
244
|
+
export declare const adjustCanvasToFitAllShapes: () => void;
|
|
245
|
+
/**
|
|
246
|
+
* 计算操作按钮的位置样式
|
|
247
|
+
*/
|
|
248
|
+
export declare const actionButtonsStyle: (shape: Shape) => Record<string, string>;
|
|
249
|
+
/**
|
|
250
|
+
* 名称虚线框容器样式 - 确保在父组件内水平居中
|
|
251
|
+
*/
|
|
252
|
+
export declare const nameTextBoxContainerStyle: (id: string) => Record<string, string>;
|
|
253
|
+
/**
|
|
254
|
+
* 名称虚线框样式 - 自适应父容器宽度
|
|
255
|
+
*/
|
|
256
|
+
export declare const nameTextBoxStyle: (shape: Shape) => Record<string, string>;
|
|
257
|
+
/**
|
|
258
|
+
* Pin 名称编辑输入框样式(放大,随字体自适应),非 Pin 返回空由 CSS 控制
|
|
259
|
+
*/
|
|
260
|
+
export declare const nameInputStyle: (shape: Shape) => Record<string, string>;
|
|
261
|
+
/**
|
|
262
|
+
* 名称编辑容器样式 - 确保在父组件内水平居中
|
|
263
|
+
*/
|
|
264
|
+
export declare const nameEditorContainerStyle: (shape: Shape) => Record<string, string>;
|
|
265
|
+
/**
|
|
266
|
+
* 计算文本所需最小宽度 - 应用于所有图形类型
|
|
267
|
+
*/
|
|
268
|
+
export declare const calculateTextMinWidth: (shape: Shape) => number;
|
|
269
|
+
/**
|
|
270
|
+
* 框选矩形的样式
|
|
271
|
+
*/
|
|
272
|
+
export declare const getMarqueeStyle: (r: {
|
|
273
|
+
x: number;
|
|
274
|
+
y: number;
|
|
275
|
+
width: number;
|
|
276
|
+
height: number;
|
|
277
|
+
}) => Record<string, string>;
|
|
278
|
+
/**
|
|
279
|
+
* 计算交互层的定位样式
|
|
280
|
+
* @param diagramBounds 画布边界
|
|
281
|
+
* @returns CSS样式对象
|
|
282
|
+
*/
|
|
283
|
+
export declare const getLayerStyle: (diagramBounds: {
|
|
284
|
+
x?: number;
|
|
285
|
+
y?: number;
|
|
286
|
+
width?: number;
|
|
287
|
+
height?: number;
|
|
288
|
+
} | undefined) => Record<string, string>;
|
|
289
|
+
//# sourceMappingURL=diagram.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagram.d.ts","sourceRoot":"","sources":["../../../src/utils/diagram.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAGnC,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAGF,eAAO,MAAM,iBAAiB,UAAW,KAAK;;;;;;;CAW7C,CAAC;AAUF;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAS,SAAS,SAAS,KAAK;;;;;;;;;;;CA8CvD,CAAC;AAQF;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAG1B,CAAC;AAEF;;KAEK;AACL,eAAO,MAAM,qBAAqB;;;;;QA4BjC,CAAC;AAEF;;KAEK;AACL,eAAO,MAAM,0BAA0B,YAgDtC,CAAC;AA6BF;;GAEG;AACH,eAAO,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