@effect-app/vue-components 0.6.1 → 0.6.2

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.
@@ -4,6 +4,6 @@ import { default as OmegaErrors } from "./OmegaErrors.vue";
4
4
  import { default as OmegaAutoGen } from "./OmegaAutoGen.vue";
5
5
  export * as OmegaErrorsContext from "./OmegaErrorsContext";
6
6
  export * from "./OmegaFormStuff";
7
- export { useOmegaForm } from "./useOmegaForm";
7
+ export { useOmegaForm, type OmegaFormReturn } from "./useOmegaForm";
8
8
  export { default } from "./OmegaWrapper.vue";
9
9
  export { OmegaForm, OmegaInput, OmegaErrors, OmegaAutoGen };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as w, computed as f, onBeforeMount as E, watch as j, createElementBlock as v, openBlock as b, withModifiers as F, createElementVNode as M, unref as c, renderSlot as p, createCommentVNode as k, Fragment as V } from "vue";
2
2
  import { useStore as g } from "@tanstack/vue-form";
3
- import { getOmegaStore as B } from "./vue-components.es21.js";
3
+ import { getOmegaStore as B } from "./vue-components.es23.js";
4
4
  import { provideOmegaErrors as C } from "./vue-components.es6.js";
5
5
  import { useOmegaForm as I } from "./vue-components.es7.js";
6
6
  const $ = ["disabled"], N = /* @__PURE__ */ w({
@@ -1,4 +1,4 @@
1
- import { isFunction as c } from "./vue-components.es22.js";
1
+ import { isFunction as c } from "./vue-components.es20.js";
2
2
  const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
3
3
  export {
4
4
  s as isFunction,
@@ -1,100 +1,4 @@
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";
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, n = L(), $ = n == null ? void 0 : n.appContext.components.VTextField, o = P(), s = e.field, a = J(s.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
- }), u = l(() => a.value.value), k = 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
- w(
29
- () => !!u.value,
30
- (t) => {
31
- t || S(() => {
32
- var r;
33
- s.setValue(
34
- ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
35
- );
36
- });
37
- }
38
- ), x(() => {
39
- 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
- });
42
- const { addError: I, removeError: O, showErrors: _, showErrorsOn: q } = K(), i = T(!1);
43
- z(() => {
44
- (_.value || q === "onChange") && (i.value = !0);
45
- });
46
- const m = () => {
47
- i.value = !0;
48
- };
49
- x(() => {
50
- u.value && m();
51
- });
52
- const d = l(() => !i.value && f.value !== "select" ? [] : k.value);
53
- w(
54
- () => a.value.meta.errors,
55
- () => {
56
- a.value.meta.errors.length ? I({
57
- inputId: o,
58
- errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
59
- label: e.label
60
- }) : O(o);
61
- }
62
- );
63
- const p = l(() => {
64
- var t, r, c, v, g, y, h, b, E, V;
65
- return {
66
- id: o,
67
- 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
- maxLength: ((v = e.meta) == null ? void 0 : v.type) === "string" && ((g = e.meta) == null ? void 0 : g.maxLength),
70
- max: ((y = e.meta) == null ? void 0 : y.type) === "number" && ((h = e.meta) == null ? void 0 : h.maximum),
71
- min: ((b = e.meta) == null ? void 0 : b.type) === "number" && ((E = e.meta) == null ? void 0 : E.minimum),
72
- name: e.field.name,
73
- modelValue: e.field.state.value,
74
- errorMessages: d.value,
75
- error: !!d.value.length,
76
- field: e.field,
77
- setRealDirty: m,
78
- type: f.value,
79
- label: `${e.label}${(V = e.meta) != null && V.required ? " *" : ""}`,
80
- options: e.options
81
- };
82
- });
83
- return (t, r) => A(t.$slots, "default", D(F(p.value)), () => [
84
- M("div", {
85
- class: N(t.$attrs.class),
86
- onFocusout: m
87
- }, [
88
- j($) ? (G(), R(Q, H({
89
- key: 0,
90
- "input-props": p.value
91
- }, t.$attrs, {
92
- "vuetify-value": p.value.field.state.value
93
- }), null, 16, ["input-props", "vuetify-value"])) : U("", !0)
94
- ], 34)
95
- ]);
96
- }
97
- });
1
+ const o = (n) => typeof n == "function";
98
2
  export {
99
- te as default
3
+ o as isFunction
100
4
  };
@@ -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
+ import f from "./vue-components.es19.js";
11
2
  export {
12
- c as getOmegaStore
3
+ f as default
13
4
  };
