@effect-app/vue-components 1.8.26 → 1.9.1

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 (62) hide show
  1. package/dist/types/components/CommandButton.vue.d.ts +38 -0
  2. package/dist/types/components/OmegaForm/OmegaArray.vue.d.ts +1 -1
  3. package/dist/types/components/index.d.ts +1 -0
  4. package/dist/vue-components.es.js +22 -20
  5. package/dist/vue-components.es10.js +338 -30
  6. package/dist/vue-components.es11.js +34 -2
  7. package/dist/vue-components.es12.js +2 -10
  8. package/dist/vue-components.es13.js +2 -5
  9. package/dist/vue-components.es14.js +10 -54
  10. package/dist/vue-components.es15.js +5 -68
  11. package/dist/vue-components.es16.js +54 -6
  12. package/dist/vue-components.es17.js +68 -6
  13. package/dist/vue-components.es18.js +6 -3
  14. package/dist/vue-components.es19.js +6 -3
  15. package/dist/vue-components.es2.js +20 -18
  16. package/dist/vue-components.es20.js +3 -2
  17. package/dist/vue-components.es21.js +3 -2
  18. package/dist/vue-components.es22.js +2 -17
  19. package/dist/vue-components.es23.js +2 -11
  20. package/dist/vue-components.es24.js +17 -42
  21. package/dist/vue-components.es25.js +11 -2
  22. package/dist/vue-components.es26.js +42 -2
  23. package/dist/vue-components.es27.js +2 -89
  24. package/dist/vue-components.es28.js +4 -0
  25. package/dist/vue-components.es29.js +89 -7
  26. package/dist/vue-components.es31.js +9 -0
  27. package/dist/vue-components.es32.js +25 -130
  28. package/dist/vue-components.es34.js +136 -23
  29. package/dist/vue-components.es36.js +11 -21
  30. package/dist/vue-components.es37.js +4 -30
  31. package/dist/vue-components.es38.js +20 -19
  32. package/dist/vue-components.es39.js +5 -12
  33. package/dist/vue-components.es4.js +43 -43
  34. package/dist/vue-components.es40.js +21 -5
  35. package/dist/vue-components.es41.js +29 -18
  36. package/dist/vue-components.es42.js +22 -9
  37. package/dist/vue-components.es43.js +7 -26
  38. package/dist/vue-components.es44.js +5 -48
  39. package/dist/vue-components.es45.js +19 -26
  40. package/dist/vue-components.es46.js +9 -11
  41. package/dist/vue-components.es47.js +31 -4
  42. package/dist/vue-components.es48.js +37 -54
  43. package/dist/vue-components.es49.js +21 -51
  44. package/dist/vue-components.es5.js +45 -46
  45. package/dist/vue-components.es50.js +64 -16
  46. package/dist/vue-components.es51.js +54 -31
  47. package/dist/vue-components.es52.js +16 -28
  48. package/dist/vue-components.es53.js +32 -41
  49. package/dist/vue-components.es54.js +29 -2
  50. package/dist/vue-components.es55.js +41 -43
  51. package/dist/vue-components.es56.js +2 -2
  52. package/dist/vue-components.es57.js +46 -0
  53. package/dist/vue-components.es58.js +4 -0
  54. package/dist/vue-components.es6.js +40 -63
  55. package/dist/vue-components.es7.js +69 -197
  56. package/dist/vue-components.es8.js +197 -28
  57. package/dist/vue-components.es9.js +29 -341
  58. package/package.json +5 -3
  59. package/src/components/CommandButton.vue +72 -0
  60. package/src/components/index.ts +1 -0
  61. package/dist/vue-components.es30.js +0 -33
  62. package/dist/vue-components.es35.js +0 -7
