@vunk/form 2.4.0 → 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/cascader/src/index.vue.d.ts +2 -2
- 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-item/index.cjs +42 -5
- package/components/form-item/index.css +13 -0
- package/components/form-item/index.mjs +43 -6
- package/components/form-item/src/index.vue.d.ts +3 -0
- package/components/form-item/src/types.d.ts +1 -0
- package/components/information/src/types.d.ts +3 -2
- package/components/information-templates-default/index.cjs +12 -3
- package/components/information-templates-default/index.mjs +12 -3
- package/components/input-collection/index.cjs +104 -21
- package/components/input-collection/index.css +9 -0
- package/components/input-collection/index.mjs +105 -22
- package/components/input-collection/src/ctx.d.ts +7 -0
- package/components/input-collection/src/index.vue.d.ts +31 -2
- package/components/input-collection/src/types.d.ts +1 -0
- package/components/tables-select/src/index.vue.d.ts +9 -0
- package/components/tag-information/index.cjs +11 -2
- package/components/tag-information/index.mjs +11 -2
- package/components/tag-information/src/ctx.d.ts +8 -0
- package/components/tag-information/src/index.vue.d.ts +24 -6
- package/components/van-cascader/src/index.vue.d.ts +67 -12803
- package/index.css +28 -0
- package/package.json +9 -1
- package/shared/element-plus/ctx.d.ts +4 -4
|
@@ -151,7 +151,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
151
151
|
debounce: number;
|
|
152
152
|
beforeFilter: (value: string) => boolean | Promise<any>;
|
|
153
153
|
tagType: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown>;
|
|
154
|
-
tagEffect: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "dark" | "
|
|
154
|
+
tagEffect: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "dark" | "light" | "plain", unknown>;
|
|
155
155
|
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
156
156
|
}>;
|
|
157
157
|
coreOnEmits: {};
|
|
@@ -338,7 +338,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
338
338
|
debounce: number;
|
|
339
339
|
beforeFilter: (value: string) => boolean | Promise<any>;
|
|
340
340
|
tagType: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown>;
|
|
341
|
-
tagEffect: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "dark" | "
|
|
341
|
+
tagEffect: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "dark" | "light" | "plain", unknown>;
|
|
342
342
|
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
343
343
|
optionsUrl: string;
|
|
344
344
|
}, {}, {
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var elementPlus = require('element-plus');
|
|
7
|
+
var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
|
|
8
|
+
|
|
9
|
+
const props = {
|
|
10
|
+
labelWidth: {
|
|
11
|
+
type: [String, Number],
|
|
12
|
+
default: void 0
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const emits = {};
|
|
16
|
+
|
|
17
|
+
class ElementPlusError extends Error {
|
|
18
|
+
constructor(m) {
|
|
19
|
+
super(m);
|
|
20
|
+
this.name = "ElementPlusError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function debugWarn(scope, message) {
|
|
24
|
+
if (process.env.NODE_ENV !== "production") {
|
|
25
|
+
const error = new ElementPlusError(`[${scope}] ${message}`) ;
|
|
26
|
+
console.warn(error);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const SCOPE = "ElForm";
|
|
31
|
+
function useFormLabelWidth() {
|
|
32
|
+
const potentialLabelWidthArr = vue.ref([]);
|
|
33
|
+
const autoLabelWidth = vue.computed(() => {
|
|
34
|
+
if (!potentialLabelWidthArr.value.length)
|
|
35
|
+
return "0";
|
|
36
|
+
const max = Math.max(...potentialLabelWidthArr.value);
|
|
37
|
+
return max ? `${max}px` : "";
|
|
38
|
+
});
|
|
39
|
+
function getLabelWidthIndex(width) {
|
|
40
|
+
const index = potentialLabelWidthArr.value.indexOf(width);
|
|
41
|
+
if (index === -1 && autoLabelWidth.value === "0") {
|
|
42
|
+
debugWarn(SCOPE, `unexpected width ${width}`);
|
|
43
|
+
}
|
|
44
|
+
return index;
|
|
45
|
+
}
|
|
46
|
+
function registerLabelWidth(val, oldVal) {
|
|
47
|
+
if (val && oldVal) {
|
|
48
|
+
const index = getLabelWidthIndex(oldVal);
|
|
49
|
+
potentialLabelWidthArr.value.splice(index, 1, val);
|
|
50
|
+
} else if (val) {
|
|
51
|
+
potentialLabelWidthArr.value.push(val);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function deregisterLabelWidth(val) {
|
|
55
|
+
const index = getLabelWidthIndex(val);
|
|
56
|
+
if (index > -1) {
|
|
57
|
+
potentialLabelWidthArr.value.splice(index, 1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
autoLabelWidth,
|
|
62
|
+
registerLabelWidth,
|
|
63
|
+
deregisterLabelWidth
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
var _sfc_main = vue.defineComponent({
|
|
68
|
+
name: "VkfFieldset",
|
|
69
|
+
props,
|
|
70
|
+
emits,
|
|
71
|
+
setup(props2) {
|
|
72
|
+
const formContext = vue.inject(elementPlus.formContextKey);
|
|
73
|
+
const labelWidth = vue.computed(() => {
|
|
74
|
+
return props2.labelWidth ?? formContext.labelWidth;
|
|
75
|
+
});
|
|
76
|
+
vue.provide(
|
|
77
|
+
elementPlus.formContextKey,
|
|
78
|
+
vue.reactive({
|
|
79
|
+
...vue.toRefs(formContext),
|
|
80
|
+
labelWidth,
|
|
81
|
+
...useFormLabelWidth()
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
return {};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const _hoisted_1 = { class: "vkf-fieldset" };
|
|
89
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
90
|
+
return vue.openBlock(), vue.createElementBlock("fieldset", _hoisted_1, [
|
|
91
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
92
|
+
]);
|
|
93
|
+
}
|
|
94
|
+
var VkfFieldset = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/fieldset/src/index.vue"]]);
|
|
95
|
+
|
|
96
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
97
|
+
__proto__: null
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
VkfFieldset.install = (app) => {
|
|
101
|
+
app.component(VkfFieldset.name || "VkfFieldset", VkfFieldset);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
exports.VkfFieldset = VkfFieldset;
|
|
105
|
+
exports.__VkfFieldset = types;
|
|
106
|
+
exports.default = VkfFieldset;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ref, computed, defineComponent, inject, provide, reactive, toRefs, openBlock, createElementBlock, renderSlot } from 'vue';
|
|
2
|
+
import { formContextKey } from 'element-plus';
|
|
3
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
4
|
+
|
|
5
|
+
const props = {
|
|
6
|
+
labelWidth: {
|
|
7
|
+
type: [String, Number],
|
|
8
|
+
default: void 0
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const emits = {};
|
|
12
|
+
|
|
13
|
+
class ElementPlusError extends Error {
|
|
14
|
+
constructor(m) {
|
|
15
|
+
super(m);
|
|
16
|
+
this.name = "ElementPlusError";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function debugWarn(scope, message) {
|
|
20
|
+
if (process.env.NODE_ENV !== "production") {
|
|
21
|
+
const error = new ElementPlusError(`[${scope}] ${message}`) ;
|
|
22
|
+
console.warn(error);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const SCOPE = "ElForm";
|
|
27
|
+
function useFormLabelWidth() {
|
|
28
|
+
const potentialLabelWidthArr = ref([]);
|
|
29
|
+
const autoLabelWidth = computed(() => {
|
|
30
|
+
if (!potentialLabelWidthArr.value.length)
|
|
31
|
+
return "0";
|
|
32
|
+
const max = Math.max(...potentialLabelWidthArr.value);
|
|
33
|
+
return max ? `${max}px` : "";
|
|
34
|
+
});
|
|
35
|
+
function getLabelWidthIndex(width) {
|
|
36
|
+
const index = potentialLabelWidthArr.value.indexOf(width);
|
|
37
|
+
if (index === -1 && autoLabelWidth.value === "0") {
|
|
38
|
+
debugWarn(SCOPE, `unexpected width ${width}`);
|
|
39
|
+
}
|
|
40
|
+
return index;
|
|
41
|
+
}
|
|
42
|
+
function registerLabelWidth(val, oldVal) {
|
|
43
|
+
if (val && oldVal) {
|
|
44
|
+
const index = getLabelWidthIndex(oldVal);
|
|
45
|
+
potentialLabelWidthArr.value.splice(index, 1, val);
|
|
46
|
+
} else if (val) {
|
|
47
|
+
potentialLabelWidthArr.value.push(val);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function deregisterLabelWidth(val) {
|
|
51
|
+
const index = getLabelWidthIndex(val);
|
|
52
|
+
if (index > -1) {
|
|
53
|
+
potentialLabelWidthArr.value.splice(index, 1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
autoLabelWidth,
|
|
58
|
+
registerLabelWidth,
|
|
59
|
+
deregisterLabelWidth
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var _sfc_main = defineComponent({
|
|
64
|
+
name: "VkfFieldset",
|
|
65
|
+
props,
|
|
66
|
+
emits,
|
|
67
|
+
setup(props2) {
|
|
68
|
+
const formContext = inject(formContextKey);
|
|
69
|
+
const labelWidth = computed(() => {
|
|
70
|
+
return props2.labelWidth ?? formContext.labelWidth;
|
|
71
|
+
});
|
|
72
|
+
provide(
|
|
73
|
+
formContextKey,
|
|
74
|
+
reactive({
|
|
75
|
+
...toRefs(formContext),
|
|
76
|
+
labelWidth,
|
|
77
|
+
...useFormLabelWidth()
|
|
78
|
+
})
|
|
79
|
+
);
|
|
80
|
+
return {};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const _hoisted_1 = { class: "vkf-fieldset" };
|
|
85
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
86
|
+
return openBlock(), createElementBlock("fieldset", _hoisted_1, [
|
|
87
|
+
renderSlot(_ctx.$slots, "default")
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
var VkfFieldset = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/fieldset/src/index.vue"]]);
|
|
91
|
+
|
|
92
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
93
|
+
__proto__: null
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
VkfFieldset.install = (app) => {
|
|
97
|
+
app.component(VkfFieldset.name || "VkfFieldset", VkfFieldset);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export { VkfFieldset, types as __VkfFieldset, VkfFieldset as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
labelWidth: {
|
|
3
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
4
|
+
default: any;
|
|
5
|
+
};
|
|
6
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
labelWidth: {
|
|
8
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
9
|
+
default: any;
|
|
10
|
+
};
|
|
11
|
+
}>> & Readonly<{}>, {
|
|
12
|
+
labelWidth: string | number;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -68,7 +68,7 @@ var _sfc_main = vue.defineComponent({
|
|
|
68
68
|
ElButton: elementPlus.ElButton
|
|
69
69
|
},
|
|
70
70
|
props,
|
|
71
|
-
setup(props2) {
|
|
71
|
+
setup(props2, { slots }) {
|
|
72
72
|
const formItemBindProps = elementPlus$1.createFormItemBindProps(props2, ["rules"]);
|
|
73
73
|
const readonly = composables.useComputedReadonly(props2);
|
|
74
74
|
const globalConfig = elementPlus.useGlobalConfig();
|
|
@@ -118,15 +118,48 @@ var _sfc_main = vue.defineComponent({
|
|
|
118
118
|
});
|
|
119
119
|
return data;
|
|
120
120
|
});
|
|
121
|
+
const elFormItemSlots = vue.computed(() => {
|
|
122
|
+
const slots2 = {};
|
|
123
|
+
const keys = ["label", "default", "error"];
|
|
124
|
+
const formItemSlots = props2.formItemSlots;
|
|
125
|
+
if (formItemSlots) {
|
|
126
|
+
Object.keys(formItemSlots).forEach((key) => {
|
|
127
|
+
if (keys.includes(key)) {
|
|
128
|
+
slots2[key] = formItemSlots?.[key];
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return slots2;
|
|
133
|
+
});
|
|
134
|
+
const customSlots = vue.computed(() => {
|
|
135
|
+
const theSlots = {
|
|
136
|
+
labelActions: slots?.labelActions ? () => slots.labelActions?.() : void 0
|
|
137
|
+
};
|
|
138
|
+
const keys = ["labelActions"];
|
|
139
|
+
const formItemSlots = props2.formItemSlots;
|
|
140
|
+
formItemSlots && Object.keys(formItemSlots).filter(keys.includes).forEach((key) => {
|
|
141
|
+
const slot = formItemSlots?.[key];
|
|
142
|
+
if (slot) {
|
|
143
|
+
theSlots[key] = slot;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
return theSlots;
|
|
147
|
+
});
|
|
121
148
|
return {
|
|
122
149
|
formItemBindProps,
|
|
123
150
|
readonly,
|
|
124
151
|
rules: rules$1,
|
|
125
|
-
localeName
|
|
152
|
+
localeName,
|
|
153
|
+
elFormItemSlots,
|
|
154
|
+
customSlots
|
|
126
155
|
};
|
|
127
156
|
}
|
|
128
157
|
});
|
|
129
158
|
|
|
159
|
+
const _hoisted_1 = {
|
|
160
|
+
key: 1,
|
|
161
|
+
class: "vk-form-item-label__actions"
|
|
162
|
+
};
|
|
130
163
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
131
164
|
const _component_Warning = vue.resolveComponent("Warning");
|
|
132
165
|
const _component_ElIcon = vue.resolveComponent("ElIcon");
|
|
@@ -139,7 +172,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
139
172
|
"is-readonly": _ctx.readonly,
|
|
140
173
|
"vkf-form-item--inline": _ctx.inline,
|
|
141
174
|
"is-empty-label": !_ctx.label,
|
|
142
|
-
"is-information": _ctx.information
|
|
175
|
+
"is-information": _ctx.information,
|
|
176
|
+
"has-label-actions": _ctx.customSlots.labelActions
|
|
143
177
|
}],
|
|
144
178
|
size: _ctx.formItemSize,
|
|
145
179
|
rules: _ctx.rules
|
|
@@ -202,11 +236,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
202
236
|
]),
|
|
203
237
|
_: 1
|
|
204
238
|
/* STABLE */
|
|
205
|
-
}, 8, ["content"])) : vue.createCommentVNode("v-if", true)
|
|
239
|
+
}, 8, ["content"])) : vue.createCommentVNode("v-if", true),
|
|
240
|
+
_ctx.customSlots.labelActions ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
241
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.customSlots.labelActions)))
|
|
242
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
206
243
|
]),
|
|
207
244
|
key: "0"
|
|
208
245
|
} : void 0,
|
|
209
|
-
vue.renderList(_ctx.
|
|
246
|
+
vue.renderList(_ctx.elFormItemSlots, (item, key) => {
|
|
210
247
|
return {
|
|
211
248
|
name: key,
|
|
212
249
|
fn: vue.withCtx((e) => [
|
|
@@ -20,3 +20,16 @@
|
|
|
20
20
|
.vkf-form-item.is-empty-label .el-form-item__label:before{
|
|
21
21
|
display: none;
|
|
22
22
|
}
|
|
23
|
+
.vkf-form-item.has-label-actions > .el-form-item__label {
|
|
24
|
+
width: 100%;
|
|
25
|
+
padding-right: 0;
|
|
26
|
+
}
|
|
27
|
+
.vk-form-item-label__actions {
|
|
28
|
+
float: right;
|
|
29
|
+
align-items: center;
|
|
30
|
+
display: none;
|
|
31
|
+
height: 1.8em;
|
|
32
|
+
}
|
|
33
|
+
.el-form-item--label-top .vk-form-item-label__actions {
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { formItemProps, ElFormItem, ElIcon, ElTooltip, ElButton, useGlobalConfig } from 'element-plus';
|
|
2
2
|
import { bindPropsFactory } from '@vunk/core/shared/utils-vue';
|
|
3
|
-
import { defineComponent, computed, resolveComponent, openBlock, createBlock, mergeProps, createSlots, withCtx, renderSlot, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, createVNode,
|
|
3
|
+
import { defineComponent, computed, resolveComponent, openBlock, createBlock, mergeProps, createSlots, withCtx, renderSlot, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, createVNode, resolveDynamicComponent, renderList } from 'vue';
|
|
4
4
|
import { createFormItemBindProps } from '@vunk/form/shared/element-plus';
|
|
5
5
|
import { useComputedReadonly } from '@vunk/form/composables';
|
|
6
6
|
import { isPlainObject } from '@vunk/core/shared/utils-object';
|
|
@@ -64,7 +64,7 @@ var _sfc_main = defineComponent({
|
|
|
64
64
|
ElButton
|
|
65
65
|
},
|
|
66
66
|
props,
|
|
67
|
-
setup(props2) {
|
|
67
|
+
setup(props2, { slots }) {
|
|
68
68
|
const formItemBindProps = createFormItemBindProps(props2, ["rules"]);
|
|
69
69
|
const readonly = useComputedReadonly(props2);
|
|
70
70
|
const globalConfig = useGlobalConfig();
|
|
@@ -114,15 +114,48 @@ var _sfc_main = defineComponent({
|
|
|
114
114
|
});
|
|
115
115
|
return data;
|
|
116
116
|
});
|
|
117
|
+
const elFormItemSlots = computed(() => {
|
|
118
|
+
const slots2 = {};
|
|
119
|
+
const keys = ["label", "default", "error"];
|
|
120
|
+
const formItemSlots = props2.formItemSlots;
|
|
121
|
+
if (formItemSlots) {
|
|
122
|
+
Object.keys(formItemSlots).forEach((key) => {
|
|
123
|
+
if (keys.includes(key)) {
|
|
124
|
+
slots2[key] = formItemSlots?.[key];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return slots2;
|
|
129
|
+
});
|
|
130
|
+
const customSlots = computed(() => {
|
|
131
|
+
const theSlots = {
|
|
132
|
+
labelActions: slots?.labelActions ? () => slots.labelActions?.() : void 0
|
|
133
|
+
};
|
|
134
|
+
const keys = ["labelActions"];
|
|
135
|
+
const formItemSlots = props2.formItemSlots;
|
|
136
|
+
formItemSlots && Object.keys(formItemSlots).filter(keys.includes).forEach((key) => {
|
|
137
|
+
const slot = formItemSlots?.[key];
|
|
138
|
+
if (slot) {
|
|
139
|
+
theSlots[key] = slot;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
return theSlots;
|
|
143
|
+
});
|
|
117
144
|
return {
|
|
118
145
|
formItemBindProps,
|
|
119
146
|
readonly,
|
|
120
147
|
rules,
|
|
121
|
-
localeName
|
|
148
|
+
localeName,
|
|
149
|
+
elFormItemSlots,
|
|
150
|
+
customSlots
|
|
122
151
|
};
|
|
123
152
|
}
|
|
124
153
|
});
|
|
125
154
|
|
|
155
|
+
const _hoisted_1 = {
|
|
156
|
+
key: 1,
|
|
157
|
+
class: "vk-form-item-label__actions"
|
|
158
|
+
};
|
|
126
159
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
127
160
|
const _component_Warning = resolveComponent("Warning");
|
|
128
161
|
const _component_ElIcon = resolveComponent("ElIcon");
|
|
@@ -135,7 +168,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
135
168
|
"is-readonly": _ctx.readonly,
|
|
136
169
|
"vkf-form-item--inline": _ctx.inline,
|
|
137
170
|
"is-empty-label": !_ctx.label,
|
|
138
|
-
"is-information": _ctx.information
|
|
171
|
+
"is-information": _ctx.information,
|
|
172
|
+
"has-label-actions": _ctx.customSlots.labelActions
|
|
139
173
|
}],
|
|
140
174
|
size: _ctx.formItemSize,
|
|
141
175
|
rules: _ctx.rules
|
|
@@ -198,11 +232,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
198
232
|
]),
|
|
199
233
|
_: 1
|
|
200
234
|
/* STABLE */
|
|
201
|
-
}, 8, ["content"])) : createCommentVNode("v-if", true)
|
|
235
|
+
}, 8, ["content"])) : createCommentVNode("v-if", true),
|
|
236
|
+
_ctx.customSlots.labelActions ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
237
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.customSlots.labelActions)))
|
|
238
|
+
])) : createCommentVNode("v-if", true)
|
|
202
239
|
]),
|
|
203
240
|
key: "0"
|
|
204
241
|
} : void 0,
|
|
205
|
-
renderList(_ctx.
|
|
242
|
+
renderList(_ctx.elFormItemSlots, (item, key) => {
|
|
206
243
|
return {
|
|
207
244
|
name: key,
|
|
208
245
|
fn: withCtx((e) => [
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FormItemRule } from 'element-plus';
|
|
2
|
+
import { NormalObject } from '@vunk/shared';
|
|
2
3
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<Omit<{
|
|
3
4
|
formItemSize: {
|
|
4
5
|
type: import("vue").PropType<"default" | "small" | "large">;
|
|
@@ -81,6 +82,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
81
82
|
readonly: import("vue").ComputedRef<boolean>;
|
|
82
83
|
rules: import("vue").ComputedRef<FormItemRule[]>;
|
|
83
84
|
localeName: import("vue").ComputedRef<string>;
|
|
85
|
+
elFormItemSlots: import("vue").ComputedRef<NormalObject>;
|
|
86
|
+
customSlots: import("vue").ComputedRef<NormalObject>;
|
|
84
87
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<Omit<{
|
|
85
88
|
formItemSize: {
|
|
86
89
|
type: import("vue").PropType<"default" | "small" | "large">;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { __VkfInputCollection } from '@vunk/form/components/input-collection';
|
|
2
|
+
import { __VkfTemplatesDefault } from '@vunk/form';
|
|
3
|
+
export type FormItem<P extends string = string> = __VkfTemplatesDefault.Source<P> | __VkfInputCollection.Source<P>;
|
|
@@ -105,8 +105,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
105
105
|
information: true,
|
|
106
106
|
class: vue.normalizeClass(`${_ctx.prefixCls}-main`),
|
|
107
107
|
readonly: true,
|
|
108
|
-
"model-value": value
|
|
109
|
-
|
|
108
|
+
"model-value": value,
|
|
109
|
+
options: props.options
|
|
110
|
+
}, null, 8, ["label", "class", "model-value", "options"])
|
|
110
111
|
]),
|
|
111
112
|
_: 2
|
|
112
113
|
/* DYNAMIC */
|
|
@@ -145,7 +146,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
145
146
|
key: index,
|
|
146
147
|
"label-render": props.summaryLabel,
|
|
147
148
|
data: item,
|
|
148
|
-
"form-items": props.columns
|
|
149
|
+
"form-items": props.columns.map((v) => {
|
|
150
|
+
return {
|
|
151
|
+
...v,
|
|
152
|
+
...v.templateProps,
|
|
153
|
+
...v.templateProps?.createTemplateProps?.({
|
|
154
|
+
row: item
|
|
155
|
+
})
|
|
156
|
+
};
|
|
157
|
+
})
|
|
149
158
|
}, null, 8, ["label-render", "data", "form-items"]);
|
|
150
159
|
}),
|
|
151
160
|
128
|
|
@@ -101,8 +101,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
101
101
|
information: true,
|
|
102
102
|
class: normalizeClass(`${_ctx.prefixCls}-main`),
|
|
103
103
|
readonly: true,
|
|
104
|
-
"model-value": value
|
|
105
|
-
|
|
104
|
+
"model-value": value,
|
|
105
|
+
options: props.options
|
|
106
|
+
}, null, 8, ["label", "class", "model-value", "options"])
|
|
106
107
|
]),
|
|
107
108
|
_: 2
|
|
108
109
|
/* DYNAMIC */
|
|
@@ -141,7 +142,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
141
142
|
key: index,
|
|
142
143
|
"label-render": props.summaryLabel,
|
|
143
144
|
data: item,
|
|
144
|
-
"form-items": props.columns
|
|
145
|
+
"form-items": props.columns.map((v) => {
|
|
146
|
+
return {
|
|
147
|
+
...v,
|
|
148
|
+
...v.templateProps,
|
|
149
|
+
...v.templateProps?.createTemplateProps?.({
|
|
150
|
+
row: item
|
|
151
|
+
})
|
|
152
|
+
};
|
|
153
|
+
})
|
|
145
154
|
}, null, 8, ["label-render", "data", "form-items"]);
|
|
146
155
|
}),
|
|
147
156
|
128
|