@effect-app/vue-components 2.1.5 → 2.1.6
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/OmegaInternalInput.vue.d.ts +2 -2
- package/dist/vue-components.es10.js +148 -145
- package/dist/vue-components.es22.js +1 -1
- package/dist/vue-components.es23.js +1 -1
- package/dist/vue-components.es36.js +1 -1
- package/dist/vue-components.es41.js +22 -10
- package/dist/vue-components.es42.js +5 -23
- package/dist/vue-components.es43.js +21 -5
- package/dist/vue-components.es44.js +25 -16
- package/dist/vue-components.es45.js +15 -23
- package/dist/vue-components.es46.js +7 -17
- package/dist/vue-components.es47.js +5 -12
- package/dist/vue-components.es48.js +19 -5
- package/dist/vue-components.es49.js +9 -19
- package/dist/vue-components.es50.js +31 -9
- package/dist/vue-components.es51.js +42 -25
- package/dist/vue-components.es52.js +16 -38
- package/dist/vue-components.es53.js +11 -26
- package/dist/vue-components.es54.js +1 -1
- package/dist/vue-components.es56.js +1 -1
- package/dist/vue-components.es58.js +3 -3
- package/dist/vue-components.es59.js +1 -1
- package/dist/vue-components.es7.js +23 -31
- package/package.json +1 -1
- package/src/components/OmegaForm/OmegaInternalInput.vue +4 -31
- package/src/components/OmegaForm/useOmegaForm.ts +41 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DeepKeys
|
|
1
|
+
import { type DeepKeys } from "@tanstack/vue-form";
|
|
2
2
|
import { type ComputedRef } from "vue";
|
|
3
3
|
import type { OmegaFieldInternalApi } from "./InputProps";
|
|
4
4
|
import type { FieldValidators, MetaRecord, NestedKeyOf, TypeOverride } from "./OmegaFormStuff";
|
|
@@ -26,7 +26,7 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, Name extends
|
|
|
26
26
|
slots: {
|
|
27
27
|
default?: (props: {
|
|
28
28
|
field: OmegaFieldInternalApi<From, Name>;
|
|
29
|
-
state: import("@tanstack/vue-form").FieldState<From, Name, DeepValue<From, Name>, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").StandardSchemaV1<DeepValue<From, Name>, unknown> | import("@tanstack/vue-form").FieldValidateFn<From, Name>, import("@tanstack/vue-form").StandardSchemaV1<DeepValue<From, Name>, unknown> | import("@tanstack/vue-form").FieldValidateAsyncFn<From, Name>, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, DeepValue<From, Name>>, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, Name, DeepValue<From, Name>>, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, Name, DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, Name, DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, any, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined>;
|
|
29
|
+
state: import("@tanstack/vue-form").FieldState<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").StandardSchemaV1<import("@tanstack/vue-form").DeepValue<From, Name>, unknown> | import("@tanstack/vue-form").FieldValidateFn<From, Name>, import("@tanstack/vue-form").StandardSchemaV1<import("@tanstack/vue-form").DeepValue<From, Name>, unknown> | import("@tanstack/vue-form").FieldValidateAsyncFn<From, Name>, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>>, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>>, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, any, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined>;
|
|
30
30
|
id: string;
|
|
31
31
|
required?: boolean;
|
|
32
32
|
minLength?: number | false;
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { useForm as
|
|
2
|
-
import { Data as
|
|
1
|
+
import { useForm as J } from "@tanstack/vue-form";
|
|
2
|
+
import { Data as z, S as D, Effect as l, Fiber as N, Option as P, Array as g } from "effect-app";
|
|
3
3
|
import { runtimeFiberAsPromise as K } from "./vue-components.es16.js";
|
|
4
4
|
import { isObject as T } from "./vue-components.es17.js";
|
|
5
|
-
import { computed as
|
|
5
|
+
import { computed as L, onUnmounted as k, onMounted as Z, onBeforeUnmount as G, watch as W, ref as Q, h as B } from "vue";
|
|
6
6
|
import X from "./vue-components.es18.js";
|
|
7
7
|
import Y from "./vue-components.es19.js";
|
|
8
|
-
import
|
|
9
|
-
import { generateMetaFromSchema as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
8
|
+
import C from "./vue-components.es20.js";
|
|
9
|
+
import { generateMetaFromSchema as ee } from "./vue-components.es12.js";
|
|
10
|
+
import re from "./vue-components.es6.js";
|
|
11
|
+
import te from "./vue-components.es8.js";
|
|
12
|
+
import ne from "./vue-components.es21.js";
|
|
13
13
|
import { trace as R } from "./vue-components.es22.js";
|
|
14
|
-
import { context as
|
|
15
|
-
class
|
|
14
|
+
import { context as x } from "./vue-components.es23.js";
|
|
15
|
+
class se extends z.TaggedError("FormErrors") {
|
|
16
16
|
}
|
|
17
|
-
const E = (
|
|
17
|
+
const E = (c) => function(i) {
|
|
18
18
|
return {
|
|
19
19
|
render() {
|
|
20
|
-
return
|
|
21
|
-
form:
|
|
20
|
+
return B(i, {
|
|
21
|
+
form: c,
|
|
22
22
|
...this.$attrs
|
|
23
23
|
}, this.$slots);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
},
|
|
26
|
+
}, oe = (c) => function(i) {
|
|
27
27
|
return {
|
|
28
28
|
setup() {
|
|
29
|
-
const { fieldMap:
|
|
30
|
-
const
|
|
31
|
-
Object.entries(
|
|
32
|
-
([
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
35
|
-
const a =
|
|
29
|
+
const { fieldMap: S, form: v } = c, m = v.useStore((u) => u.errors), p = v.useStore((u) => u.fieldMeta), F = v.useStore((u) => u.errorMap), M = L(() => {
|
|
30
|
+
const u = g.filterMap(
|
|
31
|
+
Object.entries(p.value),
|
|
32
|
+
([j, o]) => {
|
|
33
|
+
const b = o.errors ?? [];
|
|
34
|
+
if (!b.length) return P.none();
|
|
35
|
+
const a = S.value.get(j);
|
|
36
36
|
return a ? P.some({
|
|
37
37
|
label: a.label,
|
|
38
38
|
inputId: a.id,
|
|
39
39
|
// Only show the first error
|
|
40
|
-
errors: [
|
|
40
|
+
errors: [b[0]?.message].filter(Boolean)
|
|
41
41
|
}) : P.none();
|
|
42
42
|
}
|
|
43
|
-
),
|
|
44
|
-
if (
|
|
45
|
-
for (const [
|
|
46
|
-
if (g.isArray(
|
|
47
|
-
for (const
|
|
48
|
-
const a =
|
|
43
|
+
), O = [];
|
|
44
|
+
if (F.value.onSubmit) {
|
|
45
|
+
for (const [j, o] of Object.entries(F.value.onSubmit))
|
|
46
|
+
if (g.isArray(o) && o.length)
|
|
47
|
+
for (const b of o) {
|
|
48
|
+
const a = b;
|
|
49
49
|
if (a?.path && g.isArray(a.path) && a.path.length) {
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
|
|
53
|
-
label:
|
|
54
|
-
inputId:
|
|
50
|
+
const w = a.path.join(".");
|
|
51
|
+
if (!S.value.has(w)) {
|
|
52
|
+
O.push({
|
|
53
|
+
label: w,
|
|
54
|
+
inputId: w,
|
|
55
55
|
errors: [a.message].filter(Boolean)
|
|
56
56
|
});
|
|
57
57
|
break;
|
|
@@ -59,177 +59,180 @@ const E = (u) => function(s) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
return [...
|
|
62
|
+
return [...u, ...O];
|
|
63
63
|
});
|
|
64
64
|
return {
|
|
65
|
-
generalErrors:
|
|
66
|
-
errors:
|
|
65
|
+
generalErrors: m,
|
|
66
|
+
errors: M
|
|
67
67
|
};
|
|
68
68
|
},
|
|
69
|
-
render({ errors:
|
|
70
|
-
return
|
|
71
|
-
errors:
|
|
72
|
-
generalErrors:
|
|
69
|
+
render({ errors: S, generalErrors: v }) {
|
|
70
|
+
return B(i, {
|
|
71
|
+
errors: S,
|
|
72
|
+
generalErrors: v,
|
|
73
73
|
...this.$attrs
|
|
74
74
|
}, this.$slots);
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
},
|
|
78
|
-
if (!
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
return
|
|
82
|
-
const e = window.location.pathname, r = Object.keys(
|
|
77
|
+
}, ye = (c, f, i) => {
|
|
78
|
+
if (!c) throw new Error("Schema is required");
|
|
79
|
+
const S = D.standardSchemaV1(c), v = D.decode(c), { meta: m } = ee(c), p = L(() => {
|
|
80
|
+
if (i?.persistency?.id)
|
|
81
|
+
return i.persistency.id;
|
|
82
|
+
const e = window.location.pathname, r = Object.keys(m);
|
|
83
83
|
return `${e}-${r.join("-")}`;
|
|
84
|
-
}),
|
|
84
|
+
}), F = () => {
|
|
85
85
|
const e = new URLSearchParams(window.location.search);
|
|
86
|
-
e.delete(
|
|
86
|
+
e.delete(p.value);
|
|
87
87
|
const r = new URL(window.location.href);
|
|
88
88
|
r.search = e.toString(), window.history.replaceState({}, "", r.toString());
|
|
89
89
|
};
|
|
90
|
-
function
|
|
91
|
-
for (const
|
|
92
|
-
r[
|
|
90
|
+
function M(e, r) {
|
|
91
|
+
for (const n in r)
|
|
92
|
+
r[n] && T(r[n]) ? (e[n] || (e[n] = {}), M(e[n], r[n])) : e[n] = r[n];
|
|
93
93
|
return e;
|
|
94
94
|
}
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
const u = (e) => {
|
|
96
|
+
const r = { ...e };
|
|
97
|
+
for (const n in m) {
|
|
98
|
+
const s = m[n], t = r[n], y = (t == null || t === !1 || t === "" || Number.isNaN(t)) && t !== !1 && t !== 0;
|
|
99
|
+
s && !s.required && s.nullableOrUndefined && s.type !== "boolean" && (t === void 0 || y) && (r[n] = s.nullableOrUndefined === "undefined" ? void 0 : null);
|
|
100
|
+
}
|
|
101
|
+
return r;
|
|
102
|
+
}, O = L(() => {
|
|
103
|
+
const e = f?.defaultValues ? u(f.defaultValues) : void 0;
|
|
104
|
+
if (e && !i?.persistency?.overrideDefaultValues)
|
|
105
|
+
return e;
|
|
106
|
+
let r;
|
|
107
|
+
const n = i?.persistency;
|
|
108
|
+
if (!n?.policies || n.policies.length === 0) return {};
|
|
109
|
+
if (n.policies.includes("querystring"))
|
|
102
110
|
try {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
} catch (
|
|
106
|
-
console.error(
|
|
111
|
+
const t = new URLSearchParams(window.location.search).get(p.value);
|
|
112
|
+
F(), t && (r = JSON.parse(t));
|
|
113
|
+
} catch (s) {
|
|
114
|
+
console.error(s);
|
|
107
115
|
}
|
|
108
116
|
if (
|
|
109
117
|
// query string has higher priority than local/session storage
|
|
110
|
-
!
|
|
118
|
+
!r && (n.policies.includes("local") || n.policies.includes("session"))
|
|
111
119
|
) {
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
120
|
+
const s = n.policies.includes("local") ? localStorage : sessionStorage;
|
|
121
|
+
if (s)
|
|
114
122
|
try {
|
|
115
|
-
const
|
|
116
|
-
|
|
123
|
+
const t = JSON.parse(
|
|
124
|
+
s.getItem(p.value) || "{}"
|
|
117
125
|
);
|
|
118
|
-
|
|
119
|
-
} catch (
|
|
120
|
-
console.error(
|
|
126
|
+
s.removeItem(p.value), r = t;
|
|
127
|
+
} catch (t) {
|
|
128
|
+
console.error(t);
|
|
121
129
|
}
|
|
122
130
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const t = l?.defaultValues;
|
|
127
|
-
return j(t, e);
|
|
128
|
-
}
|
|
129
|
-
}), F = (e, r) => e ? L.with(R.setSpan(L.active(), e), r) : r(), i = q({
|
|
130
|
-
...l,
|
|
131
|
+
return r ??= {}, e ? M(e, r) : r;
|
|
132
|
+
}), j = (e, r) => e ? x.with(R.setSpan(x.active(), e), r) : r(), o = J({
|
|
133
|
+
...f,
|
|
131
134
|
validators: {
|
|
132
|
-
onSubmit:
|
|
133
|
-
...
|
|
135
|
+
onSubmit: S,
|
|
136
|
+
...f?.validators || {}
|
|
134
137
|
},
|
|
135
|
-
onSubmit:
|
|
136
|
-
const
|
|
138
|
+
onSubmit: f?.onSubmit ? ({ formApi: e, meta: r, value: n }) => j(r?.currentSpan, async () => {
|
|
139
|
+
const s = await l.runPromise(v(n)), t = f.onSubmit({
|
|
137
140
|
formApi: e,
|
|
138
141
|
meta: r,
|
|
139
|
-
value:
|
|
142
|
+
value: s
|
|
140
143
|
});
|
|
141
|
-
return
|
|
142
|
-
|
|
144
|
+
return N.isFiber(t) && N.isRuntimeFiber(t) ? await K(t) : l.isEffect(t) ? await l.runPromise(
|
|
145
|
+
t.pipe(
|
|
143
146
|
// meta?.currentSpan
|
|
144
147
|
// ? Effect.withParentSpan(meta.currentSpan)
|
|
145
148
|
// : (_) => _,
|
|
146
|
-
|
|
149
|
+
l.flatMap((d) => N.join(d))
|
|
147
150
|
)
|
|
148
|
-
) :
|
|
151
|
+
) : t;
|
|
149
152
|
}) : void 0,
|
|
150
|
-
defaultValues:
|
|
151
|
-
}),
|
|
152
|
-
Object.keys(
|
|
153
|
-
|
|
153
|
+
defaultValues: O.value
|
|
154
|
+
}), b = () => {
|
|
155
|
+
Object.keys(m).forEach((e) => {
|
|
156
|
+
o.setFieldValue(e, void 0);
|
|
154
157
|
});
|
|
155
|
-
},
|
|
156
|
-
const
|
|
157
|
-
return
|
|
158
|
-
}, {}),
|
|
158
|
+
}, a = (e) => e.reduce((r, n) => {
|
|
159
|
+
const s = n.split(".");
|
|
160
|
+
return s.reduce((t, d, y) => (y === s.length - 1 ? t[d] = o.getFieldValue(n) : t[d] = t[d] ?? {}, t[d]), r), r;
|
|
161
|
+
}, {}), w = (e) => {
|
|
159
162
|
if (e) {
|
|
160
163
|
if (g.isArray(e.keys))
|
|
161
|
-
return
|
|
164
|
+
return a(e.keys);
|
|
162
165
|
if (g.isArray(e.banKeys)) {
|
|
163
|
-
const r = Object.keys(
|
|
164
|
-
return
|
|
166
|
+
const r = Object.keys(m).filter((n) => e.banKeys?.includes(n));
|
|
167
|
+
return a(r);
|
|
165
168
|
}
|
|
166
|
-
return
|
|
169
|
+
return o.store.state.values;
|
|
167
170
|
}
|
|
168
|
-
},
|
|
169
|
-
const e =
|
|
171
|
+
}, U = () => {
|
|
172
|
+
const e = i?.persistency;
|
|
170
173
|
if (!(!e?.policies || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
|
|
171
174
|
const r = e.policies.includes("local") ? localStorage : sessionStorage;
|
|
172
175
|
if (!r) return;
|
|
173
|
-
const
|
|
174
|
-
return r.setItem(
|
|
176
|
+
const n = w(e);
|
|
177
|
+
return r.setItem(p.value, JSON.stringify(n));
|
|
175
178
|
}
|
|
176
|
-
},
|
|
177
|
-
const e =
|
|
179
|
+
}, V = () => {
|
|
180
|
+
const e = i?.persistency;
|
|
178
181
|
if (!(!e?.policies || e.policies.length === 0) && e.policies.includes("querystring")) {
|
|
179
|
-
const r =
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
|
|
182
|
+
const r = w(e), n = new URLSearchParams(window.location.search);
|
|
183
|
+
n.set(p.value, JSON.stringify(r));
|
|
184
|
+
const s = new URL(window.location.href);
|
|
185
|
+
s.search = n.toString(), window.history.replaceState({}, "", s.toString());
|
|
183
186
|
}
|
|
184
187
|
}, _ = (e) => {
|
|
185
|
-
|
|
188
|
+
o.store.state.isDirty && e.preventDefault();
|
|
186
189
|
};
|
|
187
|
-
if (
|
|
188
|
-
window.addEventListener("beforeunload",
|
|
189
|
-
}),
|
|
190
|
-
window.removeEventListener("beforeunload",
|
|
191
|
-
}),
|
|
192
|
-
const e =
|
|
193
|
-
W([e, r], ([
|
|
194
|
-
|
|
190
|
+
if (k(U), Z(() => {
|
|
191
|
+
window.addEventListener("beforeunload", U), window.addEventListener("blur", V), i?.preventWindowExit && i.preventWindowExit !== "nope" && window.addEventListener("beforeunload", _);
|
|
192
|
+
}), G(() => {
|
|
193
|
+
window.removeEventListener("beforeunload", U), window.removeEventListener("blur", V), i?.preventWindowExit && i.preventWindowExit !== "nope" && window.removeEventListener("beforeunload", _);
|
|
194
|
+
}), i?.preventWindowExit === "prevent-and-reset") {
|
|
195
|
+
const e = o.useStore((t) => t.isSubmitting), r = o.useStore((t) => t.submissionAttempts), n = o.useStore((t) => t.canSubmit), s = o.useStore((t) => t.values);
|
|
196
|
+
W([e, r], ([t, d], [y]) => {
|
|
197
|
+
y && !t && d > 0 && n.value && o.reset(s.value);
|
|
195
198
|
});
|
|
196
199
|
}
|
|
197
|
-
const I = (e) =>
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
(r) =>
|
|
200
|
+
const I = (e) => l.currentSpan.pipe(
|
|
201
|
+
l.option,
|
|
202
|
+
l.flatMap(
|
|
203
|
+
(r) => l.promise(() => o.handleSubmit(P.isSome(r) ? { currentSpan: r.value, ...e } : e))
|
|
201
204
|
)
|
|
202
|
-
),
|
|
203
|
-
const r =
|
|
205
|
+
), q = (e) => e?.checkErrors ? I(e?.meta).pipe(l.flatMap(l.fnUntraced(function* () {
|
|
206
|
+
const r = o.getAllErrors();
|
|
204
207
|
if (Object.keys(r.fields).length || r.form.errors.length)
|
|
205
|
-
return yield* new
|
|
206
|
-
}))) : I(e?.meta),
|
|
207
|
-
i18nNamespace:
|
|
208
|
-
ignorePreventCloseEvents:
|
|
209
|
-
meta:
|
|
210
|
-
clear:
|
|
208
|
+
return yield* new se({ form: r.form, fields: r.fields });
|
|
209
|
+
}))) : I(e?.meta), H = o.handleSubmit, A = Q(/* @__PURE__ */ new Map()), h = Object.assign(o, {
|
|
210
|
+
i18nNamespace: i?.i18nNamespace,
|
|
211
|
+
ignorePreventCloseEvents: i?.ignorePreventCloseEvents,
|
|
212
|
+
meta: m,
|
|
213
|
+
clear: b,
|
|
211
214
|
handleSubmit: (e) => {
|
|
212
|
-
const r = R.getSpan(
|
|
213
|
-
return
|
|
215
|
+
const r = R.getSpan(x.active());
|
|
216
|
+
return H({ currentSpan: r, ...e });
|
|
214
217
|
},
|
|
215
218
|
// /** @experimental */
|
|
216
|
-
handleSubmitEffect:
|
|
219
|
+
handleSubmitEffect: q,
|
|
217
220
|
registerField: (e) => {
|
|
218
|
-
W(e, (r) =>
|
|
221
|
+
W(e, (r) => A.value.set(r.name, { label: r.label, id: r.id }), { immediate: !0 }), k(() => A.value.delete(e.value.name));
|
|
219
222
|
}
|
|
220
|
-
}), $ = { form:
|
|
221
|
-
return Object.assign(
|
|
223
|
+
}), $ = { form: h, fieldMap: A };
|
|
224
|
+
return Object.assign(h, {
|
|
222
225
|
errorContext: $,
|
|
223
|
-
Form: E(
|
|
224
|
-
Input: E(
|
|
225
|
-
TaggedUnion: E(
|
|
226
|
-
Field:
|
|
227
|
-
Errors:
|
|
228
|
-
Array: E(
|
|
229
|
-
AutoGen: E(
|
|
226
|
+
Form: E(h)(ne),
|
|
227
|
+
Input: E(h)(i?.input ?? re),
|
|
228
|
+
TaggedUnion: E(h)(te),
|
|
229
|
+
Field: o.Field,
|
|
230
|
+
Errors: oe($)(C),
|
|
231
|
+
Array: E(h)(X),
|
|
232
|
+
AutoGen: E(h)(Y)
|
|
230
233
|
});
|
|
231
234
|
};
|
|
232
235
|
export {
|
|
233
|
-
|
|
234
|
-
|
|
236
|
+
se as FormErrors,
|
|
237
|
+
ye as useOmegaForm
|
|
235
238
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as m, createElementBlock as d, openBlock as u, withModifiers as f, createElementVNode as l, unref as s, renderSlot as a } from "vue";
|
|
2
2
|
import { useStore as b } from "@tanstack/vue-form";
|
|
3
3
|
import { usePreventClose as p } from "./vue-components.es11.js";
|
|
4
|
-
import { getOmegaStore as c } from "./vue-components.
|
|
4
|
+
import { getOmegaStore as c } from "./vue-components.es53.js";
|
|
5
5
|
const S = ["disabled"], V = /* @__PURE__ */ m({
|
|
6
6
|
__name: "OmegaWrapper",
|
|
7
7
|
props: {
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 : {});
|
|
1
|
+
function a(t) {
|
|
2
|
+
return Symbol.for(t);
|
|
10
3
|
}
|
|
4
|
+
var c = (
|
|
5
|
+
/** @class */
|
|
6
|
+
/* @__PURE__ */ (function() {
|
|
7
|
+
function t(u) {
|
|
8
|
+
var e = this;
|
|
9
|
+
e._currentContext = u ? new Map(u) : /* @__PURE__ */ new Map(), e.getValue = function(n) {
|
|
10
|
+
return e._currentContext.get(n);
|
|
11
|
+
}, e.setValue = function(n, r) {
|
|
12
|
+
var o = new t(e._currentContext);
|
|
13
|
+
return o._currentContext.set(n, r), o;
|
|
14
|
+
}, e.deleteValue = function(n) {
|
|
15
|
+
var r = new t(e._currentContext);
|
|
16
|
+
return r._currentContext.delete(n), r;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
})()
|
|
21
|
+
), x = new c();
|
|
11
22
|
export {
|
|
12
|
-
|
|
23
|
+
x as ROOT_CONTEXT,
|
|
24
|
+
a as createContextKey
|
|
13
25
|
};
|
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** @class */
|
|
6
|
-
/* @__PURE__ */ (function() {
|
|
7
|
-
function t(u) {
|
|
8
|
-
var e = this;
|
|
9
|
-
e._currentContext = u ? new Map(u) : /* @__PURE__ */ new Map(), e.getValue = function(n) {
|
|
10
|
-
return e._currentContext.get(n);
|
|
11
|
-
}, e.setValue = function(n, r) {
|
|
12
|
-
var o = new t(e._currentContext);
|
|
13
|
-
return o._currentContext.set(n, r), o;
|
|
14
|
-
}, e.deleteValue = function(n) {
|
|
15
|
-
var r = new t(e._currentContext);
|
|
16
|
-
return r._currentContext.delete(n), r;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
return t;
|
|
20
|
-
})()
|
|
21
|
-
), x = new c();
|
|
1
|
+
var R;
|
|
2
|
+
(function(E) {
|
|
3
|
+
E[E.NONE = 0] = "NONE", E[E.ERROR = 30] = "ERROR", E[E.WARN = 50] = "WARN", E[E.INFO = 60] = "INFO", E[E.DEBUG = 70] = "DEBUG", E[E.VERBOSE = 80] = "VERBOSE", E[E.ALL = 9999] = "ALL";
|
|
4
|
+
})(R || (R = {}));
|
|
22
5
|
export {
|
|
23
|
-
|
|
24
|
-
a as createContextKey
|
|
6
|
+
R as DiagLogLevel
|
|
25
7
|
};
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
(
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { NoopTracer as o } from "./vue-components.es44.js";
|
|
2
|
+
var s = new o(), c = (
|
|
3
|
+
/** @class */
|
|
4
|
+
(function() {
|
|
5
|
+
function r(t, e, n, a) {
|
|
6
|
+
this._provider = t, this.name = e, this.version = n, this.options = a;
|
|
7
|
+
}
|
|
8
|
+
return r.prototype.startSpan = function(t, e, n) {
|
|
9
|
+
return this._getTracer().startSpan(t, e, n);
|
|
10
|
+
}, r.prototype.startActiveSpan = function(t, e, n, a) {
|
|
11
|
+
var i = this._getTracer();
|
|
12
|
+
return Reflect.apply(i.startActiveSpan, i, arguments);
|
|
13
|
+
}, r.prototype._getTracer = function() {
|
|
14
|
+
if (this._delegate)
|
|
15
|
+
return this._delegate;
|
|
16
|
+
var t = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
17
|
+
return t ? (this._delegate = t, this._delegate) : s;
|
|
18
|
+
}, r;
|
|
19
|
+
})()
|
|
20
|
+
);
|
|
5
21
|
export {
|
|
6
|
-
|
|
22
|
+
c as ProxyTracer
|
|
7
23
|
};
|
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ContextAPI as l } from "./vue-components.es51.js";
|
|
2
|
+
import { getSpanContext as m, setSpan as d } from "./vue-components.es58.js";
|
|
3
|
+
import { NonRecordingSpan as p } from "./vue-components.es50.js";
|
|
4
|
+
import { isSpanContextValid as S } from "./vue-components.es48.js";
|
|
5
|
+
var f = l.getInstance(), I = (
|
|
3
6
|
/** @class */
|
|
4
7
|
(function() {
|
|
5
|
-
function
|
|
6
|
-
this._provider = t, this.name = e, this.version = n, this.options = a;
|
|
8
|
+
function t() {
|
|
7
9
|
}
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
return t.prototype.startSpan = function(u, e, r) {
|
|
11
|
+
r === void 0 && (r = f.active());
|
|
12
|
+
var i = !!e?.root;
|
|
13
|
+
if (i)
|
|
14
|
+
return new p();
|
|
15
|
+
var n = r && m(r);
|
|
16
|
+
return g(n) && S(n) ? new p(n) : new p();
|
|
17
|
+
}, t.prototype.startActiveSpan = function(u, e, r, i) {
|
|
18
|
+
var n, o, a;
|
|
19
|
+
if (!(arguments.length < 2)) {
|
|
20
|
+
arguments.length === 2 ? a = e : arguments.length === 3 ? (n = e, a = r) : (n = e, o = r, a = i);
|
|
21
|
+
var v = o ?? f.active(), s = this.startSpan(u, n, v), c = d(v, s);
|
|
22
|
+
return f.with(c, a, void 0, s);
|
|
23
|
+
}
|
|
24
|
+
}, t;
|
|
19
25
|
})()
|
|
20
26
|
);
|
|
27
|
+
function g(t) {
|
|
28
|
+
return typeof t == "object" && typeof t.spanId == "string" && typeof t.traceId == "string" && typeof t.traceFlags == "number";
|
|
29
|
+
}
|
|
21
30
|
export {
|
|
22
|
-
|
|
31
|
+
I as NoopTracer
|
|
23
32
|
};
|
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { isSpanContextValid as S } from "./vue-components.es49.js";
|
|
5
|
-
var f = l.getInstance(), I = (
|
|
1
|
+
import { ProxyTracer as i } from "./vue-components.es43.js";
|
|
2
|
+
import { NoopTracerProvider as n } from "./vue-components.es46.js";
|
|
3
|
+
var c = new n(), g = (
|
|
6
4
|
/** @class */
|
|
7
5
|
(function() {
|
|
8
6
|
function t() {
|
|
9
7
|
}
|
|
10
|
-
return t.prototype.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var v = o ?? f.active(), s = this.startSpan(u, n, v), c = d(v, s);
|
|
22
|
-
return f.with(c, a, void 0, s);
|
|
23
|
-
}
|
|
8
|
+
return t.prototype.getTracer = function(e, o, a) {
|
|
9
|
+
var r;
|
|
10
|
+
return (r = this.getDelegateTracer(e, o, a)) !== null && r !== void 0 ? r : new i(this, e, o, a);
|
|
11
|
+
}, t.prototype.getDelegate = function() {
|
|
12
|
+
var e;
|
|
13
|
+
return (e = this._delegate) !== null && e !== void 0 ? e : c;
|
|
14
|
+
}, t.prototype.setDelegate = function(e) {
|
|
15
|
+
this._delegate = e;
|
|
16
|
+
}, t.prototype.getDelegateTracer = function(e, o, a) {
|
|
17
|
+
var r;
|
|
18
|
+
return (r = this._delegate) === null || r === void 0 ? void 0 : r.getTracer(e, o, a);
|
|
24
19
|
}, t;
|
|
25
20
|
})()
|
|
26
21
|
);
|
|
27
|
-
function g(t) {
|
|
28
|
-
return typeof t == "object" && typeof t.spanId == "string" && typeof t.traceId == "string" && typeof t.traceFlags == "number";
|
|
29
|
-
}
|
|
30
22
|
export {
|
|
31
|
-
|
|
23
|
+
g as ProxyTracerProvider
|
|
32
24
|
};
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var c = new n(), g = (
|
|
1
|
+
import { NoopTracer as o } from "./vue-components.es44.js";
|
|
2
|
+
var p = (
|
|
4
3
|
/** @class */
|
|
5
4
|
(function() {
|
|
6
|
-
function
|
|
5
|
+
function r() {
|
|
7
6
|
}
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, t.prototype.getDelegate = function() {
|
|
12
|
-
var e;
|
|
13
|
-
return (e = this._delegate) !== null && e !== void 0 ? e : c;
|
|
14
|
-
}, t.prototype.setDelegate = function(e) {
|
|
15
|
-
this._delegate = e;
|
|
16
|
-
}, t.prototype.getDelegateTracer = function(e, o, a) {
|
|
17
|
-
var r;
|
|
18
|
-
return (r = this._delegate) === null || r === void 0 ? void 0 : r.getTracer(e, o, a);
|
|
19
|
-
}, t;
|
|
7
|
+
return r.prototype.getTracer = function(e, n, t) {
|
|
8
|
+
return new o();
|
|
9
|
+
}, r;
|
|
20
10
|
})()
|
|
21
11
|
);
|
|
22
12
|
export {
|
|
23
|
-
|
|
13
|
+
p as NoopTracerProvider
|
|
24
14
|
};
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function r() {
|
|
6
|
-
}
|
|
7
|
-
return r.prototype.getTracer = function(e, n, t) {
|
|
8
|
-
return new o();
|
|
9
|
-
}, r;
|
|
10
|
-
})()
|
|
11
|
-
);
|
|
1
|
+
var N;
|
|
2
|
+
(function(E) {
|
|
3
|
+
E[E.NONE = 0] = "NONE", E[E.SAMPLED = 1] = "SAMPLED";
|
|
4
|
+
})(N || (N = {}));
|
|
12
5
|
export {
|
|
13
|
-
|
|
6
|
+
N as TraceFlags
|
|
14
7
|
};
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { INVALID_TRACEID as r, INVALID_SPANID as t } from "./vue-components.es49.js";
|
|
2
|
+
import { NonRecordingSpan as i } from "./vue-components.es50.js";
|
|
3
|
+
var a = /^([0-9a-f]{32})$/i, o = /^[0-9a-f]{16}$/i;
|
|
4
|
+
function I(n) {
|
|
5
|
+
return a.test(n) && n !== r;
|
|
6
|
+
}
|
|
7
|
+
function e(n) {
|
|
8
|
+
return o.test(n) && n !== t;
|
|
9
|
+
}
|
|
10
|
+
function A(n) {
|
|
11
|
+
return I(n.traceId) && e(n.spanId);
|
|
12
|
+
}
|
|
13
|
+
function D(n) {
|
|
14
|
+
return new i(n);
|
|
15
|
+
}
|
|
5
16
|
export {
|
|
6
|
-
|
|
17
|
+
A as isSpanContextValid,
|
|
18
|
+
e as isValidSpanId,
|
|
19
|
+
I as isValidTraceId,
|
|
20
|
+
D as wrapSpanContext
|
|
7
21
|
};
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
function e(n) {
|
|
8
|
-
return o.test(n) && n !== t;
|
|
9
|
-
}
|
|
10
|
-
function A(n) {
|
|
11
|
-
return I(n.traceId) && e(n.spanId);
|
|
12
|
-
}
|
|
13
|
-
function D(n) {
|
|
14
|
-
return new i(n);
|
|
15
|
-
}
|
|
1
|
+
import { TraceFlags as I } from "./vue-components.es47.js";
|
|
2
|
+
var a = "0000000000000000", r = "00000000000000000000000000000000", A = {
|
|
3
|
+
traceId: r,
|
|
4
|
+
spanId: a,
|
|
5
|
+
traceFlags: I.NONE
|
|
6
|
+
};
|
|
16
7
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
D as wrapSpanContext
|
|
8
|
+
a as INVALID_SPANID,
|
|
9
|
+
A as INVALID_SPAN_CONTEXT,
|
|
10
|
+
r as INVALID_TRACEID
|
|
21
11
|
};
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { INVALID_SPAN_CONTEXT as o } from "./vue-components.es49.js";
|
|
2
|
+
var i = (
|
|
3
|
+
/** @class */
|
|
4
|
+
(function() {
|
|
5
|
+
function t(n) {
|
|
6
|
+
n === void 0 && (n = o), this._spanContext = n;
|
|
7
|
+
}
|
|
8
|
+
return t.prototype.spanContext = function() {
|
|
9
|
+
return this._spanContext;
|
|
10
|
+
}, t.prototype.setAttribute = function(n, e) {
|
|
11
|
+
return this;
|
|
12
|
+
}, t.prototype.setAttributes = function(n) {
|
|
13
|
+
return this;
|
|
14
|
+
}, t.prototype.addEvent = function(n, e) {
|
|
15
|
+
return this;
|
|
16
|
+
}, t.prototype.addLink = function(n) {
|
|
17
|
+
return this;
|
|
18
|
+
}, t.prototype.addLinks = function(n) {
|
|
19
|
+
return this;
|
|
20
|
+
}, t.prototype.setStatus = function(n) {
|
|
21
|
+
return this;
|
|
22
|
+
}, t.prototype.updateName = function(n) {
|
|
23
|
+
return this;
|
|
24
|
+
}, t.prototype.end = function(n) {
|
|
25
|
+
}, t.prototype.isRecording = function() {
|
|
26
|
+
return !1;
|
|
27
|
+
}, t.prototype.recordException = function(n, e) {
|
|
28
|
+
}, t;
|
|
29
|
+
})()
|
|
30
|
+
);
|
|
7
31
|
export {
|
|
8
|
-
|
|
9
|
-
A as INVALID_SPAN_CONTEXT,
|
|
10
|
-
r as INVALID_TRACEID
|
|
32
|
+
i as NonRecordingSpan
|
|
11
33
|
};
|
|
@@ -1,33 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { NoopContextManager as f } from "./vue-components.es59.js";
|
|
2
|
+
import { registerGlobal as s, getGlobal as p, unregisterGlobal as g } from "./vue-components.es57.js";
|
|
3
|
+
import { DiagAPI as u } from "./vue-components.es54.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.es57.js";
|
|
2
|
+
import { ProxyTracerProvider as i } from "./vue-components.es45.js";
|
|
3
|
+
import { wrapSpanContext as c, isSpanContextValid as h } from "./vue-components.es48.js";
|
|
4
|
+
import { deleteSpan as g, getSpan as S, getActiveSpan as x, getSpanContext as d, setSpan as f, setSpanContext as l } from "./vue-components.es58.js";
|
|
5
|
+
import { DiagAPI as o } from "./vue-components.es54.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.es55.js";
|
|
2
2
|
import { createLogLevelDiagLogger as y } from "./vue-components.es56.js";
|
|
3
|
-
import { DiagLogLevel as d } from "./vue-components.
|
|
3
|
+
import { DiagLogLevel as d } from "./vue-components.es42.js";
|
|
4
4
|
import { unregisterGlobal as p, getGlobal as v, registerGlobal as w } from "./vue-components.es57.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.es41.js";
|
|
2
|
+
import { NonRecordingSpan as a } from "./vue-components.es50.js";
|
|
3
|
+
import { ContextAPI as u } from "./vue-components.es51.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
|
|
3
|
-
import { useStore as
|
|
2
|
+
import { defineComponent as b, computed as r, getCurrentInstance as C, useId as x, renderSlot as _, normalizeProps as m, guardReactiveProps as P, createElementVNode as N, normalizeClass as $, createBlock as q, createCommentVNode as B, unref as k, openBlock as I, mergeProps as L } from "vue";
|
|
3
|
+
import { useStore as M } from "@tanstack/vue-form";
|
|
4
4
|
import S from "./vue-components.es38.js";
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const U = /* @__PURE__ */ b({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "OmegaInternalInput",
|
|
9
9
|
props: {
|
|
@@ -17,59 +17,51 @@ const E = /* @__PURE__ */ C({
|
|
|
17
17
|
register: {},
|
|
18
18
|
options: { default: void 0 }
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const e =
|
|
22
|
-
e.register(
|
|
23
|
-
const c =
|
|
20
|
+
setup(u) {
|
|
21
|
+
const e = u, o = r(() => e.required ?? e?.meta?.required), d = C()?.appContext.components.VTextField, l = x(), p = e.field, i = M(p.store, (t) => t), f = r(() => e.type ? e.type : e.meta?.type === "string" ? e.meta.format === "email" ? "email" : "string" : e.meta?.type || "unknown");
|
|
22
|
+
e.register(r(() => ({ name: e.field.name, label: e.label, id: l }))), r(() => i.value.value);
|
|
23
|
+
const c = r(() => i.value.meta.errors ?? []), s = r(
|
|
24
24
|
() => (
|
|
25
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
-
|
|
26
|
+
c.value.map((t) => t?.message).filter(Boolean)
|
|
27
27
|
)
|
|
28
|
-
),
|
|
29
|
-
|
|
28
|
+
), g = (t) => t == null || t === !1 || t === "" || Number.isNaN(t), v = (t) => {
|
|
29
|
+
g(t) && e.meta?.type !== "boolean" && e.meta?.nullableOrUndefined ? e.field.handleChange(
|
|
30
30
|
e.meta.nullableOrUndefined === "undefined" ? void 0 : null
|
|
31
31
|
) : e.field.handleChange(t), e.field.setMeta((n) => ({ ...n, errorMap: { ...n.errorMap, onSubmit: void 0 } }));
|
|
32
|
-
}
|
|
33
|
-
_(() => {
|
|
34
|
-
if (c.value === void 0) {
|
|
35
|
-
const t = s.value.meta.isDirty;
|
|
36
|
-
if (r.setMeta((n) => ({ ...n, isDirty: t })), i.value) return;
|
|
37
|
-
e.meta?.nullableOrUndefined === "null" ? r.setValue(null) : e.meta?.nullableOrUndefined === "undefined" ? r.setValue(void 0) : e.meta?.type === "string" ? r.setValue("") : e.meta?.type === "number" || e.meta?.type === "boolean" && r.setValue(!1);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const h = (t) => {
|
|
32
|
+
}, h = (t) => {
|
|
41
33
|
const n = {
|
|
42
|
-
get(
|
|
43
|
-
return
|
|
34
|
+
get(O, y, R) {
|
|
35
|
+
return y === "handleChange" ? v : Reflect.get(...arguments);
|
|
44
36
|
}
|
|
45
37
|
};
|
|
46
38
|
return new Proxy(t, n);
|
|
47
|
-
},
|
|
39
|
+
}, a = r(() => ({
|
|
48
40
|
inputProps: {
|
|
49
|
-
id:
|
|
50
|
-
required:
|
|
41
|
+
id: l,
|
|
42
|
+
required: o.value,
|
|
51
43
|
minLength: e.meta?.type === "string" && e.meta?.minLength,
|
|
52
44
|
maxLength: e.meta?.type === "string" && e.meta?.maxLength,
|
|
53
45
|
max: e.meta?.type === "number" && e.meta?.maximum,
|
|
54
46
|
min: e.meta?.type === "number" && e.meta?.minimum,
|
|
55
|
-
errorMessages:
|
|
56
|
-
error: !!
|
|
57
|
-
type:
|
|
58
|
-
label: `${e.label}${
|
|
47
|
+
errorMessages: s.value,
|
|
48
|
+
error: !!s.value.length,
|
|
49
|
+
type: f.value,
|
|
50
|
+
label: `${e.label}${o.value ? " *" : ""}`,
|
|
59
51
|
options: e.options
|
|
60
52
|
},
|
|
61
53
|
state: e.state,
|
|
62
54
|
field: h(e.field)
|
|
63
55
|
}));
|
|
64
|
-
return (t, n) =>
|
|
56
|
+
return (t, n) => _(t.$slots, "default", m(P({ ...a.value.inputProps, field: a.value.field, state: a.value.state })), () => [
|
|
65
57
|
N("div", {
|
|
66
58
|
class: $(t.$attrs.class)
|
|
67
59
|
}, [
|
|
68
|
-
|
|
60
|
+
k(d) ? (I(), q(S, m(L({ key: 0 }, { ...t.$attrs, ...a.value })), null, 16)) : B("", !0)
|
|
69
61
|
], 2)
|
|
70
62
|
]);
|
|
71
63
|
}
|
|
72
64
|
});
|
|
73
65
|
export {
|
|
74
|
-
|
|
66
|
+
U as default
|
|
75
67
|
};
|
package/package.json
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
lang="ts"
|
|
15
15
|
generic="From extends Record<PropertyKey, any>, Name extends DeepKeys<From>"
|
|
16
16
|
>
|
|
17
|
-
import { type DeepKeys,
|
|
18
|
-
import { computed, type ComputedRef, getCurrentInstance,
|
|
17
|
+
import { type DeepKeys, useStore } from "@tanstack/vue-form"
|
|
18
|
+
import { computed, type ComputedRef, getCurrentInstance, useId } from "vue"
|
|
19
19
|
import type { InputProps, OmegaFieldInternalApi } from "./InputProps"
|
|
20
20
|
import type { FieldValidators, MetaRecord, NestedKeyOf, TypeOverride } from "./OmegaFormStuff"
|
|
21
21
|
import OmegaInputVuetify from "./OmegaInputVuetify.vue"
|
|
@@ -112,35 +112,8 @@ const handleChange: OmegaFieldInternalApi<From, Name>["handleChange"] = (value)
|
|
|
112
112
|
props.field.setMeta((m) => ({ ...m, errorMap: { ...m.errorMap, onSubmit: undefined } }))
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
// Initialize field value on mount if it doesn't exist
|
|
118
|
-
if (fieldValue.value === undefined) {
|
|
119
|
-
const isDirty = fieldState.value.meta.isDirty
|
|
120
|
-
// make sure we restore the previous dirty state..
|
|
121
|
-
fieldApi.setMeta((_) => ({ ..._, isDirty }))
|
|
122
|
-
|
|
123
|
-
if (isRequired.value) return
|
|
124
|
-
|
|
125
|
-
// Set appropriate default value based on field type and nullability
|
|
126
|
-
if (props.meta?.nullableOrUndefined === "null") {
|
|
127
|
-
fieldApi.setValue(null as DeepValue<From, Name>)
|
|
128
|
-
} else if (props.meta?.nullableOrUndefined === "undefined") {
|
|
129
|
-
fieldApi.setValue(undefined as DeepValue<From, Name>)
|
|
130
|
-
} else {
|
|
131
|
-
// For required fields, initialize with appropriate empty value
|
|
132
|
-
if (props.meta?.type === "string") {
|
|
133
|
-
fieldApi.setValue("" as DeepValue<From, Name>)
|
|
134
|
-
} else if (props.meta?.type === "number") {
|
|
135
|
-
// Don't initialize number fields to avoid setting them to 0
|
|
136
|
-
// Leave as undefined so validation will catch it
|
|
137
|
-
} else if (props.meta?.type === "boolean") {
|
|
138
|
-
fieldApi.setValue(false as DeepValue<From, Name>)
|
|
139
|
-
}
|
|
140
|
-
// For other types, leave undefined so validation will catch missing required fields
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
})
|
|
115
|
+
// Note: Default value normalization (converting empty strings to null/undefined for nullable fields)
|
|
116
|
+
// is now handled at the form level in useOmegaForm, not here in the component
|
|
144
117
|
|
|
145
118
|
const wrapField = (field: OmegaFieldInternalApi<From, Name>) => {
|
|
146
119
|
const handler3 = {
|
|
@@ -783,14 +783,50 @@ export const useOmegaForm = <
|
|
|
783
783
|
return target
|
|
784
784
|
}
|
|
785
785
|
|
|
786
|
+
// Normalize default values based on schema metadata
|
|
787
|
+
// Convert empty strings to null/undefined for nullable fields
|
|
788
|
+
// Also initialize missing nullable fields with null/undefined
|
|
789
|
+
const normalizeDefaultValues = (values: Partial<From>): Partial<From> => {
|
|
790
|
+
const normalized: any = { ...values }
|
|
791
|
+
|
|
792
|
+
// Process all fields in the schema metadata
|
|
793
|
+
for (const key in meta) {
|
|
794
|
+
const fieldMeta = meta[key as keyof typeof meta]
|
|
795
|
+
const value = normalized[key]
|
|
796
|
+
|
|
797
|
+
// Check if the value is falsy (but not boolean false or zero)
|
|
798
|
+
const isFalsyButNotZero = value == null || value === false || value === "" || Number.isNaN(value)
|
|
799
|
+
const isFalsy = isFalsyButNotZero && value !== false && value !== 0
|
|
800
|
+
|
|
801
|
+
if (
|
|
802
|
+
fieldMeta
|
|
803
|
+
&& !fieldMeta.required
|
|
804
|
+
&& fieldMeta.nullableOrUndefined
|
|
805
|
+
&& fieldMeta.type !== "boolean"
|
|
806
|
+
) {
|
|
807
|
+
// If value is missing or falsy, set to null or undefined based on schema
|
|
808
|
+
if (value === undefined || isFalsy) {
|
|
809
|
+
normalized[key] = fieldMeta.nullableOrUndefined === "undefined" ? undefined : null
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
return normalized
|
|
815
|
+
}
|
|
816
|
+
|
|
786
817
|
const defaultValues = computed(() => {
|
|
818
|
+
// Normalize tanstack default values at the beginning
|
|
819
|
+
const normalizedTanstackDefaults = tanstackFormOptions?.defaultValues
|
|
820
|
+
? normalizeDefaultValues(tanstackFormOptions.defaultValues)
|
|
821
|
+
: undefined
|
|
822
|
+
|
|
787
823
|
if (
|
|
788
|
-
|
|
824
|
+
normalizedTanstackDefaults
|
|
789
825
|
&& !omegaConfig?.persistency?.overrideDefaultValues
|
|
790
826
|
) {
|
|
791
827
|
// defaultValues from tanstack are not partial,
|
|
792
|
-
// so if ovverrideDefaultValues is false we
|
|
793
|
-
return
|
|
828
|
+
// so if ovverrideDefaultValues is false we return the normalized values
|
|
829
|
+
return normalizedTanstackDefaults
|
|
794
830
|
}
|
|
795
831
|
|
|
796
832
|
// we are here because there are no default values from tankstack
|
|
@@ -839,12 +875,11 @@ export const useOmegaForm = <
|
|
|
839
875
|
// to be sure we have a valid object at the end of the gathering process
|
|
840
876
|
defValuesPatch ??= {}
|
|
841
877
|
|
|
842
|
-
if (
|
|
878
|
+
if (!normalizedTanstackDefaults) {
|
|
843
879
|
// we just return what we gathered from the query/storage
|
|
844
880
|
return defValuesPatch
|
|
845
881
|
} else {
|
|
846
|
-
|
|
847
|
-
return deepMerge(startingDefValues, defValuesPatch)
|
|
882
|
+
return deepMerge(normalizedTanstackDefaults, defValuesPatch)
|
|
848
883
|
}
|
|
849
884
|
})
|
|
850
885
|
|