@@ -0,0 +1,38 @@
1
+ import type { CommandBase } from "@effect-app/vue";
2
+ import type { VBtn } from "vuetify/components";
3
+ export type VBtnProps = VBtn["$props"];
4
+ export interface ButtonProps extends /* @vue-ignore */ VBtnProps {
5
+ }
6
+ declare const __VLS_export: <I = never>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
7
+ props: __VLS_PrettifyLocal<({
8
+ input: NoInfer<I>;
9
+ command: CommandBase<I>;
10
+ empty?: boolean;
11
+ } | {
12
+ command: CommandBase;
13
+ input?: undefined;
14
+ empty?: boolean;
15
+ }) & {
16
+ disabled?: ButtonProps["disabled"];
17
+ title?: string;
18
+ } & ButtonProps> & import("vue").PublicProps;
19
+ expose: (exposed: {}) => void;
20
+ attrs: any;
21
+ slots: {
22
+ default?: (props: {
23
+ loading: boolean;
24
+ disabled: boolean | undefined;
25
+ label: string;
26
+ title: string;
27
+ }) => any;
28
+ };
29
+ emit: {};
30
+ }>) => import("vue").VNode & {
31
+ __ctx?: Awaited<typeof __VLS_setup>;
32
+ };
33
+ /** Command Button is an easy way to connect commands and have it execute on click, while keeping track of disabled/loading states automatically */
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ type __VLS_PrettifyLocal<T> = {
37
+ [K in keyof T as K]: T[K];
38
+ } & {};
@@ -1,7 +1,7 @@
1
1
  import { type DeepKeys, type DeepValue } from "@tanstack/vue-form";
2
2
  import { type OmegaInputProps } from "./OmegaFormStuff";
3
3
  declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
