@vunk/form 2.19.20 → 2.19.22

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 (197) hide show
  1. package/components/ai-provider/index.cjs +1 -0
  2. package/components/ai-provider/index.d.ts +7 -0
  3. package/components/ai-provider/index.mjs +61 -0
  4. package/components/ai-provider/src/ctx.d.ts +8 -0
  5. package/components/ai-provider/src/index.vue.d.ts +23 -0
  6. package/components/ai-provider/src/types.d.ts +56 -0
  7. package/components/ai-provider/src/use.d.ts +3 -0
  8. package/components/api-tables-select/index.cjs +1 -1
  9. package/components/api-tables-select/index.mjs +1 -1
  10. package/components/api-tables-select/src/ctx.d.ts +57 -57
  11. package/components/api-tables-select/src/index.vue.d.ts +46 -419
  12. package/components/button/index.cjs +1 -1
  13. package/components/button/index.mjs +12 -12
  14. package/components/button/src/ctx.d.ts +7 -2
  15. package/components/button/src/index.vue.d.ts +36 -14
  16. package/components/card-input-collection/index.cjs +1 -1
  17. package/components/card-input-collection/index.mjs +136 -141
  18. package/components/card-input-collection/src/core.vue.d.ts +18 -7
  19. package/components/card-input-collection/src/ctx.d.ts +7 -2
  20. package/components/card-input-collection/src/index.vue.d.ts +18 -7
  21. package/components/cascader/index.cjs +1 -1
  22. package/components/cascader/index.mjs +38 -39
  23. package/components/cascader/src/ctx.d.ts +8 -3
  24. package/components/cascader/src/index.vue.d.ts +19 -8
  25. package/components/checkbox/src/ctx.d.ts +8 -3
  26. package/components/checkbox/src/index.vue.d.ts +43 -21
  27. package/components/{cloneDeep-DE0l40hv.mjs → cloneDeep-2YeQ7w2t.mjs} +10 -10
  28. package/components/cloneDeep-Btpy0oPF.js +1 -0
  29. package/components/collapse/index.cjs +1 -1
  30. package/components/collapse/index.mjs +19 -22
  31. package/components/collapse-item/index.cjs +1 -1
  32. package/components/collapse-item/index.mjs +21 -21
  33. package/components/collapse-item/src/index.vue.d.ts +2 -2
  34. package/components/color-picker/index.cjs +1 -1
  35. package/components/color-picker/index.mjs +26 -27
  36. package/components/color-picker/src/ctx.d.ts +7 -2
  37. package/components/color-picker/src/index.vue.d.ts +17 -6
  38. package/components/{style.css → components.css} +1 -1
  39. package/components/date-picker/index.cjs +1 -1
  40. package/components/date-picker/index.mjs +40 -41
  41. package/components/date-picker/src/ctx.d.ts +8 -3
  42. package/components/date-picker/src/index.vue.d.ts +17 -6
  43. package/components/date-picker-range/index.cjs +1 -1
  44. package/components/date-picker-range/index.mjs +17 -17
  45. package/components/date-picker-range/src/ctx.d.ts +14 -9
  46. package/components/date-picker-range/src/index.vue.d.ts +48 -26
  47. package/components/dialog/index.cjs +1 -1
  48. package/components/dialog/index.mjs +41 -52
  49. package/components/dialog/src/ctx.d.ts +1 -1
  50. package/components/dialog/src/index.vue.d.ts +1 -1
  51. package/components/dialog-input-collection/index.cjs +1 -1
  52. package/components/dialog-input-collection/index.mjs +124 -122
  53. package/components/dialog-input-collection/src/ctx.d.ts +7 -2
  54. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +1 -1
  55. package/components/dialog-input-collection/src/index.vue.d.ts +17 -6
  56. package/components/download-plus/index.cjs +1 -1
  57. package/components/download-plus/index.mjs +193 -202
  58. package/components/download-plus/src/ctx.d.ts +7 -2
  59. package/components/download-plus/src/index.vue.d.ts +32 -10
  60. package/components/editable-text/index.cjs +1 -1
  61. package/components/editable-text/index.mjs +72 -75
  62. package/components/editable-text/src/ctx.d.ts +7 -2
  63. package/components/editable-text/src/index.vue.d.ts +18 -7
  64. package/components/el-slider/index.cjs +1 -1
  65. package/components/el-slider/index.mjs +230 -233
  66. package/components/el-slider/src/composables/index.cjs +1 -1
  67. package/components/el-slider/src/composables/index.mjs +1 -1
  68. package/components/el-slider/src/slider-core.vue.d.ts +3 -3
  69. package/components/esri-input-geojson/index.cjs +1 -5
  70. package/components/esri-input-geojson/index.mjs +59 -68
  71. package/components/esri-input-geojson/src/append.vue.d.ts +2 -2
  72. package/components/esri-input-geojson/src/ctx.d.ts +9 -4
  73. package/components/esri-input-geojson/src/index.vue.d.ts +65 -30
  74. package/components/fieldset/src/index.vue.d.ts +1 -1
  75. package/components/form/index.cjs +1 -1
  76. package/components/form/index.mjs +96 -101
  77. package/components/form/src/ctx.d.ts +2 -2
  78. package/components/form/src/index.vue.d.ts +4 -4
  79. package/components/form/src/use.d.ts +2 -2
  80. package/components/form-item/index.cjs +1 -1
  81. package/components/form-item/index.mjs +179 -107
  82. package/components/form-item/src/core.vue.d.ts +7 -3
  83. package/components/form-item/src/ctx.d.ts +7 -1
  84. package/components/form-item/src/index.vue.d.ts +13 -2
  85. package/components/form-item/src/use.d.ts +11 -0
  86. package/components/form-item-renderer/index.cjs +1 -1
  87. package/components/form-item-renderer/index.d.ts +1 -0
  88. package/components/form-item-renderer/index.mjs +85 -78
  89. package/components/form-item-renderer/src/use.d.ts +3 -0
  90. package/components/forms-provider/index.cjs +1 -1
  91. package/components/forms-provider/index.mjs +18 -21
  92. package/components/index-BIo_4rr_.mjs +18620 -0
  93. package/components/index-Bc7UifHG.js +1 -0
  94. package/components/index-D0D9ABpH.js +108 -0
  95. package/components/{index-CeHbpfCD.mjs → index-DCNYT7Wv.mjs} +0 -1
  96. package/components/information-collection/index.cjs +1 -1
  97. package/components/information-collection/index.mjs +32 -38
  98. package/components/information-collection/src/ctx.d.ts +7 -2
  99. package/components/information-collection/src/index.vue.d.ts +17 -6
  100. package/components/information-tag/index.cjs +1 -1
  101. package/components/information-tag/index.mjs +9 -12
  102. package/components/information-tag/src/index.vue.d.ts +1 -1
  103. package/components/input/index.cjs +1 -1
  104. package/components/input/index.mjs +27 -27
  105. package/components/input/src/ctx.d.ts +9 -4
  106. package/components/input/src/index.vue.d.ts +35 -13
  107. package/components/input-array/index.cjs +1 -1
  108. package/components/input-array/index.mjs +71 -74
  109. package/components/input-array/src/ctx.d.ts +7 -2
  110. package/components/input-array/src/index.vue.d.ts +18 -7
  111. package/components/input-collection/index.cjs +1 -1
  112. package/components/input-collection/index.mjs +121 -126
  113. package/components/input-collection/src/core.vue.d.ts +17 -6
  114. package/components/input-collection/src/ctx.d.ts +7 -2
  115. package/components/input-collection/src/index.vue.d.ts +17 -6
  116. package/components/input-file/src/index.vue.d.ts +19 -8
  117. package/components/input-link/index.cjs +1 -1
  118. package/components/input-link/index.mjs +1 -1
  119. package/components/input-link/src/ctx.d.ts +7 -2
  120. package/components/input-link/src/index.vue.d.ts +54 -21
  121. package/components/input-number/index.cjs +1 -1
  122. package/components/input-number/index.mjs +30 -33
  123. package/components/input-number/src/ctx.d.ts +8 -3
  124. package/components/input-number/src/index.vue.d.ts +33 -11
  125. package/components/input-tag/index.cjs +1 -1
  126. package/components/input-tag/index.mjs +24 -24
  127. package/components/input-tag/src/ctx.d.ts +9 -4
  128. package/components/input-tag/src/index.vue.d.ts +33 -11
  129. package/components/monaco-editor/src/ctx.d.ts +8 -3
  130. package/components/monaco-editor/src/index.vue.d.ts +38 -16
  131. package/components/radio/src/ctx.d.ts +7 -2
  132. package/components/radio/src/index.vue.d.ts +40 -18
  133. package/components/radio/src/wraper.vue.d.ts +22 -11
  134. package/components/renderer-data/index.cjs +1 -1
  135. package/components/renderer-data/index.mjs +14 -17
  136. package/components/select/index.cjs +1 -1
  137. package/components/select/index.mjs +167 -131
  138. package/components/select/src/core.vue.d.ts +96 -69
  139. package/components/select/src/ctx.d.ts +9 -4
  140. package/components/select/src/index.vue.d.ts +53 -42
  141. package/components/slider/index.cjs +1 -1
  142. package/components/slider/index.mjs +30 -31
  143. package/components/slider/src/ctx.d.ts +7 -2
  144. package/components/slider/src/index.vue.d.ts +18 -7
  145. package/components/switch/src/ctx.d.ts +7 -2
  146. package/components/switch/src/index.vue.d.ts +18 -7
  147. package/components/tables-select/index.cjs +1 -1
  148. package/components/tables-select/index.mjs +4 -4
  149. package/components/tables-select/src/ctx.d.ts +68 -68
  150. package/components/tables-select/src/index.vue.d.ts +52 -420
  151. package/components/template-instances-provider/index.cjs +1 -1
  152. package/components/template-instances-provider/index.mjs +11 -17
  153. package/components/templates-default/src/index.vue.d.ts +404 -185
  154. package/components/templates-esri/src/index.vue.d.ts +65 -30
  155. package/components/templates-variant/src/index.vue.d.ts +48 -26
  156. package/components/time-picker/index.cjs +1 -1
  157. package/components/time-picker/index.mjs +38 -39
  158. package/components/time-picker/src/ctx.d.ts +8 -3
  159. package/components/time-picker/src/index.vue.d.ts +17 -6
  160. package/components/upload/index.cjs +1 -1
  161. package/components/upload/index.mjs +244 -253
  162. package/components/upload/src/ctx.d.ts +8 -3
  163. package/components/upload/src/file.vue.d.ts +3 -3
  164. package/components/upload/src/index.vue.d.ts +37 -15
  165. package/components/upload/src/wraper.vue.d.ts +19 -8
  166. package/components/upload-plus/index.cjs +7 -15
  167. package/components/upload-plus/index.mjs +1879 -1897
  168. package/components/upload-plus/src/ctx.d.ts +7 -2
  169. package/components/upload-plus/src/index.vue.d.ts +18 -7
  170. package/components/use-watch-C3iIa2DX.js +1 -0
  171. package/components/use-watch-Dp64x0si.mjs +411 -0
  172. package/components/van-cascader/src/ctx.d.ts +7 -2
  173. package/components/van-cascader/src/index.vue.d.ts +19 -8
  174. package/components/var-datetime-picker/src/ctx.d.ts +7 -2
  175. package/components/var-datetime-picker/src/index.vue.d.ts +30 -8
  176. package/components/vditor/src/ctx.d.ts +7 -2
  177. package/components/vditor/src/index.vue.d.ts +41 -19
  178. package/composables/element-plus/index.cjs +1 -1
  179. package/composables/element-plus/index.mjs +10 -10
  180. package/composables/form-mitt/index.mjs +1 -1
  181. package/composables/index.cjs +1 -1
  182. package/composables/index.mjs +53 -53
  183. package/index.css +1 -1
  184. package/locale/index.cjs +1 -1
  185. package/locale/index.mjs +8 -5
  186. package/locale/lang/ar.d.ts +1 -0
  187. package/locale/lang/en.d.ts +1 -0
  188. package/locale/lang/zh-cn.d.ts +1 -0
  189. package/package.json +9 -1
  190. package/shared/element-plus/ctx.d.ts +16 -16
  191. package/shared/types/source/index.d.ts +5 -0
  192. package/shared/upload/index.cjs +1 -1
  193. package/shared/upload/index.mjs +166 -165
  194. package/components/cloneDeep-DaYwfXwD.js +0 -1
  195. package/components/index-BBriTmQP.js +0 -1
  196. package/components/use-watch-Bfrz9pv_.js +0 -1
  197. package/components/use-watch-t49wP7jy.mjs +0 -414
