@effect-app/vue-components 4.0.0-beta.157 → 4.0.0-beta.159
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/OmegaArray.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaErrorsInternal.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +2 -1
- package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/createUseFormWithCustomInput.d.ts +2 -2
- package/dist/types/components/OmegaForm/errors.d.ts +33 -0
- package/dist/types/components/OmegaForm/getOmegaStore.d.ts +1 -1
- package/dist/types/components/OmegaForm/hocs.d.ts +3 -0
- package/dist/types/components/OmegaForm/index.d.ts +13 -3
- package/dist/types/components/OmegaForm/inputs.d.ts +4 -0
- package/dist/types/components/OmegaForm/meta/checks.d.ts +4 -0
- package/dist/types/components/OmegaForm/meta/createMeta.d.ts +32 -0
- package/dist/types/components/OmegaForm/meta/defaults.d.ts +2 -0
- package/dist/types/components/OmegaForm/meta/redacted.d.ts +2 -0
- package/dist/types/components/OmegaForm/meta/types.d.ts +56 -0
- package/dist/types/components/OmegaForm/meta/walker.d.ts +18 -0
- package/dist/types/components/OmegaForm/persistency.d.ts +58 -0
- package/dist/types/components/OmegaForm/submit.d.ts +60 -0
- package/dist/types/components/OmegaForm/types.d.ts +281 -0
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +6 -212
- package/dist/types/components/OmegaForm/validation/localized.d.ts +10 -0
- package/dist/vue-components.es.js +24 -16
- package/dist/vue-components10.es.js +4 -4
- package/dist/vue-components11.es.js +19 -12
- package/dist/vue-components12.es.js +22 -444
- package/dist/vue-components13.es.js +126 -3
- package/dist/vue-components14.es.js +61 -34
- package/dist/vue-components15.es.js +57 -24
- package/dist/vue-components16.es.js +20 -26
- package/dist/vue-components17.es.js +4 -6
- package/dist/vue-components18.es.js +78 -16
- package/dist/vue-components19.es.js +86 -30
- package/dist/vue-components20.es.js +72 -17
- package/dist/vue-components21.es.js +10 -19
- package/dist/vue-components22.es.js +54 -28
- package/dist/vue-components23.es.js +4 -6
- package/dist/vue-components24.es.js +43 -8
- package/dist/vue-components25.es.js +4 -37
- package/dist/vue-components26.es.js +83 -24
- package/dist/vue-components28.es.js +6 -22
- package/dist/vue-components29.es.js +8 -20
- package/dist/vue-components3.es.js +2 -2
- package/dist/vue-components30.es.js +267 -7
- package/dist/vue-components32.es.js +7 -4
- package/dist/vue-components33.es.js +71 -27
- package/dist/vue-components34.es.js +4 -4
- package/dist/vue-components35.es.js +50 -27
- package/dist/vue-components36.es.js +4 -5
- package/dist/vue-components37.es.js +23 -17
- package/dist/vue-components38.es.js +4 -55
- package/dist/vue-components39.es.js +57 -3
- package/dist/vue-components40.es.js +4 -43
- package/dist/vue-components41.es.js +11 -4
- package/dist/vue-components42.es.js +17 -79
- package/dist/vue-components44.es.js +8 -7
- package/dist/vue-components45.es.js +3 -8
- package/dist/vue-components46.es.js +36 -267
- package/dist/vue-components47.es.js +27 -0
- package/dist/vue-components48.es.js +27 -7
- package/dist/vue-components49.es.js +6 -79
- package/dist/vue-components50.es.js +17 -4
- package/dist/vue-components51.es.js +32 -69
- package/dist/vue-components52.es.js +17 -4
- package/dist/vue-components53.es.js +19 -22
- package/dist/vue-components54.es.js +29 -4
- package/dist/vue-components55.es.js +6 -58
- package/dist/vue-components56.es.js +8 -4
- package/dist/vue-components57.es.js +37 -11
- package/dist/vue-components58.es.js +24 -21
- package/dist/{vue-components27.es.js → vue-components59.es.js} +2 -2
- package/dist/vue-components6.es.js +11 -11
- package/dist/vue-components60.es.js +23 -8
- package/dist/vue-components61.es.js +18 -232
- package/dist/vue-components62.es.js +7 -31
- package/dist/vue-components63.es.js +19 -8
- package/dist/vue-components64.es.js +4 -35
- package/dist/vue-components65.es.js +29 -0
- package/dist/vue-components66.es.js +5 -0
- package/dist/vue-components67.es.js +29 -0
- package/dist/vue-components68.es.js +6 -0
- package/dist/vue-components69.es.js +18 -0
- package/dist/vue-components7.es.js +11 -26
- package/dist/vue-components70.es.js +40 -0
- package/dist/vue-components71.es.js +81 -0
- package/dist/vue-components72.es.js +33 -0
- package/dist/vue-components73.es.js +19 -0
- package/dist/vue-components74.es.js +48 -0
- package/dist/vue-components8.es.js +33 -45
- package/dist/vue-components9.es.js +46 -4
- package/package.json +7 -7
- package/src/components/CommandButton.vue +3 -1
- package/src/components/OmegaForm/OmegaArray.vue +1 -1
- package/src/components/OmegaForm/OmegaAutoGen.vue +2 -1
- package/src/components/OmegaForm/OmegaErrorsInternal.vue +1 -1
- package/src/components/OmegaForm/OmegaFormInput.vue +1 -1
- package/src/components/OmegaForm/OmegaInput.vue +6 -68
- package/src/components/OmegaForm/OmegaInputVuetify.vue +1 -1
- package/src/components/OmegaForm/OmegaInternalInput.vue +5 -11
- package/src/components/OmegaForm/OmegaTaggedUnion.vue +2 -1
- package/src/components/OmegaForm/OmegaWrapper.vue +1 -1
- package/src/components/OmegaForm/blockDialog.ts +10 -1
- package/src/components/OmegaForm/createUseFormWithCustomInput.ts +2 -1
- package/src/components/OmegaForm/errors.ts +136 -0
- package/src/components/OmegaForm/getOmegaStore.ts +1 -1
- package/src/components/OmegaForm/hocs.ts +19 -0
- package/src/components/OmegaForm/index.ts +16 -4
- package/src/components/OmegaForm/inputs.ts +22 -0
- package/src/components/OmegaForm/meta/checks.ts +81 -0
- package/src/components/OmegaForm/meta/createMeta.ts +138 -0
- package/src/components/OmegaForm/meta/defaults.ts +132 -0
- package/src/components/OmegaForm/meta/redacted.ts +66 -0
- package/src/components/OmegaForm/meta/types.ts +78 -0
- package/src/components/OmegaForm/meta/walker.ts +247 -0
- package/src/components/OmegaForm/persistency.ts +247 -0
- package/src/components/OmegaForm/submit.ts +128 -0
- package/src/components/OmegaForm/types.ts +751 -0
- package/src/components/OmegaForm/useOmegaForm.ts +49 -913
- package/src/components/OmegaForm/validation/localized.ts +202 -0
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +0 -173
- package/dist/vue-components31.es.js +0 -19
- package/src/components/OmegaForm/OmegaFormStuff.ts +0 -1422
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getGlobal as e, registerGlobal as t, unregisterGlobal as n } from "./vue-components47.es.js";
|
|
2
|
+
import { DiagAPI as r } from "./vue-components51.es.js";
|
|
3
|
+
import { deleteSpan as i, getActiveSpan as a, getSpan as o, getSpanContext as s, setSpan as c, setSpanContext as l } from "./vue-components58.es.js";
|
|
4
|
+
import { isSpanContextValid as u, wrapSpanContext as d } from "./vue-components59.es.js";
|
|
5
|
+
import { ProxyTracerProvider as f } from "./vue-components63.es.js";
|
|
6
|
+
//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/trace.js
|
|
7
|
+
var p = "trace", m = class m {
|
|
8
|
+
constructor() {
|
|
9
|
+
this._proxyTracerProvider = new f(), this.wrapSpanContext = d, this.isSpanContextValid = u, this.deleteSpan = i, this.getSpan = o, this.getActiveSpan = a, this.getSpanContext = s, this.setSpan = c, this.setSpanContext = l;
|
|
10
|
+
}
|
|
11
|
+
static getInstance() {
|
|
12
|
+
return this._instance ||= new m(), this._instance;
|
|
13
|
+
}
|
|
14
|
+
setGlobalTracerProvider(e) {
|
|
15
|
+
let n = t(p, this._proxyTracerProvider, r.instance());
|
|
16
|
+
return n && this._proxyTracerProvider.setDelegate(e), n;
|
|
17
|
+
}
|
|
18
|
+
getTracerProvider() {
|
|
19
|
+
return e(p) || this._proxyTracerProvider;
|
|
20
|
+
}
|
|
21
|
+
getTracer(e, t) {
|
|
22
|
+
return this.getTracerProvider().getTracer(e, t);
|
|
23
|
+
}
|
|
24
|
+
disable() {
|
|
25
|
+
n(p, r.instance()), this._proxyTracerProvider = new f();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { m as TraceAPI };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.59/node_modules/effect/dist/Function.js
|
|
2
|
+
var e = function(e, t) {
|
|
3
|
+
if (typeof e == "function") return function() {
|
|
4
|
+
return e(arguments) ? t.apply(this, arguments) : (e) => t(e, ...arguments);
|
|
5
|
+
};
|
|
6
|
+
switch (e) {
|
|
7
|
+
case 0:
|
|
8
|
+
case 1: throw RangeError(`Invalid arity ${e}`);
|
|
9
|
+
case 2: return function(e, n) {
|
|
10
|
+
return arguments.length >= 2 ? t(e, n) : function(n) {
|
|
11
|
+
return t(n, e);
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
case 3: return function(e, n, r) {
|
|
15
|
+
return arguments.length >= 3 ? t(e, n, r) : function(r) {
|
|
16
|
+
return t(r, e, n);
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
default: return function() {
|
|
20
|
+
if (arguments.length >= e) return t.apply(this, arguments);
|
|
21
|
+
let n = arguments;
|
|
22
|
+
return function(e) {
|
|
23
|
+
return t(e, ...n);
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { e as dual };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { dual as e } from "./vue-components67.es.js";
|
|
2
|
+
import { isFunction as t } from "./vue-components68.es.js";
|
|
3
|
+
import { Cause as n, Effect as r, Exit as i, Fiber as a } from "effect";
|
|
4
|
+
//#region ../effect-app/dist/utils.js
|
|
5
|
+
var o = Symbol.for("clone-trait"), s = e(2, (e, t) => o in e ? e[o](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(e)));
|
|
6
|
+
e(2, (e, n) => s(e, {
|
|
7
|
+
...e,
|
|
8
|
+
...t(n) ? n(e) : n
|
|
9
|
+
}));
|
|
10
|
+
var c = (e, t) => {
|
|
11
|
+
let n = () => r.runSync(a.interrupt(e));
|
|
12
|
+
return t.aborted ? (n(), e) : (t.addEventListener("abort", n), e);
|
|
13
|
+
}, l = (e, t) => (t && c(e, t), new Promise((t, r) => e.addObserver((e) => {
|
|
14
|
+
i.isSuccess(e) ? t(e.value) : r(n.squash(e.cause));
|
|
15
|
+
})));
|
|
16
|
+
(function* () {}).constructor;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { l as runtimeFiberAsPromise };
|
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
if (!n) return;
|
|
11
|
-
let r = e();
|
|
12
|
-
t(() => {
|
|
13
|
-
let e = (e) => {
|
|
14
|
-
r.value && (confirm("Es sind ungespeicherte Änderungen vorhanden. Wirklich schließen?") || (e.prevent = !0));
|
|
15
|
-
};
|
|
16
|
-
return n.on("dialog-closing", e), () => n.off("dialog-closing", e);
|
|
1
|
+
import { onMounted as e, onUnmounted as t } from "vue";
|
|
2
|
+
//#region src/components/OmegaForm/onMountedWithCleanup.ts
|
|
3
|
+
function n(n) {
|
|
4
|
+
let r;
|
|
5
|
+
e(() => {
|
|
6
|
+
let e = n();
|
|
7
|
+
e && (r = e);
|
|
8
|
+
}), t(() => {
|
|
9
|
+
r && r();
|
|
17
10
|
});
|
|
18
|
-
}
|
|
19
|
-
let t = o();
|
|
20
|
-
return t ||= s(), () => {
|
|
21
|
-
let n = {};
|
|
22
|
-
t.emit("dialog-closing", n), n.prevent ? typeof n.prevent == "object" && "then" in n.prevent && n.prevent.then((t) => {
|
|
23
|
-
t !== !1 && e();
|
|
24
|
-
}) : e();
|
|
25
|
-
};
|
|
26
|
-
};
|
|
11
|
+
}
|
|
27
12
|
//#endregion
|
|
28
|
-
export {
|
|
13
|
+
export { n as onMountedWithCleanup };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { context as e } from "./vue-components64.es.js";
|
|
2
|
+
import { trace as t } from "./vue-components66.es.js";
|
|
3
|
+
import { runtimeFiberAsPromise as n } from "./vue-components69.es.js";
|
|
4
|
+
import { Data as r, Effect as i, Fiber as a, Option as o } from "effect-app";
|
|
5
|
+
//#region src/components/OmegaForm/submit.ts
|
|
6
|
+
var s = class extends r.TaggedError("FormErrors") {}, c = (n, r) => n ? e.with(t.setSpan(e.active(), n), r) : r(), l = (e, t, r) => {
|
|
7
|
+
if (e) return ({ formApi: o, meta: s, value: l }) => c(s?.currentSpan, async () => {
|
|
8
|
+
let c = e({
|
|
9
|
+
formApi: o,
|
|
10
|
+
meta: s,
|
|
11
|
+
value: await r(t(l))
|
|
12
|
+
});
|
|
13
|
+
if (a.isFiber(c)) return await n(c);
|
|
14
|
+
if (i.isEffect(c)) {
|
|
15
|
+
let e = await r(c);
|
|
16
|
+
return a.isFiber(e) ? await n(e) : e;
|
|
17
|
+
}
|
|
18
|
+
return c;
|
|
19
|
+
});
|
|
20
|
+
}, u = (n) => {
|
|
21
|
+
let r = n.handleSubmit, a = async (e) => await r(e), c = (n) => a({
|
|
22
|
+
currentSpan: t.getSpan(e.active()),
|
|
23
|
+
...n
|
|
24
|
+
}), l = (e) => i.currentSpan.pipe(i.option, i.flatMap((t) => i.promise(() => a(o.isSome(t) ? {
|
|
25
|
+
currentSpan: t.value,
|
|
26
|
+
...e
|
|
27
|
+
} : e))));
|
|
28
|
+
return {
|
|
29
|
+
handleSubmit: c,
|
|
30
|
+
handleSubmitEffect: (e) => e?.checkErrors ? l(e?.meta).pipe(i.flatMap(i.fnUntraced(function* () {
|
|
31
|
+
let e = n.getAllErrors();
|
|
32
|
+
if (Object.keys(e.fields).length || e.form.errors.length) return yield* i.fail(new s({
|
|
33
|
+
form: e.form,
|
|
34
|
+
fields: e.fields
|
|
35
|
+
}));
|
|
36
|
+
}))) : l(e?.meta)
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { s as FormErrors, u as makeSubmitHandlers, l as wrapOnSubmit };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useIntl as e } from "./vue-components6.es.js";
|
|
2
|
+
import { generateMetaFromSchema as t } from "./vue-components14.es.js";
|
|
3
|
+
import { defaultsValueFromSchema as n } from "./vue-components15.es.js";
|
|
4
|
+
import { toFormSchema as r } from "./vue-components16.es.js";
|
|
5
|
+
import { usePersistency as i } from "./vue-components18.es.js";
|
|
6
|
+
import { annotateLiteralUnionMessages as a, toLocalizedStandardSchemaV1 as o } from "./vue-components19.es.js";
|
|
7
|
+
import { eHoc as s, makeFieldMap as c } from "./vue-components20.es.js";
|
|
8
|
+
import { fHoc as l } from "./vue-components21.es.js";
|
|
9
|
+
import u from "./vue-components23.es.js";
|
|
10
|
+
import d from "./vue-components25.es.js";
|
|
11
|
+
import f from "./vue-components29.es.js";
|
|
12
|
+
import p from "./vue-components36.es.js";
|
|
13
|
+
import m from "./vue-components40.es.js";
|
|
14
|
+
import h from "./vue-components44.es.js";
|
|
15
|
+
import { makeSubmitHandlers as g, wrapOnSubmit as _ } from "./vue-components70.es.js";
|
|
16
|
+
import { watch as v } from "vue";
|
|
17
|
+
import { Context as y, S as b } from "effect-app";
|
|
18
|
+
import { revalidateLogic as x, useForm as S } from "@tanstack/vue-form";
|
|
19
|
+
import { makeRunPromise as C } from "@effect-app/vue/runtime";
|
|
20
|
+
//#region src/components/OmegaForm/useOmegaForm.ts
|
|
21
|
+
var w = Symbol("OmegaForm"), T = C(y.empty()), E = (y, C, w) => {
|
|
22
|
+
if (!y) throw Error("Schema is required");
|
|
23
|
+
let { trans: E } = e(), D = r(y), O = o(a(D, E), E), k = b.decodeUnknownEffect(D), { meta: A, unionMeta: j } = t(D), M = { form: void 0 }, N = i({
|
|
24
|
+
meta: A,
|
|
25
|
+
persistency: w?.persistency,
|
|
26
|
+
preventWindowExit: w?.preventWindowExit,
|
|
27
|
+
defaultValuesPriority: w?.defaultValuesPriority,
|
|
28
|
+
tanstackDefaultValues: C?.defaultValues,
|
|
29
|
+
schemaDefaultValues: () => n(y),
|
|
30
|
+
getForm: () => M.form
|
|
31
|
+
}), P = S({
|
|
32
|
+
...C,
|
|
33
|
+
validationLogic: x(),
|
|
34
|
+
validators: {
|
|
35
|
+
onDynamic: O,
|
|
36
|
+
...C?.validators
|
|
37
|
+
},
|
|
38
|
+
onSubmit: _(C?.onSubmit, k, T),
|
|
39
|
+
defaultValues: N.defaultValues.value
|
|
40
|
+
});
|
|
41
|
+
M.form = P;
|
|
42
|
+
let F = () => {
|
|
43
|
+
Object.keys(A).forEach((e) => {
|
|
44
|
+
P.setFieldValue(e, void 0);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
if (w?.preventWindowExit === "prevent-and-reset") {
|
|
48
|
+
let e = P.useStore((e) => e.isSubmitting), t = P.useStore((e) => e.submissionAttempts), n = P.useStore((e) => e.canSubmit), r = P.useStore((e) => e.values);
|
|
49
|
+
v([e, t], ([e, t], [i]) => {
|
|
50
|
+
i && !e && t > 0 && n.value && P.reset(r.value);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
let { handleSubmit: I, handleSubmitEffect: L } = g(P), { fieldMap: R, registerField: z } = c(), B = Object.assign(P, {
|
|
54
|
+
i18nNamespace: w?.i18nNamespace,
|
|
55
|
+
ignorePreventCloseEvents: w?.ignorePreventCloseEvents,
|
|
56
|
+
meta: A,
|
|
57
|
+
unionMeta: j,
|
|
58
|
+
clear: F,
|
|
59
|
+
handleSubmit: I,
|
|
60
|
+
handleSubmitEffect: L,
|
|
61
|
+
registerField: z
|
|
62
|
+
}), V = {
|
|
63
|
+
form: B,
|
|
64
|
+
fieldMap: R
|
|
65
|
+
};
|
|
66
|
+
return Object.assign(B, {
|
|
67
|
+
_paths: void 0,
|
|
68
|
+
_keys: void 0,
|
|
69
|
+
_schema: y,
|
|
70
|
+
errorContext: V,
|
|
71
|
+
Form: l(B)(h),
|
|
72
|
+
Input: l(B)(w?.input ?? p),
|
|
73
|
+
TaggedUnion: l(B)(m),
|
|
74
|
+
Field: P.Field,
|
|
75
|
+
Errors: s(V)(f),
|
|
76
|
+
Array: l(B)(u),
|
|
77
|
+
AutoGen: l(B)(d)
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
export { w as OmegaFormKey, E as useOmegaForm };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import e from "./vue-components36.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) => {
|
|
6
|
+
let [a, o, s] = i, c = {
|
|
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, ...o }) => n(r, {
|
|
15
|
+
...Object.fromEntries(Object.entries(i).filter(([e]) => !Object.prototype.hasOwnProperty.call(o, e) && e !== "form")),
|
|
16
|
+
field: e,
|
|
17
|
+
state: t,
|
|
18
|
+
inputProps: o
|
|
19
|
+
}, {
|
|
20
|
+
...a.label && { label: (e) => a.label(e) },
|
|
21
|
+
...a.default && { default: (e) => a.default(e) }
|
|
22
|
+
}),
|
|
23
|
+
...a.label && { label: (e) => a.label(e) }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return t(a, o, {
|
|
28
|
+
...s,
|
|
29
|
+
input: c
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { r as createUseFormWithCustomInput };
|
|
@@ -0,0 +1,19 @@
|
|
|
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-components34.es.js";
|
|
10
|
+
import "./vue-components36.es.js";
|
|
11
|
+
import "./vue-components38.es.js";
|
|
12
|
+
import "./vue-components40.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,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-components34.es.js";
|
|
13
|
+
import _ from "./vue-components36.es.js";
|
|
14
|
+
import v from "./vue-components38.es.js";
|
|
15
|
+
import y from "./vue-components40.es.js";
|
|
16
|
+
import { FormErrors as b } from "./vue-components70.es.js";
|
|
17
|
+
import { OmegaFormKey as x, useOmegaForm as S } from "./vue-components71.es.js";
|
|
18
|
+
import { createUseFormWithCustomInput as C } from "./vue-components72.es.js";
|
|
19
|
+
import { duplicateSchema as w } from "./vue-components73.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 };
|
|
@@ -1,47 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_.value && !s.persistent && e.code === "Escape" && b();
|
|
23
|
-
};
|
|
24
|
-
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
25
|
-
}), (e, t) => {
|
|
26
|
-
let n = f("v-dialog");
|
|
27
|
-
return l(), r(n, {
|
|
28
|
-
modelValue: _.value,
|
|
29
|
-
"onUpdate:modelValue": t[0] ||= (e) => _.value = e,
|
|
30
|
-
persistent: "",
|
|
31
|
-
"onClick:outside": p(b)
|
|
32
|
-
}, i({
|
|
33
|
-
default: g(({ isActive: t }) => [d(e.$slots, "default", {
|
|
34
|
-
open: _.value,
|
|
35
|
-
cancel: p(b),
|
|
36
|
-
isActive: t
|
|
37
|
-
})]),
|
|
38
|
-
_: 2
|
|
39
|
-
}, [u(y.value, (t, n) => ({
|
|
40
|
-
name: n,
|
|
41
|
-
fn: g((t) => [d(e.$slots, n, c(o(t)))])
|
|
42
|
-
}))]), 1032, ["modelValue", "onClick:outside"]);
|
|
1
|
+
import e from "./vue-components5.es.js";
|
|
2
|
+
import { useIntl as t } from "./vue-components6.es.js";
|
|
3
|
+
import { onMountedWithCleanup as n } from "./vue-components7.es.js";
|
|
4
|
+
import { inject as r, provide as i } from "vue";
|
|
5
|
+
//#region src/components/OmegaForm/blockDialog.ts
|
|
6
|
+
var a = () => e(), o = Symbol("DialogBus"), s = () => r(o, null), c = () => {
|
|
7
|
+
let e = a();
|
|
8
|
+
return i(o, e), e;
|
|
9
|
+
}, l = (e) => {
|
|
10
|
+
let r = s();
|
|
11
|
+
if (!r) return;
|
|
12
|
+
let { formatMessage: i, trans: a } = t(), o = e(), c = "There are unsaved changes. Are you sure you want to close?";
|
|
13
|
+
n(() => {
|
|
14
|
+
let e = (e) => {
|
|
15
|
+
if (o.value) {
|
|
16
|
+
let t = i ? i({
|
|
17
|
+
id: "form.unsaved_changes_confirm",
|
|
18
|
+
defaultMessage: c
|
|
19
|
+
}) : a?.("form.unsaved_changes_confirm") ?? c;
|
|
20
|
+
confirm(t) || (e.prevent = !0);
|
|
21
|
+
}
|
|
43
22
|
};
|
|
44
|
-
|
|
45
|
-
});
|
|
23
|
+
return r.on("dialog-closing", e), () => r.off("dialog-closing", e);
|
|
24
|
+
});
|
|
25
|
+
}, u = (e) => {
|
|
26
|
+
let t = s();
|
|
27
|
+
return t ||= c(), () => {
|
|
28
|
+
let n = {};
|
|
29
|
+
t.emit("dialog-closing", n), n.prevent ? typeof n.prevent == "object" && "then" in n.prevent && n.prevent.then((t) => {
|
|
30
|
+
t !== !1 && e();
|
|
31
|
+
}) : e();
|
|
32
|
+
};
|
|
33
|
+
};
|
|
46
34
|
//#endregion
|
|
47
|
-
export {
|
|
35
|
+
export { u as useOnClose, l as usePreventClose };
|
|
@@ -1,5 +1,47 @@
|
|
|
1
|
-
import e from "./vue-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { onMountedWithCleanup as e } from "./vue-components7.es.js";
|
|
2
|
+
import { useOnClose as t } from "./vue-components8.es.js";
|
|
3
|
+
import { computed as n, createBlock as r, createSlots as i, defineComponent as a, guardReactiveProps as o, mergeModels as s, normalizeProps as c, openBlock as l, renderList as u, renderSlot as d, resolveComponent as f, unref as p, useModel as m, useSlots as h, withCtx as g } from "vue";
|
|
4
|
+
//#region src/components/Dialog.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _ = /* @__PURE__ */ a({
|
|
6
|
+
__name: "Dialog",
|
|
7
|
+
props: /* @__PURE__ */ s({ persistent: { type: Boolean } }, {
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: !1
|
|
11
|
+
},
|
|
12
|
+
modelModifiers: {}
|
|
13
|
+
}),
|
|
14
|
+
emits: ["update:modelValue"],
|
|
15
|
+
setup(a) {
|
|
16
|
+
let s = a, _ = m(a, "modelValue"), v = h(), y = n(() => {
|
|
17
|
+
let { default: e, ...t } = v;
|
|
18
|
+
return t;
|
|
19
|
+
}), b = t(() => _.value = !1);
|
|
20
|
+
return e(() => {
|
|
21
|
+
let e = (e) => {
|
|
22
|
+
_.value && !s.persistent && e.code === "Escape" && b();
|
|
23
|
+
};
|
|
24
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
25
|
+
}), (e, t) => {
|
|
26
|
+
let n = f("v-dialog");
|
|
27
|
+
return l(), r(n, {
|
|
28
|
+
modelValue: _.value,
|
|
29
|
+
"onUpdate:modelValue": t[0] ||= (e) => _.value = e,
|
|
30
|
+
persistent: "",
|
|
31
|
+
"onClick:outside": p(b)
|
|
32
|
+
}, i({
|
|
33
|
+
default: g(({ isActive: t }) => [d(e.$slots, "default", {
|
|
34
|
+
open: _.value,
|
|
35
|
+
cancel: p(b),
|
|
36
|
+
isActive: t
|
|
37
|
+
})]),
|
|
38
|
+
_: 2
|
|
39
|
+
}, [u(y.value, (t, n) => ({
|
|
40
|
+
name: n,
|
|
41
|
+
fn: g((t) => [d(e.$slots, n, c(o(t)))])
|
|
42
|
+
}))]), 1032, ["modelValue", "onClick:outside"]);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
4
46
|
//#endregion
|
|
5
|
-
export {
|
|
47
|
+
export { _ as default };
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.159",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
|
-
"effect": "^4.0.0-beta.
|
|
6
|
+
"effect": "^4.0.0-beta.59",
|
|
7
7
|
"intl-messageformat": "^11.2.2",
|
|
8
8
|
"mdi-js": "^1.0.1",
|
|
9
9
|
"primeflex": "^4.0.0",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"@storybook/vue3-vite": "^10.3.5",
|
|
18
18
|
"@types/node": "^25.6.0",
|
|
19
19
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
20
|
-
"@vue/test-utils": "^2.4.
|
|
20
|
+
"@vue/test-utils": "^2.4.9",
|
|
21
21
|
"@vueuse/core": "^14.2.1",
|
|
22
|
-
"jsdom": "^29.0
|
|
22
|
+
"jsdom": "^29.1.0",
|
|
23
23
|
"rimraf": "^6.1.3",
|
|
24
24
|
"sass": "^1.99.0",
|
|
25
25
|
"storybook": "^10.3.5",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"vue-toastification": "^2.0.0-rc.5",
|
|
34
34
|
"vue-tsc": "^3.2.7",
|
|
35
35
|
"vuetify": "^4.0.6",
|
|
36
|
-
"@effect-app/eslint-shared-config": "0.6.0-beta.
|
|
36
|
+
"@effect-app/eslint-shared-config": "0.6.0-beta.17"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"src",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"highlight.js": "^11.11.1",
|
|
58
58
|
"mitt": "^3.0.1",
|
|
59
59
|
"vue3-highlightjs": "^1.0.5",
|
|
60
|
-
"@effect-app/vue": "4.0.0-beta.
|
|
61
|
-
"effect-app": "4.0.0-beta.
|
|
60
|
+
"@effect-app/vue": "4.0.0-beta.159",
|
|
61
|
+
"effect-app": "4.0.0-beta.159"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"check": "vue-tsc",
|
|
@@ -41,7 +41,9 @@ const handleClick = () => {
|
|
|
41
41
|
const input = ("input" in props && props.input
|
|
42
42
|
? props.input
|
|
43
43
|
: undefined) as unknown as I
|
|
44
|
-
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- command.handle has a generic signature mismatched by erased input type
|
|
45
|
+
const handle = props.command.handle as any
|
|
46
|
+
handle(input)
|
|
45
47
|
}
|
|
46
48
|
</script>
|
|
47
49
|
<script lang="ts">
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
>
|
|
49
49
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
50
50
|
import { computed, onMounted, provide } from "vue"
|
|
51
|
-
import { type OmegaArrayProps } from "./
|
|
51
|
+
import { type OmegaArrayProps } from "./types"
|
|
52
52
|
|
|
53
53
|
const props = defineProps<OmegaArrayProps<From, To, Name>>()
|
|
54
54
|
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
24
24
|
import { Order } from "effect-app"
|
|
25
25
|
import { computed } from "vue"
|
|
26
|
-
import { type FieldMeta
|
|
26
|
+
import { type FieldMeta } from "./meta/types"
|
|
27
|
+
import { type FieldPath, type OmegaAutoGenMeta, type OmegaInputProps } from "./types"
|
|
27
28
|
|
|
28
29
|
type NewMeta = OmegaAutoGenMeta<From, To, Name>
|
|
29
30
|
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
import type { StandardSchemaV1Issue } from "@tanstack/vue-form"
|
|
103
103
|
import { computed, getCurrentInstance } from "vue"
|
|
104
104
|
import { useIntl } from "../../utils"
|
|
105
|
-
import { type OmegaError } from "./
|
|
105
|
+
import { type OmegaError } from "./types"
|
|
106
106
|
|
|
107
107
|
const instance = getCurrentInstance()
|
|
108
108
|
const vuetified = instance?.appContext.components["VAlert"]
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
22
22
|
import { inject } from "vue"
|
|
23
23
|
import type { MergedInputProps } from "./InputProps"
|
|
24
|
-
import type { BaseProps, DefaultTypeProps, OmegaInputProps } from "./OmegaFormStuff"
|
|
25
24
|
import OmegaInput from "./OmegaInput.vue"
|
|
25
|
+
import type { BaseProps, DefaultTypeProps, OmegaInputProps } from "./types"
|
|
26
26
|
import { OmegaFormKey } from "./useOmegaForm"
|
|
27
27
|
|
|
28
28
|
const form = inject(OmegaFormKey) as unknown as OmegaInputProps<
|