@effect-app/vue-components 4.0.0-beta.298 → 4.0.0-beta.299
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/FixedNuxtErrorBoundary.vue.d.ts +39 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/vue-components.es.js +19 -18
- package/dist/vue-components11.es.js +55 -19
- package/dist/vue-components12.es.js +4 -48
- package/dist/vue-components13.es.js +19 -127
- package/dist/vue-components14.es.js +46 -62
- package/dist/vue-components15.es.js +115 -101
- package/dist/vue-components16.es.js +63 -20
- package/dist/vue-components17.es.js +113 -4
- package/dist/vue-components18.es.js +20 -78
- package/dist/vue-components19.es.js +4 -92
- package/dist/vue-components20.es.js +75 -68
- package/dist/vue-components21.es.js +91 -10
- package/dist/vue-components22.es.js +72 -56
- package/dist/vue-components23.es.js +11 -4
- package/dist/vue-components24.es.js +49 -36
- package/dist/vue-components25.es.js +1 -1
- package/dist/vue-components26.es.js +39 -79
- package/dist/vue-components27.es.js +5 -0
- package/dist/vue-components28.es.js +83 -7
- package/dist/vue-components30.es.js +7 -23
- package/dist/vue-components31.es.js +8 -299
- package/dist/vue-components32.es.js +24 -0
- package/dist/vue-components33.es.js +299 -7
- package/dist/vue-components35.es.js +5 -2
- package/dist/vue-components36.es.js +61 -52
- package/dist/vue-components37.es.js +1 -1
- package/dist/vue-components38.es.js +58 -18
- package/dist/vue-components39.es.js +1 -1
- package/dist/vue-components40.es.js +18 -53
- package/dist/vue-components41.es.js +1 -1
- package/dist/vue-components42.es.js +58 -11
- package/dist/vue-components43.es.js +4 -21
- package/dist/vue-components44.es.js +12 -0
- package/dist/vue-components45.es.js +21 -8
- package/dist/vue-components47.es.js +8 -37
- package/dist/vue-components48.es.js +3 -26
- package/dist/vue-components49.es.js +34 -24
- package/dist/vue-components50.es.js +26 -6
- package/dist/vue-components51.es.js +25 -15
- package/dist/vue-components52.es.js +6 -35
- package/dist/vue-components53.es.js +16 -16
- package/dist/vue-components54.es.js +32 -17
- package/dist/vue-components55.es.js +16 -28
- package/dist/vue-components56.es.js +20 -6
- package/dist/vue-components57.es.js +28 -7
- package/dist/vue-components58.es.js +6 -37
- package/dist/vue-components59.es.js +8 -24
- package/dist/vue-components60.es.js +37 -127
- package/dist/vue-components61.es.js +22 -21
- package/dist/vue-components62.es.js +127 -20
- package/dist/vue-components63.es.js +21 -6
- package/dist/vue-components64.es.js +15 -13
- package/dist/vue-components65.es.js +8 -4
- package/dist/vue-components66.es.js +13 -23
- package/dist/vue-components67.es.js +3 -3
- package/dist/vue-components68.es.js +27 -41
- package/dist/vue-components69.es.js +4 -100
- package/dist/vue-components70.es.js +39 -32
- package/dist/vue-components71.es.js +100 -18
- package/dist/vue-components72.es.js +35 -47
- package/dist/vue-components73.es.js +19 -0
- package/dist/vue-components74.es.js +50 -0
- package/package.json +9 -3
- package/src/components/FixedNuxtErrorBoundary.vue +112 -0
- package/src/components/index.ts +1 -0
- package/dist/vue-components29.es.js +0 -9
- package/dist/vue-components34.es.js +0 -73
- package/dist/vue-components46.es.js +0 -4
|
@@ -1,101 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
58
|
-
});
|
|
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
|
|
85
|
-
};
|
|
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)
|
|
98
|
-
});
|
|
99
|
-
};
|
|
1
|
+
import { TraceAPI as e } from "./vue-components68.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();
|
|
100
4
|
//#endregion
|
|
101
|
-
export {
|
|
5
|
+
export { t as trace };
|
|
@@ -1,36 +1,43 @@
|
|
|
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
|
-
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
|
-
});
|
|
1
|
+
import { context as e } from "./vue-components67.es.js";
|
|
2
|
+
import { trace as t } from "./vue-components69.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;
|
|
28
20
|
}
|
|
29
|
-
|
|
30
|
-
return t(i, a, {
|
|
31
|
-
...o,
|
|
32
|
-
input: s
|
|
21
|
+
return c;
|
|
33
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
|
+
};
|
|
34
41
|
};
|
|
35
42
|
//#endregion
|
|
36
|
-
export {
|
|
43
|
+
export { s as FormErrors, u as makeSubmitHandlers, l as wrapOnSubmit };
|
|
@@ -1,19 +1,101 @@
|
|
|
1
|
-
import "./vue-
|
|
2
|
-
import "./vue-
|
|
3
|
-
import "./vue-
|
|
4
|
-
import "./vue-
|
|
5
|
-
import "./vue-
|
|
6
|
-
import "./vue-
|
|
7
|
-
import "./vue-
|
|
8
|
-
import "./vue-
|
|
9
|
-
import "./vue-
|
|
10
|
-
import "./vue-
|
|
11
|
-
import "./vue-
|
|
12
|
-
import "./vue-
|
|
13
|
-
import "./vue-
|
|
14
|
-
import "./vue-
|
|
15
|
-
import "./vue-components70.es.js";
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { useIntl as e } from "./vue-components6.es.js";
|
|
2
|
+
import { generateMetaFromSchema as t, unwrapDeclaration as n } from "./vue-components16.es.js";
|
|
3
|
+
import { defaultsValueFromSchema as r, fillNestedDefaults as i } from "./vue-components17.es.js";
|
|
4
|
+
import { toFormSchema as a } from "./vue-components18.es.js";
|
|
5
|
+
import { usePersistency as o } from "./vue-components20.es.js";
|
|
6
|
+
import { annotateLiteralUnionMessages as s, toLocalizedStandardSchemaV1 as c } from "./vue-components21.es.js";
|
|
7
|
+
import { eHoc as l, makeFieldMap as u } from "./vue-components22.es.js";
|
|
8
|
+
import { fHoc as d } from "./vue-components23.es.js";
|
|
9
|
+
import f from "./vue-components25.es.js";
|
|
10
|
+
import p from "./vue-components27.es.js";
|
|
11
|
+
import m from "./vue-components31.es.js";
|
|
12
|
+
import h from "./vue-components39.es.js";
|
|
13
|
+
import g from "./vue-components43.es.js";
|
|
14
|
+
import _ from "./vue-components47.es.js";
|
|
15
|
+
import { makeSubmitHandlers as v, wrapOnSubmit as y } from "./vue-components70.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
|
|
58
|
+
});
|
|
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
|
|
85
|
+
};
|
|
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)
|
|
98
|
+
});
|
|
99
|
+
};
|
|
18
100
|
//#endregion
|
|
19
|
-
export {
|
|
101
|
+
export { E as OmegaFormKey, O as useOmegaForm };
|
|
@@ -1,48 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "./vue-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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 e from "./vue-components39.es.js";
|
|
2
|
+
import { useOmegaForm as t } from "./vue-components71.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
|
+
};
|
|
47
35
|
//#endregion
|
|
48
|
-
export {
|
|
36
|
+
export { r as createUseFormWithCustomInput };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "./vue-components8.es.js";
|
|
2
|
+
import "./vue-components13.es.js";
|
|
3
|
+
import "./vue-components16.es.js";
|
|
4
|
+
import "./vue-components17.es.js";
|
|
5
|
+
import "./vue-components18.es.js";
|
|
6
|
+
import "./vue-components20.es.js";
|
|
7
|
+
import "./vue-components21.es.js";
|
|
8
|
+
import "./vue-components22.es.js";
|
|
9
|
+
import "./vue-components37.es.js";
|
|
10
|
+
import "./vue-components39.es.js";
|
|
11
|
+
import "./vue-components41.es.js";
|
|
12
|
+
import "./vue-components43.es.js";
|
|
13
|
+
import "./vue-components70.es.js";
|
|
14
|
+
import "./vue-components71.es.js";
|
|
15
|
+
import "./vue-components72.es.js";
|
|
16
|
+
//#region src/components/OmegaForm/index.ts
|
|
17
|
+
var e = (e) => e;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { e as duplicateSchema };
|
|
@@ -0,0 +1,50 @@
|
|
|
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 a from "./vue-components12.es.js";
|
|
6
|
+
import { getInputType as o } from "./vue-components13.es.js";
|
|
7
|
+
import { createMeta as s, generateMetaFromSchema as c, isNullableOrUndefined as l, metadataFromAst as u } from "./vue-components16.es.js";
|
|
8
|
+
import { defaultsValueFromSchema as d } from "./vue-components17.es.js";
|
|
9
|
+
import { toFormSchema as f } from "./vue-components18.es.js";
|
|
10
|
+
import { deepMerge as p } from "./vue-components20.es.js";
|
|
11
|
+
import { makeStandardSchemaV1Hooks as m, toLocalizedStandardSchemaV1 as h } from "./vue-components21.es.js";
|
|
12
|
+
import { useErrorLabel as g } from "./vue-components22.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 b from "./vue-components43.es.js";
|
|
17
|
+
import { FormErrors as x } from "./vue-components70.es.js";
|
|
18
|
+
import { OmegaFormKey as S, useOmegaForm as C } from "./vue-components71.es.js";
|
|
19
|
+
import { createUseFormWithCustomInput as w } from "./vue-components72.es.js";
|
|
20
|
+
import { duplicateSchema as T } from "./vue-components73.es.js";
|
|
21
|
+
//#region src/components/index.ts
|
|
22
|
+
var E = /* @__PURE__ */ e({
|
|
23
|
+
CommandButton: () => t,
|
|
24
|
+
Dialog: () => i,
|
|
25
|
+
FixedNuxtErrorBoundary: () => a,
|
|
26
|
+
FormErrors: () => x,
|
|
27
|
+
OmegaFormKey: () => S,
|
|
28
|
+
OmegaInput: () => v,
|
|
29
|
+
OmegaTaggedUnion: () => b,
|
|
30
|
+
OmegaTaggedUnionInternal: () => y,
|
|
31
|
+
OmegaVuetifyInput: () => _,
|
|
32
|
+
createMeta: () => s,
|
|
33
|
+
createUseFormWithCustomInput: () => w,
|
|
34
|
+
deepMerge: () => p,
|
|
35
|
+
defaultsValueFromSchema: () => d,
|
|
36
|
+
duplicateSchema: () => T,
|
|
37
|
+
generateMetaFromSchema: () => c,
|
|
38
|
+
getInputType: () => o,
|
|
39
|
+
isNullableOrUndefined: () => l,
|
|
40
|
+
makeStandardSchemaV1Hooks: () => m,
|
|
41
|
+
metadataFromAst: () => u,
|
|
42
|
+
toFormSchema: () => f,
|
|
43
|
+
toLocalizedStandardSchemaV1: () => h,
|
|
44
|
+
useErrorLabel: () => g,
|
|
45
|
+
useOmegaForm: () => C,
|
|
46
|
+
useOnClose: () => n,
|
|
47
|
+
usePreventClose: () => r
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
export { E as components_exports };
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.299",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/effect-app/libs.git",
|
|
7
|
+
"directory": "packages/vue-components"
|
|
8
|
+
},
|
|
4
9
|
"peerDependencies": {
|
|
5
10
|
"@mdi/js": "^7.4.47",
|
|
6
11
|
"effect": "^4.0.0-beta.90",
|
|
@@ -10,6 +15,7 @@
|
|
|
10
15
|
"primeicons": "^7.0.0",
|
|
11
16
|
"primevue": "^4.5.5",
|
|
12
17
|
"vue": "^3.5.35",
|
|
18
|
+
"vue-router": "^5.1.0",
|
|
13
19
|
"vuetify": "^4.0.8"
|
|
14
20
|
},
|
|
15
21
|
"devDependencies": {
|
|
@@ -56,8 +62,8 @@
|
|
|
56
62
|
"highlight.js": "^11.11.1",
|
|
57
63
|
"mitt": "^3.0.1",
|
|
58
64
|
"vue3-highlightjs": "^1.0.5",
|
|
59
|
-
"@effect-app/vue": "4.0.0-beta.
|
|
60
|
-
"effect-app": "4.0.0-beta.
|
|
65
|
+
"@effect-app/vue": "4.0.0-beta.299",
|
|
66
|
+
"effect-app": "4.0.0-beta.299"
|
|
61
67
|
},
|
|
62
68
|
"scripts": {
|
|
63
69
|
"check": "vue-tsc",
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { CauseException } from "effect-app/client"
|
|
3
|
+
import * as Cause from "effect/Cause"
|
|
4
|
+
import { onErrorCaptured, shallowRef } from "vue"
|
|
5
|
+
import { useRouter } from "vue-router"
|
|
6
|
+
|
|
7
|
+
// withDefaults, NOT `props.enabled ?? true`: Vue's boolean casting resolves an
|
|
8
|
+
// ABSENT boolean prop to `false`, so the `??` fallback would never fire and an
|
|
9
|
+
// omitted `enabled` (the frontend case) would silently disable the boundary.
|
|
10
|
+
const props = withDefaults(
|
|
11
|
+
defineProps<{
|
|
12
|
+
captureException: (err: Error, hint?: { extra?: Record<string, unknown> }) => void
|
|
13
|
+
toastError: (message: string) => void
|
|
14
|
+
debug: boolean
|
|
15
|
+
/** register the boundary only when true (backend passes import.meta.client; frontend omits → true) */
|
|
16
|
+
enabled?: boolean
|
|
17
|
+
/** defer handling until app ready (backend: onNuxtReady while hydrating; frontend: omit → run now) */
|
|
18
|
+
scheduleAfterReady?: (fn: () => void) => void
|
|
19
|
+
/** extra side-effect after emit, before error.value is set (backend: nuxtApp vue:error hook) */
|
|
20
|
+
onHandled?: (err: Error, instance: unknown, info: string) => void
|
|
21
|
+
}>(),
|
|
22
|
+
{ enabled: true }
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
defineOptions({ name: "NuxtErrorBoundary", inheritAttrs: false })
|
|
26
|
+
|
|
27
|
+
const emit = defineEmits<{ error: [error: Error] }>()
|
|
28
|
+
|
|
29
|
+
defineSlots<{
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
error(props: { error: Error; clearError: () => void }): any
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
default(): any
|
|
34
|
+
}>()
|
|
35
|
+
|
|
36
|
+
const error = shallowRef<Error | null>(null)
|
|
37
|
+
function clearError() {
|
|
38
|
+
error.value = null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// lol in production these are different...
|
|
42
|
+
const supportedErrors = ["https://vuejs.org/error-reference/#runtime-0", 0, "0", "setup function"]
|
|
43
|
+
|
|
44
|
+
function handleError(...args: Parameters<Parameters<typeof onErrorCaptured<Error>>[0]>) {
|
|
45
|
+
const [err, instance, info] = args
|
|
46
|
+
const fiberFailure = err instanceof CauseException ? err : null
|
|
47
|
+
// PRO: log that we hit the error boundary
|
|
48
|
+
console.warn(
|
|
49
|
+
"NuxtErrorBoundary caught error in " + info + ": " + (fiberFailure ? "CauseException" : "classic error"),
|
|
50
|
+
fiberFailure ? Cause.pretty(fiberFailure.originalCause) : err,
|
|
51
|
+
instance
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
// PRO: we don't handle native event handlers the same way we handle setup errors,
|
|
55
|
+
// because these errors should only get reported, not take over the page.
|
|
56
|
+
if (!supportedErrors.includes(info)) {
|
|
57
|
+
props.captureException(err, { extra: { info, instance } })
|
|
58
|
+
if (props.debug) {
|
|
59
|
+
props.toastError("An unexpected error has occurred: " + err.toString())
|
|
60
|
+
}
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// PRO: don't render interruptions..
|
|
65
|
+
// e.g when we run useSuspenseQuery, and we navigate away before a query is finished, we get a CancelledError
|
|
66
|
+
// if we however render it here instead of the default slot, we will show the cancellation error of the previous page, instead of rendering the new page
|
|
67
|
+
//
|
|
68
|
+
// NOTE the engine-side contract that makes this blanket silence safe: `useSuspenseQuery(New)`
|
|
69
|
+
// converts an interrupt that settles while the component is STILL MOUNTED (a query-side interrupt,
|
|
70
|
+
// e.g. a server RPC interrupt Exit — the thing that used to blank the page) into a typed
|
|
71
|
+
// `SuspenseInterruptedError` (@effect-app/vue makeClient), whose cause is NOT interrupt-only and
|
|
72
|
+
// therefore falls through to the error slot below. What remains interrupt-only here is genuinely
|
|
73
|
+
// "navigated away / unmounted" — silencing it is correct and avoids rendering the previous page's
|
|
74
|
+
// cancellation over the new page.
|
|
75
|
+
if (fiberFailure && Cause.hasInterruptsOnly(fiberFailure.originalCause)) {
|
|
76
|
+
return
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
emit("error", err)
|
|
80
|
+
props.onHandled?.(err, instance, info)
|
|
81
|
+
error.value = err
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (props.enabled) {
|
|
85
|
+
onErrorCaptured((err, instance, info) => {
|
|
86
|
+
if (props.scheduleAfterReady) props.scheduleAfterReady(() => handleError(err, instance, info))
|
|
87
|
+
else handleError(err, instance, info)
|
|
88
|
+
return false
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// PRO: fix error not clearing after route change: https://github.com/nuxt/nuxt/issues/15781#issuecomment-2320928163
|
|
93
|
+
const router = useRouter()
|
|
94
|
+
router.afterEach(() => {
|
|
95
|
+
clearError()
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
defineExpose({ error, clearError })
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<template>
|
|
102
|
+
<slot
|
|
103
|
+
v-if="error"
|
|
104
|
+
v-bind="{ error, clearError }"
|
|
105
|
+
name="error"
|
|
106
|
+
/>
|
|
107
|
+
|
|
108
|
+
<slot
|
|
109
|
+
v-else
|
|
110
|
+
name="default"
|
|
111
|
+
/>
|
|
112
|
+
</template>
|
package/src/components/index.ts
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);if(e.appendChild(document.createTextNode(`.v-enter-from[data-v-5278f8d3],.v-leave-to[data-v-5278f8d3]{opacity:0;grid-template-rows:0fr;max-height:0}.v-enter-active[data-v-5278f8d3],.v-leave-active[data-v-5278f8d3]{transition:all .15s;display:grid}.v-enter-to[data-v-5278f8d3],.v-leave-from[data-v-5278f8d3]{opacity:1;grid-template-rows:1fr;max-height:50vh}.error-alert[data-v-5278f8d3]{transition-behavior:allow-discrete;min-height:0;display:grid;overflow:hidden}.error-alert>[data-v-5278f8d3]{min-height:0}.error-list[data-v-5278f8d3]{list-style-position:inside}.error-list [data-v-5278f8d3]::marker{margin:0;padding:0}.error-alert-content[data-v-5278f8d3]{background-color:var(--error-background,#fff5f5);color:var(--error-color,#c92a2a);padding:1em}.error-link[data-v-5278f8d3]{color:var(--error-color,#c92a2a);cursor:pointer;font-weight:700;position:relative}.error-link[data-v-5278f8d3]:after{content:"";background:rgba(from var(--error-color,#c92a2a) r g b / .5);height:1px;position:absolute;bottom:0;left:0;right:0}.text-h6[data-v-5278f8d3]{font-size:1.25em;font-weight:700}.error-message[data-v-5278f8d3]{font-style:italic}.error-item[data-v-5278f8d3]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-5278f8d3]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-5278f8d3]{gap:1.5em;display:flex}.container svg[data-v-5278f8d3]{width:3em}.container .single-error[data-v-5278f8d3]{display:inline-block}`)),document.head.appendChild(e),window.customElements){let e=window.customElements.define;window.customElements.define=function(t,n){let r=n.prototype.connectedCallback;return n.prototype.connectedCallback=function(){if(r&&r.call(this),this.shadowRoot){let e=document.createElement(`style`);e.appendChild(document.createTextNode(`.v-enter-from[data-v-5278f8d3],.v-leave-to[data-v-5278f8d3]{opacity:0;grid-template-rows:0fr;max-height:0}.v-enter-active[data-v-5278f8d3],.v-leave-active[data-v-5278f8d3]{transition:all .15s;display:grid}.v-enter-to[data-v-5278f8d3],.v-leave-from[data-v-5278f8d3]{opacity:1;grid-template-rows:1fr;max-height:50vh}.error-alert[data-v-5278f8d3]{transition-behavior:allow-discrete;min-height:0;display:grid;overflow:hidden}.error-alert>[data-v-5278f8d3]{min-height:0}.error-list[data-v-5278f8d3]{list-style-position:inside}.error-list [data-v-5278f8d3]::marker{margin:0;padding:0}.error-alert-content[data-v-5278f8d3]{background-color:var(--error-background,#fff5f5);color:var(--error-color,#c92a2a);padding:1em}.error-link[data-v-5278f8d3]{color:var(--error-color,#c92a2a);cursor:pointer;font-weight:700;position:relative}.error-link[data-v-5278f8d3]:after{content:"";background:rgba(from var(--error-color,#c92a2a) r g b / .5);height:1px;position:absolute;bottom:0;left:0;right:0}.text-h6[data-v-5278f8d3]{font-size:1.25em;font-weight:700}.error-message[data-v-5278f8d3]{font-style:italic}.error-item[data-v-5278f8d3]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-5278f8d3]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-5278f8d3]{gap:1.5em;display:flex}.container svg[data-v-5278f8d3]{width:3em}.container .single-error[data-v-5278f8d3]{display:inline-block}`)),this.shadowRoot.appendChild(e)}},e.call(window.customElements,t,n)}}}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);if(e.appendChild(document.createTextNode(`.v-enter-from[data-v-5278f8d3],.v-leave-to[data-v-5278f8d3]{opacity:0;grid-template-rows:0fr;max-height:0}.v-enter-active[data-v-5278f8d3],.v-leave-active[data-v-5278f8d3]{transition:all .15s;display:grid}.v-enter-to[data-v-5278f8d3],.v-leave-from[data-v-5278f8d3]{opacity:1;grid-template-rows:1fr;max-height:50vh}.error-alert[data-v-5278f8d3]{transition-behavior:allow-discrete;min-height:0;display:grid;overflow:hidden}.error-alert>[data-v-5278f8d3]{min-height:0}.error-list[data-v-5278f8d3]{list-style-position:inside}.error-list [data-v-5278f8d3]::marker{margin:0;padding:0}.error-alert-content[data-v-5278f8d3]{background-color:var(--error-background,#fff5f5);color:var(--error-color,#c92a2a);padding:1em}.error-link[data-v-5278f8d3]{color:var(--error-color,#c92a2a);cursor:pointer;font-weight:700;position:relative}.error-link[data-v-5278f8d3]:after{content:"";background:rgba(from var(--error-color,#c92a2a) r g b / .5);height:1px;position:absolute;bottom:0;left:0;right:0}.text-h6[data-v-5278f8d3]{font-size:1.25em;font-weight:700}.error-message[data-v-5278f8d3]{font-style:italic}.error-item[data-v-5278f8d3]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-5278f8d3]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-5278f8d3]{gap:1.5em;display:flex}.container svg[data-v-5278f8d3]{width:3em}.container .single-error[data-v-5278f8d3]{display:inline-block}`)),document.head.appendChild(e),window.customElements){let e=window.customElements.define;window.customElements.define=function(t,n){let r=n.prototype.connectedCallback;return n.prototype.connectedCallback=function(){if(r&&r.call(this),this.shadowRoot){let e=document.createElement(`style`);e.appendChild(document.createTextNode(`.v-enter-from[data-v-5278f8d3],.v-leave-to[data-v-5278f8d3]{opacity:0;grid-template-rows:0fr;max-height:0}.v-enter-active[data-v-5278f8d3],.v-leave-active[data-v-5278f8d3]{transition:all .15s;display:grid}.v-enter-to[data-v-5278f8d3],.v-leave-from[data-v-5278f8d3]{opacity:1;grid-template-rows:1fr;max-height:50vh}.error-alert[data-v-5278f8d3]{transition-behavior:allow-discrete;min-height:0;display:grid;overflow:hidden}.error-alert>[data-v-5278f8d3]{min-height:0}.error-list[data-v-5278f8d3]{list-style-position:inside}.error-list [data-v-5278f8d3]::marker{margin:0;padding:0}.error-alert-content[data-v-5278f8d3]{background-color:var(--error-background,#fff5f5);color:var(--error-color,#c92a2a);padding:1em}.error-link[data-v-5278f8d3]{color:var(--error-color,#c92a2a);cursor:pointer;font-weight:700;position:relative}.error-link[data-v-5278f8d3]:after{content:"";background:rgba(from var(--error-color,#c92a2a) r g b / .5);height:1px;position:absolute;bottom:0;left:0;right:0}.text-h6[data-v-5278f8d3]{font-size:1.25em;font-weight:700}.error-message[data-v-5278f8d3]{font-style:italic}.error-item[data-v-5278f8d3]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-5278f8d3]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-5278f8d3]{gap:1.5em;display:flex}.container svg[data-v-5278f8d3]{width:3em}.container .single-error[data-v-5278f8d3]{display:inline-block}`)),this.shadowRoot.appendChild(e)}},e.call(window.customElements,t,n)}}}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
3
|
-
import e from "./vue-components26.es.js";
|
|
4
|
-
|
|
5
|
-
import t from "./vue-components28.es.js";
|
|
6
|
-
//#region src/components/OmegaForm/OmegaErrorsInternal.vue
|
|
7
|
-
var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-5278f8d3"]]);
|
|
8
|
-
//#endregion
|
|
9
|
-
export { n as default };
|