@effect-app/vue-components 0.2.0 → 0.2.2
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/OmegaInput.vue.d.ts +1 -0
- package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +8 -2
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +1 -0
- package/dist/vue-components.es11.js +1 -1
- package/dist/vue-components.es15.js +11 -85
- package/dist/vue-components.es16.js +85 -11
- package/dist/vue-components.es17.js +1 -1
- package/dist/vue-components.es18.js +47 -47
- package/dist/vue-components.es8.js +1 -1
- package/package.json +3 -3
- package/src/components/OmegaForm/OmegaInputVuetify.vue +14 -7
- package/src/components/OmegaForm/OmegaInternalInput.vue +1 -4
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { InputProps } from "./InputProps";
|
|
2
2
|
declare const _default: <T>(__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<{
|
|
3
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly onBlur?: ((event: Event) => any) | undefined;
|
|
5
|
+
readonly onFocus?: ((event: Event) => any) | undefined;
|
|
6
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onFocus"> & {
|
|
4
7
|
inputProps: InputProps<T>;
|
|
5
8
|
} & Partial<{}>> & import("vue").PublicProps;
|
|
6
9
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
7
10
|
attrs: any;
|
|
8
11
|
slots: {};
|
|
9
|
-
emit: {
|
|
12
|
+
emit: {
|
|
13
|
+
(e: "focus", event: Event): void;
|
|
14
|
+
(e: "blur", event: Event): void;
|
|
15
|
+
};
|
|
10
16
|
}>) => import("vue").VNode & {
|
|
11
17
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
12
18
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
2
|
import { useStore as i } from "@tanstack/vue-form";
|
|
3
|
-
import { getOmegaStore as y } from "./vue-components.
|
|
3
|
+
import { getOmegaStore as y } from "./vue-components.es15.js";
|
|
4
4
|
import { provideOmegaErrors as O } from "./vue-components.es4.js";
|
|
5
5
|
import { useOmegaForm as F } from "./vue-components.es5.js";
|
|
6
6
|
const I = ["disabled"], A = /* @__PURE__ */ d({
|
|
@@ -1,87 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
field: {},
|
|
12
|
-
meta: {},
|
|
13
|
-
label: {},
|
|
14
|
-
options: {},
|
|
15
|
-
type: {},
|
|
16
|
-
validators: {}
|
|
17
|
-
},
|
|
18
|
-
setup(q) {
|
|
19
|
-
const e = q, l = B(), E = l == null ? void 0 : l.appContext.components.VTextField, o = C(), u = e.field, a = j(u.store, (t) => t), i = n(() => {
|
|
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
|
-
}), s = n(() => a.value.value), p = n(
|
|
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
|
-
_(
|
|
29
|
-
() => [!!s.value],
|
|
30
|
-
() => {
|
|
31
|
-
var t, r;
|
|
32
|
-
p.value.length && !s.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
|
-
), L(() => {
|
|
37
|
-
var t, r;
|
|
38
|
-
!s.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
|
|
39
|
-
});
|
|
40
|
-
const m = O(!1), I = () => {
|
|
41
|
-
m.value = !0;
|
|
42
|
-
}, { addError: $, formSubmissionAttempts: k, removeError: w } = G();
|
|
43
|
-
P(() => {
|
|
44
|
-
k.value > 0 && (m.value = !0);
|
|
45
|
-
});
|
|
46
|
-
const f = n(() => !m.value && i.value !== "select" ? [] : p.value);
|
|
47
|
-
_(
|
|
48
|
-
() => a.value.meta.errors,
|
|
49
|
-
() => {
|
|
50
|
-
a.value.meta.errors.length ? $({
|
|
51
|
-
inputId: o,
|
|
52
|
-
errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
53
|
-
label: e.label
|
|
54
|
-
}) : w(o);
|
|
55
|
-
}
|
|
56
|
-
), S();
|
|
57
|
-
const d = n(() => {
|
|
58
|
-
var t, r, c, v, g, y, h, b, x, V;
|
|
59
|
-
return {
|
|
60
|
-
id: o,
|
|
61
|
-
required: (t = e.meta) == null ? void 0 : t.required,
|
|
62
|
-
minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((c = e.meta) == null ? void 0 : c.minLength),
|
|
63
|
-
maxLength: ((v = e.meta) == null ? void 0 : v.type) === "string" && ((g = e.meta) == null ? void 0 : g.maxLength),
|
|
64
|
-
max: ((y = e.meta) == null ? void 0 : y.type) === "number" && ((h = e.meta) == null ? void 0 : h.maximum),
|
|
65
|
-
min: ((b = e.meta) == null ? void 0 : b.type) === "number" && ((x = e.meta) == null ? void 0 : x.minimum),
|
|
66
|
-
name: e.field.name,
|
|
67
|
-
modelValue: e.field.state.value,
|
|
68
|
-
errorMessages: f.value,
|
|
69
|
-
error: !!f.value.length,
|
|
70
|
-
field: e.field,
|
|
71
|
-
setRealDirty: I,
|
|
72
|
-
type: i.value,
|
|
73
|
-
label: `${e.label}${(V = e.meta) != null && V.required ? " *" : ""}`,
|
|
74
|
-
options: e.options
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
return (t, r) => D(t.$slots, "default", M(R(d.value)), () => [
|
|
78
|
-
z(E) ? (F(), T(H, N({
|
|
79
|
-
key: 0,
|
|
80
|
-
"input-props": d.value
|
|
81
|
-
}, t.$attrs), null, 16, ["input-props"])) : U("", !0)
|
|
82
|
-
]);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
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
|
+
}
|
|
85
11
|
export {
|
|
86
|
-
|
|
12
|
+
c as getOmegaStore
|
|
87
13
|
};
|
|
@@ -1,13 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
import { computed as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.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 [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(o,t){const a=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(a&&a.call(this),this.shadowRoot){const i=document.createElement("style");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 [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),this.shadowRoot.appendChild(i)}},e.call(window.customElements,o,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 q, onMounted as S, ref as A, watchEffect as D, renderSlot as F, mergeProps as E, createBlock as M, createCommentVNode as P, unref as T, openBlock as U } from "vue";
|
|
3
|
+
import { useStore as N } from "@tanstack/vue-form";
|
|
4
|
+
import { useOmegaErrors as R } from "./vue-components.es4.js";
|
|
5
|
+
import j from "./vue-components.es18.js";
|
|
6
|
+
|
|
7
|
+
const Q = /* @__PURE__ */ C({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "OmegaInternalInput",
|
|
10
|
+
props: {
|
|
11
|
+
field: {},
|
|
12
|
+
meta: {},
|
|
13
|
+
label: {},
|
|
14
|
+
options: {},
|
|
15
|
+
type: {},
|
|
16
|
+
validators: {}
|
|
17
|
+
},
|
|
18
|
+
setup(I) {
|
|
19
|
+
const e = I, l = L(), $ = l == null ? void 0 : l.appContext.components.VTextField, o = O(), u = e.field, a = N(u.store, (t) => t), i = n(() => {
|
|
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
|
+
}), m = n(() => a.value.value), p = n(
|
|
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
|
+
q(
|
|
29
|
+
() => [!!m.value],
|
|
30
|
+
() => {
|
|
31
|
+
var t, r;
|
|
32
|
+
p.value.length && !m.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
|
+
), S(() => {
|
|
37
|
+
var t, r;
|
|
38
|
+
!m.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
|
|
39
|
+
});
|
|
40
|
+
const s = A(!1), f = () => {
|
|
41
|
+
s.value = !0;
|
|
42
|
+
}, { addError: k, formSubmissionAttempts: w, removeError: B } = R();
|
|
43
|
+
D(() => {
|
|
44
|
+
w.value > 0 && (s.value = !0);
|
|
45
|
+
});
|
|
46
|
+
const d = n(() => !s.value && i.value !== "select" ? [] : p.value);
|
|
47
|
+
q(
|
|
48
|
+
() => a.value.meta.errors,
|
|
49
|
+
() => {
|
|
50
|
+
a.value.meta.errors.length ? k({
|
|
51
|
+
inputId: o,
|
|
52
|
+
errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
53
|
+
label: e.label
|
|
54
|
+
}) : B(o);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
const c = n(() => {
|
|
58
|
+
var t, r, v, g, y, h, b, x, V, _;
|
|
59
|
+
return {
|
|
60
|
+
id: o,
|
|
61
|
+
required: (t = e.meta) == null ? void 0 : t.required,
|
|
62
|
+
minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((v = e.meta) == null ? void 0 : v.minLength),
|
|
63
|
+
maxLength: ((g = e.meta) == null ? void 0 : g.type) === "string" && ((y = e.meta) == null ? void 0 : y.maxLength),
|
|
64
|
+
max: ((h = e.meta) == null ? void 0 : h.type) === "number" && ((b = e.meta) == null ? void 0 : b.maximum),
|
|
65
|
+
min: ((x = e.meta) == null ? void 0 : x.type) === "number" && ((V = e.meta) == null ? void 0 : V.minimum),
|
|
66
|
+
name: e.field.name,
|
|
67
|
+
modelValue: e.field.state.value,
|
|
68
|
+
errorMessages: d.value,
|
|
69
|
+
error: !!d.value.length,
|
|
70
|
+
field: e.field,
|
|
71
|
+
setRealDirty: f,
|
|
72
|
+
type: i.value,
|
|
73
|
+
label: `${e.label}${(_ = e.meta) != null && _.required ? " *" : ""}`,
|
|
74
|
+
options: e.options
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
return (t, r) => F(t.$slots, "default", E(c.value, { onFocusout: f }), () => [
|
|
78
|
+
T($) ? (U(), M(j, E({
|
|
79
|
+
key: 0,
|
|
80
|
+
"input-props": c.value
|
|
81
|
+
}, t.$attrs), null, 16, ["input-props"])) : P("", !0)
|
|
82
|
+
]);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
11
85
|
export {
|
|
12
|
-
|
|
86
|
+
Q as default
|
|
13
87
|
};
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { defineComponent as k, resolveComponent as
|
|
1
|
+
import { defineComponent as k, resolveComponent as i, createElementBlock as m, openBlock as p, createBlock as l, createCommentVNode as n, mergeProps as s, normalizeClass as v, createVNode as u, unref as t, withCtx as y } from "vue";
|
|
2
2
|
import { mdiRefresh as a } from "@mdi/js";
|
|
3
|
-
const
|
|
3
|
+
const U = /* @__PURE__ */ k({
|
|
4
|
+
inheritAttrs: !1,
|
|
4
5
|
__name: "OmegaInputVuetify",
|
|
5
6
|
props: {
|
|
6
7
|
inputProps: {}
|
|
7
8
|
},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
emits: ["focus", "blur"],
|
|
10
|
+
setup(C) {
|
|
11
|
+
return (e, r) => {
|
|
12
|
+
const b = i("v-checkbox"), d = i("v-text-field"), h = i("v-textarea"), f = i("v-select"), P = i("v-icon"), g = i("v-btn"), V = i("v-autocomplete");
|
|
13
|
+
return p(), m("div", {
|
|
14
|
+
class: "omega-input",
|
|
15
|
+
onFocusout: r[4] || (r[4] = (o) => e.$emit("blur", o)),
|
|
16
|
+
onFocusin: r[5] || (r[5] = (o) => e.$emit("focus", o))
|
|
17
|
+
}, [
|
|
18
|
+
e.inputProps.type === "boolean" ? (p(), l(b, s({
|
|
13
19
|
key: 0,
|
|
14
20
|
id: e.inputProps.id,
|
|
15
21
|
name: e.inputProps.name,
|
|
@@ -19,10 +25,9 @@ const C = { class: "omega-input" }, U = /* @__PURE__ */ k({
|
|
|
19
25
|
error: e.inputProps.error
|
|
20
26
|
}, e.$attrs, {
|
|
21
27
|
ripple: "",
|
|
22
|
-
onChange:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
e.inputProps.type === "email" || e.inputProps.type === "string" ? (r(), l(d, i({
|
|
28
|
+
onChange: r[0] || (r[0] = (o) => e.inputProps.field.handleChange(o.target.checked))
|
|
29
|
+
}), null, 16, ["id", "name", "label", "model-value", "error-messages", "error"])) : n("", !0),
|
|
30
|
+
e.inputProps.type === "email" || e.inputProps.type === "string" ? (p(), l(d, s({
|
|
26
31
|
key: 1,
|
|
27
32
|
id: e.inputProps.id,
|
|
28
33
|
required: e.inputProps.required,
|
|
@@ -35,10 +40,9 @@ const C = { class: "omega-input" }, U = /* @__PURE__ */ k({
|
|
|
35
40
|
"error-messages": e.inputProps.errorMessages,
|
|
36
41
|
error: e.inputProps.error
|
|
37
42
|
}, e.$attrs, {
|
|
38
|
-
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
e.inputProps.type === "text" ? (r(), l(b, i({ key: 2 }, e.$attrs, {
|
|
43
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
44
|
+
}), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "model-value", "error-messages", "error", "onUpdate:modelValue"])) : n("", !0),
|
|
45
|
+
e.inputProps.type === "text" ? (p(), l(h, s({ key: 2 }, e.$attrs, {
|
|
42
46
|
id: e.inputProps.id,
|
|
43
47
|
required: e.inputProps.required,
|
|
44
48
|
"min-length": e.inputProps.minLength,
|
|
@@ -49,10 +53,9 @@ const C = { class: "omega-input" }, U = /* @__PURE__ */ k({
|
|
|
49
53
|
"model-value": e.inputProps.modelValue,
|
|
50
54
|
"error-messages": e.inputProps.errorMessages,
|
|
51
55
|
error: e.inputProps.error,
|
|
52
|
-
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
e.inputProps.type === "number" ? (r(), l(d, i({
|
|
56
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
57
|
+
}), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "model-value", "error-messages", "error", "onUpdate:modelValue"])) : n("", !0),
|
|
58
|
+
e.inputProps.type === "number" ? (p(), l(d, s({
|
|
56
59
|
key: 3,
|
|
57
60
|
id: e.inputProps.id,
|
|
58
61
|
required: e.inputProps.required,
|
|
@@ -65,16 +68,15 @@ const C = { class: "omega-input" }, U = /* @__PURE__ */ k({
|
|
|
65
68
|
"error-messages": e.inputProps.errorMessages,
|
|
66
69
|
error: e.inputProps.error
|
|
67
70
|
}, e.$attrs, {
|
|
68
|
-
"onUpdate:modelValue":
|
|
69
|
-
e.inputProps.field.handleChange(Number(
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (r(), m("div", {
|
|
71
|
+
"onUpdate:modelValue": r[1] || (r[1] = (o) => {
|
|
72
|
+
e.inputProps.field.handleChange(Number(o));
|
|
73
|
+
})
|
|
74
|
+
}), null, 16, ["id", "required", "min", "max", "type", "name", "label", "model-value", "error-messages", "error"])) : n("", !0),
|
|
75
|
+
e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (p(), m("div", {
|
|
74
76
|
key: 4,
|
|
75
|
-
class:
|
|
77
|
+
class: v(e.inputProps.type !== "multiple" && "d-flex")
|
|
76
78
|
}, [
|
|
77
|
-
u(f,
|
|
79
|
+
u(f, s({
|
|
78
80
|
id: e.inputProps.id,
|
|
79
81
|
required: e.inputProps.required,
|
|
80
82
|
multiple: e.inputProps.type === "multiple",
|
|
@@ -86,28 +88,27 @@ const C = { class: "omega-input" }, U = /* @__PURE__ */ k({
|
|
|
86
88
|
"error-messages": e.inputProps.errorMessages,
|
|
87
89
|
error: e.inputProps.error
|
|
88
90
|
}, e.$attrs, {
|
|
89
|
-
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
e.inputProps.type === "select" ? (r(), l(g, {
|
|
91
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
92
|
+
}), null, 16, ["id", "required", "multiple", "chips", "name", "model-value", "label", "items", "error-messages", "error", "onUpdate:modelValue"]),
|
|
93
|
+
e.inputProps.type === "select" ? (p(), l(g, {
|
|
93
94
|
key: 0,
|
|
94
95
|
"variant-btn": "secondary",
|
|
95
96
|
"variant-icon": t(a),
|
|
96
97
|
class: "mr-2",
|
|
97
98
|
title: "Reset",
|
|
98
|
-
onClick:
|
|
99
|
+
onClick: r[2] || (r[2] = (o) => e.inputProps.field.handleChange(void 0))
|
|
99
100
|
}, {
|
|
100
|
-
default:
|
|
101
|
+
default: y(() => [
|
|
101
102
|
u(P, { icon: t(a) }, null, 8, ["icon"])
|
|
102
103
|
]),
|
|
103
104
|
_: 1
|
|
104
|
-
}, 8, ["variant-icon"])) :
|
|
105
|
-
], 2)) :
|
|
106
|
-
e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (
|
|
105
|
+
}, 8, ["variant-icon"])) : n("", !0)
|
|
106
|
+
], 2)) : n("", !0),
|
|
107
|
+
e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (p(), m("div", {
|
|
107
108
|
key: 5,
|
|
108
|
-
class:
|
|
109
|
+
class: v(e.inputProps.type !== "autocompletemultiple" && "d-flex")
|
|
109
110
|
}, [
|
|
110
|
-
u(V,
|
|
111
|
+
u(V, s({
|
|
111
112
|
id: e.inputProps.id,
|
|
112
113
|
multiple: e.inputProps.type === "autocompletemultiple",
|
|
113
114
|
required: e.inputProps.required,
|
|
@@ -119,24 +120,23 @@ const C = { class: "omega-input" }, U = /* @__PURE__ */ k({
|
|
|
119
120
|
error: e.inputProps.error,
|
|
120
121
|
chips: e.inputProps.type === "autocompletemultiple"
|
|
121
122
|
}, e.$attrs, {
|
|
122
|
-
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
e.inputProps.type === "autocomplete" ? (r(), l(g, {
|
|
123
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
124
|
+
}), null, 16, ["id", "multiple", "required", "name", "model-value", "label", "items", "error-messages", "error", "chips", "onUpdate:modelValue"]),
|
|
125
|
+
e.inputProps.type === "autocomplete" ? (p(), l(g, {
|
|
126
126
|
key: 0,
|
|
127
127
|
"variant-btn": "secondary",
|
|
128
128
|
"variant-icon": t(a),
|
|
129
129
|
class: "mr-2",
|
|
130
130
|
title: "Reset",
|
|
131
|
-
onClick:
|
|
131
|
+
onClick: r[3] || (r[3] = (o) => e.inputProps.field.handleChange(void 0))
|
|
132
132
|
}, {
|
|
133
|
-
default:
|
|
133
|
+
default: y(() => [
|
|
134
134
|
u(P, { icon: t(a) }, null, 8, ["icon"])
|
|
135
135
|
]),
|
|
136
136
|
_: 1
|
|
137
|
-
}, 8, ["variant-icon"])) :
|
|
138
|
-
], 2)) :
|
|
139
|
-
]);
|
|
137
|
+
}, 8, ["variant-icon"])) : n("", !0)
|
|
138
|
+
], 2)) : n("", !0)
|
|
139
|
+
], 32);
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as i, computed as t, createBlock as p, openBlock as d, resolveDynamicComponent as u, withCtx as r, createVNode as f, mergeProps as c, renderSlot as v, normalizeProps as h, guardReactiveProps as g } from "vue";
|
|
2
2
|
import { generateInputStandardSchemaFromFieldMeta as y } from "./vue-components.es6.js";
|
|
3
|
-
import b from "./vue-components.
|
|
3
|
+
import b from "./vue-components.es16.js";
|
|
4
4
|
const S = /* @__PURE__ */ i({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "OmegaInput",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"@tanstack/vue-form": "^1.2.4",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"./dist/vue-components.css": "./dist/vue-components.css"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@effect-app/vue": "2.
|
|
47
|
-
"effect-app": "2.
|
|
46
|
+
"@effect-app/vue": "2.40.0",
|
|
47
|
+
"effect-app": "2.39.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "rimraf dist && vue-tsc && vite build",
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="omega-input"
|
|
4
|
+
@focusout="$emit('blur', $event)"
|
|
5
|
+
@focusin="$emit('focus', $event)"
|
|
6
|
+
>
|
|
3
7
|
<v-checkbox
|
|
4
8
|
v-if="inputProps.type === 'boolean'"
|
|
5
9
|
:id="inputProps.id"
|
|
@@ -11,7 +15,6 @@
|
|
|
11
15
|
v-bind="$attrs"
|
|
12
16
|
ripple
|
|
13
17
|
@change="(e: any) => inputProps.field.handleChange(e.target.checked)"
|
|
14
|
-
@blur="inputProps.setRealDirty"
|
|
15
18
|
/>
|
|
16
19
|
<v-text-field
|
|
17
20
|
v-if="inputProps.type === 'email' || inputProps.type === 'string'"
|
|
@@ -27,7 +30,6 @@
|
|
|
27
30
|
:error="inputProps.error"
|
|
28
31
|
v-bind="$attrs"
|
|
29
32
|
@update:model-value="inputProps.field.handleChange"
|
|
30
|
-
@blur="inputProps.setRealDirty"
|
|
31
33
|
/>
|
|
32
34
|
<v-textarea
|
|
33
35
|
v-if="inputProps.type === 'text'"
|
|
@@ -43,7 +45,6 @@
|
|
|
43
45
|
:error-messages="inputProps.errorMessages"
|
|
44
46
|
:error="inputProps.error"
|
|
45
47
|
@update:model-value="inputProps.field.handleChange"
|
|
46
|
-
@blur="inputProps.setRealDirty"
|
|
47
48
|
/>
|
|
48
49
|
<v-text-field
|
|
49
50
|
v-if="inputProps.type === 'number'"
|
|
@@ -63,7 +64,6 @@
|
|
|
63
64
|
inputProps.field.handleChange(Number(e))
|
|
64
65
|
}
|
|
65
66
|
"
|
|
66
|
-
@blur="inputProps.setRealDirty"
|
|
67
67
|
/>
|
|
68
68
|
<div
|
|
69
69
|
v-if="inputProps.type === 'select' || inputProps.type === 'multiple'"
|
|
@@ -82,7 +82,6 @@
|
|
|
82
82
|
:error="inputProps.error"
|
|
83
83
|
v-bind="$attrs"
|
|
84
84
|
@update:model-value="inputProps.field.handleChange"
|
|
85
|
-
@blur="inputProps.setRealDirty"
|
|
86
85
|
/>
|
|
87
86
|
<v-btn
|
|
88
87
|
v-if="inputProps.type === 'select'"
|
|
@@ -116,7 +115,6 @@
|
|
|
116
115
|
:chips="inputProps.type === 'autocompletemultiple'"
|
|
117
116
|
v-bind="$attrs"
|
|
118
117
|
@update:model-value="inputProps.field.handleChange"
|
|
119
|
-
@blur="inputProps.setRealDirty"
|
|
120
118
|
/>
|
|
121
119
|
<v-btn
|
|
122
120
|
v-if="inputProps.type === 'autocomplete'"
|
|
@@ -139,6 +137,15 @@ import type { InputProps } from "./InputProps"
|
|
|
139
137
|
defineProps<{
|
|
140
138
|
inputProps: InputProps<T>
|
|
141
139
|
}>()
|
|
140
|
+
|
|
141
|
+
defineEmits<{
|
|
142
|
+
(e: "focus", event: Event): void
|
|
143
|
+
(e: "blur", event: Event): void
|
|
144
|
+
}>()
|
|
145
|
+
|
|
146
|
+
defineOptions({
|
|
147
|
+
inheritAttrs: false,
|
|
148
|
+
})
|
|
142
149
|
</script>
|
|
143
150
|
|
|
144
151
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<slot v-bind="inputProps">
|
|
2
|
+
<slot v-bind="inputProps" @focusout="setRealDirty">
|
|
3
3
|
<OmegaInputVuetify
|
|
4
4
|
v-if="vuetified"
|
|
5
5
|
:input-props="inputProps"
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
<script setup lang="ts" generic="To">
|
|
12
12
|
import { useStore } from "@tanstack/vue-form"
|
|
13
13
|
import {
|
|
14
|
-
useAttrs,
|
|
15
14
|
useId,
|
|
16
15
|
computed,
|
|
17
16
|
watch,
|
|
@@ -128,8 +127,6 @@ watch(
|
|
|
128
127
|
},
|
|
129
128
|
)
|
|
130
129
|
|
|
131
|
-
const otherAttrs = useAttrs()
|
|
132
|
-
|
|
133
130
|
const inputProps: ComputedRef<InputProps<To>> = computed(() => ({
|
|
134
131
|
id,
|
|
135
132
|
required: props.meta?.required,
|