@kengic/vue 0.26.6-beta.99 → 0.26.7-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/dist/card-text-outline.6e053122.mjs +8 -0
  2. package/dist/index.css +1 -1
  3. package/dist/kengic-vue.js +52447 -51381
  4. package/dist/project/build/vite/plugin/index.ts +0 -1
  5. package/dist/src/component/KgAppSelect/index.event.d.ts +17 -0
  6. package/dist/src/component/KgAppSelect/index.hooks.d.ts +13 -11
  7. package/dist/src/component/KgAppSelect/index.store.d.ts +6 -21
  8. package/dist/src/component/KgButton/index.event.d.ts +27 -0
  9. package/dist/src/component/KgButton/index.hooks.d.ts +8 -6
  10. package/dist/src/component/KgButton/index.store.d.ts +8 -32
  11. package/dist/src/component/KgCanvas/KgCanvas.ContextMenu.d.ts +0 -3
  12. package/dist/src/component/KgCanvas/KgCanvas.d.ts +15 -0
  13. package/dist/src/component/KgCanvas/KgCanvas.service.d.ts +2 -2
  14. package/dist/src/component/KgCanvas/index.event.d.ts +213 -0
  15. package/dist/src/component/KgCanvas/index.hooks.d.ts +18 -13
  16. package/dist/src/component/KgCanvas/index.store.d.ts +0 -229
  17. package/dist/src/component/KgCanvas/index.vm.d.ts +4 -0
  18. package/dist/src/component/KgForm/index.event.d.ts +191 -0
  19. package/dist/src/component/KgForm/index.hooks.d.ts +17 -9
  20. package/dist/src/component/KgForm/index.store.d.ts +11 -177
  21. package/dist/src/component/KgForm.Item/KgForm.Item.service.d.ts +1 -1
  22. package/dist/src/component/KgForm.Item/components/KgForm.Item.Checkbox.d.ts +3 -1
  23. package/dist/src/component/KgForm.Item/components/KgForm.Item.CheckboxGroup.d.ts +3 -3
  24. package/dist/src/component/KgForm.Item/components/KgForm.Item.Date.d.ts +1 -1
  25. package/dist/src/component/KgForm.Item/components/KgForm.Item.DateRange.d.ts +1 -1
  26. package/dist/src/component/KgForm.Item/components/KgForm.Item.Input.d.ts +1 -1
  27. package/dist/src/component/KgForm.Item/components/KgForm.Item.InputNumber.d.ts +1 -1
  28. package/dist/src/component/KgForm.Item/components/KgForm.Item.InputPassword.d.ts +1 -1
  29. package/dist/src/component/KgForm.Item/components/KgForm.Item.RadioGroup.d.ts +1 -1
  30. package/dist/src/component/KgForm.Item/components/KgForm.Item.Select.d.ts +1 -1
  31. package/dist/src/component/KgForm.Item/components/KgForm.Item.Switch.d.ts +1 -1
  32. package/dist/src/component/KgForm.Item/components/KgForm.Item.TextArea.d.ts +1 -1
  33. package/dist/src/component/KgSearch/KgSearch.service.d.ts +1 -1
  34. package/dist/src/component/KgSearch/index.event.d.ts +17 -0
  35. package/dist/src/component/KgSearch/index.hooks.d.ts +6 -5
  36. package/dist/src/component/KgSearch/index.store.d.ts +14 -29
  37. package/dist/src/component/KgSubmit/KgSubmit.service.d.ts +1 -1
  38. package/dist/src/component/KgSubmit/index.event.d.ts +105 -0
  39. package/dist/src/component/KgSubmit/index.hooks.d.ts +15 -13
  40. package/dist/src/component/KgSubmit/index.store.d.ts +13 -115
  41. package/dist/src/component/KgTable/KgTable.service.d.ts +2 -2
  42. package/dist/src/component/KgTable/index.event.d.ts +57 -0
  43. package/dist/src/component/KgTable/index.hooks.d.ts +13 -12
  44. package/dist/src/component/KgTable/index.store.d.ts +10 -63
  45. package/dist/src/component/KgVar/index.event.d.ts +60 -0
  46. package/dist/src/component/KgVar/index.hooks.d.ts +31 -3
  47. package/dist/src/component/KgVar/index.store.d.ts +1 -38
  48. package/dist/src/component/KgVar/index.vm.d.ts +16 -2
  49. package/dist/src/component/KgWarehouse/index.hooks.d.ts +3 -3
  50. package/dist/src/component/KgWarehouse/index.store.d.ts +6 -6
  51. package/dist/src/config/setup/setup.d.ts +1 -1
  52. package/dist/src/const/i18n/en.d.ts +1 -1
  53. package/dist/src/const/i18n/es_ES.d.ts +1 -1
  54. package/dist/src/const/i18n/fr_FR.d.ts +1 -1
  55. package/dist/src/const/i18n/km_KH.d.ts +1 -1
  56. package/dist/src/const/i18n/ko_KR.d.ts +1 -1
  57. package/dist/src/const/i18n/vi_VN.d.ts +1 -1
  58. package/dist/src/const/i18n/zh_CN.d.ts +1 -1
  59. package/dist/src/const/index.vm.d.ts +22 -24
  60. package/dist/src/const/injection-keys.const.d.ts +2 -0
  61. package/dist/src/index.d.ts +2 -2
  62. package/dist/src/util/index.d.ts +14 -0
  63. package/dist/src/util/kg-var.util.d.ts +14 -0
  64. package/dist/src/util/kg.util.d.ts +7 -5
  65. package/package.json +5 -4
  66. package/dist/src/component/KgSearch/components/KgSearch.ConfigModal.d.ts +0 -16
  67. package/dist/src/component/KgTable/components/setting/config/KgTable.Setting.ConfigModal.d.ts +0 -16
  68. package/dist/src/component/util.d.ts +0 -14
  69. /package/dist/{close-outlined-DMcSQWxQ.67071609.mjs → close-outlined-DMcSQWxQ.51cba716.mjs} +0 -0
  70. /package/dist/{fullscreen-exit-outlined-X1iYkFc4.3aba678f.mjs → fullscreen-exit-outlined-X1iYkFc4.67367c9f.mjs} +0 -0
  71. /package/dist/{fullscreen-outlined-DDBrsRcy.c4fdcf26.mjs → fullscreen-outlined-DDBrsRcy.52a11d27.mjs} +0 -0