@@ -1,4 +1,100 @@
1
- const o = (n) => typeof n == "function";
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";
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, n = L(), $ = n == null ? void 0 : n.appContext.components.VTextField, o = P(), s = e.field, a = J(s.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
+ }), u = l(() => a.value.value), k = 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
+ w(
29
+ () => !!u.value,
30
+ (t) => {
31
+ t || S(() => {
32
+ var r;
33
+ s.setValue(
34
+ ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
35
+ );
36
+ });
37
+ }
38
+ ), x(() => {
39
+ 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
+ });
42
+ const { addError: I, removeError: O, showErrors: _, showErrorsOn: q } = K(), i = T(!1);
43
+ z(() => {
44
+ (_.value || q === "onChange") && (i.value = !0);
45
+ });
46
+ const m = () => {
47
+ i.value = !0;
48
+ };
49
+ x(() => {
50
+ u.value && m();
51
+ });
52
+ const d = l(() => !i.value && f.value !== "select" ? [] : k.value);
53
+ w(
54
+ () => a.value.meta.errors,
55
+ () => {
56
+ a.value.meta.errors.length ? I({
57
+ inputId: o,
58
+ errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
59
+ label: e.label
60
+ }) : O(o);
61
+ }
62
+ );
63
+ const p = l(() => {
64
+ var t, r, c, v, g, y, h, b, E, V;
65
+ return {
66
+ id: o,
67
+ 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
+ maxLength: ((v = e.meta) == null ? void 0 : v.type) === "string" && ((g = e.meta) == null ? void 0 : g.maxLength),
70
+ max: ((y = e.meta) == null ? void 0 : y.type) === "number" && ((h = e.meta) == null ? void 0 : h.maximum),
71
+ min: ((b = e.meta) == null ? void 0 : b.type) === "number" && ((E = e.meta) == null ? void 0 : E.minimum),
72
+ name: e.field.name,
73
+ modelValue: e.field.state.value,
74
+ errorMessages: d.value,
75
+ error: !!d.value.length,
76
+ field: e.field,
77
+ setRealDirty: m,
78
+ type: f.value,
79
+ label: `${e.label}${(V = e.meta) != null && V.required ? " *" : ""}`,
80
+ options: e.options
81
+ };
82
+ });
83
+ return (t, r) => A(t.$slots, "default", D(F(p.value)), () => [
84
+ M("div", {
85
+ class: N(t.$attrs.class),
86
+ onFocusout: m
87
+ }, [
88
+ j($) ? (G(), R(Q, H({
89
+ key: 0,
90
+ "input-props": p.value
91
+ }, t.$attrs, {
92
+ "vuetify-value": p.value.field.state.value
93
+ }), null, 16, ["input-props", "vuetify-value"])) : U("", !0)
94
+ ], 34)
95
+ ]);
96
+ }
97
+ });
2
98
  export {
3
- o as isFunction
99
+ te as default
4
100
  };
@@ -1,4 +1,13 @@
1
- import f from "./vue-components.es19.js";
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
+ }
2
11
  export {
3
- f as default
12
+ c as getOmegaStore
4
13
  };
@@ -1,4 +1,4 @@
1
- import f from "./vue-components.es20.js";
1
+ import f from "./vue-components.es22.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as i, computed as t, createBlock as p, openBlock as d, resolveDynamicComponent as u, withCtx as r, createVNode as f, mergeProps as c, renderSlot as v, normalizeProps as h, guardReactiveProps as g } from "vue";
2
2
  import { generateInputStandardSchemaFromFieldMeta as y } from "./vue-components.es8.js";
3
- import b from "./vue-components.es20.js";
3
+ import b from "./vue-components.es22.js";
4
4
  const S = /* @__PURE__ */ i({
5
5
  inheritAttrs: !1,
6
6
  __name: "OmegaInput",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-app/vue-components",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "peerDependencies": {
5
5
  "@mdi/js": "^7.4.47",
6
6
  "@tanstack/vue-form": "^1.2.4",
@@ -58,7 +58,7 @@
58
58
  "effect-app": "2.40.1"
59
59
  },
60
60
  "scripts": {
61
- "build": "pnpm test:run && pnpm build:run",
61
+ "build": "pnpm build:run",
62
62
  "build:run": "rimraf dist && vue-tsc && vite build",
63
63
  "docs:dev": "vitepress dev docs",
64
64
  "docs:build": "vitepress build docs",
@@ -1,4 +1,3 @@
1
- import { defineCustomElement } from "vue"
2
1
  import { default as OmegaForm } from "./OmegaWrapper.vue"
3
2
  import { default as OmegaInput } from "./OmegaInput.vue"
4
3
  import { default as OmegaErrors } from "./OmegaErrors.vue"
@@ -6,7 +5,7 @@ import { default as OmegaAutoGen } from "./OmegaAutoGen.vue"
6
5
 
7
6
  export * as OmegaErrorsContext from "./OmegaErrorsContext"
8
7
  export * from "./OmegaFormStuff"
9
- export { useOmegaForm } from "./useOmegaForm"
8
+ export { useOmegaForm, type OmegaFormReturn } from "./useOmegaForm"
10
9
  export { default } from "./OmegaWrapper.vue"
11
10
 
12
11
  export { OmegaForm, OmegaInput, OmegaErrors, OmegaAutoGen }