@vunk/form 2.5.4 → 2.5.6

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.
@@ -35,6 +35,10 @@ const props = {
35
35
  splicable: {
36
36
  type: Boolean,
37
37
  default: true
38
+ },
39
+ slots: {
40
+ type: Object,
41
+ default: () => ({})
38
42
  }
39
43
  };
40
44
  const emits = {};
@@ -80,7 +84,7 @@ var _sfc_main = vue.defineComponent({
80
84
  const addToFirst = () => {
81
85
  emit("update:modelValue", [
82
86
  {},
83
- ...props2.modelValue
87
+ ...props2.modelValue ?? []
84
88
  ]);
85
89
  };
86
90
  const handleFormSetData = (e) => {
@@ -114,10 +118,7 @@ var _sfc_main = vue.defineComponent({
114
118
  }
115
119
  });
116
120
 
117
- const _hoisted_1 = {
118
- key: 0,
119
- class: "vkf-card-input-collection-options"
120
- };
121
+ const _hoisted_1 = { class: "vkf-card-input-collection-options" };
121
122
  const _hoisted_2 = { class: "vkf-card-input-collection-card__footer" };
122
123
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
123
124
  const _component_VkfTemplatesDefault = vue.resolveComponent("VkfTemplatesDefault");
@@ -143,8 +144,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
143
144
  vue.mergeProps(_ctx.formItemBindProps, { class: "vkf-card-input-collection" }),
144
145
  {
145
146
  default: vue.withCtx(() => [
146
- !_ctx.readonly && _ctx.splicable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
147
- vue.createVNode(_component_ElButton, {
147
+ vue.createElementVNode("div", _hoisted_1, [
148
+ vue.renderSlot(_ctx.$slots, "options", {}, () => [
149
+ _ctx.slots.options ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.slots.options), { key: 0 })) : vue.createCommentVNode("v-if", true)
150
+ ]),
151
+ !_ctx.readonly && _ctx.splicable ? (vue.openBlock(), vue.createBlock(_component_ElButton, {
152
+ key: 0,
148
153
  type: "primary",
149
154
  onClick: _ctx.addToFirst
150
155
  }, {
@@ -153,10 +158,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
153
158
  ])),
154
159
  _: 1
155
160
  /* STABLE */
156
- }, 8, ["onClick"])
157
- ])) : vue.createCommentVNode("v-if", true),
161
+ }, 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
162
+ ]),
158
163
  !_ctx.modelValue?.length ? (vue.openBlock(), vue.createBlock(_component_ElEmpty, {
159
- key: 1,
164
+ key: 0,
160
165
  class: "vkf-card-input-collection-empty"
161
166
  }, {
162
167
  image: vue.withCtx(() => _cache[1] || (_cache[1] = [
@@ -222,19 +227,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
222
227
  /* KEYED_FRAGMENT */
223
228
  ))
224
229
  ]),
225
- _: 1
226
- /* STABLE */
230
+ _: 3
231
+ /* FORWARDED */
227
232
  },
228
233
  16
229
234
  /* FULL_PROPS */
230
235
  )
231
236
  ]),
232
- _: 1
233
- /* STABLE */
237
+ _: 3
238
+ /* FORWARDED */
234
239
  }, 8, ["data", "onSetData"])
235
240
  ]),
236
- _: 1
237
- /* STABLE */
241
+ _: 3
242
+ /* FORWARDED */
238
243
  });
239
244
  }
240
245
  var VkfCardInputCollection = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/card-input-collection/src/index.vue"]]);
@@ -1,5 +1,5 @@
1
1
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
- import { defineComponent, computed, resolveComponent, openBlock, createBlock, withCtx, createVNode, mergeProps, createElementBlock, createTextVNode, createCommentVNode, toDisplayString, Fragment, renderList, createSlots, createElementVNode } from 'vue';
2
+ import { defineComponent, computed, resolveComponent, openBlock, createBlock, withCtx, createVNode, mergeProps, createElementVNode, renderSlot, resolveDynamicComponent, createCommentVNode, createTextVNode, toDisplayString, createElementBlock, Fragment, renderList, createSlots } from 'vue';
3
3
  import { useComputedReadonly } from '@vunk/form/composables';
