@kengic/vue 0.13.8 → 0.13.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  import { IRemoveEventListenerHandler, KG_BUTTON_TYPE } from '../../consts';
2
- import { IKgButtonClickCb, IKgButtonDeleteOkCb, IKgButtonOtherOkCb, IKgButtonStore, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb, IKgButtonUpdateBeforeClickCb } from './index.store';
2
+ import { IKgButtonClickCb, IKgButtonDeleteOkCb, IKgButtonImportOkCb, IKgButtonOtherOkCb, IKgButtonStore, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb, IKgButtonUpdateBeforeClickCb } from './index.store';
3
3
  export declare type IUseKgButton = {
4
4
  formID: string;
5
5
  /** 状态数据. */
@@ -19,7 +19,7 @@ export declare type IUseKgButton = {
19
19
  */
20
20
  onClick(cb: IKgButtonClickCb, once?: boolean): IRemoveEventListenerHandler;
21
21
  /**
22
- * 监听事件: 点击更新按钮之后, 执行默认逻辑之前. 如果返回 Promise.resolve(true), 则不再执行后续的默认逻辑.
22
+ * 监听事件: 点击更新按钮之后, 执行默认逻辑之前. 如果返回 true, 则不再执行后续的默认逻辑.
23
23
  * @param cb 回调函数.
24
24
  * @param once 是否只会触发一次. 默认为 undefined.
25
25
  */
@@ -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
+ * 监听事件: 导入成功, 导入接口调用成功.
35
+ * @param cb 回调函数.
36
+ * @param once 是否只会触发一次. 默认为 undefined.
37
+ */
38
+ onImportOk(cb: IKgButtonImportOkCb, once?: boolean): IRemoveEventListenerHandler;
33
39
  /**
34
40
  * 监听事件: other 类型的按钮接口调用成功.
35
41
  * @param cb 回调函数.
@@ -7,46 +7,46 @@ import { IKgTableRow } from '../KgTable';
7
7
  * 'click': 点击按钮
8
8
  * 'updateBeforeClick': 点击更新按钮之后, 执行默认逻辑之前. 如果返回 Promise.resolve(false), 则不执行默认逻辑
9
9
  * 'deleteOk': 删除成功, 删除接口调用成功
10
+ * 'importOk': 导入成功, 导入接口调用成功
10
11
  * 'otherOk': other 类型的按钮接口调用成功
11
12
  * 'submitSave': 表格内编辑时, 点击保存按钮
12
13
  * 'submitCancel': 表格内编辑时, 点击取消按钮
13
14
  */
14
- export declare type IKgButtonEvent = 'click' | 'updateBeforeClick' | 'deleteOk' | 'otherOk' | 'submitSave' | 'submitCancel';
15
- /** 事件监听函数: click. */
15
+ export declare type IKgButtonEvent = 'click' | 'updateBeforeClick' | 'deleteOk' | 'importOk' | 'otherOk' | 'submitSave' | 'submitCancel';
16
16
  export declare type IKgButtonClickCbParam = {
17
17
  button: VarButton;
18
18
  };
19
19
  export declare type IKgButtonClickCb = ((button: VarButton) => Promise<boolean>) & IKgEventCb;
20
- /** 事件监听函数: updateBeforeClick. */
21
20
  export declare type IKgButtonUpdateBeforeClickCbParam = {
22
21
  button?: VarButton | null;
23
22
  row?: IKgTableRow | null;
24
23
  };
25
24
  export declare type IKgButtonUpdateBeforeClickCb = ((args: IKgButtonUpdateBeforeClickCbParam) => Promise<boolean>) & IKgEventCb;
26
- /** 事件监听函数: deleteOk. */
27
25
  export declare type IKgButtonDeleteOkCbParam = {
28
26
  button?: VarButton | null;
29
27
  /** 删除的行. */
30
28
  rows: Array<IKgTableRow> | null;
31
29
  };
32
30
  export declare type IKgButtonDeleteOkCb = ((args: IKgButtonDeleteOkCbParam) => Promise<boolean>) & IKgEventCb;
33
- /** 事件监听函数: otherOk. */
31
+ export declare type IKgButtonImportOkCbParam = {
32
+ button?: VarButton | null;
33
+ };
34
+ export declare type IKgButtonImportOkCb = ((args: IKgButtonImportOkCbParam) => Promise<boolean>) & IKgEventCb;
34
35
  export declare type IKgButtonOtherOkCbParam = {
35
36
  button?: VarButton | null;
36
37
  /** 接口返回的数据. */
37
38
  data: any;
38
39
  };
39
40
  export declare type IKgButtonOtherOkCb = ((args: IKgButtonOtherOkCbParam) => Promise<boolean>) & IKgEventCb;
40
- /** 事件监听函数: submitSave. */
41
41
  export declare type IKgButtonSubmitSaveCb = (() => Promise<boolean>) & IKgEventCb;
42
- /** 事件监听函数: submitCancel. */
43
42
  export declare type IKgButtonSubmitCancelCb = (() => Promise<boolean>) & IKgEventCb;
44
- export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonUpdateBeforeClickCbParam | IKgButtonDeleteOkCbParam | IKgButtonOtherOkCbParam | any;
45
- export declare type IKgButtonCb = IKgButtonClickCb | IKgButtonUpdateBeforeClickCb | IKgButtonDeleteOkCb | IKgButtonOtherOkCb | IKgButtonSubmitSaveCb | IKgButtonSubmitCancelCb;
43
+ export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonUpdateBeforeClickCbParam | IKgButtonDeleteOkCbParam | IKgButtonImportOkCbParam | IKgButtonOtherOkCbParam | any;
44
+ export declare type IKgButtonCb = IKgButtonClickCb | IKgButtonUpdateBeforeClickCb | IKgButtonDeleteOkCb | IKgButtonImportOkCb | IKgButtonOtherOkCb | IKgButtonSubmitSaveCb | IKgButtonSubmitCancelCb;
46
45
  export interface IKgButtonState {
47
46
  clickListenersMap: Map<string, Array<IKgButtonClickCb>>;
48
47
  updateBeforeClickListenersMap: Map<string, Array<IKgButtonUpdateBeforeClickCb>>;
49
48
  deleteOkListenersMap: Map<string, Array<IKgButtonDeleteOkCb>>;
49
+ importOkListenersMap: Map<string, Array<IKgButtonImportOkCb>>;
50
50
  otherOkListenersMap: Map<string, Array<IKgButtonOtherOkCb>>;
51
51
  submitSaveListenersMap: Map<string, Array<IKgButtonSubmitSaveCb>>;
52
52
  submitCancelListenersMap: Map<string, Array<IKgButtonSubmitCancelCb>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.13.8",
3
+ "version": "0.13.9",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "rimraf dist && vue-tsc && vite build --mode development",