@effect-app/vue-components 0.8.12 → 0.9.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.
|
@@ -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.
|
|
3
|
+
import { getOmegaStore as B } from "./vue-components.es23.js";
|
|
4
4
|
import { provideOmegaErrors as C } from "./vue-components.es7.js";
|
|
5
5
|
import { useOmegaForm as I } from "./vue-components.es8.js";
|
|
6
6
|
const $ = ["disabled"], N = /* @__PURE__ */ w({
|
|
@@ -1,13 +1,101 @@
|
|
|
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 q, getCurrentInstance as L, useId as P, computed as l, watch as w, nextTick as F, onMounted as x, ref as S, watchEffect as T, renderSlot as z, normalizeProps as A, guardReactiveProps as D, createElementVNode as M, normalizeClass as R, createBlock as U, createCommentVNode as Z, 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 re = /* @__PURE__ */ q({
|
|
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 t = C, o = L(), N = o == null ? void 0 : o.appContext.components.VTextField, s = P(), u = t.field, a = J(u.store, (e) => e), f = l(() => {
|
|
20
|
+
var e, r;
|
|
21
|
+
return t.type ? t.type : ((e = t.meta) == null ? void 0 : e.type) === "string" ? t.meta.format === "email" ? "email" : "string" : ((r = t.meta) == null ? void 0 : r.type) || "unknown";
|
|
22
|
+
}), n = l(() => a.value.value), $ = l(
|
|
23
|
+
() => (
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
a.value.meta.errors.map((e) => e == null ? void 0 : e.message).filter(Boolean)
|
|
26
|
+
)
|
|
27
|
+
), k = (e) => e == null || e === !1 || e === "" || Number.isNaN(e);
|
|
28
|
+
w(
|
|
29
|
+
() => !!n.value,
|
|
30
|
+
() => {
|
|
31
|
+
var e;
|
|
32
|
+
k(n.value) && ((e = t.meta) == null ? void 0 : e.type) !== "boolean" && F(() => {
|
|
33
|
+
var r;
|
|
34
|
+
u.setValue(
|
|
35
|
+
((r = t.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
), x(() => {
|
|
40
|
+
var e, r;
|
|
41
|
+
!n.value && !((e = t.meta) != null && e.required) && ((r = t.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
|
|
42
|
+
});
|
|
43
|
+
const { addError: B, removeError: I, showErrors: O, showErrorsOn: _ } = K(), i = S(!1);
|
|
44
|
+
T(() => {
|
|
45
|
+
(O.value || _ === "onChange") && (i.value = !0);
|
|
46
|
+
});
|
|
47
|
+
const m = () => {
|
|
48
|
+
i.value = !0;
|
|
49
|
+
};
|
|
50
|
+
x(() => {
|
|
51
|
+
n.value && m();
|
|
52
|
+
});
|
|
53
|
+
const d = l(() => !i.value && f.value !== "select" ? [] : $.value);
|
|
54
|
+
w(
|
|
55
|
+
() => a.value.meta.errors,
|
|
56
|
+
() => {
|
|
57
|
+
a.value.meta.errors.length ? B({
|
|
58
|
+
inputId: s,
|
|
59
|
+
errors: a.value.meta.errors.map((e) => e.message).filter(Boolean),
|
|
60
|
+
label: t.label
|
|
61
|
+
}) : I(s);
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
const p = l(() => {
|
|
65
|
+
var e, r, c, v, g, y, h, b, E, V;
|
|
66
|
+
return {
|
|
67
|
+
id: s,
|
|
68
|
+
required: (e = t.meta) == null ? void 0 : e.required,
|
|
69
|
+
minLength: ((r = t.meta) == null ? void 0 : r.type) === "string" && ((c = t.meta) == null ? void 0 : c.minLength),
|
|
70
|
+
maxLength: ((v = t.meta) == null ? void 0 : v.type) === "string" && ((g = t.meta) == null ? void 0 : g.maxLength),
|
|
71
|
+
max: ((y = t.meta) == null ? void 0 : y.type) === "number" && ((h = t.meta) == null ? void 0 : h.maximum),
|
|
72
|
+
min: ((b = t.meta) == null ? void 0 : b.type) === "number" && ((E = t.meta) == null ? void 0 : E.minimum),
|
|
73
|
+
name: t.field.name,
|
|
74
|
+
modelValue: t.field.state.value,
|
|
75
|
+
errorMessages: d.value,
|
|
76
|
+
error: !!d.value.length,
|
|
77
|
+
field: t.field,
|
|
78
|
+
setRealDirty: m,
|
|
79
|
+
type: f.value,
|
|
80
|
+
label: `${t.label}${(V = t.meta) != null && V.required ? " *" : ""}`,
|
|
81
|
+
options: t.options
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
return (e, r) => z(e.$slots, "default", A(D(p.value)), () => [
|
|
85
|
+
M("div", {
|
|
86
|
+
class: R(e.$attrs.class),
|
|
87
|
+
onFocusout: m
|
|
88
|
+
}, [
|
|
89
|
+
j(N) ? (G(), U(Q, H({
|
|
90
|
+
key: 0,
|
|
91
|
+
"input-props": p.value
|
|
92
|
+
}, e.$attrs, {
|
|
93
|
+
"vuetify-value": p.value.field.state.value
|
|
94
|
+
}), null, 16, ["input-props", "vuetify-value"])) : Z("", !0)
|
|
95
|
+
], 34)
|
|
96
|
+
]);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
11
99
|
export {
|
|
12
|
-
|
|
100
|
+
re as default
|
|
13
101
|
};
|
|
@@ -1,101 +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(C) {
|
|
19
|
-
const t = C, o = L(), N = o == null ? void 0 : o.appContext.components.VTextField, s = P(), u = t.field, a = J(u.store, (e) => e), f = l(() => {
|
|
20
|
-
var e, r;
|
|
21
|
-
return t.type ? t.type : ((e = t.meta) == null ? void 0 : e.type) === "string" ? t.meta.format === "email" ? "email" : "string" : ((r = t.meta) == null ? void 0 : r.type) || "unknown";
|
|
22
|
-
}), n = l(() => a.value.value), $ = l(
|
|
23
|
-
() => (
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
-
a.value.meta.errors.map((e) => e == null ? void 0 : e.message).filter(Boolean)
|
|
26
|
-
)
|
|
27
|
-
), k = (e) => e == null || e === !1 || e === "" || Number.isNaN(e);
|
|
28
|
-
w(
|
|
29
|
-
() => !!n.value,
|
|
30
|
-
() => {
|
|
31
|
-
var e;
|
|
32
|
-
k(n.value) && ((e = t.meta) == null ? void 0 : e.type) !== "boolean" && F(() => {
|
|
33
|
-
var r;
|
|
34
|
-
u.setValue(
|
|
35
|
-
((r = t.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
|
|
36
|
-
);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
), x(() => {
|
|
40
|
-
var e, r;
|
|
41
|
-
!n.value && !((e = t.meta) != null && e.required) && ((r = t.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
|
|
42
|
-
});
|
|
43
|
-
const { addError: B, removeError: I, showErrors: O, showErrorsOn: _ } = K(), i = S(!1);
|
|
44
|
-
T(() => {
|
|
45
|
-
(O.value || _ === "onChange") && (i.value = !0);
|
|
46
|
-
});
|
|
47
|
-
const m = () => {
|
|
48
|
-
i.value = !0;
|
|
49
|
-
};
|
|
50
|
-
x(() => {
|
|
51
|
-
n.value && m();
|
|
52
|
-
});
|
|
53
|
-
const d = l(() => !i.value && f.value !== "select" ? [] : $.value);
|
|
54
|
-
w(
|
|
55
|
-
() => a.value.meta.errors,
|
|
56
|
-
() => {
|
|
57
|
-
a.value.meta.errors.length ? B({
|
|
58
|
-
inputId: s,
|
|
59
|
-
errors: a.value.meta.errors.map((e) => e.message).filter(Boolean),
|
|
60
|
-
label: t.label
|
|
61
|
-
}) : I(s);
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
const p = l(() => {
|
|
65
|
-
var e, r, c, v, g, y, h, b, E, V;
|
|
66
|
-
return {
|
|
67
|
-
id: s,
|
|
68
|
-
required: (e = t.meta) == null ? void 0 : e.required,
|
|
69
|
-
minLength: ((r = t.meta) == null ? void 0 : r.type) === "string" && ((c = t.meta) == null ? void 0 : c.minLength),
|
|
70
|
-
maxLength: ((v = t.meta) == null ? void 0 : v.type) === "string" && ((g = t.meta) == null ? void 0 : g.maxLength),
|
|
71
|
-
max: ((y = t.meta) == null ? void 0 : y.type) === "number" && ((h = t.meta) == null ? void 0 : h.maximum),
|
|
72
|
-
min: ((b = t.meta) == null ? void 0 : b.type) === "number" && ((E = t.meta) == null ? void 0 : E.minimum),
|
|
73
|
-
name: t.field.name,
|
|
74
|
-
modelValue: t.field.state.value,
|
|
75
|
-
errorMessages: d.value,
|
|
76
|
-
error: !!d.value.length,
|
|
77
|
-
field: t.field,
|
|
78
|
-
setRealDirty: m,
|
|
79
|
-
type: f.value,
|
|
80
|
-
label: `${t.label}${(V = t.meta) != null && V.required ? " *" : ""}`,
|
|
81
|
-
options: t.options
|
|
82
|
-
};
|
|
83
|
-
});
|
|
84
|
-
return (e, r) => z(e.$slots, "default", A(D(p.value)), () => [
|
|
85
|
-
M("div", {
|
|
86
|
-
class: R(e.$attrs.class),
|
|
87
|
-
onFocusout: m
|
|
88
|
-
}, [
|
|
89
|
-
j(N) ? (G(), U(Q, H({
|
|
90
|
-
key: 0,
|
|
91
|
-
"input-props": p.value
|
|
92
|
-
}, e.$attrs, {
|
|
93
|
-
"vuetify-value": p.value.field.state.value
|
|
94
|
-
}), null, 16, ["input-props", "vuetify-value"])) : Z("", !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
|
-
|
|
12
|
+
c as getOmegaStore
|
|
101
13
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as d, inject as f, computed as r, createBlock as n, openBlock as l, resolveDynamicComponent as v, withCtx as m, createCommentVNode as c, mergeProps as h, renderSlot as y, normalizeProps as g, guardReactiveProps as C } from "vue";
|
|
2
2
|
import { generateInputStandardSchemaFromFieldMeta as b } from "./vue-components.es9.js";
|
|
3
|
-
import k from "./vue-components.
|
|
3
|
+
import k from "./vue-components.es22.js";
|
|
4
4
|
const $ = /* @__PURE__ */ d({
|
|
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.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"@tanstack/vue-form": "^1.2.4",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"highlight.js": "^11.11.1",
|
|
56
56
|
"vue3-highlightjs": "^1.0.5",
|
|
57
|
-
"
|
|
58
|
-
"effect-app": "2.
|
|
57
|
+
"effect-app": "2.47.0",
|
|
58
|
+
"@effect-app/vue": "2.45.0"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "pnpm build:run",
|