@vunk/form 2.14.8 → 2.14.9

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.
@@ -15,6 +15,10 @@ const props = {
15
15
  labelPosition: {
16
16
  type: String,
17
17
  default: void 0
18
+ },
19
+ labelSuffix: {
20
+ type: String,
21
+ default: void 0
18
22
  }
19
23
  };
20
24
  const emits = {};
@@ -84,12 +88,16 @@ var _sfc_main = vue.defineComponent({
84
88
  const labelPosition = vue.computed(() => {
85
89
  return props2.labelPosition ?? formContext.labelPosition;
86
90
  });
91
+ const labelSuffix = vue.computed(() => {
92
+ return props2.labelSuffix ?? formContext.labelSuffix;
93
+ });
87
94
  vue.provide(
88
95
  elementPlus.formContextKey,
89
96
  vue.reactive({
90
97
  ...formContext === backupFormContext ? backupFormContext : vue.toRefs(formContext),
91
98
  labelWidth,
92
99
  labelPosition,
100
+ labelSuffix,
93
101
  ...useFormLabelWidth()
94
102
  })
95
103
  );
@@ -11,6 +11,10 @@ const props = {
11
11
  labelPosition: {
12
12
  type: String,
13
13
  default: void 0
14
+ },
15
+ labelSuffix: {
16
+ type: String,
17
+ default: void 0
14
18
  }
15
19
  };
16
20
  const emits = {};
@@ -80,12 +84,16 @@ var _sfc_main = defineComponent({
80
84
  const labelPosition = computed(() => {
81
85
  return props2.labelPosition ?? formContext.labelPosition;
82
86
  });
87
+ const labelSuffix = computed(() => {
88
+ return props2.labelSuffix ?? formContext.labelSuffix;
89
+ });
83
90
  provide(
84
91
  formContextKey,
85
92
  reactive({
86
93
  ...formContext === backupFormContext ? backupFormContext : toRefs(formContext),
87
94
  labelWidth,
88
95
  labelPosition,
96
+ labelSuffix,
89
97
  ...useFormLabelWidth()
90
98
  })
91
99
  );
@@ -8,5 +8,9 @@ export declare const props: {
8
8
  type: PropType<"left" | "right" | "top">;
9
9
  default: any;
10
10
  };
11
+ labelSuffix: {
12
+ type: StringConstructor;
13
+ default: any;
14
+ };
11
15
  };
12
16
  export declare const emits: {};
@@ -7,6 +7,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
7
7
  type: import("vue").PropType<"left" | "right" | "top">;
8
8
  default: any;
9
9
  };
10
+ labelSuffix: {
11
+ type: StringConstructor;
12
+ default: any;
13
+ };
10
14
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
15
  labelWidth: {
12
16
  type: (StringConstructor | NumberConstructor)[];
@@ -16,8 +20,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
16
20
  type: import("vue").PropType<"left" | "right" | "top">;
17
21
  default: any;
18
22
  };
23
+ labelSuffix: {
24
+ type: StringConstructor;
25
+ default: any;
26
+ };
19
27
  }>> & Readonly<{}>, {
20
28
  labelWidth: string | number;
21
29
  labelPosition: "top" | "left" | "right";
30
+ labelSuffix: string;
22
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
23
32
  export default _default;
@@ -74,7 +74,8 @@ var _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
74
74
  default: ""
75
75
  },
76
76
  formItemTipClass: null,
77
- elRef: null
77
+ elRef: null,
78
+ label: null
78
79
  },
79
80
  setup(__props, { expose: __expose }) {
80
81
  __expose();
@@ -94,9 +95,8 @@ var _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
94
95
  }
95
96
  });
96
97
 
