@kengic/vue 0.5.16 → 0.5.17
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.
@@ -136,7 +136,10 @@ export declare const getProps: () => {
|
|
136
136
|
};
|
137
137
|
};
|
138
138
|
export declare type IKgFormProps = Partial<ExtractPropTypes<ReturnType<typeof getProps>>>;
|
139
|
-
/**
|
140
|
-
|
139
|
+
/**
|
140
|
+
* 依赖注入表单数据对象.
|
141
|
+
* 在表单组件(KgForm)的任何下级组件中, 都可以通过注入获取表单数据对象.
|
142
|
+
*/
|
143
|
+
export declare const DI_FORM_MODEL: InjectionKey<ComputedRef<Record<string, any>>>;
|
141
144
|
/** 依赖注入 formRef. */
|
142
145
|
export declare const DI_FORM_REF: InjectionKey<Ref<FormInstance | null>>;
|
@@ -1,9 +1,12 @@
|
|
1
|
+
import { Ref } from 'vue';
|
1
2
|
import { IRemoveEventListenerHandler } from '../../consts';
|
2
3
|
import { IKgSubmitBeforeOkCb, IKgSubmitCloseCb, IKgSubmitOkCb, IKgSubmitOpenCb, IKgSubmitStore } from './index.store';
|
3
4
|
export declare type IUseKgSubmit = {
|
4
5
|
formID: string;
|
5
6
|
/** 状态数据. */
|
6
7
|
store: IKgSubmitStore;
|
8
|
+
/** 表单数据对象. */
|
9
|
+
model: Ref<Record<string, any>>;
|
7
10
|
/** 监听事件: 打开抽屉. */
|
8
11
|
onOpen(cb: IKgSubmitOpenCb): IRemoveEventListenerHandler;
|
9
12
|
/** 监听事件: 关闭抽屉. 点击取消或者点击确定并且成功之后, 都会触发 */
|
@@ -37,10 +37,13 @@ export interface IKgSubmitState {
|
|
37
37
|
beforeOkListenersMap: Map<string, Array<IKgSubmitBeforeOkCb>>;
|
38
38
|
okListenersMap: Map<string, Array<IKgSubmitOkCb>>;
|
39
39
|
isLoadingMap: Map<string, boolean>;
|
40
|
+
/** 表单数据对象. */
|
41
|
+
modelMap: Map<string, Record<string, any>>;
|
40
42
|
}
|
41
43
|
export declare type IKgSubmitStoreDefinition = StoreDefinition<'KgSubmit', IKgSubmitState, {
|
42
44
|
/** 是否处于加载状态. */
|
43
45
|
isLoading(): (formID?: string | null) => boolean;
|
46
|
+
getModel(): (formID?: string | null) => Record<string, any> | null;
|
44
47
|
}, {
|
45
48
|
dispose(formID?: string | null): void;
|
46
49
|
addEventListener(formID: string, event: IKgSubmitEvent, cb: IKgSubmitCb): void;
|
@@ -53,6 +56,7 @@ export declare type IKgSubmitStoreDefinition = StoreDefinition<'KgSubmit', IKgSu
|
|
53
56
|
*/
|
54
57
|
emit(formID: string, event: IKgSubmitEvent, args?: any | null): Promise<boolean>;
|
55
58
|
setIsLoading(formID: string, value: boolean): void;
|
59
|
+
setModel(formID: string, model: Record<string, any>): void;
|
56
60
|
}>;
|
57
61
|
export declare type IKgSubmitStore = ReturnType<IKgSubmitStoreDefinition>;
|
58
62
|
export declare const useKgSubmitStore: () => IKgSubmitStoreDefinition;
|
@@ -11,7 +11,7 @@ export declare function isPathInApp(path: string | undefined | null, app: KG_APP
|
|
11
11
|
*/
|
12
12
|
export declare function getAppByPath(path: string): KG_APP;
|
13
13
|
/**
|
14
|
-
*
|
14
|
+
* 根据模块获取首页地址.
|
15
15
|
* @param app 模块.
|
16
16
|
*/
|
17
17
|
export declare function getAppIndexPath(app: KG_APP): string;
|