@effect-app/vue-components 0.2.1 → 0.2.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as d, watch as b, createElementBlock as S, openBlock as g, withModifiers as v, unref as a, createElementVNode as h, renderSlot as M } from "vue";
|
|
2
2
|
import { useStore as i } from "@tanstack/vue-form";
|
|
3
|
-
import { getOmegaStore as y } from "./vue-components.
|
|
3
|
+
import { getOmegaStore as y } from "./vue-components.es15.js";
|
|
4
4
|
import { provideOmegaErrors as O } from "./vue-components.es4.js";
|
|
5
5
|
import { useOmegaForm as F } from "./vue-components.es5.js";
|
|
6
6
|
const I = ["disabled"], A = /* @__PURE__ */ d({
|
|
@@ -1,87 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
field: {},
|
|
12
|
-
meta: {},
|
|
13
|
-
label: {},
|
|
14
|
-
options: {},
|
|
15
|
-
type: {},
|
|
16
|
-
validators: {}
|
|
17
|
-
},
|
|
18
|
-
setup(I) {
|
|
19
|
-
const e = I, l = L(), $ = l == null ? void 0 : l.appContext.components.VTextField, o = O(), u = e.field, a = N(u.store, (t) => t), i = n(() => {
|
|
20
|
-
var t, r;
|
|
21
|
-
return e.type ? e.type : ((t = e.meta) == null ? void 0 : t.type) === "string" ? e.meta.format === "email" ? "email" : "string" : ((r = e.meta) == null ? void 0 : r.type) || "unknown";
|
|
22
|
-
}), m = n(() => a.value.value), p = n(
|
|
23
|
-
() => (
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
-
a.value.meta.errors.map((t) => t == null ? void 0 : t.message).filter(Boolean)
|
|
26
|
-
)
|
|
27
|
-
);
|
|
28
|
-
q(
|
|
29
|
-
() => [!!m.value],
|
|
30
|
-
() => {
|
|
31
|
-
var t, r;
|
|
32
|
-
p.value.length && !m.value && !((t = e.meta) != null && t.required) && u.setValue(
|
|
33
|
-
((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
), S(() => {
|
|
37
|
-
var t, r;
|
|
38
|
-
!m.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
|
|
39
|
-
});
|
|
40
|
-
const s = A(!1), f = () => {
|
|
41
|
-
s.value = !0;
|
|
42
|
-
}, { addError: k, formSubmissionAttempts: w, removeError: B } = R();
|
|
43
|
-
D(() => {
|
|
44
|
-
w.value > 0 && (s.value = !0);
|
|
45
|
-
});
|
|
46
|
-
const d = n(() => !s.value && i.value !== "select" ? [] : p.value);
|
|
47
|
-
q(
|
|
48
|
-
() => a.value.meta.errors,
|
|
49
|
-
() => {
|
|
50
|
-
a.value.meta.errors.length ? k({
|
|
51
|
-
inputId: o,
|
|
52
|
-
errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
53
|
-
label: e.label
|
|
54
|
-
}) : B(o);
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
const c = n(() => {
|
|
58
|
-
var t, r, v, g, y, h, b, x, V, _;
|
|
59
|
-
return {
|
|
60
|
-
id: o,
|
|
61
|
-
required: (t = e.meta) == null ? void 0 : t.required,
|
|
62
|
-
minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((v = e.meta) == null ? void 0 : v.minLength),
|
|
63
|
-
maxLength: ((g = e.meta) == null ? void 0 : g.type) === "string" && ((y = e.meta) == null ? void 0 : y.maxLength),
|
|
64
|
-
max: ((h = e.meta) == null ? void 0 : h.type) === "number" && ((b = e.meta) == null ? void 0 : b.maximum),
|
|
65
|
-
min: ((x = e.meta) == null ? void 0 : x.type) === "number" && ((V = e.meta) == null ? void 0 : V.minimum),
|
|
66
|
-
name: e.field.name,
|
|
67
|
-
modelValue: e.field.state.value,
|
|
68
|
-
errorMessages: d.value,
|
|
69
|
-
error: !!d.value.length,
|
|
70
|
-
field: e.field,
|
|
71
|
-
setRealDirty: f,
|
|
72
|
-
type: i.value,
|
|
73
|
-
label: `${e.label}${(_ = e.meta) != null && _.required ? " *" : ""}`,
|
|
74
|
-
options: e.options
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
return (t, r) => F(t.$slots, "default", E(c.value, { onFocusout: f }), () => [
|
|
78
|
-
T($) ? (U(), M(j, E({
|
|
79
|
-
key: 0,
|
|
80
|
-
"input-props": c.value
|
|
81
|
-
}, t.$attrs), null, 16, ["input-props"])) : P("", !0)
|
|
82
|
-
]);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
1
|
+
import { useStore as u } from "@tanstack/vue-form";
|
|
2
|
+
import { computed as f } from "vue";
|
|
3
|
+
function c(o, t) {
|
|
4
|
+
return f(() => t ? u(o.store, (n) => {
|
|
5
|
+
const r = {};
|
|
6
|
+
for (const e of t)
|
|
7
|
+
r[e] = n[e];
|
|
8
|
+
return r;
|
|
9
|
+
}).value : {});
|
|
10
|
+
}
|
|
85
11
|
export {
|
|
86
|
-
|
|
12
|
+
c as getOmegaStore
|
|
87
13
|
};
|
|
@@ -1,13 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
import { computed as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(o,t){const a=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(a&&a.call(this),this.shadowRoot){const i=document.createElement("style");i.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),this.shadowRoot.appendChild(i)}},e.call(window.customElements,o,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { defineComponent as C, getCurrentInstance as L, useId as O, computed as n, watch as q, onMounted as S, ref as A, watchEffect as D, renderSlot as F, mergeProps as E, createBlock as M, createCommentVNode as P, unref as T, openBlock as U } from "vue";
|
|
3
|
+
import { useStore as N } from "@tanstack/vue-form";
|
|
4
|
+
import { useOmegaErrors as R } from "./vue-components.es4.js";
|
|
5
|
+
import j from "./vue-components.es18.js";
|
|
6
|
+
|
|
7
|
+
const Q = /* @__PURE__ */ C({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "OmegaInternalInput",
|
|
10
|
+
props: {
|
|
11
|
+
field: {},
|
|
12
|
+
meta: {},
|
|
13
|
+
label: {},
|
|
14
|
+
options: {},
|
|
15
|
+
type: {},
|
|
16
|
+
validators: {}
|
|
17
|
+
},
|
|
18
|
+
setup(I) {
|
|
19
|
+
const e = I, l = L(), $ = l == null ? void 0 : l.appContext.components.VTextField, o = O(), u = e.field, a = N(u.store, (t) => t), i = n(() => {
|
|
20
|
+
var t, r;
|
|
21
|
+
return e.type ? e.type : ((t = e.meta) == null ? void 0 : t.type) === "string" ? e.meta.format === "email" ? "email" : "string" : ((r = e.meta) == null ? void 0 : r.type) || "unknown";
|
|
22
|
+
}), m = n(() => a.value.value), p = n(
|
|
23
|
+
() => (
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
a.value.meta.errors.map((t) => t == null ? void 0 : t.message).filter(Boolean)
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
q(
|
|
29
|
+
() => [!!m.value],
|
|
30
|
+
() => {
|
|
31
|
+
var t, r;
|
|
32
|
+
p.value.length && !m.value && !((t = e.meta) != null && t.required) && u.setValue(
|
|
33
|
+
((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
), S(() => {
|
|
37
|
+
var t, r;
|
|
38
|
+
!m.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
|
|
39
|
+
});
|
|
40
|
+
const s = A(!1), f = () => {
|
|
41
|
+
s.value = !0;
|
|
42
|
+
}, { addError: k, formSubmissionAttempts: w, removeError: B } = R();
|
|
43
|
+
D(() => {
|
|
44
|
+
w.value > 0 && (s.value = !0);
|
|
45
|
+
});
|
|
46
|
+
const d = n(() => !s.value && i.value !== "select" ? [] : p.value);
|
|
47
|
+
q(
|
|
48
|
+
() => a.value.meta.errors,
|
|
49
|
+
() => {
|
|
50
|
+
a.value.meta.errors.length ? k({
|
|
51
|
+
inputId: o,
|
|
52
|
+
errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
53
|
+
label: e.label
|
|
54
|
+
}) : B(o);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
const c = n(() => {
|
|
58
|
+
var t, r, v, g, y, h, b, x, V, _;
|
|
59
|
+
return {
|
|
60
|
+
id: o,
|
|
61
|
+
required: (t = e.meta) == null ? void 0 : t.required,
|
|
62
|
+
minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((v = e.meta) == null ? void 0 : v.minLength),
|
|
63
|
+
maxLength: ((g = e.meta) == null ? void 0 : g.type) === "string" && ((y = e.meta) == null ? void 0 : y.maxLength),
|
|
64
|
+
max: ((h = e.meta) == null ? void 0 : h.type) === "number" && ((b = e.meta) == null ? void 0 : b.maximum),
|
|
65
|
+
min: ((x = e.meta) == null ? void 0 : x.type) === "number" && ((V = e.meta) == null ? void 0 : V.minimum),
|
|
66
|
+
name: e.field.name,
|
|
67
|
+
modelValue: e.field.state.value,
|
|
68
|
+
errorMessages: d.value,
|
|
69
|
+
error: !!d.value.length,
|
|
70
|
+
field: e.field,
|
|
71
|
+
setRealDirty: f,
|
|
72
|
+
type: i.value,
|
|
73
|
+
label: `${e.label}${(_ = e.meta) != null && _.required ? " *" : ""}`,
|
|
74
|
+
options: e.options
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
return (t, r) => F(t.$slots, "default", E(c.value, { onFocusout: f }), () => [
|
|
78
|
+
T($) ? (U(), M(j, E({
|
|
79
|
+
key: 0,
|
|
80
|
+
"input-props": c.value
|
|
81
|
+
}, t.$attrs), null, 16, ["input-props"])) : P("", !0)
|
|
82
|
+
]);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
11
85
|
export {
|
|
12
|
-
|
|
86
|
+
Q as default
|
|
13
87
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as i, computed as t, createBlock as p, openBlock as d, resolveDynamicComponent as u, withCtx as r, createVNode as f, mergeProps as c, renderSlot as v, normalizeProps as h, guardReactiveProps as g } from "vue";
|
|
2
2
|
import { generateInputStandardSchemaFromFieldMeta as y } from "./vue-components.es6.js";
|
|
3
|
-
import b from "./vue-components.
|
|
3
|
+
import b from "./vue-components.es16.js";
|
|
4
4
|
const S = /* @__PURE__ */ i({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "OmegaInput",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"@tanstack/vue-form": "^1.2.4",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"./dist/vue-components.css": "./dist/vue-components.css"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@effect-app/vue": "2.
|
|
47
|
-
"effect-app": "2.
|
|
46
|
+
"@effect-app/vue": "2.40.0",
|
|
47
|
+
"effect-app": "2.39.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "rimraf dist && vue-tsc && vite build",
|