@effect-app/vue-components 0.6.2 → 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 (37) hide show
  1. package/dist/types/components/OmegaForm/OmegaArray.vue.d.ts +24 -0
  2. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +16 -2
  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 +32 -31
  17. package/dist/vue-components.es24.js +2 -2
  18. package/dist/vue-components.es25.js +2 -115
  19. package/dist/vue-components.es26.js +4 -0
  20. package/dist/vue-components.es27.js +115 -4
  21. package/dist/vue-components.es29.js +6 -0
  22. package/dist/vue-components.es4.js +19 -18
  23. package/dist/vue-components.es6.js +50 -36
  24. package/dist/vue-components.es7.js +34 -131
  25. package/dist/vue-components.es8.js +128 -211
  26. package/dist/vue-components.es9.js +218 -6
  27. package/package.json +1 -1
  28. package/src/components/OmegaForm/OmegaArray.vue +67 -0
  29. package/src/components/OmegaForm/OmegaErrors.vue +7 -3
  30. package/src/components/OmegaForm/OmegaFormInput.vue +6 -2
  31. package/src/components/OmegaForm/OmegaFormStuff.ts +5 -1
  32. package/src/components/OmegaForm/OmegaInput.vue +9 -1
  33. package/src/components/OmegaForm/OmegaInputVuetify.vue +3 -2
  34. package/src/components/OmegaForm/OmegaInternalInput.vue +1 -1
  35. package/src/components/OmegaForm/index.ts +2 -1
  36. package/dist/vue-components.es13.js +0 -9
  37. 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,8 +1,8 @@
1
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 l, 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";
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
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";
4
+ import { useOmegaErrors as K } from "./vue-components.es7.js";
5
+ import Q from "./vue-components.es27.js";
6
6
 
