@effect-app/vue-components 4.0.0-beta.282 → 4.0.0-beta.283
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.
- package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +6 -0
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +5 -9
- package/dist/types/components/OmegaForm/createUseFormWithCustomInput.d.ts +4 -2
- package/dist/types/components/OmegaForm/index.d.ts +1 -0
- package/dist/types/components/OmegaForm/types.d.ts +26 -3
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +4 -2
- package/dist/vue-components.es.js +9 -9
- package/dist/vue-components22.es.js +1 -0
- package/dist/vue-components30.es.js +23 -265
- package/dist/vue-components31.es.js +300 -0
- package/dist/vue-components33.es.js +7 -72
- package/dist/vue-components34.es.js +71 -3
- package/dist/vue-components35.es.js +4 -54
- package/dist/vue-components36.es.js +60 -4
- package/dist/vue-components37.es.js +4 -23
- package/dist/vue-components38.es.js +23 -4
- package/dist/vue-components39.es.js +3 -57
- package/dist/vue-components40.es.js +57 -3
- package/dist/vue-components41.es.js +4 -11
- package/dist/vue-components42.es.js +11 -21
- package/dist/vue-components43.es.js +22 -0
- package/dist/vue-components45.es.js +8 -3
- package/dist/vue-components46.es.js +3 -37
- package/dist/vue-components47.es.js +34 -23
- package/dist/vue-components48.es.js +23 -24
- package/dist/vue-components49.es.js +27 -6
- package/dist/vue-components50.es.js +6 -17
- package/dist/vue-components51.es.js +16 -34
- package/dist/vue-components52.es.js +34 -16
- package/dist/vue-components53.es.js +16 -19
- package/dist/vue-components54.es.js +10 -19
- package/dist/vue-components55.es.js +29 -6
- package/dist/vue-components56.es.js +6 -8
- package/dist/vue-components57.es.js +7 -36
- package/dist/vue-components58.es.js +37 -24
- package/dist/vue-components59.es.js +19 -122
- package/dist/vue-components60.es.js +126 -22
- package/dist/vue-components61.es.js +20 -17
- package/dist/vue-components62.es.js +18 -6
- package/dist/vue-components63.es.js +5 -15
- package/dist/vue-components64.es.js +18 -4
- package/dist/vue-components65.es.js +4 -28
- package/dist/vue-components66.es.js +28 -4
- package/dist/vue-components67.es.js +4 -42
- package/dist/vue-components68.es.js +38 -95
- package/dist/vue-components69.es.js +95 -27
- package/dist/vue-components70.es.js +35 -18
- package/dist/vue-components71.es.js +18 -47
- package/dist/vue-components72.es.js +48 -0
- package/package.json +3 -3
- package/src/components/OmegaForm/OmegaInput.vue +4 -1
- package/src/components/OmegaForm/OmegaInputVuetify.vue +49 -2
- package/src/components/OmegaForm/OmegaInternalInput.vue +16 -9
- package/src/components/OmegaForm/createUseFormWithCustomInput.ts +15 -14
- package/src/components/OmegaForm/index.ts +1 -0
- package/src/components/OmegaForm/types.ts +63 -21
- package/src/components/OmegaForm/useOmegaForm.ts +7 -6
- package/dist/vue-components32.es.js +0 -8
- package/dist/vue-components44.es.js +0 -9
|
@@ -1,43 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import * as r from "effect-app/Effect";
|
|
5
|
-
import { runtimeFiberAsPromise as i } from "effect-app/utils";
|
|
6
|
-
import * as a from "effect/Data";
|
|
7
|
-
import * as o from "effect/Fiber";
|
|
8
|
-
//#region src/components/OmegaForm/submit.ts
|
|
9
|
-
var s = class extends a.TaggedError("FormErrors") {}, c = (n, r) => n ? e.with(t.setSpan(e.active(), n), r) : r(), l = (e, t, n) => {
|
|
10
|
-
if (e) return ({ formApi: a, meta: s, value: l }) => c(s?.currentSpan, async () => {
|
|
11
|
-
let c = e({
|
|
12
|
-
formApi: a,
|
|
13
|
-
meta: s,
|
|
14
|
-
value: await n(t(l))
|
|
15
|
-
});
|
|
16
|
-
if (o.isFiber(c)) return await i(c);
|
|
17
|
-
if (r.isEffect(c)) {
|
|
18
|
-
let e = await n(c);
|
|
19
|
-
return o.isFiber(e) ? await i(e) : e;
|
|
20
|
-
}
|
|
21
|
-
return c;
|
|
22
|
-
});
|
|
23
|
-
}, u = (i) => {
|
|
24
|
-
let a = i.handleSubmit.bind(i), o = async (e) => await a(e), c = (n) => o({
|
|
25
|
-
currentSpan: t.getSpan(e.active()),
|
|
26
|
-
...n
|
|
27
|
-
}), l = (e) => r.currentSpan.pipe(r.option, r.flatMap((t) => r.promise(() => o(n.isSome(t) ? {
|
|
28
|
-
currentSpan: t.value,
|
|
29
|
-
...e
|
|
30
|
-
} : e))));
|
|
31
|
-
return {
|
|
32
|
-
handleSubmit: c,
|
|
33
|
-
handleSubmitEffect: (e) => e?.checkErrors ? l(e?.meta).pipe(r.flatMap(r.fnUntraced(function* () {
|
|
34
|
-
let e = i.getAllErrors();
|
|
35
|
-
if (Object.keys(e.fields).length || e.form.errors.length) return yield* r.fail(new s({
|
|
36
|
-
form: e.form,
|
|
37
|
-
fields: e.fields
|
|
38
|
-
}));
|
|
39
|
-
}))) : l(e?.meta)
|
|
40
|
-
};
|
|
41
|
-
};
|
|
1
|
+
import { TraceAPI as e } from "./vue-components66.es.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace-api.js
|
|
3
|
+
var t = e.getInstance();
|
|
42
4
|
//#endregion
|
|
43
|
-
export {
|
|
5
|
+
export { t as trace };
|
|
@@ -1,100 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import { makeRunPromise as T } from "@effect-app/vue/runtime";
|
|
21
|
-
//#region src/components/OmegaForm/useOmegaForm.ts
|
|
22
|
-
var E = Symbol("OmegaForm"), D = T(w.empty()), O = (w, T, E) => {
|
|
23
|
-
if (!w) throw Error("Schema is required");
|
|
24
|
-
let { trans: O } = e(), k = a(w), A = s(k, O), j = n(k.ast), M = (e) => i(j, e), N = c(A, O), P = {
|
|
25
|
-
...N,
|
|
26
|
-
"~standard": {
|
|
27
|
-
...N["~standard"],
|
|
28
|
-
validate: (e) => N["~standard"].validate(M(e))
|
|
1
|
+
import { context as e } from "./vue-components65.es.js";
|
|
2
|
+
import { trace as t } from "./vue-components67.es.js";
|
|
3
|
+
import * as n from "effect-app/Option";
|
|
4
|
+
import * as r from "effect-app/Effect";
|
|
5
|
+
import { runtimeFiberAsPromise as i } from "effect-app/utils";
|
|
6
|
+
import * as a from "effect/Data";
|
|
7
|
+
import * as o from "effect/Fiber";
|
|
8
|
+
//#region src/components/OmegaForm/submit.ts
|
|
9
|
+
var s = class extends a.TaggedError("FormErrors") {}, c = (n, r) => n ? e.with(t.setSpan(e.active(), n), r) : r(), l = (e, t, n) => {
|
|
10
|
+
if (e) return ({ formApi: a, meta: s, value: l }) => c(s?.currentSpan, async () => {
|
|
11
|
+
let c = e({
|
|
12
|
+
formApi: a,
|
|
13
|
+
meta: s,
|
|
14
|
+
value: await n(t(l))
|
|
15
|
+
});
|
|
16
|
+
if (o.isFiber(c)) return await i(c);
|
|
17
|
+
if (r.isEffect(c)) {
|
|
18
|
+
let e = await n(c);
|
|
19
|
+
return o.isFiber(e) ? await i(e) : e;
|
|
29
20
|
}
|
|
30
|
-
|
|
31
|
-
meta: L,
|
|
32
|
-
persistency: E?.persistency,
|
|
33
|
-
preventWindowExit: E?.preventWindowExit,
|
|
34
|
-
defaultValuesPriority: E?.defaultValuesPriority,
|
|
35
|
-
tanstackDefaultValues: T?.defaultValues,
|
|
36
|
-
schemaDefaultValues: () => r(w),
|
|
37
|
-
getForm: () => z.form
|
|
38
|
-
}), V = C({
|
|
39
|
-
...T,
|
|
40
|
-
validationLogic: S(),
|
|
41
|
-
validators: {
|
|
42
|
-
onDynamic: P,
|
|
43
|
-
...T?.validators
|
|
44
|
-
},
|
|
45
|
-
onSubmit: y(T?.onSubmit, I, D),
|
|
46
|
-
defaultValues: B.defaultValues.value
|
|
21
|
+
return c;
|
|
47
22
|
});
|
|
48
|
-
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
23
|
+
}, u = (i) => {
|
|
24
|
+
let a = i.handleSubmit.bind(i), o = async (e) => await a(e), c = (n) => o({
|
|
25
|
+
currentSpan: t.getSpan(e.active()),
|
|
26
|
+
...n
|
|
27
|
+
}), l = (e) => r.currentSpan.pipe(r.option, r.flatMap((t) => r.promise(() => o(n.isSome(t) ? {
|
|
28
|
+
currentSpan: t.value,
|
|
29
|
+
...e
|
|
30
|
+
} : e))));
|
|
31
|
+
return {
|
|
32
|
+
handleSubmit: c,
|
|
33
|
+
handleSubmitEffect: (e) => e?.checkErrors ? l(e?.meta).pipe(r.flatMap(r.fnUntraced(function* () {
|
|
34
|
+
let e = i.getAllErrors();
|
|
35
|
+
if (Object.keys(e.fields).length || e.form.errors.length) return yield* r.fail(new s({
|
|
36
|
+
form: e.form,
|
|
37
|
+
fields: e.fields
|
|
38
|
+
}));
|
|
39
|
+
}))) : l(e?.meta)
|
|
64
40
|
};
|
|
65
|
-
if (E?.preventWindowExit === "prevent-and-reset") {
|
|
66
|
-
let e = V.useStore((e) => e.isSubmitting), t = V.useStore((e) => e.submissionAttempts), n = V.useStore((e) => e.canSubmit), r = V.useStore((e) => e.values);
|
|
67
|
-
b([e, t], ([e, t], [i]) => {
|
|
68
|
-
i && !e && t > 0 && n.value && V.reset(r.value);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
let { handleSubmit: W, handleSubmitEffect: G } = v(V), { fieldMap: K, registerField: q } = u(), J = Object.assign(V, {
|
|
72
|
-
i18nNamespace: E?.i18nNamespace,
|
|
73
|
-
ignorePreventCloseEvents: E?.ignorePreventCloseEvents,
|
|
74
|
-
meta: L,
|
|
75
|
-
unionMeta: R,
|
|
76
|
-
clear: U,
|
|
77
|
-
normalizeNullableStructs: H,
|
|
78
|
-
handleSubmit: W,
|
|
79
|
-
handleSubmitEffect: G,
|
|
80
|
-
registerField: q
|
|
81
|
-
}), Y = {
|
|
82
|
-
form: J,
|
|
83
|
-
fieldMap: K
|
|
84
|
-
};
|
|
85
|
-
return Object.assign(J, {
|
|
86
|
-
_paths: void 0,
|
|
87
|
-
_keys: void 0,
|
|
88
|
-
_schema: w,
|
|
89
|
-
errorContext: Y,
|
|
90
|
-
Form: d(J)(_),
|
|
91
|
-
Input: d(J)(E?.input ?? h),
|
|
92
|
-
TaggedUnion: d(J)(g),
|
|
93
|
-
Field: V.Field,
|
|
94
|
-
Errors: l(Y)(m),
|
|
95
|
-
Array: d(J)(f),
|
|
96
|
-
AutoGen: d(J)(p)
|
|
97
|
-
});
|
|
98
41
|
};
|
|
99
42
|
//#endregion
|
|
100
|
-
export {
|
|
43
|
+
export { s as FormErrors, u as makeSubmitHandlers, l as wrapOnSubmit };
|
|
@@ -1,33 +1,101 @@
|
|
|
1
|
-
import e from "./vue-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { useIntl as e } from "./vue-components6.es.js";
|
|
2
|
+
import { generateMetaFromSchema as t, unwrapDeclaration as n } from "./vue-components14.es.js";
|
|
3
|
+
import { defaultsValueFromSchema as r, fillNestedDefaults as i } from "./vue-components15.es.js";
|
|
4
|
+
import { toFormSchema as a } from "./vue-components16.es.js";
|
|
5
|
+
import { usePersistency as o } from "./vue-components18.es.js";
|
|
6
|
+
import { annotateLiteralUnionMessages as s, toLocalizedStandardSchemaV1 as c } from "./vue-components19.es.js";
|
|
7
|
+
import { eHoc as l, makeFieldMap as u } from "./vue-components20.es.js";
|
|
8
|
+
import { fHoc as d } from "./vue-components21.es.js";
|
|
9
|
+
import f from "./vue-components23.es.js";
|
|
10
|
+
import p from "./vue-components25.es.js";
|
|
11
|
+
import m from "./vue-components29.es.js";
|
|
12
|
+
import h from "./vue-components37.es.js";
|
|
13
|
+
import g from "./vue-components41.es.js";
|
|
14
|
+
import _ from "./vue-components45.es.js";
|
|
15
|
+
import { makeSubmitHandlers as v, wrapOnSubmit as y } from "./vue-components68.es.js";
|
|
16
|
+
import { watch as b } from "vue";
|
|
17
|
+
import * as x from "effect-app/Schema";
|
|
18
|
+
import { revalidateLogic as S, useForm as C } from "@tanstack/vue-form";
|
|
19
|
+
import * as w from "effect-app/Context";
|
|
20
|
+
import { makeRunPromise as T } from "@effect-app/vue/runtime";
|
|
21
|
+
//#region src/components/OmegaForm/useOmegaForm.ts
|
|
22
|
+
var E = Symbol("OmegaForm"), D = T(w.empty()), O = (w, T, E) => {
|
|
23
|
+
if (!w) throw Error("Schema is required");
|
|
24
|
+
let { trans: O } = e(), k = a(w), A = s(k, O), j = n(k.ast), M = (e) => i(j, e), N = c(A, O), P = {
|
|
25
|
+
...N,
|
|
26
|
+
"~standard": {
|
|
27
|
+
...N["~standard"],
|
|
28
|
+
validate: (e) => N["~standard"].validate(M(e))
|
|
29
|
+
}
|
|
30
|
+
}, F = x.decodeUnknownEffectConcurrently(k), I = (e) => F(M(e)), { meta: L, unionMeta: R } = t(k), z = { form: void 0 }, B = o({
|
|
31
|
+
meta: L,
|
|
32
|
+
persistency: E?.persistency,
|
|
33
|
+
preventWindowExit: E?.preventWindowExit,
|
|
34
|
+
defaultValuesPriority: E?.defaultValuesPriority,
|
|
35
|
+
tanstackDefaultValues: T?.defaultValues,
|
|
36
|
+
schemaDefaultValues: () => r(w),
|
|
37
|
+
getForm: () => z.form
|
|
38
|
+
}), V = C({
|
|
39
|
+
...T,
|
|
40
|
+
validationLogic: S(),
|
|
41
|
+
validators: {
|
|
42
|
+
onDynamic: P,
|
|
43
|
+
...T?.validators
|
|
44
|
+
},
|
|
45
|
+
onSubmit: y(T?.onSubmit, I, D),
|
|
46
|
+
defaultValues: B.defaultValues.value
|
|
47
|
+
});
|
|
48
|
+
z.form = V;
|
|
49
|
+
let H = () => {
|
|
50
|
+
let e = V.state.values, t = i(j, e);
|
|
51
|
+
if (t === e || !t || typeof t != "object") return;
|
|
52
|
+
let n = e, r = t;
|
|
53
|
+
for (let e of Object.keys(r)) if (r[e] !== n[e]) {
|
|
54
|
+
let t = e;
|
|
55
|
+
V.setFieldValue(t, r[e], {
|
|
56
|
+
dontUpdateMeta: !0,
|
|
57
|
+
dontValidate: !0
|
|
24
58
|
});
|
|
25
59
|
}
|
|
60
|
+
}, U = () => {
|
|
61
|
+
Object.keys(L).forEach((e) => {
|
|
62
|
+
V.setFieldValue(e, void 0);
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
if (E?.preventWindowExit === "prevent-and-reset") {
|
|
66
|
+
let e = V.useStore((e) => e.isSubmitting), t = V.useStore((e) => e.submissionAttempts), n = V.useStore((e) => e.canSubmit), r = V.useStore((e) => e.values);
|
|
67
|
+
b([e, t], ([e, t], [i]) => {
|
|
68
|
+
i && !e && t > 0 && n.value && V.reset(r.value);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
let { handleSubmit: W, handleSubmitEffect: G } = v(V), { fieldMap: K, registerField: q } = u(), J = Object.assign(V, {
|
|
72
|
+
i18nNamespace: E?.i18nNamespace,
|
|
73
|
+
ignorePreventCloseEvents: E?.ignorePreventCloseEvents,
|
|
74
|
+
inputs: E?.inputs,
|
|
75
|
+
meta: L,
|
|
76
|
+
unionMeta: R,
|
|
77
|
+
clear: U,
|
|
78
|
+
normalizeNullableStructs: H,
|
|
79
|
+
handleSubmit: W,
|
|
80
|
+
handleSubmitEffect: G,
|
|
81
|
+
registerField: q
|
|
82
|
+
}), Y = {
|
|
83
|
+
form: J,
|
|
84
|
+
fieldMap: K
|
|
26
85
|
};
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
86
|
+
return Object.assign(J, {
|
|
87
|
+
_paths: void 0,
|
|
88
|
+
_keys: void 0,
|
|
89
|
+
_schema: w,
|
|
90
|
+
errorContext: Y,
|
|
91
|
+
Form: d(J)(_),
|
|
92
|
+
Input: d(J)(E?.input ?? h),
|
|
93
|
+
TaggedUnion: d(J)(g),
|
|
94
|
+
Field: V.Field,
|
|
95
|
+
Errors: l(Y)(m),
|
|
96
|
+
Array: d(J)(f),
|
|
97
|
+
AutoGen: d(J)(p)
|
|
30
98
|
});
|
|
31
99
|
};
|
|
32
100
|
//#endregion
|
|
33
|
-
export {
|
|
101
|
+
export { E as OmegaFormKey, O as useOmegaForm };
|
|
@@ -1,19 +1,36 @@
|
|
|
1
|
-
import "./vue-
|
|
2
|
-
import "./vue-
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import e from "./vue-components37.es.js";
|
|
2
|
+
import { useOmegaForm as t } from "./vue-components69.es.js";
|
|
3
|
+
import { h as n } from "vue";
|
|
4
|
+
//#region src/components/OmegaForm/createUseFormWithCustomInput.ts
|
|
5
|
+
var r = (r) => (i, a, o) => {
|
|
6
|
+
let s = {
|
|
7
|
+
name: "WrappedInput",
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
setup(t, { attrs: i, slots: a }) {
|
|
10
|
+
return () => n(e, {
|
|
11
|
+
...t,
|
|
12
|
+
...i
|
|
13
|
+
}, {
|
|
14
|
+
default: ({ field: e, state: t, ...s }) => {
|
|
15
|
+
let c = Object.fromEntries(Object.entries(i).filter(([e]) => !Object.prototype.hasOwnProperty.call(s, e) && e !== "form"));
|
|
16
|
+
return n(o?.inputs?.[s.type] ?? r, {
|
|
17
|
+
...c,
|
|
18
|
+
field: e,
|
|
19
|
+
state: t,
|
|
20
|
+
inputProps: s
|
|
21
|
+
}, {
|
|
22
|
+
...a.label && { label: (e) => a.label(e) },
|
|
23
|
+
...a.default && { default: (e) => a.default(e) }
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
...a.label && { label: (e) => a.label(e) }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return t(i, a, {
|
|
31
|
+
...o,
|
|
32
|
+
input: s
|
|
33
|
+
});
|
|
34
|
+
};
|
|
18
35
|
//#endregion
|
|
19
|
-
export {
|
|
36
|
+
export { r as createUseFormWithCustomInput };
|
|
@@ -1,48 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import { createUseFormWithCustomInput as C } from "./vue-components69.es.js";
|
|
19
|
-
import { duplicateSchema as w } from "./vue-components70.es.js";
|
|
20
|
-
//#region src/components/index.ts
|
|
21
|
-
var T = /* @__PURE__ */ e({
|
|
22
|
-
CommandButton: () => t,
|
|
23
|
-
Dialog: () => i,
|
|
24
|
-
FormErrors: () => b,
|
|
25
|
-
OmegaFormKey: () => x,
|
|
26
|
-
OmegaInput: () => _,
|
|
27
|
-
OmegaTaggedUnion: () => y,
|
|
28
|
-
OmegaTaggedUnionInternal: () => v,
|
|
29
|
-
OmegaVuetifyInput: () => g,
|
|
30
|
-
createMeta: () => o,
|
|
31
|
-
createUseFormWithCustomInput: () => C,
|
|
32
|
-
deepMerge: () => f,
|
|
33
|
-
defaultsValueFromSchema: () => u,
|
|
34
|
-
duplicateSchema: () => w,
|
|
35
|
-
generateMetaFromSchema: () => s,
|
|
36
|
-
getInputType: () => a,
|
|
37
|
-
isNullableOrUndefined: () => c,
|
|
38
|
-
makeStandardSchemaV1Hooks: () => p,
|
|
39
|
-
metadataFromAst: () => l,
|
|
40
|
-
toFormSchema: () => d,
|
|
41
|
-
toLocalizedStandardSchemaV1: () => m,
|
|
42
|
-
useErrorLabel: () => h,
|
|
43
|
-
useOmegaForm: () => S,
|
|
44
|
-
useOnClose: () => n,
|
|
45
|
-
usePreventClose: () => r
|
|
46
|
-
});
|
|
1
|
+
import "./vue-components8.es.js";
|
|
2
|
+
import "./vue-components11.es.js";
|
|
3
|
+
import "./vue-components14.es.js";
|
|
4
|
+
import "./vue-components15.es.js";
|
|
5
|
+
import "./vue-components16.es.js";
|
|
6
|
+
import "./vue-components18.es.js";
|
|
7
|
+
import "./vue-components19.es.js";
|
|
8
|
+
import "./vue-components20.es.js";
|
|
9
|
+
import "./vue-components35.es.js";
|
|
10
|
+
import "./vue-components37.es.js";
|
|
11
|
+
import "./vue-components39.es.js";
|
|
12
|
+
import "./vue-components41.es.js";
|
|
13
|
+
import "./vue-components68.es.js";
|
|
14
|
+
import "./vue-components69.es.js";
|
|
15
|
+
import "./vue-components70.es.js";
|
|
16
|
+
//#region src/components/OmegaForm/index.ts
|
|
17
|
+
var e = (e) => e;
|
|
47
18
|
//#endregion
|
|
48
|
-
export {
|
|
19
|
+
export { e as duplicateSchema };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __exportAll as e } from "./vue-components2.es.js";
|
|
2
|
+
import t from "./vue-components4.es.js";
|
|
3
|
+
import { useOnClose as n, usePreventClose as r } from "./vue-components8.es.js";
|
|
4
|
+
import i from "./vue-components10.es.js";
|
|
5
|
+
import { getInputType as a } from "./vue-components11.es.js";
|
|
6
|
+
import { createMeta as o, generateMetaFromSchema as s, isNullableOrUndefined as c, metadataFromAst as l } from "./vue-components14.es.js";
|
|
7
|
+
import { defaultsValueFromSchema as u } from "./vue-components15.es.js";
|
|
8
|
+
import { toFormSchema as d } from "./vue-components16.es.js";
|
|
9
|
+
import { deepMerge as f } from "./vue-components18.es.js";
|
|
10
|
+
import { makeStandardSchemaV1Hooks as p, toLocalizedStandardSchemaV1 as m } from "./vue-components19.es.js";
|
|
11
|
+
import { useErrorLabel as h } from "./vue-components20.es.js";
|
|
12
|
+
import g from "./vue-components35.es.js";
|
|
13
|
+
import _ from "./vue-components37.es.js";
|
|
14
|
+
import v from "./vue-components39.es.js";
|
|
15
|
+
import y from "./vue-components41.es.js";
|
|
16
|
+
import { FormErrors as b } from "./vue-components68.es.js";
|
|
17
|
+
import { OmegaFormKey as x, useOmegaForm as S } from "./vue-components69.es.js";
|
|
18
|
+
import { createUseFormWithCustomInput as C } from "./vue-components70.es.js";
|
|
19
|
+
import { duplicateSchema as w } from "./vue-components71.es.js";
|
|
20
|
+
//#region src/components/index.ts
|
|
21
|
+
var T = /* @__PURE__ */ e({
|
|
22
|
+
CommandButton: () => t,
|
|
23
|
+
Dialog: () => i,
|
|
24
|
+
FormErrors: () => b,
|
|
25
|
+
OmegaFormKey: () => x,
|
|
26
|
+
OmegaInput: () => _,
|
|
27
|
+
OmegaTaggedUnion: () => y,
|
|
28
|
+
OmegaTaggedUnionInternal: () => v,
|
|
29
|
+
OmegaVuetifyInput: () => g,
|
|
30
|
+
createMeta: () => o,
|
|
31
|
+
createUseFormWithCustomInput: () => C,
|
|
32
|
+
deepMerge: () => f,
|
|
33
|
+
defaultsValueFromSchema: () => u,
|
|
34
|
+
duplicateSchema: () => w,
|
|
35
|
+
generateMetaFromSchema: () => s,
|
|
36
|
+
getInputType: () => a,
|
|
37
|
+
isNullableOrUndefined: () => c,
|
|
38
|
+
makeStandardSchemaV1Hooks: () => p,
|
|
39
|
+
metadataFromAst: () => l,
|
|
40
|
+
toFormSchema: () => d,
|
|
41
|
+
toLocalizedStandardSchemaV1: () => m,
|
|
42
|
+
useErrorLabel: () => h,
|
|
43
|
+
useOmegaForm: () => S,
|
|
44
|
+
useOnClose: () => n,
|
|
45
|
+
usePreventClose: () => r
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
export { T as components_exports };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.283",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"effect": "^4.0.0-beta.88",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"highlight.js": "^11.11.1",
|
|
57
57
|
"mitt": "^3.0.1",
|
|
58
58
|
"vue3-highlightjs": "^1.0.5",
|
|
59
|
-
"@effect-app/vue": "4.0.0-beta.
|
|
60
|
-
"effect-app": "4.0.0-beta.
|
|
59
|
+
"@effect-app/vue": "4.0.0-beta.283",
|
|
60
|
+
"effect-app": "4.0.0-beta.283"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"check": "vue-tsc",
|
|
@@ -53,7 +53,10 @@ import { type OmegaInputPropsBase } from "./types"
|
|
|
53
53
|
const props = defineProps<OmegaInputPropsBase<From, To, Name>>()
|
|
54
54
|
const internalInputProps = computed(() => ({
|
|
55
55
|
label: props.label,
|
|
56
|
-
|
|
56
|
+
required: props.required,
|
|
57
|
+
type: props.type,
|
|
58
|
+
options: props.options,
|
|
59
|
+
inputs: props.form.inputs
|
|
57
60
|
}))
|
|
58
61
|
|
|
59
62
|
// downgrade to *as* DeepKeys<From> to avoid useless and possible infinite recursion in TS
|
|
@@ -34,7 +34,12 @@
|
|
|
34
34
|
v-if="inputProps.type === 'email'
|
|
35
35
|
|| inputProps.type === 'string'
|
|
36
36
|
|| inputProps.type === 'password'
|
|
37
|
-
|| inputProps.type === 'date'
|
|
37
|
+
|| inputProps.type === 'date'
|
|
38
|
+
|| inputProps.type === 'tel'
|
|
39
|
+
|| inputProps.type === 'url'
|
|
40
|
+
|| inputProps.type === 'color'
|
|
41
|
+
|| inputProps.type === 'time'
|
|
42
|
+
|| inputProps.type === 'search'"
|
|
38
43
|
:id="inputProps.id"
|
|
39
44
|
:required="inputProps.required"
|
|
40
45
|
:min-length="inputProps.minLength"
|
|
@@ -198,6 +203,33 @@
|
|
|
198
203
|
/>
|
|
199
204
|
</template>
|
|
200
205
|
</v-autocomplete>
|
|
206
|
+
|
|
207
|
+
<!-- Fallback for any type not handled by a dedicated branch above (e.g. an
|
|
208
|
+
unrecognized schema type resolved to "unknown", or a custom `type` with
|
|
209
|
+
no renderer). Renders an editable text input instead of nothing. -->
|
|
210
|
+
<v-text-field
|
|
211
|
+
v-if="isUnhandledType"
|
|
212
|
+
:id="inputProps.id"
|
|
213
|
+
:required="inputProps.required"
|
|
214
|
+
:type="getInputType(inputProps.type)"
|
|
215
|
+
:name="field.name"
|
|
216
|
+
:label="inputProps.label"
|
|
217
|
+
:error-messages="inputProps.errorMessages"
|
|
218
|
+
:error="inputProps.error"
|
|
219
|
+
v-bind="$attrs"
|
|
220
|
+
:model-value="state.value"
|
|
221
|
+
@update:model-value="(v: any) => field.handleChange(v)"
|
|
222
|
+
>
|
|
223
|
+
<template
|
|
224
|
+
v-if="$slots.label"
|
|
225
|
+
#label
|
|
226
|
+
>
|
|
227
|
+
<slot
|
|
228
|
+
name="label"
|
|
229
|
+
v-bind="{ required: inputProps.required, id: inputProps.id, label: inputProps.label }"
|
|
230
|
+
/>
|
|
231
|
+
</template>
|
|
232
|
+
</v-text-field>
|
|
201
233
|
</div>
|
|
202
234
|
</template>
|
|
203
235
|
|
|
@@ -207,10 +239,12 @@
|
|
|
207
239
|
generic="From extends Record<PropertyKey, any>, Name extends DeepKeys<From>"
|
|
208
240
|
>
|
|
209
241
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
242
|
+
import { computed, watchEffect } from "vue"
|
|
210
243
|
import type { VuetifyInputProps } from "./InputProps"
|
|
211
244
|
import { getInputType } from "./inputs"
|
|
245
|
+
import { typeOverrides } from "./types"
|
|
212
246
|
|
|
213
|
-
defineProps<VuetifyInputProps<From, Name>>()
|
|
247
|
+
const props = defineProps<VuetifyInputProps<From, Name>>()
|
|
214
248
|
|
|
215
249
|
defineEmits<{
|
|
216
250
|
(e: "focus", event: Event): void
|
|
@@ -220,6 +254,19 @@ defineEmits<{
|
|
|
220
254
|
defineOptions({
|
|
221
255
|
inheritAttrs: false
|
|
222
256
|
})
|
|
257
|
+
|
|
258
|
+
// True when no dedicated branch handles `inputProps.type` (it's outside the
|
|
259
|
+
// built-in `typeOverrides`): the fallback text input renders and we warn.
|
|
260
|
+
const isUnhandledType = computed(() => !(typeOverrides as readonly string[]).includes(props.inputProps.type))
|
|
261
|
+
|
|
262
|
+
watchEffect(() => {
|
|
263
|
+
if (isUnhandledType.value) {
|
|
264
|
+
// eslint-disable-next-line no-console
|
|
265
|
+
console.warn(
|
|
266
|
+
`[OmegaForm] Unhandled input type "${props.inputProps.type}", falling back to a text input.`
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
})
|
|
223
270
|
</script>
|
|
224
271
|
|
|
225
272
|
<style>
|