@kengic/vue 0.6.1-beta.1 → 0.6.1-beta.2
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 {
|
2
|
+
import { IKgButtonClickCb, IKgButtonDeleteOkCb, IKgButtonStore, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb, IKgButtonUpdateBeforeClickCb } from './index.store';
|
3
3
|
export declare type IUseKgButton = {
|
4
4
|
formID: string;
|
5
5
|
/** 状态数据. */
|
@@ -15,9 +15,11 @@ export declare type IUseKgButton = {
|
|
15
15
|
/** 监听事件: 点击按钮. */
|
16
16
|
onClick(cb: IKgButtonClickCb): IRemoveEventListenerHandler;
|
17
17
|
/** 监听事件: 点击更新按钮之后, 执行默认逻辑之前. 如果返回 Promise.resolve(true), 则不再执行后续的默认逻辑. */
|
18
|
-
|
18
|
+
onUpdateBeforeClick(cb: IKgButtonUpdateBeforeClickCb): IRemoveEventListenerHandler;
|
19
19
|
/** 监听事件: 删除成功, 删除接口调用成功. */
|
20
20
|
onDeleteOk(cb: IKgButtonDeleteOkCb): IRemoveEventListenerHandler;
|
21
|
+
onSubmitSave(cb: IKgButtonSubmitSaveCb): IRemoveEventListenerHandler;
|
22
|
+
onSubmitCancel(cb: IKgButtonSubmitCancelCb): IRemoveEventListenerHandler;
|
21
23
|
};
|
22
24
|
/**
|
23
25
|
* @param formID 界面标识.
|
@@ -4,26 +4,34 @@ import { KG_BUTTON_TYPE } from '../../consts';
|
|
4
4
|
import { IKgTableRow } from '../KgTable';
|
5
5
|
/**
|
6
6
|
* 事件类型.
|
7
|
-
* 'click':
|
8
|
-
* '
|
9
|
-
* 'deleteOk':
|
7
|
+
* 'click': 点击按钮
|
8
|
+
* 'updateBeforeClick': 点击更新按钮之后, 执行默认逻辑之前. 如果返回 Promise.resolve(false), 则不执行默认逻辑
|
9
|
+
* 'deleteOk': 删除成功, 删除接口调用成功
|
10
|
+
* 'submitSave': 表格内编辑时, 点击保存按钮
|
11
|
+
* 'submitCancel': 表格内编辑时, 点击取消按钮
|
10
12
|
*/
|
11
|
-
export declare type IKgButtonEvent = 'click' | '
|
13
|
+
export declare type IKgButtonEvent = 'click' | 'updateBeforeClick' | 'deleteOk' | 'submitSave' | 'submitCancel';
|
12
14
|
/** 事件监听函数: click. */
|
13
15
|
export declare type IKgButtonClickCb = (button: VarButton) => Promise<boolean>;
|
14
|
-
/** 事件监听函数:
|
15
|
-
export declare type
|
16
|
+
/** 事件监听函数: updateBeforeClick. */
|
17
|
+
export declare type IKgButtonUpdateBeforeClickCbParam = {
|
16
18
|
button?: VarButton | null;
|
17
19
|
row?: IKgTableRow | null;
|
18
20
|
};
|
19
|
-
export declare type
|
21
|
+
export declare type IKgButtonUpdateBeforeClickCb = (args: IKgButtonUpdateBeforeClickCbParam) => Promise<boolean>;
|
20
22
|
/** 事件监听函数: deleteOk. */
|
21
23
|
export declare type IKgButtonDeleteOkCb = () => Promise<boolean>;
|
22
|
-
|
24
|
+
/** 事件监听函数: submitSave. */
|
25
|
+
export declare type IKgButtonSubmitSaveCb = () => Promise<boolean>;
|
26
|
+
/** 事件监听函数: submitCancel. */
|
27
|
+
export declare type IKgButtonSubmitCancelCb = () => Promise<boolean>;
|
28
|
+
export declare type IKgButtonCb = IKgButtonClickCb | IKgButtonUpdateBeforeClickCb | IKgButtonDeleteOkCb | IKgButtonSubmitSaveCb | IKgButtonSubmitCancelCb;
|
23
29
|
export interface IKgButtonState {
|
24
30
|
clickListenersMap: Map<string, Array<IKgButtonClickCb>>;
|
25
|
-
|
31
|
+
updateBeforeClickListenersMap: Map<string, Array<IKgButtonUpdateBeforeClickCb>>;
|
26
32
|
deleteOkListenersMap: Map<string, Array<IKgButtonDeleteOkCb>>;
|
33
|
+
submitSaveListenersMap: Map<string, Array<IKgButtonSubmitSaveCb>>;
|
34
|
+
submitCancelListenersMap: Map<string, Array<IKgButtonSubmitCancelCb>>;
|
27
35
|
}
|
28
36
|
export declare type IKgButtonStoreDefinition = StoreDefinition<'KgButton', IKgButtonState, {
|
29
37
|
getClickListeners(): (formID?: string | null) => Array<IKgButtonClickCb> | null;
|
@@ -15,12 +15,16 @@ export declare type IUseKgVar = {
|
|
15
15
|
isRetrievingVarGridMaster: ComputedRef<ReturnType<IKgVarStore['isRetrievingVarGridMaster']>>;
|
16
16
|
/** 正在创建. */
|
17
17
|
isCreating: ComputedRef<ReturnType<IKgVarStore['isCreating']>>;
|
18
|
+
isCreatingRequesting: ComputedRef<ReturnType<IKgVarStore['isCreatingRequesting']>>;
|
18
19
|
/** 正在更新. */
|
19
20
|
isUpdating: ComputedRef<ReturnType<IKgVarStore['isUpdating']>>;
|
21
|
+
isUpdatingRequesting: ComputedRef<ReturnType<IKgVarStore['isUpdatingRequesting']>>;
|
20
22
|
/** 正在复制. */
|
21
23
|
isCopying: ComputedRef<ReturnType<IKgVarStore['isCopying']>>;
|
24
|
+
isCopyingRequesting: ComputedRef<ReturnType<IKgVarStore['isCopyingRequesting']>>;
|
22
25
|
/** 正在删除. */
|
23
26
|
isDeleting: ComputedRef<ReturnType<IKgVarStore['isDeleting']>>;
|
27
|
+
isDeletingRequesting: ComputedRef<ReturnType<IKgVarStore['isDeletingRequesting']>>;
|
24
28
|
/** 其他按钮: 正在调用接口. */
|
25
29
|
isOtherRequesting: ComputedRef<ReturnType<IKgVarStore['isOtherRequesting']>>;
|
26
30
|
/** 所有的 VarButton 列表. */
|