@@ -25,7 +25,6 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
25
25
  vue({
26
26
  template: {
27
27
  compilerOptions: {
28
- // treat all tags with a dash as custom elements
29
28
  isCustomElement: (tag) => {
30
29
  if (['kg-var-config', 'kg-work-station'].includes(tag)) {
31
30
  return true;
@@ -0,0 +1,17 @@
1
+ import { IKgEventListener } from '@kengic/core.core';
2
+ /**
3
+ * 事件类型.
4
+ * 'onGotoApp': 进入某个模块
5
+ * 'onGotoPath': 进入某个地址
6
+ */
7
+ export declare type IKgAppSelectEvent = 'onGotoApp' | 'onGotoPath';
8
+ export declare type IKgAppSelectOnGotoAppEventListenerParameter = {
9
+ app: string;
10
+ };
11
+ export declare type IKgAppSelectOnGotoAppEventListener = ((param: IKgAppSelectOnGotoAppEventListenerParameter) => Promise<boolean>) & IKgEventListener;
12
+ export declare type IKgAppSelectOnGotoPathEventListenerParameter = {
13
+ path: string;
14
+ };
15
+ export declare type IKgAppSelectOnGotoPathEventListener = ((param: IKgAppSelectOnGotoPathEventListenerParameter) => Promise<boolean>) & IKgEventListener;
16
+ export declare type IKgAppSelectEventListenerParameter = IKgAppSelectOnGotoAppEventListenerParameter | IKgAppSelectOnGotoPathEventListenerParameter;
17
+ export declare type IKgAppSelectEventListener = IKgAppSelectOnGotoAppEventListener | IKgAppSelectOnGotoPathEventListener;
@@ -1,8 +1,8 @@
1
- import { IRemoveEventListenerHandler, KG_APP, Menu } from '../../const';
2
- import { IKgAppSelectGotoAppEventListener, IKgAppSelectGotoPathEventListener, IKgAppSelectStore } from './index.store';
1
+ import { IRemoveEventListener } from '@kengic/core.core';
2
+ import { KG_APP, Menu } from '../../const';
3
+ import { IKgAppSelectOnGotoAppEventListener, IKgAppSelectOnGotoPathEventListener } from './index.event';
4
+ import { IKgAppSelectStore } from './index.store';
3
5
  export declare type IUseKgAppSelect = {
4
- /** 状态数据. */
5
- store: IKgAppSelectStore;
6
6
  /**
7
7
  * 进入某个模块.
8
8
  * @param app 要进入的模块.
@@ -14,28 +14,30 @@ export declare type IUseKgAppSelect = {
14
14
  * @param path 要进入的地址.
15
15
  */
16
16
  gotoPath(path: string): Promise<void>;
17
+ /**
18
+ * 初始化.
19
+ * 1. 需要根据当前地址设置当前模块.
20
+ */
21
+ init(): void;
17
22
  /**
18
23
  * 判断某个菜单是否属于当前模块.
19
24
  * @param menu 菜单.
20
25
  * @return {} 如果菜单属于当前模块则返回 true, 否则返回 false.
21
26
  */
22
27
  isMenuInCurrentApp(menu: Menu): boolean;
23
- /**
24
- * 初始化.
25
- * 1. 需要根据当前地址设置当前模块.
26
- */
27
- init(): void;
28
28
  /**
29
29
  * 监听事件: 进入某个模块.
30
30
  * @param listener 事件监听函数.
31
31
  * @param isOnce 是否只会触发一次. 默认为 undefined.
32
32
  */
33
- onGotoApp(listener: IKgAppSelectGotoAppEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
33
+ onGotoApp(listener: IKgAppSelectOnGotoAppEventListener, isOnce?: boolean): IRemoveEventListener;
34
34
  /**
35
35
  * 监听事件: 进入某个地址.
36
36
  * @param listener 事件监听函数.
37
37
  * @param isOnce 是否只会触发一次. 默认为 undefined.
38
38
  */
39
- onGotoPath(listener: IKgAppSelectGotoPathEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
39
+ onGotoPath(listener: IKgAppSelectOnGotoPathEventListener, isOnce?: boolean): IRemoveEventListener;
40
+ /** 状态数据. */
41
+ store: IKgAppSelectStore;
40
42
  };
41
43
  export declare function useKgAppSelect(): IUseKgAppSelect;
@@ -1,28 +1,13 @@
1
1
  import { StoreDefinition } from 'pinia';
2
- import { IKgEventListener, KG_APP, Menu } from '../../const';
3
- /**
4
- * 事件类型.
5
- * 'gotoApp': 进入某个模块
6
- * 'gotoPath': 进入某个地址
7
- */
8
- export declare type IKgAppSelectEvent = 'gotoApp' | 'gotoPath';
9
- export declare type IKgAppSelectGotoAppEventListenerParameter = {
10
- app: string;
11
- };
12
- export declare type IKgAppSelectGotoAppEventListener = ((param: IKgAppSelectGotoAppEventListenerParameter) => Promise<boolean>) & IKgEventListener;
13
- export declare type IKgAppSelectGotoPathEventListenerParameter = {
14
- path: string;
15
- };
16
- export declare type IKgAppSelectGotoPathEventListener = ((param: IKgAppSelectGotoPathEventListenerParameter) => Promise<boolean>) & IKgEventListener;
17
- export declare type IKgAppSelectEventListenerParameter = IKgAppSelectGotoAppEventListenerParameter | IKgAppSelectGotoPathEventListenerParameter;
18
- export declare type IKgAppSelectEventListener = IKgAppSelectGotoAppEventListener | IKgAppSelectGotoPathEventListener;
2
+ import { KG_APP, Menu } from '../../const';
3
+ import { IKgAppSelectEvent, IKgAppSelectEventListenerParameter, IKgAppSelectOnGotoAppEventListener, IKgAppSelectOnGotoPathEventListener } from './index.event';
19
4
  export interface IUseKgAppSelectStoreState {
20
5
  /**
21
6
  * 当前模块.
22
7
  */
23
8
  currentApp: KG_APP | null;
24
- gotoAppEventListenerMap: Map<string, Array<IKgAppSelectGotoAppEventListener>>;
25
- gotoPathEventListenerMap: Map<string, Array<IKgAppSelectGotoPathEventListener>>;
9
+ onGotoApp: Map<string, Array<IKgAppSelectOnGotoAppEventListener>>;
10
+ onGotoPath: Map<string, Array<IKgAppSelectOnGotoPathEventListener>>;
26
11
  }
27
12
  export interface IUseKgAppSelectStoreGetters {
28
13
  getCurrentApp(): KG_APP;
@@ -37,9 +22,9 @@ export interface IUseKgAppSelectStoreActions {
37
22
  /**
38
23
  * 触发事件.
39
24
  * @param event 事件名称.
40
- * @param param 参数.
25
+ * @param parameter 事件参数.
41
26
  */
42
- emit<T = IKgAppSelectEventListenerParameter>(event: IKgAppSelectEvent, param?: T | null): Promise<boolean>;
27
+ emit<T = IKgAppSelectEventListenerParameter>(event: IKgAppSelectEvent, parameter?: T | null): Promise<boolean>;
43
28
  /**
44
29
  * 进入某个模块.
45
30
  * @param app 要进入的模块.
@@ -0,0 +1,27 @@
1
+ import { IKgEventListener } from '@kengic/core.core';
2
+ import { VarButton } from '../../api/WMS/models';
3
+ /**
4
+ * 事件类型.
5
+ * 'onClick': 点击按钮
6
+ * 'onImportOk': 导入成功, 导入接口调用成功
7
+ * 'onSubmitSave': 表格内编辑时, 点击保存按钮
8
+ * 'onSubmitCancel': 表格内编辑时, 点击取消按钮
9
+ */
10
+ export declare type IKgButtonEvent = 'onClick' | 'onImportOk' | 'onSubmitSave' | 'onSubmitCancel';
11
+ export declare type IKgButtonOnClickEventListenerParameter = {
12
+ /**
13
+ * 被点击的按钮.
14
+ */
15
+ button: VarButton;
16
+ };
17
+ export declare type IKgButtonOnClickEventListener = ((param: IKgButtonOnClickEventListenerParameter) => Promise<boolean>) & IKgEventListener;
18
+ export declare type IKgButtonOnImportOkEventListenerParameter = {
19
+ button?: VarButton | null;
20
+ };
21
+ export declare type IKgButtonOnImportOkEventListener = ((param: IKgButtonOnImportOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
22
+ export declare type IKgButtonOnSubmitSaveEventListenerParameter = {};
23
+ export declare type IKgButtonOnSubmitSaveEventListener = ((param: IKgButtonOnSubmitSaveEventListenerParameter) => Promise<boolean>) & IKgEventListener;
24
+ export declare type IKgButtonOnSubmitCancelEventListenerParameter = {};
25
+ export declare type IKgButtonOnSubmitCancelEventListener = ((param: IKgButtonOnSubmitCancelEventListenerParameter) => Promise<boolean>) & IKgEventListener;
26
+ export declare type IKgButtonEventListenerParameter = IKgButtonOnClickEventListenerParameter | IKgButtonOnImportOkEventListenerParameter | IKgButtonOnSubmitSaveEventListenerParameter | IKgButtonOnSubmitCancelEventListenerParameter;
27
+ export declare type IKgButtonEventListener = IKgButtonOnClickEventListener | IKgButtonOnImportOkEventListener | IKgButtonOnSubmitSaveEventListener | IKgButtonOnSubmitCancelEventListener;
@@ -1,6 +1,8 @@
1
+ import { IRemoveEventListener } from '@kengic/core.core';
1
2
  import { ComputedRef } from 'vue';
2
- import { IRemoveEventListenerHandler, KG__VAR_BUTTON__TYPE } from '../../const';
3
- import { IKgButtonClickEventListener, IKgButtonImportOkEventListener, IKgButtonStore, IKgButtonSubmitCancelEventListener, IKgButtonSubmitSaveEventListener } from './index.store';
3
+ import { KG__VAR_BUTTON__TYPE } from '../../const';
4
+ import { IKgButtonOnClickEventListener, IKgButtonOnImportOkEventListener, IKgButtonOnSubmitCancelEventListener, IKgButtonOnSubmitSaveEventListener } from './index.event';
5
+ import { IKgButtonStore } from './index.store';
4
6
  export interface IUseKgButton {
5
7
  /**
6
8
  * <p>手动点击某个按钮.</p>
@@ -85,28 +87,28 @@ export interface IUseKgButton {
85
87
  * @param listener 事件监听函数.
86
88
  * @param isOnce 是否只会触发一次. 默认为 undefined.
87
89
  */
88
- onClick(listener: IKgButtonClickEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
90
+ onClick(listener: IKgButtonOnClickEventListener, isOnce?: boolean): IRemoveEventListener;
89
91
  /**
90
92
  * 监听事件: 导入成功, 导入接口调用成功.
91
93
  *
92
94
  * @param listener 事件监听函数.
93
95
  * @param isOnce 是否只会触发一次. 默认为 undefined.
94
96
  */
95
- onImportOk(listener: IKgButtonImportOkEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
97
+ onImportOk(listener: IKgButtonOnImportOkEventListener, isOnce?: boolean): IRemoveEventListener;
96
98
  /**
97
99
  * 监听事件: 表格内编辑时, 点击取消按钮.
98
100
  *
99
101
  * @param listener 事件监听函数.
100
102
  * @param isOnce 是否只会触发一次. 默认为 undefined.
101
103
  */
102
- onSubmitCancel(listener: IKgButtonSubmitCancelEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
104
+ onSubmitCancel(listener: IKgButtonOnSubmitCancelEventListener, isOnce?: boolean): IRemoveEventListener;
103
105
  /**
104
106
  * 监听事件: 表格内编辑时, 点击保存按钮.
105
107
  *
106
108
  * @param listener 事件监听函数.
107
109
  * @param isOnce 是否只会触发一次. 默认为 undefined.
108
110
  */
109
- onSubmitSave(listener: IKgButtonSubmitSaveEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
111
+ onSubmitSave(listener: IKgButtonOnSubmitSaveEventListener, isOnce?: boolean): IRemoveEventListener;
110
112
  /**
111
113
  * <p>「查询按钮」.</p>
112
114
  */
@@ -1,39 +1,13 @@
1
1
  import { StoreDefinition } from 'pinia';
2
2
  import { VarButton, VarButtonConfig } from '../../api/WMS/models';
3
- import { IKgEventListener, KG__VAR_BUTTON__TYPE } from '../../const';
4
- /**
5
- * 事件类型.
6
- * 'click': 点击按钮
7
- * 'importOk': 导入成功, 导入接口调用成功
8
- * 'submitSave': 表格内编辑时, 点击保存按钮
9
- * 'submitCancel': 表格内编辑时, 点击取消按钮
10
- */
11
- export declare type IKgButtonEvent = 'click' | 'importOk' | 'submitSave' | 'submitCancel';
12
- export declare type IKgButtonClickEventListenerParameter = {
13
- /**
14
- * 被点击的按钮.
15
- */
16
- button: VarButton;
17
- };
18
- export declare type IKgButtonClickEventListener = ((param: IKgButtonClickEventListenerParameter) => Promise<boolean>) & IKgEventListener;
19
- export declare type IKgButtonImportOkEventListenerParameter = {
20
- button?: VarButton | null;
21
- };
22
- export declare type IKgButtonImportOkEventListener = ((param: IKgButtonImportOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
23
- export declare type IKgButtonSubmitSaveEventListenerParameter = {};
24
- export declare type IKgButtonSubmitSaveEventListener = ((param: IKgButtonSubmitSaveEventListenerParameter) => Promise<boolean>) & IKgEventListener;
25
- export declare type IKgButtonSubmitCancelEventListenerParameter = {};
26
- export declare type IKgButtonSubmitCancelEventListener = ((param: IKgButtonSubmitCancelEventListenerParameter) => Promise<boolean>) & IKgEventListener;
27
- export declare type IKgButtonEventListenerParameter = IKgButtonClickEventListenerParameter | IKgButtonImportOkEventListenerParameter | IKgButtonSubmitSaveEventListenerParameter | IKgButtonSubmitCancelEventListenerParameter;
28
- export declare type IKgButtonEventListener = IKgButtonClickEventListener | IKgButtonImportOkEventListener | IKgButtonSubmitSaveEventListener | IKgButtonSubmitCancelEventListener;
3
+ import { KG__VAR_BUTTON__TYPE } from '../../const';
4
+ import { IKgButtonEvent, IKgButtonEventListenerParameter, IKgButtonOnClickEventListener, IKgButtonOnImportOkEventListener, IKgButtonOnSubmitCancelEventListener, IKgButtonOnSubmitSaveEventListener } from './index.event';
29
5
  export interface IUseKgButtonStoreState {
30
- clickEventListenerMap: Map<string, Array<IKgButtonClickEventListener>>;
31
6
  /**
32
7
  * <p>当前按钮.</p>
33
8
  * <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
34
9
  */
35
10
  currentButtonMap: Map<string, VarButton | null>;
36
- importOkEventListenerMap: Map<string, Array<IKgButtonImportOkEventListener>>;
37
11
  /**
38
12
  * <p>按钮的 click 事件是否被拦截.</p>
39
13
  * <p>用户调用 kgVar.kgButton.onClick(listener) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
@@ -45,8 +19,10 @@ export interface IUseKgButtonStoreState {
45
19
  * <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
46
20
  */
47
21
  isCurrentButtonRequestingMap: Map<string, boolean>;
48
- submitCancelEventListenerMap: Map<string, Array<IKgButtonSubmitCancelEventListener>>;
49
- submitSaveEventListenerMap: Map<string, Array<IKgButtonSubmitSaveEventListener>>;
22
+ onClick: Map<string, Array<IKgButtonOnClickEventListener>>;
23
+ onImport: Map<string, Array<IKgButtonOnImportOkEventListener>>;
24
+ onSubmitCancel: Map<string, Array<IKgButtonOnSubmitCancelEventListener>>;
25
+ onSubmitSave: Map<string, Array<IKgButtonOnSubmitSaveEventListener>>;
50
26
  }
51
27
  export interface IUseKgButtonStoreGetters {
52
28
  getButtonDescription(): (formID: string | null | undefined, param: {
@@ -88,9 +64,9 @@ export interface IUseKgButtonStoreActions {
88
64
  * 触发事件.
89
65
  * @param formID 界面标识.
90
66
  * @param event 事件名称.
91
- * @param param 数据.
67
+ * @param parameter 事件参数.
92
68
  */
93
- emit<T = IKgButtonEventListenerParameter>(formID: string, event: IKgButtonEvent, param: T): Promise<boolean>;
69
+ emit<T = IKgButtonEventListenerParameter>(formID: string, event: IKgButtonEvent, parameter: T): Promise<boolean>;
94
70
  /**
95
71
  * 退订事件监听.
96
72
  * @param formID 界面标识.
@@ -26,7 +26,6 @@ export declare type IKgCanvasContextMenu = {
26
26
  name?: string;
27
27
  };
28
28
  export declare const getProps: () => {
29
- eid: PropType<string>;
30
29
  kgElement: PropType<Q.Element<any>>;
31
30
  kgElementUi: PropType<Q.ElementUI>;
32
31
  /**
@@ -51,7 +50,6 @@ export declare const getProps: () => {
51
50
  };
52
51
  export declare type KgCanvasContextMenuProps = Partial<ExtractPropTypes<ReturnType<typeof getProps>>>;
53
52
  declare const _default: import("vue").DefineComponent<{
54
- eid: PropType<string>;
55
53
  kgElement: PropType<Q.Element<any>>;
56
54
  kgElementUi: PropType<Q.ElementUI>;
57
55
  /**
@@ -74,7 +72,6 @@ declare const _default: import("vue").DefineComponent<{
74
72
  kgUi: PropType<Q.BaseUI>;
75
73
  'onUpdate:kgIsVisible': PropType<(value: boolean) => void>;
76
74
  }, () => 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
- eid: PropType<string>;
78
75
  kgElement: PropType<Q.Element<any>>;
79
76
  kgElementUi: PropType<Q.ElementUI>;
80
77
  /**
@@ -1,6 +1,11 @@
1
1
  import { ExtractPropTypes, PropType } from 'vue';
2
2
  import './KgCanvas.css';
3
3
  export declare const getProps: () => {
4
+ /** 该组件实例的唯一标识. */
5
+ id: {
6
+ type: PropType<string>;
7
+ required: boolean;
8
+ };
4
9
  /**
5
10
  * 组件 KgCanvasToolbarFullscreen 的参数.
6
11
  */
@@ -51,6 +56,11 @@ export declare const getProps: () => {
51
56
  };
52
57
  export declare type KgCanvasProps = Partial<ExtractPropTypes<ReturnType<typeof getProps>>>;
53
58
  declare const _default: import("vue").DefineComponent<{
59
+ /** 该组件实例的唯一标识. */
60
+ id: {
61
+ type: PropType<string>;
62
+ required: boolean;
63
+ };
54
64
  /**
55
65
  * 组件 KgCanvasToolbarFullscreen 的参数.
56
66
  */
@@ -99,6 +109,11 @@ declare const _default: import("vue").DefineComponent<{
99
109
  default: boolean;
100
110
  };
101
111
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
112
+ /** 该组件实例的唯一标识. */
113
+ id: {
114
+ type: PropType<string>;
115
+ required: boolean;
116
+ };
102
117
  /**
103
118
  * 组件 KgCanvasToolbarFullscreen 的参数.
104
119
  */
@@ -32,12 +32,12 @@ export declare type IUseGlobalContextMenus = {
32
32
  globalContextMenus: Array<IKgCanvasContextMenu>;
33
33
  };
34
34
  export declare function _useGlobalContextMenus(param: {
35
- eid: string;
35
+ id: string | undefined;
36
36
  }): IUseGlobalContextMenus;
37
37
  export declare type IUseResizeObserver = {};
38
38
  export declare function _useResizeObserver(param: {
39
- eid: string;
40
39
  graph: () => Q.Graph | null;
40
+ id: string | undefined;
41
41
  kgCanvasContextMenuProps: Ref<KgCanvasContextMenuProps>;
42
42
  kgCanvasRef: Ref<HTMLDivElement | null>;
43
43
  }): IUseResizeObserver;
@@ -0,0 +1,213 @@
1
+ import { IKgEventListener } from '@kengic/core.core';
2
+ import { Q } from '@thymine/xunee';
3
+ import { Ref } from 'vue';
4
+ import { IKgCanvasContextMenu } from './KgCanvas.ContextMenu';
5
+ /**
6
+ * 事件类型.
7
+ * 'onInit': 图形组件初始完成
8
+ * 'onReload': 重新加载
9
+ * 'onResize': 尺寸变化
10
+ * 'onMouseMove': 鼠标移动
11
+ * 'onMouseEnter': 鼠标进入
12
+ * 'onMouseLeave': 鼠标离开
13
+ * 'onClick': 单击鼠标左键
14
+ * 'onRightClick': 单击鼠标右键
15
+ * 'onContextMenuOpen': 右键菜单打开
16
+ * 'onContextMenuClose': 右键菜单关闭
17
+ */
18
+ export declare type IKgCanvasEvent = 'onInit' | 'onReload' | 'onResize' | 'onMouseMove' | 'onMouseEnter' | 'onMouseLeave' | 'onClick' | 'onRightClick' | 'onContextMenuOpen' | 'onContextMenuClose';
19
+ export declare type IKgCanvasOnInitEventListenerParameter = {
20
+ /**
21
+ * Q.
22
+ */
23
+ Q: typeof Q;
24
+ /**
25
+ * 图形组件对象.
26
+ */
27
+ graph: Q.Graph;
28
+ };
29
+ export declare type IKgCanvasOnInitEventListener = ((param: IKgCanvasOnInitEventListenerParameter) => Promise<boolean>) & IKgEventListener;
30
+ export declare type IKgCanvasOnReloadEventListenerParameter = {
31
+ /**
32
+ * Q.
33
+ */
34
+ Q: typeof Q;
35
+ /**
36
+ * 图形组件对象.
37
+ */
38
+ graph: Q.Graph;
39
+ };
40
+ export declare type IKgCanvasOnReloadEventListener = ((param: IKgCanvasOnReloadEventListenerParameter) => Promise<boolean>) & IKgEventListener;
41
+ export declare type IKgCanvasOnResizeEventListenerParameter = {
42
+ /**
43
+ * Q.
44
+ */
45
+ Q: typeof Q;
46
+ /**
47
+ * 图形组件对象.
48
+ */
49
+ graph: Q.Graph;
50
+ /**
51
+ * 当前高度.
52
+ */
53
+ height: number;
54
+ /**
55
+ * 当前宽度.
56
+ */
57
+ width: number;
58
+ };
59
+ export declare type IKgCanvasOnResizeEventListener = ((param: IKgCanvasOnResizeEventListenerParameter) => Promise<boolean>) & IKgEventListener;
60
+ export declare type IKgCanvasOnRightClickEventListenerParameter = {
61
+ /**
62
+ * Q.
63
+ */
64
+ Q: typeof Q;
65
+ /**
66
+ * <p>右键菜单列表.</p>
67
+ * <p>用户可以直接修改该参数的值, 从而修改此次单击右键事件弹出的右键菜单.</p>
68
+ */
69
+ contextMenus: Ref<Array<IKgCanvasContextMenu>>;
70
+ /**
71
+ * 图元.
72
+ */
73
+ element?: Q.Element;
74
+ /**
75
+ * 图元组件.
76
+ */
77
+ elementUI?: Q.ElementUI;
78
+ /**
79
+ * 鼠标事件.
80
+ */
81
+ event: MouseEvent;
82
+ /**
83
+ * 图形组件对象.
84
+ */
85
+ graph: Q.Graph;
86
+ /**
87
+ * 图元组件.
88
+ */
89
+ ui?: Q.BaseUI;
90
+ };
91
+ export declare type IKgCanvasOnRightClickEventListener = ((param: IKgCanvasOnRightClickEventListenerParameter) => Promise<boolean>) & IKgEventListener;
92
+ export declare type IKgCanvasOnMouseMoveEventListenerParameter = {
93
+ /**
94
+ * Q.
95
+ */
96
+ Q: typeof Q;
97
+ /**
98
+ * 图元.
99
+ */
100
+ element?: Q.Element;
101
+ /**
102
+ * 图元组件.
103
+ */
104
+ elementUI?: Q.ElementUI;
105
+ /**
106
+ * 图形组件对象.
107
+ */
108
+ graph: Q.Graph;
109
+ /**
110
+ * 图元组件.
111
+ */
112
+ ui?: Q.BaseUI;
113
+ };
114
+ export declare type IKgCanvasOnMouseMoveEventListener = ((param: IKgCanvasOnMouseMoveEventListenerParameter) => Promise<boolean>) & IKgEventListener;
115
+ export declare type IKgCanvasOnMouseLeaveEventListenerParameter = {
116
+ /**
117
+ * Q.
118
+ */
119
+ Q: typeof Q;
120
+ /**
121
+ * 图元.
122
+ */
123
+ element?: Q.Element;
124
+ /**
125
+ * 图元组件.
126
+ */
127
+ elementUI?: Q.ElementUI;
128
+ /**
129
+ * 图形组件对象.
130
+ */
131
+ graph: Q.Graph;
132
+ /**
133
+ * 图元组件.
134
+ */
135
+ ui?: Q.BaseUI;
136
+ };
137
+ export declare type IKgCanvasOnMouseLeaveEventListener = ((param: IKgCanvasOnMouseLeaveEventListenerParameter) => Promise<boolean>) & IKgEventListener;
138
+ export declare type IKgCanvasOnMouseEnterEventListenerParameter = {
139
+ /**
140
+ * Q.
141
+ */
142
+ Q: typeof Q;
143
+ /**
144
+ * 图元.
145
+ */
146
+ element?: Q.Element;
147
+ /**
148
+ * 图元组件.
149
+ */
150
+ elementUI?: Q.ElementUI;
151
+ /**
152
+ * 图形组件对象.
153
+ */
154
+ graph: Q.Graph;
155
+ /**
156
+ * 图元组件.
157
+ */
158
+ ui?: Q.BaseUI;
159
+ };
160
+ export declare type IKgCanvasOnMouseEnterEventListener = ((param: IKgCanvasOnMouseEnterEventListenerParameter) => Promise<boolean>) & IKgEventListener;
161
+ export declare type IKgCanvasOnClickEventListenerParameter = {
162
+ /**
163
+ * Q.
164
+ */
165
+ Q: typeof Q;
166
+ /**
167
+ * 图元.
168
+ */
169
+ element?: Q.Element;
170
+ /**
171
+ * 图元组件.
172
+ */
173
+ elementUI?: Q.ElementUI;
174
+ /**
175
+ * 图形组件对象.
176
+ */
177
+ graph: Q.Graph;
178
+ /**
179
+ * 图元组件.
180
+ */
181
+ ui?: Q.BaseUI;
182
+ };
183
+ export declare type IKgCanvasOnClickEventListener = ((param: IKgCanvasOnClickEventListenerParameter) => Promise<boolean>) & IKgEventListener;
184
+ export declare type IKgCanvasOnContextMenuOpenEventListenerParameter = {};
185
+ export declare type IKgCanvasOnContextMenuOpenEventListener = ((param: IKgCanvasOnContextMenuOpenEventListenerParameter) => Promise<boolean>) & IKgEventListener;
186
+ export declare type IKgCanvasOnContextMenuCloseEventListenerParameter = {};
187
+ export declare type IKgCanvasOnContextMenuCloseEventListener = ((param: IKgCanvasOnContextMenuCloseEventListenerParameter) => Promise<boolean>) & IKgEventListener;
188
+ export declare type IKgCanvasEventListenerParameter = IKgCanvasOnInitEventListenerParameter | IKgCanvasOnReloadEventListenerParameter | IKgCanvasOnResizeEventListenerParameter | IKgCanvasOnRightClickEventListenerParameter | IKgCanvasOnMouseMoveEventListenerParameter | IKgCanvasOnMouseEnterEventListenerParameter | IKgCanvasOnMouseLeaveEventListenerParameter | IKgCanvasOnClickEventListenerParameter | IKgCanvasOnContextMenuOpenEventListenerParameter | IKgCanvasOnContextMenuCloseEventListenerParameter;
189
+ export declare type IKgCanvasEventListener = IKgCanvasOnInitEventListener | IKgCanvasOnReloadEventListener | IKgCanvasOnResizeEventListener | IKgCanvasOnRightClickEventListener | IKgCanvasOnMouseMoveEventListener | IKgCanvasOnMouseEnterEventListener | IKgCanvasOnMouseLeaveEventListener | IKgCanvasOnClickEventListener | IKgCanvasOnContextMenuOpenEventListener | IKgCanvasOnContextMenuCloseEventListener;
190
+ export declare const eventListenerListRecordRecord: Record<string, {
191
+ onClick: Array<IKgCanvasOnClickEventListener>;
192
+ onContextMenuClose: Array<IKgCanvasOnContextMenuCloseEventListener>;
193
+ onContextMenuOpen: Array<IKgCanvasOnContextMenuOpenEventListener>;
194
+ onInit: Array<IKgCanvasOnInitEventListener>;
195
+ onMouseEnter: Array<IKgCanvasOnMouseEnterEventListener>;
196
+ onMouseLeave: Array<IKgCanvasOnMouseLeaveEventListener>;
197
+ onMouseMove: Array<IKgCanvasOnMouseMoveEventListener>;
198
+ onReload: Array<IKgCanvasOnReloadEventListener>;
199
+ onResize: Array<IKgCanvasOnResizeEventListener>;
200
+ onRightClick: Array<IKgCanvasOnRightClickEventListener>;
201
+ }>;
202
+ /**
203
+ * 触发事件.
204
+ *
205
+ * @param param.event 事件名称.
206
+ * @param param.id 唯一标识.
207
+ * @param param.parameter 事件参数.
208
+ */
209
+ export declare function emit<P extends IKgCanvasEventListenerParameter>(param: {
210
+ event: IKgCanvasEvent;
211
+ id?: string | undefined;
212
+ parameter: P;
213
+ }): Promise<boolean>;
@@ -1,67 +1,72 @@
1
- import { IRemoveEventListenerHandler } from '../../const';
2
- import { IKgCanvasOnClickEventListener, IKgCanvasOnContextMenuCloseEventListener, IKgCanvasOnContextMenuOpenEventListener, IKgCanvasOnInitEventListener, IKgCanvasOnMouseEnterEventListener, IKgCanvasOnMouseLeaveEventListener, IKgCanvasOnMouseMoveEventListener, IKgCanvasOnReloadEventListener, IKgCanvasOnResizeEventListener, IKgCanvasOnRightClickEventListener, IKgCanvasStore } from './index.store';
1
+ import { IRemoveEventListener } from '@kengic/core.core';
2
+ import { IKgCanvasOnClickEventListener, IKgCanvasOnContextMenuCloseEventListener, IKgCanvasOnContextMenuOpenEventListener, IKgCanvasOnInitEventListener, IKgCanvasOnMouseEnterEventListener, IKgCanvasOnMouseLeaveEventListener, IKgCanvasOnMouseMoveEventListener, IKgCanvasOnReloadEventListener, IKgCanvasOnResizeEventListener, IKgCanvasOnRightClickEventListener } from './index.event';
3
+ import { IKgCanvasStore } from './index.store';
3
4
  export declare type IUseKgCanvas = {
4
5
  /**
5
6
  * 监听事件: 单击鼠标左键.
6
7
  * @param listener 事件监听函数.
7
8
  * @param isOnce 是否只会触发一次. 默认为 undefined.
8
9
  */
9
- onClick(listener: IKgCanvasOnClickEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
10
+ onClick(listener: IKgCanvasOnClickEventListener, isOnce?: boolean): IRemoveEventListener;
10
11
  /**
11
12
  * 监听事件: 右键菜单关闭.
12
13
  * @param listener 事件监听函数.
13
14
  * @param isOnce 是否只会触发一次. 默认为 undefined.
14
15
  */
15
- onContextMenuClose(listener: IKgCanvasOnContextMenuCloseEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
16
+ onContextMenuClose(listener: IKgCanvasOnContextMenuCloseEventListener, isOnce?: boolean): IRemoveEventListener;
16
17
  /**
17
18
  * 监听事件: 右键菜单打开.
18
19
  * @param listener 事件监听函数.
19
20
  * @param isOnce 是否只会触发一次. 默认为 undefined.
20
21
  */
21
- onContextMenuOpen(listener: IKgCanvasOnContextMenuOpenEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
22
+ onContextMenuOpen(listener: IKgCanvasOnContextMenuOpenEventListener, isOnce?: boolean): IRemoveEventListener;
22
23
  /**
23
24
  * 监听事件: 图形组件初始完成.
24
25
  * @param listener 事件监听函数.
25
26
  * @param isOnce 是否只会触发一次. 默认为 undefined.
26
27
  */
27
- onInit(listener: IKgCanvasOnInitEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
28
+ onInit(listener: IKgCanvasOnInitEventListener, isOnce?: boolean): IRemoveEventListener;
28
29
  /**
29
30
  * 监听事件: 鼠标进入.
30
31
  * @param listener 事件监听函数.
31
32
  * @param isOnce 是否只会触发一次. 默认为 undefined.
32
33
  */
33
- onMouseEnter(listener: IKgCanvasOnMouseEnterEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
34
+ onMouseEnter(listener: IKgCanvasOnMouseEnterEventListener, isOnce?: boolean): IRemoveEventListener;
34
35
  /**
35
36
  * 监听事件: 鼠标离开.
36
37
  * @param listener 事件监听函数.
37
38
  * @param isOnce 是否只会触发一次. 默认为 undefined.
38
39
  */
39
- onMouseLeave(listener: IKgCanvasOnMouseLeaveEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
40
+ onMouseLeave(listener: IKgCanvasOnMouseLeaveEventListener, isOnce?: boolean): IRemoveEventListener;
40
41
  /**
41
42
  * 监听事件: 鼠标移动.
42
43
  * @param listener 事件监听函数.
43
44
  * @param isOnce 是否只会触发一次. 默认为 undefined.
44
45
  */
45
- onMouseMove(listener: IKgCanvasOnMouseMoveEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
46
+ onMouseMove(listener: IKgCanvasOnMouseMoveEventListener, isOnce?: boolean): IRemoveEventListener;
46
47
  /**
47
48
  * 监听事件: 重新加载.
48
49
  * @param listener 事件监听函数.
49
50
  * @param isOnce 是否只会触发一次. 默认为 undefined.
50
51
  */
51
- onReload(listener: IKgCanvasOnReloadEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
52
+ onReload(listener: IKgCanvasOnReloadEventListener, isOnce?: boolean): IRemoveEventListener;
52
53
  /**
53
54
  * 监听事件: 尺寸变化.
54
55
  * @param listener 事件监听函数.
55
56
  * @param isOnce 是否只会触发一次. 默认为 undefined.
56
57
  */
57
- onResize(listener: IKgCanvasOnResizeEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
58
+ onResize(listener: IKgCanvasOnResizeEventListener, isOnce?: boolean): IRemoveEventListener;
58
59
  /**
59
60
  * 监听事件: 单击鼠标右键.
60
61
  * @param listener 事件监听函数.
61
62
  * @param isOnce 是否只会触发一次. 默认为 undefined.
62
63
  */
63
- onRightClick(listener: IKgCanvasOnRightClickEventListener, isOnce?: boolean): IRemoveEventListenerHandler;
64
+ onRightClick(listener: IKgCanvasOnRightClickEventListener, isOnce?: boolean): IRemoveEventListener;
64
65
  /** 状态数据. */
65
66
  store: IKgCanvasStore;
66
67
  };
67
- export declare function useKgCanvas(): IUseKgCanvas;
68
+ /**
69
+ *
70
+ * @param id 唯一标识.
71
+ */
72
+ export declare function useKgCanvas(id: string): IUseKgCanvas;