@effect-app/vue-components 0.6.3 → 0.7.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.
Files changed (36) hide show
  1. package/dist/types/components/OmegaForm/OmegaArray.vue.d.ts +24 -0
  2. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +15 -1
  3. package/dist/types/components/OmegaForm/index.d.ts +2 -1
  4. package/dist/vue-components.es.js +22 -19
  5. package/dist/vue-components.es10.js +5 -5
  6. package/dist/vue-components.es11.js +6 -108
  7. package/dist/vue-components.es12.js +110 -0
  8. package/dist/vue-components.es14.js +7 -2
  9. package/dist/vue-components.es15.js +2 -88
  10. package/dist/vue-components.es16.js +90 -0
  11. package/dist/vue-components.es18.js +2 -5
  12. package/dist/vue-components.es19.js +2 -32
  13. package/dist/vue-components.es2.js +14 -11
  14. package/dist/vue-components.es20.js +5 -2
  15. package/dist/vue-components.es21.js +32 -2
  16. package/dist/vue-components.es22.js +99 -11
  17. package/dist/vue-components.es23.js +11 -99
  18. package/dist/vue-components.es24.js +2 -2
  19. package/dist/vue-components.es25.js +2 -115
  20. package/dist/vue-components.es26.js +4 -0
  21. package/dist/vue-components.es27.js +115 -4
  22. package/dist/vue-components.es29.js +6 -0
  23. package/dist/vue-components.es4.js +19 -18
  24. package/dist/vue-components.es6.js +50 -36
  25. package/dist/vue-components.es7.js +34 -131
  26. package/dist/vue-components.es8.js +128 -211
  27. package/dist/vue-components.es9.js +218 -6
  28. package/package.json +1 -1
  29. package/src/components/OmegaForm/OmegaArray.vue +67 -0
  30. package/src/components/OmegaForm/OmegaErrors.vue +7 -3
  31. package/src/components/OmegaForm/OmegaFormInput.vue +6 -2
  32. package/src/components/OmegaForm/OmegaFormStuff.ts +4 -1
  33. package/src/components/OmegaForm/OmegaInput.vue +9 -1
  34. package/src/components/OmegaForm/index.ts +2 -1
  35. package/dist/vue-components.es13.js +0 -9
  36. package/dist/vue-components.es17.js +0 -4
@@ -1,19 +1,22 @@
1
- import { default as t } from "./vue-components.es9.js";
1
+ import { default as t } from "./vue-components.es10.js";
2
2
  import { default as m } from "./vue-components.es4.js";
3
- import { default as f } from "./vue-components.es10.js";
3
+ import { default as p } from "./vue-components.es11.js";
4
4
  import { default as l } from "./vue-components.es5.js";
5
- import * as e from "./vue-components.es6.js";
6
- import { duplicateSchema as d, generateInputStandardSchemaFromFieldMeta as g, generateMetaFromSchema as s, nullableInput as x } from "./vue-components.es8.js";
7
- import { useOmegaForm as F } from "./vue-components.es7.js";
5
+ import { default as g } from "./vue-components.es6.js";
6
+ import * as e from "./vue-components.es7.js";
7
+ import { createMeta as s, duplicateSchema as x, generateInputStandardSchemaFromFieldMeta as O, generateMetaFromSchema as c, nullableInput as F } from "./vue-components.es9.js";
8
+ import { useOmegaForm as h } from "./vue-components.es8.js";
8
9
  export {
10
+ g as OmegaArray,
9
11
  l as OmegaAutoGen,
10
- f as OmegaErrors,
12
+ p as OmegaErrors,
11
13
  e as OmegaErrorsContext,
12
14
  t as OmegaForm,
13
15
  m as OmegaInput,
14
- d as duplicateSchema,
15
- g as generateInputStandardSchemaFromFieldMeta,
16
- s as generateMetaFromSchema,
17
- x as nullableInput,
18
- F as useOmegaForm
16
+ s as createMeta,
17
+ x as duplicateSchema,
18
+ O as generateInputStandardSchemaFromFieldMeta,
19
+ c as generateMetaFromSchema,
20
+ F as nullableInput,
21
+ h as useOmegaForm
19
22
  };