97
- const _hoisted_1 = { key: 0 };
98
- const _hoisted_2 = {
99
- key: 2,
98
+ const _hoisted_1 = {
99
+ key: 1,
100
100
  class: "vkf-form-item-label__actions"
101
101
  };
102
102
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -104,7 +104,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
104
104
  ref: $props.elRef,
105
105
  class: ["vkf-form-item", {
106
106
  "has-label-actions": _ctx.$slots.labelActions
107
- }]
107
+ }],
108
+ label: $props.label
108
109
  }), {
109
110
  default: vue.withCtx(() => [
110
111
  vue.renderSlot(_ctx.$slots, "before"),
@@ -131,15 +132,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
131
132
  ]),
132
133
  label: vue.withCtx((e) => [
133
134
  vue.renderSlot(_ctx.$slots, "label", vue.normalizeProps(vue.guardReactiveProps(e)), () => [
134
- e.label ? (vue.openBlock(), vue.createElementBlock(
135
+ vue.withDirectives(vue.createElementVNode(
135
136
  "span",
136
- _hoisted_1,
137
+ null,
137
138
  vue.toDisplayString(e.label),
138
- 1
139
- /* TEXT */
140
- )) : vue.createCommentVNode("v-if", true),
139
+ 513
140
+ /* TEXT, NEED_PATCH */
141
+ ), [
142
+ [vue.vShow, $props.label]
143
+ ]),
141
144
  $props.labelTip ? (vue.openBlock(), vue.createBlock($setup["ElTooltip"], {
142
- key: 1,
145
+ key: 0,
143
146
  content: $props.labelTip
144
147
  }, {
145
148
  default: vue.withCtx(() => [
@@ -163,7 +166,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
163
166
  _: 1
164
167
  /* STABLE */
165
168
  }, 8, ["content"])) : vue.createCommentVNode("v-if", true),
166
- _ctx.$slots.labelActions ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
169
+ _ctx.$slots.labelActions ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
167
170
  vue.renderSlot(_ctx.$slots, "labelActions")
168
171
  ])) : vue.createCommentVNode("v-if", true)
169
172
  ])
@@ -173,7 +176,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
173
176
  ]),
174
177
  _: 3
175
178
  /* FORWARDED */
176
- }, 16, ["class"]);
179
+ }, 16, ["class", "label"]);
177
180
  }
178
181
  var FormItemCore = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/form-item/src/core.vue"]]);
179
182
 
@@ -232,6 +235,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
232
235
  });
233
236
  return data;
234
237
  });
238
+ console.log("props.label", props2.label);
235
239
  return () => vue.h(FormItemCore, {
236
240
  ...formItemBindProps.value,
237
241
  elRef: props2.elRef,
@@ -245,7 +249,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
245
249
  rules: rules$1.value,
246
250
  formItemTip: props2.formItemTip,
247
251
  formItemTipClass: props2.formItemTipClass,
248
- labelTip: props2.labelTip
252
+ labelTip: props2.labelTip,
253
+ label: props2.label
249
254
  }, {
250
255
  ...slots,
251
256
  ...props2.formItemSlots
@@ -1,6 +1,6 @@
1
1
  import { formItemProps, ElFormItem, ElTooltip, ElIcon, ElButton, useGlobalConfig } from 'element-plus';
2
2
  import { bindPropsFactory } from '@vunk/core/shared/utils-vue';
3
- import { defineComponent, openBlock, createBlock, mergeProps, withCtx, renderSlot, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, normalizeProps, guardReactiveProps, createVNode, computed, h } from 'vue';
3
+ import { defineComponent, openBlock, createBlock, mergeProps, withCtx, renderSlot, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, normalizeProps, guardReactiveProps, withDirectives, vShow, createVNode, computed, h } 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';
@@ -70,7 +70,8 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
70
70
  default: ""
71
71
  },
72
72
  formItemTipClass: null,
73
- elRef: null
73
+ elRef: null,
74
+ label: null
74
75
  },
75
76
  setup(__props, { expose: __expose }) {
76
77
  __expose();
@@ -90,9 +91,8 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
90
91
  }
91
92
  });
92
93
 
93
- const _hoisted_1 = { key: 0 };
94
- const _hoisted_2 = {
95
- key: 2,
94
+ const _hoisted_1 = {
95
+ key: 1,
96
96
  class: "vkf-form-item-label__actions"
97
97
  };
98
98
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -100,7 +100,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
100
100
  ref: $props.elRef,
101
101
  class: ["vkf-form-item", {
102
102
  "has-label-actions": _ctx.$slots.labelActions
103
- }]
103
+ }],
104
+ label: $props.label
104
105
  }), {
105
106
  default: withCtx(() => [
106
107
  renderSlot(_ctx.$slots, "before"),
@@ -127,15 +128,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
127
128
  ]),
128
129
  label: withCtx((e) => [
129
130
  renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps(e)), () => [
130
- e.label ? (openBlock(), createElementBlock(
131
+ withDirectives(createElementVNode(
131
132
  "span",
132
- _hoisted_1,
133
+ null,
133
134
  toDisplayString(e.label),
134
- 1
135
- /* TEXT */
136
- )) : createCommentVNode("v-if", true),
135
+ 513
136
+ /* TEXT, NEED_PATCH */
137
+ ), [
138
+ [vShow, $props.label]
139
+ ]),
137
140
  $props.labelTip ? (openBlock(), createBlock($setup["ElTooltip"], {
138
- key: 1,
141
+ key: 0,
139
142
  content: $props.labelTip
140
143
  }, {
141
144
  default: withCtx(() => [
@@ -159,7 +162,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
159
162
  _: 1
160
163
  /* STABLE */
161
164
  }, 8, ["content"])) : createCommentVNode("v-if", true),
162
- _ctx.$slots.labelActions ? (openBlock(), createElementBlock("div", _hoisted_2, [
165
+ _ctx.$slots.labelActions ? (openBlock(), createElementBlock("div", _hoisted_1, [
163
166
  renderSlot(_ctx.$slots, "labelActions")
164
167
  ])) : createCommentVNode("v-if", true)
165
168
  ])
@@ -169,7 +172,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
169
172
  ]),
170
173
  _: 3
171
174
  /* FORWARDED */
172
- }, 16, ["class"]);
175
+ }, 16, ["class", "label"]);
173
176
  }
