@king-one/form-design 0.0.4 → 0.0.6
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/CHANGELOG.md +12 -0
- package/dist/es/index.mjs +13 -11
- package/dist/es/src/components/form-desgin.mjs +32 -29
- package/dist/es/src/components/form-panel.vue.mjs +3 -1
- package/dist/es/src/components/form-setting.vue.mjs +40 -78
- package/dist/es/src/components/index.mjs +1 -0
- package/dist/es/src/components/props/form-config.vue.mjs +78 -0
- package/dist/es/src/components/props/form-config.vue2.mjs +4 -0
- package/dist/es/src/components/props/form-props.vue2.mjs +22 -21
- package/dist/es/src/components/props/index.mjs +3 -2
- package/dist/es/src/components/props/widget/index.mjs +41 -14
- package/dist/es/src/components/types.mjs +7 -1
- package/dist/es/src/config/index.mjs +1 -2
- package/dist/es/src/core/Design.mjs +10 -13
- package/dist/es/src/core/FormSchema.mjs +16 -21
- package/dist/es/src/hooks/use-monaco.mjs +38 -25
- package/dist/es/src/index.mjs +10 -9
- package/dist/lib/index.js +1 -1
- package/dist/lib/src/components/form-desgin.js +1 -1
- package/dist/lib/src/components/form-panel.vue.js +1 -1
- package/dist/lib/src/components/form-setting.vue.js +11 -1
- package/dist/lib/src/components/index.js +1 -1
- package/dist/lib/src/components/props/form-config.vue.js +1 -0
- package/dist/lib/src/components/props/form-config.vue2.js +1 -0
- package/dist/lib/src/components/props/form-props.vue2.js +1 -1
- package/dist/lib/src/components/props/index.js +1 -1
- package/dist/lib/src/components/props/widget/index.js +1 -1
- package/dist/lib/src/components/types.js +1 -1
- package/dist/lib/src/config/index.js +1 -1
- package/dist/lib/src/core/Design.js +1 -1
- package/dist/lib/src/core/FormSchema.js +1 -1
- package/dist/lib/src/hooks/use-monaco.js +1 -1
- package/dist/lib/src/index.js +1 -1
- package/dist/theme-chalk/form-config.css +1 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/setting.css +1 -1
- package/dist/types/src/components/form-setting.vue.d.ts +15 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/panel/index.d.ts +2 -2
- package/dist/types/src/components/props/form-config.vue.d.ts +30 -0
- package/dist/types/src/components/props/index.d.ts +1 -0
- package/dist/types/src/components/props/widget/index.d.ts +8 -3
- package/dist/types/src/components/types.d.ts +11 -1
- package/dist/types/src/core/Design.d.ts +10 -14
- package/dist/types/src/core/FormSchema.d.ts +4 -8
- package/dist/types/src/hooks/use-monaco.d.ts +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/types.d.ts +7 -7
- package/package.json +1 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { FieldSchema,
|
|
1
|
+
import { FieldSchema, valueType } from '@king-one/form-design/src/types';
|
|
2
2
|
import { Field } from './Field';
|
|
3
|
-
import { Ref, VNode
|
|
3
|
+
import { Ref, VNode } from 'vue';
|
|
4
4
|
export declare class FormSchema {
|
|
5
5
|
private version;
|
|
6
|
-
formProps: FormProps;
|
|
7
6
|
fields: Ref<{
|
|
8
7
|
title: string;
|
|
9
8
|
key: string;
|
|
10
9
|
type: valueType;
|
|
11
|
-
'k-component'
|
|
10
|
+
'k-component'?: string | undefined;
|
|
12
11
|
enum?: any[] | undefined;
|
|
13
12
|
items?: any[] | undefined;
|
|
14
13
|
children?: any[] | undefined;
|
|
@@ -32,7 +31,7 @@ export declare class FormSchema {
|
|
|
32
31
|
title: string;
|
|
33
32
|
key: string;
|
|
34
33
|
type: valueType;
|
|
35
|
-
'k-component'
|
|
34
|
+
'k-component'?: string | undefined;
|
|
36
35
|
enum?: any[] | undefined;
|
|
37
36
|
items?: any[] | undefined;
|
|
38
37
|
children?: any[] | undefined;
|
|
@@ -57,9 +56,6 @@ export declare class FormSchema {
|
|
|
57
56
|
version: string;
|
|
58
57
|
form: {
|
|
59
58
|
schema: {};
|
|
60
|
-
layout: "horizontal" | "vertical";
|
|
61
|
-
labelAlign: "left" | "right" | "top";
|
|
62
|
-
style?: CSSProperties;
|
|
63
59
|
};
|
|
64
60
|
};
|
|
65
61
|
getFieldList(): Field[];
|
|
@@ -2,6 +2,7 @@ export { default as FormPanelItem } from './components/panel/panel-item.vue';
|
|
|
2
2
|
export { useInjectDesignContext } from './context/design';
|
|
3
3
|
export { default as FormDesign } from './components/form-desgin';
|
|
4
4
|
export { CreateFormDesign } from './core/index';
|
|
5
|
+
export { FormConfig } from './components';
|
|
5
6
|
export * from './config';
|
|
6
7
|
export * from './effects/onEffects';
|
|
7
8
|
export type { DesignSchema } from './types';
|
|
@@ -2,6 +2,7 @@ import { CSSProperties, Component, VNode } from 'vue';
|
|
|
2
2
|
import { FormDesign } from './core/Design';
|
|
3
3
|
import { LifeCycleInstance } from './effects/types';
|
|
4
4
|
import { Plugin } from './plugins';
|
|
5
|
+
export type { ExpandPropsType } from './components/types';
|
|
5
6
|
export type PluginInterface = InstanceType<typeof Plugin>;
|
|
6
7
|
export declare const valueTypeMap: {
|
|
7
8
|
string: string;
|
|
@@ -21,7 +22,7 @@ export interface FieldSchema {
|
|
|
21
22
|
'title': string;
|
|
22
23
|
'key': string;
|
|
23
24
|
'type': valueType;
|
|
24
|
-
'k-component'
|
|
25
|
+
'k-component'?: string;
|
|
25
26
|
'enum'?: any[];
|
|
26
27
|
'items'?: FieldSchema[];
|
|
27
28
|
'children'?: FieldSchema[];
|
|
@@ -48,8 +49,8 @@ export interface DesignSchema {
|
|
|
48
49
|
widget?: FieldSchema[];
|
|
49
50
|
}
|
|
50
51
|
type PromiseFn<T> = () => Promise<T>;
|
|
51
|
-
export type
|
|
52
|
-
export interface
|
|
52
|
+
export type ComponentWidgetType = PromiseFn<Component> | Component;
|
|
53
|
+
export interface PropsWidgetType {
|
|
53
54
|
component: Component[];
|
|
54
55
|
defaultValues?: Record<string, any>;
|
|
55
56
|
rules?: any;
|
|
@@ -61,8 +62,8 @@ export interface DesignParams {
|
|
|
61
62
|
key: string;
|
|
62
63
|
component: PromiseFn<Component> | Component;
|
|
63
64
|
}[];
|
|
64
|
-
propsWidgets?: Record<string,
|
|
65
|
-
panelWidgets?: Record<string,
|
|
65
|
+
propsWidgets?: Record<string, PropsWidgetType>;
|
|
66
|
+
panelWidgets?: Record<string, ComponentWidgetType>;
|
|
66
67
|
effects?: () => void;
|
|
67
68
|
}
|
|
68
69
|
export type FormDesignInstance = InstanceType<typeof FormDesign>;
|
|
@@ -76,5 +77,4 @@ export interface FormDesignPlugin {
|
|
|
76
77
|
name: string;
|
|
77
78
|
install: (app: PluginInterface, ...options: any[]) => void;
|
|
78
79
|
}
|
|
79
|
-
export type widgetPropsType = Record<string,
|
|
80
|
-
export {};
|
|
80
|
+
export type widgetPropsType = Record<string, PropsWidgetType>;
|