- props: __VLS_PrettifyLocal<Omit<OmegaInputProps<From, To>, "validators" | "options" | "label" | "type" | "items"> & {
4
+ props: __VLS_PrettifyLocal<Omit<OmegaInputProps<From, To>, "type" | "label" | "validators" | "options" | "items"> & {
5
5
  defaultItems?: DeepValue<From, DeepKeys<From>>;
6
6
  items?: "please use `defaultItems` instead";
7
7
  }> & import("vue").PublicProps;
@@ -1,2 +1,3 @@
1
+ export { default as CommandButton } from "./CommandButton.vue";
1
2
  export { default as Dialog } from "./Dialog.vue";
2
3
  export * from "./OmegaForm";
@@ -1,12 +1,13 @@
1
1
  import * as o from "./vue-components.es2.js";
2
- import { getTransformationFrom as f, provideIntl as s, useIntl as u, useIntlKey as l } from "./vue-components.es3.js";
2
+ import { getTransformationFrom as f, provideIntl as u, useIntl as s, useIntlKey as l } from "./vue-components.es3.js";
3
3
  import { default as i } from "./vue-components.es4.js";
4
4
  import { default as x } from "./vue-components.es5.js";
5
5
  import { default as g } from "./vue-components.es6.js";
6
- import { useOmegaForm as F } from "./vue-components.es7.js";
7
- import { useOnClose as h, usePreventClose as S } from "./vue-components.es8.js";
8
- import { createMeta as C, duplicateSchema as M, generateInputStandardSchemaFromFieldMeta as j, generateMetaFromSchema as v, getInputType as P, nullableInput as T } from "./vue-components.es9.js";
9
- import { createUseFormWithCustomInput as w } from "./vue-components.es10.js";
6
+ import { default as F } from "./vue-components.es7.js";
7
+ import { useOmegaForm as h } from "./vue-components.es8.js";
8
+ import { useOnClose as S, usePreventClose as b } from "./vue-components.es9.js";
9
+ import { createMeta as j, duplicateSchema as v, generateInputStandardSchemaFromFieldMeta as P, generateMetaFromSchema as T, getInputType as k, nullableInput as w } from "./vue-components.es10.js";
10
+ import { createUseFormWithCustomInput as D } from "./vue-components.es11.js";
10
11
  function a(r) {
11
12
  for (const e in o)
12
13
  if (Object.prototype.hasOwnProperty.call(o, e)) {
@@ -16,22 +17,23 @@ function a(r) {
16
17
  }
17
18
  const n = { install: a };
18
19
  export {
19
- i as Dialog,
20
- x as OmegaInput,
21
- g as OmegaVuetifyInput,
22
- C as createMeta,
23
- w as createUseFormWithCustomInput,
20
+ i as CommandButton,
21
+ x as Dialog,
22
+ g as OmegaInput,
23
+ F as OmegaVuetifyInput,
24
+ j as createMeta,
25
+ D as createUseFormWithCustomInput,
24
26
  n as default,
25
- M as duplicateSchema,
26
- j as generateInputStandardSchemaFromFieldMeta,
27
- v as generateMetaFromSchema,
28
- P as getInputType,
27
+ v as duplicateSchema,
28
+ P as generateInputStandardSchemaFromFieldMeta,
29
+ T as generateMetaFromSchema,
30
+ k as getInputType,
29
31
  f as getTransformationFrom,
30
- T as nullableInput,
31
- s as provideIntl,
32
- u as useIntl,
32
+ w as nullableInput,
33
+ u as provideIntl,
34
+ s as useIntl,
33
35
  l as useIntlKey,
34
- F as useOmegaForm,
35
- h as useOnClose,
36
- S as usePreventClose
36
+ h as useOmegaForm,
37
+ S as useOnClose,
38
+ b as usePreventClose
37
39
  };
@@ -1,36 +1,344 @@
1
- import { h as o } from "vue";
2
- import l from "./vue-components.es5.js";
3
- import { useOmegaForm as O } from "./vue-components.es7.js";
4
- const g = (n) => (...m) => {
5
- const [p, s, a] = m;
6
- return O(
7
- p,
8
- s,
9
- {
10
- ...a,
11
- input: {
12
- name: "WrappedInput",
13
- inheritAttrs: !1,
14
- setup(c, { attrs: t }) {
15
- return () => o(l, {
16
- ...c,
17
- ...t
18
- }, {
19
- // Override the default slot that OmegaInternalInput provides
20
- default: ({ field: f, state: i, ...r }) => {
21
- const u = Object.fromEntries(
22
- Object.entries(t).filter(
23
- ([e]) => !Object.prototype.hasOwnProperty.call(r, e) && e !== "form"
24
- )
25
- );
26
- return o(n, { ...u, field: f, state: i, inputProps: r });
1
+ import { S as n, Option as q } from "effect-app";
2
+ import { getMetadataFromSchema as M } from "@effect-app/vue/form";
3
+ import { useIntl as U, getTransformationFrom as _ } from "./vue-components.es3.js";
4
+ const w = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKeyword" || i === n.Null.ast), f = (e) => !e || !n.AST.isUnion(e) ? !1 : e.types.find((i) => i._tag === "UndefinedKeyword") ? "undefined" : e.types.find((i) => i === n.Null.ast) ? "null" : !1, u = ({ meta: e = {}, parent: i = "", property: t, propertySignatures: g }, o = {}) => {
5
+ if (t && t._tag === "Transformation")
6
+ return u({
7
+ parent: i,
8
+ meta: e,
9
+ property: t.from
10
+ });
11
+ if (t?._tag === "TypeLiteral" && "propertySignatures" in t)
12
+ return u({
13
+ meta: e,
14
+ propertySignatures: t.propertySignatures
15
+ });
16
+ if (g) {
17
+ for (const r of g) {
18
+ const p = i ? `${i}.${r.name.toString()}` : r.name.toString(), a = f(r.type), l = !a, O = r.type;
19
+ if (n.AST.isUnion(r.type)) {
20
+ const S = r.type.types.filter(
21
+ (s) => s._tag !== "UndefinedKeyword" && s !== n.Null.ast
22
+ ).map(_);
23
+ if (S.some(
24
+ (s) => "propertySignatures" in s
25
+ )) {
26
+ if (!a) {
27
+ const s = u({
28
+ parent: p,
29
+ property: r.type,
30
+ meta: { required: l, nullableOrUndefined: a }
31
+ });
32
+ o[p] = s;
33
+ }
34
+ for (const s of S)
35
+ "propertySignatures" in s && Object.assign(
36
+ o,
37
+ u({
38
+ parent: p,
39
+ propertySignatures: s.propertySignatures,
40
+ meta: { required: l, nullableOrUndefined: a }
41
+ })
42
+ );
43
+ } else {
44
+ const s = S.filter(n.AST.isTupleType);
45
+ if (s.length > 0) {
46
+ const y = s[0];
47
+ if (o[p] = {
48
+ type: "multiple",
49
+ members: y.elements,
50
+ rest: y.rest,
51
+ required: l,
52
+ nullableOrUndefined: a
53
+ }, y.rest && y.rest.length > 0) {
54
+ const d = y.rest[0];
55
+ if (d.type._tag === "TypeLiteral" && "propertySignatures" in d.type)
56
+ for (const m of d.type.propertySignatures) {
57
+ const T = `${p}.${m.name.toString()}`, c = u({
58
+ parent: T,
59
+ property: m.type,
60
+ meta: {
61
+ required: !f(m.type),
62
+ nullableOrUndefined: f(m.type)
63
+ }
64
+ });
65
+ if (c && typeof c == "object" && "type" in c && (o[T] = c, c.type === "multiple" && n.AST.isTupleType(m.type) && m.type.rest && m.type.rest.length > 0)) {
66
+ const v = m.type.rest[0];
67
+ if (v.type._tag === "TypeLiteral" && "propertySignatures" in v.type)
68
+ for (const h of v.type.propertySignatures) {
69
+ const L = `${T}.${h.name.toString()}`, x = u({
70
+ parent: L,
71
+ property: h.type,
72
+ meta: {
73
+ required: !f(h.type),
74
+ nullableOrUndefined: f(h.type)
75
+ }
76
+ });
77
+ x && typeof x == "object" && "type" in x && (o[L] = x);
78
+ }
79
+ }
80
+ }
27
81
  }
28
- });
82
+ } else {
83
+ const y = u({
84
+ parent: p,
85
+ property: r.type,
86
+ meta: { required: l, nullableOrUndefined: a }
87
+ });
88
+ o[p] = y;
89
+ }
29
90
  }
91
+ } else if ("propertySignatures" in O)
92
+ Object.assign(
93
+ o,
94
+ u({
95
+ parent: p,
96
+ propertySignatures: O.propertySignatures,
97
+ meta: { required: l, nullableOrUndefined: a }
98
+ })
99
+ );
100
+ else if (n.AST.isTupleType(r.type))
101
+ if (r.type.rest.length > 0 && r.type.rest[0].type._tag === "TypeLiteral" && "propertySignatures" in r.type.rest[0].type) {
102
+ const b = r.type.rest[0].type;
103
+ if (b._tag === "TypeLiteral" && "propertySignatures" in b)
104
+ for (const s of b.propertySignatures) {
105
+ const y = `${p}.${s.name.toString()}`;
106
+ if (n.AST.isTupleType(s.type) && s.type.rest.length > 0) {
107
+ const d = s.type.rest[0].type;
108
+ if (d._tag === "TypeLiteral" && "propertySignatures" in d)
109
+ for (const m of d.propertySignatures) {
110
+ const T = `${y}.${m.name.toString()}`, c = u({
111
+ parent: T,
112
+ property: m.type,
113
+ meta: {
114
+ required: !f(m.type),
115
+ nullableOrUndefined: f(m.type)
116
+ }
117
+ });
118
+ o[T] = c;
119
+ }
120
+ else
121
+ o[y] = {
122
+ type: "multiple",
123
+ members: s.type.elements,
124
+ rest: s.type.rest,
125
+ required: !f(s.type),
126
+ nullableOrUndefined: f(s.type)
127
+ };
128
+ } else {
129
+ const d = u({
130
+ parent: y,
131
+ property: s.type,
132
+ meta: {
133
+ required: !f(s.type),
134
+ nullableOrUndefined: f(s.type)
135
+ }
136
+ });
137
+ o[y] = d;
138
+ }
139
+ }
140
+ } else
141
+ o[p] = {
142
+ type: "multiple",
143
+ members: r.type.elements,
144
+ rest: r.type.rest,
145
+ required: l,
146
+ nullableOrUndefined: a
147
+ };
148
+ else {
149
+ const S = u({
150
+ parent: p,
151
+ property: r.type,
152
+ meta: {
153
+ // an empty string is valid for a S.String field, so we should not mark it as required
154
+ // TODO: handle this better via the createMeta minLength parsing
155
+ required: l && (r.type._tag !== "StringKeyword" || M(r.type).minLength),
156
+ nullableOrUndefined: a
157
+ }
158
+ });
159
+ o[p] = S;
30
160
  }
31
161
  }
32
- );
33
- };
162
+ return o;
163
+ }
164
+ if (t) {
165
+ const r = w(t);
166
+ if (Object.hasOwnProperty.call(e, "required") || (e.required = !r), n.AST.isUnion(t)) {
167
+ const a = t.types.find(
168
+ (l) => l._tag !== "UndefinedKeyword" && l !== n.Null.ast
169
+ );
170
+ return "propertySignatures" in a ? u({
171
+ propertySignatures: a.propertySignatures,
172
+ parent: i,
173
+ meta: e
174
+ }) : t.types.every(n.AST.isLiteral) ? {
175
+ ...e,
176
+ type: "select",
177
+ members: t.types.map((l) => l.literal)
178
+ } : {
179
+ ...e,
180
+ ...u({
181
+ parent: i,
182
+ meta: e,
183
+ property: a
184
+ })
185
+ };
186
+ }
187
+ if (n.AST.isTupleType(t))
188
+ return {
189
+ ...e,
190
+ type: "multiple",
191
+ members: t.elements,
192
+ rest: t.rest
193
+ };
194
+ const p = n.AST.getAnnotation(
195
+ t,
196
+ n.AST.JSONSchemaAnnotationId
197
+ ).pipe(q.getOrElse(() => ({})));
198
+ return e = { ...e, ...p }, "from" in t ? u({
199
+ parent: i,
200
+ meta: e,
201
+ property: t.from
202
+ }) : (e.type = n.AST.getAnnotation(
203
+ t,
204
+ n.AST.TitleAnnotationId
205
+ ).pipe(
206
+ q.getOrElse(() => "unknown")
207
+ ), e);
208
+ }
209
+ return o;
210
+ }, A = (e) => {
211
+ const i = e.ast, t = {};
212
+ if (i._tag === "Transformation" || i._tag === "Refinement")
213
+ return A(n.make(i.from));
214
+ if ("propertySignatures" in i) {
215
+ const g = u({
216
+ propertySignatures: i.propertySignatures
217
+ });
218
+ if (Object.values(g).every((r) => r && "type" in r))
219
+ return g;
220
+ const o = (r, p = "") => {
221
+ for (const a in r) {
222
+ const l = p ? `${p}.${a}` : a;
223
+ r[a] && typeof r[a] == "object" && "type" in r[a] ? t[l] = r[a] : r[a] && typeof r[a] == "object" && o(r[a], l);
224
+ }
225
+ };
226
+ o(g);
227
+ }
228
+ return t;
229
+ }, K = (e) => n.extend(e, n.Struct({})), I = (e) => {
230
+ const i = A(e);
231
+ return { schema: e, meta: i };
232
+ }, P = (e) => {
233
+ const { trans: i } = U();
234
+ let t;
235
+ switch (e.type) {
236
+ case "string":
237
+ t = n.String.annotations({
238
+ message: () => i("validation.empty")
239
+ }), e.format === "email" && (t = n.compose(
240
+ t,
241
+ n.Email.annotations({
242
+ message: () => i("validation.email.invalid")
243
+ })
244
+ )), e.required && t.annotations({
245
+ message: () => i("validation.empty")
246
+ }), e.maxLength && (t = t.pipe(n.maxLength(e.maxLength)).annotations({
247
+ message: () => i("validation.string.maxLength", {
248
+ maxLength: e.maxLength
249
+ })
250
+ })), e.minLength && (t = t.pipe(n.minLength(e.minLength)).annotations({
251
+ message: () => i("validation.string.minLength", {
252
+ minLength: e.minLength
253
+ })
254
+ }));
255
+ break;
256
+ case "number":
257
+ t = n.Number.annotations({
258
+ message: () => i("validation.empty")
259
+ }), e.required && t.annotations({
260
+ message: () => i("validation.empty")
261
+ }), e.minimum && (t = t.pipe(n.greaterThanOrEqualTo(e.minimum)).annotations({
262
+ message: () => i("validation.number.min", {
263
+ minimum: e.minimum,
264
+ isExclusive: !0
265
+ })
266
+ })), e.maximum && (t = t.pipe(n.lessThanOrEqualTo(e.maximum)).annotations({
267
+ message: () => i("validation.number.max", {
268
+ maximum: e.maximum,
269
+ isExclusive: !0
270
+ })
271
+ })), e.exclusiveMinimum && (t = t.pipe(n.greaterThan(e.exclusiveMinimum)).annotations({
272
+ message: () => i("validation.number.min", {
273
+ minimum: e.exclusiveMinimum,
274
+ isExclusive: !1
275
+ })
276
+ })), e.exclusiveMaximum && (t = t.pipe(n.lessThan(e.exclusiveMaximum)).annotations({
277
+ message: () => i("validation.number.max", {
278
+ maximum: e.exclusiveMaximum,
279
+ isExclusive: !1
280
+ })
281
+ }));
282
+ break;
283
+ case "select":
284
+ t = n.Literal(...e.members).annotations({
285
+ message: () => ({
286
+ message: i("validation.not_a_valid", {
287
+ type: "select",
288
+ message: e.members.join(", ")
289
+ }),
290
+ override: !0
291
+ })
292
+ });
293
+ break;
294
+ case "multiple":
295
+ t = n.Array(n.String).annotations({
296
+ message: () => i("validation.not_a_valid", {
297
+ type: "multiple",
298
+ message: e.members.join(", ")
299
+ })
300
+ });
301
+ break;
302
+ case "boolean":
303
+ t = n.Boolean;
304
+ break;
305
+ // todo: switch must be exhaustive or have default case, otherwise falls through with schema undefined.
306
+ case "unknown":
307
+ t = n.Unknown;
308
+ break;
309
+ }
310
+ return e.required ? t.pipe(
311
+ n.annotations({
312
+ message: () => i("validation.empty")
313
+ })
314
+ ) : t = n.NullishOr(t), n.standardSchemaV1(t);
315
+ }, F = (e, i) => n.NullOr(e).pipe(
316
+ n.transform(n.typeSchema(e), {
317
+ decode: (t) => t ?? i(),
318
+ encode: (t) => t
319
+ })
320
+ ), E = [
321
+ "button",
322
+ "checkbox",
323
+ "color",
324
+ "date",
325
+ "email",
326
+ "number",
327
+ "password",
328
+ "radio",
329
+ "range",
330
+ "search",
331
+ "submit",
332
+ "tel",
333
+ "text",
334
+ "time",
335
+ "url"
336
+ ], j = (e) => E.includes(e) ? e : "text";
34
337
  export {
35
- g as createUseFormWithCustomInput
338
+ u as createMeta,
339
+ K as duplicateSchema,
340
+ P as generateInputStandardSchemaFromFieldMeta,
341
+ I as generateMetaFromSchema,
342
+ j as getInputType,
343
+ F as nullableInput
36
344
  };
@@ -1,4 +1,36 @@
1
- import f from "./vue-components.es4.js";
1
+ import { h as o } from "vue";
2
+ import l from "./vue-components.es6.js";
3
+ import { useOmegaForm as O } from "./vue-components.es8.js";
4
+ const g = (n) => (...m) => {
5
+ const [p, s, a] = m;
6
+ return O(
7
+ p,
8
+ s,
9
+ {
10
+ ...a,
11
+ input: {
12
+ name: "WrappedInput",
13
+ inheritAttrs: !1,
14
+ setup(c, { attrs: t }) {
15
+ return () => o(l, {
16
+ ...c,
17
+ ...t
18
+ }, {
19
+ // Override the default slot that OmegaInternalInput provides
20
+ default: ({ field: f, state: i, ...r }) => {
21
+ const u = Object.fromEntries(
22
+ Object.entries(t).filter(
23
+ ([e]) => !Object.prototype.hasOwnProperty.call(r, e) && e !== "form"
24
+ )
25
+ );
26
+ return o(n, { ...u, field: f, state: i, inputProps: r });
27
+ }
28
+ });
29
+ }
30
+ }
31
+ }
32
+ );
33
+ };
2
34
  export {
3
- f as default
35
+ g as createUseFormWithCustomInput
4
36
  };
@@ -1,12 +1,4 @@
1
- import { Exit as c, Runtime as u } from "effect";
2
- import { dual as n, isFunction as m } from "./vue-components.es24.js";
3
- const i = Symbol.for("clone-trait"), a = n(2, (e, t) => i in e ? e[i](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(e)));
4
- n(2, (e, t) => a(e, { ...e, ...m(t) ? t(e) : t }));
5
- const p = (e, t) => new Promise((o, s) => e.addObserver((r) => {
6
- c.isSuccess(r) ? o(r.value) : s(u.makeFiberFailure(r.cause));
7
- }));
1
+ import f from "./vue-components.es4.js";
8
2
  export {
9
- a as clone,
10
- i as cloneTrait,
11
- p as runtimeFiberAsPromise
3
+ f as default
12
4
  };
@@ -1,7 +1,4 @@
1
- import { isFunction as c } from "./vue-components.es24.js";
2
- const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
1
+ import f from "./vue-components.es5.js";
3
2
  export {
4
- s as isFunction,
5
- i as isObject,
6
- t as isRecordOrArray
3
+ f as default
7
4
  };
@@ -1,56 +1,12 @@
1
- import { defineComponent as F, computed as i, onMounted as M, provide as P, createBlock as c, openBlock as s, resolveDynamicComponent as p, withCtx as g, renderSlot as o, createElementBlock as k, normalizeProps as l, guardReactiveProps as u, Fragment as A, renderList as b, mergeProps as B } from "vue";
2
- const N = /* @__PURE__ */ F({
3
- inheritAttrs: !1,
4
- __name: "OmegaArray",
5
- props: {
6
- form: {},
7
- name: {},
8
- defaultItems: {},
9
- items: {}
10
- },
11
- setup(n) {
12
- const a = n, y = a.form.useStore((e) => e.values), d = i(() => {
13
- const e = a.name.replace(/\[/g, ".").replace(/\]/g, "");
14
- try {
15
- return e.split(".").reduce((r, t) => r && r[t], y.value);
16
- } catch (r) {
17
- return console.error(r), [];
18
- }
19
- });
20
- M(async () => {
21
- a.defaultItems && !d.value && a.form.setFieldValue(a.name, a.defaultItems);
22
- });
23
- const $ = i(() => (r) => {
24
- const t = r.replace(/\[\d+\]/g, "");
25
- return a.form.meta[t];
26
- });
27
- return P("getMetaFromArray", $), (e, r) => (s(), c(p(n.form.Field), { name: n.name }, {
28
- default: g(({ field: t, state: f }) => [
29
- o(e.$slots, "pre-array", l(u({ field: t, state: f }))),
30
- (s(!0), k(A, null, b(d.value, (C, m) => (s(), c(p(n.form.Field), {
31
- key: `${n.name}[${Number(m)}]`,
32
- name: (
33
- // eslint-disable-next-line
34
- `${n.name}[${Number(m)}]`
35
- )
36
- }, {
37
- default: g(({ field: v, state: h }) => [
38
- o(e.$slots, "default", B({ ref_for: !0 }, {
39
- subField: v,
40
- subState: h,
41
- index: Number(m),
42
- field: t
43
- }))
44
- ]),
45
- _: 2
46
- }, 1032, ["name"]))), 128)),
47
- o(e.$slots, "post-array", l(u({ field: t, state: f }))),
48
- o(e.$slots, "field", l(u({ field: t })))
49
- ]),
50
- _: 3
51
- }, 8, ["name"]));
52
- }
53
- });
1
+ import { Exit as c, Runtime as u } from "effect";
2
+ import { dual as n, isFunction as m } from "./vue-components.es26.js";
3
+ const i = Symbol.for("clone-trait"), a = n(2, (e, t) => i in e ? e[i](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(e)));
4
+ n(2, (e, t) => a(e, { ...e, ...m(t) ? t(e) : t }));
5
+ const p = (e, t) => new Promise((o, s) => e.addObserver((r) => {
6
+ c.isSuccess(r) ? o(r.value) : s(u.makeFiberFailure(r.cause));
7
+ }));
54
8
  export {
55
- N as default
9
+ a as clone,
10
+ i as cloneTrait,
11
+ p as runtimeFiberAsPromise
56
12
  };