@@ -1,9 +1,9 @@
1
- import { defineComponent as R, computed as $, h as z, nextTick as B, openBlock as K, createBlock as M, unref as N, withCtx as c, createVNode as q, normalizeProps as w, guardReactiveProps as E, renderSlot as b } from "vue";
2
- import { VkfTemplateInstancesProvider as G } from "@vunk/form/components/template-instances-provider";
3
- import { genTemplateIfFunc as H } from "@vunk/form/shared/form";
4
- import { useTemplateInstancesContext as J, useRendererData as L } from "@vunk/form/composables";
5
- import { noop as Q, isCallable as F } from "@vunk/shared/function";
6
- const V = {
1
+ import { inject as g, provide as C, defineComponent as _, computed as K, h as O, nextTick as $, openBlock as z, createBlock as B, unref as E, withCtx as u, createVNode as M, normalizeProps as N, guardReactiveProps as q, renderSlot as v } from "vue";
2
+ import { VkfTemplateInstancesProvider as w } from "@vunk/form/components/template-instances-provider";
3
+ import { genTemplateIfFunc as G } from "@vunk/form/shared/form";
4
+ import { useTemplateInstancesContext as H, useRendererData as J } from "@vunk/form/composables";
5
+ import { noop as L, isCallable as S } from "@vunk/shared/function";
6
+ const h = {
7
7
  source: {
8
8
  type: Array,
9
9
  default: () => []
@@ -17,99 +17,104 @@ const V = {
17
17
  type: Array,
18
18
  default: () => []
19
19
  }
20
- }, U = (o) => {
21
- if (o)
22
- return typeof o == "function" ? o : typeof o == "string" ? new Function("value", "context", o) : Q;
23
- }, h = R({
20
+ }, Q = (t) => {
21
+ if (t)
22
+ return typeof t == "function" ? t : typeof t == "string" ? new Function("value", "context", t) : L;
23
+ }, i = /* @__PURE__ */ Symbol("vkfAiSchemaKey");
24
+ function U(t) {
25
+ const o = g(i, null);
26
+ return o || (C(i, t), t);
27
+ }
28
+ function re() {
29
+ return g(i, null);
30
+ }
31
+ const V = _({
24
32
  name: "VkfFormItemRenderer",
25
- props: V,
26
- setup(o, l) {
27
- const { templateInstances: n, getTemplateInstance: s } = J(), {
28
- emitSetData: a,
29
- data: r,
30
- getDataValue: m
31
- } = L(), j = (u) => z(h, {
33
+ props: h,
34
+ setup(t, o) {
35
+ U(t.source);
36
+ const { templateInstances: n, getTemplateInstance: p } = H(), {
37
+ emitSetData: f,
38
+ data: a,
39
+ getDataValue: c
40
+ } = J(), b = (l) => O(V, {
32
41
  templateInstances: n,
33
- ...u
34
- }), A = (u, f = []) => u.reduce((p, e, S) => {
35
- var P, T, I;
42
+ ...l
43
+ }), A = (l, F = []) => l.reduce((m, e, R) => {
36
44
  e.key = e.key ?? (Array.isArray(e.prop) ? e.prop.join() : e.prop);
37
- const y = [...o.k, ...f, S], x = () => {
38
- B(() => {
39
- e.templateType && !s(e.templateType) && console.warn(
45
+ const d = [...t.k, ...F, R], j = () => {
46
+ $(() => {
47
+ e.templateType && !p(e.templateType) && console.warn(
40
48
  e.templateType,
41
49
  "templateType不存在将跳过"
42
50
  );
43
51
  });
44
52
  };
45
- if (e.templateType && s(e.templateType)) {
46
- const t = { ...e };
53
+ if (e.templateType && p(e.templateType)) {
54
+ const r = { ...e };
47
55
  Object.assign(
48
- t,
49
- F(e.templateProps) ? e.templateProps(r == null ? void 0 : r.value) : e.templateProps
56
+ r,
57
+ S(e.templateProps) ? e.templateProps(a?.value) : e.templateProps
50
58
  );
51
- const k = H(
52
- t.templateIf
59
+ const y = G(
60
+ r.templateIf
53
61
  );
54
- if (!(r ? k(r.value) : !0)) return p;
55
- const C = F(t.informationProps) ? t.informationProps(r == null ? void 0 : r.value) : t.informationProps, i = U(t.inputEffect);
56
- Reflect.deleteProperty(t, "templateType"), Reflect.deleteProperty(t, "templateIf"), Reflect.deleteProperty(t, "templateProps"), Reflect.deleteProperty(t, "informationProps"), Reflect.deleteProperty(t, "inputEffect");
57
- const O = y.join(",") + "-" + e.templateType + "-" + (e.prop || "no-prop"), v = $({
58
- get: () => e.prop && (m == null ? void 0 : m(e.prop)),
59
- set: (d) => a == null ? void 0 : a({
62
+ if (!(a ? y(a.value) : !0)) return m;
63
+ const D = S(r.informationProps) ? r.informationProps(a?.value) : r.informationProps, P = Q(r.inputEffect);
64
+ Reflect.deleteProperty(r, "templateType"), Reflect.deleteProperty(r, "templateIf"), Reflect.deleteProperty(r, "templateProps"), Reflect.deleteProperty(r, "informationProps"), Reflect.deleteProperty(r, "inputEffect");
65
+ const x = d.join(",") + "-" + e.templateType + "-" + (e.prop || "no-prop"), T = K({
66
+ get: () => e.prop && c?.(e.prop),
67
+ set: (s) => f?.({
60
68
  k: e.prop,
61
- v: d
69
+ v: s
62
70
  })
63
- }), _ = {
71
+ }), k = {
64
72
  // for legacy
65
- data: t,
73
+ data: r,
66
74
  raw: e,
67
- props: t,
68
- k: y,
69
- key: O,
70
- value: v.value,
71
- input: (d) => {
72
- v.value = d, i == null || i(d, {
73
- ..._,
75
+ props: r,
76
+ k: d,
77
+ key: x,
78
+ value: T.value,
79
+ input: (s) => {
80
+ T.value = s, P?.(s, {
81
+ ...k,
74
82
  parentProp: [e.prop].flat(1 / 0).slice(0, -1)
75
83
  });
76
84
  },
77
- informationProps: C,
78
- templateIf: k,
79
- Renderer: j,
80
- getDataValue: m,
81
- emitSetData: a,
82
- inputEffect: i
83
- }, g = (I = (P = s(e.templateType)) == null ? void 0 : (T = P.slots).default) == null ? void 0 : I.call(T, _);
84
- g && p.push(g);
85
+ informationProps: D,
86
+ templateIf: y,
87
+ Renderer: b,
88
+ getDataValue: c,
89
+ emitSetData: f,
90
+ inputEffect: P
91
+ }, I = p(e.templateType)?.slots.default?.(k);
92
+ I && m.push(I);
85
93
  } else
86
- x();
87
- return p;
94
+ j();
95
+ return m;
88
96
  }, []);
89
- return () => {
90
- var f, p;
91
- return [
92
- (p = (f = l.slots).default) == null ? void 0 : p.call(f),
93
- A(o.source)
94
- ];
95
- };
97
+ return () => [
98
+ o.slots.default?.(),
99
+ A(t.source)
100
+ ];
96
101
  }
97
- }), te = /* @__PURE__ */ R({
102
+ }), oe = /* @__PURE__ */ _({
98
103
  __name: "index",
99
- props: V,
100
- setup(o) {
101
- const l = o;
102
- return (n, s) => (K(), M(N(G), null, {
103
- placeholder: c(() => [
104
- b(n.$slots, "placeholder")
104
+ props: h,
105
+ setup(t) {
106
+ const o = t;
107
+ return (n, p) => (z(), B(E(w), null, {
108
+ placeholder: u(() => [
109
+ v(n.$slots, "placeholder")
105
110
  ]),
106
- default: c(() => [
107
- q(h, w(E({
108
- ...l,
111
+ default: u(() => [
112
+ M(V, N(q({
113
+ ...o,
109
114
  ...n.$attrs
110
115
  })), {
111
- default: c(() => [
112
- b(n.$slots, "default")
116
+ default: u(() => [
117
+ v(n.$slots, "default")
113
118
  ]),
114
119
  _: 3
115
120
  }, 16)
@@ -117,11 +122,13 @@ const V = {
117
122
  _: 3
118
123
  }));
119
124
  }
120
- }), oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
125
+ }), ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
121
126
  __proto__: null
122
127
  }, Symbol.toStringTag, { value: "Module" }));
123
128
  export {
124
- te as VkfFormItemRenderer,
125
- oe as __VkfFormItemRenderer,
126
- te as default
129
+ oe as VkfFormItemRenderer,
130
+ ne as __VkfFormItemRenderer,
131
+ oe as default,
132
+ U as initAiSchema,
133
+ re as useAiSchema
127
134
  };
@@ -0,0 +1,3 @@
1
+ import type { NormalObject } from '@vunk/shared';
2
+ export declare function initAiSchema(source: NormalObject[]): NormalObject[];
3
+ export declare function useAiSchema(): NormalObject[] | null;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@vunk/core/components/segment-renderer"),t=require("vue"),i=require("element-plus"),{SegmentRenderer:m,Segment:d,SegmentView:g,useSegmentRendererContext:a}=c.createSegmentRenderer("@vunk/form:provider");m.name="VkfFormsProvider";const f=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),_=t.defineComponent({name:"VkfFormsSegment",inheritAttrs:!1,__name:"segment",setup(l){function s(){try{return a()}catch{return null}}const u=s(),r=t.inject(i.formContextKey),n=async e=>r.validateField(void 0,e);return(e,o)=>t.unref(u)?(t.openBlock(),t.createBlock(t.unref(d),t.mergeProps({key:0,validate:n,form:t.unref(r)},e.$attrs),null,16,["form"])):t.renderSlot(e.$slots,"default",{key:1})}}),p=t.defineComponent({__name:"view",setup(l,{expose:s}){const u=a(),r=t.computed(()=>u.items.map(e=>e.attrs));async function n(){return Promise.all(r.value.map(e=>{var o;return(o=e.validate)==null?void 0:o.call(e)}))}return s({forms:r,validate:n}),(e,o)=>t.renderSlot(e.$slots,"default",{forms:r.value,validate:n})}});exports.VkfFormsProvider=m;exports.VkfFormsSegment=_;exports.VkfFormsView=p;exports.__VkfFormsProvider=f;exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@vunk/core/components/segment-renderer"),e=require("vue"),i=require("element-plus"),{SegmentRenderer:m,Segment:d,SegmentView:g,useSegmentRendererContext:u}=c.createSegmentRenderer("@vunk/form:provider");m.name="VkfFormsProvider";const f=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),_=e.defineComponent({name:"VkfFormsSegment",inheritAttrs:!1,__name:"segment",setup(a){function o(){try{return u()}catch{return null}}const s=o(),r=e.inject(i.formContextKey),n=async t=>r.validateField(void 0,t);return(t,l)=>e.unref(s)?(e.openBlock(),e.createBlock(e.unref(d),e.mergeProps({key:0,validate:n,form:e.unref(r)},t.$attrs),null,16,["form"])):e.renderSlot(t.$slots,"default",{key:1})}}),p=e.defineComponent({__name:"view",setup(a,{expose:o}){const s=u(),r=e.computed(()=>s.items.map(t=>t.attrs));async function n(){return Promise.all(r.value.map(t=>t.validate?.()))}return o({forms:r,validate:n}),(t,l)=>e.renderSlot(t.$slots,"default",{forms:r.value,validate:n})}});exports.VkfFormsProvider=m;exports.VkfFormsSegment=_;exports.VkfFormsView=p;exports.__VkfFormsProvider=f;exports.default=m;
@@ -1,53 +1,50 @@
1
- import { createSegmentRenderer as u } from "@vunk/core/components/segment-renderer";
2
- import { defineComponent as a, inject as d, unref as m, openBlock as f, createBlock as p, mergeProps as _, renderSlot as c, computed as g } from "vue";
1
+ import { createSegmentRenderer as l } from "@vunk/core/components/segment-renderer";
2
+ import { defineComponent as m, inject as u, unref as s, openBlock as d, createBlock as p, mergeProps as _, renderSlot as a, computed as g } from "vue";
3
3
  import { formContextKey as v } from "element-plus";
4
4
  const {
5
5
  SegmentRenderer: k,
6
6
  Segment: S,
7
7
  SegmentView: C,
8
- useSegmentRendererContext: i
9
- } = u("@vunk/form:provider");
8
+ useSegmentRendererContext: c
9
+ } = l("@vunk/form:provider");
10
10
  k.name = "VkfFormsProvider";
11
11
  const F = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12
12
  __proto__: null
13
- }, Symbol.toStringTag, { value: "Module" })), P = /* @__PURE__ */ a({
13
+ }, Symbol.toStringTag, { value: "Module" })), P = /* @__PURE__ */ m({
14
14
  name: "VkfFormsSegment",
15
15
  inheritAttrs: !1,
16
16
  __name: "segment",
17
- setup(l) {
18
- function o() {
17
+ setup(f) {
18
+ function n() {
19
19
  try {
20
- return i();
20
+ return c();
21
21
  } catch {
22
22
  return null;
23
23
  }
24
24
  }
25
- const s = o(), t = d(v), r = async (e) => t.validateField(
25
+ const o = n(), t = u(v), r = async (e) => t.validateField(
26
26
  void 0,
27
27
  e
28
28
  );
29
- return (e, n) => m(s) ? (f(), p(m(S), _({
29
+ return (e, i) => s(o) ? (d(), p(s(S), _({
30
30
  key: 0,
31
31
  validate: r,
32
- form: m(t)
33
- }, e.$attrs), null, 16, ["form"])) : c(e.$slots, "default", { key: 1 });
32
+ form: s(t)
33
+ }, e.$attrs), null, 16, ["form"])) : a(e.$slots, "default", { key: 1 });
34
34
  }
35
- }), R = /* @__PURE__ */ a({
35
+ }), R = /* @__PURE__ */ m({
36
36
  __name: "view",
37
- setup(l, { expose: o }) {
38
- const s = i(), t = g(() => s.items.map((e) => e.attrs));
37
+ setup(f, { expose: n }) {
38
+ const o = c(), t = g(() => o.items.map((e) => e.attrs));
39
39
  async function r() {
40
40
  return Promise.all(
41
- t.value.map((e) => {
42
- var n;
43
- return (n = e.validate) == null ? void 0 : n.call(e);
44
- })
41
+ t.value.map((e) => e.validate?.())
45
42
  );
46
43
  }
47
- return o({
44
+ return n({
48
45
  forms: t,
49
46
  validate: r
50
- }), (e, n) => c(e.$slots, "default", {
47
+ }), (e, i) => a(e.$slots, "default", {
51
48
  forms: t.value,
52
49
  validate: r
53
50
  });