@effect-app/vue-components 1.2.0 → 1.4.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.
- package/dist/types/components/OmegaForm/InputProps.d.ts +1 -0
- package/dist/types/components/OmegaForm/OmegaArray.vue.d.ts +5 -5
- package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +5 -4
- package/dist/types/components/OmegaForm/OmegaErrorsInternal.vue.d.ts +3 -2
- package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +5 -4
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +5 -4
- package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +8 -7
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +6 -4
- package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +5 -4
- package/dist/vue-components.es12.js +15 -15
- package/dist/vue-components.es13.js +36 -39
- package/dist/vue-components.es15.js +3 -3
- package/dist/vue-components.es16.js +1 -1
- package/dist/vue-components.es17.js +1 -1
- package/dist/vue-components.es20.js +45 -45
- package/dist/vue-components.es25.js +41 -41
- package/dist/vue-components.es28.js +15 -15
- package/dist/vue-components.es31.js +22 -10
- package/dist/vue-components.es32.js +5 -23
- package/dist/vue-components.es33.js +21 -5
- package/dist/vue-components.es34.js +25 -16
- package/dist/vue-components.es35.js +15 -23
- package/dist/vue-components.es36.js +7 -17
- package/dist/vue-components.es37.js +5 -12
- package/dist/vue-components.es38.js +19 -5
- package/dist/vue-components.es39.js +9 -19
- package/dist/vue-components.es4.js +12 -12
- package/dist/vue-components.es40.js +31 -9
- package/dist/vue-components.es41.js +42 -25
- package/dist/vue-components.es42.js +16 -38
- package/dist/vue-components.es43.js +11 -26
- package/dist/vue-components.es44.js +1 -1
- package/dist/vue-components.es46.js +1 -1
- package/dist/vue-components.es48.js +3 -3
- package/dist/vue-components.es49.js +1 -1
- package/dist/vue-components.es5.js +35 -36
- package/dist/vue-components.es8.js +25 -19
- package/package.json +15 -15
- package/src/components/OmegaForm/InputProps.ts +1 -0
- package/src/components/OmegaForm/OmegaArray.vue +4 -2
- package/src/components/OmegaForm/OmegaAutoGen.vue +4 -2
- package/src/components/OmegaForm/OmegaFormInput.vue +4 -2
- package/src/components/OmegaForm/OmegaFormStuff.ts +7 -1
- package/src/components/OmegaForm/OmegaInput.vue +4 -2
- package/src/components/OmegaForm/OmegaInputVuetify.vue +10 -10
- package/src/components/OmegaForm/OmegaInternalInput.vue +20 -15
- package/src/components/OmegaForm/OmegaWrapper.vue +4 -2
|
@@ -1,33 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { NoopContextManager as f } from "./vue-components.es49.js";
|
|
2
|
+
import { registerGlobal as s, getGlobal as p, unregisterGlobal as g } from "./vue-components.es47.js";
|
|
3
|
+
import { DiagAPI as u } from "./vue-components.es44.js";
|
|
4
|
+
var y = function(t, e) {
|
|
5
|
+
var a = typeof Symbol == "function" && t[Symbol.iterator];
|
|
6
|
+
if (!a) return t;
|
|
7
|
+
var n = a.call(t), o, r = [], i;
|
|
8
|
+
try {
|
|
9
|
+
for (; (e === void 0 || e-- > 0) && !(o = n.next()).done; ) r.push(o.value);
|
|
10
|
+
} catch (c) {
|
|
11
|
+
i = { error: c };
|
|
12
|
+
} finally {
|
|
13
|
+
try {
|
|
14
|
+
o && !o.done && (a = n.return) && a.call(n);
|
|
15
|
+
} finally {
|
|
16
|
+
if (i) throw i.error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return r;
|
|
20
|
+
}, d = function(t, e, a) {
|
|
21
|
+
if (a || arguments.length === 2) for (var n = 0, o = e.length, r; n < o; n++)
|
|
22
|
+
(r || !(n in e)) && (r || (r = Array.prototype.slice.call(e, 0, n)), r[n] = e[n]);
|
|
23
|
+
return t.concat(r || Array.prototype.slice.call(e));
|
|
24
|
+
}, l = "context", _ = new f(), A = (
|
|
3
25
|
/** @class */
|
|
4
26
|
(function() {
|
|
5
|
-
function t(
|
|
6
|
-
n === void 0 && (n = o), this._spanContext = n;
|
|
27
|
+
function t() {
|
|
7
28
|
}
|
|
8
|
-
return t.
|
|
9
|
-
return this.
|
|
10
|
-
}, t.prototype.
|
|
11
|
-
return
|
|
12
|
-
}, t.prototype.
|
|
13
|
-
return this;
|
|
14
|
-
}, t.prototype.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return this;
|
|
18
|
-
}, t.prototype.
|
|
19
|
-
return this;
|
|
20
|
-
}, t.prototype.
|
|
21
|
-
return
|
|
22
|
-
}, t.prototype.
|
|
23
|
-
|
|
24
|
-
}, t.prototype.end = function(n) {
|
|
25
|
-
}, t.prototype.isRecording = function() {
|
|
26
|
-
return !1;
|
|
27
|
-
}, t.prototype.recordException = function(n, e) {
|
|
29
|
+
return t.getInstance = function() {
|
|
30
|
+
return this._instance || (this._instance = new t()), this._instance;
|
|
31
|
+
}, t.prototype.setGlobalContextManager = function(e) {
|
|
32
|
+
return s(l, e, u.instance());
|
|
33
|
+
}, t.prototype.active = function() {
|
|
34
|
+
return this._getContextManager().active();
|
|
35
|
+
}, t.prototype.with = function(e, a, n) {
|
|
36
|
+
for (var o, r = [], i = 3; i < arguments.length; i++)
|
|
37
|
+
r[i - 3] = arguments[i];
|
|
38
|
+
return (o = this._getContextManager()).with.apply(o, d([e, a, n], y(r), !1));
|
|
39
|
+
}, t.prototype.bind = function(e, a) {
|
|
40
|
+
return this._getContextManager().bind(e, a);
|
|
41
|
+
}, t.prototype._getContextManager = function() {
|
|
42
|
+
return p(l) || _;
|
|
43
|
+
}, t.prototype.disable = function() {
|
|
44
|
+
this._getContextManager().disable(), g(l, u.instance());
|
|
28
45
|
}, t;
|
|
29
46
|
})()
|
|
30
47
|
);
|
|
31
48
|
export {
|
|
32
|
-
|
|
49
|
+
A as ContextAPI
|
|
33
50
|
};
|
|
@@ -1,50 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var n = a.call(t), o, r = [], i;
|
|
8
|
-
try {
|
|
9
|
-
for (; (e === void 0 || e-- > 0) && !(o = n.next()).done; ) r.push(o.value);
|
|
10
|
-
} catch (c) {
|
|
11
|
-
i = { error: c };
|
|
12
|
-
} finally {
|
|
13
|
-
try {
|
|
14
|
-
o && !o.done && (a = n.return) && a.call(n);
|
|
15
|
-
} finally {
|
|
16
|
-
if (i) throw i.error;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return r;
|
|
20
|
-
}, d = function(t, e, a) {
|
|
21
|
-
if (a || arguments.length === 2) for (var n = 0, o = e.length, r; n < o; n++)
|
|
22
|
-
(r || !(n in e)) && (r || (r = Array.prototype.slice.call(e, 0, n)), r[n] = e[n]);
|
|
23
|
-
return t.concat(r || Array.prototype.slice.call(e));
|
|
24
|
-
}, l = "context", _ = new f(), A = (
|
|
1
|
+
import { registerGlobal as a, getGlobal as p, unregisterGlobal as s } from "./vue-components.es47.js";
|
|
2
|
+
import { ProxyTracerProvider as i } from "./vue-components.es35.js";
|
|
3
|
+
import { wrapSpanContext as c, isSpanContextValid as h } from "./vue-components.es38.js";
|
|
4
|
+
import { deleteSpan as g, getSpan as S, getActiveSpan as x, getSpanContext as d, setSpan as f, setSpanContext as l } from "./vue-components.es48.js";
|
|
5
|
+
import { DiagAPI as o } from "./vue-components.es44.js";
|
|
6
|
+
var n = "trace", y = (
|
|
25
7
|
/** @class */
|
|
26
8
|
(function() {
|
|
27
9
|
function t() {
|
|
10
|
+
this._proxyTracerProvider = new i(), this.wrapSpanContext = c, this.isSpanContextValid = h, this.deleteSpan = g, this.getSpan = S, this.getActiveSpan = x, this.getSpanContext = d, this.setSpan = f, this.setSpanContext = l;
|
|
28
11
|
}
|
|
29
12
|
return t.getInstance = function() {
|
|
30
13
|
return this._instance || (this._instance = new t()), this._instance;
|
|
31
|
-
}, t.prototype.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return (o = this._getContextManager()).with.apply(o, d([e, a, n], y(r), !1));
|
|
39
|
-
}, t.prototype.bind = function(e, a) {
|
|
40
|
-
return this._getContextManager().bind(e, a);
|
|
41
|
-
}, t.prototype._getContextManager = function() {
|
|
42
|
-
return p(l) || _;
|
|
14
|
+
}, t.prototype.setGlobalTracerProvider = function(r) {
|
|
15
|
+
var e = a(n, this._proxyTracerProvider, o.instance());
|
|
16
|
+
return e && this._proxyTracerProvider.setDelegate(r), e;
|
|
17
|
+
}, t.prototype.getTracerProvider = function() {
|
|
18
|
+
return p(n) || this._proxyTracerProvider;
|
|
19
|
+
}, t.prototype.getTracer = function(r, e) {
|
|
20
|
+
return this.getTracerProvider().getTracer(r, e);
|
|
43
21
|
}, t.prototype.disable = function() {
|
|
44
|
-
|
|
22
|
+
s(n, o.instance()), this._proxyTracerProvider = new i();
|
|
45
23
|
}, t;
|
|
46
24
|
})()
|
|
47
25
|
);
|
|
48
26
|
export {
|
|
49
|
-
|
|
27
|
+
y as TraceAPI
|
|
50
28
|
};
|
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
return t.getInstance = function() {
|
|
13
|
-
return this._instance || (this._instance = new t()), this._instance;
|
|
14
|
-
}, t.prototype.setGlobalTracerProvider = function(r) {
|
|
15
|
-
var e = a(n, this._proxyTracerProvider, o.instance());
|
|
16
|
-
return e && this._proxyTracerProvider.setDelegate(r), e;
|
|
17
|
-
}, t.prototype.getTracerProvider = function() {
|
|
18
|
-
return p(n) || this._proxyTracerProvider;
|
|
19
|
-
}, t.prototype.getTracer = function(r, e) {
|
|
20
|
-
return this.getTracerProvider().getTracer(r, e);
|
|
21
|
-
}, t.prototype.disable = function() {
|
|
22
|
-
s(n, o.instance()), this._proxyTracerProvider = new i();
|
|
23
|
-
}, t;
|
|
24
|
-
})()
|
|
25
|
-
);
|
|
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
|
+
}
|
|
26
11
|
export {
|
|
27
|
-
|
|
12
|
+
c as getOmegaStore
|
|
28
13
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DiagComponentLogger as m } from "./vue-components.es45.js";
|
|
2
2
|
import { createLogLevelDiagLogger as y } from "./vue-components.es46.js";
|
|
3
|
-
import { DiagLogLevel as d } from "./vue-components.
|
|
3
|
+
import { DiagLogLevel as d } from "./vue-components.es32.js";
|
|
4
4
|
import { unregisterGlobal as p, getGlobal as v, registerGlobal as w } from "./vue-components.es47.js";
|
|
5
5
|
var b = function(i, n) {
|
|
6
6
|
var r = typeof Symbol == "function" && i[Symbol.iterator];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createContextKey as o } from "./vue-components.
|
|
2
|
-
import { NonRecordingSpan as a } from "./vue-components.
|
|
3
|
-
import { ContextAPI as u } from "./vue-components.
|
|
1
|
+
import { createContextKey as o } from "./vue-components.es31.js";
|
|
2
|
+
import { NonRecordingSpan as a } from "./vue-components.es40.js";
|
|
3
|
+
import { ContextAPI as u } from "./vue-components.es41.js";
|
|
4
4
|
var n = o("OpenTelemetry Context Key SPAN");
|
|
5
5
|
function r(e) {
|
|
6
6
|
return e.getValue(n) || void 0;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");if(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;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),document.head.appendChild(i),window.customElements){const e=window.customElements.define;window.customElements.define=function(s,t){const n=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(n&&n.call(this),this.shadowRoot){const a=document.createElement("style");a.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;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),this.shadowRoot.appendChild(a)}},e.call(window.customElements,s,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import { defineComponent as
|
|
2
|
+
import { defineComponent as x, getCurrentInstance as N, useId as V, computed as a, onMounted as c, ref as $, watchEffect as B, watch as I, onUnmounted as _, renderSlot as k, normalizeProps as q, guardReactiveProps as D, createElementVNode as F, normalizeClass as L, createBlock as O, createCommentVNode as P, unref as M, openBlock as S, mergeProps as U } from "vue";
|
|
3
3
|
import { useStore as z } from "@tanstack/vue-form";
|
|
4
4
|
import A from "./vue-components.es20.js";
|
|
5
5
|
|
|
6
|
-
const H = /* @__PURE__ */
|
|
6
|
+
const H = /* @__PURE__ */ x({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "OmegaInternalInput",
|
|
9
9
|
props: {
|
|
@@ -15,48 +15,46 @@ const H = /* @__PURE__ */ E({
|
|
|
15
15
|
validators: {}
|
|
16
16
|
},
|
|
17
17
|
setup(v) {
|
|
18
|
-
const e = v, g =
|
|
18
|
+
const e = v, g = N()?.appContext.components.VTextField, n = V(), l = e.field, r = z(l.store, (t) => t), u = a(() => e.type ? e.type : e.meta?.type === "string" ? e.meta.format === "email" ? "email" : "string" : e.meta?.type || "unknown"), m = a(() => r.value.value), h = a(
|
|
19
19
|
() => (
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
21
|
r.value.meta.errors.map((t) => t?.message).filter(Boolean)
|
|
22
22
|
)
|
|
23
|
-
),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
23
|
+
), y = (t) => t == null || t === !1 || t === "" || Number.isNaN(t), b = (t) => {
|
|
24
|
+
y(t) && e.meta?.type !== "boolean" ? e.field.handleChange(
|
|
25
|
+
e.meta?.nullableOrUndefined === "undefined" ? void 0 : null
|
|
26
|
+
) : e.field.handleChange(t);
|
|
27
|
+
};
|
|
28
|
+
c(() => {
|
|
29
|
+
if (!m.value && !e.meta?.required && e.meta?.nullableOrUndefined === "null") {
|
|
30
|
+
const t = r.value.meta.isDirty;
|
|
31
|
+
l.setValue(null), l.setMeta((p) => ({ ...p, isDirty: t }));
|
|
32
32
|
}
|
|
33
|
-
), c(() => {
|
|
34
|
-
!l.value && !e.meta?.required && e.meta?.nullableOrUndefined === "null" && o.setValue(null);
|
|
35
33
|
});
|
|
36
|
-
const { mapError:
|
|
37
|
-
|
|
38
|
-
(
|
|
34
|
+
const { mapError: C, removeError: d, showErrors: E, showErrorsOn: w } = e.field.form.errorContext, o = $(!1);
|
|
35
|
+
B(() => {
|
|
36
|
+
(E.value || w === "onChange") && (o.value = !0);
|
|
39
37
|
});
|
|
40
|
-
const
|
|
41
|
-
|
|
38
|
+
const s = () => {
|
|
39
|
+
o.value = !0;
|
|
42
40
|
};
|
|
43
41
|
c(() => {
|
|
44
|
-
|
|
42
|
+
m.value && s();
|
|
45
43
|
});
|
|
46
|
-
const
|
|
47
|
-
|
|
44
|
+
const f = a(() => !o.value && u.value !== "select" ? [] : h.value);
|
|
45
|
+
I(
|
|
48
46
|
() => r.value.meta.errors,
|
|
49
47
|
() => {
|
|
50
|
-
r.value.meta.errors.length ?
|
|
48
|
+
r.value.meta.errors.length ? C({
|
|
51
49
|
inputId: n,
|
|
52
50
|
errors: r.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
53
51
|
label: e.label
|
|
54
|
-
}) :
|
|
52
|
+
}) : d(n);
|
|
55
53
|
}
|
|
56
|
-
),
|
|
57
|
-
|
|
54
|
+
), _(() => {
|
|
55
|
+
d(n), e.field.form.deleteField(e.field.name);
|
|
58
56
|
});
|
|
59
|
-
const
|
|
57
|
+
const i = a(() => ({
|
|
60
58
|
id: n,
|
|
61
59
|
required: e.meta?.required,
|
|
62
60
|
minLength: e.meta?.type === "string" && e.meta?.minLength,
|
|
@@ -65,24 +63,25 @@ const H = /* @__PURE__ */ E({
|
|
|
65
63
|
min: e.meta?.type === "number" && e.meta?.minimum,
|
|
66
64
|
name: e.field.name,
|
|
67
65
|
modelValue: e.field.state.value,
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
handleChange: b,
|
|
67
|
+
errorMessages: f.value,
|
|
68
|
+
error: !!f.value.length,
|
|
70
69
|
field: e.field,
|
|
71
|
-
setRealDirty:
|
|
72
|
-
type:
|
|
70
|
+
setRealDirty: s,
|
|
71
|
+
type: u.value,
|
|
73
72
|
label: `${e.label}${e.meta?.required ? " *" : ""}`,
|
|
74
73
|
options: e.options
|
|
75
74
|
}));
|
|
76
|
-
return (t,
|
|
75
|
+
return (t, p) => k(t.$slots, "default", q(D(i.value)), () => [
|
|
77
76
|
F("div", {
|
|
78
77
|
class: L(t.$attrs.class),
|
|
79
|
-
onFocusout:
|
|
78
|
+
onFocusout: s
|
|
80
79
|
}, [
|
|
81
|
-
|
|
80
|
+
M(g) ? (S(), O(A, U({
|
|
82
81
|
key: 0,
|
|
83
|
-
"input-props":
|
|
82
|
+
"input-props": i.value
|
|
84
83
|
}, t.$attrs, {
|
|
85
|
-
"vuetify-value":
|
|
84
|
+
"vuetify-value": i.value.field.state.value
|
|
86
85
|
}), null, 16, ["input-props", "vuetify-value"])) : P("", !0)
|
|
87
86
|
], 34)
|
|
88
87
|
]);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { S as n, Option as c, pipe as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { S as n, Option as c, pipe as q } from "effect-app";
|
|
2
|
+
import { getMetadataFromSchema as U } from "@effect-app/vue/form";
|
|
3
|
+
import { useIntl as _, getTransformationFrom as N } from "./vue-components.es3.js";
|
|
4
|
+
const w = n.NonEmptyArray(n.String), E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKeyword" || i === n.Null.ast), g = (e) => !e || !n.AST.isUnion(e) ? !1 : e.types.find((i) => i._tag === "UndefinedKeyword") ? "undefined" : e.types.find((i) => i === n.Null.ast) ? "null" : !1, m = ({ meta: e = {}, parent: i = "", property: t, propertySignatures: p }, o = {}) => {
|
|
4
5
|
if (t && t._tag === "Transformation")
|
|
5
6
|
return m({
|
|
6
7
|
parent: i,
|
|
@@ -18,7 +19,7 @@ const N = n.NonEmptyArray(n.String), E = (e) => n.AST.isUnion(e) && e.types.find
|
|
|
18
19
|
if (n.AST.isUnion(r.type)) {
|
|
19
20
|
const T = r.type.types.filter(
|
|
20
21
|
(s) => s._tag !== "UndefinedKeyword" && s !== n.Null.ast
|
|
21
|
-
).map(
|
|
22
|
+
).map(N);
|
|
22
23
|
if (T.some(
|
|
23
24
|
(s) => "propertySignatures" in s
|
|
24
25
|
)) {
|
|
@@ -148,7 +149,12 @@ const N = n.NonEmptyArray(n.String), E = (e) => n.AST.isUnion(e) && e.types.find
|
|
|
148
149
|
const T = m({
|
|
149
150
|
parent: l,
|
|
150
151
|
property: r.type,
|
|
151
|
-
meta: {
|
|
152
|
+
meta: {
|
|
153
|
+
// an empty string is valid for a S.String field, so we should not mark it as required
|
|
154
|
+
// TODO: handle this better via the createMeta minLength parsing
|
|
155
|
+
required: u && (r.type._tag !== "StringKeyword" || U(r.type).minLength),
|
|
156
|
+
nullableOrUndefined: a
|
|
157
|
+
}
|
|
152
158
|
});
|
|
153
159
|
o[l] = T;
|
|
154
160
|
}
|
|
@@ -201,10 +207,10 @@ const N = n.NonEmptyArray(n.String), E = (e) => n.AST.isUnion(e) && e.types.find
|
|
|
201
207
|
), e);
|
|
202
208
|
}
|
|
203
209
|
return o;
|
|
204
|
-
},
|
|
210
|
+
}, L = (e) => {
|
|
205
211
|
const i = e.ast, t = {};
|
|
206
212
|
if (i._tag === "Transformation" || i._tag === "Refinement")
|
|
207
|
-
return
|
|
213
|
+
return L(n.make(i.from));
|
|
208
214
|
if ("propertySignatures" in i) {
|
|
209
215
|
const p = m({
|
|
210
216
|
propertySignatures: i.propertySignatures
|
|
@@ -220,13 +226,13 @@ const N = n.NonEmptyArray(n.String), E = (e) => n.AST.isUnion(e) && e.types.find
|
|
|
220
226
|
o(p);
|
|
221
227
|
}
|
|
222
228
|
return t;
|
|
223
|
-
},
|
|
224
|
-
const i =
|
|
229
|
+
}, P = (e) => n.extend(e, n.Struct({})), F = (e) => {
|
|
230
|
+
const i = L(e), t = q(
|
|
225
231
|
e.ast,
|
|
226
232
|
c.liftPredicate((p) => p._tag === "Refinement" && "filter" in p),
|
|
227
233
|
c.flatMap((p) => n.AST.getJSONSchemaAnnotation(p)),
|
|
228
234
|
c.filter((p) => "items" in p),
|
|
229
|
-
c.filterMap(({ items: p }) => n.decodeUnknownOption(
|
|
235
|
+
c.filterMap(({ items: p }) => n.decodeUnknownOption(w)(p)),
|
|
230
236
|
c.zipWith(
|
|
231
237
|
n.AST.getMessageAnnotation(e.ast),
|
|
232
238
|
(p, o) => ({
|
|
@@ -237,8 +243,8 @@ const N = n.NonEmptyArray(n.String), E = (e) => n.AST.isUnion(e) && e.types.find
|
|
|
237
243
|
c.getOrUndefined
|
|
238
244
|
);
|
|
239
245
|
return { schema: e, meta: i, filterItems: t };
|
|
240
|
-
},
|
|
241
|
-
const { trans: i } =
|
|
246
|
+
}, j = (e) => {
|
|
247
|
+
const { trans: i } = _();
|
|
242
248
|
let t;
|
|
243
249
|
switch (e.type) {
|
|
244
250
|
case "string":
|
|
@@ -320,7 +326,7 @@ const N = n.NonEmptyArray(n.String), E = (e) => n.AST.isUnion(e) && e.types.find
|
|
|
320
326
|
message: () => i("validation.empty")
|
|
321
327
|
})
|
|
322
328
|
) : t = n.NullishOr(t), n.standardSchemaV1(t);
|
|
323
|
-
},
|
|
329
|
+
}, R = (e, i) => n.NullOr(e).pipe(
|
|
324
330
|
n.transform(n.typeSchema(e), {
|
|
325
331
|
decode: (t) => t ?? i(),
|
|
326
332
|
encode: (t) => t
|
|
@@ -341,12 +347,12 @@ const N = n.NonEmptyArray(n.String), E = (e) => n.AST.isUnion(e) && e.types.find
|
|
|
341
347
|
"text",
|
|
342
348
|
"time",
|
|
343
349
|
"url"
|
|
344
|
-
],
|
|
350
|
+
], J = (e) => k.includes(e) ? e : "text";
|
|
345
351
|
export {
|
|
346
352
|
m as createMeta,
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
353
|
+
P as duplicateSchema,
|
|
354
|
+
j as generateInputStandardSchemaFromFieldMeta,
|
|
355
|
+
F as generateMetaFromSchema,
|
|
356
|
+
J as getInputType,
|
|
357
|
+
R as nullableInput
|
|
352
358
|
};
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
|
-
"effect": "^3.
|
|
6
|
+
"effect": "^3.18.0",
|
|
7
7
|
"intl-messageformat": "^10.7.16",
|
|
8
8
|
"mdi-js": "^1.0.1",
|
|
9
9
|
"primeflex": "^4.0.0",
|
|
10
10
|
"primeicons": "^7.0.0",
|
|
11
11
|
"primevue": "^4.3.9",
|
|
12
|
-
"vue": "^3.5.
|
|
13
|
-
"vuetify": "^3.10.
|
|
12
|
+
"vue": "^3.5.22",
|
|
13
|
+
"vuetify": "^3.10.3"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@storybook/vue3": "^9.1.
|
|
17
|
-
"@storybook/vue3-vite": "^9.1.
|
|
18
|
-
"@types/node": "^24.
|
|
16
|
+
"@storybook/vue3": "^9.1.9",
|
|
17
|
+
"@storybook/vue3-vite": "^9.1.9",
|
|
18
|
+
"@types/node": "^24.6.0",
|
|
19
19
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
20
20
|
"@vue/test-utils": "^2.4.6",
|
|
21
21
|
"dprint": "^0.50.2",
|
|
22
22
|
"jsdom": "^27.0.0",
|
|
23
23
|
"rimraf": "^6.0.1",
|
|
24
|
-
"sass": "^1.
|
|
25
|
-
"storybook": "^9.1.
|
|
24
|
+
"sass": "^1.93.2",
|
|
25
|
+
"storybook": "^9.1.9",
|
|
26
26
|
"typescript": "~5.9.2",
|
|
27
|
-
"vite": "^7.1.
|
|
27
|
+
"vite": "^7.1.7",
|
|
28
28
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
29
29
|
"vitepress": "^1.6.4",
|
|
30
30
|
"vitest": "^3.2.4",
|
|
31
|
-
"vue-router": "^4.
|
|
32
|
-
"vue-tsc": "^3.0
|
|
33
|
-
"@effect-app/eslint-shared-config": "0.
|
|
31
|
+
"vue-router": "^4.5.1",
|
|
32
|
+
"vue-tsc": "^3.1.0",
|
|
33
|
+
"@effect-app/eslint-shared-config": "0.3.1"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"src",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@tanstack/vue-form": "^1.23.4",
|
|
50
50
|
"highlight.js": "^11.11.1",
|
|
51
51
|
"vue3-highlightjs": "^1.0.5",
|
|
52
|
-
"
|
|
53
|
-
"effect-app": "
|
|
52
|
+
"effect-app": "3.9.0",
|
|
53
|
+
"@effect-app/vue": "2.82.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "pnpm build:run",
|
|
@@ -36,6 +36,7 @@ export type InputProps<From extends Record<PropertyKey, any>, TName extends Deep
|
|
|
36
36
|
min?: number | false
|
|
37
37
|
name: string
|
|
38
38
|
modelValue: DeepValue<From, TName>
|
|
39
|
+
handleChange: (value: DeepValue<From, TName>) => void
|
|
39
40
|
errorMessages: string[]
|
|
40
41
|
error: boolean
|
|
41
42
|
field: OmegaFieldInternalApi<From, TName>
|
|
@@ -42,9 +42,11 @@
|
|
|
42
42
|
<script
|
|
43
43
|
setup
|
|
44
44
|
lang="ts"
|
|
45
|
-
generic="
|
|
45
|
+
generic="
|
|
46
|
+
// dprint ignore - somehow with 120 chars, this becomes a mess. should report it.
|
|
46
47
|
From extends Record<PropertyKey, any>,
|
|
47
|
-
To extends Record<PropertyKey, any>
|
|
48
|
+
To extends Record<PropertyKey, any>
|
|
49
|
+
"
|
|
48
50
|
>
|
|
49
51
|
import { type DeepKeys, type DeepValue } from "@tanstack/vue-form"
|
|
50
52
|
import { computed, onMounted, provide } from "vue"
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
<script
|
|
15
15
|
setup
|
|
16
16
|
lang="ts"
|
|
17
|
-
generic="
|
|
18
|
-
|
|
17
|
+
generic="
|
|
18
|
+
From extends Record<PropertyKey, string>,
|
|
19
|
+
To extends Record<PropertyKey, string>
|
|
20
|
+
"
|
|
19
21
|
>
|
|
20
22
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
21
23
|
import { Array as A, Order, pipe } from "effect-app"
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
<script
|
|
18
18
|
setup
|
|
19
19
|
lang="ts"
|
|
20
|
-
generic="
|
|
20
|
+
generic="
|
|
21
|
+
From extends Record<PropertyKey, any>,
|
|
21
22
|
To extends Record<PropertyKey, any>,
|
|
22
|
-
Name extends DeepKeys<From>
|
|
23
|
+
Name extends DeepKeys<From>
|
|
24
|
+
"
|
|
23
25
|
>
|
|
24
26
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
25
27
|
import { inject } from "vue"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Effect, Option, pipe, type Record, S } from "effect-app"
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import { getMetadataFromSchema } from "@effect-app/vue/form"
|
|
3
4
|
import { type DeepKeys, type FieldAsyncValidateOrFn, type FieldValidateOrFn, type FormApi, type FormAsyncValidateOrFn, type FormOptions, type FormState, type FormValidateOrFn, type StandardSchemaV1, type VueFormApi } from "@tanstack/vue-form"
|
|
4
5
|
import { type RuntimeFiber } from "effect/Fiber"
|
|
5
6
|
import { getTransformationFrom, useIntl } from "../../utils"
|
|
@@ -492,7 +493,12 @@ export const createMeta = <T = any>(
|
|
|
492
493
|
const newMeta = createMeta<T>({
|
|
493
494
|
parent: key,
|
|
494
495
|
property: p.type,
|
|
495
|
-
meta: {
|
|
496
|
+
meta: {
|
|
497
|
+
// an empty string is valid for a S.String field, so we should not mark it as required
|
|
498
|
+
// TODO: handle this better via the createMeta minLength parsing
|
|
499
|
+
required: isRequired && (p.type._tag !== "StringKeyword" || getMetadataFromSchema(p.type).minLength),
|
|
500
|
+
nullableOrUndefined
|
|
501
|
+
}
|
|
496
502
|
})
|
|
497
503
|
|
|
498
504
|
acc[key as NestedKeyOf<T>] = newMeta as FieldMeta
|
|
@@ -28,9 +28,11 @@
|
|
|
28
28
|
<script
|
|
29
29
|
setup
|
|
30
30
|
lang="ts"
|
|
31
|
-
generic="
|
|
31
|
+
generic="
|
|
32
|
+
// dprint ignore - somehow with 120 chars, this becomes a mess. should report it.
|
|
32
33
|
From extends Record<PropertyKey, any>,
|
|
33
|
-
To extends Record<PropertyKey, any>
|
|
34
|
+
To extends Record<PropertyKey, any>
|
|
35
|
+
"
|
|
34
36
|
>
|
|
35
37
|
import { computed, inject, type Ref } from "vue"
|
|
36
38
|
import { useIntl } from "../../utils"
|