@effect-app/vue-components 0.4.6 → 0.6.1

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 (48) hide show
  1. package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +30 -0
  2. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +1 -1
  3. package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +5 -5
  4. package/dist/types/components/OmegaForm/index.d.ts +2 -6
  5. package/dist/types/components/OmegaForm/useOmegaForm.d.ts +1 -1
  6. package/dist/vue-components.es.js +24 -27
  7. package/dist/vue-components.es10.js +6 -23
  8. package/dist/vue-components.es11.js +76 -43
  9. package/dist/vue-components.es15.js +1 -1
  10. package/dist/vue-components.es17.js +2 -5
  11. package/dist/vue-components.es18.js +5 -32
  12. package/dist/vue-components.es19.js +32 -2
  13. package/dist/vue-components.es2.js +16 -19
  14. package/dist/vue-components.es20.js +98 -2
  15. package/dist/vue-components.es21.js +11 -96
  16. package/dist/vue-components.es22.js +2 -11
  17. package/dist/vue-components.es23.js +1 -1
  18. package/dist/vue-components.es24.js +2 -115
  19. package/dist/vue-components.es25.js +117 -0
  20. package/dist/{vue-components.es26.js → vue-components.es27.js} +1 -1
  21. package/dist/vue-components.es3.js +3 -3
  22. package/dist/vue-components.es4.js +2 -2
  23. package/dist/vue-components.es5.js +78 -36
  24. package/dist/vue-components.es6.js +34 -131
  25. package/dist/vue-components.es7.js +128 -211
  26. package/dist/vue-components.es8.js +216 -6
  27. package/dist/vue-components.es9.js +4 -4
  28. package/package.json +9 -3
  29. package/src/components/OmegaForm/OmegaAutoGen.vue +110 -0
  30. package/src/components/OmegaForm/OmegaErrors.vue +3 -3
  31. package/src/components/OmegaForm/OmegaFormStuff.ts +1 -1
  32. package/src/components/OmegaForm/OmegaInternalInput.vue +9 -6
  33. package/src/components/OmegaForm/OmegaWrapper.vue +59 -12
  34. package/src/components/OmegaForm/index.ts +2 -19
  35. package/src/components/OmegaForm/useOmegaForm.ts +1 -1
  36. package/src/env.d.ts +0 -8
  37. package/src/stories/OmegaForm/ComplexForm.vue +0 -87
  38. package/src/stories/OmegaForm/EmailForm.vue +0 -48
  39. package/src/stories/OmegaForm/Meta.vue +0 -47
  40. package/src/stories/OmegaForm/OneHundredWaysToWriteAForm.vue +0 -188
  41. package/src/stories/OmegaForm/PersistencyForm.vue +0 -58
  42. package/src/stories/OmegaForm/SimpleForm.vue +0 -30
  43. package/src/stories/OmegaForm/SimpleFormVuetifyDefault.vue +0 -15
  44. package/src/stories/OmegaForm/SumExample.vue +0 -37
  45. package/src/stories/OmegaForm/form.Input.vue +0 -98
  46. package/src/stories/OmegaForm.stories.ts +0 -106
  47. package/src/stories/README.md +0 -29
  48. package/src/stories/tsconfig.json +0 -4
