@kengic/vue 0.10.2-beta.0 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/kengic-vue.js +1064 -953
- package/dist/src/src/components/KgForm/index.hooks.d.ts +7 -1
- package/dist/src/src/components/KgForm/index.store.d.ts +17 -7
- package/dist/src/src/components/KgForm.Item/components/KgForm.Item.Select.d.ts +2 -2
- package/dist/src/src/components/KgSubmit/index.hooks.d.ts +7 -1
- package/dist/src/src/components/KgSubmit/index.store.d.ts +14 -3
- package/dist/src/src/components/KgVar/index.store.d.ts +26 -6
- package/package.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import { IRemoveEventListenerHandler } from '../../consts';
|
2
|
-
import { IKgFormLookupBeforeOkCb, IKgFormLookupOkCb, IKgFormSelectChangeCb, IKgFormStore } from './index.store';
|
2
|
+
import { IKgFormLookupBeforeOkCb, IKgFormLookupBeforeOpenCb, IKgFormLookupOkCb, IKgFormSelectChangeCb, IKgFormStore } from './index.store';
|
3
3
|
export declare type IUseKgForm = {
|
4
4
|
formID: string;
|
5
5
|
/** 状态数据. */
|
@@ -9,6 +9,12 @@ export declare type IUseKgForm = {
|
|
9
9
|
* @param once 是否只会触发一次. 默认为 undefined.
|
10
10
|
*/
|
11
11
|
onSelectChange(cb: IKgFormSelectChangeCb, once?: boolean): IRemoveEventListenerHandler;
|
12
|
+
/**
|
13
|
+
* 监听事件: 查找弹窗打开之前.
|
14
|
+
* @param cb 回调函数.
|
15
|
+
* @param once 是否只会触发一次. 默认为 undefined.
|
16
|
+
*/
|
17
|
+
onLookupBeforeOpen(cb: IKgFormLookupBeforeOpenCb, once?: boolean): IRemoveEventListenerHandler;
|
12
18
|
/**
|
13
19
|
* 监听事件: 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件.
|
14
20
|
* @param cb 回调函数.
|
@@ -4,11 +4,12 @@ import { IKgEventCb } from '../../consts';
|
|
4
4
|
import { IKgTableRow } from '../KgTable';
|
5
5
|
/**
|
6
6
|
* 事件类型.
|
7
|
-
* 'selectChange':
|
8
|
-
* '
|
9
|
-
* '
|
7
|
+
* 'selectChange': 下拉列表选中某个(可能多个)数据
|
8
|
+
* 'lookupBeforeOpen': 查找弹窗打开之前
|
9
|
+
* 'lookupBeforeOk': 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件
|
10
|
+
* 'lookupOk': 查找弹窗点击确定
|
10
11
|
*/
|
11
|
-
export declare type IKgFormEvent = 'selectChange' | 'lookupBeforeOk' | 'lookupOk';
|
12
|
+
export declare type IKgFormEvent = 'selectChange' | 'lookupBeforeOpen' | 'lookupBeforeOk' | 'lookupOk';
|
12
13
|
/** 事件监听函数: selectChange. */
|
13
14
|
export declare type IKgFormSelectChangeCbParam = {
|
14
15
|
/** 变量. */
|
@@ -17,6 +18,14 @@ export declare type IKgFormSelectChangeCbParam = {
|
|
17
18
|
rows: any | null;
|
18
19
|
};
|
19
20
|
export declare type IKgFormSelectChangeCb = ((param: IKgFormSelectChangeCbParam) => Promise<boolean>) & IKgEventCb;
|
21
|
+
/** 事件监听函数: lookupBeforeOpen. */
|
22
|
+
export declare type IKgFormLookupBeforeOpenCbParam = {
|
23
|
+
/** 变量. */
|
24
|
+
var_nam: string;
|
25
|
+
/** 查找弹出的界面标识. */
|
26
|
+
lookupFormID: string;
|
27
|
+
};
|
28
|
+
export declare type IKgFormLookupBeforeOpenCb = ((param: IKgFormLookupBeforeOpenCbParam) => Promise<boolean>) & IKgEventCb;
|
20
29
|
/** 事件监听函数: lookupBeforeOk. */
|
21
30
|
export declare type IKgFormLookupBeforeOkCbParam = {
|
22
31
|
/** 变量. */
|
@@ -51,12 +60,13 @@ export declare type IKgFormLookupOkCbParam = {
|
|
51
60
|
rows?: Array<IKgTableRow> | null;
|
52
61
|
};
|
53
62
|
export declare type IKgFormLookupOkCb = ((param: IKgFormLookupOkCbParam) => Promise<boolean>) & IKgEventCb;
|
54
|
-
export declare type IKgFormCbParam = IKgFormLookupBeforeOkCbParam | IKgFormLookupOkCbParam | IKgFormSelectChangeCbParam;
|
55
|
-
export declare type IKgFormCb = IKgFormLookupBeforeOkCb | IKgFormLookupOkCb | IKgFormSelectChangeCb;
|
63
|
+
export declare type IKgFormCbParam = IKgFormLookupBeforeOpenCbParam | IKgFormLookupBeforeOkCbParam | IKgFormLookupOkCbParam | IKgFormSelectChangeCbParam;
|
64
|
+
export declare type IKgFormCb = IKgFormLookupBeforeOpenCb | IKgFormLookupBeforeOkCb | IKgFormLookupOkCb | IKgFormSelectChangeCb;
|
56
65
|
export interface IKgFormState {
|
57
66
|
selectChangeListenersMap: Map<string, Array<IKgFormSelectChangeCb>>;
|
58
|
-
|
67
|
+
lookupBeforeOpenListenersMap: Map<string, Array<IKgFormLookupBeforeOpenCb>>;
|
59
68
|
lookupBeforeOkListenersMap: Map<string, Array<IKgFormLookupBeforeOkCb>>;
|
69
|
+
lookupOkListenersMap: Map<string, Array<IKgFormLookupOkCb>>;
|
60
70
|
}
|
61
71
|
export declare type IKgFormStoreDefinition = StoreDefinition<'KgForm', IKgFormState, {}, {
|
62
72
|
addEventListener(frm_id: string, event: IKgFormEvent, cb: IKgFormCb): void;
|
@@ -19,8 +19,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
19
19
|
type: import("vue").PropType<boolean>;
|
20
20
|
default: boolean;
|
21
21
|
};
|
22
|
-
/** 获取下拉列表数据. */
|
23
22
|
kgAllowClear: {
|
23
|
+
/** 获取下拉列表数据. */
|
24
24
|
type: import("vue").PropType<boolean>;
|
25
25
|
default: boolean;
|
26
26
|
};
|
@@ -60,8 +60,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
60
60
|
type: import("vue").PropType<boolean>;
|
61
61
|
default: boolean;
|
62
62
|
};
|
63
|
-
/** 获取下拉列表数据. */
|
64
63
|
kgAllowClear: {
|
64
|
+
/** 获取下拉列表数据. */
|
65
65
|
type: import("vue").PropType<boolean>;
|
66
66
|
default: boolean;
|
67
67
|
};
|
@@ -2,7 +2,7 @@ import { RuleObject } from 'ant-design-vue/es/form';
|
|
2
2
|
import { FormInstance } from 'ant-design-vue/lib/form/Form';
|
3
3
|
import { Ref } from 'vue';
|
4
4
|
import { IRemoveEventListenerHandler, KG_VAR_SUBMIT__DISPLAY_TYPE } from '../../consts';
|
5
|
-
import { IKgSubmitAfterValidateCb, IKgSubmitBeforeOkCb, IKgSubmitBeforeRequestCb, IKgSubmitCloseCb, IKgSubmitErrorCb, IKgSubmitOkCb, IKgSubmitOpenCb, IKgSubmitStore } from './index.store';
|
5
|
+
import { IKgSubmitAfterValidateCb, IKgSubmitBeforeOkCb, IKgSubmitBeforeOpenCb, IKgSubmitBeforeRequestCb, IKgSubmitCloseCb, IKgSubmitErrorCb, IKgSubmitOkCb, IKgSubmitOpenCb, IKgSubmitStore } from './index.store';
|
6
6
|
export declare type IUseKgSubmit = {
|
7
7
|
formID: string;
|
8
8
|
/** 状态数据. */
|
@@ -13,6 +13,12 @@ export declare type IUseKgSubmit = {
|
|
13
13
|
rules: Ref<Record<string, Array<RuleObject>>>;
|
14
14
|
/** 显示方式. */
|
15
15
|
displayType: Ref<KG_VAR_SUBMIT__DISPLAY_TYPE>;
|
16
|
+
/**
|
17
|
+
* 监听事件: 打开弹窗之前.
|
18
|
+
* @param cb 回调函数.
|
19
|
+
* @param once 是否只会触发一次. 默认为 undefined.
|
20
|
+
* */
|
21
|
+
onBeforeOpen(cb: IKgSubmitBeforeOpenCb, once?: boolean): IRemoveEventListenerHandler;
|
16
22
|
/**
|
17
23
|
* 监听事件: 打开弹窗.
|
18
24
|
* @param cb 回调函数.
|
@@ -6,6 +6,7 @@ import { IKgEventCb } from '../../consts';
|
|
6
6
|
import { IKgTableRow } from '../KgTable';
|
7
7
|
/**
|
8
8
|
* 事件类型.
|
9
|
+
* 'beforeOpen': 打开弹窗之前
|
9
10
|
* 'open': 打开弹窗
|
10
11
|
* 'beforeOk': 点击保存按钮之后, 执行默认逻辑之前
|
11
12
|
* 'afterValidate': 表单验证成功
|
@@ -14,7 +15,16 @@ import { IKgTableRow } from '../KgTable';
|
|
14
15
|
* 'error': 请求失败. 请求失败了, 或者请求返回了错误消息
|
15
16
|
* 'close': 关闭弹窗
|
16
17
|
*/
|
17
|
-
export declare type IKgSubmitEvent = 'open' | 'beforeOk' | 'afterValidate' | 'beforeRequest' | 'ok' | 'error' | 'close';
|
18
|
+
export declare type IKgSubmitEvent = 'beforeOpen' | 'open' | 'beforeOk' | 'afterValidate' | 'beforeRequest' | 'ok' | 'error' | 'close';
|
19
|
+
/** 事件监听函数: beforeOpen. */
|
20
|
+
export declare type IKgSubmitBeforeOpenCbParam = {
|
21
|
+
isCreating: boolean | null;
|
22
|
+
isUpdating: boolean | null;
|
23
|
+
isCopying: boolean | null;
|
24
|
+
isDeleting: boolean | null;
|
25
|
+
row: IKgTableRow | null;
|
26
|
+
};
|
27
|
+
export declare type IKgSubmitBeforeOpenCb = ((param: IKgSubmitBeforeOpenCbParam) => Promise<boolean>) & IKgEventCb;
|
18
28
|
/** 事件监听函数: open. */
|
19
29
|
export declare type IKgSubmitOpenCbParam = {
|
20
30
|
isCreating: boolean | null;
|
@@ -74,9 +84,10 @@ export declare type IKgSubmitOkCb = ((param: IKgSubmitOkCbParam) => Promise<bool
|
|
74
84
|
export declare type IKgSubmitErrorCb = ((param: any) => Promise<boolean>) & IKgEventCb;
|
75
85
|
/** 事件监听函数: close. */
|
76
86
|
export declare type IKgSubmitCloseCb = ((param?: any | null) => Promise<boolean>) & IKgEventCb;
|
77
|
-
export declare type IKgSubmitCbParam = IKgSubmitOpenCbParam | IKgSubmitBeforeOkCbParam | IKgSubmitAfterValidateCbParam | IKgSubmitBeforeRequestCbParam | IKgSubmitOkCbParam | null;
|
78
|
-
export declare type IKgSubmitCb = IKgSubmitOpenCb | IKgSubmitBeforeOkCb | IKgSubmitAfterValidateCb | IKgSubmitBeforeRequestCb | IKgSubmitOkCb | IKgSubmitErrorCb | IKgSubmitCloseCb;
|
87
|
+
export declare type IKgSubmitCbParam = IKgSubmitBeforeOpenCbParam | IKgSubmitOpenCbParam | IKgSubmitBeforeOkCbParam | IKgSubmitAfterValidateCbParam | IKgSubmitBeforeRequestCbParam | IKgSubmitOkCbParam | null;
|
88
|
+
export declare type IKgSubmitCb = IKgSubmitBeforeOpenCb | IKgSubmitOpenCb | IKgSubmitBeforeOkCb | IKgSubmitAfterValidateCb | IKgSubmitBeforeRequestCb | IKgSubmitOkCb | IKgSubmitErrorCb | IKgSubmitCloseCb;
|
79
89
|
export interface IKgSubmitState {
|
90
|
+
beforeOpenListenersMap: Map<string, Array<IKgSubmitBeforeOpenCb>>;
|
80
91
|
openListenersMap: Map<string, Array<IKgSubmitOpenCb>>;
|
81
92
|
beforeOkListenersMap: Map<string, Array<IKgSubmitBeforeOkCb>>;
|
82
93
|
afterValidateListenersMap: Map<string, Array<IKgSubmitAfterValidateCb>>;
|
@@ -115,26 +115,42 @@ export declare type IKgVarStoreDefinition = StoreDefinition<'KgVar', IKgVarState
|
|
115
115
|
getVarSubmitFieldsForCreate(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
116
116
|
/** 获取创建时的提交字段: 关键字段. */
|
117
117
|
getVarSubmitFieldsForCreateKey(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
118
|
-
/** 获取创建时的提交字段:
|
118
|
+
/** 获取创建时的提交字段: 普通字段. */
|
119
119
|
getVarSubmitFieldsForCreateNotKey(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
120
|
+
/** 获取创建时的提交字段: 关键字段, 并且可见. */
|
121
|
+
getVarSubmitFieldsForCreateKeyVisible(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
122
|
+
/** 获取创建时的提交字段: 普通字段, 并且可见. */
|
123
|
+
getVarSubmitFieldsForCreateNotKeyVisible(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
120
124
|
/** 获取更新时的提交字段. */
|
121
125
|
getVarSubmitFieldsForUpdate(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
122
126
|
/** 获取更新时的提交字段: 关键字段. */
|
123
127
|
getVarSubmitFieldsForUpdateKey(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
124
|
-
/** 获取更新时的提交字段:
|
128
|
+
/** 获取更新时的提交字段: 普通字段. */
|
125
129
|
getVarSubmitFieldsForUpdateNotKey(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
130
|
+
/** 获取更新时的提交字段: 关键字段, 并且可见. */
|
131
|
+
getVarSubmitFieldsForUpdateKeyVisible(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
132
|
+
/** 获取更新时的提交字段: 普通字段, 并且可见. */
|
133
|
+
getVarSubmitFieldsForUpdateNotKeyVisible(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
126
134
|
/** 获取复制时的提交字段. */
|
127
135
|
getVarSubmitFieldsForCopy(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
128
136
|
/** 获取复制时的提交字段: 关键字段. */
|
129
137
|
getVarSubmitFieldsForCopyKey(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
130
|
-
/** 获取复制时的提交字段:
|
138
|
+
/** 获取复制时的提交字段: 普通字段. */
|
131
139
|
getVarSubmitFieldsForCopyNotKey(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
140
|
+
/** 获取复制时的提交字段: 关键字段, 并且可见. */
|
141
|
+
getVarSubmitFieldsForCopyKeyVisible(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
142
|
+
/** 获取复制时的提交字段: 普通字段, 并且可见. */
|
143
|
+
getVarSubmitFieldsForCopyNotKeyVisible(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
132
144
|
/** 获取删除时的提交字段. */
|
133
145
|
getVarSubmitFieldsForDelete(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
134
146
|
/** 获取删除时的提交字段: 关键字段. */
|
135
147
|
getVarSubmitFieldsForDeleteKey(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
136
|
-
/** 获取删除时的提交字段:
|
148
|
+
/** 获取删除时的提交字段: 普通字段. */
|
137
149
|
getVarSubmitFieldsForDeleteNotKey(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
150
|
+
/** 获取删除时的提交字段: 关键字段, 并且可见. */
|
151
|
+
getVarSubmitFieldsForDeleteKeyVisible(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
152
|
+
/** 获取删除时的提交字段: 普通字段, 并且可见. */
|
153
|
+
getVarSubmitFieldsForDeleteNotKeyVisible(): (frm_id?: string | null) => Array<VarSubmitField> | null;
|
138
154
|
getVarSubmitField(): (frm_id?: string | null, var_nam?: string | null) => VarSubmitField | null;
|
139
155
|
getVarButton(): (frm_id?: string | null, var_nam?: string | null) => VarButton | null;
|
140
156
|
getVarButtonConfig(): (frm_id?: string | null) => VarButtonConfig | null;
|
@@ -174,6 +190,11 @@ export declare type IKgVarStoreDefinition = StoreDefinition<'KgVar', IKgVarState
|
|
174
190
|
getCurrentVisibleVarGridDetails(): (frm_id?: string | null) => Array<VarGridDetail> | null;
|
175
191
|
getCurrentVisibleVarGridDetailsTotalWidth(): (frm_id?: string | null) => number | null;
|
176
192
|
}, {
|
193
|
+
/**
|
194
|
+
* 清理数据.
|
195
|
+
* @param frm_id 页面标识.
|
196
|
+
*/
|
197
|
+
dispose(frm_id: string): void;
|
177
198
|
/**
|
178
199
|
* 注册事件监听.
|
179
200
|
* @param frm_id 界面标识.
|
@@ -196,7 +217,6 @@ export declare type IKgVarStoreDefinition = StoreDefinition<'KgVar', IKgVarState
|
|
196
217
|
*/
|
197
218
|
emit(frm_id: string, event: IKgVarEvent, args?: any): void;
|
198
219
|
enter(frm_id: IFormID): Promise<void>;
|
199
|
-
leave(frm_id: string): void;
|
200
220
|
/**
|
201
221
|
* 查询所有变量配置.
|
202
222
|
* @param frm_id 界面标识.
|
@@ -276,7 +296,7 @@ export declare type IKgVarStoreDefinition = StoreDefinition<'KgVar', IKgVarState
|
|
276
296
|
* @param var_nam 变量名称
|
277
297
|
* @param properties 要修改的部分属性.
|
278
298
|
*/
|
279
|
-
patchVarPossibilityCommandParameter(frm_id: string | null | undefined, var_nam: string | null | undefined, properties: Record<string, any>): void
|
299
|
+
patchVarPossibilityCommandParameter(frm_id: string | null | undefined, var_nam: string | null | undefined, properties: Record<string, any>): Promise<void>;
|
280
300
|
/**
|
281
301
|
* 拖拽排序 VarGridDetail 列表.
|
282
302
|
* @param frm_id 界面标识.
|