@kengic/vue 0.22.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/CHANGELOG.md +178 -139
  2. package/dist/index.css +1 -1
  3. package/dist/kengic-vue.js +4201 -3969
  4. package/dist/project/build/script/postBuild.ts +1 -1
  5. package/dist/src/apis/WMS/Controllers/DescriptionController/ListByCodeNamesAndCodeValues.d.ts +16 -0
  6. package/dist/src/apis/WMS/Controllers/DescriptionController/index.d.ts +1 -0
  7. package/dist/src/apis/WMS/models.d.ts +8 -0
  8. package/dist/src/components/KgButton/index.hooks.d.ts +74 -199
  9. package/dist/src/components/KgButton/index.store.d.ts +48 -184
  10. package/dist/src/components/KgForm/index.hooks.d.ts +22 -28
  11. package/dist/src/components/KgForm/index.store.d.ts +22 -15
  12. package/dist/src/components/KgForm.Item/components/KgForm.Item.CheckboxGroup.d.ts +2 -0
  13. package/dist/src/components/KgForm.Item/components/KgForm.Item.RadioGroup.d.ts +0 -2
  14. package/dist/src/components/KgForm.Item/components/KgForm.Item.Select.d.ts +2 -4
  15. package/dist/src/components/KgSearch/index.hooks.d.ts +31 -136
  16. package/dist/src/components/KgSearch/index.store.d.ts +59 -175
  17. package/dist/src/components/KgSubmit/index.hooks.d.ts +80 -279
  18. package/dist/src/components/KgSubmit/index.store.d.ts +40 -225
  19. package/dist/src/components/KgTable/{KgTable.hooks.d.ts → KgTable.service.d.ts} +8 -16
  20. package/dist/src/components/KgTable/components/setting/KgTable.Setting.d.ts +0 -1
  21. package/dist/src/components/KgTable/components/setting/config/KgTable.Setting.ConfigModal.d.ts +0 -2
  22. package/dist/src/components/KgTable/index.hooks.d.ts +65 -428
  23. package/dist/src/components/KgTable/index.store.d.ts +87 -621
  24. package/dist/src/components/KgVar/index.hooks.d.ts +105 -3622
  25. package/dist/src/components/KgVar/index.store.d.ts +129 -3213
  26. package/dist/src/config/index.hooks.d.ts +31 -38
  27. package/dist/src/config/index.store.d.ts +74 -52
  28. package/dist/src/consts/i18n/en.d.ts +1 -0
  29. package/dist/src/consts/i18n/zh_CN.d.ts +1 -0
  30. package/dist/src/consts/index.d.ts +20 -13
  31. package/dist/src/consts/index.vm.d.ts +78 -51
  32. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.store.d.ts +1 -1
  33. package/dist/src/utils/kg-route.util.d.ts +3 -2
  34. package/dist/src/utils/kg.util.d.ts +2 -2
  35. package/package.json +1 -1
  36. /package/dist/src/components/KgForm.Item/{KgForm.Item.hooks.d.ts → KgForm.Item.service.d.ts} +0 -0
  37. /package/dist/src/components/KgForm.Item/components/{KgForm.Item.Select.hooks.d.ts → KgForm.Item.Select.service.d.ts} +0 -0
  38. /package/dist/src/components/KgModal/{KgModal.hooks.d.ts → KgModal.service.d.ts} +0 -0
  39. /package/dist/src/components/KgSearch/{KgSearch.hooks.d.ts → KgSearch.service.d.ts} +0 -0
  40. /package/dist/src/components/KgSubmit/{KgSubmit.hooks.d.ts → KgSubmit.service.d.ts} +0 -0
  41. /package/dist/src/components/KgTable/components/setting/{KgTable.Setting.hooks.d.ts → KgTable.Setting.service.d.ts} +0 -0
@@ -1,3 +1,4 @@
1
+ import { StoreDefinition } from 'pinia';
1
2
  import { VarButton } from '../../apis/WMS/models';
2
3
  import { IKgEventCb, KG_BUTTON_TYPE } from '../../consts';
3
4
  /**
@@ -9,197 +10,56 @@ import { IKgEventCb, KG_BUTTON_TYPE } from '../../consts';
9
10
  */
