@effect-app/vue-components 0.0.8 → 0.1.0
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/InputProps.d.ts +64 -0
- package/dist/types/components/OmegaForm/OmegaErrors.vue.d.ts +28 -1
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +16 -6
- package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +16 -0
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +24 -3
- package/dist/types/components/OmegaForm/index.d.ts +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/vue-components.es.js +31 -618
- package/dist/vue-components.es10.js +25 -0
- package/dist/vue-components.es11.js +64 -0
- package/dist/vue-components.es12.js +9 -0
- package/dist/vue-components.es13.js +4 -0
- package/dist/vue-components.es14.js +90 -0
- package/dist/vue-components.es15.js +86 -0
- package/dist/vue-components.es16.js +13 -0
- package/dist/vue-components.es17.js +4 -0
- package/dist/vue-components.es18.js +134 -0
- package/dist/vue-components.es2.js +22 -0
- package/dist/vue-components.es20.js +6 -0
- package/dist/vue-components.es3.js +11 -0
- package/dist/vue-components.es4.js +30 -0
- package/dist/vue-components.es5.js +25 -0
- package/dist/vue-components.es6.js +218 -0
- package/dist/vue-components.es7.js +7 -0
- package/dist/vue-components.es8.js +48 -0
- package/dist/vue-components.es9.js +7 -0
- package/package.json +13 -4
- package/src/components/OmegaForm/InputProps.ts +81 -0
- package/src/components/OmegaForm/OmegaErrors.vue +69 -30
- package/src/components/OmegaForm/OmegaFormStuff.ts +2 -0
- package/src/components/OmegaForm/OmegaInput.vue +25 -38
- package/src/components/OmegaForm/OmegaInputVuetify.vue +164 -0
- package/src/components/OmegaForm/OmegaInternalInput.vue +43 -88
- package/src/components/OmegaForm/useOmegaForm.ts +3 -1
- package/src/components/style.css +1 -1
- package/src/constants/index.ts +1 -1
- package/src/env.d.ts +2 -2
- package/src/index.ts +12 -8
- package/src/utils/index.ts +9 -5
- package/dist/vue-components.css +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineComponent as d, watch as b, createElementBlock as S, openBlock as g, withModifiers as v, unref as a, createElementVNode as h, renderSlot as M } from "vue";
|
|
2
|
+
import { useStore as i } from "@tanstack/vue-form";
|
|
3
|
+
import { getOmegaStore as y } from "./vue-components.es16.js";
|
|
4
|
+
import { provideOmegaErrors as O } from "./vue-components.es4.js";
|
|
5
|
+
import { useOmegaForm as F } from "./vue-components.es5.js";
|
|
6
|
+
const I = ["disabled"], A = /* @__PURE__ */ d({
|
|
7
|
+
__name: "OmegaWrapper",
|
|
8
|
+
props: {
|
|
9
|
+
subscribe: {},
|
|
10
|
+
form: {},
|
|
11
|
+
schema: {},
|
|
12
|
+
defaultValues: {},
|
|
13
|
+
defaultState: {},
|
|
14
|
+
asyncAlways: { type: Boolean },
|
|
15
|
+
asyncDebounceMs: {},
|
|
16
|
+
validators: {},
|
|
17
|
+
onSubmitMeta: {},
|
|
18
|
+
onSubmitInvalid: { type: Function },
|
|
19
|
+
transform: {},
|
|
20
|
+
onSubmit: { type: Function }
|
|
21
|
+
},
|
|
22
|
+
setup(u, { expose: l }) {
|
|
23
|
+
const r = u, t = r.form ?? F(r.schema, r), f = i(t.store, (e) => e.isSubmitting);
|
|
24
|
+
l(t);
|
|
25
|
+
const c = y(
|
|
26
|
+
t,
|
|
27
|
+
r.subscribe
|
|
28
|
+
), p = i(
|
|
29
|
+
t.store,
|
|
30
|
+
(e) => e.submissionAttempts
|
|
31
|
+
), o = t.useStore((e) => e.errors);
|
|
32
|
+
return b(
|
|
33
|
+
() => [t.filterItems, o.value],
|
|
34
|
+
() => {
|
|
35
|
+
const e = t.filterItems;
|
|
36
|
+
return e ? o.value ? (Object.values(o.value).filter(
|
|
37
|
+
(s) => !!s
|
|
38
|
+
).flatMap(
|
|
39
|
+
(s) => Object.values(s).flat().map((n) => n.message)
|
|
40
|
+
).some((s) => s === e.message) && e.items.forEach((s) => {
|
|
41
|
+
const n = t.getFieldMeta(s);
|
|
42
|
+
t.setFieldMeta(s, {
|
|
43
|
+
...n,
|
|
44
|
+
errorMap: {
|
|
45
|
+
onSubmit: [{ path: [s], message: e.message }]
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}), {}) : {} : {};
|
|
49
|
+
}
|
|
50
|
+
), O(p, o), (e, m) => (g(), S("form", {
|
|
51
|
+
onSubmit: m[0] || (m[0] = v((s) => a(t).handleSubmit(), ["prevent", "stop"]))
|
|
52
|
+
}, [
|
|
53
|
+
h("fieldset", { disabled: a(f) }, [
|
|
54
|
+
M(e.$slots, "default", {
|
|
55
|
+
form: a(t),
|
|
56
|
+
subscribedValues: a(c)
|
|
57
|
+
}, void 0, !0)
|
|
58
|
+
], 8, I)
|
|
59
|
+
], 32));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
A as default
|
|
64
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { defineComponent as E, getCurrentInstance as b, computed as x, createBlock as o, openBlock as t, Transition as B, withCtx as l, createElementBlock as m, createCommentVNode as w, unref as e, renderSlot as I, normalizeProps as V, guardReactiveProps as N, resolveDynamicComponent as a, normalizeClass as O, createElementVNode as u, toDisplayString as d, Fragment as g, renderList as k, createTextVNode as y } from "vue";
|
|
2
|
+
import { useOmegaErrors as S } from "./vue-components.es4.js";
|
|
3
|
+
import { mdiLink as z } from "@mdi/js";
|
|
4
|
+
import { useIntl as A } from "./vue-components.es3.js";
|
|
5
|
+
const D = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "error-alert"
|
|
8
|
+
}, G = { class: "text-h6 mb-3" }, L = { class: "font-weight-medium" }, M = { class: "error-message" }, P = ["href"], T = { key: 1 }, H = /* @__PURE__ */ E({
|
|
9
|
+
__name: "OmegaErrors",
|
|
10
|
+
setup($) {
|
|
11
|
+
const c = b(), f = c == null ? void 0 : c.appContext.components.VAlert, { errors: n, formSubmissionAttempts: C, generalErrors: _ } = S(), { trans: v } = A(), p = x(() => _.value ? _.value.filter(
|
|
12
|
+
(i) => !!i
|
|
13
|
+
).flatMap(
|
|
14
|
+
(i) => Object.values(i).filter((s) => !!s).flatMap(
|
|
15
|
+
(s) => s.filter(
|
|
16
|
+
(r) => !!(r != null && r.message)
|
|
17
|
+
).map((r) => r.message)
|
|
18
|
+
)
|
|
19
|
+
) : []);
|
|
20
|
+
return (i, s) => (t(), o(B, null, {
|
|
21
|
+
default: l(() => [
|
|
22
|
+
e(C) > 0 && (e(n).length || p.value.length) ? (t(), m("div", D, [
|
|
23
|
+
I(i.$slots, "default", V(N({ errors: e(n), showedGeneralErrors: p.value })), () => [
|
|
24
|
+
(t(), o(a(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
|
+
u("div", G, d(e(v)("form.includes_error")) + ":", 1),
|
|
33
|
+
e(n).length ? (t(), o(a(e(n).length > 1 ? "ul" : "div"), {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "error-list"
|
|
36
|
+
}, {
|
|
37
|
+
default: l(() => [
|
|
38
|
+
(t(!0), m(g, null, k(e(n), (r) => (t(), o(a(e(n).length > 1 ? "li" : "div"), {
|
|
39
|
+
key: r.inputId,
|
|
40
|
+
class: "error-item"
|
|
41
|
+
}, {
|
|
42
|
+
default: l(() => [
|
|
43
|
+
u("div", L, d(r.label), 1),
|
|
44
|
+
u("div", M, [
|
|
45
|
+
(t(), o(a(r.errors.length > 1 ? "ul" : "div"), { class: "error-list" }, {
|
|
46
|
+
default: l(() => [
|
|
47
|
+
(t(!0), m(g, null, k(r.errors, (h) => (t(), o(a(r.errors.length > 1 ? "li" : "span"), { key: h }, {
|
|
48
|
+
default: l(() => [
|
|
49
|
+
y(d(h), 1)
|
|
50
|
+
]),
|
|
51
|
+
_: 2
|
|
52
|
+
}, 1024))), 128))
|
|
53
|
+
]),
|
|
54
|
+
_: 2
|
|
55
|
+
}, 1024))
|
|
56
|
+
]),
|
|
57
|
+
u("a", {
|
|
58
|
+
href: `#${r.inputId}`,
|
|
59
|
+
class: "error-link"
|
|
60
|
+
}, [
|
|
61
|
+
(t(), o(a(e(f) ? "v-icon" : "i"), {
|
|
62
|
+
icon: e(z),
|
|
63
|
+
"aria-hidden": "true"
|
|
64
|
+
}, {
|
|
65
|
+
default: l(() => s[0] || (s[0] = [
|
|
66
|
+
u("i", null, "🔗", -1)
|
|
67
|
+
])),
|
|
68
|
+
_: 1
|
|
69
|
+
}, 8, ["icon"])),
|
|
70
|
+
y(" " + d(e(v)("form.fix_input")), 1)
|
|
71
|
+
], 8, P)
|
|
72
|
+
]),
|
|
73
|
+
_: 2
|
|
74
|
+
}, 1024))), 128))
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
})) : (t(), m("span", T, d(p.value[0]), 1))
|
|
78
|
+
]),
|
|
79
|
+
_: 1
|
|
80
|
+
}, 8, ["class"]))
|
|
81
|
+
], !0)
|
|
82
|
+
])) : w("", !0)
|
|
83
|
+
]),
|
|
84
|
+
_: 3
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export {
|
|
89
|
+
H as default
|
|
90
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");if(i.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input v-btn{all:unset;cursor:pointer}")),document.head.appendChild(i),window.customElements){const e=window.customElements.define;window.customElements.define=function(a,t){const n=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(n&&n.call(this),this.shadowRoot){const s=document.createElement("style");s.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input v-btn{all:unset;cursor:pointer}")),this.shadowRoot.appendChild(s)}},e.call(window.customElements,a,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { defineComponent as C, getCurrentInstance as L, useId as O, computed as n, watch as V, onMounted as S, ref as $, watchEffect as A, useAttrs as P, renderSlot as D, normalizeProps as M, guardReactiveProps as R, createBlock as T, createCommentVNode as U, unref as z, openBlock as F } from "vue";
|
|
3
|
+
import { useStore as N } from "@tanstack/vue-form";
|
|
4
|
+
import { useOmegaErrors as j } from "./vue-components.es4.js";
|
|
5
|
+
import G from "./vue-components.es18.js";
|
|
6
|
+
|
|
7
|
+
const X = /* @__PURE__ */ C({
|
|
8
|
+
__name: "OmegaInternalInput",
|
|
9
|
+
props: {
|
|
10
|
+
field: {},
|
|
11
|
+
meta: {},
|
|
12
|
+
label: {},
|
|
13
|
+
options: {},
|
|
14
|
+
type: {},
|
|
15
|
+
validators: {}
|
|
16
|
+
},
|
|
17
|
+
setup(q) {
|
|
18
|
+
const e = q, l = L(), E = l == null ? void 0 : l.appContext.components.VTextField, o = O(), u = e.field, a = N(u.store, (t) => t), i = n(() => {
|
|
19
|
+
var t, r;
|
|
20
|
+
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";
|
|
21
|
+
}), m = n(() => a.value.value), p = n(
|
|
22
|
+
() => (
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
a.value.meta.errors.map((t) => t == null ? void 0 : t.message).filter(Boolean)
|
|
25
|
+
)
|
|
26
|
+
);
|
|
27
|
+
V(
|
|
28
|
+
() => [!!m.value],
|
|
29
|
+
() => {
|
|
30
|
+
var t, r;
|
|
31
|
+
p.value.length && !m.value && !((t = e.meta) != null && t.required) && u.setValue(
|
|
32
|
+
((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
), S(() => {
|
|
36
|
+
var t, r;
|
|
37
|
+
!m.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
|
|
38
|
+
});
|
|
39
|
+
const s = $(!1), I = () => {
|
|
40
|
+
s.value = !0;
|
|
41
|
+
}, { addError: k, formSubmissionAttempts: w, removeError: B } = j();
|
|
42
|
+
A(() => {
|
|
43
|
+
w.value > 0 && (s.value = !0);
|
|
44
|
+
});
|
|
45
|
+
const d = n(() => !s.value && i.value !== "select" ? [] : p.value);
|
|
46
|
+
V(
|
|
47
|
+
() => a.value.meta.errors,
|
|
48
|
+
() => {
|
|
49
|
+
a.value.meta.errors.length ? k({
|
|
50
|
+
inputId: o,
|
|
51
|
+
errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
52
|
+
label: e.label
|
|
53
|
+
}) : B(o);
|
|
54
|
+
}
|
|
55
|
+
), P();
|
|
56
|
+
const f = n(() => {
|
|
57
|
+
var t, r, c, v, g, y, h, b, x, _;
|
|
58
|
+
return {
|
|
59
|
+
id: o,
|
|
60
|
+
required: (t = e.meta) == null ? void 0 : t.required,
|
|
61
|
+
minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((c = e.meta) == null ? void 0 : c.minLength),
|
|
62
|
+
maxLength: ((v = e.meta) == null ? void 0 : v.type) === "string" && ((g = e.meta) == null ? void 0 : g.maxLength),
|
|
63
|
+
max: ((y = e.meta) == null ? void 0 : y.type) === "number" && ((h = e.meta) == null ? void 0 : h.maximum),
|
|
64
|
+
min: ((b = e.meta) == null ? void 0 : b.type) === "number" && ((x = e.meta) == null ? void 0 : x.minimum),
|
|
65
|
+
name: e.field.name,
|
|
66
|
+
modelValue: e.field.state.value,
|
|
67
|
+
errorMessages: d.value,
|
|
68
|
+
error: !!d.value.length,
|
|
69
|
+
field: e.field,
|
|
70
|
+
setRealDirty: I,
|
|
71
|
+
type: i.value,
|
|
72
|
+
label: `${e.label}${(_ = e.meta) != null && _.required ? " *" : ""}`,
|
|
73
|
+
options: e.options
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
return (t, r) => D(t.$slots, "default", M(R(f.value)), () => [
|
|
77
|
+
z(E) ? (F(), T(G, {
|
|
78
|
+
key: 0,
|
|
79
|
+
"input-props": f.value
|
|
80
|
+
}, null, 8, ["input-props"])) : U("", !0)
|
|
81
|
+
]);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
X as default
|
|
86
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useStore as u } from "@tanstack/vue-form";
|
|
2
|
+
import { computed as f } from "vue";
|
|
3
|
+
function c(o, t) {
|
|
4
|
+
return f(() => t ? u(o.store, (n) => {
|
|
5
|
+
const r = {};
|
|
6
|
+
for (const e of t)
|
|
7
|
+
r[e] = n[e];
|
|
8
|
+
return r;
|
|
9
|
+
}).value : {});
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
c as getOmegaStore
|
|
13
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { defineComponent as V, resolveComponent as o, createElementBlock as m, openBlock as r, createBlock as l, createCommentVNode as p, mergeProps as i, normalizeClass as y, createVNode as s, unref as t, withCtx as v } from "vue";
|
|
2
|
+
import { mdiRefresh as u } from "@mdi/js";
|
|
3
|
+
const q = { class: "omega-input" }, U = /* @__PURE__ */ V({
|
|
4
|
+
__name: "OmegaInputVuetify",
|
|
5
|
+
props: {
|
|
6
|
+
inputProps: {}
|
|
7
|
+
},
|
|
8
|
+
setup(C) {
|
|
9
|
+
return (e, n) => {
|
|
10
|
+
const d = o("v-text-field"), h = o("v-textarea"), f = o("v-select"), P = o("v-icon"), g = o("v-btn"), b = o("v-autocomplete");
|
|
11
|
+
return r(), m("div", q, [
|
|
12
|
+
e.inputProps.type === "email" || e.inputProps.type === "string" ? (r(), l(d, i({
|
|
13
|
+
key: 0,
|
|
14
|
+
id: e.inputProps.id,
|
|
15
|
+
required: e.inputProps.required,
|
|
16
|
+
"min-length": e.inputProps.minLength,
|
|
17
|
+
"max-length": e.inputProps.maxLength,
|
|
18
|
+
type: e.inputProps.type,
|
|
19
|
+
name: e.inputProps.name,
|
|
20
|
+
label: e.inputProps.label,
|
|
21
|
+
"model-value": e.inputProps.modelValue,
|
|
22
|
+
"error-messages": e.inputProps.errorMessages,
|
|
23
|
+
error: e.inputProps.error
|
|
24
|
+
}, e.$attrs, {
|
|
25
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange,
|
|
26
|
+
onBlur: e.inputProps.setRealDirty
|
|
27
|
+
}), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "model-value", "error-messages", "error", "onUpdate:modelValue", "onBlur"])) : p("", !0),
|
|
28
|
+
e.inputProps.type === "text" ? (r(), l(h, i({ key: 1 }, e.$attrs, {
|
|
29
|
+
id: e.inputProps.id,
|
|
30
|
+
required: e.inputProps.required,
|
|
31
|
+
"min-length": e.inputProps.minLength,
|
|
32
|
+
"max-length": e.inputProps.maxLength,
|
|
33
|
+
type: e.inputProps.type,
|
|
34
|
+
name: e.inputProps.name,
|
|
35
|
+
label: e.inputProps.label,
|
|
36
|
+
"model-value": e.inputProps.modelValue,
|
|
37
|
+
"error-messages": e.inputProps.errorMessages,
|
|
38
|
+
error: e.inputProps.error,
|
|
39
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange,
|
|
40
|
+
onBlur: e.inputProps.setRealDirty
|
|
41
|
+
}), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "model-value", "error-messages", "error", "onUpdate:modelValue", "onBlur"])) : p("", !0),
|
|
42
|
+
e.inputProps.type === "number" ? (r(), l(d, i({
|
|
43
|
+
key: 2,
|
|
44
|
+
id: e.inputProps.id,
|
|
45
|
+
required: e.inputProps.required,
|
|
46
|
+
min: e.inputProps.min,
|
|
47
|
+
max: e.inputProps.max,
|
|
48
|
+
type: e.inputProps.type,
|
|
49
|
+
name: e.inputProps.name,
|
|
50
|
+
label: e.inputProps.label,
|
|
51
|
+
"model-value": e.inputProps.modelValue,
|
|
52
|
+
"error-messages": e.inputProps.errorMessages,
|
|
53
|
+
error: e.inputProps.error
|
|
54
|
+
}, e.$attrs, {
|
|
55
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => {
|
|
56
|
+
e.inputProps.field.handleChange(Number(a));
|
|
57
|
+
}),
|
|
58
|
+
onBlur: e.inputProps.setRealDirty
|
|
59
|
+
}), null, 16, ["id", "required", "min", "max", "type", "name", "label", "model-value", "error-messages", "error", "onBlur"])) : p("", !0),
|
|
60
|
+
e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (r(), m("div", {
|
|
61
|
+
key: 3,
|
|
62
|
+
class: y(e.inputProps.type !== "multiple" && "d-flex align-center")
|
|
63
|
+
}, [
|
|
64
|
+
s(f, i({
|
|
65
|
+
id: e.inputProps.id,
|
|
66
|
+
required: e.inputProps.required,
|
|
67
|
+
multiple: e.inputProps.type === "multiple",
|
|
68
|
+
chips: e.inputProps.type === "multiple",
|
|
69
|
+
name: e.inputProps.name,
|
|
70
|
+
"model-value": e.inputProps.modelValue,
|
|
71
|
+
label: e.inputProps.label,
|
|
72
|
+
items: e.inputProps.options,
|
|
73
|
+
"error-messages": e.inputProps.errorMessages,
|
|
74
|
+
error: e.inputProps.error
|
|
75
|
+
}, e.$attrs, {
|
|
76
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange,
|
|
77
|
+
onBlur: e.inputProps.setRealDirty
|
|
78
|
+
}), null, 16, ["id", "required", "multiple", "chips", "name", "model-value", "label", "items", "error-messages", "error", "onUpdate:modelValue", "onBlur"]),
|
|
79
|
+
e.inputProps.type === "select" ? (r(), l(g, {
|
|
80
|
+
key: 0,
|
|
81
|
+
"variant-btn": "secondary",
|
|
82
|
+
"variant-icon": t(u),
|
|
83
|
+
class: "mr-2",
|
|
84
|
+
title: "Reset",
|
|
85
|
+
onClick: n[1] || (n[1] = (a) => e.inputProps.field.handleChange(void 0))
|
|
86
|
+
}, {
|
|
87
|
+
default: v(() => [
|
|
88
|
+
s(P, { icon: t(u) }, null, 8, ["icon"])
|
|
89
|
+
]),
|
|
90
|
+
_: 1
|
|
91
|
+
}, 8, ["variant-icon"])) : p("", !0)
|
|
92
|
+
], 2)) : p("", !0),
|
|
93
|
+
e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (r(), m("div", {
|
|
94
|
+
key: 4,
|
|
95
|
+
class: y(
|
|
96
|
+
e.inputProps.type !== "autocompletemultiple" && "d-flex align-center"
|
|
97
|
+
)
|
|
98
|
+
}, [
|
|
99
|
+
s(b, i({
|
|
100
|
+
id: e.inputProps.id,
|
|
101
|
+
multiple: e.inputProps.type === "autocompletemultiple",
|
|
102
|
+
required: e.inputProps.required,
|
|
103
|
+
name: e.inputProps.name,
|
|
104
|
+
"model-value": e.inputProps.modelValue,
|
|
105
|
+
label: e.inputProps.label,
|
|
106
|
+
items: e.inputProps.options,
|
|
107
|
+
"error-messages": e.inputProps.errorMessages,
|
|
108
|
+
error: e.inputProps.error,
|
|
109
|
+
chips: e.inputProps.type === "autocompletemultiple"
|
|
110
|
+
}, e.$attrs, {
|
|
111
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange,
|
|
112
|
+
onBlur: e.inputProps.setRealDirty
|
|
113
|
+
}), null, 16, ["id", "multiple", "required", "name", "model-value", "label", "items", "error-messages", "error", "chips", "onUpdate:modelValue", "onBlur"]),
|
|
114
|
+
e.inputProps.type === "autocomplete" ? (r(), l(g, {
|
|
115
|
+
key: 0,
|
|
116
|
+
"variant-btn": "secondary",
|
|
117
|
+
"variant-icon": t(u),
|
|
118
|
+
class: "mr-2",
|
|
119
|
+
title: "Reset",
|
|
120
|
+
onClick: n[2] || (n[2] = (a) => e.inputProps.field.handleChange(void 0))
|
|
121
|
+
}, {
|
|
122
|
+
default: v(() => [
|
|
123
|
+
s(P, { icon: t(u) }, null, 8, ["icon"])
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
}, 8, ["variant-icon"])) : p("", !0)
|
|
127
|
+
], 2)) : p("", !0)
|
|
128
|
+
]);
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
export {
|
|
133
|
+
U as default
|
|
134
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OmegaErrorsCE as m, OmegaFormCE as o, OmegaInputCE as t, registerOmegaForm as p } from "./vue-components.es10.js";
|
|
2
|
+
import * as e from "./vue-components.es4.js";
|
|
3
|
+
import { useOmegaForm as f } from "./vue-components.es5.js";
|
|
4
|
+
import { duplicateSchema as n, generateInputStandardSchemaFromFieldMeta as s, generateMetaFromSchema as O, nullableInput as l } from "./vue-components.es6.js";
|
|
5
|
+
import { default as d } from "./vue-components.es7.js";
|
|
6
|
+
import { default as E } from "./vue-components.es8.js";
|
|
7
|
+
import { default as i } from "./vue-components.es9.js";
|
|
8
|
+
export {
|
|
9
|
+
i as OmegaErrors,
|
|
10
|
+
m as OmegaErrorsCE,
|
|
11
|
+
e as OmegaErrorsContext,
|
|
12
|
+
d as OmegaForm,
|
|
13
|
+
o as OmegaFormCE,
|
|
14
|
+
E as OmegaInput,
|
|
15
|
+
t as OmegaInputCE,
|
|
16
|
+
n as duplicateSchema,
|
|
17
|
+
s as generateInputStandardSchemaFromFieldMeta,
|
|
18
|
+
O as generateMetaFromSchema,
|
|
19
|
+
l as nullableInput,
|
|
20
|
+
p as registerOmegaForm,
|
|
21
|
+
f as useOmegaForm
|
|
22
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");if(i.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input v-btn{all:unset;cursor:pointer}")),document.head.appendChild(i),window.customElements){const e=window.customElements.define;window.customElements.define=function(a,t){const n=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(n&&n.call(this),this.shadowRoot){const s=document.createElement("style");s.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input v-btn{all:unset;cursor:pointer}")),this.shadowRoot.appendChild(s)}},e.call(window.customElements,a,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import o from "./vue-components.es18.js";
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
o as default
|
|
6
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { inject as o, provide as r } from "vue";
|
|
2
|
+
const n = Symbol(), i = () => {
|
|
3
|
+
const t = o(n);
|
|
4
|
+
if (!t)
|
|
5
|
+
throw new Error("useIntl must be used within a IntlProvider");
|
|
6
|
+
return t;
|
|
7
|
+
}, s = (t) => r(n, t);
|
|
8
|
+
export {
|
|
9
|
+
s as provideIntl,
|
|
10
|
+
i as useIntl
|
|
11
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ref as m, readonly as d, provide as l, inject as p } from "vue";
|
|
2
|
+
const s = Symbol();
|
|
3
|
+
function E(e, u) {
|
|
4
|
+
const r = m([]), t = (o) => {
|
|
5
|
+
r.value = r.value.filter((i) => i.inputId !== o);
|
|
6
|
+
}, a = (o) => {
|
|
7
|
+
t(o.inputId), r.value.push(o);
|
|
8
|
+
}, c = () => {
|
|
9
|
+
r.value = [];
|
|
10
|
+
}, n = {
|
|
11
|
+
errors: d(r),
|
|
12
|
+
addError: a,
|
|
13
|
+
removeError: t,
|
|
14
|
+
clearErrors: c,
|
|
15
|
+
formSubmissionAttempts: e,
|
|
16
|
+
generalErrors: u
|
|
17
|
+
};
|
|
18
|
+
return l(s, n), n;
|
|
19
|
+
}
|
|
20
|
+
function f() {
|
|
21
|
+
const e = p(s);
|
|
22
|
+
if (!e)
|
|
23
|
+
throw new Error("useOmegaErrors must be used within an OmegaForm provider");
|
|
24
|
+
return e;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
s as OmegaErrorsKey,
|
|
28
|
+
E as provideOmegaErrors,
|
|
29
|
+
f as useOmegaErrors
|
|
30
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useForm as b } from "@tanstack/vue-form";
|
|
2
|
+
import { S as g } from "effect-app";
|
|
3
|
+
import { generateMetaFromSchema as h } from "./vue-components.es6.js";
|
|
4
|
+
const v = (r, e) => {
|
|
5
|
+
if (!r) throw new Error("Schema is required");
|
|
6
|
+
const a = g.standardSchemaV1(r), { filterItems: t, meta: d } = h(r), u = b({
|
|
7
|
+
...e,
|
|
8
|
+
validators: {
|
|
9
|
+
onSubmit: a,
|
|
10
|
+
...(e == null ? void 0 : e.validators) || {}
|
|
11
|
+
},
|
|
12
|
+
onSubmit: e != null && e.onSubmit ? ({ formApi: S, meta: c, value: f }) => {
|
|
13
|
+
var m;
|
|
14
|
+
return (m = e.onSubmit) == null ? void 0 : m.call(e, {
|
|
15
|
+
formApi: S,
|
|
16
|
+
meta: c,
|
|
17
|
+
value: f
|
|
18
|
+
});
|
|
19
|
+
} : void 0
|
|
20
|
+
});
|
|
21
|
+
return Object.assign(u, { meta: d, filterItems: t });
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
v as useOmegaForm
|
|
25
|
+
};
|