@@ -1,98 +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 l, watch as C, onMounted as $, ref as S, watchEffect as z, renderSlot as A, normalizeProps as D, guardReactiveProps as F, createElementVNode as M, normalizeClass as N, createBlock as R, createCommentVNode as T, unref as U, openBlock as j, mergeProps as G } from "vue";
3
- import { useStore as H } from "@tanstack/vue-form";
4
- import { useOmegaErrors as J } from "./vue-components.es5.js";
5
- import K from "./vue-components.es24.js";
6
-
7
- const ee = /* @__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(q) {
19
- const e = q, o = L(), x = o == null ? void 0 : o.appContext.components.VTextField, s = P(), u = e.field, a = H(u.store, (t) => t), f = l(() => {
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
- }), n = l(() => a.value.value), d = l(
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
- C(
29
- () => [!!n.value],
30
- () => {
31
- var t, r;
32
- d.value.length && !n.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
- ), $(() => {
37
- var t, r;
38
- !n.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
39
- });
40
- const { addError: I, removeError: O, showErrors: _, showErrorsOn: k } = J(), i = S(!1);
41
- z(() => {
42
- (_.value || k === "onChange") && (i.value = !0);
43
- });
44
- const m = () => {
45
- i.value = !0;
46
- };
47
- $(() => {
48
- n.value && m();
49
- });
50
- const v = l(() => !i.value && f.value !== "select" ? [] : d.value);
51
- C(
52
- () => a.value.meta.errors,
53
- () => {
54
- a.value.meta.errors.length ? I({
55
- inputId: s,
56
- errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
57
- label: e.label
58
- }) : O(s);
59
- }
60
- );
61
- const p = l(() => {
62
- var t, r, c, g, y, h, b, E, V, w;
63
- return {
64
- id: s,
65
- required: (t = e.meta) == null ? void 0 : t.required,
66
- minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((c = e.meta) == null ? void 0 : c.minLength),
67
- maxLength: ((g = e.meta) == null ? void 0 : g.type) === "string" && ((y = e.meta) == null ? void 0 : y.maxLength),
68
- max: ((h = e.meta) == null ? void 0 : h.type) === "number" && ((b = e.meta) == null ? void 0 : b.maximum),
69
- min: ((E = e.meta) == null ? void 0 : E.type) === "number" && ((V = e.meta) == null ? void 0 : V.minimum),
70
- name: e.field.name,
71
- modelValue: e.field.state.value,
72
- errorMessages: v.value,
73
- error: !!v.value.length,
74
- field: e.field,
75
- setRealDirty: m,
76
- type: f.value,
77
- label: `${e.label}${(w = e.meta) != null && w.required ? " *" : ""}`,
78
- options: e.options
79
- };
80
- });
81
- return (t, r) => A(t.$slots, "default", D(F(p.value)), () => [
82
- M("div", {
83
- class: N(t.$attrs.class),
84
- onFocusout: m
85
- }, [
86
- U(x) ? (j(), R(K, G({
87
- key: 0,
88
- "input-props": p.value
89
- }, t.$attrs, {
90
- "vuetify-value": p.value.field.state.value
91
- }), null, 16, ["input-props", "vuetify-value"])) : T("", !0)
92
- ], 34)
93
- ]);
94
- }
95
- });
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
+ }
96
11
  export {
97
- ee as default
12
+ c as getOmegaStore
98
13
  };
@@ -1,13 +1,4 @@
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
+ const o = (n) => typeof n == "function";
11
2
  export {
12
- c as getOmegaStore
3
+ o as isFunction
13
4
  };
@@ -1,4 +1,4 @@
1
- import f from "./vue-components.es21.js";
1
+ import f from "./vue-components.es19.js";
2
2
  export {
3
3
  f as default
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.es20.js";
115
2
  export {
116
- b as default
3
+ f as default
117
4
  };
@@ -0,0 +1,117 @@
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
+ });
115
+ export {
116
+ b as default
117
+ };
@@ -1,5 +1,5 @@
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 o from "./vue-components.es24.js";
2
+ import o from "./vue-components.es25.js";
3
3
 
4
4
  export {
5
5
  o as default
@@ -1,10 +1,10 @@
1
- import { inject as o, provide as r } from "vue";
1
+ import { provide as o, inject as r } from "vue";
2
2
  const n = Symbol(), i = () => {
3
- const t = o(n);
3
+ const t = r(n);
4
4
  if (!t)
5
5
  throw new Error("useIntl must be used within a IntlProvider");
6
6
  return t;
7
- }, s = (t) => r(n, t);
7
+ }, s = (t) => o(n, t);
8
8
  export {
9
9
  s as provideIntl,
10
10
  i as useIntl
@@ -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
- import { generateInputStandardSchemaFromFieldMeta as y } from "./vue-components.es7.js";
3
- import b from "./vue-components.es21.js";
2
+ import { generateInputStandardSchemaFromFieldMeta as y } from "./vue-components.es8.js";
3
+ import b from "./vue-components.es20.js";
4
4
  const S = /* @__PURE__ */ i({
5
5
  inheritAttrs: !1,
6
6
  __name: "OmegaInput",
@@ -1,38 +1,80 @@
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 _, computed as O, createElementBlock as j, openBlock as M, Fragment as E, renderList as A, renderSlot as F, createVNode as g, mergeProps as h } from "vue";
2
+ import { Order as s, pipe as k, Array as l } from "effect-app";
3
+ import v from "./vue-components.es4.js";
4
+ const R = /* @__PURE__ */ _({
5
+ __name: "OmegaAutoGen",
6
+ props: {
7
+ form: {},
8
+ pick: {},
9
+ omit: {},
10
+ labelMap: { type: Function },
11
+ filterMap: { type: Function },
12
+ order: {},
13
+ sort: {}
14
+ },
15
+ setup(m) {
16
+ const u = (e) => (t) => Object.fromEntries(
17
+ Object.entries(t).map(([r, o]) => [r, e(o, r)])
18
+ ), a = (e) => (t) => Object.fromEntries(
19
+ Object.entries(t).filter(([r, o]) => e(o, r))
20
+ ), f = (e) => (t) => Object.entries(t).reduce(
21
+ (r, [o, c]) => {
22
+ const i = e(c, o);
23
+ return i !== !1 && (r[o] = i), r;
24
+ },
25
+ {}
26
+ ), n = m, p = (e, t) => {
27
+ const r = (t == null ? void 0 : t.indexOf(e)) ?? -1;
28
+ return r === -1 ? Number.MAX_SAFE_INTEGER : r;
29
+ }, d = s.mapInput(
30
+ s.number,
31
+ (e) => p(e.name, n.order || [])
32
+ ), b = O(
33
+ () => k(
34
+ n.form.meta,
35
+ // include / exclude
36
+ a(
37
+ (e, t) => {
38
+ var r, o;
39
+ return n.pick ? n.pick.includes(t) && !((r = n.omit) != null && r.includes(t)) : !((o = n.omit) != null && o.includes(t));
40
+ }
41
+ ),
42
+ (e) => e,
43
+ // labelMap and adding name
44
+ u((e, t) => {
45
+ var r;
46
+ return {
47
+ name: t,
48
+ label: ((r = n.labelMap) == null ? void 0 : r.call(n, t)) || t,
49
+ ...e
50
+ };
51
+ }),
52
+ // filterMap
53
+ n.filterMap ? f((e) => {
54
+ var r;
55
+ const t = (r = n.filterMap) == null ? void 0 : r.call(n, e.name, e);
56
+ return t === void 0 || t === !0 ? e : t;
57
+ }) : (e) => e,
58
+ // transform to array
59
+ (e) => Object.values(e),
60
+ // order
61
+ l.sort(d),
62
+ // sort
63
+ n.sort ? l.sort(n.sort) : (e) => e
64
+ )
65
+ );
66
+ return (e, t) => (M(!0), j(E, null, A(b.value, ({ name: r, label: o, ...c }) => F(e.$slots, "default", {
67
+ child: { name: r, label: o, ...c }
68
+ }, () => [
69
+ g(v, h({
70
+ form: n.form,
71
+ name: r,
72
+ label: o,
73
+ ref_for: !0
74
+ }, c), null, 16, ["form", "name", "label"])
75
+ ])), 256));
76
+ }
77
+ });
34
78
  export {
35
- u as OmegaErrorsKey,
36
- h as provideOmegaErrors,
37
- w as useOmegaErrors
79
+ R as default
38
80
  };