7
7
  const te = /* @__PURE__ */ B({
8
8
  inheritAttrs: !1,
@@ -16,80 +16,81 @@ const te = /* @__PURE__ */ B({
16
16
  validators: {}
17
17
  },
18
18
  setup(C) {
19
- const e = C, n = L(), $ = n == null ? void 0 : n.appContext.components.VTextField, o = P(), s = e.field, a = J(s.store, (t) => t), f = l(() => {
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
20
  var t, r;
21
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
- }), u = l(() => a.value.value), k = l(
22
+ }), i = n(() => a.value.value), k = n(
23
23
  () => (
24
24
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
25
  a.value.meta.errors.map((t) => t == null ? void 0 : t.message).filter(Boolean)
26
26
  )
27
27
  );
28
28
  w(
29
- () => !!u.value,
29
+ () => !!i.value,
30
30
  (t) => {
31
- t || S(() => {
32
- var r;
33
- s.setValue(
34
- ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
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
35
36
  );
36
37
  });
37
38
  }
38
39
  ), x(() => {
39
40
  var t, r;
40
- !u.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && s.setValue(null);
41
+ !i.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
41
42
  });
42
- const { addError: I, removeError: O, showErrors: _, showErrorsOn: q } = K(), i = T(!1);
43
+ const { addError: I, removeError: O, showErrors: _, showErrorsOn: q } = K(), m = T(!1);
43
44
  z(() => {
44
- (_.value || q === "onChange") && (i.value = !0);
45
+ (_.value || q === "onChange") && (m.value = !0);
45
46
  });
46
- const m = () => {
47
- i.value = !0;
47
+ const p = () => {
48
+ m.value = !0;
48
49
  };
49
50
  x(() => {
50
- u.value && m();
51
+ i.value && p();
51
52
  });
52
- const d = l(() => !i.value && f.value !== "select" ? [] : k.value);
53
+ const c = n(() => !m.value && d.value !== "select" ? [] : k.value);
53
54
  w(
54
55
  () => a.value.meta.errors,
55
56
  () => {
56
57
  a.value.meta.errors.length ? I({
57
- inputId: o,
58
+ inputId: s,
58
59
  errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
59
60
  label: e.label
60
- }) : O(o);
61
+ }) : O(s);
61
62
  }
62
63
  );
63
- const p = l(() => {
64
- var t, r, c, v, g, y, h, b, E, V;
64
+ const f = n(() => {
65
+ var t, r, l, v, g, y, h, b, E, V;
65
66
  return {
66
- id: o,
67
+ id: s,
67
68
  required: (t = e.meta) == null ? void 0 : t.required,
68
- minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((c = e.meta) == null ? void 0 : c.minLength),
69
+ minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((l = e.meta) == null ? void 0 : l.minLength),
69
70
  maxLength: ((v = e.meta) == null ? void 0 : v.type) === "string" && ((g = e.meta) == null ? void 0 : g.maxLength),
70
71
  max: ((y = e.meta) == null ? void 0 : y.type) === "number" && ((h = e.meta) == null ? void 0 : h.maximum),
71
72
  min: ((b = e.meta) == null ? void 0 : b.type) === "number" && ((E = e.meta) == null ? void 0 : E.minimum),
72
73
  name: e.field.name,
73
74
  modelValue: e.field.state.value,
74
- errorMessages: d.value,
75
- error: !!d.value.length,
75
+ errorMessages: c.value,
76
+ error: !!c.value.length,
76
77
  field: e.field,
77
- setRealDirty: m,
78
- type: f.value,
78
+ setRealDirty: p,
79
+ type: d.value,
79
80
  label: `${e.label}${(V = e.meta) != null && V.required ? " *" : ""}`,
80
81
  options: e.options
81
82
  };
82
83
  });
83
- return (t, r) => A(t.$slots, "default", D(F(p.value)), () => [
84
+ return (t, r) => A(t.$slots, "default", D(F(f.value)), () => [
84
85
  M("div", {
85
86
  class: N(t.$attrs.class),
86
- onFocusout: m
87
+ onFocusout: p
87
88
  }, [
88
89
  j($) ? (G(), R(Q, H({
89
90
  key: 0,
90
- "input-props": p.value
91
+ "input-props": f.value
91
92
  }, t.$attrs, {
92
- "vuetify-value": p.value.field.state.value
93
+ "vuetify-value": f.value.field.state.value
93
94
  }), null, 16, ["input-props", "vuetify-value"])) : U("", !0)
94
95
  ], 34)
95
96
  ]);
@@ -1,4 +1,4 @@
1
- import f from "./vue-components.es22.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 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({
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 a = i("v-checkbox"), u = i("v-text-field"), t = i("v-textarea"), m = i("v-select"), d = i("v-autocomplete");
13
- return o(), g("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" ? (o(), n(a, s({
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, s({
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(t, s({
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, s({
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(m, s({
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(d, s({
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.es22.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
  };
@@ -1,38 +1,52 @@
1
- import { ref as l, computed as p, readonly as v, provide as E, inject as f } from "vue";
2
- const u = Symbol();
3
- function h(e, a, t = "onSubmit") {
4
- const r = l([]), n = (o) => {
5
- r.value = r.value.filter((d) => d.inputId !== o);
6
- }, c = (o) => {
7
- n(o.inputId), r.value.push(o);
8
- }, i = () => {
9
- r.value = [];
10
- }, m = p(() => {
11
- switch (t) {
12
- case "onChange":
13
- return !0;
14
- default:
15
- return e.value > 0;
16
- }
17
- }), s = {
18
- errors: v(r),
19
- addError: c,
20
- removeError: n,
21
- clearErrors: i,
22
- showErrors: m,
23
- generalErrors: a,
24
- showErrorsOn: t ?? "onSubmit"
25
- };
26
- return E(u, s), s;
27
- }
28
- function w() {
29
- const e = f(u);
30
- if (!e)
31
- throw new Error("useOmegaErrors must be used within an OmegaForm provider");
32
- return e;
33
- }
1
+ import { defineComponent as c, computed as g, provide as M, createBlock as m, openBlock as s, resolveDynamicComponent as u, withCtx as i, createElementBlock as _, renderSlot as l, Fragment as h, renderList as k, mergeProps as v, normalizeProps as F, guardReactiveProps as S } from "vue";
2
+ import { createMeta as A } from "./vue-components.es9.js";
3
+ const C = /* @__PURE__ */ c({
4
+ inheritAttrs: !1,
5
+ __name: "OmegaArray",
6
+ props: {
7
+ form: {},
8
+ name: {}
9
+ },
10
+ setup(f) {
11
+ const p = f, d = g(() => {
12
+ const e = p.form.meta[p.name];
13
+ if (e && e.type === "multiple") {
14
+ const n = e.rest.reduce(
15
+ (t, r) => (r.type._tag === "TypeLiteral" && t.propertySignatures.push(...r.type.propertySignatures), t),
16
+ {
17
+ propertySignatures: []
18
+ }
19
+ ), a = A(n);
20
+ return (t) => {
21
+ const r = t.split("]."), o = r[r.length - 1];
22
+ return a[o];
23
+ };
24
+ }
25
+ return (n) => {
26
+ };
27
+ });
28
+ return M("getMetaFromArray", d), (e, n) => (s(), m(u(e.form.Field), { name: e.name }, {
29
+ default: i(({ field: a }) => [
30
+ (s(!0), _(h, null, k(a.state.value, (y, t) => (s(), m(u(e.form.Field), {
31
+ key: t,
32
+ name: `${e.name}[${t}]`
33
+ }, {
34
+ default: i(({ field: r, state: o }) => [
35
+ l(e.$slots, "default", v({ ref_for: !0 }, {
36
+ field: a,
37
+ subField: r,
38
+ subState: o,
39
+ index: t
40
+ }))
41
+ ]),
42
+ _: 2
43
+ }, 1032, ["name"]))), 128)),
44
+ l(e.$slots, "field", F(S({ field: a })))
45
+ ]),
46
+ _: 3
47
+ }, 8, ["name"]));
48
+ }
49
+ });
34
50
  export {
35
- u as OmegaErrorsKey,
36
- h as provideOmegaErrors,
37
- w as useOmegaErrors
51
+ C as default
38
52
  };