@vunk/form 2.4.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/components/cascader/src/index.vue.d.ts +2 -2
  2. package/components/fieldset/index.cjs +114 -0
  3. package/components/fieldset/index.css +5 -0
  4. package/components/fieldset/index.d.ts +4 -0
  5. package/components/fieldset/index.mjs +108 -0
  6. package/components/fieldset/src/ctx.d.ts +12 -0
  7. package/components/fieldset/src/index.vue.d.ts +23 -0
  8. package/components/fieldset/src/types.d.ts +1 -0
  9. package/components/fieldset/src/use.d.ts +5 -0
  10. package/components/form-item/index.cjs +42 -5
  11. package/components/form-item/index.css +13 -0
  12. package/components/form-item/index.mjs +43 -6
  13. package/components/form-item/src/index.vue.d.ts +3 -0
  14. package/components/form-item/src/types.d.ts +1 -0
  15. package/components/information/src/types.d.ts +3 -2
  16. package/components/information-templates-default/index.cjs +12 -3
  17. package/components/information-templates-default/index.mjs +12 -3
  18. package/components/input-collection/index.cjs +105 -21
  19. package/components/input-collection/index.css +9 -0
  20. package/components/input-collection/index.mjs +106 -22
  21. package/components/input-collection/src/ctx.d.ts +7 -0
  22. package/components/input-collection/src/index.vue.d.ts +31 -2
  23. package/components/input-collection/src/types.d.ts +1 -0
  24. package/components/tables-select/src/index.vue.d.ts +9 -0
  25. package/components/tag-information/index.cjs +11 -2
  26. package/components/tag-information/index.mjs +11 -2
  27. package/components/tag-information/src/ctx.d.ts +8 -0
  28. package/components/tag-information/src/index.vue.d.ts +24 -6
  29. package/components/van-cascader/src/index.vue.d.ts +67 -12803
  30. package/index.css +28 -0
  31. package/package.json +9 -1
  32. 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" | "plain" | "light", unknown>;
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" | "plain" | "light", unknown>;
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,114 @@
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
+ labelPosition: {
15
+ type: String,
16
+ default: void 0
17
+ }
18
+ };
19
+ const emits = {};
20
+
21
+ class ElementPlusError extends Error {
22
+ constructor(m) {
23
+ super(m);
24
+ this.name = "ElementPlusError";
25
+ }
26
+ }
27
+ function debugWarn(scope, message) {
28
+ if (process.env.NODE_ENV !== "production") {
29
+ const error = new ElementPlusError(`[${scope}] ${message}`) ;
30
+ console.warn(error);
31
+ }
32
+ }
33
+
34
+ const SCOPE = "ElForm";
35
+ function useFormLabelWidth() {
36
+ const potentialLabelWidthArr = vue.ref([]);
37
+ const autoLabelWidth = vue.computed(() => {
38
+ if (!potentialLabelWidthArr.value.length)
39
+ return "0";
40
+ const max = Math.max(...potentialLabelWidthArr.value);
41
+ return max ? `${max}px` : "";
42
+ });
43
+ function getLabelWidthIndex(width) {
44
+ const index = potentialLabelWidthArr.value.indexOf(width);
45
+ if (index === -1 && autoLabelWidth.value === "0") {
46
+ debugWarn(SCOPE, `unexpected width ${width}`);
47
+ }
48
+ return index;
49
+ }
50
+ function registerLabelWidth(val, oldVal) {
51
+ if (val && oldVal) {
52
+ const index = getLabelWidthIndex(oldVal);
53
+ potentialLabelWidthArr.value.splice(index, 1, val);
54
+ } else if (val) {
55
+ potentialLabelWidthArr.value.push(val);
56
+ }
57
+ }
58
+ function deregisterLabelWidth(val) {
59
+ const index = getLabelWidthIndex(val);
60
+ if (index > -1) {
61
+ potentialLabelWidthArr.value.splice(index, 1);
62
+ }
63
+ }
64
+ return {
65
+ autoLabelWidth,
66
+ registerLabelWidth,
67
+ deregisterLabelWidth
68
+ };
69
+ }
70
+
71
+ var _sfc_main = vue.defineComponent({
72
+ name: "VkfFieldset",
73
+ props,
74
+ emits,
75
+ setup(props2) {
76
+ const formContext = vue.inject(elementPlus.formContextKey);
77
+ const labelWidth = vue.computed(() => {
78
+ return props2.labelWidth ?? formContext.labelWidth;
79
+ });
80
+ const labelPosition = vue.computed(() => {
81
+ return props2.labelPosition ?? formContext.labelPosition;
82
+ });
83
+ vue.provide(
84
+ elementPlus.formContextKey,
85
+ vue.reactive({
86
+ ...vue.toRefs(formContext),
87
+ labelWidth,
88
+ labelPosition,
89
+ ...useFormLabelWidth()
90
+ })
91
+ );
92
+ return {};
93
+ }
94
+ });
95
+
96
+ const _hoisted_1 = { class: "vkf-fieldset" };
97
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
98
+ return vue.openBlock(), vue.createElementBlock("fieldset", _hoisted_1, [
99
+ vue.renderSlot(_ctx.$slots, "default")
100
+ ]);
101
+ }
102
+ 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"]]);
103
+
104
+ var types = /*#__PURE__*/Object.freeze({
105
+ __proto__: null
106
+ });
107
+
108
+ VkfFieldset.install = (app) => {
109
+ app.component(VkfFieldset.name || "VkfFieldset", VkfFieldset);
110
+ };
111
+
112
+ exports.VkfFieldset = VkfFieldset;
113
+ exports.__VkfFieldset = types;
114
+ exports.default = VkfFieldset;
@@ -0,0 +1,5 @@
1
+ .vkf-fieldset {
2
+ border: none;
3
+ padding: 0;
4
+ margin: 0;
5
+ }
@@ -0,0 +1,4 @@
1
+ import VkfFieldset from './src/index.vue';
2
+ export * as __VkfFieldset from './src/types';
3
+ export { VkfFieldset, };
4
+ export default VkfFieldset;
@@ -0,0 +1,108 @@
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
+ labelPosition: {
11
+ type: String,
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 = ref([]);
33
+ const autoLabelWidth = 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 = defineComponent({
68
+ name: "VkfFieldset",
69
+ props,
70
+ emits,
71
+ setup(props2) {
72
+ const formContext = inject(formContextKey);
73
+ const labelWidth = computed(() => {
74
+ return props2.labelWidth ?? formContext.labelWidth;
75
+ });
76
+ const labelPosition = computed(() => {
77
+ return props2.labelPosition ?? formContext.labelPosition;
78
+ });
79
+ provide(
80
+ formContextKey,
81
+ reactive({
82
+ ...toRefs(formContext),
83
+ labelWidth,
84
+ labelPosition,
85
+ ...useFormLabelWidth()
86
+ })
87
+ );
88
+ return {};
89
+ }
90
+ });
91
+
92
+ const _hoisted_1 = { class: "vkf-fieldset" };
93
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
94
+ return openBlock(), createElementBlock("fieldset", _hoisted_1, [
95
+ renderSlot(_ctx.$slots, "default")
96
+ ]);
97
+ }
98
+ 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"]]);
99
+
100
+ var types = /*#__PURE__*/Object.freeze({
101
+ __proto__: null
102
+ });
103
+
104
+ VkfFieldset.install = (app) => {
105
+ app.component(VkfFieldset.name || "VkfFieldset", VkfFieldset);
106
+ };
107
+
108
+ export { VkfFieldset, types as __VkfFieldset, VkfFieldset as default };
@@ -0,0 +1,12 @@
1
+ import { PropType } from 'vue';
2
+ export declare const props: {
3
+ labelWidth: {
4
+ type: (StringConstructor | NumberConstructor)[];
5
+ default: any;
6
+ };
7
+ labelPosition: {
8
+ type: PropType<"left" | "right" | "top">;
9
+ default: any;
10
+ };
11
+ };
12
+ export declare const emits: {};
@@ -0,0 +1,23 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ labelWidth: {
3
+ type: (StringConstructor | NumberConstructor)[];
4
+ default: any;
5
+ };
6
+ labelPosition: {
7
+ type: import("vue").PropType<"left" | "right" | "top">;
8
+ default: any;
9
+ };
10
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
+ labelWidth: {
12
+ type: (StringConstructor | NumberConstructor)[];
13
+ default: any;
14
+ };
15
+ labelPosition: {
16
+ type: import("vue").PropType<"left" | "right" | "top">;
17
+ default: any;
18
+ };
19
+ }>> & Readonly<{}>, {
20
+ labelWidth: string | number;
21
+ labelPosition: "top" | "left" | "right";
22
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
23
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare function useFormLabelWidth(): {
2
+ autoLabelWidth: import("vue").ComputedRef<string>;
3
+ registerLabelWidth: (val: number, oldVal: number) => void;
4
+ deregisterLabelWidth: (val: number) => void;
5
+ };
@@ -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((key) => keys.includes(key)).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.formItemSlots, (item, key) => {
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, renderList, resolveDynamicComponent } from 'vue';
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((key) => keys.includes(key)).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.formItemSlots, (item, key) => {
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">;
@@ -3,4 +3,5 @@ export type FormItemSlots = {
3
3
  label: Func<{
4
4
  label: string;
5
5
  }>;
6
+ labelActions: Func;
6
7
  };
@@ -1,2 +1,3 @@
1
- import { __VkfForm } from '@vunk/form/components/form';
2
- export type FormItem = __VkfForm.FormItem;
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
- }, null, 8, ["label", "class", "model-value"])
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
- }, null, 8, ["label", "class", "model-value"])
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