10
11
  export declare type IKgButtonEvent = 'click' | 'importOk' | 'submitSave' | 'submitCancel';
11
12
  export declare type IKgButtonClickCbParam = {
13
+ /**
14
+ * 被点击的按钮.
15
+ */
12
16
  button: VarButton;
13
17
  };
14
- export declare type IKgButtonClickCb = ((button: VarButton) => Promise<boolean>) & IKgEventCb;
18
+ export declare type IKgButtonClickCb = ((param: IKgButtonClickCbParam) => Promise<boolean>) & IKgEventCb;
15
19
  export declare type IKgButtonImportOkCbParam = {
16
20
  button?: VarButton | null;
17
21
  };
18
22
  export declare type IKgButtonImportOkCb = ((args: IKgButtonImportOkCbParam) => Promise<boolean>) & IKgEventCb;
19
23
  export declare type IKgButtonSubmitSaveCb = (() => Promise<boolean>) & IKgEventCb;
20
24
  export declare type IKgButtonSubmitCancelCb = (() => Promise<boolean>) & IKgEventCb;
21
- export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonImportOkCbParam | any;
25
+ export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonImportOkCbParam;
22
26
  export declare type IKgButtonCb = IKgButtonClickCb | IKgButtonImportOkCb | IKgButtonSubmitSaveCb | IKgButtonSubmitCancelCb;
