@harbor-design/proform 1.1.9 → 1.1.12
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.cjs +1 -1
- package/dist/index.js +464 -253
- package/dist/types/index.d.ts +1 -1
- package/dist/types/src/interactions/useFormPresetConfigurer.d.ts +2 -0
- package/dist/types/src/services/Context/index.d.ts +4 -0
- package/dist/types/src/services/{Effect.d.ts → Effect/index.d.ts} +2 -2
- package/dist/types/src/services/{FormCustomizer.d.ts → FormCustomizer/index.d.ts} +2 -2
- package/dist/types/src/services/Preset/AdapterPreset.d.ts +3 -0
- package/dist/types/src/services/{Preset.d.ts → Preset/RuntimePreset.d.ts} +2 -2
- package/dist/types/src/services/Preset/index.d.ts +14 -0
- package/dist/types/src/services/{Processor.d.ts → Processor/index.d.ts} +3 -3
- package/dist/types/src/services/RuntimeCore/RuntimeAdapter.d.ts +10 -0
- package/dist/types/src/services/RuntimeCore/RuntimeContainer.d.ts +9 -0
- package/dist/types/src/services/{RuntimeCore.d.ts → RuntimeCore/index.d.ts} +8 -5
- package/dist/types/src/types/adapter.d.ts +9 -0
- package/dist/types/src/types/contextTypes.d.ts +17 -7
- package/dist/types/src/types/formCustomizerTypes.d.ts +11 -10
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/runtimeTypes.d.ts +3 -0
- package/package.json +1 -1
- package/dist/types/src/interactions/useFormRenderer.d.ts +0 -4
- package/dist/types/src/services/Context.d.ts +0 -4
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as ProForm } from "./src/form/index";
|
|
2
2
|
export { useForm } from "./src/interactions/useForm";
|
|
3
|
-
export {
|
|
3
|
+
export { useFormPresetConfigurer } from "./src/interactions/useFormPresetConfigurer";
|
|
4
4
|
export { useModifiers } from "./src/interactions/useModifiers";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyFunction } from "
|
|
2
|
-
import { TrackEffectMeta } from "
|
|
1
|
+
import { AnyFunction } from "../../types";
|
|
2
|
+
import { TrackEffectMeta } from "../../types/effectTypes";
|
|
3
3
|
export default class Effect {
|
|
4
4
|
effects: Set<Function>;
|
|
5
5
|
constructor();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyObject, FormCustomization } from "
|
|
2
|
-
import { RuntimeCore } from "
|
|
1
|
+
import { AnyObject, FormCustomization } from "../../types";
|
|
2
|
+
import { RuntimeCore } from "../index";
|
|
3
3
|
export default class FormCustomizer {
|
|
4
4
|
formCustomization: FormCustomization;
|
|
5
5
|
runtimeCore: RuntimeCore;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
adapters: {
|
|
3
|
+
[x: string & {}]: import("../../types").AdaptedInterface;
|
|
4
|
+
ArcoVue: import("../../types").AdaptedInterface;
|
|
5
|
+
NutUI: import("../../types").AdaptedInterface;
|
|
6
|
+
NaiveUI: import("../../types").AdaptedInterface;
|
|
7
|
+
};
|
|
8
|
+
schemaPreset: Record<keyof import("../../types").ItemSchema, any> & {
|
|
9
|
+
children: any;
|
|
10
|
+
};
|
|
11
|
+
componentPropsPreset: import("../../types").AnyObject;
|
|
12
|
+
placeholderPresetByComponentName: {};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ref } from "vue";
|
|
2
|
-
import { AnyObject, Schema, ProxyedSchema, AnyFunction, ObjectParserRoot } from "
|
|
3
|
-
import { RuntimeCore } from "
|
|
4
|
-
import Effect from "
|
|
2
|
+
import { AnyObject, Schema, ProxyedSchema, AnyFunction, ObjectParserRoot } from "../../types";
|
|
3
|
+
import { RuntimeCore } from "..";
|
|
4
|
+
import Effect from "../Effect";
|
|
5
5
|
/**
|
|
6
6
|
* 基本描述
|
|
7
7
|
* 对于函数的命名,如果是动词相关,代表对过程的处理,如果是名词,代表一个处理器
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnyObject } from "../../types";
|
|
2
|
+
export default class RuntimeAdpter {
|
|
3
|
+
ui: string;
|
|
4
|
+
constructor(ui: string);
|
|
5
|
+
getRuntimeField(runtimeArgs: AnyObject): any;
|
|
6
|
+
getRuntimeRequired(runtimeArgs: AnyObject): any;
|
|
7
|
+
getFormModelPropName(): any;
|
|
8
|
+
formComponentRenderer(runtimeArgs: AnyObject): any;
|
|
9
|
+
clearValidate(runtimeArgs: AnyObject): any;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RuntimeOptions } from "../../types";
|
|
2
|
+
export default class RuntimeContainer {
|
|
3
|
+
static getFormContainer({ ui }?: RuntimeOptions): import("../../types").DomType;
|
|
4
|
+
static getFormItemContainer({ ui }?: RuntimeOptions): import("../../types").DomType;
|
|
5
|
+
static getItemContainer({ ui }?: RuntimeOptions): import("../../types").DomType;
|
|
6
|
+
static getGroupContainer({ ui }?: RuntimeOptions): import("../../types").DomType;
|
|
7
|
+
static getListContainer({ ui }?: RuntimeOptions): import("../../types").DomType;
|
|
8
|
+
static getListItemContainer({ ui }?: RuntimeOptions): import("../../types").DomType;
|
|
9
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Ref } from "vue";
|
|
2
|
-
import { Setup, Schema, AnyObject, ItemSchema, GroupSchema, ListSchema, ProcessorBySchemaType,
|
|
3
|
-
import Processor from "
|
|
4
|
-
import Effect from "
|
|
2
|
+
import { Setup, Schema, AnyObject, ItemSchema, GroupSchema, ListSchema, ProcessorBySchemaType, runtime, NativeCustomizationOptions } from "../../types";
|
|
3
|
+
import Processor from "../Processor";
|
|
4
|
+
import Effect from "../Effect";
|
|
5
|
+
import RuntimeAdpter from "./RuntimeAdapter";
|
|
5
6
|
export default class RuntimeCore {
|
|
6
7
|
setup: Setup;
|
|
7
8
|
processor: Processor;
|
|
@@ -11,12 +12,14 @@ export default class RuntimeCore {
|
|
|
11
12
|
formRef: Ref<AnyObject>;
|
|
12
13
|
hydrateEffect: Effect;
|
|
13
14
|
native: NativeCustomizationOptions;
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
grid: {};
|
|
16
|
+
runtime: runtime;
|
|
16
17
|
globalNativeFormOverride: {
|
|
17
18
|
props: {};
|
|
18
19
|
slots: {};
|
|
19
20
|
};
|
|
21
|
+
ui: string;
|
|
22
|
+
runtimeAdapter: RuntimeAdpter;
|
|
20
23
|
constructor(setup: Setup);
|
|
21
24
|
getRuntimeMeta(): {
|
|
22
25
|
model: AnyObject;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnyFunction } from ".";
|
|
2
|
+
export interface AdaptedInterface {
|
|
3
|
+
getRuntimeField: AnyFunction;
|
|
4
|
+
getRuntimeRequired: AnyFunction;
|
|
5
|
+
getFormModelPropName: AnyFunction;
|
|
6
|
+
formComponentRenderer: AnyFunction;
|
|
7
|
+
validateForm: AnyFunction;
|
|
8
|
+
clearValidate: AnyFunction;
|
|
9
|
+
}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
import { AdaptedInterface } from ".";
|
|
1
2
|
import { AnyObject } from "./utilTypes";
|
|
2
3
|
export type DomType = new (...args: any) => AnyObject & {
|
|
3
4
|
$props: AnyObject;
|
|
4
5
|
};
|
|
5
|
-
export interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
export interface FormPreset {
|
|
7
|
+
container: {
|
|
8
|
+
Form: DomType;
|
|
9
|
+
FormItem: DomType;
|
|
10
|
+
Item: DomType;
|
|
11
|
+
List: DomType;
|
|
12
|
+
ListItem: DomType;
|
|
13
|
+
Group: DomType;
|
|
14
|
+
};
|
|
15
|
+
adapter?: AdaptedInterface;
|
|
12
16
|
}
|
|
17
|
+
export type UIName = "ArcoVue" | "NutUI" | "NaiveUI" | (string & {});
|
|
18
|
+
export type AdaptedInterfacePreset = Record<UIName, AdaptedInterface>;
|
|
19
|
+
export type FormPresets = {
|
|
20
|
+
ui: UIName;
|
|
21
|
+
uiPresets: Partial<Record<UIName, FormPreset>>;
|
|
22
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject, DomType } from "./index";
|
|
1
|
+
import { AnyObject, DomType, UIName } from "./index";
|
|
2
2
|
export type SchemaType = "item" | "list" | "group";
|
|
3
3
|
export type FieldRule<T = any> = {
|
|
4
4
|
type?: "string" | "number" | "boolean" | "array" | "object" | "email" | "url" | "ip";
|
|
@@ -59,8 +59,8 @@ export interface ItemSchema {
|
|
|
59
59
|
required?: boolean;
|
|
60
60
|
placeholder?: string;
|
|
61
61
|
native?: NativeCustomizationOptions;
|
|
62
|
-
|
|
63
|
-
label
|
|
62
|
+
grid?: GridStyle;
|
|
63
|
+
label?: string;
|
|
64
64
|
field: string;
|
|
65
65
|
component: DomType;
|
|
66
66
|
componentProps?: AnyObject;
|
|
@@ -70,15 +70,15 @@ export interface GroupSchema {
|
|
|
70
70
|
type: "group";
|
|
71
71
|
label: string;
|
|
72
72
|
children: ProxyedSchema[];
|
|
73
|
-
|
|
73
|
+
grid?: GridStyle;
|
|
74
74
|
}
|
|
75
75
|
export interface ListSchema {
|
|
76
76
|
type: "list";
|
|
77
77
|
field: string;
|
|
78
78
|
label: string;
|
|
79
79
|
children: ProxyedSchema[];
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
grid?: GridStyle;
|
|
81
|
+
runtime?: runtime;
|
|
82
82
|
}
|
|
83
83
|
export type Schema = ItemSchema | GroupSchema | ListSchema;
|
|
84
84
|
export interface runtimeMeta {
|
|
@@ -89,13 +89,14 @@ export type ProFormProxy<T> = {
|
|
|
89
89
|
[K in keyof T]: ProFormProxyRule<T[K]>;
|
|
90
90
|
};
|
|
91
91
|
export type ProxyedSchema = ProFormProxy<ItemSchema | GroupSchema | ListSchema>;
|
|
92
|
-
export interface
|
|
93
|
-
|
|
92
|
+
export interface runtime {
|
|
93
|
+
customizeItemLabel?: (rawLabel: string, rawIndex: number) => any;
|
|
94
94
|
}
|
|
95
95
|
export interface FormCustomization {
|
|
96
|
-
|
|
96
|
+
ui?: UIName;
|
|
97
|
+
grid?: GridStyle;
|
|
97
98
|
native?: NativeCustomizationOptions;
|
|
98
|
-
|
|
99
|
+
runtime?: runtime;
|
|
99
100
|
schemas: ProxyedSchema[];
|
|
100
101
|
}
|
|
101
102
|
export type NativeCustomizationOptions = {
|
package/package.json
CHANGED