@@ -1,4 +1,7 @@
1
- const o = (n) => typeof n == "function";
1
+ import { isFunction as c } from "./vue-components.es24.js";
2
+ const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
2
3
  export {
3
- o as isFunction
4
+ s as isFunction,
5
+ i as isObject,
6
+ t as isRecordOrArray
4
7
  };
@@ -1,4 +1,34 @@
1
- import f from "./vue-components.es19.js";
1
+ import { defineComponent as a, inject as t, createBlock as n, openBlock as m, mergeProps as p, unref as s, withCtx as i, renderSlot as l, normalizeProps as f, guardReactiveProps as u } from "vue";
2
+ import d from "./vue-components.es4.js";
3
+ import { OmegaFormKey as c } from "./vue-components.es8.js";
4
+ const w = /* @__PURE__ */ a({
5
+ __name: "OmegaFormInput",
6
+ props: {
7
+ name: {},
8
+ label: {},
9
+ validators: {},
10
+ options: {},
11
+ type: {}
12
+ },
13
+ setup(g) {
14
+ const o = t(c);
15
+ if (!o)
16
+ throw new Error("OmegaFormInput must be used within an OmegaForm context");
17
+ return (e, b) => (m(), n(d, p(e.$props, {
18
+ form: s(o),
19
+ name: e.name,
20
+ label: e.label,
21
+ validators: e.validators,
22
+ options: e.options,
23
+ type: e.type
24
+ }), {
25
+ default: i((r) => [
26
+ l(e.$slots, "default", f(u(r)))
27
+ ]),
28
+ _: 3
29
+ }, 16, ["form", "name", "label", "validators", "options", "type"]));
30
+ }
31
+ });
2
32
  export {
3
- f as default
33
+ w as default
4
34
  };
@@ -1,13 +1,101 @@
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 B, getCurrentInstance as L, useId as P, computed as n, watch as w, nextTick as S, onMounted as x, ref as T, watchEffect as z, renderSlot as A, normalizeProps as D, guardReactiveProps as F, createElementVNode as M, normalizeClass as N, createBlock as R, createCommentVNode as U, unref as j, openBlock as G, mergeProps as H } from "vue";
3
+ import { useStore as J } from "@tanstack/vue-form";
4
+ import { useOmegaErrors as K } from "./vue-components.es7.js";
5
+ import Q from "./vue-components.es27.js";
6
+
7
+ const te = /* @__PURE__ */ B({
8
+ inheritAttrs: !1,
9
+ __name: "OmegaInternalInput",
10
+ props: {
11
+ field: {},
12
+ meta: {},
13
+ label: {},
14
+ options: {},
15
+ type: {},
16
+ validators: {}
17
+ },
18
+ setup(C) {
19
+ const e = C, o = L(), $ = o == null ? void 0 : o.appContext.components.VTextField, s = P(), u = e.field, a = J(u.store, (t) => t), d = 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
+ }), i = n(() => a.value.value), k = 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
+ w(
29
+ () => !!i.value,
30
+ (t) => {
31
+ var r;
32
+ !t && ((r = e.meta) == null ? void 0 : r.type) !== "boolean" && S(() => {
33
+ var l;
34
+ u.setValue(
35
+ ((l = e.meta) == null ? void 0 : l.nullableOrUndefined) === "undefined" ? void 0 : null
36
+ );
37
+ });
38
+ }
39
+ ), x(() => {
40
+ var t, r;
41
+ !i.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
42
+ });
43
+ const { addError: I, removeError: O, showErrors: _, showErrorsOn: q } = K(), m = T(!1);
44
+ z(() => {
45
+ (_.value || q === "onChange") && (m.value = !0);
46
+ });
47
+ const p = () => {
48
+ m.value = !0;
49
+ };
50
+ x(() => {
51
+ i.value && p();
52
+ });
53
+ const c = n(() => !m.value && d.value !== "select" ? [] : k.value);
54
+ w(
55
+ () => a.value.meta.errors,
56
+ () => {
57
+ a.value.meta.errors.length ? I({
58
+ inputId: s,
59
+ errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
60
+ label: e.label
61
+ }) : O(s);
62
+ }
63
+ );
64
+ const f = n(() => {
65
+ var t, r, l, v, g, y, h, b, E, V;
66
+ return {
67
+ id: s,
68
+ required: (t = e.meta) == null ? void 0 : t.required,
69
+ minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((l = e.meta) == null ? void 0 : l.minLength),
70
+ maxLength: ((v = e.meta) == null ? void 0 : v.type) === "string" && ((g = e.meta) == null ? void 0 : g.maxLength),
71
+ max: ((y = e.meta) == null ? void 0 : y.type) === "number" && ((h = e.meta) == null ? void 0 : h.maximum),
72
+ min: ((b = e.meta) == null ? void 0 : b.type) === "number" && ((E = e.meta) == null ? void 0 : E.minimum),
73
+ name: e.field.name,
74
+ modelValue: e.field.state.value,
75
+ errorMessages: c.value,
76
+ error: !!c.value.length,
77
+ field: e.field,
78
+ setRealDirty: p,
79
+ type: d.value,
80
+ label: `${e.label}${(V = e.meta) != null && V.required ? " *" : ""}`,
81
+ options: e.options
82
+ };
83
+ });
84
+ return (t, r) => A(t.$slots, "default", D(F(f.value)), () => [
85
+ M("div", {
86
+ class: N(t.$attrs.class),
87
+ onFocusout: p
88
+ }, [
89
+ j($) ? (G(), R(Q, H({
90
+ key: 0,
91
+ "input-props": f.value
92
+ }, t.$attrs, {
93
+ "vuetify-value": f.value.field.state.value
94
+ }), null, 16, ["input-props", "vuetify-value"])) : U("", !0)
95
+ ], 34)
96
+ ]);
97
+ }
98
+ });
11
99
  export {
12
- c as getOmegaStore
100
+ te as default
13
101
  };
