@king-one/form-design 0.0.16 → 0.0.18
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 +16 -13
- package/dist/es/src/components/base/Carousel.vue.mjs +92 -0
- package/dist/es/src/components/base/Carousel.vue2.mjs +4 -0
- package/dist/es/src/components/base/json-preview.vue.mjs +215 -151
- package/dist/es/src/components/form-material.vue.mjs +168 -96
- package/dist/es/src/components/form-panel.vue.mjs +71 -65
- package/dist/es/src/components/panel/index.mjs +23 -13
- package/dist/es/src/components/panel/panel-item.vue.mjs +29 -29
- package/dist/es/src/components/panel/panel-wrapper.mjs +1 -1
- package/dist/es/src/components/panel/widget/date-range.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/date-range.vue2.mjs +28 -0
- package/dist/es/src/components/panel/widget/date-single.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/date-single.vue2.mjs +28 -0
- package/dist/es/src/components/panel/widget/kit.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/kit.vue2.mjs +48 -0
- package/dist/es/src/components/panel/widget/object.vue2.mjs +25 -25
- package/dist/es/src/components/panel/widget/select.vue2.mjs +3 -3
- package/dist/es/src/components/props/form-config.vue.mjs +1 -1
- package/dist/es/src/components/props/widget/BaseProps.vue2.mjs +31 -46
- package/dist/es/src/components/props/widget/InputNumberProps.vue2.mjs +94 -109
- package/dist/es/src/components/props/widget/InputProps.vue2.mjs +49 -64
- package/dist/es/src/components/props/widget/OvertimeProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/OvertimeProps.vue2.mjs +17 -0
- package/dist/es/src/components/props/widget/PropsDecorator.mjs +34 -0
- package/dist/es/src/components/props/widget/SelectProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/SelectProps.vue2.mjs +88 -0
- package/dist/es/src/components/props/widget/TextareaProps.vue2.mjs +48 -63
- package/dist/es/src/components/props/widget/index.mjs +44 -36
- package/dist/es/src/config/index.mjs +165 -15
- package/dist/es/src/core/Design.mjs +24 -19
- package/dist/es/src/core/Field.mjs +1 -1
- package/dist/es/src/core/FormSchema.mjs +28 -26
- package/dist/es/src/index.mjs +15 -13
- package/dist/es/src/plugins/index.mjs +10 -7
- package/dist/es/src/plugins/modules/drag-put.mjs +14 -0
- package/dist/es/src/utils/debounce.mjs +16 -0
- package/dist/es/src/utils/index.mjs +15 -13
- package/dist/lib/index.js +1 -1
- package/dist/lib/src/components/base/Carousel.vue.js +1 -0
- package/dist/lib/src/components/base/Carousel.vue2.js +1 -0
- package/dist/lib/src/components/base/json-preview.vue.js +6 -6
- package/dist/lib/src/components/form-material.vue.js +10 -1
- package/dist/lib/src/components/form-panel.vue.js +2 -2
- package/dist/lib/src/components/panel/index.js +1 -1
- package/dist/lib/src/components/panel/panel-item.vue.js +1 -1
- package/dist/lib/src/components/panel/panel-wrapper.js +1 -1
- package/dist/lib/src/components/panel/widget/date-range.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/date-range.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/date-single.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/date-single.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/kit.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/kit.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/object.vue2.js +1 -1
- package/dist/lib/src/components/panel/widget/select.vue2.js +1 -1
- package/dist/lib/src/components/props/form-config.vue.js +1 -1
- package/dist/lib/src/components/props/widget/BaseProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/InputNumberProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/InputProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/OvertimeProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/OvertimeProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/PropsDecorator.js +1 -0
- package/dist/lib/src/components/props/widget/SelectProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/SelectProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/TextareaProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/index.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/Field.js +1 -1
- package/dist/lib/src/core/FormSchema.js +1 -1
- package/dist/lib/src/index.js +1 -1
- package/dist/lib/src/plugins/index.js +1 -1
- package/dist/lib/src/plugins/modules/drag-put.js +1 -0
- package/dist/lib/src/utils/debounce.js +1 -0
- package/dist/lib/src/utils/index.js +1 -1
- package/dist/theme-chalk/carousel.css +1 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/json-preview.css +1 -1
- package/dist/theme-chalk/kit-panel.css +1 -0
- package/dist/theme-chalk/material.css +1 -1
- package/dist/theme-chalk/panel.css +1 -1
- package/dist/types/src/components/base/Carousel.vue.d.ts +65 -0
- package/dist/types/src/components/panel/widget/date-range.vue.d.ts +8 -0
- package/dist/types/src/components/panel/widget/date-single.vue.d.ts +8 -0
- package/dist/types/src/components/panel/widget/kit.vue.d.ts +8 -0
- package/dist/types/src/components/props/widget/OvertimeProps.vue.d.ts +3 -0
- package/dist/types/src/components/props/widget/PropsDecorator.d.ts +3 -0
- package/dist/types/src/components/props/widget/SelectProps.vue.d.ts +3 -0
- package/dist/types/src/components/props/widget/index.d.ts +1 -9
- package/dist/types/src/components/types.d.ts +4 -3
- package/dist/types/src/config/index.d.ts +2 -1
- package/dist/types/src/core/Design.d.ts +93 -41
- package/dist/types/src/core/FormSchema.d.ts +22 -10
- package/dist/types/src/hooks/usePolling.d.ts +5 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/plugins/index.d.ts +3 -1
- package/dist/types/src/plugins/modules/drag-put.d.ts +5 -0
- package/dist/types/src/types.d.ts +29 -6
- package/dist/types/src/utils/debounce.d.ts +10 -0
- package/dist/types/src/utils/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { DefineComponent, ExtractPropTypes, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare function goTo(index: number): void;
|
|
3
|
+
declare function next(): void;
|
|
4
|
+
declare function prev(): void;
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
slots: {
|
|
7
|
+
default?(_: {}): any;
|
|
8
|
+
};
|
|
9
|
+
refs: {
|
|
10
|
+
trackRef: HTMLDivElement;
|
|
11
|
+
};
|
|
12
|
+
attrs: Partial<{}>;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: NumberConstructor;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
isAnimating: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
direction: {
|
|
25
|
+
type: () => "horizontal" | "vertical";
|
|
26
|
+
default: string;
|
|
27
|
+
validator: (value: string) => boolean;
|
|
28
|
+
};
|
|
29
|
+
}>, {
|
|
30
|
+
next: typeof next;
|
|
31
|
+
prev: typeof prev;
|
|
32
|
+
goTo: typeof goTo;
|
|
33
|
+
currentIndex: Ref<number, number>;
|
|
34
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
35
|
+
"update:modelValue": (...args: any[]) => void;
|
|
36
|
+
afterChange: (...args: any[]) => void;
|
|
37
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
38
|
+
modelValue: {
|
|
39
|
+
type: NumberConstructor;
|
|
40
|
+
default: number;
|
|
41
|
+
};
|
|
42
|
+
isAnimating: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
default: boolean;
|
|
45
|
+
};
|
|
46
|
+
direction: {
|
|
47
|
+
type: () => "horizontal" | "vertical";
|
|
48
|
+
default: string;
|
|
49
|
+
validator: (value: string) => boolean;
|
|
50
|
+
};
|
|
51
|
+
}>> & Readonly<{
|
|
52
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
53
|
+
onAfterChange?: ((...args: any[]) => any) | undefined;
|
|
54
|
+
}>, {
|
|
55
|
+
modelValue: number;
|
|
56
|
+
direction: "horizontal" | "vertical";
|
|
57
|
+
isAnimating: boolean;
|
|
58
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
59
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
60
|
+
export default _default;
|
|
61
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
62
|
+
new (): {
|
|
63
|
+
$slots: S;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FieldSchema } from '@king-one/form-design/src/types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare const _default: DefineComponent<{
|
|
4
|
+
field: FieldSchema;
|
|
5
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
6
|
+
field: FieldSchema;
|
|
7
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FieldSchema } from '@king-one/form-design/src/types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare const _default: DefineComponent<{
|
|
4
|
+
field: FieldSchema;
|
|
5
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
6
|
+
field: FieldSchema;
|
|
7
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FieldSchema } from '@king-one/form-design/src/types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare const _default: DefineComponent<{
|
|
4
|
+
field: FieldSchema;
|
|
5
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
6
|
+
field: FieldSchema;
|
|
7
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PropsWidgetComponent } from '@king-one/form-design/src/types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
export declare function propsWidgetDecorator(key: string, components: PropsWidgetComponent[]): DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { PropsWidgetType } from '@king-one/form-design/src/types';
|
|
2
|
-
import { Component
|
|
2
|
+
import { Component } from 'vue';
|
|
3
3
|
import { ExpandPropsType } from '../../types';
|
|
4
|
-
export declare const components: {
|
|
5
|
-
'k-input': DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
6
|
-
'k-textarea': DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
7
|
-
'k-input-number': DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
8
|
-
};
|
|
9
4
|
export declare const widgetProps: Record<string, PropsWidgetType>;
|
|
10
5
|
export declare function expandProps(expandSchema?: ExpandPropsType[]): Record<string, Component>;
|
|
11
|
-
export declare function propsWidgetDecorator(key: string, components: Component[]): DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
}>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { FormDesignInstance } from '@king-one/form-design/src/types';
|
|
2
|
-
import {
|
|
1
|
+
import { FormDesignInstance, PropsWidgetComponent } from '@king-one/form-design/src/types';
|
|
2
|
+
import { PropType, VNode, RendererNode, RendererElement } from 'vue';
|
|
3
3
|
export interface ExpandPropsType {
|
|
4
|
-
component:
|
|
4
|
+
component: PropsWidgetComponent;
|
|
5
5
|
keys: Array<string> | RegExp;
|
|
6
|
+
exclude?: Array<string> | RegExp;
|
|
6
7
|
}
|
|
7
8
|
export declare const definePropType: <T>(val: any) => PropType<T>;
|
|
8
9
|
export declare const iconProps: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DesignSchema } from '@king-one/form-design/src/types';
|
|
1
|
+
import { DesignSchema, TemplateSchema } from '@king-one/form-design/src/types';
|
|
2
2
|
export declare const LayoutSchema: DesignSchema;
|
|
3
3
|
export declare const BaseSchema: DesignSchema;
|
|
4
4
|
export declare const ExtendSchema: DesignSchema;
|
|
5
|
+
export declare const tempSchema: TemplateSchema[];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ComponentWidgetType, DesignParams, DesignSchema, FieldSchema, FormDesignPlugin, PropsWidgetType, valueType } from '@king-one/form-design/src/types';
|
|
1
|
+
import { ComponentWidgetType, DesignParams, DesignSchema, FieldSchema, FormDesignPlugin, PropsWidgetType, TemplateSchema, valueType, DragPutType } from '@king-one/form-design/src/types';
|
|
2
2
|
import { Ref, VNode } from 'vue';
|
|
3
3
|
import { Field } from './Field';
|
|
4
4
|
import { SyncBailHook, UnsetAdditionalOptions } from '@king-one/tapable';
|
|
5
5
|
export declare class FormDesign {
|
|
6
6
|
schema: DesignSchema[];
|
|
7
|
+
tempSchema: TemplateSchema[];
|
|
7
8
|
private heart;
|
|
8
9
|
private plugin;
|
|
9
10
|
private FormSchema;
|
|
@@ -12,21 +13,27 @@ export declare class FormDesign {
|
|
|
12
13
|
title?: string | undefined;
|
|
13
14
|
key?: string | undefined;
|
|
14
15
|
type?: "string" | "number" | "boolean" | "object" | "array" | "void" | undefined;
|
|
15
|
-
'
|
|
16
|
+
'x-component'?: string | undefined;
|
|
16
17
|
enum?: any[] | undefined;
|
|
18
|
+
format?: string | undefined;
|
|
17
19
|
items?: {
|
|
18
20
|
title: string;
|
|
19
21
|
key: string;
|
|
20
22
|
type: valueType;
|
|
21
|
-
'
|
|
23
|
+
'x-component'?: string | undefined;
|
|
22
24
|
enum?: any[] | undefined;
|
|
23
|
-
|
|
25
|
+
format?: string | undefined;
|
|
26
|
+
items?: any[] | {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
type?: valueType | undefined;
|
|
29
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
30
|
+
} | undefined;
|
|
24
31
|
children?: any[] | undefined;
|
|
25
32
|
required?: boolean | undefined;
|
|
26
33
|
id?: string | undefined;
|
|
27
34
|
name?: string | undefined;
|
|
28
35
|
icon?: (string | VNode) | undefined;
|
|
29
|
-
'
|
|
36
|
+
'x-design-props'?: {
|
|
30
37
|
[x: string]: any;
|
|
31
38
|
unDragTo?: string[] | undefined;
|
|
32
39
|
validate?: {
|
|
@@ -34,24 +41,34 @@ export declare class FormDesign {
|
|
|
34
41
|
message: string;
|
|
35
42
|
} | undefined;
|
|
36
43
|
} | undefined;
|
|
37
|
-
'
|
|
38
|
-
'
|
|
44
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
45
|
+
'x-decorator'?: string | undefined;
|
|
46
|
+
'x-decorator-props'?: {
|
|
39
47
|
[x: string]: any;
|
|
40
48
|
} | undefined;
|
|
41
|
-
}[] |
|
|
49
|
+
}[] | {
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
type?: valueType | undefined;
|
|
52
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
53
|
+
} | undefined;
|
|
42
54
|
children?: {
|
|
43
55
|
title: string;
|
|
44
56
|
key: string;
|
|
45
57
|
type: valueType;
|
|
46
|
-
'
|
|
58
|
+
'x-component'?: string | undefined;
|
|
47
59
|
enum?: any[] | undefined;
|
|
48
|
-
|
|
60
|
+
format?: string | undefined;
|
|
61
|
+
items?: any[] | {
|
|
62
|
+
[x: string]: any;
|
|
63
|
+
type?: valueType | undefined;
|
|
64
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
65
|
+
} | undefined;
|
|
49
66
|
children?: any[] | undefined;
|
|
50
67
|
required?: boolean | undefined;
|
|
51
68
|
id?: string | undefined;
|
|
52
69
|
name?: string | undefined;
|
|
53
70
|
icon?: (string | VNode) | undefined;
|
|
54
|
-
'
|
|
71
|
+
'x-design-props'?: {
|
|
55
72
|
[x: string]: any;
|
|
56
73
|
unDragTo?: string[] | undefined;
|
|
57
74
|
validate?: {
|
|
@@ -59,8 +76,9 @@ export declare class FormDesign {
|
|
|
59
76
|
message: string;
|
|
60
77
|
} | undefined;
|
|
61
78
|
} | undefined;
|
|
62
|
-
'
|
|
63
|
-
'
|
|
79
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
80
|
+
'x-decorator'?: string | undefined;
|
|
81
|
+
'x-decorator-props'?: {
|
|
64
82
|
[x: string]: any;
|
|
65
83
|
} | undefined;
|
|
66
84
|
}[] | undefined;
|
|
@@ -68,7 +86,7 @@ export declare class FormDesign {
|
|
|
68
86
|
id?: string | undefined;
|
|
69
87
|
name?: string | undefined;
|
|
70
88
|
icon?: (string | VNode) | undefined;
|
|
71
|
-
'
|
|
89
|
+
'x-design-props'?: {
|
|
72
90
|
[x: string]: any;
|
|
73
91
|
unDragTo?: string[] | undefined;
|
|
74
92
|
validate?: {
|
|
@@ -76,29 +94,36 @@ export declare class FormDesign {
|
|
|
76
94
|
message: string;
|
|
77
95
|
} | undefined;
|
|
78
96
|
} | undefined;
|
|
79
|
-
'
|
|
80
|
-
'
|
|
97
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
98
|
+
'x-decorator'?: string | undefined;
|
|
99
|
+
'x-decorator-props'?: {
|
|
81
100
|
[x: string]: any;
|
|
82
101
|
} | undefined;
|
|
83
102
|
}, Partial<FieldSchema> | {
|
|
84
103
|
title?: string | undefined;
|
|
85
104
|
key?: string | undefined;
|
|
86
105
|
type?: "string" | "number" | "boolean" | "object" | "array" | "void" | undefined;
|
|
87
|
-
'
|
|
106
|
+
'x-component'?: string | undefined;
|
|
88
107
|
enum?: any[] | undefined;
|
|
108
|
+
format?: string | undefined;
|
|
89
109
|
items?: {
|
|
90
110
|
title: string;
|
|
91
111
|
key: string;
|
|
92
112
|
type: valueType;
|
|
93
|
-
'
|
|
113
|
+
'x-component'?: string | undefined;
|
|
94
114
|
enum?: any[] | undefined;
|
|
95
|
-
|
|
115
|
+
format?: string | undefined;
|
|
116
|
+
items?: any[] | {
|
|
117
|
+
[x: string]: any;
|
|
118
|
+
type?: valueType | undefined;
|
|
119
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
120
|
+
} | undefined;
|
|
96
121
|
children?: any[] | undefined;
|
|
97
122
|
required?: boolean | undefined;
|
|
98
123
|
id?: string | undefined;
|
|
99
124
|
name?: string | undefined;
|
|
100
125
|
icon?: (string | VNode) | undefined;
|
|
101
|
-
'
|
|
126
|
+
'x-design-props'?: {
|
|
102
127
|
[x: string]: any;
|
|
103
128
|
unDragTo?: string[] | undefined;
|
|
104
129
|
validate?: {
|
|
@@ -106,24 +131,34 @@ export declare class FormDesign {
|
|
|
106
131
|
message: string;
|
|
107
132
|
} | undefined;
|
|
108
133
|
} | undefined;
|
|
109
|
-
'
|
|
110
|
-
'
|
|
134
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
135
|
+
'x-decorator'?: string | undefined;
|
|
136
|
+
'x-decorator-props'?: {
|
|
111
137
|
[x: string]: any;
|
|
112
138
|
} | undefined;
|
|
113
|
-
}[] |
|
|
139
|
+
}[] | {
|
|
140
|
+
[x: string]: any;
|
|
141
|
+
type?: valueType | undefined;
|
|
142
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
143
|
+
} | undefined;
|
|
114
144
|
children?: {
|
|
115
145
|
title: string;
|
|
116
146
|
key: string;
|
|
117
147
|
type: valueType;
|
|
118
|
-
'
|
|
148
|
+
'x-component'?: string | undefined;
|
|
119
149
|
enum?: any[] | undefined;
|
|
120
|
-
|
|
150
|
+
format?: string | undefined;
|
|
151
|
+
items?: any[] | {
|
|
152
|
+
[x: string]: any;
|
|
153
|
+
type?: valueType | undefined;
|
|
154
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
155
|
+
} | undefined;
|
|
121
156
|
children?: any[] | undefined;
|
|
122
157
|
required?: boolean | undefined;
|
|
123
158
|
id?: string | undefined;
|
|
124
159
|
name?: string | undefined;
|
|
125
160
|
icon?: (string | VNode) | undefined;
|
|
126
|
-
'
|
|
161
|
+
'x-design-props'?: {
|
|
127
162
|
[x: string]: any;
|
|
128
163
|
unDragTo?: string[] | undefined;
|
|
129
164
|
validate?: {
|
|
@@ -131,8 +166,9 @@ export declare class FormDesign {
|
|
|
131
166
|
message: string;
|
|
132
167
|
} | undefined;
|
|
133
168
|
} | undefined;
|
|
134
|
-
'
|
|
135
|
-
'
|
|
169
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
170
|
+
'x-decorator'?: string | undefined;
|
|
171
|
+
'x-decorator-props'?: {
|
|
136
172
|
[x: string]: any;
|
|
137
173
|
} | undefined;
|
|
138
174
|
}[] | undefined;
|
|
@@ -140,7 +176,7 @@ export declare class FormDesign {
|
|
|
140
176
|
id?: string | undefined;
|
|
141
177
|
name?: string | undefined;
|
|
142
178
|
icon?: (string | VNode) | undefined;
|
|
143
|
-
'
|
|
179
|
+
'x-design-props'?: {
|
|
144
180
|
[x: string]: any;
|
|
145
181
|
unDragTo?: string[] | undefined;
|
|
146
182
|
validate?: {
|
|
@@ -148,14 +184,16 @@ export declare class FormDesign {
|
|
|
148
184
|
message: string;
|
|
149
185
|
} | undefined;
|
|
150
186
|
} | undefined;
|
|
151
|
-
'
|
|
152
|
-
'
|
|
187
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
188
|
+
'x-decorator'?: string | undefined;
|
|
189
|
+
'x-decorator-props'?: {
|
|
153
190
|
[x: string]: any;
|
|
154
191
|
} | undefined;
|
|
155
192
|
}>;
|
|
156
193
|
shared: {
|
|
157
194
|
draggedContext: {
|
|
158
195
|
key: string;
|
|
196
|
+
field: any;
|
|
159
197
|
};
|
|
160
198
|
panelWidgets: Record<string, ComponentWidgetType>;
|
|
161
199
|
propsWidgets: Record<string, PropsWidgetType>;
|
|
@@ -171,23 +209,30 @@ export declare class FormDesign {
|
|
|
171
209
|
};
|
|
172
210
|
};
|
|
173
211
|
getFieldList(): Field[];
|
|
212
|
+
setCheckedField(field: FieldSchema): void;
|
|
174
213
|
private get lifecycles();
|
|
175
214
|
get hooks(): {
|
|
176
215
|
beforeDelete: SyncBailHook<FieldSchema, boolean, UnsetAdditionalOptions>;
|
|
216
|
+
dragPut: SyncBailHook<DragPutType, boolean, UnsetAdditionalOptions>;
|
|
177
217
|
};
|
|
178
218
|
get fields(): Ref<{
|
|
179
219
|
title: string;
|
|
180
220
|
key: string;
|
|
181
221
|
type: valueType;
|
|
182
|
-
'
|
|
222
|
+
'x-component'?: string | undefined;
|
|
183
223
|
enum?: any[] | undefined;
|
|
184
|
-
|
|
224
|
+
format?: string | undefined;
|
|
225
|
+
items?: any[] | {
|
|
226
|
+
[x: string]: any;
|
|
227
|
+
type?: valueType | undefined;
|
|
228
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
229
|
+
} | undefined;
|
|
185
230
|
children?: any[] | undefined;
|
|
186
231
|
required?: boolean | undefined;
|
|
187
232
|
id?: string | undefined;
|
|
188
233
|
name?: string | undefined;
|
|
189
234
|
icon?: (string | VNode) | undefined;
|
|
190
|
-
'
|
|
235
|
+
'x-design-props'?: {
|
|
191
236
|
[x: string]: any;
|
|
192
237
|
unDragTo?: string[] | undefined;
|
|
193
238
|
validate?: {
|
|
@@ -195,23 +240,29 @@ export declare class FormDesign {
|
|
|
195
240
|
message: string;
|
|
196
241
|
} | undefined;
|
|
197
242
|
} | undefined;
|
|
198
|
-
'
|
|
199
|
-
'
|
|
243
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
244
|
+
'x-decorator'?: string | undefined;
|
|
245
|
+
'x-decorator-props'?: {
|
|
200
246
|
[x: string]: any;
|
|
201
247
|
} | undefined;
|
|
202
248
|
}[], FieldSchema[] | {
|
|
203
249
|
title: string;
|
|
204
250
|
key: string;
|
|
205
251
|
type: valueType;
|
|
206
|
-
'
|
|
252
|
+
'x-component'?: string | undefined;
|
|
207
253
|
enum?: any[] | undefined;
|
|
208
|
-
|
|
254
|
+
format?: string | undefined;
|
|
255
|
+
items?: any[] | {
|
|
256
|
+
[x: string]: any;
|
|
257
|
+
type?: valueType | undefined;
|
|
258
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
259
|
+
} | undefined;
|
|
209
260
|
children?: any[] | undefined;
|
|
210
261
|
required?: boolean | undefined;
|
|
211
262
|
id?: string | undefined;
|
|
212
263
|
name?: string | undefined;
|
|
213
264
|
icon?: (string | VNode) | undefined;
|
|
214
|
-
'
|
|
265
|
+
'x-design-props'?: {
|
|
215
266
|
[x: string]: any;
|
|
216
267
|
unDragTo?: string[] | undefined;
|
|
217
268
|
validate?: {
|
|
@@ -219,8 +270,9 @@ export declare class FormDesign {
|
|
|
219
270
|
message: string;
|
|
220
271
|
} | undefined;
|
|
221
272
|
} | undefined;
|
|
222
|
-
'
|
|
223
|
-
'
|
|
273
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
274
|
+
'x-decorator'?: string | undefined;
|
|
275
|
+
'x-decorator-props'?: {
|
|
224
276
|
[x: string]: any;
|
|
225
277
|
} | undefined;
|
|
226
278
|
}[]>;
|
|
@@ -7,15 +7,20 @@ export declare class FormSchema {
|
|
|
7
7
|
title: string;
|
|
8
8
|
key: string;
|
|
9
9
|
type: valueType;
|
|
10
|
-
'
|
|
10
|
+
'x-component'?: string | undefined;
|
|
11
11
|
enum?: any[] | undefined;
|
|
12
|
-
|
|
12
|
+
format?: string | undefined;
|
|
13
|
+
items?: any[] | {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
type?: valueType | undefined;
|
|
16
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
17
|
+
} | undefined;
|
|
13
18
|
children?: any[] | undefined;
|
|
14
19
|
required?: boolean | undefined;
|
|
15
20
|
id?: string | undefined;
|
|
16
21
|
name?: string | undefined;
|
|
17
22
|
icon?: (string | VNode) | undefined;
|
|
18
|
-
'
|
|
23
|
+
'x-design-props'?: {
|
|
19
24
|
[x: string]: any;
|
|
20
25
|
unDragTo?: string[] | undefined;
|
|
21
26
|
validate?: {
|
|
@@ -23,23 +28,29 @@ export declare class FormSchema {
|
|
|
23
28
|
message: string;
|
|
24
29
|
} | undefined;
|
|
25
30
|
} | undefined;
|
|
26
|
-
'
|
|
27
|
-
'
|
|
31
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
32
|
+
'x-decorator'?: string | undefined;
|
|
33
|
+
'x-decorator-props'?: {
|
|
28
34
|
[x: string]: any;
|
|
29
35
|
} | undefined;
|
|
30
36
|
}[], FieldSchema[] | {
|
|
31
37
|
title: string;
|
|
32
38
|
key: string;
|
|
33
39
|
type: valueType;
|
|
34
|
-
'
|
|
40
|
+
'x-component'?: string | undefined;
|
|
35
41
|
enum?: any[] | undefined;
|
|
36
|
-
|
|
42
|
+
format?: string | undefined;
|
|
43
|
+
items?: any[] | {
|
|
44
|
+
[x: string]: any;
|
|
45
|
+
type?: valueType | undefined;
|
|
46
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
47
|
+
} | undefined;
|
|
37
48
|
children?: any[] | undefined;
|
|
38
49
|
required?: boolean | undefined;
|
|
39
50
|
id?: string | undefined;
|
|
40
51
|
name?: string | undefined;
|
|
41
52
|
icon?: (string | VNode) | undefined;
|
|
42
|
-
'
|
|
53
|
+
'x-design-props'?: {
|
|
43
54
|
[x: string]: any;
|
|
44
55
|
unDragTo?: string[] | undefined;
|
|
45
56
|
validate?: {
|
|
@@ -47,8 +58,9 @@ export declare class FormSchema {
|
|
|
47
58
|
message: string;
|
|
48
59
|
} | undefined;
|
|
49
60
|
} | undefined;
|
|
50
|
-
'
|
|
51
|
-
'
|
|
61
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
62
|
+
'x-decorator'?: string | undefined;
|
|
63
|
+
'x-decorator-props'?: {
|
|
52
64
|
[x: string]: any;
|
|
53
65
|
} | undefined;
|
|
54
66
|
}[]>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as Carousel } from './components/base/Carousel.vue';
|
|
1
2
|
export { default as FormPanelItem } from './components/panel/panel-item.vue';
|
|
2
3
|
export { useInjectDesignContext } from './context/design';
|
|
3
4
|
export { default as FormDesign } from './components/form-desgin';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { SyncBailHook, UnsetAdditionalOptions } from '@king-one/tapable';
|
|
2
|
-
import { FieldSchema, FormDesignPlugin } from '../types';
|
|
2
|
+
import { DragPutType, FieldSchema, FormDesignPlugin } from '../types';
|
|
3
3
|
export declare class Plugin {
|
|
4
4
|
readonly hooks: {
|
|
5
5
|
beforeDelete: SyncBailHook<FieldSchema, boolean, UnsetAdditionalOptions>;
|
|
6
|
+
dragPut: SyncBailHook<DragPutType, boolean, UnsetAdditionalOptions>;
|
|
6
7
|
};
|
|
8
|
+
constructor();
|
|
7
9
|
use(plugIn: FormDesignPlugin): void;
|
|
8
10
|
}
|
|
@@ -22,15 +22,20 @@ export interface FieldSchema {
|
|
|
22
22
|
'title': string;
|
|
23
23
|
'key': string;
|
|
24
24
|
'type': valueType;
|
|
25
|
-
'
|
|
25
|
+
'x-component'?: string;
|
|
26
26
|
'enum'?: any[];
|
|
27
|
-
'
|
|
27
|
+
'format'?: string;
|
|
28
|
+
'items'?: FieldSchema[] | {
|
|
29
|
+
type?: valueType;
|
|
30
|
+
properties?: Record<string, FieldSchema>;
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
};
|
|
28
33
|
'children'?: FieldSchema[];
|
|
29
34
|
'required'?: boolean;
|
|
30
35
|
'id'?: string;
|
|
31
36
|
'name'?: string;
|
|
32
37
|
'icon'?: string | VNode;
|
|
33
|
-
'
|
|
38
|
+
'x-design-props'?: {
|
|
34
39
|
unDragTo?: string[];
|
|
35
40
|
validate?: {
|
|
36
41
|
status: 'success' | 'error' | 'warning' | '';
|
|
@@ -38,11 +43,18 @@ export interface FieldSchema {
|
|
|
38
43
|
};
|
|
39
44
|
[x: string]: any;
|
|
40
45
|
};
|
|
41
|
-
'
|
|
42
|
-
'
|
|
46
|
+
'x-component-props'?: Record<string, any>;
|
|
47
|
+
'x-decorator'?: string;
|
|
48
|
+
'x-decorator-props'?: {
|
|
43
49
|
[x: string]: any;
|
|
44
50
|
};
|
|
45
51
|
}
|
|
52
|
+
export interface TemplateSchema {
|
|
53
|
+
name: string;
|
|
54
|
+
key: string;
|
|
55
|
+
icon?: string | VNode;
|
|
56
|
+
schema: FieldSchema;
|
|
57
|
+
}
|
|
46
58
|
export interface DesignSchema {
|
|
47
59
|
name: string;
|
|
48
60
|
key: string;
|
|
@@ -50,13 +62,19 @@ export interface DesignSchema {
|
|
|
50
62
|
}
|
|
51
63
|
type PromiseFn<T> = () => Promise<T>;
|
|
52
64
|
export type ComponentWidgetType = PromiseFn<Component> | Component;
|
|
65
|
+
export interface PropsWidgetComponent {
|
|
66
|
+
header: string;
|
|
67
|
+
widget: Component;
|
|
68
|
+
}
|
|
53
69
|
export interface PropsWidgetType {
|
|
54
|
-
component:
|
|
70
|
+
component: PropsWidgetComponent[];
|
|
55
71
|
defaultValues?: Record<string, any>;
|
|
72
|
+
activeKey?: string;
|
|
56
73
|
rules?: any;
|
|
57
74
|
}
|
|
58
75
|
export interface DesignParams {
|
|
59
76
|
schema: DesignSchema[];
|
|
77
|
+
tempSchema?: TemplateSchema[];
|
|
60
78
|
extendFormProps?: {
|
|
61
79
|
title: string;
|
|
62
80
|
key: string;
|
|
@@ -78,3 +96,8 @@ export interface FormDesignPlugin {
|
|
|
78
96
|
install: (app: PluginInterface, ...options: any[]) => void;
|
|
79
97
|
}
|
|
80
98
|
export type widgetPropsType = Record<string, PropsWidgetType>;
|
|
99
|
+
export interface DragPutType {
|
|
100
|
+
key: string;
|
|
101
|
+
field: FieldSchema;
|
|
102
|
+
region: 'form-panel' | 'form-material';
|
|
103
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 防抖函数
|
|
3
|
+
* @param fn 需要防抖的函数
|
|
4
|
+
* @param delay 延迟时间(毫秒)
|
|
5
|
+
* @param immediate 是否立即执行(默认 false)
|
|
6
|
+
* @returns 防抖后的函数,包含 cancel 方法用于取消
|
|
7
|
+
*/
|
|
8
|
+
export declare function debounce<T extends (...args: any[]) => any>(fn: T, delay: number, immediate?: boolean): T & {
|
|
9
|
+
cancel: () => void;
|
|
10
|
+
};
|