@effect-app/vue-components 0.2.2 → 0.2.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/vue-components.es11.js +1 -1
- package/dist/vue-components.es15.js +85 -11
- package/dist/vue-components.es16.js +11 -85
- package/dist/vue-components.es17.js +1 -1
- package/dist/vue-components.es18.js +53 -86
- package/dist/vue-components.es8.js +1 -1
- package/package.json +3 -3
- package/src/components/OmegaForm/OmegaInputVuetify.vue +34 -61
|
@@ -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.es16.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,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,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(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
|
-
});
|
|
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,33 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
const U = /* @__PURE__ */ k({
|
|
1
|
+
import { defineComponent as P, resolveComponent as i, createElementBlock as g, openBlock as o, createBlock as n, createCommentVNode as s, mergeProps as l } from "vue";
|
|
2
|
+
const b = /* @__PURE__ */ P({
|
|
4
3
|
inheritAttrs: !1,
|
|
5
4
|
__name: "OmegaInputVuetify",
|
|
6
5
|
props: {
|
|
7
6
|
inputProps: {}
|
|
8
7
|
},
|
|
9
8
|
emits: ["focus", "blur"],
|
|
10
|
-
setup(
|
|
9
|
+
setup(y) {
|
|
11
10
|
return (e, r) => {
|
|
12
|
-
const
|
|
13
|
-
return
|
|
11
|
+
const a = i("v-checkbox"), u = i("v-text-field"), t = i("v-textarea"), m = i("v-select"), d = i("v-autocomplete");
|
|
12
|
+
return o(), g("div", {
|
|
14
13
|
class: "omega-input",
|
|
15
|
-
onFocusout: r[
|
|
16
|
-
onFocusin: r[
|
|
14
|
+
onFocusout: r[2] || (r[2] = (p) => e.$emit("blur", p)),
|
|
15
|
+
onFocusin: r[3] || (r[3] = (p) => e.$emit("focus", p))
|
|
17
16
|
}, [
|
|
18
|
-
e.inputProps.type === "boolean" ? (
|
|
17
|
+
e.inputProps.type === "boolean" ? (o(), n(a, l({
|
|
19
18
|
key: 0,
|
|
20
19
|
id: e.inputProps.id,
|
|
21
20
|
name: e.inputProps.name,
|
|
22
21
|
label: e.inputProps.label,
|
|
23
|
-
"model-value": e.inputProps.
|
|
22
|
+
"model-value": e.inputProps.field.state.value,
|
|
24
23
|
"error-messages": e.inputProps.errorMessages,
|
|
25
24
|
error: e.inputProps.error
|
|
26
25
|
}, e.$attrs, {
|
|
27
26
|
ripple: "",
|
|
28
|
-
onChange: r[0] || (r[0] = (
|
|
29
|
-
}), null, 16, ["id", "name", "label", "model-value", "error-messages", "error"])) :
|
|
30
|
-
e.inputProps.type === "email" || e.inputProps.type === "string" ? (
|
|
27
|
+
onChange: r[0] || (r[0] = (p) => e.inputProps.field.handleChange(p.target.checked))
|
|
28
|
+
}), null, 16, ["id", "name", "label", "model-value", "error-messages", "error"])) : s("", !0),
|
|
29
|
+
e.inputProps.type === "email" || e.inputProps.type === "string" ? (o(), n(u, l({
|
|
31
30
|
key: 1,
|
|
32
31
|
id: e.inputProps.id,
|
|
33
32
|
required: e.inputProps.required,
|
|
@@ -36,13 +35,13 @@ const U = /* @__PURE__ */ k({
|
|
|
36
35
|
type: e.inputProps.type,
|
|
37
36
|
name: e.inputProps.name,
|
|
38
37
|
label: e.inputProps.label,
|
|
39
|
-
"model-value": e.inputProps.
|
|
38
|
+
"model-value": e.inputProps.field.state.value,
|
|
40
39
|
"error-messages": e.inputProps.errorMessages,
|
|
41
40
|
error: e.inputProps.error
|
|
42
41
|
}, e.$attrs, {
|
|
43
42
|
"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"])) :
|
|
45
|
-
e.inputProps.type === "text" ? (
|
|
43
|
+
}), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "model-value", "error-messages", "error", "onUpdate:modelValue"])) : s("", !0),
|
|
44
|
+
e.inputProps.type === "text" ? (o(), n(t, l({ key: 2 }, e.$attrs, {
|
|
46
45
|
id: e.inputProps.id,
|
|
47
46
|
required: e.inputProps.required,
|
|
48
47
|
"min-length": e.inputProps.minLength,
|
|
@@ -50,12 +49,12 @@ const U = /* @__PURE__ */ k({
|
|
|
50
49
|
type: e.inputProps.type,
|
|
51
50
|
name: e.inputProps.name,
|
|
52
51
|
label: e.inputProps.label,
|
|
53
|
-
"model-value": e.inputProps.
|
|
52
|
+
"model-value": e.inputProps.field.state.value,
|
|
54
53
|
"error-messages": e.inputProps.errorMessages,
|
|
55
54
|
error: e.inputProps.error,
|
|
56
55
|
"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"])) :
|
|
58
|
-
e.inputProps.type === "number" ? (
|
|
56
|
+
}), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "model-value", "error-messages", "error", "onUpdate:modelValue"])) : s("", !0),
|
|
57
|
+
e.inputProps.type === "number" ? (o(), n(u, l({
|
|
59
58
|
key: 3,
|
|
60
59
|
id: e.inputProps.id,
|
|
61
60
|
required: e.inputProps.required,
|
|
@@ -64,82 +63,50 @@ const U = /* @__PURE__ */ k({
|
|
|
64
63
|
type: e.inputProps.type,
|
|
65
64
|
name: e.inputProps.name,
|
|
66
65
|
label: e.inputProps.label,
|
|
67
|
-
"model-value": e.inputProps.
|
|
66
|
+
"model-value": e.inputProps.field.state.value,
|
|
68
67
|
"error-messages": e.inputProps.errorMessages,
|
|
69
68
|
error: e.inputProps.error
|
|
70
69
|
}, e.$attrs, {
|
|
71
|
-
"onUpdate:modelValue": r[1] || (r[1] = (
|
|
72
|
-
e.inputProps.field.handleChange(Number(
|
|
70
|
+
"onUpdate:modelValue": r[1] || (r[1] = (p) => {
|
|
71
|
+
e.inputProps.field.handleChange(Number(p));
|
|
73
72
|
})
|
|
74
|
-
}), null, 16, ["id", "required", "min", "max", "type", "name", "label", "model-value", "error-messages", "error"])) :
|
|
75
|
-
e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (
|
|
73
|
+
}), null, 16, ["id", "required", "min", "max", "type", "name", "label", "model-value", "error-messages", "error"])) : s("", !0),
|
|
74
|
+
e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (o(), n(m, l({
|
|
76
75
|
key: 4,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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, {
|
|
94
|
-
key: 0,
|
|
95
|
-
"variant-btn": "secondary",
|
|
96
|
-
"variant-icon": t(a),
|
|
97
|
-
class: "mr-2",
|
|
98
|
-
title: "Reset",
|
|
99
|
-
onClick: r[2] || (r[2] = (o) => e.inputProps.field.handleChange(void 0))
|
|
100
|
-
}, {
|
|
101
|
-
default: y(() => [
|
|
102
|
-
u(P, { icon: t(a) }, null, 8, ["icon"])
|
|
103
|
-
]),
|
|
104
|
-
_: 1
|
|
105
|
-
}, 8, ["variant-icon"])) : n("", !0)
|
|
106
|
-
], 2)) : n("", !0),
|
|
107
|
-
e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (p(), m("div", {
|
|
76
|
+
id: e.inputProps.id,
|
|
77
|
+
clearable: e.inputProps.type === "select",
|
|
78
|
+
required: e.inputProps.required,
|
|
79
|
+
multiple: e.inputProps.type === "multiple",
|
|
80
|
+
chips: e.inputProps.type === "multiple",
|
|
81
|
+
name: e.inputProps.name,
|
|
82
|
+
"model-value": e.inputProps.field.state.value,
|
|
83
|
+
label: e.inputProps.label,
|
|
84
|
+
items: e.inputProps.options,
|
|
85
|
+
"error-messages": e.inputProps.errorMessages,
|
|
86
|
+
error: e.inputProps.error
|
|
87
|
+
}, e.$attrs, {
|
|
88
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
89
|
+
}), null, 16, ["id", "clearable", "required", "multiple", "chips", "name", "model-value", "label", "items", "error-messages", "error", "onUpdate:modelValue"])) : s("", !0),
|
|
90
|
+
e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (o(), n(d, l({
|
|
108
91
|
key: 5,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
key: 0,
|
|
127
|
-
"variant-btn": "secondary",
|
|
128
|
-
"variant-icon": t(a),
|
|
129
|
-
class: "mr-2",
|
|
130
|
-
title: "Reset",
|
|
131
|
-
onClick: r[3] || (r[3] = (o) => e.inputProps.field.handleChange(void 0))
|
|
132
|
-
}, {
|
|
133
|
-
default: y(() => [
|
|
134
|
-
u(P, { icon: t(a) }, null, 8, ["icon"])
|
|
135
|
-
]),
|
|
136
|
-
_: 1
|
|
137
|
-
}, 8, ["variant-icon"])) : n("", !0)
|
|
138
|
-
], 2)) : n("", !0)
|
|
92
|
+
id: e.inputProps.id,
|
|
93
|
+
clearable: e.inputProps.type === "autocomplete",
|
|
94
|
+
multiple: e.inputProps.type === "autocompletemultiple",
|
|
95
|
+
required: e.inputProps.required,
|
|
96
|
+
name: e.inputProps.name,
|
|
97
|
+
"model-value": e.inputProps.field.state.value,
|
|
98
|
+
label: e.inputProps.label,
|
|
99
|
+
items: e.inputProps.options,
|
|
100
|
+
"error-messages": e.inputProps.errorMessages,
|
|
101
|
+
error: e.inputProps.error,
|
|
102
|
+
chips: e.inputProps.type === "autocompletemultiple"
|
|
103
|
+
}, e.$attrs, {
|
|
104
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
105
|
+
}), null, 16, ["id", "clearable", "multiple", "required", "name", "model-value", "label", "items", "error-messages", "error", "chips", "onUpdate:modelValue"])) : s("", !0)
|
|
139
106
|
], 32);
|
|
140
107
|
};
|
|
141
108
|
}
|
|
142
109
|
});
|
|
143
110
|
export {
|
|
144
|
-
|
|
111
|
+
b as default
|
|
145
112
|
};
|
|
@@ -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.es15.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.4",
|
|
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.40.
|
|
47
|
-
"effect-app": "2.39.
|
|
46
|
+
"@effect-app/vue": "2.40.1",
|
|
47
|
+
"effect-app": "2.39.1"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "rimraf dist && vue-tsc && vite build",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
:id="inputProps.id"
|
|
10
10
|
:name="inputProps.name"
|
|
11
11
|
:label="inputProps.label"
|
|
12
|
-
:model-value="inputProps.
|
|
12
|
+
:model-value="inputProps.field.state.value"
|
|
13
13
|
:error-messages="inputProps.errorMessages"
|
|
14
14
|
:error="inputProps.error"
|
|
15
15
|
v-bind="$attrs"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
:type="inputProps.type"
|
|
26
26
|
:name="inputProps.name"
|
|
27
27
|
:label="inputProps.label"
|
|
28
|
-
:model-value="inputProps.
|
|
28
|
+
:model-value="inputProps.field.state.value"
|
|
29
29
|
:error-messages="inputProps.errorMessages"
|
|
30
30
|
:error="inputProps.error"
|
|
31
31
|
v-bind="$attrs"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
:type="inputProps.type"
|
|
42
42
|
:name="inputProps.name"
|
|
43
43
|
:label="inputProps.label"
|
|
44
|
-
:model-value="inputProps.
|
|
44
|
+
:model-value="inputProps.field.state.value"
|
|
45
45
|
:error-messages="inputProps.errorMessages"
|
|
46
46
|
:error="inputProps.error"
|
|
47
47
|
@update:model-value="inputProps.field.handleChange"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
:type="inputProps.type"
|
|
56
56
|
:name="inputProps.name"
|
|
57
57
|
:label="inputProps.label"
|
|
58
|
-
:model-value="inputProps.
|
|
58
|
+
:model-value="inputProps.field.state.value"
|
|
59
59
|
:error-messages="inputProps.errorMessages"
|
|
60
60
|
:error="inputProps.error"
|
|
61
61
|
v-bind="$attrs"
|
|
@@ -65,73 +65,46 @@
|
|
|
65
65
|
}
|
|
66
66
|
"
|
|
67
67
|
/>
|
|
68
|
-
<
|
|
68
|
+
<v-select
|
|
69
69
|
v-if="inputProps.type === 'select' || inputProps.type === 'multiple'"
|
|
70
|
-
:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
@update:model-value="inputProps.field.handleChange"
|
|
85
|
-
/>
|
|
86
|
-
<v-btn
|
|
87
|
-
v-if="inputProps.type === 'select'"
|
|
88
|
-
variant-btn="secondary"
|
|
89
|
-
:variant-icon="mdiRefresh"
|
|
90
|
-
class="mr-2"
|
|
91
|
-
title="Reset"
|
|
92
|
-
@click="inputProps.field.handleChange(undefined)"
|
|
93
|
-
>
|
|
94
|
-
<v-icon :icon="mdiRefresh" />
|
|
95
|
-
</v-btn>
|
|
96
|
-
</div>
|
|
70
|
+
:id="inputProps.id"
|
|
71
|
+
:clearable="inputProps.type === 'select'"
|
|
72
|
+
:required="inputProps.required"
|
|
73
|
+
:multiple="inputProps.type === 'multiple'"
|
|
74
|
+
:chips="inputProps.type === 'multiple'"
|
|
75
|
+
:name="inputProps.name"
|
|
76
|
+
:model-value="inputProps.field.state.value"
|
|
77
|
+
:label="inputProps.label"
|
|
78
|
+
:items="inputProps.options"
|
|
79
|
+
:error-messages="inputProps.errorMessages"
|
|
80
|
+
:error="inputProps.error"
|
|
81
|
+
v-bind="$attrs"
|
|
82
|
+
@update:model-value="inputProps.field.handleChange"
|
|
83
|
+
/>
|
|
97
84
|
|
|
98
|
-
<
|
|
85
|
+
<v-autocomplete
|
|
99
86
|
v-if="
|
|
100
87
|
inputProps.type === 'autocomplete' ||
|
|
101
88
|
inputProps.type === 'autocompletemultiple'
|
|
102
89
|
"
|
|
103
|
-
:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
@update:model-value="inputProps.field.handleChange"
|
|
118
|
-
/>
|
|
119
|
-
<v-btn
|
|
120
|
-
v-if="inputProps.type === 'autocomplete'"
|
|
121
|
-
variant-btn="secondary"
|
|
122
|
-
:variant-icon="mdiRefresh"
|
|
123
|
-
class="mr-2"
|
|
124
|
-
title="Reset"
|
|
125
|
-
@click="inputProps.field.handleChange(undefined)"
|
|
126
|
-
>
|
|
127
|
-
<v-icon :icon="mdiRefresh" />
|
|
128
|
-
</v-btn>
|
|
129
|
-
</div>
|
|
90
|
+
:id="inputProps.id"
|
|
91
|
+
:clearable="inputProps.type === 'autocomplete'"
|
|
92
|
+
:multiple="inputProps.type === 'autocompletemultiple'"
|
|
93
|
+
:required="inputProps.required"
|
|
94
|
+
:name="inputProps.name"
|
|
95
|
+
:model-value="inputProps.field.state.value"
|
|
96
|
+
:label="inputProps.label"
|
|
97
|
+
:items="inputProps.options"
|
|
98
|
+
:error-messages="inputProps.errorMessages"
|
|
99
|
+
:error="inputProps.error"
|
|
100
|
+
:chips="inputProps.type === 'autocompletemultiple'"
|
|
101
|
+
v-bind="$attrs"
|
|
102
|
+
@update:model-value="inputProps.field.handleChange"
|
|
103
|
+
/>
|
|
130
104
|
</div>
|
|
131
105
|
</template>
|
|
132
106
|
|
|
133
107
|
<script setup lang="ts" generic="T">
|
|
134
|
-
import { mdiRefresh } from "@mdi/js"
|
|
135
108
|
import type { InputProps } from "./InputProps"
|
|
136
109
|
|
|
137
110
|
defineProps<{
|