@effect-app/vue-components 0.2.3 → 0.2.5

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.
@@ -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.es15.js";
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
- 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
- }
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
- c as getOmegaStore
86
+ Q as default
13
87
  };
@@ -1,87 +1,13 @@
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
- });
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
- Q as default
12
+ c as getOmegaStore
87
13
  };
@@ -1,4 +1,4 @@
1
- import f from "./vue-components.es16.js";
1
+ import f from "./vue-components.es15.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,33 +1,32 @@
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
- import { mdiRefresh as a } from "@mdi/js";
3
- const U = /* @__PURE__ */ k({
1
+ import { defineComponent as P, resolveComponent as i, createElementBlock as g, openBlock as o, createBlock as n, createCommentVNode as l, mergeProps as s } 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(C) {
9
+ setup(v) {
11
10
  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", {
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[4] || (r[4] = (o) => e.$emit("blur", o)),
16
- onFocusin: r[5] || (r[5] = (o) => e.$emit("focus", o))
14
+ onFocusout: r[4] || (r[4] = (p) => e.$emit("blur", p)),
15
+ onFocusin: r[5] || (r[5] = (p) => e.$emit("focus", p))
17
16
  }, [
18
- e.inputProps.type === "boolean" ? (p(), l(b, s({
17
+ e.inputProps.type === "boolean" ? (o(), n(a, s({
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.modelValue,
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] = (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({
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"])) : l("", !0),
29
+ e.inputProps.type === "email" || e.inputProps.type === "string" ? (o(), n(u, s({
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.modelValue,
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"])) : n("", !0),
45
- e.inputProps.type === "text" ? (p(), l(h, s({ key: 2 }, e.$attrs, {
43
+ }), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "model-value", "error-messages", "error", "onUpdate:modelValue"])) : l("", !0),
44
+ e.inputProps.type === "text" ? (o(), n(t, s({ 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.modelValue,
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"])) : n("", !0),
58
- e.inputProps.type === "number" ? (p(), l(d, s({
56
+ }), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "model-value", "error-messages", "error", "onUpdate:modelValue"])) : l("", !0),
57
+ e.inputProps.type === "number" ? (o(), n(u, s({
59
58
  key: 3,
60
59
  id: e.inputProps.id,
61
60
  required: e.inputProps.required,
@@ -64,82 +63,52 @@ 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.modelValue,
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] = (o) => {
72
- e.inputProps.field.handleChange(Number(o));
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"])) : n("", !0),
75
- e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (p(), m("div", {
73
+ }), null, 16, ["id", "required", "min", "max", "type", "name", "label", "model-value", "error-messages", "error"])) : l("", !0),
74
+ e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (o(), n(m, s({
76
75
  key: 4,
77
- class: v(e.inputProps.type !== "multiple" && "d-flex")
78
- }, [
79
- u(f, s({
80
- id: e.inputProps.id,
81
- required: e.inputProps.required,
82
- multiple: e.inputProps.type === "multiple",
83
- chips: e.inputProps.type === "multiple",
84
- name: e.inputProps.name,
85
- "model-value": e.inputProps.modelValue,
86
- label: e.inputProps.label,
87
- items: e.inputProps.options,
88
- "error-messages": e.inputProps.errorMessages,
89
- error: e.inputProps.error
90
- }, e.$attrs, {
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, {
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
+ onClear: r[2] || (r[2] = (p) => e.inputProps.field.handleChange(void 0)),
89
+ "onUpdate:modelValue": e.inputProps.field.handleChange
90
+ }), null, 16, ["id", "clearable", "required", "multiple", "chips", "name", "model-value", "label", "items", "error-messages", "error", "onUpdate:modelValue"])) : l("", !0),
91
+ e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (o(), n(d, s({
108
92
  key: 5,
109
- class: v(e.inputProps.type !== "autocompletemultiple" && "d-flex")
110
- }, [
111
- u(V, s({
112
- id: e.inputProps.id,
113
- multiple: e.inputProps.type === "autocompletemultiple",
114
- required: e.inputProps.required,
115
- name: e.inputProps.name,
116
- "model-value": e.inputProps.modelValue,
117
- label: e.inputProps.label,
118
- items: e.inputProps.options,
119
- "error-messages": e.inputProps.errorMessages,
120
- error: e.inputProps.error,
121
- chips: e.inputProps.type === "autocompletemultiple"
122
- }, e.$attrs, {
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)
93
+ id: e.inputProps.id,
94
+ clearable: e.inputProps.type === "autocomplete",
95
+ multiple: e.inputProps.type === "autocompletemultiple",
96
+ required: e.inputProps.required,
97
+ name: e.inputProps.name,
98
+ "model-value": e.inputProps.field.state.value,
99
+ label: e.inputProps.label,
100
+ items: e.inputProps.options,
101
+ "error-messages": e.inputProps.errorMessages,
102
+ error: e.inputProps.error,
103
+ chips: e.inputProps.type === "autocompletemultiple"
104
+ }, e.$attrs, {
105
+ onClear: r[3] || (r[3] = (p) => e.inputProps.field.handleChange(void 0)),
106
+ "onUpdate:modelValue": e.inputProps.field.handleChange
107
+ }), null, 16, ["id", "clearable", "multiple", "required", "name", "model-value", "label", "items", "error-messages", "error", "chips", "onUpdate:modelValue"])) : l("", !0)
139
108
  ], 32);
140
109
  };
141
110
  }
142
111
  });
143
112
  export {
144
- U as default
113
+ b as default
145
114
  };
@@ -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.es16.js";
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",
3
+ "version": "0.2.5",
4
4
  "peerDependencies": {
5
5
  "@mdi/js": "^7.4.47",
6
6
  "@tanstack/vue-form": "^1.2.4",
@@ -9,7 +9,7 @@
9
9
  :id="inputProps.id"
10
10
  :name="inputProps.name"
11
11
  :label="inputProps.label"
12
- :model-value="inputProps.modelValue"
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.modelValue"
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.modelValue"
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.modelValue"
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,48 @@
65
65
  }
66
66
  "
67
67
  />
68
- <div
68
+ <v-select
69
69
  v-if="inputProps.type === 'select' || inputProps.type === 'multiple'"
70
- :class="inputProps.type !== 'multiple' && 'd-flex'"
71
- >
72
- <v-select
73
- :id="inputProps.id"
74
- :required="inputProps.required"
75
- :multiple="inputProps.type === 'multiple'"
76
- :chips="inputProps.type === 'multiple'"
77
- :name="inputProps.name"
78
- :model-value="inputProps.modelValue"
79
- :label="inputProps.label"
80
- :items="inputProps.options"
81
- :error-messages="inputProps.errorMessages"
82
- :error="inputProps.error"
83
- v-bind="$attrs"
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
+ @clear="inputProps.field.handleChange(undefined)"
83
+ @update:model-value="inputProps.field.handleChange"
84
+ />
97
85
 
98
- <div
86
+ <v-autocomplete
99
87
  v-if="
100
88
  inputProps.type === 'autocomplete' ||
101
89
  inputProps.type === 'autocompletemultiple'
102
90
  "
103
- :class="inputProps.type !== 'autocompletemultiple' && 'd-flex'"
104
- >
105
- <v-autocomplete
106
- :id="inputProps.id"
107
- :multiple="inputProps.type === 'autocompletemultiple'"
108
- :required="inputProps.required"
109
- :name="inputProps.name"
110
- :model-value="inputProps.modelValue"
111
- :label="inputProps.label"
112
- :items="inputProps.options"
113
- :error-messages="inputProps.errorMessages"
114
- :error="inputProps.error"
115
- :chips="inputProps.type === 'autocompletemultiple'"
116
- v-bind="$attrs"
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>
91
+ :id="inputProps.id"
92
+ :clearable="inputProps.type === 'autocomplete'"
93
+ :multiple="inputProps.type === 'autocompletemultiple'"
94
+ :required="inputProps.required"
95
+ :name="inputProps.name"
96
+ :model-value="inputProps.field.state.value"
97
+ :label="inputProps.label"
98
+ :items="inputProps.options"
99
+ :error-messages="inputProps.errorMessages"
100
+ :error="inputProps.error"
101
+ :chips="inputProps.type === 'autocompletemultiple'"
102
+ v-bind="$attrs"
103
+ @clear="inputProps.field.handleChange(undefined)"
104
+ @update:model-value="inputProps.field.handleChange"
105
+ />
130
106
  </div>
131
107
  </template>
132
108
 
133
109
  <script setup lang="ts" generic="T">
134
- import { mdiRefresh } from "@mdi/js"
135
110
  import type { InputProps } from "./InputProps"
136
111
 
137
112
  defineProps<{