@vunk/form 2.3.3 → 2.5.0
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/api-tables-select/index.cjs +1 -9
- package/components/api-tables-select/index.mjs +1 -9
- package/components/api-tables-select/src/ctx.d.ts +4 -7
- package/components/api-tables-select/src/index.vue.d.ts +10 -9
- package/components/button/src/ctx.d.ts +4 -0
- package/components/button/src/index.vue.d.ts +9 -0
- package/components/card-input-collection/index.cjs +5 -10
- package/components/card-input-collection/index.mjs +6 -11
- package/components/card-input-collection/src/ctx.d.ts +4 -7
- package/components/card-input-collection/src/index.vue.d.ts +9 -9
- package/components/cascader/src/ctx.d.ts +5 -1
- package/components/cascader/src/index.vue.d.ts +11 -2
- package/components/checkbox/src/ctx.d.ts +5 -1
- package/components/checkbox/src/index.vue.d.ts +9 -0
- package/components/color-picker/src/ctx.d.ts +4 -0
- package/components/color-picker/src/index.vue.d.ts +9 -0
- package/components/date-picker/src/ctx.d.ts +5 -1
- package/components/date-picker/src/index.vue.d.ts +9 -0
- package/components/date-picker-range/src/ctx.d.ts +4 -0
- package/components/date-picker-range/src/index.vue.d.ts +9 -0
- package/components/download-plus/src/ctx.d.ts +4 -0
- package/components/download-plus/src/index.vue.d.ts +9 -0
- package/components/esri-input-geojson/src/ctx.d.ts +5 -1
- package/components/esri-input-geojson/src/index.vue.d.ts +10 -0
- package/components/fieldset/index.cjs +106 -0
- package/components/fieldset/index.css +5 -0
- package/components/fieldset/index.d.ts +4 -0
- package/components/fieldset/index.mjs +100 -0
- package/components/fieldset/src/ctx.d.ts +7 -0
- package/components/fieldset/src/index.vue.d.ts +14 -0
- package/components/fieldset/src/types.d.ts +1 -0
- package/components/fieldset/src/use.d.ts +5 -0
- package/components/form/index.cjs +12 -29
- package/components/form/index.mjs +13 -30
- package/components/form/src/ctx.d.ts +1 -8
- package/components/form/src/index.vue.d.ts +0 -20
- package/components/form-item/index.cjs +47 -5
- package/components/form-item/index.css +16 -0
- package/components/form-item/index.mjs +48 -6
- package/components/form-item/src/ctx.d.ts +5 -1
- package/components/form-item/src/index.vue.d.ts +12 -0
- package/components/form-item/src/types.d.ts +1 -0
- package/components/form-item-renderer/index.cjs +49 -7
- package/components/form-item-renderer/index.mjs +51 -9
- package/components/form-item-renderer/src/core.vue.d.ts +38 -0
- package/components/form-item-renderer/src/index.vue.d.ts +67 -12
- package/components/information/index.cjs +76 -0
- package/components/information/index.d.ts +4 -0
- package/components/information/index.mjs +70 -0
- package/components/information/src/ctx.d.ts +13 -0
- package/components/information/src/index.vue.d.ts +391 -0
- package/components/information/src/types.d.ts +3 -0
- package/components/information-templates-default/index.cjs +196 -0
- package/components/information-templates-default/index.css +12 -0
- package/components/information-templates-default/index.d.ts +4 -0
- package/components/information-templates-default/index.mjs +190 -0
- package/components/information-templates-default/src/ctx.d.ts +2 -0
- package/components/information-templates-default/src/index.vue.d.ts +52 -0
- package/components/information-templates-default/src/types.d.ts +1 -0
- package/components/input/src/ctx.d.ts +5 -1
- package/components/input/src/index.vue.d.ts +9 -0
- package/components/input-collection/index.cjs +113 -26
- package/components/input-collection/index.css +9 -0
- package/components/input-collection/index.mjs +114 -27
- package/components/input-collection/src/ctx.d.ts +13 -2
- package/components/input-collection/src/index.vue.d.ts +43 -5
- package/components/input-collection/src/types.d.ts +1 -0
- package/components/input-link/src/ctx.d.ts +4 -0
- package/components/input-link/src/index.vue.d.ts +9 -0
- package/components/input-number/src/ctx.d.ts +5 -1
- package/components/input-number/src/index.vue.d.ts +9 -0
- package/components/monaco-editor/src/ctx.d.ts +4 -0
- package/components/monaco-editor/src/index.vue.d.ts +9 -0
- package/components/radio/src/ctx.d.ts +4 -0
- package/components/radio/src/index.vue.d.ts +9 -0
- package/components/select/src/ctx.d.ts +5 -1
- package/components/select/src/index.vue.d.ts +9 -0
- package/components/slider/src/ctx.d.ts +4 -0
- package/components/slider/src/index.vue.d.ts +9 -0
- package/components/switch/src/ctx.d.ts +4 -0
- package/components/switch/src/index.vue.d.ts +9 -0
- package/components/tables-select/src/ctx.d.ts +5 -1
- package/components/tables-select/src/index.vue.d.ts +18 -0
- package/components/tag-information/index.cjs +114 -0
- package/components/tag-information/index.css +6 -0
- package/components/tag-information/index.d.ts +4 -0
- package/components/tag-information/index.mjs +108 -0
- package/components/tag-information/src/ctx.d.ts +34 -0
- package/components/tag-information/src/index.vue.d.ts +912 -0
- package/components/tag-information/src/types.d.ts +1 -0
- package/components/template-instances-provider/index.cjs +8 -13
- package/components/template-instances-provider/index.mjs +8 -13
- package/components/template-instances-provider/src/index.vue.d.ts +4 -14
- package/components/upload/src/ctx.d.ts +5 -1
- package/components/upload/src/index.vue.d.ts +9 -0
- package/components/upload-plus/src/ctx.d.ts +4 -0
- package/components/upload-plus/src/index.vue.d.ts +9 -0
- package/components/van-cascader/src/ctx.d.ts +4 -0
- package/components/van-cascader/src/index.vue.d.ts +76 -12803
- package/components/var-datetime-picker/src/ctx.d.ts +4 -0
- package/components/var-datetime-picker/src/index.vue.d.ts +9 -0
- package/components/vditor/src/ctx.d.ts +4 -0
- package/components/vditor/src/index.vue.d.ts +9 -0
- package/composables/index.cjs +31 -5
- package/composables/index.mjs +31 -6
- package/composables/useTemplateInstances.d.ts +6 -1
- package/index.css +51 -0
- package/index.d.ts +1 -0
- package/index.esm.js +1 -0
- package/package.json +30 -1
- package/shared/element-plus/ctx.d.ts +4 -4
- package/shared/types/index.d.ts +4 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, renderList, createBlock, withCtx, createVNode, normalizeClass, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
3
|
+
import { VkfFormItem } from '@vunk/form/components/form-item';
|
|
4
|
+
import { VkfSelect } from '@vunk/form/components/select';
|
|
5
|
+
import { VkfTagInformation } from '@vunk/form/components/tag-information';
|
|
6
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
7
|
+
|
|
8
|
+
const props = {};
|
|
9
|
+
const emits = {};
|
|
10
|
+
|
|
11
|
+
var _sfc_main = defineComponent({
|
|
12
|
+
name: "VkfInformationTemplatesDefault",
|
|
13
|
+
components: {
|
|
14
|
+
VkfFormItem,
|
|
15
|
+
VkfFormItemRendererTemplate,
|
|
16
|
+
VkfTagInformation,
|
|
17
|
+
VkfSelect
|
|
18
|
+
},
|
|
19
|
+
props,
|
|
20
|
+
emits,
|
|
21
|
+
setup(props2, { emit }) {
|
|
22
|
+
const prefixCls = "vkf-information-templates-default";
|
|
23
|
+
const simpleStringTemplates = [
|
|
24
|
+
"VkfInput",
|
|
25
|
+
"VkfInputNumber",
|
|
26
|
+
"VkfSlider"
|
|
27
|
+
];
|
|
28
|
+
const simpleSelectTemplates = [
|
|
29
|
+
"VkfSelect",
|
|
30
|
+
"VkfRadio"
|
|
31
|
+
];
|
|
32
|
+
const simpleCollectionTemplates = [
|
|
33
|
+
"VkfInputCollection"
|
|
34
|
+
];
|
|
35
|
+
return {
|
|
36
|
+
prefixCls,
|
|
37
|
+
simpleStringTemplates,
|
|
38
|
+
simpleSelectTemplates,
|
|
39
|
+
simpleCollectionTemplates
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
45
|
+
const _component_VkfFormItem = resolveComponent("VkfFormItem");
|
|
46
|
+
const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
|
|
47
|
+
const _component_VkfSelect = resolveComponent("VkfSelect");
|
|
48
|
+
const _component_VkfTagInformation = resolveComponent("VkfTagInformation");
|
|
49
|
+
return openBlock(), createElementBlock(
|
|
50
|
+
Fragment,
|
|
51
|
+
null,
|
|
52
|
+
[
|
|
53
|
+
(openBlock(true), createElementBlock(
|
|
54
|
+
Fragment,
|
|
55
|
+
null,
|
|
56
|
+
renderList(_ctx.simpleStringTemplates, (t) => {
|
|
57
|
+
return openBlock(), createBlock(_component_VkfFormItemRendererTemplate, {
|
|
58
|
+
key: t,
|
|
59
|
+
type: t
|
|
60
|
+
}, {
|
|
61
|
+
default: withCtx(({ props, value }) => [
|
|
62
|
+
createVNode(_component_VkfFormItem, {
|
|
63
|
+
class: normalizeClass(`${_ctx.prefixCls}-main`),
|
|
64
|
+
label: props.label,
|
|
65
|
+
prop: props.prop,
|
|
66
|
+
information: true
|
|
67
|
+
}, {
|
|
68
|
+
default: withCtx(() => [
|
|
69
|
+
createElementVNode(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
class: normalizeClass(`${_ctx.prefixCls}-value`)
|
|
73
|
+
},
|
|
74
|
+
toDisplayString(value),
|
|
75
|
+
3
|
|
76
|
+
/* TEXT, CLASS */
|
|
77
|
+
)
|
|
78
|
+
]),
|
|
79
|
+
_: 2
|
|
80
|
+
/* DYNAMIC */
|
|
81
|
+
}, 1032, ["class", "label", "prop"])
|
|
82
|
+
]),
|
|
83
|
+
_: 2
|
|
84
|
+
/* DYNAMIC */
|
|
85
|
+
}, 1032, ["type"]);
|
|
86
|
+
}),
|
|
87
|
+
128
|
|
88
|
+
/* KEYED_FRAGMENT */
|
|
89
|
+
)),
|
|
90
|
+
(openBlock(true), createElementBlock(
|
|
91
|
+
Fragment,
|
|
92
|
+
null,
|
|
93
|
+
renderList(_ctx.simpleSelectTemplates, (t) => {
|
|
94
|
+
return openBlock(), createBlock(_component_VkfFormItemRendererTemplate, {
|
|
95
|
+
key: t,
|
|
96
|
+
type: t
|
|
97
|
+
}, {
|
|
98
|
+
default: withCtx(({ props, value }) => [
|
|
99
|
+
createVNode(_component_VkfSelect, {
|
|
100
|
+
label: props.label,
|
|
101
|
+
information: true,
|
|
102
|
+
class: normalizeClass(`${_ctx.prefixCls}-main`),
|
|
103
|
+
readonly: true,
|
|
104
|
+
"model-value": value,
|
|
105
|
+
options: props.options
|
|
106
|
+
}, null, 8, ["label", "class", "model-value", "options"])
|
|
107
|
+
]),
|
|
108
|
+
_: 2
|
|
109
|
+
/* DYNAMIC */
|
|
110
|
+
}, 1032, ["type"]);
|
|
111
|
+
}),
|
|
112
|
+
128
|
|
113
|
+
/* KEYED_FRAGMENT */
|
|
114
|
+
)),
|
|
115
|
+
(openBlock(true), createElementBlock(
|
|
116
|
+
Fragment,
|
|
117
|
+
null,
|
|
118
|
+
renderList(_ctx.simpleCollectionTemplates, (t) => {
|
|
119
|
+
return openBlock(), createBlock(_component_VkfFormItemRendererTemplate, {
|
|
120
|
+
key: t,
|
|
121
|
+
type: t
|
|
122
|
+
}, {
|
|
123
|
+
default: withCtx(({ props, value }) => [
|
|
124
|
+
createVNode(_component_VkfFormItem, {
|
|
125
|
+
class: normalizeClass(`${_ctx.prefixCls}-main`),
|
|
126
|
+
label: props.label,
|
|
127
|
+
prop: props.prop,
|
|
128
|
+
information: true
|
|
129
|
+
}, {
|
|
130
|
+
default: withCtx(() => [
|
|
131
|
+
createElementVNode(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
class: normalizeClass(`${_ctx.prefixCls}-value`)
|
|
135
|
+
},
|
|
136
|
+
[
|
|
137
|
+
(openBlock(true), createElementBlock(
|
|
138
|
+
Fragment,
|
|
139
|
+
null,
|
|
140
|
+
renderList(value, (item, index) => {
|
|
141
|
+
return openBlock(), createBlock(_component_VkfTagInformation, {
|
|
142
|
+
key: index,
|
|
143
|
+
"label-render": props.summaryLabel,
|
|
144
|
+
data: item,
|
|
145
|
+
"form-items": props.columns.map((v) => {
|
|
146
|
+
return {
|
|
147
|
+
...v,
|
|
148
|
+
...v.templateProps,
|
|
149
|
+
...v.templateProps?.createTemplateProps?.({
|
|
150
|
+
row: item
|
|
151
|
+
})
|
|
152
|
+
};
|
|
153
|
+
})
|
|
154
|
+
}, null, 8, ["label-render", "data", "form-items"]);
|
|
155
|
+
}),
|
|
156
|
+
128
|
|
157
|
+
/* KEYED_FRAGMENT */
|
|
158
|
+
))
|
|
159
|
+
],
|
|
160
|
+
2
|
|
161
|
+
/* CLASS */
|
|
162
|
+
)
|
|
163
|
+
]),
|
|
164
|
+
_: 2
|
|
165
|
+
/* DYNAMIC */
|
|
166
|
+
}, 1032, ["class", "label", "prop"])
|
|
167
|
+
]),
|
|
168
|
+
_: 2
|
|
169
|
+
/* DYNAMIC */
|
|
170
|
+
}, 1032, ["type"]);
|
|
171
|
+
}),
|
|
172
|
+
128
|
|
173
|
+
/* KEYED_FRAGMENT */
|
|
174
|
+
))
|
|
175
|
+
],
|
|
176
|
+
64
|
|
177
|
+
/* STABLE_FRAGMENT */
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
var VkfInformationTemplatesDefault = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/information-templates-default/src/index.vue"]]);
|
|
181
|
+
|
|
182
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
183
|
+
__proto__: null
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
VkfInformationTemplatesDefault.install = (app) => {
|
|
187
|
+
app.component(VkfInformationTemplatesDefault.name || "VkfInformationTemplatesDefault", VkfInformationTemplatesDefault);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export { VkfInformationTemplatesDefault, types as __VkfInformationTemplatesDefault, VkfInformationTemplatesDefault as default };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
prefixCls: string;
|
|
3
|
+
simpleStringTemplates: string[];
|
|
4
|
+
simpleSelectTemplates: readonly ["VkfSelect", "VkfRadio"];
|
|
5
|
+
simpleCollectionTemplates: string[];
|
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {
|
|
7
|
+
VkfFormItem: {
|
|
8
|
+
new (...args: any[]): any;
|
|
9
|
+
__isFragment?: never;
|
|
10
|
+
__isTeleport?: never;
|
|
11
|
+
__isSuspense?: never;
|
|
12
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<Record<string | symbol, any>>>, Record<string | symbol, any>, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
[x: symbol]: any;
|
|
15
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
16
|
+
install(app: import("vue").App): void;
|
|
17
|
+
};
|
|
18
|
+
VkfFormItemRendererTemplate: {
|
|
19
|
+
new (...args: any[]): any;
|
|
20
|
+
__isFragment?: never;
|
|
21
|
+
__isTeleport?: never;
|
|
22
|
+
__isSuspense?: never;
|
|
23
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<Record<string | symbol, any>>>, Record<string | symbol, any>, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
[x: symbol]: any;
|
|
26
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
27
|
+
install(app: import("vue").App): void;
|
|
28
|
+
};
|
|
29
|
+
VkfTagInformation: {
|
|
30
|
+
new (...args: any[]): any;
|
|
31
|
+
__isFragment?: never;
|
|
32
|
+
__isTeleport?: never;
|
|
33
|
+
__isSuspense?: never;
|
|
34
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<Record<string | symbol, any>>>, Record<string | symbol, any>, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
35
|
+
[x: string]: any;
|
|
36
|
+
[x: symbol]: any;
|
|
37
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
38
|
+
install(app: import("vue").App): void;
|
|
39
|
+
};
|
|
40
|
+
VkfSelect: {
|
|
41
|
+
new (...args: any[]): any;
|
|
42
|
+
__isFragment?: never;
|
|
43
|
+
__isTeleport?: never;
|
|
44
|
+
__isSuspense?: never;
|
|
45
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<Record<string | symbol, any>>>, Record<string | symbol, any>, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
46
|
+
[x: string]: any;
|
|
47
|
+
[x: symbol]: any;
|
|
48
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
49
|
+
install(app: import("vue").App): void;
|
|
50
|
+
};
|
|
51
|
+
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
52
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -47,6 +47,10 @@ export declare const props: {
|
|
|
47
47
|
type: StringConstructor;
|
|
48
48
|
default: any;
|
|
49
49
|
};
|
|
50
|
+
information: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
default: boolean;
|
|
53
|
+
};
|
|
50
54
|
label: StringConstructor;
|
|
51
55
|
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
52
56
|
labelPosition: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "top" | "left" | "right", unknown, "", boolean>;
|
|
@@ -142,7 +146,7 @@ export declare const props: {
|
|
|
142
146
|
inputStyle: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | ((new (...args: any[]) => string | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue))[], unknown, unknown, () => import("element-plus/es/utils").Mutable<{}>, boolean>;
|
|
143
147
|
autofocus: BooleanConstructor;
|
|
144
148
|
};
|
|
145
|
-
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"type", keyof T2> | Extract<"required", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"prop", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"ariaLabel", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"formatter", keyof T2> | Extract<"autofocus", keyof T2> | Extract<"rows", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"tabindex", keyof T2> | Extract<"prefixIcon", keyof T2> | Extract<"maxlength", keyof T2> | Extract<"minlength", keyof T2> | Extract<"resize", keyof T2> | Extract<"autosize", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"parser", keyof T2> | Extract<"form", keyof T2> | Extract<"showPassword", keyof T2> | Extract<"showWordLimit", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"containerRole", keyof T2> | Extract<"inputStyle", keyof T2> | Extract<"inputSlots", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size" | "type" | "required" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "disabled" | "id" | "ariaLabel" | "modelValue" | "clearable" | "placeholder" | "formatter" | "autofocus" | "rows" | "validateEvent" | "tabindex" | "prefixIcon" | "maxlength" | "minlength" | "resize" | "autosize" | "autocomplete" | "parser" | "form" | "showPassword" | "showWordLimit" | "suffixIcon" | "containerRole" | "inputStyle" | "inputSlots", keyof T2>, KE> : Extract<"size" | "type" | "required" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "disabled" | "id" | "ariaLabel" | "modelValue" | "clearable" | "placeholder" | "formatter" | "autofocus" | "rows" | "validateEvent" | "tabindex" | "prefixIcon" | "maxlength" | "minlength" | "resize" | "autosize" | "autocomplete" | "parser" | "form" | "showPassword" | "showWordLimit" | "suffixIcon" | "containerRole" | "inputStyle" | "inputSlots", keyof T2>]: { [k in Extract<"size" | "type" | "required" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "disabled" | "id" | "ariaLabel" | "modelValue" | "clearable" | "placeholder" | "formatter" | "autofocus" | "rows" | "validateEvent" | "tabindex" | "prefixIcon" | "maxlength" | "minlength" | "resize" | "autosize" | "autocomplete" | "parser" | "form" | "showPassword" | "showWordLimit" | "suffixIcon" | "containerRole" | "inputStyle" | "inputSlots", keyof T2>]: T2[k]; }[P]; }>;
|
|
149
|
+
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"type", keyof T2> | Extract<"required", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"prop", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"ariaLabel", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"formatter", keyof T2> | Extract<"autofocus", keyof T2> | Extract<"rows", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"tabindex", keyof T2> | Extract<"prefixIcon", keyof T2> | Extract<"maxlength", keyof T2> | Extract<"minlength", keyof T2> | Extract<"resize", keyof T2> | Extract<"autosize", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"parser", keyof T2> | Extract<"form", keyof T2> | Extract<"showPassword", keyof T2> | Extract<"showWordLimit", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"containerRole", keyof T2> | Extract<"inputStyle", keyof T2> | Extract<"inputSlots", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size" | "type" | "required" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "information" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "disabled" | "id" | "ariaLabel" | "modelValue" | "clearable" | "placeholder" | "formatter" | "autofocus" | "rows" | "validateEvent" | "tabindex" | "prefixIcon" | "maxlength" | "minlength" | "resize" | "autosize" | "autocomplete" | "parser" | "form" | "showPassword" | "showWordLimit" | "suffixIcon" | "containerRole" | "inputStyle" | "inputSlots", keyof T2>, KE> : Extract<"size" | "type" | "required" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "information" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "disabled" | "id" | "ariaLabel" | "modelValue" | "clearable" | "placeholder" | "formatter" | "autofocus" | "rows" | "validateEvent" | "tabindex" | "prefixIcon" | "maxlength" | "minlength" | "resize" | "autosize" | "autocomplete" | "parser" | "form" | "showPassword" | "showWordLimit" | "suffixIcon" | "containerRole" | "inputStyle" | "inputSlots", keyof T2>]: { [k in Extract<"size" | "type" | "required" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "formItemTip" | "formItemTipClass" | "labelTip" | "information" | "label" | "labelWidth" | "labelPosition" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "disabled" | "id" | "ariaLabel" | "modelValue" | "clearable" | "placeholder" | "formatter" | "autofocus" | "rows" | "validateEvent" | "tabindex" | "prefixIcon" | "maxlength" | "minlength" | "resize" | "autosize" | "autocomplete" | "parser" | "form" | "showPassword" | "showWordLimit" | "suffixIcon" | "containerRole" | "inputStyle" | "inputSlots", keyof T2>]: T2[k]; }[P]; }>;
|
|
146
150
|
export declare const emits: {
|
|
147
151
|
"update:modelValue": (value: string) => boolean;
|
|
148
152
|
input: (value: string) => boolean;
|
|
@@ -45,6 +45,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
45
45
|
type: StringConstructor;
|
|
46
46
|
default: any;
|
|
47
47
|
};
|
|
48
|
+
information: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
default: boolean;
|
|
51
|
+
};
|
|
48
52
|
label: StringConstructor;
|
|
49
53
|
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
50
54
|
labelPosition: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "top" | "left" | "right", unknown, "", boolean>;
|
|
@@ -231,6 +235,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
231
235
|
type: StringConstructor;
|
|
232
236
|
default: any;
|
|
233
237
|
};
|
|
238
|
+
information: {
|
|
239
|
+
type: BooleanConstructor;
|
|
240
|
+
default: boolean;
|
|
241
|
+
};
|
|
234
242
|
label: StringConstructor;
|
|
235
243
|
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
236
244
|
labelPosition: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "top" | "left" | "right", unknown, "", boolean>;
|
|
@@ -348,6 +356,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
348
356
|
formItemTip: string;
|
|
349
357
|
formItemTipClass: any;
|
|
350
358
|
labelTip: string;
|
|
359
|
+
information: boolean;
|
|
351
360
|
labelWidth: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
352
361
|
labelPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "top" | "left" | "right", unknown>;
|
|
353
362
|
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
@@ -13,6 +13,7 @@ var formItemRenderer = require('@vunk/form/components/form-item-renderer');
|
|
|
13
13
|
var core = require('@vunk/core');
|
|
14
14
|
var index = require('../index2.cjs');
|
|
15
15
|
var rendererData = require('@vunk/form/components/renderer-data');
|
|
16
|
+
var fieldset = require('@vunk/form/components/fieldset');
|
|
16
17
|
var cloneDeep = require('../cloneDeep.cjs');
|
|
17
18
|
var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
|
|
18
19
|
require('../isObject.cjs');
|
|
@@ -39,9 +40,18 @@ const props = {
|
|
|
39
40
|
default: true
|
|
40
41
|
},
|
|
41
42
|
/**
|
|
42
|
-
* @description
|
|
43
|
+
* @description 简述一行的内容, 用于 Infomation
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
+
summaryLabel: {
|
|
46
|
+
type: Function,
|
|
47
|
+
default: (data) => {
|
|
48
|
+
return Object.values(data).join(" ");
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* @description 开启 form-item 的 label 上的操作区域, 在labelPosition为top时生效
|
|
53
|
+
*/
|
|
54
|
+
labelActions: {
|
|
45
55
|
type: Boolean,
|
|
46
56
|
default: false
|
|
47
57
|
}
|
|
@@ -95,49 +105,107 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
95
105
|
};
|
|
96
106
|
});
|
|
97
107
|
});
|
|
108
|
+
const expandFormItemRaws = vue.computed(() => props2.columns.filter(e => e.expandVisible));
|
|
109
|
+
const expandColumn = {
|
|
110
|
+
type: "expand",
|
|
111
|
+
slots: e => {
|
|
112
|
+
const source = expandFormItemRaws.value.map(column => {
|
|
113
|
+
return {
|
|
114
|
+
prop: [props2.prop ?? [], e.$index, column.prop].flat(),
|
|
115
|
+
label: column.label,
|
|
116
|
+
templateType: column.templateType,
|
|
117
|
+
readonly: readonly.value,
|
|
118
|
+
...column.templateProps,
|
|
119
|
+
...column.createTemplateProps?.(e),
|
|
120
|
+
class: "vk-input-collection__expand-form-item"
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
return vue.createVNode(fieldset.VkfFieldset, {
|
|
124
|
+
"class": "vk-input-collection__expand-fieldset",
|
|
125
|
+
"label-width": "auto"
|
|
126
|
+
}, {
|
|
127
|
+
default: () => [vue.createVNode(formItemRenderer.VkfFormItemRenderer, {
|
|
128
|
+
"source": source
|
|
129
|
+
}, null)]
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
};
|
|
98
133
|
const buttonsColumn = vue.computed(() => ({
|
|
99
134
|
label: "\u64CD\u4F5C",
|
|
100
135
|
align: "center",
|
|
101
|
-
width: "
|
|
136
|
+
width: "85",
|
|
102
137
|
hidden: readonly.value || !props2.splicable,
|
|
138
|
+
className: "vk-input-collection__buttons",
|
|
103
139
|
slots: ({
|
|
104
140
|
$index
|
|
105
141
|
}) => vue.createVNode(vue.Fragment, null, [vue.createVNode(elementPlus.ElButton, {
|
|
106
142
|
"size": "small",
|
|
107
143
|
"icon": index.plus_default,
|
|
144
|
+
"circle": true,
|
|
108
145
|
"onClick": () => handlePlus($index)
|
|
109
146
|
}, null), vue.createVNode(elementPlus.ElButton, {
|
|
110
147
|
"size": "small",
|
|
111
148
|
"icon": index.minus_default,
|
|
149
|
+
"circle": true,
|
|
112
150
|
"onClick": () => handleMinus($index)
|
|
113
151
|
}, null)])
|
|
114
152
|
}));
|
|
153
|
+
const allColumns = vue.computed(() => {
|
|
154
|
+
const data = [...fullColumns.value, buttonsColumn.value];
|
|
155
|
+
if (expandFormItemRaws.value.length) {
|
|
156
|
+
data.unshift(expandColumn);
|
|
157
|
+
}
|
|
158
|
+
return data;
|
|
159
|
+
});
|
|
115
160
|
function handlePlus(index) {
|
|
116
161
|
const data = cloneDeep.cloneDeep(props2.modelValue);
|
|
117
162
|
data.splice(index + 1, 0, {});
|
|
118
163
|
emit("update:modelValue", data);
|
|
164
|
+
setExpandRowKeys([]);
|
|
119
165
|
}
|
|
120
166
|
function handleMinus(index) {
|
|
121
167
|
const data = cloneDeep.cloneDeep(props2.modelValue);
|
|
122
168
|
data.splice(index, 1);
|
|
123
169
|
emit("update:modelValue", data);
|
|
170
|
+
setExpandRowKeys([]);
|
|
124
171
|
}
|
|
125
172
|
const addToFirst = () => {
|
|
126
173
|
emit("update:modelValue", [{}, ...props2.modelValue]);
|
|
174
|
+
setExpandRowKeys([]);
|
|
127
175
|
};
|
|
128
176
|
const handleFormSetData = e => {
|
|
129
177
|
const data = cloneDeep.cloneDeep(formData.value);
|
|
130
178
|
core.ensetData(data, e);
|
|
131
179
|
emit("update:modelValue", core.getValue(data, props2.prop));
|
|
132
180
|
};
|
|
181
|
+
const ROW_KEY = "_row_key";
|
|
182
|
+
const tableData = vue.computed(() => {
|
|
183
|
+
return props2.modelValue.map((e, index) => {
|
|
184
|
+
return {
|
|
185
|
+
...e,
|
|
186
|
+
[ROW_KEY]: index + ""
|
|
187
|
+
};
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
const expandRowKeys = vue.ref([]);
|
|
191
|
+
const handleExpandChange = (row, expandedRows) => {
|
|
192
|
+
expandRowKeys.value = expandedRows.map(e => e[ROW_KEY]);
|
|
193
|
+
};
|
|
194
|
+
function setExpandRowKeys(v) {
|
|
195
|
+
expandRowKeys.value = v;
|
|
196
|
+
}
|
|
133
197
|
return {
|
|
134
198
|
addToFirst,
|
|
135
199
|
formItemBindProps,
|
|
136
200
|
readonly,
|
|
137
|
-
fullColumns,
|
|
138
|
-
buttonsColumn,
|
|
139
201
|
handleFormSetData,
|
|
140
|
-
formData
|
|
202
|
+
formData,
|
|
203
|
+
Plus: index.plus_default,
|
|
204
|
+
expandRowKeys,
|
|
205
|
+
handleExpandChange,
|
|
206
|
+
tableData,
|
|
207
|
+
ROW_KEY,
|
|
208
|
+
allColumns
|
|
141
209
|
};
|
|
142
210
|
}
|
|
143
211
|
});
|
|
@@ -154,9 +222,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
154
222
|
const _component_VkfFormItem = vue.resolveComponent("VkfFormItem");
|
|
155
223
|
const _component_VkfRendererData = vue.resolveComponent("VkfRendererData");
|
|
156
224
|
const _component_VkfTemplateInstancesProvider = vue.resolveComponent("VkfTemplateInstancesProvider");
|
|
157
|
-
return vue.openBlock(), vue.createBlock(_component_VkfTemplateInstancesProvider,
|
|
225
|
+
return vue.openBlock(), vue.createBlock(_component_VkfTemplateInstancesProvider, null, {
|
|
226
|
+
placeholder: vue.withCtx(() => [
|
|
227
|
+
vue.createVNode(_component_VkfTemplatesDefault)
|
|
228
|
+
]),
|
|
158
229
|
default: vue.withCtx(() => [
|
|
159
|
-
!_ctx.inheritTemplates ? (vue.openBlock(), vue.createBlock(_component_VkfTemplatesDefault, { key: 0 })) : vue.createCommentVNode("v-if", true),
|
|
160
230
|
vue.createVNode(_component_VkfRendererData, {
|
|
161
231
|
data: _ctx.formData,
|
|
162
232
|
onSetData: _ctx.handleFormSetData
|
|
@@ -165,14 +235,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
165
235
|
vue.createVNode(
|
|
166
236
|
_component_VkfFormItem,
|
|
167
237
|
vue.normalizeProps(vue.guardReactiveProps(_ctx.formItemBindProps)),
|
|
168
|
-
{
|
|
238
|
+
vue.createSlots({
|
|
169
239
|
default: vue.withCtx(() => [
|
|
170
|
-
!_ctx.readonly && _ctx.splicable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
240
|
+
!_ctx.readonly && _ctx.splicable && !_ctx.labelActions ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
171
241
|
vue.createVNode(_component_ElButton, {
|
|
172
242
|
type: "primary",
|
|
173
243
|
onClick: _ctx.addToFirst
|
|
174
244
|
}, {
|
|
175
|
-
default: vue.withCtx(() => _cache[
|
|
245
|
+
default: vue.withCtx(() => _cache[1] || (_cache[1] = [
|
|
176
246
|
vue.createTextVNode(" \u6DFB\u52A0 ")
|
|
177
247
|
])),
|
|
178
248
|
_: 1
|
|
@@ -180,26 +250,43 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
180
250
|
}, 8, ["onClick"])
|
|
181
251
|
])) : vue.createCommentVNode("v-if", true),
|
|
182
252
|
vue.createVNode(_component_ElTable, {
|
|
183
|
-
data: _ctx.
|
|
184
|
-
class: "vkf-input-collection-table"
|
|
253
|
+
data: _ctx.tableData,
|
|
254
|
+
class: "vkf-input-collection-table",
|
|
255
|
+
"row-key": _ctx.ROW_KEY,
|
|
256
|
+
"expand-row-keys": _ctx.expandRowKeys,
|
|
257
|
+
"default-expand-all": "",
|
|
258
|
+
onExpandChange: _ctx.handleExpandChange
|
|
185
259
|
}, {
|
|
186
260
|
default: vue.withCtx(() => [
|
|
187
|
-
vue.createVNode(_component_VkTableColumns, {
|
|
188
|
-
source: [
|
|
189
|
-
..._ctx.fullColumns,
|
|
190
|
-
_ctx.buttonsColumn
|
|
191
|
-
]
|
|
192
|
-
}, null, 8, ["source"])
|
|
261
|
+
vue.createVNode(_component_VkTableColumns, { source: _ctx.allColumns }, null, 8, ["source"])
|
|
193
262
|
]),
|
|
194
263
|
_: 1
|
|
195
264
|
/* STABLE */
|
|
196
|
-
}, 8, ["data"])
|
|
265
|
+
}, 8, ["data", "row-key", "expand-row-keys", "onExpandChange"])
|
|
197
266
|
]),
|
|
198
|
-
_:
|
|
199
|
-
/*
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
|
|
267
|
+
_: 2
|
|
268
|
+
/* DYNAMIC */
|
|
269
|
+
}, [
|
|
270
|
+
!_ctx.readonly && _ctx.splicable && _ctx.labelActions ? {
|
|
271
|
+
name: "labelActions",
|
|
272
|
+
fn: vue.withCtx(() => [
|
|
273
|
+
vue.createVNode(_component_ElButton, {
|
|
274
|
+
size: "small",
|
|
275
|
+
icon: _ctx.Plus,
|
|
276
|
+
onClick: _ctx.addToFirst
|
|
277
|
+
}, {
|
|
278
|
+
default: vue.withCtx(() => _cache[0] || (_cache[0] = [
|
|
279
|
+
vue.createTextVNode(" \u6DFB\u52A0 ")
|
|
280
|
+
])),
|
|
281
|
+
_: 1
|
|
282
|
+
/* STABLE */
|
|
283
|
+
}, 8, ["icon", "onClick"])
|
|
284
|
+
]),
|
|
285
|
+
key: "0"
|
|
286
|
+
} : void 0
|
|
287
|
+
]),
|
|
288
|
+
1040
|
|
289
|
+
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
203
290
|
)
|
|
204
291
|
]),
|
|
205
292
|
_: 1
|
|
@@ -208,7 +295,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
208
295
|
]),
|
|
209
296
|
_: 1
|
|
210
297
|
/* STABLE */
|
|
211
|
-
}
|
|
298
|
+
});
|
|
212
299
|
}
|
|
213
300
|
var VkfInputCollection = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/input-collection/src/index.vue"]]);
|
|
214
301
|
|
|
@@ -9,3 +9,12 @@
|
|
|
9
9
|
.vkf-input-collection-table .vkf-form-item {
|
|
10
10
|
margin-bottom: 0;
|
|
11
11
|
}
|
|
12
|
+
.vkf-input-collection-table .vk-input-collection__expand-form-item {
|
|
13
|
+
margin-bottom: 18px;
|
|
14
|
+
}
|
|
15
|
+
.vk-input-collection__expand-fieldset{
|
|
16
|
+
padding: 8px;
|
|
17
|
+
}
|
|
18
|
+
.vk-input-collection__buttons .cell{
|
|
19
|
+
padding: 0;
|
|
20
|
+
}
|