@@ -1,101 +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 B, getCurrentInstance as L, useId as P, computed as n, watch as w, nextTick as S, onMounted as x, ref as T, watchEffect as z, renderSlot as A, normalizeProps as D, guardReactiveProps as F, createElementVNode as M, normalizeClass as N, createBlock as R, createCommentVNode as U, unref as j, openBlock as G, mergeProps as H } from "vue";
3
- import { useStore as J } from "@tanstack/vue-form";
4
- import { useOmegaErrors as K } from "./vue-components.es6.js";
5
- import Q from "./vue-components.es25.js";
6
-
7
- const te = /* @__PURE__ */ B({
8
- inheritAttrs: !1,
9
- __name: "OmegaInternalInput",
10
- props: {
11
- field: {},
12
- meta: {},
13
- label: {},
14
- options: {},
15
- type: {},
16
- validators: {}
17
- },
18
- setup(C) {
19
- const e = C, o = L(), $ = o == null ? void 0 : o.appContext.components.VTextField, s = P(), u = e.field, a = J(u.store, (t) => t), d = 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
- }), i = n(() => a.value.value), k = 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
- w(
29
- () => !!i.value,
30
- (t) => {
31
- var r;
32
- !t && ((r = e.meta) == null ? void 0 : r.type) !== "boolean" && S(() => {
33
- var l;
34
- u.setValue(
35
- ((l = e.meta) == null ? void 0 : l.nullableOrUndefined) === "undefined" ? void 0 : null
36
- );
37
- });
38
- }
39
- ), x(() => {
40
- var t, r;
41
- !i.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
42
- });
43
- const { addError: I, removeError: O, showErrors: _, showErrorsOn: q } = K(), m = T(!1);
44
- z(() => {
45
- (_.value || q === "onChange") && (m.value = !0);
46
- });
47
- const p = () => {
48
- m.value = !0;
49
- };
50
- x(() => {
51
- i.value && p();
52
- });
53
- const c = n(() => !m.value && d.value !== "select" ? [] : k.value);
54
- w(
55
- () => a.value.meta.errors,
56
- () => {
57
- a.value.meta.errors.length ? I({
58
- inputId: s,
59
- errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
60
- label: e.label
61
- }) : O(s);
62
- }
63
- );
64
- const f = n(() => {
65
- var t, r, l, v, g, y, h, b, E, V;
66
- return {
67
- id: s,
68
- required: (t = e.meta) == null ? void 0 : t.required,
69
- minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((l = e.meta) == null ? void 0 : l.minLength),
70
- maxLength: ((v = e.meta) == null ? void 0 : v.type) === "string" && ((g = e.meta) == null ? void 0 : g.maxLength),
71
- max: ((y = e.meta) == null ? void 0 : y.type) === "number" && ((h = e.meta) == null ? void 0 : h.maximum),
72
- min: ((b = e.meta) == null ? void 0 : b.type) === "number" && ((E = e.meta) == null ? void 0 : E.minimum),
73
- name: e.field.name,
74
- modelValue: e.field.state.value,
75
- errorMessages: c.value,
76
- error: !!c.value.length,
77
- field: e.field,
78
- setRealDirty: p,
79
- type: d.value,
80
- label: `${e.label}${(V = e.meta) != null && V.required ? " *" : ""}`,
81
- options: e.options
82
- };
83
- });
84
- return (t, r) => A(t.$slots, "default", D(F(f.value)), () => [
85
- M("div", {
86
- class: N(t.$attrs.class),
87
- onFocusout: p
88
- }, [
89
- j($) ? (G(), R(Q, H({
90
- key: 0,
91
- "input-props": f.value
92
- }, t.$attrs, {
93
- "vuetify-value": f.value.field.state.value
94
- }), null, 16, ["input-props", "vuetify-value"])) : U("", !0)
95
- ], 34)
96
- ]);
97
- }
98
- });
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
+ }
99
11
  export {
100
- te as default
12
+ c as getOmegaStore
101
13
  };
