@effect-app/vue-components 0.4.4 → 0.4.5
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 h, computed as u, watch as F, createElementBlock as c, openBlock as d, withModifiers as y, createElementVNode as O, unref as i, renderSlot as l, createCommentVNode as E, Fragment as M } from "vue";
|
|
2
2
|
import { useStore as v } from "@tanstack/vue-form";
|
|
3
|
-
import { getOmegaStore as V } from "./vue-components.
|
|
3
|
+
import { getOmegaStore as V } from "./vue-components.es21.js";
|
|
4
4
|
import { provideOmegaErrors as w } from "./vue-components.es5.js";
|
|
5
5
|
import { useOmegaForm as I } from "./vue-components.es6.js";
|
|
6
6
|
const k = ["disabled"], j = /* @__PURE__ */ h({
|
|
@@ -1,98 +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(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
|
-
|
|
12
|
+
c as getOmegaStore
|
|
98
13
|
};
|
|
@@ -1,13 +1,98 @@
|
|
|
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 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
|
+
});
|
|
11
96
|
export {
|
|
12
|
-
|
|
97
|
+
ee as default
|
|
13
98
|
};
|
|
@@ -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.es7.js";
|
|
3
|
-
import b from "./vue-components.
|
|
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.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"@tanstack/vue-form": "^1.2.4",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"highlight.js": "^11.11.1",
|
|
54
54
|
"vue3-highlightjs": "^1.0.5",
|
|
55
|
-
"@effect-app/vue": "2.41.
|
|
56
|
-
"effect-app": "2.40.
|
|
55
|
+
"@effect-app/vue": "2.41.1",
|
|
56
|
+
"effect-app": "2.40.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "rimraf dist && vue-tsc && vite build",
|