@kengic/vue 0.26.5-beta.6 → 0.26.5-beta.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/fit-screen-outline.7341560f.mjs +8 -0
- package/dist/index.css +1 -1
- package/dist/kengic-vue.js +2801 -2615
- package/dist/one-to-one-outlined.4f97e62a.mjs +8 -0
- package/dist/reload-outlined.abae07b1.mjs +8 -0
- package/dist/src/components/KgCanvas/KgCanvas.ContextMenu.d.ts +104 -0
- package/dist/src/components/KgCanvas/KgCanvas.service.d.ts +12 -1
- package/dist/src/components/KgCanvas/index.d.ts +1 -0
- package/dist/src/components/KgCanvas/index.hooks.d.ts +14 -2
- package/dist/src/components/KgCanvas/index.store.d.ts +50 -6
- package/package.json +3 -3
@@ -0,0 +1,8 @@
|
|
1
|
+
const c = {
|
2
|
+
width: 1024,
|
3
|
+
height: 1024,
|
4
|
+
body: '<path fill="currentColor" d="M316 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8zm196-50c22.1 0 40-17.9 40-39c0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39zm0-140c22.1 0 40-17.9 40-39c0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39z"/><path fill="currentColor" d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"/><path fill="currentColor" d="M648 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8z"/>'
|
5
|
+
};
|
6
|
+
export {
|
7
|
+
c as default
|
8
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
const c = {
|
2
|
+
width: 1024,
|
3
|
+
height: 1024,
|
4
|
+
body: '<path fill="currentColor" d="m909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92C290 92 102.3 279.5 102 511.5C101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1c1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 0 0-10.1 4.8c-1.8 5-3.8 10-5.9 14.9c-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 0 1 655.9 829c-42.3 17.9-87.4 27-133.8 27c-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 0 1 279 755.2a342.16 342.16 0 0 1-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4c31.6-31.6 68.4-56.4 109.3-73.8c42.3-17.9 87.4-27 133.8-27c46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 0 1 109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 0 0 3 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"/>'
|
5
|
+
};
|
6
|
+
export {
|
7
|
+
c as default
|
8
|
+
};
|
@@ -0,0 +1,104 @@
|
|
1
|
+
import { Q } from '@thymine/xunee';
|
2
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
3
|
+
import './KgCanvas.css';
|
4
|
+
/**
|
5
|
+
* 菜单属性.
|
6
|
+
*/
|
7
|
+
export declare type IKgCanvasContextMenu = {
|
8
|
+
/** 菜单编码. */
|
9
|
+
code?: string;
|
10
|
+
/** 菜单回调方法. */
|
11
|
+
handler?: (param: {
|
12
|
+
graph: Q.Graph;
|
13
|
+
element?: Q.Element;
|
14
|
+
elementUI?: Q.ElementUI;
|
15
|
+
ui?: Q.BaseUI;
|
16
|
+
}) => void;
|
17
|
+
/** 菜单图标. */
|
18
|
+
icon?: string;
|
19
|
+
/** 是否禁用. */
|
20
|
+
isDisabled?: boolean;
|
21
|
+
/** 是否是分割线. */
|
22
|
+
isDivider?: boolean;
|
23
|
+
/**
|
24
|
+
* 菜单标题.
|
25
|
+
*/
|
26
|
+
name?: string;
|
27
|
+
};
|
28
|
+
export declare const getProps: () => {
|
29
|
+
kgElement: PropType<Q.Element<any>>;
|
30
|
+
kgElementUI: PropType<Q.ElementUI>;
|
31
|
+
kgGraph: PropType<Q.Graph>;
|
32
|
+
/**
|
33
|
+
* 是否显示.
|
34
|
+
*
|
35
|
+
* @default false
|
36
|
+
*/
|
37
|
+
kgIsVisible: {
|
38
|
+
type: PropType<boolean>;
|
39
|
+
default: boolean;
|
40
|
+
};
|
41
|
+
/**
|
42
|
+
* 菜单.
|
43
|
+
*/
|
44
|
+
kgMenus: PropType<IKgCanvasContextMenu[]>;
|
45
|
+
/**
|
46
|
+
* 鼠标右键点击事件对象.
|
47
|
+
*/
|
48
|
+
kgMouseEvent: PropType<MouseEvent>;
|
49
|
+
kgUi: PropType<Q.BaseUI>;
|
50
|
+
'onUpdate:kgIsVisible': PropType<(value: boolean) => void>;
|
51
|
+
};
|
52
|
+
export declare type KgCanvasContextMenuProps = Partial<ExtractPropTypes<ReturnType<typeof getProps>>>;
|
53
|
+
declare const _default: import("vue").DefineComponent<{
|
54
|
+
kgElement: PropType<Q.Element<any>>;
|
55
|
+
kgElementUI: PropType<Q.ElementUI>;
|
56
|
+
kgGraph: PropType<Q.Graph>;
|
57
|
+
/**
|
58
|
+
* 是否显示.
|
59
|
+
*
|
60
|
+
* @default false
|
61
|
+
*/
|
62
|
+
kgIsVisible: {
|
63
|
+
type: PropType<boolean>;
|
64
|
+
default: boolean;
|
65
|
+
};
|
66
|
+
/**
|
67
|
+
* 菜单.
|
68
|
+
*/
|
69
|
+
kgMenus: PropType<IKgCanvasContextMenu[]>;
|
70
|
+
/**
|
71
|
+
* 鼠标右键点击事件对象.
|
72
|
+
*/
|
73
|
+
kgMouseEvent: PropType<MouseEvent>;
|
74
|
+
kgUi: PropType<Q.BaseUI>;
|
75
|
+
'onUpdate:kgIsVisible': PropType<(value: boolean) => void>;
|
76
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:kgIsVisible"[], "update:kgIsVisible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
77
|
+
kgElement: PropType<Q.Element<any>>;
|
78
|
+
kgElementUI: PropType<Q.ElementUI>;
|
79
|
+
kgGraph: PropType<Q.Graph>;
|
80
|
+
/**
|
81
|
+
* 是否显示.
|
82
|
+
*
|
83
|
+
* @default false
|
84
|
+
*/
|
85
|
+
kgIsVisible: {
|
86
|
+
type: PropType<boolean>;
|
87
|
+
default: boolean;
|
88
|
+
};
|
89
|
+
/**
|
90
|
+
* 菜单.
|
91
|
+
*/
|
92
|
+
kgMenus: PropType<IKgCanvasContextMenu[]>;
|
93
|
+
/**
|
94
|
+
* 鼠标右键点击事件对象.
|
95
|
+
*/
|
96
|
+
kgMouseEvent: PropType<MouseEvent>;
|
97
|
+
kgUi: PropType<Q.BaseUI>;
|
98
|
+
'onUpdate:kgIsVisible': PropType<(value: boolean) => void>;
|
99
|
+
}>> & {
|
100
|
+
"onUpdate:kgIsVisible"?: ((...args: any[]) => any) | undefined;
|
101
|
+
}, {
|
102
|
+
kgIsVisible: boolean;
|
103
|
+
}>;
|
104
|
+
export default _default;
|
@@ -1,4 +1,15 @@
|
|
1
1
|
import { Q } from '@thymine/xunee';
|
2
2
|
import { Ref } from 'vue';
|
3
|
+
import { IKgCanvasContextMenu, KgCanvasContextMenuProps } from './KgCanvas.ContextMenu';
|
4
|
+
export declare type IUseGlobalContextMenus = {
|
5
|
+
globalContextMenus: Array<IKgCanvasContextMenu>;
|
6
|
+
};
|
7
|
+
export declare function _useGlobalContextMenus(param: {
|
8
|
+
eid: string;
|
9
|
+
}): IUseGlobalContextMenus;
|
3
10
|
export declare type IUseResizeObserver = {};
|
4
|
-
export declare function _useResizeObserver(
|
11
|
+
export declare function _useResizeObserver(param: {
|
12
|
+
graph: () => Q.Graph | null;
|
13
|
+
kgCanvasContextMenuProps: Ref<KgCanvasContextMenuProps>;
|
14
|
+
kgCanvasRef: Ref<HTMLDivElement | null>;
|
15
|
+
}): IUseResizeObserver;
|
@@ -1,12 +1,24 @@
|
|
1
1
|
import { IRemoveEventListenerHandler } from '../../consts';
|
2
|
-
import { IKgCanvasOnInitEventListener, IKgCanvasStore } from './index.store';
|
2
|
+
import { IKgCanvasOnInitEventListener, IKgCanvasOnReloadEventListener, IKgCanvasOnRightClickEventListener, IKgCanvasStore } from './index.store';
|
3
3
|
export declare type IUseKgCanvas = {
|
4
4
|
/**
|
5
|
-
* 监听事件:
|
5
|
+
* 监听事件: 图形组件初始完成.
|
6
6
|
* @param listener 事件监听函数.
|
7
7
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
8
8
|
*/
|
9
9
|
onInit(listener: IKgCanvasOnInitEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
|
10
|
+
/**
|
11
|
+
* 监听事件: 重新加载.
|
12
|
+
* @param listener 事件监听函数.
|
13
|
+
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
14
|
+
*/
|
15
|
+
onReload(listener: IKgCanvasOnReloadEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
|
16
|
+
/**
|
17
|
+
* 监听事件: 单击右键.
|
18
|
+
* @param listener 事件监听函数.
|
19
|
+
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
20
|
+
*/
|
21
|
+
onRightClick(listener: IKgCanvasOnRightClickEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
|
10
22
|
/** 状态数据. */
|
11
23
|
store: IKgCanvasStore;
|
12
24
|
};
|
@@ -1,30 +1,74 @@
|
|
1
1
|
import { Q } from '@thymine/xunee';
|
2
2
|
import { StoreDefinition } from 'pinia';
|
3
|
+
import { Ref } from 'vue';
|
3
4
|
import { IKgEventListener } from '../../consts';
|
5
|
+
import { type IKgCanvasContextMenu } from './KgCanvas.ContextMenu';
|
4
6
|
/**
|
5
7
|
* 事件类型.
|
6
|
-
* 'onInit':
|
8
|
+
* 'onInit': 图形组件初始完成
|
9
|
+
* 'onRightClick': 单击右键
|
10
|
+
* 'onReload': 重新加载
|
7
11
|
*/
|
8
|
-
export declare type IKgCanvasEvent = 'onInit';
|
12
|
+
export declare type IKgCanvasEvent = 'onInit' | 'onRightClick' | 'onReload';
|
9
13
|
export declare type IKgCanvasOnInitEventListenerParameter = {
|
10
14
|
/**
|
11
15
|
* Q.
|
12
16
|
*/
|
13
17
|
Q: typeof Q;
|
14
18
|
/**
|
15
|
-
*
|
19
|
+
* 图形组件对象.
|
20
|
+
*/
|
21
|
+
graph: Q.Graph;
|
22
|
+
eid: string;
|
23
|
+
};
|
24
|
+
export declare type IKgCanvasOnInitEventListener = ((param: IKgCanvasOnInitEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
25
|
+
export declare type IKgCanvasOnRightClickEventListenerParameter = {
|
26
|
+
/**
|
27
|
+
* Q.
|
28
|
+
*/
|
29
|
+
Q: typeof Q;
|
30
|
+
/**
|
31
|
+
* <p>右键菜单列表.</p>
|
32
|
+
* <p>用户可以直接修改该参数的值, 从而修改此次单击右键事件弹出的右键菜单.</p>
|
33
|
+
*/
|
34
|
+
contextMenus: Ref<Array<IKgCanvasContextMenu>>;
|
35
|
+
eid: string;
|
36
|
+
/**
|
37
|
+
* 被右键单击的图元.
|
16
38
|
*/
|
39
|
+
element?: Q.Element;
|
40
|
+
/**
|
41
|
+
* 被右键单击的图元组件.
|
42
|
+
*/
|
43
|
+
elementUI?: Q.ElementUI;
|
44
|
+
/**
|
45
|
+
* 图形组件对象.
|
46
|
+
*/
|
47
|
+
graph: Q.Graph;
|
48
|
+
/**
|
49
|
+
* 被右键单击的图元组件.
|
50
|
+
*/
|
51
|
+
ui?: Q.BaseUI;
|
52
|
+
};
|
53
|
+
export declare type IKgCanvasOnRightClickEventListener = ((param: IKgCanvasOnRightClickEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
54
|
+
export declare type IKgCanvasOnReloadEventListenerParameter = {
|
55
|
+
/**
|
56
|
+
* Q.
|
57
|
+
*/
|
58
|
+
Q: typeof Q;
|
17
59
|
eid: string;
|
18
60
|
/**
|
19
61
|
* 图形组件对象.
|
20
62
|
*/
|
21
63
|
graph: Q.Graph;
|
22
64
|
};
|
23
|
-
export declare type
|
24
|
-
export declare type IKgCanvasEventListenerParameter = IKgCanvasOnInitEventListenerParameter;
|
25
|
-
export declare type IKgCanvasEventListener = IKgCanvasOnInitEventListener;
|
65
|
+
export declare type IKgCanvasOnReloadEventListener = ((param: IKgCanvasOnReloadEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
66
|
+
export declare type IKgCanvasEventListenerParameter = IKgCanvasOnInitEventListenerParameter | IKgCanvasOnRightClickEventListenerParameter | IKgCanvasOnReloadEventListenerParameter;
|
67
|
+
export declare type IKgCanvasEventListener = IKgCanvasOnInitEventListener | IKgCanvasOnRightClickEventListener | IKgCanvasOnReloadEventListener;
|
26
68
|
export interface IUseKgCanvasStoreState {
|
27
69
|
onInitEventListenerMap: Map<string, Array<IKgCanvasOnInitEventListener>>;
|
70
|
+
onReloadEventListenerMap: Map<string, Array<IKgCanvasOnReloadEventListener>>;
|
71
|
+
onRightClickEventListenerMap: Map<string, Array<IKgCanvasOnRightClickEventListener>>;
|
28
72
|
}
|
29
73
|
export interface IUseKgCanvasStoreGetters {
|
30
74
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@kengic/vue",
|
3
|
-
"version": "0.26.5-beta.
|
3
|
+
"version": "0.26.5-beta.7",
|
4
4
|
"scripts": {
|
5
5
|
"build": "npm run switch-node-version && rimraf dist && vue-tsc && vite build",
|
6
6
|
"build:dev": "npm run switch-node-version && rimraf dist && vue-tsc && vite build --mode development",
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"@iconify-icons/mdi": "1.2.48",
|
41
41
|
"@iconify-icons/ph": "1.2.5",
|
42
42
|
"@iconify/vue": "4.1.1",
|
43
|
-
"@kengic/pont": "1.2.
|
43
|
+
"@kengic/pont": "1.2.17-beta.0",
|
44
44
|
"@rys-fe/vite-plugin-theme": "0.8.6",
|
45
45
|
"@thymine/xunee": "0.4.9-beta.3",
|
46
46
|
"@types/crypto-js": "4.1.1",
|
@@ -70,7 +70,7 @@
|
|
70
70
|
"lodash-es": "4.17.21",
|
71
71
|
"picocolors": "1.0.0",
|
72
72
|
"pinia": "2.0.12",
|
73
|
-
"prettier": "3.
|
73
|
+
"prettier": "3.3.3",
|
74
74
|
"rimraf": "3.0.2",
|
75
75
|
"rollup": "2.79.1",
|
76
76
|
"rollup-plugin-visualizer": "5.8.3",
|