@kengic/vue 0.7.1 → 0.7.3
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.
@@ -1,5 +1,5 @@
|
|
1
1
|
import { IRemoveEventListenerHandler, KG_BUTTON_TYPE } from '../../consts';
|
2
|
-
import { IKgButtonClickCb, IKgButtonDeleteOkCb, IKgButtonStore, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb, IKgButtonUpdateBeforeClickCb } from './index.store';
|
2
|
+
import { IKgButtonClickCb, IKgButtonDeleteOkCb, IKgButtonOtherOkCb, IKgButtonStore, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb, IKgButtonUpdateBeforeClickCb } from './index.store';
|
3
3
|
export declare type IUseKgButton = {
|
4
4
|
formID: string;
|
5
5
|
/** 状态数据. */
|
@@ -30,6 +30,12 @@ export declare type IUseKgButton = {
|
|
30
30
|
* @param once 是否只会触发一次. 默认为 undefined.
|
31
31
|
*/
|
32
32
|
onDeleteOk(cb: IKgButtonDeleteOkCb, once?: boolean): IRemoveEventListenerHandler;
|
33
|
+
/**
|
34
|
+
* 监听事件: other 类型的按钮接口调用成功.
|
35
|
+
* @param cb 回调函数.
|
36
|
+
* @param once 是否只会触发一次. 默认为 undefined.
|
37
|
+
*/
|
38
|
+
onOtherOk(cb: IKgButtonOtherOkCb, once?: boolean): IRemoveEventListenerHandler;
|
33
39
|
/**
|
34
40
|
* 监听事件: 表格内编辑时, 点击保存按钮.
|
35
41
|
* @param cb 回调函数.
|
@@ -7,10 +7,11 @@ import { IKgTableRow } from '../KgTable';
|
|
7
7
|
* 'click': 点击按钮
|
8
8
|
* 'updateBeforeClick': 点击更新按钮之后, 执行默认逻辑之前. 如果返回 Promise.resolve(false), 则不执行默认逻辑
|
9
9
|
* 'deleteOk': 删除成功, 删除接口调用成功
|
10
|
+
* 'otherOk': other 类型的按钮接口调用成功
|
10
11
|
* 'submitSave': 表格内编辑时, 点击保存按钮
|
11
12
|
* 'submitCancel': 表格内编辑时, 点击取消按钮
|
12
13
|
*/
|
13
|
-
export declare type IKgButtonEvent = 'click' | 'updateBeforeClick' | 'deleteOk' | 'submitSave' | 'submitCancel';
|
14
|
+
export declare type IKgButtonEvent = 'click' | 'updateBeforeClick' | 'deleteOk' | 'otherOk' | 'submitSave' | 'submitCancel';
|
14
15
|
/** 事件监听函数: click. */
|
15
16
|
export declare type IKgButtonClickCbParam = {
|
16
17
|
button: VarButton;
|
@@ -24,15 +25,24 @@ export declare type IKgButtonUpdateBeforeClickCbParam = {
|
|
24
25
|
export declare type IKgButtonUpdateBeforeClickCb = ((args: IKgButtonUpdateBeforeClickCbParam) => Promise<boolean>) & IKgEventCb;
|
25
26
|
/** 事件监听函数: deleteOk. */
|
26
27
|
export declare type IKgButtonDeleteOkCb = (() => Promise<boolean>) & IKgEventCb;
|
28
|
+
/** 事件监听函数: otherOk. */
|
29
|
+
export declare type IKgButtonOtherOkCbParam = {
|
30
|
+
button?: VarButton | null;
|
31
|
+
/** 接口返回的数据. */
|
32
|
+
data: any;
|
33
|
+
};
|
34
|
+
export declare type IKgButtonOtherOkCb = ((args: IKgButtonOtherOkCbParam) => Promise<boolean>) & IKgEventCb;
|
27
35
|
/** 事件监听函数: submitSave. */
|
28
36
|
export declare type IKgButtonSubmitSaveCb = (() => Promise<boolean>) & IKgEventCb;
|
29
37
|
/** 事件监听函数: submitCancel. */
|
30
38
|
export declare type IKgButtonSubmitCancelCb = (() => Promise<boolean>) & IKgEventCb;
|
31
|
-
export declare type
|
39
|
+
export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonUpdateBeforeClickCbParam | IKgButtonOtherOkCbParam | any;
|
40
|
+
export declare type IKgButtonCb = IKgButtonClickCb | IKgButtonUpdateBeforeClickCb | IKgButtonDeleteOkCb | IKgButtonOtherOkCb | IKgButtonSubmitSaveCb | IKgButtonSubmitCancelCb;
|
32
41
|
export interface IKgButtonState {
|
33
42
|
clickListenersMap: Map<string, Array<IKgButtonClickCb>>;
|
34
43
|
updateBeforeClickListenersMap: Map<string, Array<IKgButtonUpdateBeforeClickCb>>;
|
35
44
|
deleteOkListenersMap: Map<string, Array<IKgButtonDeleteOkCb>>;
|
45
|
+
otherOkListenersMap: Map<string, Array<IKgButtonOtherOkCb>>;
|
36
46
|
submitSaveListenersMap: Map<string, Array<IKgButtonSubmitSaveCb>>;
|
37
47
|
submitCancelListenersMap: Map<string, Array<IKgButtonSubmitCancelCb>>;
|
38
48
|
}
|
@@ -57,9 +67,9 @@ export declare type IKgButtonStoreDefinition = StoreDefinition<'KgButton', IKgBu
|
|
57
67
|
* 触发事件.
|
58
68
|
* @param formID 界面标识.
|
59
69
|
* @param event 事件名称.
|
60
|
-
* @param
|
70
|
+
* @param param 数据.
|
61
71
|
*/
|
62
|
-
emit(formID: string, event: IKgButtonEvent,
|
72
|
+
emit(formID: string, event: IKgButtonEvent, param: IKgButtonCbParam): Promise<boolean>;
|
63
73
|
/**
|
64
74
|
* 点击某个按钮, 即通过代码的方式, 手动触发某个按钮的点击事件.
|
65
75
|
* @param formID 界面标识.
|
@@ -18,12 +18,16 @@ export declare type IKgSlots = {
|
|
18
18
|
};
|
19
19
|
KgSubmit?: {
|
20
20
|
'KgForm.Item'?: {
|
21
|
+
/** 某个表单控件. */
|
21
22
|
[variable: string]: (param: IKgFormItemSlotControlParam) => any;
|
22
23
|
};
|
23
24
|
};
|
24
25
|
KgTable?: {
|
26
|
+
/** 单元格. */
|
25
27
|
bodyCell?: (param: IKgTableSlotParams['bodyCell']) => any;
|
28
|
+
/** 展开行. */
|
26
29
|
expandedRowRender?: (param: IKgTableSlotParams['expandedRowRender']) => any;
|
30
|
+
/** 表格底部的汇总行.单元格. */
|
27
31
|
'summary.bodyCell'?: (param: IKgTableSlotParams['summary.bodyCell']) => any;
|
28
32
|
};
|
29
33
|
};
|