@okyiww/form 0.0.8 → 0.0.10
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.
- package/dist/index.js +2554 -2449
- package/dist/types/core/lifecycle/Model/index.d.ts +1 -0
- package/dist/types/core/lifecycle/hooks/useLookup.d.ts +7 -0
- package/dist/types/core/runtime/index.d.ts +7 -2
- package/dist/types/helpers/namesToRemember/index.d.ts +1 -0
- package/dist/types/helpers/useForm/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ export default class Model {
|
|
|
11
11
|
*/
|
|
12
12
|
relationMap: Map<string, any>;
|
|
13
13
|
model: import('vue').Ref<Record<string, any>, Record<string, any>>;
|
|
14
|
+
triggerLookup(): void;
|
|
14
15
|
immutableModel: {};
|
|
15
16
|
allConsumed: import('vue').Ref<boolean, boolean>;
|
|
16
17
|
processRelation(metadata: Metadata, value: any): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ParsedSchema } from '../Schema/types';
|
|
2
|
+
import { default as Runtime } from '../../runtime';
|
|
3
|
+
/**
|
|
4
|
+
* 该函数就像是一个 pipe,在这个时候只记录处理定义和必要元信息,真正触发的时候再根据 path 去动态处理结果
|
|
5
|
+
*/
|
|
6
|
+
export declare function useLookup(schema: ParsedSchema, fieldTarget: string, runtime: Runtime): void;
|
|
7
|
+
export declare function useLookupProcess(path: string, value: any, runtime: Runtime): void;
|
|
@@ -7,6 +7,7 @@ import { default as Schema } from '../lifecycle/Schema';
|
|
|
7
7
|
import { default as Update } from '../lifecycle/Update';
|
|
8
8
|
import { Component } from '../../helpers/defineFormSetup/types';
|
|
9
9
|
import { UseFormOptions } from '../../helpers/useForm/types';
|
|
10
|
+
import { ComputedRef, Ref } from 'vue';
|
|
10
11
|
export default class Runtime {
|
|
11
12
|
_schema: Schema;
|
|
12
13
|
_model: Model;
|
|
@@ -26,12 +27,16 @@ export default class Runtime {
|
|
|
26
27
|
err: string;
|
|
27
28
|
args: string;
|
|
28
29
|
};
|
|
30
|
+
lookups: Ref<Map<string, any>>;
|
|
31
|
+
lookupResults: Ref<Map<string, any>>;
|
|
29
32
|
constructor(options: UseFormOptions);
|
|
33
|
+
getLookupResults(): ComputedRef<Map<string, any>>;
|
|
34
|
+
getLookupResults(path: string): ComputedRef<any>;
|
|
30
35
|
processSSR(options: UseFormOptions): void;
|
|
31
36
|
render(): Component;
|
|
32
37
|
submit(): Promise<Record<string, any>>;
|
|
33
38
|
share(shared: AnyObject): void;
|
|
34
39
|
isReady(handler: AnyFunction): void;
|
|
35
|
-
hydrate(model: AnyObject):
|
|
36
|
-
getFormRef():
|
|
40
|
+
hydrate(model: AnyObject): Promise<unknown>;
|
|
41
|
+
getFormRef(): Ref<any, any>;
|
|
37
42
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function transformModelByRememberedNames(model: AnyObject, namesToRemember: Record<string, string>): AnyObject;
|
|
@@ -2,10 +2,12 @@ import { SSR } from '../../core/context/types';
|
|
|
2
2
|
import { RawSchemas } from '../defineFormSchema/types';
|
|
3
3
|
export type UseFormOptions = {
|
|
4
4
|
templateId?: string;
|
|
5
|
+
noAutoLookup?: boolean;
|
|
5
6
|
schemas: RawSchemas | ((...args: any[]) => RawSchemas) | ((...args: any[]) => Promise<RawSchemas>);
|
|
6
7
|
layoutGap?: number;
|
|
7
8
|
listLayoutGap?: number;
|
|
8
9
|
formProps?: any;
|
|
9
10
|
formSlots?: any;
|
|
10
11
|
ssr?: SSR;
|
|
12
|
+
namesToRemember?: Record<string, string>;
|
|
11
13
|
};
|