@effect-app/vue-components 0.4.2 → 0.4.4
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/OmegaFormInput.vue.d.ts +26 -0
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +6 -4
- package/dist/vue-components.es.js +11 -11
- package/dist/vue-components.es10.js +3 -3
- package/dist/vue-components.es11.js +14 -14
- package/dist/vue-components.es13.js +7 -2
- package/dist/vue-components.es14.js +2 -88
- package/dist/vue-components.es15.js +88 -5
- package/dist/vue-components.es17.js +5 -96
- package/dist/vue-components.es18.js +32 -11
- package/dist/vue-components.es19.js +2 -2
- package/dist/vue-components.es2.js +11 -11
- package/dist/vue-components.es20.js +2 -115
- package/dist/vue-components.es21.js +98 -0
- package/dist/vue-components.es22.js +11 -4
- package/dist/vue-components.es23.js +4 -0
- package/dist/vue-components.es24.js +117 -0
- package/dist/vue-components.es26.js +6 -0
- package/dist/vue-components.es4.js +46 -36
- package/dist/vue-components.es5.js +34 -148
- package/dist/vue-components.es6.js +128 -211
- package/dist/vue-components.es7.js +216 -5
- package/dist/vue-components.es8.js +6 -46
- package/dist/vue-components.es9.js +3 -2
- package/package.json +3 -3
- package/src/components/OmegaForm/OmegaFormInput.vue +45 -0
- package/src/components/OmegaForm/useOmegaForm.ts +12 -35
- package/src/stories/OmegaForm/form.Input.vue +14 -2
- package/dist/vue-components.es12.js +0 -9
- package/dist/vue-components.es16.js +0 -4
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FieldValidators, NestedKeyOf, TypeOverride } from "./OmegaFormStuff";
|
|
2
|
+
import type { InputProps } from "./InputProps";
|
|
3
|
+
declare const _default: <From, 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<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
5
|
+
name: NestedKeyOf<To>;
|
|
6
|
+
label: string;
|
|
7
|
+
validators?: FieldValidators<From>;
|
|
8
|
+
options?: {
|
|
9
|
+
title: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}[];
|
|
12
|
+
type?: TypeOverride;
|
|
13
|
+
} & Partial<{}>> & import("vue").PublicProps;
|
|
14
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
15
|
+
attrs: any;
|
|
16
|
+
slots: {
|
|
17
|
+
default: (props: InputProps<To>) => any;
|
|
18
|
+
};
|
|
19
|
+
emit: {};
|
|
20
|
+
}>) => import("vue").VNode & {
|
|
21
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_PrettifyLocal<T> = {
|
|
25
|
+
[K in keyof T]: T[K];
|
|
26
|
+
} & {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Record, S } from "effect-app";
|
|
2
|
-
import { type NestedKeyOf, type FilterItems, type FormProps, type MetaRecord, type OmegaFormApi
|
|
3
|
-
import { type
|
|
2
|
+
import { type NestedKeyOf, type FilterItems, type FormProps, type MetaRecord, type OmegaFormApi } from "./OmegaFormStuff";
|
|
3
|
+
import { type InjectionKey } from "vue";
|
|
4
|
+
import OmegaFormInput from "./OmegaFormInput.vue";
|
|
4
5
|
type keysRule<T> = {
|
|
5
6
|
keys?: NestedKeyOf<T>[];
|
|
6
7
|
banKeys?: "You should only use one of banKeys or keys, not both, moron";
|
|
@@ -24,8 +25,9 @@ interface OF<To, From> extends OmegaFormApi<To, From> {
|
|
|
24
25
|
filterItems?: FilterItems;
|
|
25
26
|
clear: () => void;
|
|
26
27
|
}
|
|
27
|
-
export
|
|
28
|
-
|
|
28
|
+
export declare const OmegaFormKey: InjectionKey<OF<any, any>>;
|
|
29
|
+
export interface OmegaFormReturn<To extends Record<PropertyKey, any>, From> extends OF<To, From> {
|
|
30
|
+
Input: typeof OmegaFormInput<From, To>;
|
|
29
31
|
}
|
|
30
32
|
export declare const useOmegaForm: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>>(schema: S.Schema<From, To, never>, tanstackFormOptions?: NoInfer<FormProps<To, From>>, omegaConfig?: OmegaConfig<From>) => OmegaFormReturn<To, From>;
|
|
31
33
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as r from "./vue-components.es2.js";
|
|
2
2
|
import { provideIntl as s, useIntl as l } from "./vue-components.es3.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { default as i } from "./vue-components.es4.js";
|
|
4
|
+
import * as m from "./vue-components.es5.js";
|
|
5
|
+
import { useOmegaForm as g } from "./vue-components.es6.js";
|
|
6
|
+
import { duplicateSchema as d, generateInputStandardSchemaFromFieldMeta as O, generateMetaFromSchema as F, nullableInput as E } from "./vue-components.es7.js";
|
|
7
7
|
import { default as h } from "./vue-components.es8.js";
|
|
8
8
|
import { default as C } from "./vue-components.es9.js";
|
|
9
9
|
import { OmegaErrorsCE as b, OmegaFormCE as j, OmegaInputCE as M, registerOmegaForm as k } from "./vue-components.es10.js";
|
|
@@ -19,17 +19,17 @@ export {
|
|
|
19
19
|
C as OmegaErrors,
|
|
20
20
|
b as OmegaErrorsCE,
|
|
21
21
|
m as OmegaErrorsContext,
|
|
22
|
-
|
|
22
|
+
h as OmegaForm,
|
|
23
23
|
j as OmegaFormCE,
|
|
24
|
-
|
|
24
|
+
i as OmegaInput,
|
|
25
25
|
M as OmegaInputCE,
|
|
26
26
|
n as default,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
d as duplicateSchema,
|
|
28
|
+
O as generateInputStandardSchemaFromFieldMeta,
|
|
29
|
+
F as generateMetaFromSchema,
|
|
30
|
+
E as nullableInput,
|
|
31
31
|
s as provideIntl,
|
|
32
32
|
k as registerOmegaForm,
|
|
33
33
|
l as useIntl,
|
|
34
|
-
|
|
34
|
+
g as useOmegaForm
|
|
35
35
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineCustomElement as e } from "vue";
|
|
2
|
-
import m from "./vue-components.
|
|
3
|
-
import t from "./vue-components.
|
|
2
|
+
import m from "./vue-components.es8.js";
|
|
3
|
+
import t from "./vue-components.es4.js";
|
|
4
4
|
import o from "./vue-components.es9.js";
|
|
5
|
-
import { duplicateSchema as d, generateInputStandardSchemaFromFieldMeta as O, generateMetaFromSchema as F, nullableInput as C } from "./vue-components.
|
|
5
|
+
import { duplicateSchema as d, generateInputStandardSchemaFromFieldMeta as O, generateMetaFromSchema as F, nullableInput as C } from "./vue-components.es7.js";
|
|
6
6
|
import "@tanstack/vue-form";
|
|
7
7
|
import "effect-app";
|
|
8
8
|
const r = e(m), a = e(t), n = e(o);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as h, computed as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { getOmegaStore as V } from "./vue-components.
|
|
4
|
-
import { provideOmegaErrors as w } from "./vue-components.
|
|
5
|
-
import { useOmegaForm as I } from "./vue-components.
|
|
1
|
+
import { defineComponent as h, computed as u, watch as F, createElementBlock as c, openBlock as d, withModifiers as y, createElementVNode as O, unref as i, renderSlot as l, createCommentVNode as E, Fragment as M } from "vue";
|
|
2
|
+
import { useStore as v } from "@tanstack/vue-form";
|
|
3
|
+
import { getOmegaStore as V } from "./vue-components.es22.js";
|
|
4
|
+
import { provideOmegaErrors as w } from "./vue-components.es5.js";
|
|
5
|
+
import { useOmegaForm as I } from "./vue-components.es6.js";
|
|
6
6
|
const k = ["disabled"], j = /* @__PURE__ */ h({
|
|
7
7
|
__name: "OmegaWrapper",
|
|
8
8
|
props: {
|
|
@@ -21,24 +21,24 @@ const k = ["disabled"], j = /* @__PURE__ */ h({
|
|
|
21
21
|
transform: {},
|
|
22
22
|
onSubmit: { type: Function }
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
25
|
-
const t =
|
|
24
|
+
setup(p) {
|
|
25
|
+
const t = p, n = u(() => {
|
|
26
26
|
if (!(t.form || !t.schema))
|
|
27
27
|
return I(t.schema, t, t.omegaConfig);
|
|
28
|
-
}), r =
|
|
28
|
+
}), r = u(() => t.form ?? n.value), b = v(
|
|
29
29
|
r.value.store,
|
|
30
30
|
(e) => e.isSubmitting
|
|
31
31
|
), f = V(
|
|
32
32
|
r.value,
|
|
33
33
|
t.subscribe
|
|
34
|
-
), g =
|
|
34
|
+
), g = v(
|
|
35
35
|
r.value.store,
|
|
36
36
|
(e) => e.submissionAttempts
|
|
37
|
-
),
|
|
37
|
+
), m = u(() => r.value.useStore((e) => e.errors));
|
|
38
38
|
return F(
|
|
39
|
-
() => [r.value.filterItems,
|
|
39
|
+
() => [r.value.filterItems, m.value.value],
|
|
40
40
|
() => {
|
|
41
|
-
const e = r.value.filterItems, s =
|
|
41
|
+
const e = r.value.filterItems, s = m.value.value;
|
|
42
42
|
return e ? s ? (Object.values(s).filter(
|
|
43
43
|
(o) => !!o
|
|
44
44
|
).flatMap(
|
|
@@ -55,11 +55,11 @@ const k = ["disabled"], j = /* @__PURE__ */ h({
|
|
|
55
55
|
});
|
|
56
56
|
}), {}) : {} : {};
|
|
57
57
|
}
|
|
58
|
-
), w(g,
|
|
58
|
+
), w(g, m.value, t.showErrorsOn), (e, s) => (d(), c("form", {
|
|
59
59
|
novalidate: "",
|
|
60
60
|
onSubmit: s[0] || (s[0] = y((S) => r.value.handleSubmit(), ["prevent", "stop"]))
|
|
61
61
|
}, [
|
|
62
|
-
O("fieldset", { disabled: i(
|
|
62
|
+
O("fieldset", { disabled: i(b) }, [
|
|
63
63
|
t.form ? (d(), c(M, { key: 0 }, [
|
|
64
64
|
l(e.$slots, "externalForm", { subscribedValues: i(f) }, void 0, !0),
|
|
65
65
|
l(e.$slots, "default", {}, void 0, !0)
|
|
@@ -1,90 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useOmegaErrors as z } from "./vue-components.es4.js";
|
|
3
|
-
import { mdiLink as D } from "@mdi/js";
|
|
4
|
-
import { useIntl as G } from "./vue-components.es3.js";
|
|
5
|
-
const L = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "error-alert"
|
|
8
|
-
}, M = { class: "text-h6 mb-3" }, P = { class: "font-weight-medium" }, S = { class: "error-message" }, T = ["href"], $ = { key: 1 }, H = /* @__PURE__ */ C({
|
|
9
|
-
__name: "OmegaErrors",
|
|
10
|
-
setup(j) {
|
|
11
|
-
const m = x(), f = m == null ? void 0 : m.appContext.components.VAlert, { errors: n, generalErrors: _, showErrors: E } = z(), { trans: h } = G(), p = B(() => _.value ? _.value.filter(
|
|
12
|
-
(i) => !!i
|
|
13
|
-
).flatMap(
|
|
14
|
-
(i) => Object.values(i).filter((a) => !!a).flatMap(
|
|
15
|
-
(a) => a.filter(
|
|
16
|
-
(r) => !!(r != null && r.message)
|
|
17
|
-
).map((r) => r.message)
|
|
18
|
-
)
|
|
19
|
-
) : []);
|
|
20
|
-
return (i, a) => (t(), o(b, null, {
|
|
21
|
-
default: l(() => [
|
|
22
|
-
e(E) && (e(n).length || p.value.length) ? (t(), c("div", L, [
|
|
23
|
-
I(i.$slots, "default", V(N({ errors: e(n), showedGeneralErrors: p.value })), () => [
|
|
24
|
-
(t(), o(s(e(f) ? "v-alert" : "div"), {
|
|
25
|
-
class: O([e(f) ? "mb-4" : "error-alert-content", "mb-4"]),
|
|
26
|
-
type: "error",
|
|
27
|
-
variant: "tonal",
|
|
28
|
-
role: "alert",
|
|
29
|
-
"aria-live": "polite"
|
|
30
|
-
}, {
|
|
31
|
-
default: l(() => [
|
|
32
|
-
d("div", M, u(e(h)("form.includes_error")) + ":", 1),
|
|
33
|
-
e(n).length ? (t(), o(s(e(n).length > 1 ? "ul" : "div"), {
|
|
34
|
-
key: 0,
|
|
35
|
-
class: "error-list"
|
|
36
|
-
}, {
|
|
37
|
-
default: l(() => [
|
|
38
|
-
(t(!0), c(g, null, k(e(n), (r) => (t(), o(s(e(n).length > 1 ? "li" : "div"), {
|
|
39
|
-
key: r.inputId,
|
|
40
|
-
class: "error-item"
|
|
41
|
-
}, {
|
|
42
|
-
default: l(() => [
|
|
43
|
-
d("div", P, u(r.label), 1),
|
|
44
|
-
d("div", S, [
|
|
45
|
-
(t(), o(s(r.errors.length > 1 ? "ul" : "div"), { class: "error-list" }, {
|
|
46
|
-
default: l(() => [
|
|
47
|
-
(t(!0), c(g, null, k(r.errors, (v) => (t(), o(s(r.errors.length > 1 ? "li" : "span"), { key: v }, {
|
|
48
|
-
default: l(() => [
|
|
49
|
-
y(u(v), 1)
|
|
50
|
-
]),
|
|
51
|
-
_: 2
|
|
52
|
-
}, 1024))), 128))
|
|
53
|
-
]),
|
|
54
|
-
_: 2
|
|
55
|
-
}, 1024))
|
|
56
|
-
]),
|
|
57
|
-
d("a", {
|
|
58
|
-
href: `#${r.inputId}`,
|
|
59
|
-
class: "error-link"
|
|
60
|
-
}, [
|
|
61
|
-
(t(), o(s(e(f) ? "v-icon" : "i"), {
|
|
62
|
-
icon: e(D),
|
|
63
|
-
"aria-hidden": "true"
|
|
64
|
-
}, {
|
|
65
|
-
default: l(() => a[0] || (a[0] = [
|
|
66
|
-
d("i", null, "🔗", -1)
|
|
67
|
-
])),
|
|
68
|
-
_: 1
|
|
69
|
-
}, 8, ["icon"])),
|
|
70
|
-
y(" " + u(e(h)("form.fix_input")), 1)
|
|
71
|
-
], 8, T)
|
|
72
|
-
]),
|
|
73
|
-
_: 2
|
|
74
|
-
}, 1024))), 128))
|
|
75
|
-
]),
|
|
76
|
-
_: 1
|
|
77
|
-
})) : (t(), c("span", $, u(p.value[0]), 1))
|
|
78
|
-
]),
|
|
79
|
-
_: 1
|
|
80
|
-
}, 8, ["class"]))
|
|
81
|
-
], !0)
|
|
82
|
-
])) : w("", !0)
|
|
83
|
-
]),
|
|
84
|
-
_: 3
|
|
85
|
-
}));
|
|
86
|
-
}
|
|
87
|
-
});
|
|
1
|
+
import f from "./vue-components.es4.js";
|
|
88
2
|
export {
|
|
89
|
-
|
|
3
|
+
f as default
|
|
90
4
|
};
|
|
@@ -1,7 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent as C, getCurrentInstance as x, computed as B, createBlock as o, openBlock as t, Transition as b, withCtx as l, createElementBlock as c, createCommentVNode as w, unref as e, renderSlot as I, normalizeProps as V, guardReactiveProps as N, resolveDynamicComponent as s, normalizeClass as O, createElementVNode as d, toDisplayString as u, Fragment as g, renderList as k, createTextVNode as y } from "vue";
|
|
2
|
+
import { useOmegaErrors as z } from "./vue-components.es5.js";
|
|
3
|
+
import { mdiLink as D } from "@mdi/js";
|
|
4
|
+
import { useIntl as G } from "./vue-components.es3.js";
|
|
5
|
+
const L = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "error-alert"
|
|
8
|
+
}, M = { class: "text-h6 mb-3" }, P = { class: "font-weight-medium" }, S = { class: "error-message" }, T = ["href"], $ = { key: 1 }, H = /* @__PURE__ */ C({
|
|
9
|
+
__name: "OmegaErrors",
|
|
10
|
+
setup(j) {
|
|
11
|
+
const m = x(), f = m == null ? void 0 : m.appContext.components.VAlert, { errors: n, generalErrors: _, showErrors: E } = z(), { trans: h } = G(), p = B(() => _.value ? _.value.filter(
|
|
12
|
+
(i) => !!i
|
|
13
|
+
).flatMap(
|
|
14
|
+
(i) => Object.values(i).filter((a) => !!a).flatMap(
|
|
15
|
+
(a) => a.filter(
|
|
16
|
+
(r) => !!(r != null && r.message)
|
|
17
|
+
).map((r) => r.message)
|
|
18
|
+
)
|
|
19
|
+
) : []);
|
|
20
|
+
return (i, a) => (t(), o(b, null, {
|
|
21
|
+
default: l(() => [
|
|
22
|
+
e(E) && (e(n).length || p.value.length) ? (t(), c("div", L, [
|
|
23
|
+
I(i.$slots, "default", V(N({ errors: e(n), showedGeneralErrors: p.value })), () => [
|
|
24
|
+
(t(), o(s(e(f) ? "v-alert" : "div"), {
|
|
25
|
+
class: O([e(f) ? "mb-4" : "error-alert-content", "mb-4"]),
|
|
26
|
+
type: "error",
|
|
27
|
+
variant: "tonal",
|
|
28
|
+
role: "alert",
|
|
29
|
+
"aria-live": "polite"
|
|
30
|
+
}, {
|
|
31
|
+
default: l(() => [
|
|
32
|
+
d("div", M, u(e(h)("form.includes_error")) + ":", 1),
|
|
33
|
+
e(n).length ? (t(), o(s(e(n).length > 1 ? "ul" : "div"), {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "error-list"
|
|
36
|
+
}, {
|
|
37
|
+
default: l(() => [
|
|
38
|
+
(t(!0), c(g, null, k(e(n), (r) => (t(), o(s(e(n).length > 1 ? "li" : "div"), {
|
|
39
|
+
key: r.inputId,
|
|
40
|
+
class: "error-item"
|
|
41
|
+
}, {
|
|
42
|
+
default: l(() => [
|
|
43
|
+
d("div", P, u(r.label), 1),
|
|
44
|
+
d("div", S, [
|
|
45
|
+
(t(), o(s(r.errors.length > 1 ? "ul" : "div"), { class: "error-list" }, {
|
|
46
|
+
default: l(() => [
|
|
47
|
+
(t(!0), c(g, null, k(r.errors, (v) => (t(), o(s(r.errors.length > 1 ? "li" : "span"), { key: v }, {
|
|
48
|
+
default: l(() => [
|
|
49
|
+
y(u(v), 1)
|
|
50
|
+
]),
|
|
51
|
+
_: 2
|
|
52
|
+
}, 1024))), 128))
|
|
53
|
+
]),
|
|
54
|
+
_: 2
|
|
55
|
+
}, 1024))
|
|
56
|
+
]),
|
|
57
|
+
d("a", {
|
|
58
|
+
href: `#${r.inputId}`,
|
|
59
|
+
class: "error-link"
|
|
60
|
+
}, [
|
|
61
|
+
(t(), o(s(e(f) ? "v-icon" : "i"), {
|
|
62
|
+
icon: e(D),
|
|
63
|
+
"aria-hidden": "true"
|
|
64
|
+
}, {
|
|
65
|
+
default: l(() => a[0] || (a[0] = [
|
|
66
|
+
d("i", null, "🔗", -1)
|
|
67
|
+
])),
|
|
68
|
+
_: 1
|
|
69
|
+
}, 8, ["icon"])),
|
|
70
|
+
y(" " + u(e(h)("form.fix_input")), 1)
|
|
71
|
+
], 8, T)
|
|
72
|
+
]),
|
|
73
|
+
_: 2
|
|
74
|
+
}, 1024))), 128))
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
})) : (t(), c("span", $, u(p.value[0]), 1))
|
|
78
|
+
]),
|
|
79
|
+
_: 1
|
|
80
|
+
}, 8, ["class"]))
|
|
81
|
+
], !0)
|
|
82
|
+
])) : w("", !0)
|
|
83
|
+
]),
|
|
84
|
+
_: 3
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
3
88
|
export {
|
|
4
|
-
|
|
5
|
-
i as isObject,
|
|
6
|
-
t as isRecordOrArray
|
|
89
|
+
H as default
|
|
7
90
|
};
|
|
@@ -1,98 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { useStore as H } from "@tanstack/vue-form";
|
|
4
|
-
import { useOmegaErrors as J } from "./vue-components.es4.js";
|
|
5
|
-
import K from "./vue-components.es20.js";
|
|
6
|
-
|
|
7
|
-
const ee = /* @__PURE__ */ B({
|
|
8
|
-
inheritAttrs: !1,
|
|
9
|
-
__name: "OmegaInternalInput",
|
|
10
|
-
props: {
|
|
11
|
-
field: {},
|
|
12
|
-
meta: {},
|
|
13
|
-
label: {},
|
|
14
|
-
options: {},
|
|
15
|
-
type: {},
|
|
16
|
-
validators: {}
|
|
17
|
-
},
|
|
18
|
-
setup(q) {
|
|
19
|
-
const e = q, o = L(), x = o == null ? void 0 : o.appContext.components.VTextField, s = P(), u = e.field, a = H(u.store, (t) => t), f = l(() => {
|
|
20
|
-
var t, r;
|
|
21
|
-
return e.type ? e.type : ((t = e.meta) == null ? void 0 : t.type) === "string" ? e.meta.format === "email" ? "email" : "string" : ((r = e.meta) == null ? void 0 : r.type) || "unknown";
|
|
22
|
-
}), n = l(() => a.value.value), d = l(
|
|
23
|
-
() => (
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
-
a.value.meta.errors.map((t) => t == null ? void 0 : t.message).filter(Boolean)
|
|
26
|
-
)
|
|
27
|
-
);
|
|
28
|
-
C(
|
|
29
|
-
() => [!!n.value],
|
|
30
|
-
() => {
|
|
31
|
-
var t, r;
|
|
32
|
-
d.value.length && !n.value && !((t = e.meta) != null && t.required) && u.setValue(
|
|
33
|
-
((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
), $(() => {
|
|
37
|
-
var t, r;
|
|
38
|
-
!n.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
|
|
39
|
-
});
|
|
40
|
-
const { addError: I, removeError: O, showErrors: _, showErrorsOn: k } = J(), i = S(!1);
|
|
41
|
-
z(() => {
|
|
42
|
-
(_.value || k === "onChange") && (i.value = !0);
|
|
43
|
-
});
|
|
44
|
-
const m = () => {
|
|
45
|
-
i.value = !0;
|
|
46
|
-
};
|
|
47
|
-
$(() => {
|
|
48
|
-
n.value && m();
|
|
49
|
-
});
|
|
50
|
-
const v = l(() => !i.value && f.value !== "select" ? [] : d.value);
|
|
51
|
-
C(
|
|
52
|
-
() => a.value.meta.errors,
|
|
53
|
-
() => {
|
|
54
|
-
a.value.meta.errors.length ? I({
|
|
55
|
-
inputId: s,
|
|
56
|
-
errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
57
|
-
label: e.label
|
|
58
|
-
}) : O(s);
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
const p = l(() => {
|
|
62
|
-
var t, r, c, g, y, h, b, E, V, w;
|
|
63
|
-
return {
|
|
64
|
-
id: s,
|
|
65
|
-
required: (t = e.meta) == null ? void 0 : t.required,
|
|
66
|
-
minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((c = e.meta) == null ? void 0 : c.minLength),
|
|
67
|
-
maxLength: ((g = e.meta) == null ? void 0 : g.type) === "string" && ((y = e.meta) == null ? void 0 : y.maxLength),
|
|
68
|
-
max: ((h = e.meta) == null ? void 0 : h.type) === "number" && ((b = e.meta) == null ? void 0 : b.maximum),
|
|
69
|
-
min: ((E = e.meta) == null ? void 0 : E.type) === "number" && ((V = e.meta) == null ? void 0 : V.minimum),
|
|
70
|
-
name: e.field.name,
|
|
71
|
-
modelValue: e.field.state.value,
|
|
72
|
-
errorMessages: v.value,
|
|
73
|
-
error: !!v.value.length,
|
|
74
|
-
field: e.field,
|
|
75
|
-
setRealDirty: m,
|
|
76
|
-
type: f.value,
|
|
77
|
-
label: `${e.label}${(w = e.meta) != null && w.required ? " *" : ""}`,
|
|
78
|
-
options: e.options
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
return (t, r) => A(t.$slots, "default", D(F(p.value)), () => [
|
|
82
|
-
M("div", {
|
|
83
|
-
class: N(t.$attrs.class),
|
|
84
|
-
onFocusout: m
|
|
85
|
-
}, [
|
|
86
|
-
U(x) ? (j(), R(K, G({
|
|
87
|
-
key: 0,
|
|
88
|
-
"input-props": p.value
|
|
89
|
-
}, t.$attrs, {
|
|
90
|
-
"vuetify-value": p.value.field.state.value
|
|
91
|
-
}), null, 16, ["input-props", "vuetify-value"])) : T("", !0)
|
|
92
|
-
], 34)
|
|
93
|
-
]);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
1
|
+
import { isFunction as c } from "./vue-components.es19.js";
|
|
2
|
+
const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
|
|
96
3
|
export {
|
|
97
|
-
|
|
4
|
+
s as isFunction,
|
|
5
|
+
i as isObject,
|
|
6
|
+
t as isRecordOrArray
|
|
98
7
|
};
|
|
@@ -1,13 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
import { defineComponent as a, inject as t, createBlock as n, openBlock as m, mergeProps as p, unref as s, withCtx as i, renderSlot as l, normalizeProps as f, guardReactiveProps as u } from "vue";
|
|
2
|
+
import d from "./vue-components.es4.js";
|
|
3
|
+
import { OmegaFormKey as c } from "./vue-components.es6.js";
|
|
4
|
+
const w = /* @__PURE__ */ a({
|
|
5
|
+
__name: "OmegaFormInput",
|
|
6
|
+
props: {
|
|
7
|
+
name: {},
|
|
8
|
+
label: {},
|
|
9
|
+
validators: {},
|
|
10
|
+
options: {},
|
|
11
|
+
type: {}
|
|
12
|
+
},
|
|
13
|
+
setup(g) {
|
|
14
|
+
const o = t(c);
|
|
15
|
+
if (!o)
|
|
16
|
+
throw new Error("OmegaFormInput must be used within an OmegaForm context");
|
|
17
|
+
return (e, b) => (m(), n(d, p(e.$props, {
|
|
18
|
+
form: s(o),
|
|
19
|
+
name: e.name,
|
|
20
|
+
label: e.label,
|
|
21
|
+
validators: e.validators,
|
|
22
|
+
options: e.options,
|
|
23
|
+
type: e.type
|
|
24
|
+
}), {
|
|
25
|
+
default: i((r) => [
|
|
26
|
+
l(e.$slots, "default", f(u(r)))
|
|
27
|
+
]),
|
|
28
|
+
_: 3
|
|
29
|
+
}, 16, ["form", "name", "label", "validators", "options", "type"]));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
11
32
|
export {
|
|
12
|
-
|
|
33
|
+
w as default
|
|
13
34
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { OmegaErrorsCE as m, OmegaFormCE as o, OmegaInputCE as t, registerOmegaForm as p } from "./vue-components.es10.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { default as f } from "./vue-components.es4.js";
|
|
3
|
+
import * as e from "./vue-components.es5.js";
|
|
4
|
+
import { useOmegaForm as n } from "./vue-components.es6.js";
|
|
5
|
+
import { duplicateSchema as O, generateInputStandardSchemaFromFieldMeta as l, generateMetaFromSchema as x, nullableInput as d } from "./vue-components.es7.js";
|
|
6
6
|
import { default as E } from "./vue-components.es8.js";
|
|
7
7
|
import { default as i } from "./vue-components.es9.js";
|
|
8
8
|
export {
|
|
9
9
|
i as OmegaErrors,
|
|
10
10
|
m as OmegaErrorsCE,
|
|
11
11
|
e as OmegaErrorsContext,
|
|
12
|
-
|
|
12
|
+
E as OmegaForm,
|
|
13
13
|
o as OmegaFormCE,
|
|
14
|
-
|
|
14
|
+
f as OmegaInput,
|
|
15
15
|
t as OmegaInputCE,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
O as duplicateSchema,
|
|
17
|
+
l as generateInputStandardSchemaFromFieldMeta,
|
|
18
|
+
x as generateMetaFromSchema,
|
|
19
|
+
d as nullableInput,
|
|
20
20
|
p as registerOmegaForm,
|
|
21
|
-
|
|
21
|
+
n as useOmegaForm
|
|
22
22
|
};
|