174
177
  var FormItemCore = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/form-item/src/core.vue"]]);
175
178
 
@@ -228,6 +231,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
228
231
  });
229
232
  return data;
230
233
  });
234
+ console.log("props.label", props2.label);
231
235
  return () => h(FormItemCore, {
232
236
  ...formItemBindProps.value,
233
237
  elRef: props2.elRef,
@@ -241,7 +245,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
241
245
  rules: rules.value,
242
246
  formItemTip: props2.formItemTip,
243
247
  formItemTipClass: props2.formItemTipClass,
244
- labelTip: props2.labelTip
248
+ labelTip: props2.labelTip,
249
+ label: props2.label
245
250
  }, {
246
251
  ...slots,
247
252
  ...props2.formItemSlots
@@ -9,6 +9,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
9
9
  };
10
10
  formItemTipClass: any;
11
11
  elRef: any;
12
+ label: any;
12
13
  }>, {
13
14
  readonly ElFormItem: {
14
15
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
@@ -1841,10 +1842,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1841
1842
  };
1842
1843
  formItemTipClass: any;
1843
1844
  elRef: any;
1845
+ label: any;
1844
1846
  }>> & Readonly<{}>, {
1845
1847
  elRef: any;
1846
1848
  formItemTip: string;
1847
1849
  formItemTipClass: any;
1848
1850
  labelTip: string;
1851
+ label: any;
1849
1852
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1850
1853
  export default _default;
@@ -69,7 +69,8 @@ const emits = {
69
69
  const ROW_KEY = "_row_key";
70
70
  var _sfc_main = /* @__PURE__ */vue.defineComponent({
71
71
  ...{
72
- name: "VkfInputCollection"
72
+ name: "VkfInputCollection",
73
+ inheritAttrs: false
73
74
  },
74
75
  __name: "index",
75
76
  props: props,
@@ -314,7 +315,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
314
315
  default: vue.withCtx(() => [
315
316
  vue.createVNode(
316
317
  $setup["VkfFormItem"],
317
- vue.normalizeProps(vue.guardReactiveProps($setup.formItemBindProps)),
318
+ vue.normalizeProps(vue.guardReactiveProps({
319
+ ...$setup.formItemBindProps,
320
+ ..._ctx.$attrs
321
+ })),
318
322
  vue.createSlots({
319
323
  default: vue.withCtx(() => [
320
324
  !$setup.readonly && _ctx.splicable && !_ctx.labelActions ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
@@ -65,7 +65,8 @@ const emits = {
65
65
  const ROW_KEY = "_row_key";
66
66
  var _sfc_main = /* @__PURE__ */defineComponent({
67
67
  ...{
68
- name: "VkfInputCollection"
68
+ name: "VkfInputCollection",
69
+ inheritAttrs: false
69
70
  },
70
71
  __name: "index",
71
72
  props: props,
@@ -310,7 +311,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
310
311
  default: withCtx(() => [
311
312
  createVNode(
312
313
  $setup["VkfFormItem"],
313
- normalizeProps(guardReactiveProps($setup.formItemBindProps)),
314
+ normalizeProps(guardReactiveProps({
315
+ ...$setup.formItemBindProps,
316
+ ..._ctx.$attrs
317
+ })),
314
318
  createSlots({
315
319
  default: withCtx(() => [
316
320
  !$setup.readonly && _ctx.splicable && !_ctx.labelActions ? (openBlock(), createElementBlock("div", _hoisted_1, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "2.14.8",
3
+ "version": "2.14.9",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {