@vunk/form 2.5.3 → 2.5.5

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 = {};
@@ -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 = {};
@@ -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
+ }
@@ -6,6 +6,7 @@ var vue = require('vue');
6
6
  var templateInstancesProvider = require('@vunk/form/components/template-instances-provider');
7
7
  var form = require('@vunk/form/shared/form');
8
8
  var composables = require('@vunk/form/composables');
9
+ var _function = require('@vunk/shared/function');
9
10
  var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
10
11
 
11
12
  const props = {
@@ -59,8 +60,13 @@ const VkfFormItemRenderer$1 = vue.defineComponent({
59
60
  const preTemplateVisible = rendererData ? templateIf(rendererData.value) : true;
60
61
  if (!preTemplateVisible) return a;
61
62
  const slotData = { ...c };
63
+ Object.assign(
64
+ slotData,
65
+ _function.isCallable(c.templateProps) ? c.templateProps(rendererData?.value) : c.templateProps
66
+ );
62
67
  Reflect.deleteProperty(slotData, "templateType");
63
68
  Reflect.deleteProperty(slotData, "templateIf");
69
+ Reflect.deleteProperty(slotData, "templateProps");
64
70
  const nodeKey = currentK.join(",") + "-" + c.templateType + "-" + (c.prop || "no-prop");
65
71
  const modelValue = vue.computed({
66
72
  get: () => c.prop && getDataValue?.(c.prop),
@@ -2,6 +2,7 @@ import { defineComponent, computed, h, nextTick, openBlock, createBlock, withCtx
2
2
  import { VkfTemplateInstancesProvider } from '@vunk/form/components/template-instances-provider';
3
3
  import { genTemplateIfFunc } from '@vunk/form/shared/form';
4
4
  import { useTemplateInstancesContext, useRendererData } from '@vunk/form/composables';
5
+ import { isCallable } from '@vunk/shared/function';
5
6
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
6
7
 
7
8
  const props = {
@@ -55,8 +56,13 @@ const VkfFormItemRenderer$1 = defineComponent({
55
56
  const preTemplateVisible = rendererData ? templateIf(rendererData.value) : true;
56
57
  if (!preTemplateVisible) return a;
57
58
  const slotData = { ...c };
59
+ Object.assign(
60
+ slotData,
61
+ isCallable(c.templateProps) ? c.templateProps(rendererData?.value) : c.templateProps
62
+ );
58
63
  Reflect.deleteProperty(slotData, "templateType");
59
64
  Reflect.deleteProperty(slotData, "templateIf");
65
+ Reflect.deleteProperty(slotData, "templateProps");
60
66
  const nodeKey = currentK.join(",") + "-" + c.templateType + "-" + (c.prop || "no-prop");
61
67
  const modelValue = computed({
62
68
  get: () => c.prop && getDataValue?.(c.prop),
@@ -1,7 +1,8 @@
1
- import { NormalObject } from '@vunk/core';
1
+ import { Func, NormalObject } from '@vunk/core';
2
2
  export interface RendererTreeData {
3
3
  key?: string;
4
4
  templateType?: string;
5
5
  templateIf?: string | ((e: NormalObject) => boolean) | boolean;
6
+ templateProps?: NormalObject | Func;
6
7
  [k: string]: any;
7
8
  }
@@ -6,6 +6,10 @@
6
6
  padding: 0;
7
7
  border: none;
8
8
  box-shadow: none;
9
+ pointer-events: auto;
10
+ }
11
+ .vkf-information-templates-default-main .el-select__suffix {
12
+ display: none;
9
13
  }
10
14
  .vkf-information-templates-default-main .el-select__selected-item {
11
15
  user-select: text;
package/index.css CHANGED
@@ -232,6 +232,10 @@
232
232
  padding: 0;
233
233
  border: none;
234
234
  box-shadow: none;
235
+ pointer-events: auto;
236
+ }
237
+ .vkf-information-templates-default-main .el-select__suffix {
238
+ display: none;
235
239
  }
236
240
  .vkf-information-templates-default-main .el-select__selected-item {
237
241
  user-select: text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "2.5.3",
3
+ "version": "2.5.5",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {
@@ -2,11 +2,12 @@ import { __VkfTemplatesDefault } from '@vunk/form/components/templates-default';
2
2
  import { __VkfTemplatesLayout } from '@vunk/form/components/templates-layout';
3
3
  import { __VkfTemplatesElementPlus } from '@vunk/form/components/templates-element-plus';
4
4
  import { __VkfTemplatesEsri } from '@vunk/form/components/templates-esri';
5
- import { NormalObject } from '@vunk/core';
5
+ import { AnyFunc, NormalObject } from '@vunk/core';
6
6
  import { __VkfTemplatesVariant } from '@vunk/form/components/templates-variant';
7
7
  export interface BasicSource {
8
8
  templateIf?: ((data: NormalObject) => boolean) | string | boolean;
9
9
  templateType?: string;
10
+ templateProps?: NormalObject | AnyFunc;
10
11
  class?: any;
11
12
  prop?: any;
12
13
  }