4
4
  import { ElCard, ElButton, ElEmpty } from 'element-plus';
5
5
  import { ensetData, getValue } from '@vunk/core';
@@ -31,6 +31,10 @@ const props = {
31
31
  splicable: {
32
32
  type: Boolean,
33
33
  default: true
34
+ },
35
+ slots: {
36
+ type: Object,
37
+ default: () => ({})
34
38
  }
35
39
  };
36
40
  const emits = {};
@@ -76,7 +80,7 @@ var _sfc_main = defineComponent({
76
80
  const addToFirst = () => {
77
81
  emit("update:modelValue", [
78
82
  {},
79
- ...props2.modelValue
83
+ ...props2.modelValue ?? []
80
84
  ]);
81
85
  };
82
86
  const handleFormSetData = (e) => {
@@ -110,10 +114,7 @@ var _sfc_main = defineComponent({
110
114
  }
111
115
  });
112
116
 
113
- const _hoisted_1 = {
114
- key: 0,
115
- class: "vkf-card-input-collection-options"
116
- };
117
+ const _hoisted_1 = { class: "vkf-card-input-collection-options" };
117
118
  const _hoisted_2 = { class: "vkf-card-input-collection-card__footer" };
118
119
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
119
120
  const _component_VkfTemplatesDefault = resolveComponent("VkfTemplatesDefault");
@@ -139,8 +140,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
139
140
  mergeProps(_ctx.formItemBindProps, { class: "vkf-card-input-collection" }),
140
141
  {
141
142
  default: withCtx(() => [
142
- !_ctx.readonly && _ctx.splicable ? (openBlock(), createElementBlock("div", _hoisted_1, [
143
- createVNode(_component_ElButton, {
143
+ createElementVNode("div", _hoisted_1, [
144
+ renderSlot(_ctx.$slots, "options", {}, () => [
145
+ _ctx.slots.options ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.slots.options), { key: 0 })) : createCommentVNode("v-if", true)
146
+ ]),
147
+ !_ctx.readonly && _ctx.splicable ? (openBlock(), createBlock(_component_ElButton, {
148
+ key: 0,
144
149
  type: "primary",
145
150
  onClick: _ctx.addToFirst
146
151
  }, {
@@ -149,10 +154,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
149
154
  ])),
150
155
  _: 1
151
156
  /* STABLE */
152
- }, 8, ["onClick"])
153
- ])) : createCommentVNode("v-if", true),
157
+ }, 8, ["onClick"])) : createCommentVNode("v-if", true)
158
+ ]),
154
159
  !_ctx.modelValue?.length ? (openBlock(), createBlock(_component_ElEmpty, {
155
- key: 1,
160
+ key: 0,
156
161
  class: "vkf-card-input-collection-empty"
157
162
  }, {
158
163
  image: withCtx(() => _cache[1] || (_cache[1] = [
@@ -218,19 +223,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
218
223
  /* KEYED_FRAGMENT */
219
224
  ))
220
225
  ]),
221
- _: 1
222
- /* STABLE */
226
+ _: 3
227
+ /* FORWARDED */
223
228
  },
224
229
  16
225
230
  /* FULL_PROPS */
226
231
  )
227
232
  ]),
228
- _: 1
229
- /* STABLE */
233
+ _: 3
234
+ /* FORWARDED */
230
235
  }, 8, ["data", "onSetData"])
231
236
  ]),
232
- _: 1
233
- /* STABLE */
237
+ _: 3
238
+ /* FORWARDED */
234
239
  });
235
240
  }
236
241
  var VkfCardInputCollection = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/card-input-collection/src/index.vue"]]);