23
- export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton", {
27
+ export interface IUseKgButtonStoreState {
28
+ clickListenersMap: Map<string, Array<IKgButtonClickCb>>;
24
29
  /**
25
30
  * <p>当前按钮.</p>
26
31
  * <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
27
32
  */
28
33
  currentButtonMap: Map<string, VarButton | null>;
29
- /**
30
- * <p>当前按钮是否正在请求后端接口.</p>
31
- * <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
32
- */
33
- isCurrentButtonRequestingMap: Map<string, boolean>;
34
+ importOkListenersMap: Map<string, Array<IKgButtonImportOkCb>>;
34
35
  /**
35
36
  * <p>按钮的 click 事件是否被拦截.</p>
36
- * <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
37
+ * <p>用户调用 kgVar.kgButton.onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
37
38
  * <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
38
39
  */
39
40
  isClickInterceptedMap: Map<string, boolean>;
40
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
41
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
42
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
43
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
44
- }, {
45
- isClickIntercepted(state: {
46
- currentButtonMap: Map<string, VarButton | null>;
47
- isCurrentButtonRequestingMap: Map<string, boolean>;
48
- isClickInterceptedMap: Map<string, boolean>;
49
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
50
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
51
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
52
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
53
- } & import("pinia").PiniaCustomStateProperties<{
54
- /**
55
- * <p>当前按钮.</p>
56
- * <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
57
- */
58
- currentButtonMap: Map<string, VarButton | null>;
59
- /**
60
- * <p>当前按钮是否正在请求后端接口.</p>
61
- * <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
62
- */
63
- isCurrentButtonRequestingMap: Map<string, boolean>;
64
- /**
65
- * <p>按钮的 click 事件是否被拦截.</p>
66
- * <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
67
- * <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
68
- */
69
- isClickInterceptedMap: Map<string, boolean>;
70
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
71
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
72
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
73
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
74
- }>): (formID: string | undefined | null, param: {
41
+ /**
42
+ * <p>当前按钮是否正在请求后端接口.</p>
43
+ * <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
44
+ */
45
+ isCurrentButtonRequestingMap: Map<string, boolean>;
46
+ submitCancelListenersMap: Map<string, Array<IKgButtonSubmitCancelCb>>;
47
+ submitSaveListenersMap: Map<string, Array<IKgButtonSubmitSaveCb>>;
48
+ }
49
+ export interface IUseKgButtonStoreGetters {
50
+ getCurrentButton(): (formID: string | null | undefined) => VarButton | null;
51
+ getSearchButton(): (formID: string | null | undefined) => VarButton | null;
52
+ isClickIntercepted(): (formID: string | undefined | null, param: {
75
53
  type?: KG_BUTTON_TYPE;
76
54
  varName?: string | null;
77
55
  }) => boolean;
78
- isCurrentButtonRequesting(state: {
79
- currentButtonMap: Map<string, VarButton | null>;
80
- isCurrentButtonRequestingMap: Map<string, boolean>;
81
- isClickInterceptedMap: Map<string, boolean>;
82
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
83
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
84
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
85
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
86
- } & import("pinia").PiniaCustomStateProperties<{
87
- /**
88
- * <p>当前按钮.</p>
89
- * <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
90
- */
91
- currentButtonMap: Map<string, VarButton | null>;
92
- /**
93
- * <p>当前按钮是否正在请求后端接口.</p>
94
- * <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
95
- */
96
- isCurrentButtonRequestingMap: Map<string, boolean>;
97
- /**
98
- * <p>按钮的 click 事件是否被拦截.</p>
99
- * <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
100
- * <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
101
- */
102
- isClickInterceptedMap: Map<string, boolean>;
103
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
104
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
105
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
106
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
107
- }>): (formID: string | undefined | null) => boolean;
108
- getCurrentButton: (state: {
109
- currentButtonMap: Map<string, VarButton | null>;
110
- isCurrentButtonRequestingMap: Map<string, boolean>;
111
- isClickInterceptedMap: Map<string, boolean>;
112
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
113
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
114
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
115
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
116
- } & import("pinia").PiniaCustomStateProperties<{
117
- /**
118
- * <p>当前按钮.</p>
119
- * <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
120
- */
121
- currentButtonMap: Map<string, VarButton | null>;
122
- /**
123
- * <p>当前按钮是否正在请求后端接口.</p>
124
- * <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
125
- */
126
- isCurrentButtonRequestingMap: Map<string, boolean>;
127
- /**
128
- * <p>按钮的 click 事件是否被拦截.</p>
129
- * <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
130
- * <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
131
- */
132
- isClickInterceptedMap: Map<string, boolean>;
133
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
134
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
135
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
136
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
137
- }>) => (formID: string | null | undefined) => VarButton | null;
138
- isCurrentButton(state: {
139
- currentButtonMap: Map<string, VarButton | null>;
140
- isCurrentButtonRequestingMap: Map<string, boolean>;
141
- isClickInterceptedMap: Map<string, boolean>;
142
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
143
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
144
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
145
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
146
- } & import("pinia").PiniaCustomStateProperties<{
147
- /**
148
- * <p>当前按钮.</p>
149
- * <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
150
- */
151
- currentButtonMap: Map<string, VarButton | null>;
152
- /**
153
- * <p>当前按钮是否正在请求后端接口.</p>
154
- * <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
155
- */
156
- isCurrentButtonRequestingMap: Map<string, boolean>;
157
- /**
158
- * <p>按钮的 click 事件是否被拦截.</p>
159
- * <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
160
- * <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
161
- */
162
- isClickInterceptedMap: Map<string, boolean>;
163
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
164
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
165
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
166
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
167
- }>): (formID: string, param: {
56
+ isCurrentButton(): (formID: string, param: {
168
57
  varName?: string;
169
58
  type?: KG_BUTTON_TYPE;
170
59
  }) => boolean;
171
- getSearchButton(state: {
172
- currentButtonMap: Map<string, VarButton | null>;
173
- isCurrentButtonRequestingMap: Map<string, boolean>;
174
- isClickInterceptedMap: Map<string, boolean>;
175
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
176
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
177
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
178
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
179
- } & import("pinia").PiniaCustomStateProperties<{
180
- /**
181
- * <p>当前按钮.</p>
182
- * <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
183
- */
184
- currentButtonMap: Map<string, VarButton | null>;
185
- /**
186
- * <p>当前按钮是否正在请求后端接口.</p>
187
- * <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
188
- */
189
- isCurrentButtonRequestingMap: Map<string, boolean>;
190
- /**
191
- * <p>按钮的 click 事件是否被拦截.</p>
192
- * <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
193
- * <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
194
- */
195
- isClickInterceptedMap: Map<string, boolean>;
196
- clickListenersMap: Map<string, IKgButtonClickCb[]>;
197
- importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
198
- submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
199
- submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
200
- }>): (formID: string | null | undefined) => VarButton | null;
201
- }, {
202
- dispose(formID: string | null | undefined): void;
60
+ isCurrentButtonRequesting(): (formID: string | undefined | null) => boolean;
61
+ }
62
+ export interface IUseKgButtonStoreActions {
203
63
  /**
204
64
  * 注册事件监听.
205
65
  * @param formID 界面标识.
@@ -208,12 +68,15 @@ export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton
208
68
  */
209
69
  addEventListener(formID: string, event: IKgButtonEvent, cb: IKgButtonCb): void;
210
70
  /**
211
- * 退订事件监听.
71
+ * <p>手动点击某个按钮.</p>
72
+ * <p>调用此方法相当于手动触发某个按钮的点击事件.</p>
73
+ *
212
74
  * @param formID 界面标识.
213
- * @param event 事件名称.
214
- * @param cb 回调函数.
75
+ * @param type 按钮类型.
76
+ * @param variableName 按钮变量名称.
215
77
  */
216
- removeEventListener(formID: string, event: IKgButtonEvent, cb?: IKgButtonCb): void;
78
+ click(formID: string, type: KG_BUTTON_TYPE, variableName?: string): void;
79
+ dispose(formID: string | null | undefined): void;
217
80
  /**
218
81
  * 触发事件.
219
82
  * @param formID 界面标识.
@@ -221,6 +84,17 @@ export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton
221
84
  * @param param 数据.
222
85
  */
223
86
  emit(formID: string, event: IKgButtonEvent, param: IKgButtonCbParam): Promise<boolean>;
87
+ /**
88
+ * 退订事件监听.
89
+ * @param formID 界面标识.
90
+ * @param event 事件名称.
91
+ * @param cb 回调函数.
92
+ */
93
+ removeEventListener(formID: string, event: IKgButtonEvent, cb?: IKgButtonCb): void;
94
+ setCurrentButton(formID: string, param: {
95
+ type?: KG_BUTTON_TYPE;
96
+ varName?: string | null;
97
+ } | null): Promise<void>;
224
98
  setIsClickIntercepted(formID: string | undefined | null, param: {
225
99
  isIntercepted: boolean;
226
100
  type?: KG_BUTTON_TYPE;
@@ -229,17 +103,7 @@ export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton
229
103
  setIsCurrentButtonRequesting(formID: string | undefined | null, param: {
230
104
  isRequesting: boolean;
231
105
  }): void;
232
- setCurrentButton(formID: string, param: {
233
- type?: KG_BUTTON_TYPE;
234
- varName?: string | null;
235
- } | null): Promise<void>;
236
- /**
237
- * <p>手动点击某个按钮.</p>
238
- * <p>调用此方法相当于手动触发某个按钮的点击事件.</p>
239
- *
240
- * @param formID 界面标识.
241
- * @param type 按钮类型.
242
- * @param variableName 按钮变量名称.
243
- */
244
- click(formID: string, type: KG_BUTTON_TYPE, variableName?: string): void;
245
- }>;
106
+ }
107
+ export declare type IUseKgButtonStore = StoreDefinition<'KgButton', IUseKgButtonStoreState, IUseKgButtonStoreGetters, IUseKgButtonStoreActions>;
108
+ export declare type IKgButtonStore = ReturnType<IUseKgButtonStore>;
109
+ export declare const useKgButtonStore: IUseKgButtonStore;
@@ -1,55 +1,49 @@
1
- import { IKgFormChangeCb, IKgFormEvent, IKgFormLookupBeforeOkCb, IKgFormLookupBeforeOpenCb, IKgFormLookupOkCb, IKgFormSelectBeforeSetDatasCb, IKgFormSelectChangeCb } from './index.store';
2
- /**
3
- * @param formID 界面标识.
4
- */
5
- export declare function useKgForm(formID?: string | null): {
1
+ import { IRemoveEventListenerHandler } from '../../consts';
2
+ import { IKgFormChangeCb, IKgFormLookupBeforeOkCb, IKgFormLookupBeforeOpenCb, IKgFormLookupOkCb, IKgFormSelectBeforeSetDatasCb, IKgFormSelectChangeCb, IKgFormStore } from './index.store';
3
+ export declare type IUseKgForm = {
6
4
  formID: string;
7
- store: import("pinia").Store<"KgForm", {
8
- changeListenersMap: Map<string, IKgFormChangeCb[]>;
9
- selectBeforeSetDatasListenersMap: Map<string, IKgFormSelectBeforeSetDatasCb[]>;
10
- selectChangeListenersMap: Map<string, IKgFormSelectChangeCb[]>;
11
- lookupBeforeOpenListenersMap: Map<string, IKgFormLookupBeforeOpenCb[]>;
12
- lookupBeforeOkListenersMap: Map<string, IKgFormLookupBeforeOkCb[]>;
13
- lookupOkListenersMap: Map<string, IKgFormLookupOkCb[]>;
14
- }, {}, {
15
- addEventListener(formID: string, event: IKgFormEvent, cb: import("./index.store").IKgFormCb): void;
16
- removeEventListener(formID: string, event: IKgFormEvent, cb?: import("./index.store").IKgFormCb | undefined): void;
17
- emit<T = import("./index.store").IKgFormCbParam>(formID: string, event: IKgFormEvent, param: T): Promise<boolean>;
18
- }>;
19
5
  /**
20
6
  * 事件: 表单控件数据发生变更.
21
7
  * @param cb 回调函数.
22
8
  * @param once 是否只会触发一次. 默认为 undefined.
23
9
  */
24
- onChange: (cb: IKgFormChangeCb, once?: boolean | undefined) => import("../..").IRemoveEventListenerHandler;
10
+ onChange(cb: IKgFormChangeCb, once?: boolean): IRemoveEventListenerHandler;
25
11
  /**
26
- * 事件: 查询请求成功, 列表数据尚未赋值. 此处可以对查询接口返回的列表数据作处理.
12
+ * 事件: 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件.
27
13
  * @param cb 回调函数.
28
14
  * @param once 是否只会触发一次. 默认为 undefined.
29
15
  */
30
- onSelectBeforeSetDatas: (cb: IKgFormSelectBeforeSetDatasCb, once?: boolean | undefined) => import("../..").IRemoveEventListenerHandler;
16
+ onLookupBeforeOk(cb: IKgFormLookupBeforeOkCb, once?: boolean): IRemoveEventListenerHandler;
31
17
  /**
32
- * 事件: 下拉列表选中某个(可能多个)数据.
18
+ * 事件: 查找弹窗打开之前.
33
19
  * @param cb 回调函数.
34
20
  * @param once 是否只会触发一次. 默认为 undefined.
35
21
  */
36
- onSelectChange: (cb: IKgFormSelectChangeCb, once?: boolean | undefined) => import("../..").IRemoveEventListenerHandler;
22
+ onLookupBeforeOpen(cb: IKgFormLookupBeforeOpenCb, once?: boolean): IRemoveEventListenerHandler;
37
23
  /**
38
- * 事件: 查找弹窗打开之前.
24
+ * 事件: 查找弹窗点击确定.
39
25
  * @param cb 回调函数.
40
26
  * @param once 是否只会触发一次. 默认为 undefined.
41
27
  */
42
- onLookupBeforeOpen: (cb: IKgFormLookupBeforeOpenCb, once?: boolean | undefined) => import("../..").IRemoveEventListenerHandler;
28
+ onLookupOk(cb: IKgFormLookupOkCb, once?: boolean): IRemoveEventListenerHandler;
43
29
  /**
44
- * 事件: 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件.
30
+ * 事件: 查询请求成功, 列表数据尚未赋值. 此处可以对查询接口返回的列表数据作处理.
45
31
  * @param cb 回调函数.
46
32
  * @param once 是否只会触发一次. 默认为 undefined.
47
33
  */
48
- onLookupBeforeOk: (cb: IKgFormLookupBeforeOkCb, once?: boolean | undefined) => import("../..").IRemoveEventListenerHandler;
34
+ onSelectBeforeSetDatas(cb: IKgFormSelectBeforeSetDatasCb, once?: boolean): IRemoveEventListenerHandler;
49
35
  /**
50
- * 事件: 查找弹窗点击确定.
36
+ * 事件: 下拉列表选中某个(可能多个)数据.
51
37
  * @param cb 回调函数.
52
38
  * @param once 是否只会触发一次. 默认为 undefined.
53
39
  */
54
- onLookupOk: (cb: IKgFormLookupOkCb, once?: boolean | undefined) => import("../..").IRemoveEventListenerHandler;
40
+ onSelectChange(cb: IKgFormSelectChangeCb, once?: boolean): IRemoveEventListenerHandler;
41
+ /**
42
+ * 状态数据.
43
+ */
44
+ store: IKgFormStore;
55
45
  };
46
+ /**
47
+ * @param formID 界面标识.
48
+ */
49
+ export declare function useKgForm(formID?: string | null): IUseKgForm;
@@ -1,3 +1,4 @@
1
+ import { StoreDefinition } from 'pinia';
1
2
  import { ComputedRef, Ref } from 'vue';
2
3
  import { IKgEventCb } from '../../consts';
3
4
  import { IKgTableRow } from '../KgTable';
@@ -113,14 +114,17 @@ export declare type IKgFormLookupOkCbParam = {
113
114
  export declare type IKgFormLookupOkCb = ((param: IKgFormLookupOkCbParam) => Promise<boolean>) & IKgEventCb;
114
115
  export declare type IKgFormCbParam = IKgFormChangeCbParam | IKgFormSelectBeforeSetDatasCbParam | IKgFormSelectChangeCbParam | IKgFormLookupBeforeOpenCbParam | IKgFormLookupBeforeOkCbParam | IKgFormLookupOkCbParam;
115
116
  export declare type IKgFormCb = IKgFormChangeCb | IKgFormSelectBeforeSetDatasCb | IKgFormSelectChangeCb | IKgFormLookupBeforeOpenCb | IKgFormLookupBeforeOkCb | IKgFormLookupOkCb;
116
- export declare const useKgFormStore: import("pinia").StoreDefinition<"KgForm", {
117
- changeListenersMap: Map<string, IKgFormChangeCb[]>;
118
- selectBeforeSetDatasListenersMap: Map<string, IKgFormSelectBeforeSetDatasCb[]>;
119
- selectChangeListenersMap: Map<string, IKgFormSelectChangeCb[]>;
120
- lookupBeforeOpenListenersMap: Map<string, IKgFormLookupBeforeOpenCb[]>;
121
- lookupBeforeOkListenersMap: Map<string, IKgFormLookupBeforeOkCb[]>;
122
- lookupOkListenersMap: Map<string, IKgFormLookupOkCb[]>;
123
- }, {}, {
117
+ export interface IUseKgFormStoreState {
118
+ changeListenersMap: Map<string, Array<IKgFormChangeCb>>;
119
+ lookupBeforeOkListenersMap: Map<string, Array<IKgFormLookupBeforeOkCb>>;
120
+ lookupBeforeOpenListenersMap: Map<string, Array<IKgFormLookupBeforeOpenCb>>;
121
+ lookupOkListenersMap: Map<string, Array<IKgFormLookupOkCb>>;
122
+ selectBeforeSetDatasListenersMap: Map<string, Array<IKgFormSelectBeforeSetDatasCb>>;
123
+ selectChangeListenersMap: Map<string, Array<IKgFormSelectChangeCb>>;
124
+ }
125
+ export interface IUseKgFormStoreGetters {
126
+ }
127
+ export interface IUseKgFormStoreActions {
124
128
  /**
125
129
  * 注册事件监听.
126
130
  * @param formID 界面标识.
@@ -129,17 +133,20 @@ export declare const useKgFormStore: import("pinia").StoreDefinition<"KgForm", {
129
133
  */
130
134
  addEventListener(formID: string, event: IKgFormEvent, cb: IKgFormCb): void;
131
135
  /**
132
- * 退订事件监听.
136
+ * 触发事件.
133
137
  * @param formID 界面标识.
134
138
  * @param event 事件名称.
135
- * @param cb 回调函数.
139
+ * @param param 数据.
136
140
  */
137
- removeEventListener(formID: string, event: IKgFormEvent, cb?: IKgFormCb): void;
141
+ emit<T = IKgFormCbParam>(formID: string, event: IKgFormEvent, param: T): Promise<boolean>;
138
142
  /**
139
- * 触发事件.
143
+ * 退订事件监听.
140
144
  * @param formID 界面标识.
141
145
  * @param event 事件名称.
142
- * @param param 数据.
146
+ * @param cb 回调函数.
143
147
  */
144
- emit<T = IKgFormCbParam>(formID: string, event: IKgFormEvent, param: T): Promise<boolean>;
145
- }>;
148
+ removeEventListener(formID: string, event: IKgFormEvent, cb?: IKgFormCb): void;
149
+ }
150
+ export declare type IUseKgFormStore = StoreDefinition<'KgForm', IUseKgFormStoreState, IUseKgFormStoreGetters, IUseKgFormStoreActions>;
151
+ export declare type IKgFormStore = ReturnType<IUseKgFormStore>;
152
+ export declare const useKgFormStore: IUseKgFormStore;
@@ -14,6 +14,7 @@ declare const _default: import("vue").DefineComponent<{
14
14
  kgSpan: import("vue").PropType<number>;
15
15
  kgPlaceholder: import("vue").PropType<string>;
16
16
  kgMode: import("vue").PropType<"multiple" | "tags">;
17
+ /** 是否全选. */
17
18
  kgShowLabel: {
18
19
  type: import("vue").PropType<boolean>;
19
20
  default: boolean;
@@ -56,6 +57,7 @@ declare const _default: import("vue").DefineComponent<{
56
57
  kgSpan: import("vue").PropType<number>;
57
58
  kgPlaceholder: import("vue").PropType<string>;
58
59
  kgMode: import("vue").PropType<"multiple" | "tags">;
60
+ /** 是否全选. */
59
61
  kgShowLabel: {
60
62
  type: import("vue").PropType<boolean>;
61
63
  default: boolean;
@@ -13,7 +13,6 @@ declare const _default: import("vue").DefineComponent<{
13
13
  };
14
14
  kgSpan: import("vue").PropType<number>;
15
15
  kgPlaceholder: import("vue").PropType<string>;
16
- /** 初始. */
17
16
  kgMode: import("vue").PropType<"multiple" | "tags">;
18
17
  kgShowLabel: {
19
18
  type: import("vue").PropType<boolean>;
@@ -56,7 +55,6 @@ declare const _default: import("vue").DefineComponent<{
56
55
  };
57
56
  kgSpan: import("vue").PropType<number>;
58
57
  kgPlaceholder: import("vue").PropType<string>;
59
- /** 初始. */
60
58
  kgMode: import("vue").PropType<"multiple" | "tags">;
61
59
  kgShowLabel: {
62
60
  type: import("vue").PropType<boolean>;
@@ -36,9 +36,8 @@ declare const _default: import("vue").DefineComponent<{
36
36
  type: import("vue").PropType<import("../index.vm").IKgFormItemValue>;
37
37
  default: undefined;
38
38
  };
39
- /** 初始. */
40
39
  'onUpdate:value': import("vue").PropType<(value: import("../index.vm").IKgFormItemValue | null) => void>;
41
- onKgSubmit: import("vue").PropType<() => void>; /** 初始. */
40
+ onKgSubmit: import("vue").PropType<() => void>;
42
41
  onKgChange: import("vue").PropType<(value: any) => void>;
43
42
  onKgSelectChange: import("vue").PropType<(value: any) => void>;
44
43
  onKgSelectDatasChange: import("vue").PropType<(datas: any[]) => void>;
@@ -79,9 +78,8 @@ declare const _default: import("vue").DefineComponent<{
79
78
  type: import("vue").PropType<import("../index.vm").IKgFormItemValue>;
80
79
  default: undefined;
81
80
  };
82
- /** 初始. */
83
81
  'onUpdate:value': import("vue").PropType<(value: import("../index.vm").IKgFormItemValue | null) => void>;
84
- onKgSubmit: import("vue").PropType<() => void>; /** 初始. */
82
+ onKgSubmit: import("vue").PropType<() => void>;
85
83
  onKgChange: import("vue").PropType<(value: any) => void>;
86
84
  onKgSelectChange: import("vue").PropType<(value: any) => void>;
87
85
  onKgSelectDatasChange: import("vue").PropType<(datas: any[]) => void>;