@vunk/form 2.6.1 → 2.7.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/form-item-renderer/index.cjs +3 -0
- package/components/form-item-renderer/index.mjs +3 -0
- package/components/form-item-renderer/src/types.d.ts +2 -5
- package/components/form-item-renderer-template/src/types.d.ts +6 -2
- package/components/information/index.cjs +22 -36
- package/components/information/index.mjs +23 -37
- package/components/information/src/index.vue.d.ts +2 -370
- package/components/information-collection/index.cjs +73 -0
- package/components/information-collection/index.d.ts +4 -0
- package/components/information-collection/index.mjs +67 -0
- package/components/information-collection/src/ctx.d.ts +107 -0
- package/components/information-collection/src/index.vue.d.ts +223 -0
- package/components/information-collection/src/types.d.ts +4 -0
- package/components/information-tag/index.cjs +101 -0
- package/components/information-tag/index.css +6 -0
- package/components/information-tag/index.d.ts +4 -0
- package/components/information-tag/index.mjs +95 -0
- package/components/information-tag/src/ctx.d.ts +50 -0
- package/components/information-tag/src/index.vue.d.ts +106 -0
- package/components/information-templates-default/index.cjs +56 -169
- package/components/information-templates-default/index.mjs +58 -171
- package/components/information-templates-default/src/index.vue.d.ts +1 -51
- package/components/input-collection/index.cjs +23 -15
- package/components/input-collection/index.mjs +23 -15
- package/components/input-collection/src/ctx.d.ts +0 -7
- package/components/input-collection/src/index.vue.d.ts +0 -9
- package/components/input-collection/src/types.d.ts +6 -1
- package/index.css +7 -7
- package/package.json +14 -9
- package/shared/element-plus/ctx.d.ts +2 -0
- package/shared/element-plus/index.cjs +4 -0
- package/shared/element-plus/index.mjs +4 -2
- package/shared/types/source/index.d.ts +21 -1
- package/components/tag-information/index.cjs +0 -114
- package/components/tag-information/index.css +0 -6
- package/components/tag-information/index.d.ts +0 -4
- package/components/tag-information/index.mjs +0 -108
- package/components/tag-information/src/ctx.d.ts +0 -34
- package/components/tag-information/src/index.vue.d.ts +0 -912
- /package/components/{tag-information → information-tag}/src/types.d.ts +0 -0
|
@@ -1,183 +1,70 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, createVNode, Fragment, mergeProps } from 'vue';
|
|
2
2
|
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
3
|
-
import { VkfFormItem } from '@vunk/form/components/form-item';
|
|
3
|
+
import { VkfFormItem, _VkfFormItemCtx } from '@vunk/form/components/form-item';
|
|
4
4
|
import { VkfSelect } from '@vunk/form/components/select';
|
|
5
|
-
import {
|
|
5
|
+
import { VkfInformationCollection } from '@vunk/form/components/information-collection';
|
|
6
6
|
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const emits = {};
|
|
10
|
-
|
|
11
|
-
var _sfc_main = defineComponent({
|
|
8
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
9
|
name: "VkfInformationTemplatesDefault",
|
|
13
|
-
|
|
14
|
-
VkfFormItem,
|
|
15
|
-
VkfFormItemRendererTemplate,
|
|
16
|
-
VkfTagInformation,
|
|
17
|
-
VkfSelect
|
|
18
|
-
},
|
|
19
|
-
props,
|
|
20
|
-
emits,
|
|
21
|
-
setup(props2, { emit }) {
|
|
10
|
+
setup() {
|
|
22
11
|
const prefixCls = "vkf-information-templates-default";
|
|
23
|
-
const simpleStringTemplates = [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
12
|
+
const simpleStringTemplates = ["VkfInput", "VkfInputNumber", "VkfSlider"];
|
|
13
|
+
const simpleSelectTemplates = ["VkfSelect", "VkfRadio"];
|
|
14
|
+
const simpleCollectionTemplates = ["VkfInputCollection"];
|
|
15
|
+
return () => createVNode(Fragment, null, [simpleStringTemplates.map(t => createVNode(VkfFormItemRendererTemplate, {
|
|
16
|
+
"key": t,
|
|
17
|
+
"type": t
|
|
18
|
+
}, {
|
|
19
|
+
default: ({
|
|
20
|
+
props,
|
|
21
|
+
value
|
|
22
|
+
}) => createVNode(VkfFormItem, {
|
|
23
|
+
"class": `${prefixCls}-main`,
|
|
24
|
+
"label": props.label,
|
|
25
|
+
"prop": props.prop,
|
|
26
|
+
"information": true
|
|
27
|
+
}, {
|
|
28
|
+
default: () => [createVNode("div", {
|
|
29
|
+
"class": `${prefixCls}-value`
|
|
30
|
+
}, [value])]
|
|
31
|
+
})
|
|
32
|
+
})), simpleSelectTemplates.map(t => createVNode(VkfFormItemRendererTemplate, {
|
|
33
|
+
"key": t,
|
|
34
|
+
"type": t
|
|
35
|
+
}, {
|
|
36
|
+
default: ({
|
|
37
|
+
props,
|
|
38
|
+
value
|
|
39
|
+
}) => createVNode(VkfSelect, {
|
|
40
|
+
"label": props.label,
|
|
41
|
+
"information": true,
|
|
42
|
+
"class": `${prefixCls}-main`,
|
|
43
|
+
"readonly": true,
|
|
44
|
+
"modelValue": value,
|
|
45
|
+
"options": props.options
|
|
46
|
+
}, null)
|
|
47
|
+
})), simpleCollectionTemplates.map(t => createVNode(VkfFormItemRendererTemplate, {
|
|
48
|
+
"key": t,
|
|
49
|
+
"type": t
|
|
50
|
+
}, {
|
|
51
|
+
default: ({
|
|
52
|
+
props,
|
|
53
|
+
value,
|
|
54
|
+
informationProps
|
|
55
|
+
}) => {
|
|
56
|
+
const formItemProps = _VkfFormItemCtx.createBindProps(props);
|
|
57
|
+
return createVNode(VkfInformationCollection, mergeProps({
|
|
58
|
+
"class": `${prefixCls}-main`,
|
|
59
|
+
"modelValue": value,
|
|
60
|
+
"columns": props.columns
|
|
61
|
+
}, formItemProps.value, informationProps), null);
|
|
62
|
+
}
|
|
63
|
+
}))]);
|
|
41
64
|
}
|
|
42
65
|
});
|
|
43
66
|
|
|
44
|
-
|
|
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"]]);
|
|
67
|
+
var VkfInformationTemplatesDefault = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/information-templates-default/src/index.vue"]]);
|
|
181
68
|
|
|
182
69
|
var types = /*#__PURE__*/Object.freeze({
|
|
183
70
|
__proto__: null
|
|
@@ -1,52 +1,2 @@
|
|
|
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>;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
52
2
|
export default _default;
|
|
@@ -39,15 +39,6 @@ const props = {
|
|
|
39
39
|
type: Boolean,
|
|
40
40
|
default: true
|
|
41
41
|
},
|
|
42
|
-
/**
|
|
43
|
-
* @description 简述一行的内容, 用于 Infomation
|
|
44
|
-
*/
|
|
45
|
-
summaryLabel: {
|
|
46
|
-
type: Function,
|
|
47
|
-
default: (data) => {
|
|
48
|
-
return Object.values(data).join(" ");
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
42
|
/**
|
|
52
43
|
* @description 开启 form-item 的 label 上的操作区域, 在labelPosition为top时生效
|
|
53
44
|
*/
|
|
@@ -103,6 +94,11 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
103
94
|
});
|
|
104
95
|
return data;
|
|
105
96
|
});
|
|
97
|
+
const innerCtx = {
|
|
98
|
+
addExpandRowKey,
|
|
99
|
+
removeExpandRowKey,
|
|
100
|
+
getExpandRowKeys
|
|
101
|
+
};
|
|
106
102
|
const fullColumns = vue.computed(() => {
|
|
107
103
|
return props2.columns.map(column => {
|
|
108
104
|
return {
|
|
@@ -118,9 +114,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
118
114
|
return vue.createVNode(formItemRenderer.VkfFormItemRenderer, {
|
|
119
115
|
"source": [{
|
|
120
116
|
...formItemProps,
|
|
121
|
-
...column.createTemplateProps?.(e, formItemProps,
|
|
122
|
-
setExpandRowKeys
|
|
123
|
-
})
|
|
117
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
124
118
|
}]
|
|
125
119
|
}, null);
|
|
126
120
|
}
|
|
@@ -142,9 +136,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
142
136
|
};
|
|
143
137
|
return {
|
|
144
138
|
...formItemProps,
|
|
145
|
-
...column.createTemplateProps?.(e, formItemProps,
|
|
146
|
-
setExpandRowKeys
|
|
147
|
-
})
|
|
139
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
148
140
|
};
|
|
149
141
|
});
|
|
150
142
|
return vue.createVNode(fieldset.VkfFieldset, {
|
|
@@ -225,6 +217,22 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
225
217
|
function setExpandRowKeys(v) {
|
|
226
218
|
expandRowKeys.value = v;
|
|
227
219
|
}
|
|
220
|
+
function addExpandRowKey(v) {
|
|
221
|
+
if (expandRowKeys.value.indexOf(v) === -1) {
|
|
222
|
+
expandRowKeys.value.push(v);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function removeExpandRowKey(v) {
|
|
226
|
+
for (let i = 0; i < expandRowKeys.value.length; i++) {
|
|
227
|
+
if (expandRowKeys.value[i] === v) {
|
|
228
|
+
expandRowKeys.value.splice(i, 1);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function getExpandRowKeys() {
|
|
234
|
+
return expandRowKeys.value;
|
|
235
|
+
}
|
|
228
236
|
return {
|
|
229
237
|
addToFirst,
|
|
230
238
|
formItemBindProps,
|
|
@@ -35,15 +35,6 @@ const props = {
|
|
|
35
35
|
type: Boolean,
|
|
36
36
|
default: true
|
|
37
37
|
},
|
|
38
|
-
/**
|
|
39
|
-
* @description 简述一行的内容, 用于 Infomation
|
|
40
|
-
*/
|
|
41
|
-
summaryLabel: {
|
|
42
|
-
type: Function,
|
|
43
|
-
default: (data) => {
|
|
44
|
-
return Object.values(data).join(" ");
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
38
|
/**
|
|
48
39
|
* @description 开启 form-item 的 label 上的操作区域, 在labelPosition为top时生效
|
|
49
40
|
*/
|
|
@@ -99,6 +90,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
99
90
|
});
|
|
100
91
|
return data;
|
|
101
92
|
});
|
|
93
|
+
const innerCtx = {
|
|
94
|
+
addExpandRowKey,
|
|
95
|
+
removeExpandRowKey,
|
|
96
|
+
getExpandRowKeys
|
|
97
|
+
};
|
|
102
98
|
const fullColumns = computed(() => {
|
|
103
99
|
return props2.columns.map(column => {
|
|
104
100
|
return {
|
|
@@ -114,9 +110,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
114
110
|
return createVNode(VkfFormItemRenderer, {
|
|
115
111
|
"source": [{
|
|
116
112
|
...formItemProps,
|
|
117
|
-
...column.createTemplateProps?.(e, formItemProps,
|
|
118
|
-
setExpandRowKeys
|
|
119
|
-
})
|
|
113
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
120
114
|
}]
|
|
121
115
|
}, null);
|
|
122
116
|
}
|
|
@@ -138,9 +132,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
138
132
|
};
|
|
139
133
|
return {
|
|
140
134
|
...formItemProps,
|
|
141
|
-
...column.createTemplateProps?.(e, formItemProps,
|
|
142
|
-
setExpandRowKeys
|
|
143
|
-
})
|
|
135
|
+
...column.createTemplateProps?.(e, formItemProps, innerCtx)
|
|
144
136
|
};
|
|
145
137
|
});
|
|
146
138
|
return createVNode(VkfFieldset, {
|
|
@@ -221,6 +213,22 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
221
213
|
function setExpandRowKeys(v) {
|
|
222
214
|
expandRowKeys.value = v;
|
|
223
215
|
}
|
|
216
|
+
function addExpandRowKey(v) {
|
|
217
|
+
if (expandRowKeys.value.indexOf(v) === -1) {
|
|
218
|
+
expandRowKeys.value.push(v);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function removeExpandRowKey(v) {
|
|
222
|
+
for (let i = 0; i < expandRowKeys.value.length; i++) {
|
|
223
|
+
if (expandRowKeys.value[i] === v) {
|
|
224
|
+
expandRowKeys.value.splice(i, 1);
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function getExpandRowKeys() {
|
|
230
|
+
return expandRowKeys.value;
|
|
231
|
+
}
|
|
224
232
|
return {
|
|
225
233
|
addToFirst,
|
|
226
234
|
formItemBindProps,
|
|
@@ -20,13 +20,6 @@ export declare const props: {
|
|
|
20
20
|
type: BooleanConstructor;
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
|
23
|
-
/**
|
|
24
|
-
* @description 简述一行的内容, 用于 Infomation
|
|
25
|
-
*/
|
|
26
|
-
summaryLabel: {
|
|
27
|
-
type: PropType<(data: NormalObject) => string>;
|
|
28
|
-
default: (data: any) => string;
|
|
29
|
-
};
|
|
30
23
|
/**
|
|
31
24
|
* @description 开启 form-item 的 label 上的操作区域, 在labelPosition为top时生效
|
|
32
25
|
*/
|
|
@@ -18,10 +18,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
18
18
|
type: BooleanConstructor;
|
|
19
19
|
default: boolean;
|
|
20
20
|
};
|
|
21
|
-
summaryLabel: {
|
|
22
|
-
type: import("vue").PropType<(data: NormalObject) => string>;
|
|
23
|
-
default: (data: any) => string;
|
|
24
|
-
};
|
|
25
21
|
labelActions: {
|
|
26
22
|
type: BooleanConstructor;
|
|
27
23
|
default: boolean;
|
|
@@ -122,10 +118,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
122
118
|
type: BooleanConstructor;
|
|
123
119
|
default: boolean;
|
|
124
120
|
};
|
|
125
|
-
summaryLabel: {
|
|
126
|
-
type: import("vue").PropType<(data: NormalObject) => string>;
|
|
127
|
-
default: (data: any) => string;
|
|
128
|
-
};
|
|
129
121
|
labelActions: {
|
|
130
122
|
type: BooleanConstructor;
|
|
131
123
|
default: boolean;
|
|
@@ -214,7 +206,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
214
206
|
defaultExpandAll: boolean;
|
|
215
207
|
splicable: boolean;
|
|
216
208
|
labelActions: boolean;
|
|
217
|
-
summaryLabel: (data: NormalObject) => string;
|
|
218
209
|
defaultItemValue: NormalObject;
|
|
219
210
|
}, {}, {
|
|
220
211
|
ElTable: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
@@ -7,6 +7,9 @@ import type Core from './index.vue';
|
|
|
7
7
|
export interface Source<P extends string = string> extends VueComponentPropsType<typeof Core>, BasicSource {
|
|
8
8
|
prop?: P | P[];
|
|
9
9
|
templateType: 'VkfInputCollection';
|
|
10
|
+
informationProps?: {
|
|
11
|
+
labelRender?: (row: any) => string;
|
|
12
|
+
};
|
|
10
13
|
}
|
|
11
14
|
export type Column<R extends NormalObject = NormalObject, SourceType extends NormalObject = __VkfTemplatesDefault.CoreSource<Keyof<R>>> = Omit<__VkTableColumns.Source<R>, 'slots'> & {
|
|
12
15
|
templateType: SourceType['templateType'];
|
|
@@ -20,6 +23,8 @@ export type Column<R extends NormalObject = NormalObject, SourceType extends Nor
|
|
|
20
23
|
prop: Array<string | number>;
|
|
21
24
|
readonly: boolean;
|
|
22
25
|
}, innerContext: {
|
|
23
|
-
|
|
26
|
+
addExpandRowKey: (rowKey: string) => void;
|
|
27
|
+
removeExpandRowKey: (rowKey: string) => void;
|
|
28
|
+
getExpandRowKeys: () => string[];
|
|
24
29
|
}) => Partial<SourceType>;
|
|
25
30
|
};
|
package/index.css
CHANGED
|
@@ -224,6 +224,13 @@
|
|
|
224
224
|
display: inline-flex;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
.vkf-information-tag__tag{
|
|
228
|
+
cursor: pointer;
|
|
229
|
+
}
|
|
230
|
+
.vkf-information-tag__tag + .vkf-information-tag__tag {
|
|
231
|
+
margin-left: 0.5em;
|
|
232
|
+
}
|
|
233
|
+
|
|
227
234
|
.vkf-information-templates-default-main .el-form-item__label {
|
|
228
235
|
color: var(--el-text-color-secondary);
|
|
229
236
|
font-weight: normal;
|
|
@@ -342,13 +349,6 @@
|
|
|
342
349
|
display: none;
|
|
343
350
|
}
|
|
344
351
|
|
|
345
|
-
.vkf-tag-information__tag{
|
|
346
|
-
cursor: pointer;
|
|
347
|
-
}
|
|
348
|
-
.vkf-tag-information__tag + .vkf-tag-information__tag {
|
|
349
|
-
margin-left: 0.5em;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
352
|
.vkf-flex {
|
|
353
353
|
display: flex;
|
|
354
354
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vunk/form",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.esm.js",
|
|
6
6
|
"scripts": {
|
|
@@ -145,11 +145,6 @@
|
|
|
145
145
|
"types": "./components/template-instances-provider/index.d.ts",
|
|
146
146
|
"require": "./components/template-instances-provider/index.cjs"
|
|
147
147
|
},
|
|
148
|
-
"./components/tag-information": {
|
|
149
|
-
"import": "./components/tag-information/index.mjs",
|
|
150
|
-
"types": "./components/tag-information/index.d.ts",
|
|
151
|
-
"require": "./components/tag-information/index.cjs"
|
|
152
|
-
},
|
|
153
148
|
"./components/tables-select": {
|
|
154
149
|
"import": "./components/tables-select/index.mjs",
|
|
155
150
|
"types": "./components/tables-select/index.d.ts",
|
|
@@ -215,6 +210,16 @@
|
|
|
215
210
|
"types": "./components/information-templates-default/index.d.ts",
|
|
216
211
|
"require": "./components/information-templates-default/index.cjs"
|
|
217
212
|
},
|
|
213
|
+
"./components/information-tag": {
|
|
214
|
+
"import": "./components/information-tag/index.mjs",
|
|
215
|
+
"types": "./components/information-tag/index.d.ts",
|
|
216
|
+
"require": "./components/information-tag/index.cjs"
|
|
217
|
+
},
|
|
218
|
+
"./components/information-collection": {
|
|
219
|
+
"import": "./components/information-collection/index.mjs",
|
|
220
|
+
"types": "./components/information-collection/index.d.ts",
|
|
221
|
+
"require": "./components/information-collection/index.cjs"
|
|
222
|
+
},
|
|
218
223
|
"./components/information": {
|
|
219
224
|
"import": "./components/information/index.mjs",
|
|
220
225
|
"types": "./components/information/index.d.ts",
|
|
@@ -313,9 +318,6 @@
|
|
|
313
318
|
"./components/templates-layout/index.css": {
|
|
314
319
|
"import": "./components/templates-layout/index.css"
|
|
315
320
|
},
|
|
316
|
-
"./components/tag-information/index.css": {
|
|
317
|
-
"import": "./components/tag-information/index.css"
|
|
318
|
-
},
|
|
319
321
|
"./components/tables-select/index.css": {
|
|
320
322
|
"import": "./components/tables-select/index.css"
|
|
321
323
|
},
|
|
@@ -343,6 +345,9 @@
|
|
|
343
345
|
"./components/information-templates-default/index.css": {
|
|
344
346
|
"import": "./components/information-templates-default/index.css"
|
|
345
347
|
},
|
|
348
|
+
"./components/information-tag/index.css": {
|
|
349
|
+
"import": "./components/information-tag/index.css"
|
|
350
|
+
},
|
|
346
351
|
"./components/form-item/index.css": {
|
|
347
352
|
"import": "./components/form-item/index.css"
|
|
348
353
|
},
|
|
@@ -26,3 +26,5 @@ export declare const createSliderBindProps: <T2 extends import("@vunk/core").Nor
|
|
|
26
26
|
export declare const createSliderOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("update:modelValue" | "input" | "change")[]>(emit: T2, excludes?: EX) => { [P in EX extends (infer KE)[] ? Exclude<"update:modelValue" | "input" | "change", KE> : "update:modelValue" | "input" | "change"]: { [k in "update:modelValue" | "input" | "change"]: (...e: import("@vunk/core").RestParameters<T2>) => void; }[P]; };
|
|
27
27
|
export declare const createInputTagBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"disabled", keyof T2> | Extract<"readonly", keyof T2> | Extract<"id", keyof T2> | Extract<"maxlength", keyof T2> | Extract<"minlength", keyof T2> | Extract<"ariaLabel", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"clearable", keyof T2> | Extract<"tabindex", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"autofocus", keyof T2> | Extract<"tagType", keyof T2> | Extract<"max", keyof T2> | Extract<"tagEffect", keyof T2> | Extract<"trigger", keyof T2> | Extract<"draggable", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size" | "disabled" | "readonly" | "id" | "maxlength" | "minlength" | "ariaLabel" | "modelValue" | "autocomplete" | "placeholder" | "clearable" | "tabindex" | "validateEvent" | "autofocus" | "tagType" | "max" | "tagEffect" | "trigger" | "draggable", keyof T2>, KE> : Extract<"size" | "disabled" | "readonly" | "id" | "maxlength" | "minlength" | "ariaLabel" | "modelValue" | "autocomplete" | "placeholder" | "clearable" | "tabindex" | "validateEvent" | "autofocus" | "tagType" | "max" | "tagEffect" | "trigger" | "draggable", keyof T2>]: { [k in Extract<"size" | "disabled" | "readonly" | "id" | "maxlength" | "minlength" | "ariaLabel" | "modelValue" | "autocomplete" | "placeholder" | "clearable" | "tabindex" | "validateEvent" | "autofocus" | "tagType" | "max" | "tagEffect" | "trigger" | "draggable", keyof T2>]: T2[k]; }[P]; }>;
|
|
28
28
|
export declare const createInputTagOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("clear" | "update:modelValue" | "input" | "change" | "focus" | "blur" | "remove-tag" | "add-tag")[]>(emit: T2, excludes?: EX) => { [P in EX extends (infer KE)[] ? Exclude<"clear" | "update:modelValue" | "input" | "change" | "focus" | "blur" | "remove-tag" | "add-tag", KE> : "clear" | "update:modelValue" | "input" | "change" | "focus" | "blur" | "remove-tag" | "add-tag"]: { [k in "clear" | "update:modelValue" | "input" | "change" | "focus" | "blur" | "remove-tag" | "add-tag"]: (...e: import("@vunk/core").RestParameters<T2>) => void; }[P]; };
|
|
29
|
+
export declare const createTagBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"type", keyof T2> | Extract<"size", keyof T2> | Extract<"effect", keyof T2> | Extract<"round", keyof T2> | Extract<"color", keyof T2> | Extract<"closable", keyof T2> | Extract<"disableTransitions", keyof T2> | Extract<"hit", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"type" | "size" | "effect" | "round" | "color" | "closable" | "disableTransitions" | "hit", keyof T2>, KE> : Extract<"type" | "size" | "effect" | "round" | "color" | "closable" | "disableTransitions" | "hit", keyof T2>]: { [k in Extract<"type" | "size" | "effect" | "round" | "color" | "closable" | "disableTransitions" | "hit", keyof T2>]: T2[k]; }[P]; }>;
|
|
30
|
+
export declare const createTagOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("click" | "close")[]>(emit: T2, excludes?: EX) => { [P in EX extends (infer KE)[] ? Exclude<"click" | "close", KE> : "click" | "close"]: { [k in "click" | "close"]: (...e: import("@vunk/core").RestParameters<T2>) => void; }[P]; };
|
|
@@ -177,6 +177,8 @@ const createSliderBindProps = utilsVue.bindPropsFactory(elementPlus.sliderProps)
|
|
|
177
177
|
const createSliderOnEmits = utilsVue.onEmitsFactory(elementPlus.sliderEmits);
|
|
178
178
|
const createInputTagBindProps = utilsVue.bindPropsFactory(elementPlus.inputTagProps);
|
|
179
179
|
const createInputTagOnEmits = utilsVue.onEmitsFactory(elementPlus.inputTagEmits);
|
|
180
|
+
const createTagBindProps = utilsVue.bindPropsFactory(elementPlus.tagProps);
|
|
181
|
+
const createTagOnEmits = utilsVue.onEmitsFactory(elementPlus.tagEmits);
|
|
180
182
|
|
|
181
183
|
const semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
|
|
182
184
|
const validateAndParse = (version) => {
|
|
@@ -312,6 +314,8 @@ exports.createSliderBindProps = createSliderBindProps;
|
|
|
312
314
|
exports.createSliderOnEmits = createSliderOnEmits;
|
|
313
315
|
exports.createSwitchBindProps = createSwitchBindProps;
|
|
314
316
|
exports.createSwitchOnEmits = createSwitchOnEmits;
|
|
317
|
+
exports.createTagBindProps = createTagBindProps;
|
|
318
|
+
exports.createTagOnEmits = createTagOnEmits;
|
|
315
319
|
exports.createUploadBindProps = createUploadBindProps;
|
|
316
320
|
exports.datePickerEmits = datePickerEmits;
|
|
317
321
|
exports.datePickerProps = datePickerProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { timePickerDefaultProps, useTooltipContentProps, tagProps, inputProps, inputEmits, formProps, formEmits, formItemProps, switchProps, switchEmits, inputNumberProps, inputNumberEmits, radioGroupProps, radioGroupEmits, checkboxGroupProps, checkboxGroupEmits, uploadProps, colorPickerProps, colorPickerEmits, buttonProps, buttonEmits, cascaderProps, cascaderEmits, sliderProps, sliderEmits, inputTagProps, inputTagEmits, version } from 'element-plus';
|
|
1
|
+
import { timePickerDefaultProps, useTooltipContentProps, tagProps, inputProps, inputEmits, formProps, formEmits, formItemProps, switchProps, switchEmits, inputNumberProps, inputNumberEmits, radioGroupProps, radioGroupEmits, checkboxGroupProps, checkboxGroupEmits, uploadProps, colorPickerProps, colorPickerEmits, buttonProps, buttonEmits, cascaderProps, cascaderEmits, sliderProps, sliderEmits, inputTagProps, inputTagEmits, tagEmits, version } from 'element-plus';
|
|
2
2
|
import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
|
|
3
3
|
import { defineComponent, openBlock, createElementBlock, createElementVNode } from 'vue';
|
|
4
4
|
|
|
@@ -175,6 +175,8 @@ const createSliderBindProps = bindPropsFactory(sliderProps);
|
|
|
175
175
|
const createSliderOnEmits = onEmitsFactory(sliderEmits);
|
|
176
176
|
const createInputTagBindProps = bindPropsFactory(inputTagProps);
|
|
177
177
|
const createInputTagOnEmits = onEmitsFactory(inputTagEmits);
|
|
178
|
+
const createTagBindProps = bindPropsFactory(tagProps);
|
|
179
|
+
const createTagOnEmits = onEmitsFactory(tagEmits);
|
|
178
180
|
|
|
179
181
|
const semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
|
|
180
182
|
const validateAndParse = (version) => {
|
|
@@ -283,4 +285,4 @@ const assertValidOperator = (op) => {
|
|
|
283
285
|
|
|
284
286
|
const isGte2_6_0 = compare(version, "2.6.0", ">=");
|
|
285
287
|
|
|
286
|
-
export { createButtonBindProps, createButtonOnEmits, createCascaderBindProps, createCascaderOnEmits, createCheckboxGroupBindProps, createCheckboxGroupOnEmits, createColorPickerBindProps, createColorPickerOnEmits, createDatePickerBindProps, createDatePickerOnEmits, createFormBindProps, createFormItemBindProps, createFormOnEmits, createInputBindProps, createInputNumberBindProps, createInputNumberOnEmits, createInputOnEmits, createInputTagBindProps, createInputTagOnEmits, createRadioGroupBindProps, createRadioGroupOnEmits, createSelectBindProps, createSelectOnEmits, createSliderBindProps, createSliderOnEmits, createSwitchBindProps, createSwitchOnEmits, createUploadBindProps, datePickerEmits, datePickerProps, isGte2_6_0, selectEmits, selectProps };
|
|
288
|
+
export { createButtonBindProps, createButtonOnEmits, createCascaderBindProps, createCascaderOnEmits, createCheckboxGroupBindProps, createCheckboxGroupOnEmits, createColorPickerBindProps, createColorPickerOnEmits, createDatePickerBindProps, createDatePickerOnEmits, createFormBindProps, createFormItemBindProps, createFormOnEmits, createInputBindProps, createInputNumberBindProps, createInputNumberOnEmits, createInputOnEmits, createInputTagBindProps, createInputTagOnEmits, createRadioGroupBindProps, createRadioGroupOnEmits, createSelectBindProps, createSelectOnEmits, createSliderBindProps, createSliderOnEmits, createSwitchBindProps, createSwitchOnEmits, createTagBindProps, createTagOnEmits, createUploadBindProps, datePickerEmits, datePickerProps, isGte2_6_0, selectEmits, selectProps };
|