@@ -1,4 +1,4 @@
1
- import f from "./vue-components.es23.js";
1
+ const o = (n) => typeof n == "function";
2
2
  export {
3
- f as default
3
+ o as isFunction
4
4
  };
@@ -1,117 +1,4 @@
1
- import { defineComponent as d, resolveComponent as s, createElementBlock as P, openBlock as o, createBlock as n, createCommentVNode as l, resolveDynamicComponent as g, mergeProps as i } from "vue";
2
- const b = /* @__PURE__ */ d({
3
- inheritAttrs: !1,
4
- __name: "OmegaInputVuetify",
5
- props: {
6
- inputProps: {},
7
- vuetifyValue: {}
8
- },
9
- emits: ["focus", "blur"],
10
- setup(y) {
11
- return (e, r) => {
12
- const u = s("v-text-field"), a = s("v-textarea"), t = s("v-select"), m = s("v-autocomplete");
13
- return o(), P("div", {
14
- class: "omega-input",
15
- onFocusout: r[4] || (r[4] = (p) => e.$emit("blur", p)),
16
- onFocusin: r[5] || (r[5] = (p) => e.$emit("focus", p))
17
- }, [
18
- e.inputProps.type === "boolean" || e.inputProps.type === "switch" ? (o(), n(g(e.inputProps.type === "boolean" ? "v-checkbox" : "v-switch"), i({
19
- key: 0,
20
- id: e.inputProps.id,
21
- name: e.inputProps.name,
22
- label: e.inputProps.label,
23
- "error-messages": e.inputProps.errorMessages,
24
- error: e.inputProps.error,
25
- ripple: ""
26
- }, e.$attrs, {
27
- "model-value": e.vuetifyValue,
28
- onChange: r[0] || (r[0] = (p) => e.inputProps.field.handleChange(p.target.checked))
29
- }), null, 16, ["id", "name", "label", "error-messages", "error", "model-value"])) : l("", !0),
30
- e.inputProps.type === "email" || e.inputProps.type === "string" ? (o(), n(u, i({
31
- key: 1,
32
- id: e.inputProps.id,
33
- required: e.inputProps.required,
34
- "min-length": e.inputProps.minLength,
35
- "max-length": e.inputProps.maxLength,
36
- type: e.inputProps.type,
37
- name: e.inputProps.name,
38
- label: e.inputProps.label,
39
- "error-messages": e.inputProps.errorMessages,
40
- error: e.inputProps.error
41
- }, e.$attrs, {
42
- "model-value": e.vuetifyValue,
43
- "onUpdate:modelValue": e.inputProps.field.handleChange
44
- }), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
45
- e.inputProps.type === "text" ? (o(), n(a, i({
46
- key: 2,
47
- id: e.inputProps.id,
48
- required: e.inputProps.required,
49
- "min-length": e.inputProps.minLength,
50
- "max-length": e.inputProps.maxLength,
51
- type: e.inputProps.type,
52
- name: e.inputProps.name,
53
- label: e.inputProps.label,
54
- "error-messages": e.inputProps.errorMessages,
55
- error: e.inputProps.error
56
- }, e.$attrs, {
57
- "model-value": e.vuetifyValue,
58
- "onUpdate:modelValue": e.inputProps.field.handleChange
59
- }), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
60
- e.inputProps.type === "number" ? (o(), n(u, i({
61
- key: 3,
62
- id: e.inputProps.id,
63
- required: e.inputProps.required,
64
- min: e.inputProps.min,
65
- max: e.inputProps.max,
66
- type: e.inputProps.type,
67
- name: e.inputProps.name,
68
- label: e.inputProps.label,
69
- "error-messages": e.inputProps.errorMessages,
70
- error: e.inputProps.error
71
- }, e.$attrs, {
72
- "model-value": e.vuetifyValue,
73
- "onUpdate:modelValue": r[1] || (r[1] = (p) => {
74
- e.inputProps.field.handleChange(Number(p));
75
- })
76
- }), null, 16, ["id", "required", "min", "max", "type", "name", "label", "error-messages", "error", "model-value"])) : l("", !0),
77
- e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (o(), n(t, i({
78
- key: 4,
79
- id: e.inputProps.id,
80
- clearable: e.inputProps.type === "select",
81
- required: e.inputProps.required,
82
- multiple: e.inputProps.type === "multiple",
83
- chips: e.inputProps.type === "multiple",
84
- name: e.inputProps.name,
85
- label: e.inputProps.label,
86
- items: e.inputProps.options,
87
- "error-messages": e.inputProps.errorMessages,
88
- error: e.inputProps.error
89
- }, e.$attrs, {
90
- "model-value": e.vuetifyValue,
91
- onClear: r[2] || (r[2] = (p) => e.inputProps.field.handleChange(void 0)),
92
- "onUpdate:modelValue": e.inputProps.field.handleChange
93
- }), null, 16, ["id", "clearable", "required", "multiple", "chips", "name", "label", "items", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
94
- e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (o(), n(m, i({
95
- key: 5,
96
- id: e.inputProps.id,
97
- clearable: e.inputProps.type === "autocomplete",
98
- multiple: e.inputProps.type === "autocompletemultiple",
99
- required: e.inputProps.required,
100
- name: e.inputProps.name,
101
- label: e.inputProps.label,
102
- items: e.inputProps.options,
103
- "error-messages": e.inputProps.errorMessages,
104
- error: e.inputProps.error,
105
- chips: e.inputProps.type === "autocompletemultiple"
106
- }, e.$attrs, {
107
- "model-value": e.vuetifyValue,
108
- onClear: r[3] || (r[3] = (p) => e.inputProps.field.handleChange(void 0)),
109
- "onUpdate:modelValue": e.inputProps.field.handleChange
110
- }), null, 16, ["id", "clearable", "multiple", "required", "name", "label", "items", "error-messages", "error", "chips", "model-value", "onUpdate:modelValue"])) : l("", !0)
111
- ], 32);
112
- };
113
- }
114
- });
1
+ import f from "./vue-components.es21.js";
115
2
  export {
116
- b as default
3
+ f as default
117
4
  };
@@ -0,0 +1,4 @@
1
+ import f from "./vue-components.es22.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,6 +1,117 @@
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 o from "./vue-components.es25.js";
3
-
1
+ import { defineComponent as d, resolveComponent as s, createElementBlock as P, openBlock as o, createBlock as n, createCommentVNode as l, resolveDynamicComponent as g, mergeProps as i } from "vue";
2
+ const b = /* @__PURE__ */ d({
3
+ inheritAttrs: !1,
4
+ __name: "OmegaInputVuetify",
5
+ props: {
6
+ inputProps: {},
7
+ vuetifyValue: {}
8
+ },
9
+ emits: ["focus", "blur"],
10
+ setup(y) {
11
+ return (e, r) => {
12
+ const u = s("v-text-field"), a = s("v-textarea"), t = s("v-select"), m = s("v-autocomplete");
13
+ return o(), P("div", {
14
+ class: "omega-input",
15
+ onFocusout: r[4] || (r[4] = (p) => e.$emit("blur", p)),
16
+ onFocusin: r[5] || (r[5] = (p) => e.$emit("focus", p))
17
+ }, [
18
+ e.inputProps.type === "boolean" || e.inputProps.type === "switch" ? (o(), n(g(e.inputProps.type === "boolean" ? "v-checkbox" : "v-switch"), i({
19
+ key: 0,
20
+ id: e.inputProps.id,
21
+ name: e.inputProps.name,
22
+ label: e.inputProps.label,
23
+ "error-messages": e.inputProps.errorMessages,
24
+ error: e.inputProps.error,
25
+ ripple: ""
26
+ }, e.$attrs, {
27
+ "model-value": e.vuetifyValue,
28
+ onChange: r[0] || (r[0] = (p) => e.inputProps.field.handleChange(p.target.checked))
29
+ }), null, 16, ["id", "name", "label", "error-messages", "error", "model-value"])) : l("", !0),
30
+ e.inputProps.type === "email" || e.inputProps.type === "string" ? (o(), n(u, i({
31
+ key: 1,
32
+ id: e.inputProps.id,
33
+ required: e.inputProps.required,
34
+ "min-length": e.inputProps.minLength,
35
+ "max-length": e.inputProps.maxLength,
36
+ type: e.inputProps.type,
37
+ name: e.inputProps.name,
38
+ label: e.inputProps.label,
39
+ "error-messages": e.inputProps.errorMessages,
40
+ error: e.inputProps.error
41
+ }, e.$attrs, {
42
+ "model-value": e.vuetifyValue,
43
+ "onUpdate:modelValue": e.inputProps.field.handleChange
44
+ }), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
45
+ e.inputProps.type === "text" ? (o(), n(a, i({
46
+ key: 2,
47
+ id: e.inputProps.id,
48
+ required: e.inputProps.required,
49
+ "min-length": e.inputProps.minLength,
50
+ "max-length": e.inputProps.maxLength,
51
+ type: e.inputProps.type,
52
+ name: e.inputProps.name,
53
+ label: e.inputProps.label,
54
+ "error-messages": e.inputProps.errorMessages,
55
+ error: e.inputProps.error
56
+ }, e.$attrs, {
57
+ "model-value": e.vuetifyValue,
58
+ "onUpdate:modelValue": e.inputProps.field.handleChange
59
+ }), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
60
+ e.inputProps.type === "number" ? (o(), n(u, i({
61
+ key: 3,
62
+ id: e.inputProps.id,
63
+ required: e.inputProps.required,
64
+ min: e.inputProps.min,
65
+ max: e.inputProps.max,
66
+ type: e.inputProps.type,
67
+ name: e.inputProps.name,
68
+ label: e.inputProps.label,
69
+ "error-messages": e.inputProps.errorMessages,
70
+ error: e.inputProps.error
71
+ }, e.$attrs, {
72
+ "model-value": e.vuetifyValue,
73
+ "onUpdate:modelValue": r[1] || (r[1] = (p) => {
74
+ e.inputProps.field.handleChange(Number(p));
75
+ })
76
+ }), null, 16, ["id", "required", "min", "max", "type", "name", "label", "error-messages", "error", "model-value"])) : l("", !0),
77
+ e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (o(), n(t, i({
78
+ key: 4,
79
+ id: e.inputProps.id,
80
+ clearable: e.inputProps.type === "select",
81
+ required: e.inputProps.required,
82
+ multiple: e.inputProps.type === "multiple",
83
+ chips: e.inputProps.type === "multiple",
84
+ name: e.inputProps.name,
85
+ label: e.inputProps.label,
86
+ items: e.inputProps.options,
87
+ "error-messages": e.inputProps.errorMessages,
88
+ error: e.inputProps.error
89
+ }, e.$attrs, {
90
+ "model-value": e.vuetifyValue,
91
+ onClear: r[2] || (r[2] = (p) => e.inputProps.field.handleChange(void 0)),
92
+ "onUpdate:modelValue": e.inputProps.field.handleChange
93
+ }), null, 16, ["id", "clearable", "required", "multiple", "chips", "name", "label", "items", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
94
+ e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (o(), n(m, i({
95
+ key: 5,
96
+ id: e.inputProps.id,
97
+ clearable: e.inputProps.type === "autocomplete",
98
+ multiple: e.inputProps.type === "autocompletemultiple",
99
+ required: e.inputProps.required,
100
+ name: e.inputProps.name,
101
+ label: e.inputProps.label,
102
+ items: e.inputProps.options,
103
+ "error-messages": e.inputProps.errorMessages,
104
+ error: e.inputProps.error,
105
+ chips: e.inputProps.type === "autocompletemultiple"
106
+ }, e.$attrs, {
107
+ "model-value": e.vuetifyValue,
108
+ onClear: r[3] || (r[3] = (p) => e.inputProps.field.handleChange(void 0)),
109
+ "onUpdate:modelValue": e.inputProps.field.handleChange
110
+ }), null, 16, ["id", "clearable", "multiple", "required", "name", "label", "items", "error-messages", "error", "chips", "model-value", "onUpdate:modelValue"])) : l("", !0)
111
+ ], 32);
112
+ };
113
+ }
114
+ });
4
115
  export {
5
- o as default
116
+ b as default
6
117
  };
@@ -0,0 +1,6 @@
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 o from "./vue-components.es27.js";
3
+
4
+ export {
5
+ o as default
6
+ };
@@ -1,7 +1,7 @@
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
- import { generateInputStandardSchemaFromFieldMeta as y } from "./vue-components.es8.js";
3
- import b from "./vue-components.es23.js";
4
- const S = /* @__PURE__ */ i({
1
+ import { defineComponent as d, inject as f, computed as r, createBlock as n, openBlock as m, resolveDynamicComponent as v, withCtx as l, createCommentVNode as c, mergeProps as h, renderSlot as y, normalizeProps as g, guardReactiveProps as C } from "vue";
2
+ import { generateInputStandardSchemaFromFieldMeta as b } from "./vue-components.es9.js";
3
+ import k from "./vue-components.es22.js";
4
+ const $ = /* @__PURE__ */ d({
5
5
  inheritAttrs: !1,
6
6
  __name: "OmegaInput",
7
7
  props: {
@@ -12,37 +12,38 @@ const S = /* @__PURE__ */ i({
12
12
  options: {},
13
13
  type: {}
14
14
  },
15
- setup(n) {
16
- const o = n, a = t(() => o.form.meta[o.name]), m = t(() => {
17
- if (!a.value)
15
+ setup(s) {
16
+ const t = s, a = f("getMetaFromArray"), o = r(() => a != null && a.value && a.value(t.name) ? a.value(t.name) : t.form.meta[t.name]), i = r(() => {
17
+ if (!o.value)
18
18
  throw new Error("Meta is undefined");
19
- return y(a.value);
19
+ return b(o.value);
20
20
  });
21
- return (e, C) => (d(), p(u(e.form.Field), {
21
+ return (e, w) => (m(), n(v(e.form.Field), {
22
22
  name: e.name,
23
23
  validators: {
24
- onChange: m.value,
24
+ onChange: i.value,
25
25
  ...e.validators
26
26
  }
27
27
  }, {
28
- default: r(({ field: l }) => [
29
- f(b, c({
30
- field: l,
28
+ default: l(({ field: p }) => [
29
+ o.value ? (m(), n(k, h({
30
+ key: 0,
31
+ field: p,
31
32
  label: e.label,
32
33
  options: e.options,
33
- meta: a.value,
34
+ meta: o.value,
34
35
  type: e.type
35
36
  }, e.$attrs), {
36
- default: r((s) => [
37
- v(e.$slots, "default", h(g(s)))
37
+ default: l((u) => [
38
+ y(e.$slots, "default", g(C(u)))
38
39
  ]),
39
40
  _: 2
40
- }, 1040, ["field", "label", "options", "meta", "type"])
41
+ }, 1040, ["field", "label", "options", "meta", "type"])) : c("", !0)
41
42
  ]),
42
43
  _: 3
43
44
  }, 8, ["name", "validators"]));
44
45
  }
45
46
  });
46
47
  export {
47
- S as default
48
+ $ as default
48
49
  };