@vunk/form 0.0.0-alpha.1
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/components/config/index.d.ts +4 -0
- package/components/config/index.js +78 -0
- package/components/config/src/ctx.d.ts +22 -0
- package/components/config/src/index.vue.d.ts +45 -0
- package/components/config-renderer/index.d.ts +6 -0
- package/components/config-renderer/index.js +57 -0
- package/components/config-renderer/src/ctx.d.ts +11 -0
- package/components/config-renderer/src/index.vue.d.ts +26 -0
- package/components/config-renderer/src/symbols.d.ts +2 -0
- package/components/config-renderer/src/types.d.ts +3 -0
- package/components/config-renderer-template/index.d.ts +3 -0
- package/components/config-renderer-template/index.js +37 -0
- package/components/config-renderer-template/src/ctx.d.ts +7 -0
- package/components/config-renderer-template/src/index.vue.d.ts +16 -0
- package/components/confirm-input/index.css +9 -0
- package/components/confirm-input/index.d.ts +3 -0
- package/components/confirm-input/index.js +124 -0
- package/components/confirm-input/src/ctx.d.ts +67 -0
- package/components/confirm-input/src/index.vue.d.ts +218 -0
- package/components/drag-wrapper/index.d.ts +4 -0
- package/components/drag-wrapper/index.js +53 -0
- package/components/drag-wrapper/src/ctx.d.ts +11 -0
- package/components/drag-wrapper/src/index.vue.d.ts +25 -0
- package/components/drag-wrapper/src/types.d.ts +3 -0
- package/components/drop-wrapper/index.d.ts +4 -0
- package/components/drop-wrapper/index.js +67 -0
- package/components/drop-wrapper/src/index.vue.d.ts +14 -0
- package/components/drop-wrapper/src/static.d.ts +5 -0
- package/components/form/index.d.ts +5 -0
- package/components/form/index.js +97 -0
- package/components/form/src/ctx.d.ts +37 -0
- package/components/form/src/index.vue.d.ts +100 -0
- package/components/form/src/utils.d.ts +2 -0
- package/components/form-item-renderer/index.d.ts +6 -0
- package/components/form-item-renderer/index.js +90 -0
- package/components/form-item-renderer/src/ctx.d.ts +16 -0
- package/components/form-item-renderer/src/index.vue.d.ts +38 -0
- package/components/form-item-renderer/src/symbols.d.ts +2 -0
- package/components/form-item-renderer/src/types.d.ts +5 -0
- package/components/form-item-renderer/src/utils.d.ts +3 -0
- package/components/form-item-renderer-template/index.d.ts +3 -0
- package/components/form-item-renderer-template/index.js +37 -0
- package/components/form-item-renderer-template/src/ctx.d.ts +7 -0
- package/components/form-item-renderer-template/src/index.vue.d.ts +16 -0
- package/components/ground/index.css +84 -0
- package/components/ground/index.d.ts +4 -0
- package/components/ground/index.js +883 -0
- package/components/ground/src/ctx.d.ts +11 -0
- package/components/ground/src/ground-config/index.d.ts +3 -0
- package/components/ground/src/ground-config/src/index.vue.d.ts +69 -0
- package/components/ground/src/ground-main/index.d.ts +3 -0
- package/components/ground/src/ground-main/src/ctx.d.ts +2 -0
- package/components/ground/src/ground-main/src/editing-wrapper.vue.d.ts +28 -0
- package/components/ground/src/ground-main/src/index.vue.d.ts +47 -0
- package/components/ground/src/ground-main/src/types.d.ts +9 -0
- package/components/ground/src/ground-widget/index.d.ts +3 -0
- package/components/ground/src/ground-widget/src/ctx.d.ts +2 -0
- package/components/ground/src/ground-widget/src/form-item-widget/index.d.ts +2 -0
- package/components/ground/src/ground-widget/src/form-item-widget/src/index.vue.d.ts +214 -0
- package/components/ground/src/ground-widget/src/index.vue.d.ts +13 -0
- package/components/ground/src/ground-widget/src/static.d.ts +4 -0
- package/components/ground/src/index.vue.d.ts +20 -0
- package/components/ground/src/types.d.ts +3 -0
- package/components/input/index.d.ts +5 -0
- package/components/input/index.js +105 -0
- package/components/input/src/ctx.d.ts +66 -0
- package/components/input/src/index.vue.d.ts +205 -0
- package/components/input/src/types.d.ts +12 -0
- package/components/input-config/index.d.ts +4 -0
- package/components/input-config/index.js +97 -0
- package/components/input-config/src/ctx.d.ts +39 -0
- package/components/input-config/src/index.vue.d.ts +125 -0
- package/components/input-config/src/types.d.ts +3 -0
- package/full-entry/main.d.ts +11 -0
- package/index.css +94 -0
- package/index.d.ts +23 -0
- package/index.esm.js +11 -0
- package/package.json +12 -0
- package/shared/element-plus/ctx/index.d.ts +5 -0
- package/shared/element-plus/ctx/index.js +10 -0
- package/shared/helper/index.d.ts +2 -0
- package/shared/helper/index.js +1 -0
- package/shared/types/form-item/index.d.ts +1 -0
- package/shared/types/form-item/index.js +1 -0
- package/shared/types/form-item/input.d.ts +12 -0
- package/shared/types/form-item/input.js +1 -0
- package/shared/types/index.d.ts +3 -0
- package/shared/types/index.js +1 -0
- package/shared/types/shared/index.d.ts +6 -0
- package/shared/types/shared/index.js +1 -0
- package/types/components/config/index.d.ts +4 -0
- package/types/components/config/src/ctx.d.ts +22 -0
- package/types/components/config/src/index.vue.d.ts +45 -0
- package/types/components/config-renderer/index.d.ts +6 -0
- package/types/components/config-renderer/src/ctx.d.ts +11 -0
- package/types/components/config-renderer/src/index.vue.d.ts +26 -0
- package/types/components/config-renderer/src/symbols.d.ts +2 -0
- package/types/components/config-renderer/src/types.d.ts +3 -0
- package/types/components/config-renderer-template/index.d.ts +3 -0
- package/types/components/config-renderer-template/src/ctx.d.ts +7 -0
- package/types/components/config-renderer-template/src/index.vue.d.ts +16 -0
- package/types/components/confirm-input/index.d.ts +3 -0
- package/types/components/confirm-input/src/ctx.d.ts +67 -0
- package/types/components/confirm-input/src/index.vue.d.ts +218 -0
- package/types/components/drag-wrapper/index.d.ts +4 -0
- package/types/components/drag-wrapper/src/ctx.d.ts +11 -0
- package/types/components/drag-wrapper/src/index.vue.d.ts +25 -0
- package/types/components/drag-wrapper/src/types.d.ts +3 -0
- package/types/components/drop-wrapper/index.d.ts +4 -0
- package/types/components/drop-wrapper/src/index.vue.d.ts +14 -0
- package/types/components/drop-wrapper/src/static.d.ts +5 -0
- package/types/components/form/index.d.ts +5 -0
- package/types/components/form/src/ctx.d.ts +37 -0
- package/types/components/form/src/index.vue.d.ts +100 -0
- package/types/components/form/src/utils.d.ts +2 -0
- package/types/components/form-item-renderer/index.d.ts +6 -0
- package/types/components/form-item-renderer/src/ctx.d.ts +16 -0
- package/types/components/form-item-renderer/src/index.vue.d.ts +38 -0
- package/types/components/form-item-renderer/src/symbols.d.ts +2 -0
- package/types/components/form-item-renderer/src/types.d.ts +5 -0
- package/types/components/form-item-renderer/src/utils.d.ts +3 -0
- package/types/components/form-item-renderer-template/index.d.ts +3 -0
- package/types/components/form-item-renderer-template/src/ctx.d.ts +7 -0
- package/types/components/form-item-renderer-template/src/index.vue.d.ts +16 -0
- package/types/components/ground/index.d.ts +4 -0
- package/types/components/ground/src/ctx.d.ts +11 -0
- package/types/components/ground/src/ground-config/index.d.ts +3 -0
- package/types/components/ground/src/ground-config/src/index.vue.d.ts +69 -0
- package/types/components/ground/src/ground-main/index.d.ts +3 -0
- package/types/components/ground/src/ground-main/src/ctx.d.ts +2 -0
- package/types/components/ground/src/ground-main/src/editing-wrapper.vue.d.ts +28 -0
- package/types/components/ground/src/ground-main/src/index.vue.d.ts +47 -0
- package/types/components/ground/src/ground-main/src/types.d.ts +9 -0
- package/types/components/ground/src/ground-widget/index.d.ts +3 -0
- package/types/components/ground/src/ground-widget/src/ctx.d.ts +2 -0
- package/types/components/ground/src/ground-widget/src/form-item-widget/index.d.ts +2 -0
- package/types/components/ground/src/ground-widget/src/form-item-widget/src/index.vue.d.ts +214 -0
- package/types/components/ground/src/ground-widget/src/index.vue.d.ts +13 -0
- package/types/components/ground/src/ground-widget/src/static.d.ts +4 -0
- package/types/components/ground/src/index.vue.d.ts +20 -0
- package/types/components/ground/src/types.d.ts +3 -0
- package/types/components/input/index.d.ts +5 -0
- package/types/components/input/src/ctx.d.ts +66 -0
- package/types/components/input/src/index.vue.d.ts +205 -0
- package/types/components/input/src/types.d.ts +12 -0
- package/types/components/input-config/index.d.ts +4 -0
- package/types/components/input-config/src/ctx.d.ts +39 -0
- package/types/components/input-config/src/index.vue.d.ts +125 -0
- package/types/components/input-config/src/types.d.ts +3 -0
- package/types/full-entry/main.d.ts +11 -0
- package/types/shared/element-plus/ctx/index.d.ts +5 -0
- package/types/shared/helper/index.d.ts +2 -0
- package/types/shared/types/form-item/index.d.ts +1 -0
- package/types/shared/types/form-item/input.d.ts +12 -0
- package/types/shared/types/index.d.ts +3 -0
- package/types/shared/types/shared/index.d.ts +6 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { _VkConfigRendererCtx, VkfConfigRenderer } from '@vunk/form/components/config-renderer';
|
|
2
|
+
import { bindPropsFactory, onEmitsFactory } from 'vunk/shared/utils-vue';
|
|
3
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps, renderSlot } from 'vue';
|
|
4
|
+
import { VkfConfigRendererTemplate } from '@vunk/form/components/config-renderer-template';
|
|
5
|
+
import { VkfInputConfig } from '@vunk/form/components/input-config';
|
|
6
|
+
|
|
7
|
+
const props = {
|
|
8
|
+
..._VkConfigRendererCtx.props,
|
|
9
|
+
data: {
|
|
10
|
+
type: Object,
|
|
11
|
+
default: () => ({})
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const createBindProps = bindPropsFactory(props);
|
|
15
|
+
const emits = {
|
|
16
|
+
setData: (e) => e,
|
|
17
|
+
"setData:source": (e) => e
|
|
18
|
+
};
|
|
19
|
+
const createOnEmits = onEmitsFactory(emits);
|
|
20
|
+
|
|
21
|
+
var ctx = /*#__PURE__*/Object.freeze({
|
|
22
|
+
__proto__: null,
|
|
23
|
+
props: props,
|
|
24
|
+
createBindProps: createBindProps,
|
|
25
|
+
emits: emits,
|
|
26
|
+
createOnEmits: createOnEmits
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
var script = defineComponent({
|
|
30
|
+
name: "VkfConfig",
|
|
31
|
+
components: {
|
|
32
|
+
VkfConfigRenderer,
|
|
33
|
+
VkfConfigRendererTemplate,
|
|
34
|
+
VkfInputConfig
|
|
35
|
+
},
|
|
36
|
+
emits,
|
|
37
|
+
props,
|
|
38
|
+
setup(props2, { emit }) {
|
|
39
|
+
const configRendererProps = _VkConfigRendererCtx.createBindProps(props2);
|
|
40
|
+
return {
|
|
41
|
+
configRendererProps
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
47
|
+
const _component_VkfInputConfig = resolveComponent("VkfInputConfig");
|
|
48
|
+
const _component_VkfConfigRendererTemplate = resolveComponent("VkfConfigRendererTemplate");
|
|
49
|
+
const _component_VkfConfigRenderer = resolveComponent("VkfConfigRenderer");
|
|
50
|
+
return openBlock(), createBlock(_component_VkfConfigRenderer, normalizeProps(guardReactiveProps(_ctx.configRendererProps)), {
|
|
51
|
+
default: withCtx(() => [
|
|
52
|
+
createVNode(_component_VkfConfigRendererTemplate, { type: "VkfInput" }, {
|
|
53
|
+
default: withCtx(({ data: sourceData }) => [
|
|
54
|
+
createVNode(_component_VkfInputConfig, mergeProps(sourceData, {
|
|
55
|
+
data: _ctx.data,
|
|
56
|
+
onSetData: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("setData", $event)),
|
|
57
|
+
"onUpdate:propDisabled": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("setData:source", {
|
|
58
|
+
k: "propDisabled",
|
|
59
|
+
v: $event
|
|
60
|
+
}))
|
|
61
|
+
}), null, 16, ["data"])
|
|
62
|
+
]),
|
|
63
|
+
_: 1
|
|
64
|
+
}),
|
|
65
|
+
renderSlot(_ctx.$slots, "rendererTemplate")
|
|
66
|
+
]),
|
|
67
|
+
_: 3
|
|
68
|
+
}, 16);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
script.render = render;
|
|
72
|
+
script.__file = "config/src/index.vue";
|
|
73
|
+
|
|
74
|
+
script.install = (app) => {
|
|
75
|
+
app.component(script.name, script);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export { script as VkfConfig, ctx as _VkfConfigCtx, script as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SetDataEvent } from '@vunk/form/shared/types';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
import { AnyObject } from 'vunk/shared/types';
|
|
4
|
+
export declare const props: {
|
|
5
|
+
data: {
|
|
6
|
+
type: PropType<AnyObject>;
|
|
7
|
+
default: () => {};
|
|
8
|
+
};
|
|
9
|
+
source: {
|
|
10
|
+
type: PropType<{
|
|
11
|
+
[k: string]: any;
|
|
12
|
+
templateType?: string | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
default: () => {};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const createBindProps: <T2 extends Record<string, any>, EX extends (keyof T2)[] | undefined, K extends Extract<EX extends (infer V)[] ? Exclude<keyof T2, V> : keyof T2, "data" | "source">>(propsArg: T2, excludes?: EX | undefined) => import("vue").ComputedRef<{ [k in K]: T2[k]; }>;
|
|
18
|
+
export declare const emits: {
|
|
19
|
+
setData: (e: SetDataEvent) => SetDataEvent<any>;
|
|
20
|
+
'setData:source': (e: SetDataEvent) => SetDataEvent<any>;
|
|
21
|
+
};
|
|
22
|
+
export declare const createOnEmits: <T2 extends (...args: any) => any, EX extends ("setData" | "setData:source")[], K extends "setData" | "setData:source">(emit: T2, excludes?: EX | undefined) => { [k in K]: T2; };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
data: {
|
|
3
|
+
type: import("vue").PropType<import("vunk/shared/types").AnyObject>;
|
|
4
|
+
default: () => {};
|
|
5
|
+
};
|
|
6
|
+
source: {
|
|
7
|
+
type: import("vue").PropType<{
|
|
8
|
+
[k: string]: any;
|
|
9
|
+
templateType?: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
default: () => {};
|
|
12
|
+
};
|
|
13
|
+
}, {
|
|
14
|
+
configRendererProps: import("vue").ComputedRef<{
|
|
15
|
+
source: {
|
|
16
|
+
[k: string]: any;
|
|
17
|
+
templateType?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
setData: (e: import("../../../shared/types").SetDataEvent<any>) => import("../../../shared/types").SetDataEvent<any>;
|
|
22
|
+
'setData:source': (e: import("../../../shared/types").SetDataEvent<any>) => import("../../../shared/types").SetDataEvent<any>;
|
|
23
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
data: {
|
|
25
|
+
type: import("vue").PropType<import("vunk/shared/types").AnyObject>;
|
|
26
|
+
default: () => {};
|
|
27
|
+
};
|
|
28
|
+
source: {
|
|
29
|
+
type: import("vue").PropType<{
|
|
30
|
+
[k: string]: any;
|
|
31
|
+
templateType?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
default: () => {};
|
|
34
|
+
};
|
|
35
|
+
}>> & {
|
|
36
|
+
onSetData?: ((e: import("../../../shared/types").SetDataEvent<any>) => any) | undefined;
|
|
37
|
+
"onSetData:source"?: ((e: import("../../../shared/types").SetDataEvent<any>) => any) | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
data: import("vunk/shared/types").AnyObject;
|
|
40
|
+
source: {
|
|
41
|
+
[k: string]: any;
|
|
42
|
+
templateType?: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
}>;
|
|
45
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { bindPropsFactory } from 'vunk/shared/utils-vue';
|
|
2
|
+
import { defineComponent, shallowReactive, provide } from 'vue';
|
|
3
|
+
|
|
4
|
+
const props = {
|
|
5
|
+
source: {
|
|
6
|
+
type: Object,
|
|
7
|
+
default: () => ({})
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const createBindProps = bindPropsFactory(props);
|
|
11
|
+
|
|
12
|
+
var ctx = /*#__PURE__*/Object.freeze({
|
|
13
|
+
__proto__: null,
|
|
14
|
+
props: props,
|
|
15
|
+
createBindProps: createBindProps
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const S_CONFIG_RENDERER_TEMPLATE_INSTANCES = Symbol("templateInstances");
|
|
19
|
+
|
|
20
|
+
var script = defineComponent({
|
|
21
|
+
name: "VkfConfigRenderer",
|
|
22
|
+
props,
|
|
23
|
+
setup(props2, ctx) {
|
|
24
|
+
const templateInstances = shallowReactive({});
|
|
25
|
+
provide(S_CONFIG_RENDERER_TEMPLATE_INSTANCES, templateInstances);
|
|
26
|
+
const renderFormItems = (c) => {
|
|
27
|
+
if (c.templateType && templateInstances[c.templateType]) {
|
|
28
|
+
const slotData = { ...c };
|
|
29
|
+
Reflect.deleteProperty(slotData, "templateType");
|
|
30
|
+
const nodes = templateInstances[c.templateType].slots.default?.({
|
|
31
|
+
data: slotData,
|
|
32
|
+
raw: c
|
|
33
|
+
});
|
|
34
|
+
return nodes;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return () => {
|
|
38
|
+
const tempSlots = ctx.slots.default?.();
|
|
39
|
+
return [
|
|
40
|
+
tempSlots,
|
|
41
|
+
renderFormItems(props2.source)
|
|
42
|
+
];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
script.__file = "config-renderer/src/index.vue";
|
|
48
|
+
|
|
49
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
50
|
+
__proto__: null
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
script.install = (app) => {
|
|
54
|
+
app.component(script.name, script);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { S_CONFIG_RENDERER_TEMPLATE_INSTANCES, script as VkfConfigRenderer, ctx as _VkConfigRendererCtx, types as __VkfConfigRenderer, script as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
export declare const props: {
|
|
3
|
+
source: {
|
|
4
|
+
type: PropType<{
|
|
5
|
+
[k: string]: any;
|
|
6
|
+
templateType?: string | undefined;
|
|
7
|
+
}>;
|
|
8
|
+
default: () => {};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const createBindProps: <T2 extends Record<string, any>, EX extends (keyof T2)[] | undefined, K extends Extract<EX extends (infer V)[] ? Exclude<keyof T2, V> : keyof T2, "source">>(propsArg: T2, excludes?: EX | undefined) => import("vue").ComputedRef<{ [k in K]: T2[k]; }>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
source: {
|
|
4
|
+
type: import("vue").PropType<{
|
|
5
|
+
[k: string]: any;
|
|
6
|
+
templateType?: string | undefined;
|
|
7
|
+
}>;
|
|
8
|
+
default: () => {};
|
|
9
|
+
};
|
|
10
|
+
}, () => (VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>[] | undefined)[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
source: {
|
|
14
|
+
type: import("vue").PropType<{
|
|
15
|
+
[k: string]: any;
|
|
16
|
+
templateType?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
default: () => {};
|
|
19
|
+
};
|
|
20
|
+
}>>, {
|
|
21
|
+
source: {
|
|
22
|
+
[k: string]: any;
|
|
23
|
+
templateType?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent, inject, getCurrentInstance, onUnmounted } from 'vue';
|
|
2
|
+
import { S_CONFIG_RENDERER_TEMPLATE_INSTANCES } from '@vunk/form/components/config-renderer';
|
|
3
|
+
|
|
4
|
+
const props = {
|
|
5
|
+
type: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
default: ""
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
var script = defineComponent({
|
|
13
|
+
name: "VkfFormItemRendererTemplate",
|
|
14
|
+
props,
|
|
15
|
+
setup(props2) {
|
|
16
|
+
const templateInstances = inject(S_CONFIG_RENDERER_TEMPLATE_INSTANCES);
|
|
17
|
+
if (!templateInstances)
|
|
18
|
+
throw new Error();
|
|
19
|
+
const vm = getCurrentInstance();
|
|
20
|
+
const oVm = templateInstances[props2.type];
|
|
21
|
+
if (vm && templateInstances) {
|
|
22
|
+
templateInstances[props2.type] = vm;
|
|
23
|
+
}
|
|
24
|
+
onUnmounted(() => {
|
|
25
|
+
templateInstances[props2.type] = oVm;
|
|
26
|
+
});
|
|
27
|
+
return () => null;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
script.__file = "config-renderer-template/src/index.vue";
|
|
32
|
+
|
|
33
|
+
script.install = (app) => {
|
|
34
|
+
app.component(script.name, script);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { script as VkfConfigRendererTemplate, script as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
type: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: boolean;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
}, () => null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
type: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: boolean;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
}>>, {
|
|
14
|
+
type: string;
|
|
15
|
+
}>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { _VkfInputCtx, VkfInput } from '@vunk/form/components/input';
|
|
2
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, ref, watch, h, resolveComponent, createBlock, mergeProps, toHandlers } from 'vue';
|
|
3
|
+
import { ElButton, ElIcon } from 'element-plus';
|
|
4
|
+
|
|
5
|
+
const props = {
|
|
6
|
+
..._VkfInputCtx.props,
|
|
7
|
+
inputSlot: {
|
|
8
|
+
type: Object,
|
|
9
|
+
default: () => ({})
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const emits = {
|
|
13
|
+
..._VkfInputCtx.emits,
|
|
14
|
+
"update:disabled": (e) => e || true
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var _export_sfc = (sfc, props) => {
|
|
18
|
+
const target = sfc.__vccOpts || sfc;
|
|
19
|
+
for (const [key, val] of props) {
|
|
20
|
+
target[key] = val;
|
|
21
|
+
}
|
|
22
|
+
return target;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const _sfc_main$1 = defineComponent({
|
|
26
|
+
name: "Check"
|
|
27
|
+
});
|
|
28
|
+
const _hoisted_1$1 = {
|
|
29
|
+
viewBox: "0 0 1024 1024",
|
|
30
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
31
|
+
};
|
|
32
|
+
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("path", {
|
|
33
|
+
fill: "currentColor",
|
|
34
|
+
d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
|
|
35
|
+
}, null, -1);
|
|
36
|
+
const _hoisted_3$1 = [
|
|
37
|
+
_hoisted_2$1
|
|
38
|
+
];
|
|
39
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
40
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1);
|
|
41
|
+
}
|
|
42
|
+
var check = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
43
|
+
|
|
44
|
+
const _sfc_main = defineComponent({
|
|
45
|
+
name: "Edit"
|
|
46
|
+
});
|
|
47
|
+
const _hoisted_1 = {
|
|
48
|
+
viewBox: "0 0 1024 1024",
|
|
49
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
50
|
+
};
|
|
51
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("path", {
|
|
52
|
+
fill: "currentColor",
|
|
53
|
+
d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640V512z"
|
|
54
|
+
}, null, -1);
|
|
55
|
+
const _hoisted_3 = /* @__PURE__ */ createElementVNode("path", {
|
|
56
|
+
fill: "currentColor",
|
|
57
|
+
d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
|
|
58
|
+
}, null, -1);
|
|
59
|
+
const _hoisted_4 = [
|
|
60
|
+
_hoisted_2,
|
|
61
|
+
_hoisted_3
|
|
62
|
+
];
|
|
63
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
64
|
+
return openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_4);
|
|
65
|
+
}
|
|
66
|
+
var edit = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
67
|
+
|
|
68
|
+
var script = defineComponent({
|
|
69
|
+
name: "VkfConfirmInput",
|
|
70
|
+
components: {
|
|
71
|
+
VkfInput
|
|
72
|
+
},
|
|
73
|
+
emits,
|
|
74
|
+
props,
|
|
75
|
+
setup(props2, { emit }) {
|
|
76
|
+
const inputProps = _VkfInputCtx.createBindProps(props2, ["inputSlot", "disabled", "modelValue"]);
|
|
77
|
+
const inputEmits = _VkfInputCtx.createOnEmits(emit, ["update:modelValue"]);
|
|
78
|
+
const inputValue = ref(props2.modelValue);
|
|
79
|
+
watch(() => props2.modelValue, (v) => {
|
|
80
|
+
inputValue.value = v;
|
|
81
|
+
});
|
|
82
|
+
const appendEl = () => h(ElButton, {
|
|
83
|
+
onClick: () => {
|
|
84
|
+
if (!props2.disabled) {
|
|
85
|
+
emit("update:modelValue", inputValue.value);
|
|
86
|
+
} else {
|
|
87
|
+
emit("update:disabled", false);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}, () => h(ElIcon, {
|
|
91
|
+
class: "vkf-confirm-input-icon",
|
|
92
|
+
size: 16
|
|
93
|
+
}, () => h(props2.disabled ? edit : check)));
|
|
94
|
+
return {
|
|
95
|
+
inputProps,
|
|
96
|
+
appendEl,
|
|
97
|
+
inputEmits,
|
|
98
|
+
inputValue
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
104
|
+
const _component_VkfInput = resolveComponent("VkfInput");
|
|
105
|
+
return openBlock(), createBlock(_component_VkfInput, mergeProps({
|
|
106
|
+
modelValue: _ctx.inputValue,
|
|
107
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.inputValue = $event),
|
|
108
|
+
class: "vkf-confirm-input",
|
|
109
|
+
inputSlot: {
|
|
110
|
+
append: _ctx.appendEl,
|
|
111
|
+
..._ctx.inputSlot
|
|
112
|
+
},
|
|
113
|
+
disabled: _ctx.disabled
|
|
114
|
+
}, _ctx.inputProps, toHandlers(_ctx.inputEmits)), null, 16, ["modelValue", "inputSlot", "disabled"]);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
script.render = render;
|
|
118
|
+
script.__file = "confirm-input/src/index.vue";
|
|
119
|
+
|
|
120
|
+
script.install = (app) => {
|
|
121
|
+
app.component(script.name, script);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export { script as VkfConfirmInput, script as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
export declare const props: {
|
|
3
|
+
inputSlot: {
|
|
4
|
+
type: PropType<{
|
|
5
|
+
type: PropType<import("../../input/src/types").InputSlot>;
|
|
6
|
+
default: undefined;
|
|
7
|
+
}>;
|
|
8
|
+
default: () => {};
|
|
9
|
+
};
|
|
10
|
+
formItemSize: {
|
|
11
|
+
type: PropType<"small" | "default" | "large">;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
formItemSlot: {
|
|
15
|
+
type: PropType<import("../../input/src/types").FormItemSlot>;
|
|
16
|
+
default: undefined;
|
|
17
|
+
};
|
|
18
|
+
updateEvent: {
|
|
19
|
+
type: PropType<"update:modelValue" | "change">;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
size: import("element-plus/es/utils").BuildPropReturn<StringConstructor, never, false, "" | "small" | "default" | "large", never>;
|
|
23
|
+
disabled: BooleanConstructor;
|
|
24
|
+
modelValue: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | number | null | undefined>, "", unknown, unknown, unknown>;
|
|
25
|
+
type: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "text", unknown, unknown, unknown>;
|
|
26
|
+
resize: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, "none" | "both" | "horizontal" | "vertical", unknown>;
|
|
27
|
+
autosize: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<import("element-plus").InputAutoSize>, false, unknown, unknown, unknown>;
|
|
28
|
+
autocomplete: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "off", unknown, unknown, unknown>;
|
|
29
|
+
formatter: import("element-plus/es/utils").BuildPropReturn<FunctionConstructor, unknown, unknown, unknown, unknown>;
|
|
30
|
+
parser: import("element-plus/es/utils").BuildPropReturn<FunctionConstructor, unknown, unknown, unknown, unknown>;
|
|
31
|
+
placeholder: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
|
|
32
|
+
form: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
|
|
33
|
+
readonly: import("element-plus/es/utils").BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
34
|
+
clearable: import("element-plus/es/utils").BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
35
|
+
showPassword: import("element-plus/es/utils").BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
36
|
+
showWordLimit: import("element-plus/es/utils").BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
37
|
+
suffixIcon: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>, "", unknown, unknown, unknown>;
|
|
38
|
+
prefixIcon: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>, "", unknown, unknown, unknown>;
|
|
39
|
+
label: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
|
|
40
|
+
tabindex: import("element-plus/es/utils").BuildPropReturn<readonly [NumberConstructor, StringConstructor], unknown, unknown, unknown, unknown>;
|
|
41
|
+
validateEvent: import("element-plus/es/utils").BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
42
|
+
inputStyle: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<import("vue").StyleValue>, () => import("element-plus/es/utils").Mutable<{}>, unknown, unknown, unknown>;
|
|
43
|
+
labelWidth: import("element-plus/es/utils").BuildPropReturn<readonly [StringConstructor, NumberConstructor], "", unknown, unknown, unknown>;
|
|
44
|
+
prop: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<import("element-plus").FormItemProp>, unknown, unknown, unknown, unknown>;
|
|
45
|
+
required: import("element-plus/es/utils").BuildPropReturn<BooleanConstructor, undefined, unknown, unknown, unknown>;
|
|
46
|
+
rules: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>>, unknown, unknown, unknown, unknown>;
|
|
47
|
+
error: StringConstructor;
|
|
48
|
+
validateStatus: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, "" | "error" | "success" | "validating", unknown>;
|
|
49
|
+
for: StringConstructor;
|
|
50
|
+
inlineMessage: import("element-plus/es/utils").BuildPropReturn<readonly [StringConstructor, BooleanConstructor], "", unknown, unknown, unknown>;
|
|
51
|
+
showMessage: import("element-plus/es/utils").BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
52
|
+
};
|
|
53
|
+
export declare const emits: {
|
|
54
|
+
'update:disabled': (e: boolean) => true;
|
|
55
|
+
"update:modelValue": (value: string) => boolean;
|
|
56
|
+
input: (value: string) => boolean;
|
|
57
|
+
change: (value: string) => boolean;
|
|
58
|
+
focus: (evt: FocusEvent) => boolean;
|
|
59
|
+
blur: (evt: FocusEvent) => boolean;
|
|
60
|
+
clear: () => boolean;
|
|
61
|
+
mouseleave: (evt: MouseEvent) => boolean;
|
|
62
|
+
mouseenter: (evt: MouseEvent) => boolean;
|
|
63
|
+
keydown: (evt: Event | KeyboardEvent) => boolean;
|
|
64
|
+
compositionstart: (evt: CompositionEvent) => boolean;
|
|
65
|
+
compositionupdate: (evt: CompositionEvent) => boolean;
|
|
66
|
+
compositionend: (evt: CompositionEvent) => boolean;
|
|
67
|
+
};
|