@@ -1,5 +1,6 @@
1
1
  import { PropType } from 'vue';
2
2
  import { NormalObject } from '@vunk/shared';
3
+ import { Slots } from './types';
3
4
  export declare const props: {
4
5
  formItems: {
5
6
  type: PropType<any[]>;
@@ -20,6 +21,10 @@ export declare const props: {
20
21
  type: BooleanConstructor;
21
22
  default: boolean;
22
23
  };
24
+ slots: {
25
+ type: PropType<Slots>;
26
+ default: () => {};
27
+ };
23
28
  required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
24
29
  formItemSize: {
25
30
  type: PropType<"default" | "small" | "large">;
@@ -17,6 +17,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
17
17
  type: BooleanConstructor;
18
18
  default: boolean;
19
19
  };
20
+ slots: {
21
+ type: import("vue").PropType<import("./types").Slots>;
22
+ default: () => {};
23
+ };
20
24
  required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
21
25
  formItemSize: {
22
26
  type: import("vue").PropType<"default" | "small" | "large">;
@@ -98,6 +102,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
98
102
  type: BooleanConstructor;
99
103
  default: boolean;
100
104
  };
105
+ slots: {
106
+ type: import("vue").PropType<import("./types").Slots>;
107
+ default: () => {};
108
+ };
101
109
  required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
102
110
  formItemSize: {
103
111
  type: import("vue").PropType<"default" | "small" | "large">;
@@ -167,6 +175,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
167
175
  labelPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "top" | "left" | "right", unknown>;
168
176
  inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
169
177
  showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
178
+ slots: import("./types").Slots;
170
179
  modelValue: NormalObject[];
171
180
  formItems: any[];
172
181
  splicable: boolean;
@@ -1,7 +1,10 @@
1
- import { VueComponentPropsType } from '@vunk/shared';
1
+ import { AnyFunc, VueComponentPropsType } from '@vunk/shared';
2
2
  import Core from './index.vue';
3
3
  import { BasicSource } from '@vunk/form/shared';
4
4
  export interface Source<P extends string = string> extends VueComponentPropsType<typeof Core>, BasicSource {
5
5
  prop?: P | P[];
6
6
  templateType: 'VkfCardInputCollection';
7
7
  }
8
+ export interface Slots {
9
+ options: AnyFunc;
10
+ }
@@ -178,7 +178,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
178
178
  setExpandRowKeys([]);
179
179
  }
180
180
  const addToFirst = () => {
181
- emit("update:modelValue", [{}, ...props2.modelValue]);
181
+ emit("update:modelValue", [{}, ...(props2.modelValue ?? [])]);
182
182
  setExpandRowKeys([]);
183
183
  };
184
184
  const handleFormSetData = e => {
@@ -188,7 +188,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
188
188
  };
189
189
  const ROW_KEY = "_row_key";
190
190
  const tableData = vue.computed(() => {
191
- return props2.modelValue.map((e, index) => {
191
+ return props2.modelValue?.map((e, index) => {
192
192
  return {
193
193
  ...e,
194
194
  [ROW_KEY]: index + ""
@@ -174,7 +174,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
174
174
  setExpandRowKeys([]);
175
175
  }
176
176
  const addToFirst = () => {
177
- emit("update:modelValue", [{}, ...props2.modelValue]);
177
+ emit("update:modelValue", [{}, ...(props2.modelValue ?? [])]);
178
178
  setExpandRowKeys([]);
179
179
  };
180
180
  const handleFormSetData = e => {
@@ -184,7 +184,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
184
184
  };
185
185
  const ROW_KEY = "_row_key";
186
186
  const tableData = computed(() => {
187
- return props2.modelValue.map((e, index) => {
187
+ return props2.modelValue?.map((e, index) => {
188
188
  return {
189
189
  ...e,
190
190
  [ROW_KEY]: index + ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "2.5.4",
3
+ "version": "2.5.6",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {