@vunk/form 2.19.1 → 2.19.3

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 (167) hide show
  1. package/components/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  2. package/components/api-tables-select/index.cjs +1 -1
  3. package/components/api-tables-select/index.mjs +1 -1
  4. package/components/api-tables-select/src/ctx.d.ts +5 -2
  5. package/components/api-tables-select/src/index.vue.d.ts +11 -5
  6. package/components/button/index.cjs +1 -1
  7. package/components/button/index.mjs +1 -1
  8. package/components/button/src/ctx.d.ts +5 -2
  9. package/components/button/src/index.vue.d.ts +22 -10
  10. package/components/card-input-collection/index.cjs +1 -1
  11. package/components/card-input-collection/index.mjs +2 -2
  12. package/components/card-input-collection/src/core.vue.d.ts +11 -5
  13. package/components/card-input-collection/src/ctx.d.ts +5 -2
  14. package/components/card-input-collection/src/index.vue.d.ts +11 -5
  15. package/components/cascader/src/ctx.d.ts +6 -3
  16. package/components/cascader/src/index.vue.d.ts +11 -5
  17. package/components/checkbox/index.cjs +1 -1
  18. package/components/checkbox/index.mjs +1 -1
  19. package/components/checkbox/src/ctx.d.ts +6 -3
  20. package/components/checkbox/src/index.vue.d.ts +22 -10
  21. package/components/cloneDeep-DE0l40hv.mjs +486 -0
  22. package/components/cloneDeep-DaYwfXwD.js +1 -0
  23. package/components/color-picker/src/ctx.d.ts +5 -2
  24. package/components/color-picker/src/index.vue.d.ts +11 -5
  25. package/components/date-picker/src/ctx.d.ts +6 -3
  26. package/components/date-picker/src/index.vue.d.ts +11 -5
  27. package/components/date-picker-range/index.cjs +1 -1
  28. package/components/date-picker-range/index.mjs +1 -1
  29. package/components/date-picker-range/src/ctx.d.ts +5 -2
  30. package/components/date-picker-range/src/index.vue.d.ts +22 -10
  31. package/components/debounce-CliSPkvP.js +1 -0
  32. package/components/debounce-DIph5ENi.mjs +85 -0
  33. package/components/dialog-input-collection/index.cjs +1 -1
  34. package/components/dialog-input-collection/index.mjs +2 -2
  35. package/components/dialog-input-collection/src/ctx.d.ts +5 -2
  36. package/components/dialog-input-collection/src/index.vue.d.ts +11 -5
  37. package/components/download-plus/index.cjs +1 -1
  38. package/components/download-plus/index.mjs +3 -3
  39. package/components/download-plus/src/ctx.d.ts +5 -2
  40. package/components/download-plus/src/index.vue.d.ts +22 -10
  41. package/components/editable-text/index.cjs +1 -1
  42. package/components/editable-text/index.mjs +1 -1
  43. package/components/editable-text/src/ctx.d.ts +5 -2
  44. package/components/editable-text/src/index.vue.d.ts +11 -5
  45. package/components/el-slider/index.cjs +1 -1
  46. package/components/el-slider/index.mjs +1 -1
  47. package/components/el-slider/src/composables/index.cjs +1 -1
  48. package/components/el-slider/src/composables/index.mjs +1 -1
  49. package/components/esri-input-geojson/index.cjs +1 -1
  50. package/components/esri-input-geojson/index.mjs +2 -2
  51. package/components/esri-input-geojson/src/ctx.d.ts +6 -3
  52. package/components/esri-input-geojson/src/index.vue.d.ts +35 -17
  53. package/components/fieldset/index.cjs +1 -1
  54. package/components/fieldset/index.mjs +40 -35
  55. package/components/fieldset/src/ctx.d.ts +1 -1
  56. package/components/fieldset/src/index.vue.d.ts +3 -3
  57. package/components/form/index.cjs +1 -1
  58. package/components/form/index.mjs +83 -72
  59. package/components/form/src/ctx.d.ts +5 -2
  60. package/components/form/src/index.vue.d.ts +13 -7
  61. package/components/form-item/index.cjs +1 -1
  62. package/components/form-item/index.mjs +78 -69
  63. package/components/form-item/src/ctx.d.ts +6 -3
  64. package/components/form-item/src/index.vue.d.ts +11 -5
  65. package/components/index-BCZuzyeO.mjs +317 -0
  66. package/components/index-DJv1MwwH.mjs +14 -0
  67. package/components/information-collection/src/ctx.d.ts +5 -2
  68. package/components/information-collection/src/index.vue.d.ts +11 -5
  69. package/components/input/index.cjs +1 -1
  70. package/components/input/index.mjs +1 -1
  71. package/components/input/src/ctx.d.ts +6 -3
  72. package/components/input/src/index.vue.d.ts +22 -10
  73. package/components/input-array/index.cjs +1 -1
  74. package/components/input-array/index.mjs +2 -2
  75. package/components/input-array/src/ctx.d.ts +5 -2
  76. package/components/input-array/src/index.vue.d.ts +11 -5
  77. package/components/input-collection/index.cjs +1 -1
  78. package/components/input-collection/index.mjs +2 -2
  79. package/components/input-collection/src/core.vue.d.ts +11 -5
  80. package/components/input-collection/src/ctx.d.ts +5 -2
  81. package/components/input-collection/src/index.vue.d.ts +11 -5
  82. package/components/input-file/src/index.vue.d.ts +11 -5
  83. package/components/input-link/index.cjs +1 -1
  84. package/components/input-link/index.mjs +2 -2
  85. package/components/input-link/src/ctx.d.ts +5 -2
  86. package/components/input-link/src/index.vue.d.ts +33 -15
  87. package/components/input-number/index.cjs +1 -1
  88. package/components/input-number/index.mjs +1 -1
  89. package/components/input-number/src/ctx.d.ts +6 -3
  90. package/components/input-number/src/index.vue.d.ts +22 -10
  91. package/components/input-tag/index.cjs +1 -1
  92. package/components/input-tag/index.mjs +1 -1
  93. package/components/input-tag/src/ctx.d.ts +6 -3
  94. package/components/input-tag/src/index.vue.d.ts +22 -10
  95. package/components/isObject-DQpnfMRp.mjs +34 -0
  96. package/components/monaco-editor/index.cjs +1 -1
  97. package/components/monaco-editor/index.mjs +1 -1
  98. package/components/monaco-editor/src/ctx.d.ts +5 -2
  99. package/components/monaco-editor/src/index.vue.d.ts +22 -10
  100. package/components/radio/index.cjs +1 -1
  101. package/components/radio/index.mjs +1 -1
  102. package/components/radio/src/ctx.d.ts +5 -2
  103. package/components/radio/src/index.vue.d.ts +22 -10
  104. package/components/radio/src/wraper.vue.d.ts +11 -5
  105. package/components/select/index.cjs +1 -1
  106. package/components/select/index.mjs +1 -1
  107. package/components/select/src/core.vue.d.ts +22 -10
  108. package/components/select/src/ctx.d.ts +6 -3
  109. package/components/select/src/index.vue.d.ts +11 -5
  110. package/components/slider/src/ctx.d.ts +5 -2
  111. package/components/slider/src/index.vue.d.ts +11 -5
  112. package/components/style.css +1 -1
  113. package/components/switch/src/ctx.d.ts +5 -2
  114. package/components/switch/src/index.vue.d.ts +11 -5
  115. package/components/tables-select/src/ctx.d.ts +6 -3
  116. package/components/tables-select/src/index.vue.d.ts +12 -6
  117. package/components/templates-default/index.cjs +1 -1
  118. package/components/templates-default/index.mjs +1 -1
  119. package/components/templates-default/src/index.vue.d.ts +219 -102
  120. package/components/templates-element-plus/index.cjs +1 -1
  121. package/components/templates-element-plus/index.mjs +1 -1
  122. package/components/templates-esri/index.cjs +1 -1
  123. package/components/templates-esri/index.mjs +1 -1
  124. package/components/templates-esri/src/index.vue.d.ts +35 -17
  125. package/components/templates-layout/index.cjs +1 -1
  126. package/components/templates-layout/index.mjs +1 -1
  127. package/components/templates-layout/src/index.vue.d.ts +3 -3
  128. package/components/templates-variant/index.cjs +1 -1
  129. package/components/templates-variant/index.mjs +1 -1
  130. package/components/templates-variant/src/index.vue.d.ts +22 -10
  131. package/components/time-picker/src/ctx.d.ts +6 -3
  132. package/components/time-picker/src/index.vue.d.ts +11 -5
  133. package/components/upload/index.cjs +1 -1
  134. package/components/upload/index.mjs +2 -2
  135. package/components/upload/src/ctx.d.ts +6 -3
  136. package/components/upload/src/index.vue.d.ts +22 -10
  137. package/components/upload/src/wraper.vue.d.ts +11 -5
  138. package/components/upload-plus/index.cjs +1 -1
  139. package/components/upload-plus/index.mjs +2 -2
  140. package/components/upload-plus/src/ctx.d.ts +5 -2
  141. package/components/upload-plus/src/index.vue.d.ts +11 -5
  142. package/components/use-watch-Bfrz9pv_.js +1 -0
  143. package/components/use-watch-t49wP7jy.mjs +414 -0
  144. package/components/van-cascader/src/ctx.d.ts +5 -2
  145. package/components/van-cascader/src/index.vue.d.ts +11 -5
  146. package/components/var-datetime-picker/index.cjs +1 -1
  147. package/components/var-datetime-picker/index.mjs +1 -1
  148. package/components/var-datetime-picker/src/ctx.d.ts +5 -2
  149. package/components/var-datetime-picker/src/index.vue.d.ts +22 -10
  150. package/components/vditor/index.cjs +1 -1
  151. package/components/vditor/index.mjs +1 -1
  152. package/components/vditor/src/ctx.d.ts +5 -2
  153. package/components/vditor/src/index.vue.d.ts +22 -10
  154. package/composables/index.cjs +1 -1
  155. package/composables/index.d.ts +1 -0
  156. package/composables/index.mjs +69 -60
  157. package/composables/useComputedLabelPosition.d.ts +15 -0
  158. package/index.css +1 -1
  159. package/package.json +1 -1
  160. package/shared/element-plus/ctx.d.ts +2 -2
  161. package/components/cloneDeep.cjs +0 -1
  162. package/components/debounce.cjs +0 -1
  163. package/components/use-watch.cjs +0 -1
  164. /package/components/{_plugin-vue_export-helper.cjs → _plugin-vue_export-helper-BHFhmbuH.js} +0 -0
  165. /package/components/{index2.cjs → index-BNPcMpOO.js} +0 -0
  166. /package/components/{index.cjs → index-DSyxYMB0.js} +0 -0
  167. /package/components/{isObject.cjs → isObject-fAvOGw_H.js} +0 -0
@@ -1,20 +1,25 @@
1
- import { formProps as w, formEmits as O, ElForm as I } from "element-plus";
2
- import { bindPropsFactory as T, onEmitsFactory as h } from "@vunk/core/shared/utils-vue";
3
- import { NOOP as j } from "@vunk/core/shared/utils-function";
4
- import { defineComponent as v, shallowRef as C, getCurrentInstance as D, provide as g, computed as E, resolveComponent as m, openBlock as P, createBlock as $, mergeProps as R, toHandlers as B, withCtx as f, createVNode as l, renderSlot as _ } from "vue";
5
- import { VkfFormItemRenderer as L } from "@vunk/form/components/form-item-renderer";
6
- import { createFormBindProps as A, createFormOnEmits as q } from "@vunk/form/shared/element-plus";
7
- import { getValue as z } from "@vunk/core/shared/helper";
8
- import { VkfTemplatesDefault as M } from "@vunk/form/components/templates-default";
9
- import { VkfTemplatesLayout as N } from "@vunk/form/components/templates-layout";
10
- import { pickObject as H } from "@vunk/core/shared/utils-object";
11
- import { genTemplateIfFunc as G } from "@vunk/form/shared/form";
12
- import { VkfRendererData as J } from "@vunk/form/components/renderer-data";
13
- import { pickObject as K } from "@vunk/shared/object";
14
- import { VkfFormsSegment as Q } from "@vunk/form/components/forms-provider";
15
- import { _ as U } from "../_plugin-vue_export-helper.cjs";
16
- const d = {
17
- ...w,
1
+ import { formProps as I, formEmits as T, ElForm as h } from "element-plus";
2
+ import { bindPropsFactory as j, onEmitsFactory as C } from "@vunk/core/shared/utils-vue";
3
+ import { NOOP as D } from "@vunk/core/shared/utils-function";
4
+ import { defineComponent as L, shallowRef as $, getCurrentInstance as B, computed as l, provide as w, resolveComponent as a, openBlock as A, createBlock as q, mergeProps as v, toHandlers as z, withCtx as f, createVNode as m, renderSlot as O } from "vue";
5
+ import { VkfFormItemRenderer as M } from "@vunk/form/components/form-item-renderer";
6
+ import { createFormBindProps as N, createFormOnEmits as H } from "@vunk/form/shared/element-plus";
7
+ import { getValue as G } from "@vunk/core/shared/helper";
8
+ import { VkfTemplatesDefault as J } from "@vunk/form/components/templates-default";
9
+ import { VkfTemplatesLayout as K } from "@vunk/form/components/templates-layout";
10
+ import { pickObject as Q } from "@vunk/core/shared/utils-object";
11
+ import { genTemplateIfFunc as U } from "@vunk/form/shared/form";
12
+ import { VkfRendererData as W } from "@vunk/form/components/renderer-data";
13
+ import { pickObject as X } from "@vunk/shared/object";
14
+ import { VkfFormsSegment as Y } from "@vunk/form/components/forms-provider";
15
+ import { useComputedLabelPosition as Z } from "@vunk/form/composables";
16
+ import { _ as x } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
17
+ const b = {
18
+ ...I,
19
+ labelPosition: {
20
+ type: String,
21
+ default: "end"
22
+ },
18
23
  data: {
19
24
  type: Object,
20
25
  default: () => ({})
@@ -28,7 +33,7 @@ const d = {
28
33
  },
29
34
  elRef: {
30
35
  type: Function,
31
- default: () => j
36
+ default: () => D
32
37
  },
33
38
  /**
34
39
  * 是否开启布局模式
@@ -62,22 +67,22 @@ const d = {
62
67
  type: Object,
63
68
  default: () => ({})
64
69
  }
65
- }, W = T(d), i = {
66
- ...O,
70
+ }, ee = j(b), k = {
71
+ ...T,
67
72
  setData: (e) => e,
68
73
  validate: null,
69
74
  submit: null
70
- }, X = h(i), Fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
75
+ }, te = C(k), _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
71
76
  __proto__: null,
72
- createBindProps: W,
73
- createOnEmits: X,
74
- emits: i,
75
- props: d
76
- }, Symbol.toStringTag, { value: "Module" })), Y = (e) => 24 - e.templateSlots.reduce((o, r) => {
77
+ createBindProps: ee,
78
+ createOnEmits: te,
79
+ emits: k,
80
+ props: b
81
+ }, Symbol.toStringTag, { value: "Module" })), oe = (e) => 24 - e.templateSlots.reduce((o, r) => {
77
82
  if (!r.span)
78
83
  throw new Error("ElColSource span is required");
79
84
  return o + r.span;
80
- }, 0), Z = (e, o = {}) => {
85
+ }, 0), re = (e, o = {}) => {
81
86
  const r = e.span ?? o.span;
82
87
  if (r == null)
83
88
  throw new Error("genColItem ElColSource span is required");
@@ -86,89 +91,95 @@ const d = {
86
91
  templateType: "ElCol",
87
92
  span: r,
88
93
  templateSlots: [
89
- H(e, {
94
+ Q(e, {
90
95
  excludes: ["span"]
91
96
  })
92
97
  ]
93
98
  };
94
- }, x = (e, o = {}) => ({
99
+ }, ne = (e, o = {}) => ({
95
100
  ...o,
96
101
  templateType: "ElRow",
97
102
  templateSlots: e ? [
98
103
  e
99
104
  ] : []
100
- }), ee = v({
105
+ }), ae = L({
101
106
  name: "VkfForm",
102
107
  components: {
103
- VkfRendererData: J,
104
- ElForm: I,
105
- VkfFormItemRenderer: L,
106
- VkfTemplatesDefault: M,
107
- VkfTemplatesLayout: N,
108
- VkfFormsSegment: Q
108
+ VkfRendererData: W,
109
+ ElForm: h,
110
+ VkfFormItemRenderer: M,
111
+ VkfTemplatesDefault: J,
112
+ VkfTemplatesLayout: K,
113
+ VkfFormsSegment: Y
109
114
  },
110
- props: d,
111
- emits: i,
115
+ props: b,
116
+ emits: k,
112
117
  setup(e, { emit: o }) {
113
- const r = A(e, ["model"]), y = q(o), p = C(), S = D();
114
- g("vkfFormVm", S), g("elFormRef", p);
115
- const u = (t) => {
116
- p.value = t, e.elRef(t);
117
- }, c = E(() => e.layout ? e.formItems.reduce((t, n) => {
118
- var V;
119
- const a = t.findLast((b) => b.templateType === "ElRow"), s = n.span ?? e.colSource.span;
120
- if (!s)
118
+ const r = N(e, ["model", "labelPosition"]), F = H(o), s = $(), g = B(), p = l(() => {
119
+ var t;
120
+ return (t = s.value) == null ? void 0 : t.$el;
121
+ }), u = l(() => e.labelPosition), c = Z(p, u), i = l(() => ({
122
+ ...r.value,
123
+ "label-position": c.value
124
+ }));
125
+ w("vkfFormVm", g), w("elFormRef", s);
126
+ const d = (t) => {
127
+ s.value = t, e.elRef(t);
128
+ }, y = l(() => e.layout ? e.formItems.reduce((t, n) => {
129
+ var _;
130
+ const S = t.findLast((P) => P.templateType === "ElRow"), R = n.span ?? e.colSource.span;
131
+ if (!R)
121
132
  return t.push(n), t;
122
- if (!((V = n.templateLayout) != null && V.allowEmpty) && Reflect.has(n, "templateIf") && !G(n.templateIf)(e.data))
133
+ if (!((_ = n.templateLayout) != null && _.allowEmpty) && Reflect.has(n, "templateIf") && !U(n.templateIf)(e.data))
123
134
  return t;
124
- const F = Z(n, K({
135
+ const E = re(n, X({
125
136
  ...e.colSource,
126
137
  ...n.templateLayout
127
138
  }, {
128
139
  excludes: ["allowEmpty"]
129
140
  }));
130
- return !a || Y(a) < s ? t.push(x(F, e.rowSource)) : a.templateSlots.push(F), t;
141
+ return !S || oe(S) < R ? t.push(ne(E, e.rowSource)) : S.templateSlots.push(E), t;
131
142
  }, []) : e.formItems);
132
143
  return {
133
- formProps: r,
134
- formEmits: y,
135
- getValue: z,
136
- getRef: u,
137
- computed: E,
138
- rendererSource: c,
144
+ formProps: i,
145
+ formEmits: F,
146
+ getValue: G,
147
+ getRef: d,
148
+ computed: l,
149
+ rendererSource: y,
139
150
  handleSubmit: (t) => {
140
151
  t.preventDefault(), o("submit", t);
141
152
  }
142
153
  };
143
154
  }
144
155
  });
145
- function te(e, o, r, y, p, S) {
146
- const u = m("VkfFormsSegment"), c = m("VkfTemplatesDefault"), k = m("VkfTemplatesLayout"), t = m("VkfFormItemRenderer"), n = m("VkfRendererData"), a = m("ElForm");
147
- return P(), $(a, R(e.formProps, {
156
+ function le(e, o, r, F, s, g) {
157
+ const p = a("VkfFormsSegment"), u = a("VkfTemplatesDefault"), c = a("VkfTemplatesLayout"), i = a("VkfFormItemRenderer"), d = a("VkfRendererData"), y = a("ElForm");
158
+ return A(), q(y, v(e.formProps, {
148
159
  ref: e.getRef,
149
160
  class: {
150
161
  "is-readonly": e.readonly
151
162
  },
152
163
  model: e.model || e.data
153
- }, B(e.formEmits), { onSubmit: e.handleSubmit }), {
164
+ }, z(e.formEmits), { onSubmit: e.handleSubmit }), {
154
165
  default: f(() => [
155
- l(n, {
166
+ m(d, {
156
167
  data: e.data,
157
- onSetData: o[0] || (o[0] = (s) => e.$emit("setData", s))
168
+ onSetData: o[0] || (o[0] = (V) => e.$emit("setData", V))
158
169
  }, {
159
170
  default: f(() => [
160
- l(u, R({ data: e.data }, e.segmentAttrs), null, 16, ["data"]),
161
- l(t, { source: e.rendererSource }, {
171
+ m(p, v({ data: e.data }, e.segmentAttrs), null, 16, ["data"]),
172
+ m(i, { source: e.rendererSource }, {
162
173
  placeholder: f(() => [
163
- l(c),
164
- l(k)
174
+ m(u),
175
+ m(c)
165
176
  ]),
166
177
  default: f(() => [
167
- _(e.$slots, "rendererTemplate")
178
+ O(e.$slots, "rendererTemplate")
168
179
  ]),
169
180
  _: 3
170
181
  }, 8, ["source"]),
171
- _(e.$slots, "default")
182
+ O(e.$slots, "default")
172
183
  ]),
173
184
  _: 3
174
185
  }, 8, ["data"])
@@ -176,12 +187,12 @@ function te(e, o, r, y, p, S) {
176
187
  _: 3
177
188
  }, 16, ["class", "model", "onSubmit"]);
178
189
  }
179
- const Ve = /* @__PURE__ */ U(ee, [["render", te]]), be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
190
+ const Pe = /* @__PURE__ */ x(ae, [["render", le]]), we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
180
191
  __proto__: null
181
192
  }, Symbol.toStringTag, { value: "Module" }));
182
193
  export {
183
- Ve as VkfForm,
184
- Fe as _VkfFormCtx,
185
- be as __VkfForm,
186
- Ve as default
194
+ Pe as VkfForm,
195
+ _e as _VkfFormCtx,
196
+ we as __VkfForm,
197
+ Pe as default
187
198
  };
@@ -3,6 +3,10 @@ import type { SetDataEvent } from '@vunk/core';
3
3
  import { ColItem, RowItem } from './types';
4
4
  import { AnyFunc } from '@vunk/shared';
5
5
  export declare const props: {
6
+ labelPosition: {
7
+ type: PropType<"left" | "right" | "top" | "start" | "end">;
8
+ default: string;
9
+ };
6
10
  data: {
7
11
  type: PropType<Record<string, any>>;
8
12
  default: () => {};
@@ -57,7 +61,6 @@ export declare const props: {
57
61
  readonly validator: ((val: unknown) => boolean) | undefined;
58
62
  __epPropKey: true;
59
63
  };
60
- labelPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right" | "top", unknown, "right", boolean>;
61
64
  requireAsteriskPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right", unknown, "left", boolean>;
62
65
  labelWidth: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
63
66
  labelSuffix: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
@@ -77,7 +80,7 @@ export declare const props: {
77
80
  };
78
81
  disabled: BooleanConstructor;
79
82
  };
80
- export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"rules", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"data", keyof T2> | Extract<"model", keyof T2> | Extract<"requireAsteriskPosition", keyof T2> | Extract<"labelSuffix", keyof T2> | Extract<"statusIcon", keyof T2> | Extract<"validateOnRuleChange", keyof T2> | Extract<"hideRequiredAsterisk", keyof T2> | Extract<"scrollToError", keyof T2> | Extract<"scrollIntoViewOptions", keyof T2> | Extract<"layout", keyof T2> | Extract<"formItems", keyof T2> | Extract<"rowSource", keyof T2> | Extract<"colSource", keyof T2> | Extract<"segmentAttrs", keyof T2>)[]>(propsArg: T2, excludes?: EX | undefined) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size", keyof T2>, KE> | Exclude<Extract<"elRef", keyof T2>, KE> | Exclude<Extract<"inline", keyof T2>, KE> | Exclude<Extract<"readonly", keyof T2>, KE> | Exclude<Extract<"labelWidth", keyof T2>, KE> | Exclude<Extract<"labelPosition", keyof T2>, KE> | Exclude<Extract<"rules", keyof T2>, KE> | Exclude<Extract<"inlineMessage", keyof T2>, KE> | Exclude<Extract<"showMessage", keyof T2>, KE> | Exclude<Extract<"disabled", keyof T2>, KE> | Exclude<Extract<"data", keyof T2>, KE> | Exclude<Extract<"model", keyof T2>, KE> | Exclude<Extract<"requireAsteriskPosition", keyof T2>, KE> | Exclude<Extract<"labelSuffix", keyof T2>, KE> | Exclude<Extract<"statusIcon", keyof T2>, KE> | Exclude<Extract<"validateOnRuleChange", keyof T2>, KE> | Exclude<Extract<"hideRequiredAsterisk", keyof T2>, KE> | Exclude<Extract<"scrollToError", keyof T2>, KE> | Exclude<Extract<"scrollIntoViewOptions", keyof T2>, KE> | Exclude<Extract<"layout", keyof T2>, KE> | Exclude<Extract<"formItems", keyof T2>, KE> | Exclude<Extract<"rowSource", keyof T2>, KE> | Exclude<Extract<"colSource", keyof T2>, KE> | Exclude<Extract<"segmentAttrs", keyof T2>, KE> : Extract<"size", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"rules", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"data", keyof T2> | Extract<"model", keyof T2> | Extract<"requireAsteriskPosition", keyof T2> | Extract<"labelSuffix", keyof T2> | Extract<"statusIcon", keyof T2> | Extract<"validateOnRuleChange", keyof T2> | Extract<"hideRequiredAsterisk", keyof T2> | Extract<"scrollToError", keyof T2> | Extract<"scrollIntoViewOptions", keyof T2> | Extract<"layout", keyof T2> | Extract<"formItems", keyof T2> | Extract<"rowSource", keyof T2> | Extract<"colSource", keyof T2> | Extract<"segmentAttrs", keyof T2>]: { [k in Extract<"size", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"rules", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"data", keyof T2> | Extract<"model", keyof T2> | Extract<"requireAsteriskPosition", keyof T2> | Extract<"labelSuffix", keyof T2> | Extract<"statusIcon", keyof T2> | Extract<"validateOnRuleChange", keyof T2> | Extract<"hideRequiredAsterisk", keyof T2> | Extract<"scrollToError", keyof T2> | Extract<"scrollIntoViewOptions", keyof T2> | Extract<"layout", keyof T2> | Extract<"formItems", keyof T2> | Extract<"rowSource", keyof T2> | Extract<"colSource", keyof T2> | Extract<"segmentAttrs", keyof T2>]: T2[k]; }[P]; }>;
83
+ export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"rules", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"data", keyof T2> | Extract<"model", keyof T2> | Extract<"requireAsteriskPosition", keyof T2> | Extract<"labelSuffix", keyof T2> | Extract<"statusIcon", keyof T2> | Extract<"validateOnRuleChange", keyof T2> | Extract<"hideRequiredAsterisk", keyof T2> | Extract<"scrollToError", keyof T2> | Extract<"scrollIntoViewOptions", keyof T2> | Extract<"layout", keyof T2> | Extract<"formItems", keyof T2> | Extract<"rowSource", keyof T2> | Extract<"colSource", keyof T2> | Extract<"segmentAttrs", keyof T2>)[]>(propsArg: T2, excludes?: EX | undefined) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size", keyof T2>, KE> | Exclude<Extract<"labelPosition", keyof T2>, KE> | Exclude<Extract<"elRef", keyof T2>, KE> | Exclude<Extract<"inline", keyof T2>, KE> | Exclude<Extract<"readonly", keyof T2>, KE> | Exclude<Extract<"labelWidth", keyof T2>, KE> | Exclude<Extract<"rules", keyof T2>, KE> | Exclude<Extract<"inlineMessage", keyof T2>, KE> | Exclude<Extract<"showMessage", keyof T2>, KE> | Exclude<Extract<"disabled", keyof T2>, KE> | Exclude<Extract<"data", keyof T2>, KE> | Exclude<Extract<"model", keyof T2>, KE> | Exclude<Extract<"requireAsteriskPosition", keyof T2>, KE> | Exclude<Extract<"labelSuffix", keyof T2>, KE> | Exclude<Extract<"statusIcon", keyof T2>, KE> | Exclude<Extract<"validateOnRuleChange", keyof T2>, KE> | Exclude<Extract<"hideRequiredAsterisk", keyof T2>, KE> | Exclude<Extract<"scrollToError", keyof T2>, KE> | Exclude<Extract<"scrollIntoViewOptions", keyof T2>, KE> | Exclude<Extract<"layout", keyof T2>, KE> | Exclude<Extract<"formItems", keyof T2>, KE> | Exclude<Extract<"rowSource", keyof T2>, KE> | Exclude<Extract<"colSource", keyof T2>, KE> | Exclude<Extract<"segmentAttrs", keyof T2>, KE> : Extract<"size", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"rules", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"data", keyof T2> | Extract<"model", keyof T2> | Extract<"requireAsteriskPosition", keyof T2> | Extract<"labelSuffix", keyof T2> | Extract<"statusIcon", keyof T2> | Extract<"validateOnRuleChange", keyof T2> | Extract<"hideRequiredAsterisk", keyof T2> | Extract<"scrollToError", keyof T2> | Extract<"scrollIntoViewOptions", keyof T2> | Extract<"layout", keyof T2> | Extract<"formItems", keyof T2> | Extract<"rowSource", keyof T2> | Extract<"colSource", keyof T2> | Extract<"segmentAttrs", keyof T2>]: { [k in Extract<"size", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"rules", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"data", keyof T2> | Extract<"model", keyof T2> | Extract<"requireAsteriskPosition", keyof T2> | Extract<"labelSuffix", keyof T2> | Extract<"statusIcon", keyof T2> | Extract<"validateOnRuleChange", keyof T2> | Extract<"hideRequiredAsterisk", keyof T2> | Extract<"scrollToError", keyof T2> | Extract<"scrollIntoViewOptions", keyof T2> | Extract<"layout", keyof T2> | Extract<"formItems", keyof T2> | Extract<"rowSource", keyof T2> | Extract<"colSource", keyof T2> | Extract<"segmentAttrs", keyof T2>]: T2[k]; }[P]; }>;
81
84
  export declare const emits: {
82
85
  setData: (e: SetDataEvent) => SetDataEvent;
83
86
  validate: null;
@@ -2,6 +2,10 @@ import { RowItem } from './types';
2
2
  declare const _default: typeof __VLS_export;
3
3
  export default _default;
4
4
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
+ labelPosition: {
6
+ type: import("vue").PropType<"left" | "right" | "top" | "start" | "end">;
7
+ default: string;
8
+ };
5
9
  data: {
6
10
  type: import("vue").PropType<Record<string, any>>;
7
11
  default: () => {};
@@ -40,7 +44,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
40
44
  readonly validator: ((val: unknown) => boolean) | undefined;
41
45
  __epPropKey: true;
42
46
  };
43
- labelPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right" | "top", unknown, "right", boolean>;
44
47
  requireAsteriskPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right", unknown, "left", boolean>;
45
48
  labelWidth: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
46
49
  labelSuffix: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
@@ -61,10 +64,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
61
64
  disabled: BooleanConstructor;
62
65
  }>, {
63
66
  formProps: import("vue").ComputedRef<{
67
+ 'label-position': "left" | "right" | "top" | undefined;
64
68
  size: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", unknown> | undefined;
65
69
  inline: boolean;
66
70
  labelWidth: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
67
- labelPosition: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "left" | "right" | "top", unknown>;
68
71
  rules: Partial<Record<string, Record<string, any> | import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>>> | undefined;
69
72
  inlineMessage: boolean;
70
73
  showMessage: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
@@ -88,6 +91,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
88
91
  validate: null;
89
92
  submit: null;
90
93
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
94
+ labelPosition: {
95
+ type: import("vue").PropType<"left" | "right" | "top" | "start" | "end">;
96
+ default: string;
97
+ };
91
98
  data: {
92
99
  type: import("vue").PropType<Record<string, any>>;
93
100
  default: () => {};
@@ -126,7 +133,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
126
133
  readonly validator: ((val: unknown) => boolean) | undefined;
127
134
  __epPropKey: true;
128
135
  };
129
- labelPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right" | "top", unknown, "right", boolean>;
130
136
  requireAsteriskPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right", unknown, "left", boolean>;
131
137
  labelWidth: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
132
138
  labelSuffix: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
@@ -150,11 +156,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
150
156
  onValidate?: ((...args: any[]) => any) | undefined;
151
157
  onSetData?: ((e: import("@vunk/core").SetDataEvent) => any) | undefined;
152
158
  }>, {
159
+ labelPosition: "left" | "right" | "top" | "start" | "end";
153
160
  elRef: import("@vunk/shared").AnyFunc;
154
161
  inline: boolean;
155
162
  readonly: boolean;
156
163
  labelWidth: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
157
- labelPosition: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "left" | "right" | "top", unknown>;
158
164
  inlineMessage: boolean;
159
165
  showMessage: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
160
166
  disabled: boolean;
@@ -444,7 +450,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
444
450
  }, {}, {
445
451
  ElRow: import("element-plus/es/utils/index.mjs").SFCWithInstall<{
446
452
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("element-plus").RowProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
447
- justify: "center" | "start" | "end" | "space-around" | "space-between" | "space-evenly";
453
+ justify: "start" | "end" | "center" | "space-around" | "space-between" | "space-evenly";
448
454
  tag: string;
449
455
  gutter: number;
450
456
  }, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
@@ -455,7 +461,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
455
461
  M: {};
456
462
  Defaults: {};
457
463
  }, Readonly<import("element-plus").RowProps> & Readonly<{}>, {}, {}, {}, {}, {
458
- justify: "center" | "start" | "end" | "space-around" | "space-between" | "space-evenly";
464
+ justify: "start" | "end" | "center" | "space-around" | "space-between" | "space-evenly";
459
465
  tag: string;
460
466
  gutter: number;
461
467
  }>;
@@ -463,7 +469,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
463
469
  __isTeleport?: never;
464
470
  __isSuspense?: never;
465
471
  } & import("vue").ComponentOptionsBase<Readonly<import("element-plus").RowProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
466
- justify: "center" | "start" | "end" | "space-around" | "space-between" | "space-evenly";
472
+ justify: "start" | "end" | "center" | "space-around" | "space-between" | "space-evenly";
467
473
  tag: string;
468
474
  gutter: number;
469
475
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("element-plus"),g=require("@vunk/core/shared/utils-vue"),e=require("vue"),p=require("@vunk/form/shared/element-plus"),b=require("@vunk/form/composables"),P=require("@vunk/form/composables/element-plus"),y=require("@vunk/core/shared/utils-object"),C=require("@vunk/form/shared/rules"),h=require("../index.cjs"),v={...a.formItemProps,formItemSize:{type:String,default:void 0},formItemSlots:{type:Object,default:void 0},elRef:{type:Function,required:!1},inline:{type:Boolean,default:!1},readonly:{type:Boolean,default:void 0},formItemTip:{type:String,default:void 0},formItemTipClass:null,labelTip:{type:String,default:void 0},information:{type:Boolean,default:!1},prop:null,defaultModelValue:null};Reflect.deleteProperty(v,"size");const f=v,q=g.bindPropsFactory(f),B=Object.freeze(Object.defineProperty({__proto__:null,createBindProps:q,props:f},Symbol.toStringTag,{value:"Module"})),V={key:0,class:"vkf-form-item-label__span"},_={key:2,class:"vkf-form-item-label__actions"},$=e.defineComponent({inheritAttrs:!1,__name:"core",props:{labelTip:{type:String,default:""},formItemTip:{type:String,default:""},formItemTipClass:null,elRef:null,label:null},setup(t){return(r,m)=>(e.openBlock(),e.createBlock(e.unref(a.ElFormItem),e.mergeProps(r.$attrs,{ref:t.elRef,class:["vkf-form-item",{"has-label-actions":r.$slots.labelActions}],label:t.label}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"before"),e.renderSlot(r.$slots,"default"),e.renderSlot(r.$slots,"after"),t.formItemTip?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vkf-form-item__tip",t.formItemTipClass])},[e.createElementVNode("span",null,e.toDisplayString(t.formItemTip),1)],2)):e.createCommentVNode("",!0)]),label:e.withCtx(n=>[e.renderSlot(r.$slots,"label",e.normalizeProps(e.guardReactiveProps(n)),()=>[t.label?(e.openBlock(),e.createElementBlock("span",V,e.toDisplayString(n.label),1)):e.createCommentVNode("",!0),t.labelTip?(e.openBlock(),e.createBlock(e.unref(a.ElTooltip),{key:1,content:t.labelTip},{default:e.withCtx(()=>[e.createVNode(e.unref(a.ElButton),{text:"",class:"vkf-form-item-label-tip-button"},{default:e.withCtx(()=>[e.createVNode(e.unref(a.ElIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(h.warning_default))]),_:1})]),_:1})]),_:1},8,["content"])):e.createCommentVNode("",!0),r.$slots.labelActions?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(r.$slots,"labelActions")])):e.createCommentVNode("",!0)])]),error:e.withCtx(n=>[e.renderSlot(r.$slots,"error",e.normalizeProps(e.guardReactiveProps(n)))]),_:3},16,["class","label"]))}}),k=e.defineComponent({name:"VkfFormItem",props:f,setup(t,{slots:r}){const m=p.createFormItemBindProps(t,["rules"]),n=b.useComputedReadonly(t),{tr:i}=P.useLocale(),d=()=>t.label||i("vkf.formItem.defaultField","该字段"),I=l=>{if(l.message)return;l.required&&(l.message=i("vkf.formItem.required","{label}不能为空",{label:d()}));const o=C.PATTERN_OPTIONS.find(c=>c.value===l.pattern);o&&(l.message=i("vkf.formItem.pattern","输入 {label} {pattern}",{label:d(),pattern:o.title}))},T=e.computed(()=>{let l=[];return!t.rules&&t.required&&l.push({required:!0}),y.isPlainObject(t.rules)&&(l=[t.rules]),Array.isArray(t.rules)&&(l=t.rules,t.required&&!t.rules.find(o=>o.required)&&l.push({required:!0})),l=l.filter(o=>{if(o&&y.isPlainObject(o))return Object.keys(o).filter(S=>!S.startsWith("data-")).length>0}),l.forEach(o=>{I(o)}),l}),{getDataValue:s,emitSetData:u}=b.useRendererData();return setTimeout(()=>{t.defaultModelValue!==void 0&&t.prop&&(s==null?void 0:s(t.prop))===void 0&&(u==null||u({k:t.prop,v:t.defaultModelValue}))}),()=>e.h($,{...m.value,elRef:t.elRef,class:{"is-readonly":n.value,"vkf-form-item--inline":t.inline,"is-empty-label":!t.label,"is-information":t.information},size:t.formItemSize,rules:T.value,formItemTip:t.formItemTip,formItemTipClass:t.formItemTipClass,labelTip:t.labelTip,label:t.label},{...r,...t.formItemSlots})}}),O=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfFormItem=k;exports._VkfFormItemCtx=B;exports.__VkfFormItem=O;exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("element-plus"),h=require("@vunk/core/shared/utils-vue"),e=require("vue"),q=require("@vunk/form/shared/element-plus"),m=require("@vunk/form/composables"),B=require("@vunk/form/composables/element-plus"),v=require("@vunk/core/shared/utils-object"),V=require("@vunk/form/shared/rules"),_=require("../index-DSyxYMB0.js"),I={...a.formItemProps,labelPosition:{type:String,default:void 0},formItemSize:{type:String,default:void 0},formItemSlots:{type:Object,default:void 0},elRef:{type:Function,required:!1},inline:{type:Boolean,default:!1},readonly:{type:Boolean,default:void 0},formItemTip:{type:String,default:void 0},formItemTipClass:null,labelTip:{type:String,default:void 0},information:{type:Boolean,default:!1},prop:null,defaultModelValue:null};Reflect.deleteProperty(I,"size");const c=I,$=h.bindPropsFactory(c),R=Object.freeze(Object.defineProperty({__proto__:null,createBindProps:$,props:c},Symbol.toStringTag,{value:"Module"})),E={key:0,class:"vkf-form-item-label__span"},O={key:2,class:"vkf-form-item-label__actions"},j=e.defineComponent({inheritAttrs:!1,__name:"core",props:{labelTip:{type:String,default:""},formItemTip:{type:String,default:""},formItemTipClass:null,elRef:null,label:null},setup(t){return(o,i)=>(e.openBlock(),e.createBlock(e.unref(a.ElFormItem),e.mergeProps(o.$attrs,{ref:t.elRef,class:["vkf-form-item",{"has-label-actions":o.$slots.labelActions}],label:t.label}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"before"),e.renderSlot(o.$slots,"default"),e.renderSlot(o.$slots,"after"),t.formItemTip?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vkf-form-item__tip",t.formItemTipClass])},[e.createElementVNode("span",null,e.toDisplayString(t.formItemTip),1)],2)):e.createCommentVNode("",!0)]),label:e.withCtx(n=>[e.renderSlot(o.$slots,"label",e.normalizeProps(e.guardReactiveProps(n)),()=>[t.label?(e.openBlock(),e.createElementBlock("span",E,e.toDisplayString(n.label),1)):e.createCommentVNode("",!0),t.labelTip?(e.openBlock(),e.createBlock(e.unref(a.ElTooltip),{key:1,content:t.labelTip},{default:e.withCtx(()=>[e.createVNode(e.unref(a.ElButton),{text:"",class:"vkf-form-item-label-tip-button"},{default:e.withCtx(()=>[e.createVNode(e.unref(a.ElIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(_.warning_default))]),_:1})]),_:1})]),_:1},8,["content"])):e.createCommentVNode("",!0),o.$slots.labelActions?(e.openBlock(),e.createElementBlock("div",O,[e.renderSlot(o.$slots,"labelActions")])):e.createCommentVNode("",!0)])]),error:e.withCtx(n=>[e.renderSlot(o.$slots,"error",e.normalizeProps(e.guardReactiveProps(n)))]),_:3},16,["class","label"]))}}),k=e.defineComponent({name:"VkfFormItem",props:c,setup(t,{slots:o}){const i=q.createFormItemBindProps(t,["rules"]),n=m.useComputedReadonly(t),{tr:s}=B.useLocale(),d=e.ref(),P=e.computed(()=>i.value.labelPosition??t.labelPosition),T=m.useComputedLabelPosition(d,P),b=()=>t.label||s("vkf.formItem.defaultField","该字段"),S=l=>{if(l.message)return;l.required&&(l.message=s("vkf.formItem.required","{label}不能为空",{label:b()}));const r=V.PATTERN_OPTIONS.find(y=>y.value===l.pattern);r&&(l.message=s("vkf.formItem.pattern","输入 {label} {pattern}",{label:b(),pattern:r.title}))},g=e.computed(()=>{let l=[];return!t.rules&&t.required&&l.push({required:!0}),v.isPlainObject(t.rules)&&(l=[t.rules]),Array.isArray(t.rules)&&(l=t.rules,t.required&&!t.rules.find(r=>r.required)&&l.push({required:!0})),l=l.filter(r=>{if(r&&v.isPlainObject(r))return Object.keys(r).filter(C=>!C.startsWith("data-")).length>0}),l.forEach(r=>{S(r)}),l}),{getDataValue:u,emitSetData:f}=m.useRendererData();setTimeout(()=>{t.defaultModelValue!==void 0&&t.prop&&(u==null?void 0:u(t.prop))===void 0&&(f==null||f({k:t.prop,v:t.defaultModelValue}))});const p=l=>{d.value=(l==null?void 0:l.$el)??l,typeof t.elRef=="function"&&t.elRef(l)};return()=>e.h(j,{...i.value,"label-position":T.value,elRef:p,class:{"is-readonly":n.value,"vkf-form-item--inline":t.inline,"is-empty-label":!t.label,"is-information":t.information},size:t.formItemSize,rules:g.value,formItemTip:t.formItemTip,formItemTipClass:t.formItemTipClass,labelTip:t.labelTip,label:t.label},{...o,...t.formItemSlots})}}),N=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfFormItem=k;exports._VkfFormItemCtx=R;exports.__VkfFormItem=N;exports.default=k;