@effect-app/vue-components 2.4.6 → 2.4.9
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/OmegaArray.vue.d.ts +2 -2
- package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +5 -5
- package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +14 -11
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +2 -3
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +71 -90
- package/dist/vue-components.es10.js +139 -122
- package/dist/vue-components.es22.js +1 -1
- package/dist/vue-components.es23.js +1 -1
- package/dist/vue-components.es40.js +23 -4
- package/dist/vue-components.es41.js +5 -23
- package/dist/vue-components.es42.js +21 -5
- package/dist/vue-components.es43.js +25 -16
- package/dist/vue-components.es44.js +15 -23
- package/dist/vue-components.es45.js +7 -17
- package/dist/vue-components.es46.js +5 -12
- package/dist/vue-components.es47.js +19 -5
- package/dist/vue-components.es48.js +9 -19
- package/dist/vue-components.es49.js +31 -9
- package/dist/vue-components.es50.js +42 -25
- package/dist/vue-components.es51.js +16 -38
- package/dist/vue-components.es52.js +4 -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/package.json +1 -1
- package/src/components/OmegaForm/OmegaArray.vue +2 -3
- package/src/components/OmegaForm/OmegaAutoGen.vue +5 -6
- package/src/components/OmegaForm/OmegaFormInput.vue +2 -3
- package/src/components/OmegaForm/OmegaFormStuff.ts +12 -16
- package/src/components/OmegaForm/OmegaInput.vue +2 -3
- package/src/components/OmegaForm/useOmegaForm.ts +222 -466
|
@@ -1,57 +1,48 @@
|
|
|
1
|
-
import { useForm as
|
|
2
|
-
import { Data as
|
|
3
|
-
import { runtimeFiberAsPromise as
|
|
4
|
-
import { isObject as
|
|
5
|
-
import { computed as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { generateMetaFromSchema as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { trace as
|
|
14
|
-
import { context as
|
|
15
|
-
class
|
|
1
|
+
import { useForm as Z } from "@tanstack/vue-form";
|
|
2
|
+
import { Data as G, S as W, Effect as l, Fiber as N, Option as A, Array as g } from "effect-app";
|
|
3
|
+
import { runtimeFiberAsPromise as Q } from "./vue-components.es16.js";
|
|
4
|
+
import { isObject as X } from "./vue-components.es17.js";
|
|
5
|
+
import { computed as V, onUnmounted as $, onMounted as Y, onBeforeUnmount as C, watch as R, ref as ee, h as b } from "vue";
|
|
6
|
+
import re from "./vue-components.es18.js";
|
|
7
|
+
import te from "./vue-components.es19.js";
|
|
8
|
+
import se from "./vue-components.es20.js";
|
|
9
|
+
import { generateMetaFromSchema as ne } from "./vue-components.es12.js";
|
|
10
|
+
import oe from "./vue-components.es6.js";
|
|
11
|
+
import ie from "./vue-components.es8.js";
|
|
12
|
+
import ae from "./vue-components.es21.js";
|
|
13
|
+
import { trace as x } from "./vue-components.es22.js";
|
|
14
|
+
import { context as L } from "./vue-components.es23.js";
|
|
15
|
+
class le extends G.TaggedError("FormErrors") {
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
return {
|
|
19
|
-
render() {
|
|
20
|
-
return B(i, {
|
|
21
|
-
form: c,
|
|
22
|
-
...this.$attrs
|
|
23
|
-
}, this.$slots);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}, oe = (c) => function(i) {
|
|
17
|
+
const ce = (m) => function(i) {
|
|
27
18
|
return {
|
|
28
19
|
setup() {
|
|
29
|
-
const { fieldMap:
|
|
30
|
-
const
|
|
31
|
-
Object.entries(
|
|
20
|
+
const { fieldMap: h, form: v } = m, d = v.useStore((c) => c.errors), f = v.useStore((c) => c.fieldMeta), F = v.useStore((c) => c.errorMap), M = V(() => {
|
|
21
|
+
const c = g.filterMap(
|
|
22
|
+
Object.entries(f.value),
|
|
32
23
|
([j, o]) => {
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
35
|
-
const a =
|
|
36
|
-
return a ?
|
|
24
|
+
const w = o.errors ?? [];
|
|
25
|
+
if (!w.length) return A.none();
|
|
26
|
+
const a = h.value.get(j);
|
|
27
|
+
return a ? A.some({
|
|
37
28
|
label: a.label,
|
|
38
29
|
inputId: a.id,
|
|
39
30
|
// Only show the first error
|
|
40
|
-
errors: [
|
|
41
|
-
}) :
|
|
31
|
+
errors: [w[0]?.message].filter(Boolean)
|
|
32
|
+
}) : A.none();
|
|
42
33
|
}
|
|
43
34
|
), O = [];
|
|
44
35
|
if (F.value.onSubmit) {
|
|
45
36
|
for (const [j, o] of Object.entries(F.value.onSubmit))
|
|
46
37
|
if (g.isArray(o) && o.length)
|
|
47
|
-
for (const
|
|
48
|
-
const a =
|
|
38
|
+
for (const w of o) {
|
|
39
|
+
const a = w;
|
|
49
40
|
if (a?.path && g.isArray(a.path) && a.path.length) {
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
41
|
+
const y = a.path.join(".");
|
|
42
|
+
if (!h.value.has(y)) {
|
|
52
43
|
O.push({
|
|
53
|
-
label:
|
|
54
|
-
inputId:
|
|
44
|
+
label: y,
|
|
45
|
+
inputId: y,
|
|
55
46
|
errors: [a.message].filter(Boolean)
|
|
56
47
|
});
|
|
57
48
|
break;
|
|
@@ -59,180 +50,206 @@ const E = (c) => function(i) {
|
|
|
59
50
|
}
|
|
60
51
|
}
|
|
61
52
|
}
|
|
62
|
-
return [...
|
|
53
|
+
return [...c, ...O];
|
|
63
54
|
});
|
|
64
55
|
return {
|
|
65
|
-
generalErrors:
|
|
56
|
+
generalErrors: d,
|
|
66
57
|
errors: M
|
|
67
58
|
};
|
|
68
59
|
},
|
|
69
|
-
render({ errors:
|
|
70
|
-
return
|
|
71
|
-
errors:
|
|
60
|
+
render({ errors: h, generalErrors: v }) {
|
|
61
|
+
return b(i, {
|
|
62
|
+
errors: h,
|
|
72
63
|
generalErrors: v,
|
|
73
64
|
...this.$attrs
|
|
74
65
|
}, this.$slots);
|
|
75
66
|
}
|
|
76
67
|
};
|
|
77
|
-
},
|
|
78
|
-
if (!
|
|
79
|
-
const
|
|
68
|
+
}, Oe = (m, p, i) => {
|
|
69
|
+
if (!m) throw new Error("Schema is required");
|
|
70
|
+
const h = W.standardSchemaV1(m), v = W.decode(m), { meta: d } = ne(m), f = V(() => {
|
|
80
71
|
if (i?.persistency?.id)
|
|
81
72
|
return i.persistency.id;
|
|
82
|
-
const e = window.location.pathname, r = Object.keys(
|
|
73
|
+
const e = window.location.pathname, r = Object.keys(d);
|
|
83
74
|
return `${e}-${r.join("-")}`;
|
|
84
75
|
}), F = () => {
|
|
85
76
|
const e = new URLSearchParams(window.location.search);
|
|
86
|
-
e.delete(
|
|
77
|
+
e.delete(f.value);
|
|
87
78
|
const r = new URL(window.location.href);
|
|
88
79
|
r.search = e.toString(), window.history.replaceState({}, "", r.toString());
|
|
89
80
|
};
|
|
90
81
|
function M(e, r) {
|
|
91
|
-
for (const
|
|
92
|
-
r[
|
|
82
|
+
for (const s in r)
|
|
83
|
+
r[s] && X(r[s]) ? (e[s] || (e[s] = {}), M(e[s], r[s])) : e[s] = r[s];
|
|
93
84
|
return e;
|
|
94
85
|
}
|
|
95
|
-
const
|
|
86
|
+
const c = (e) => {
|
|
96
87
|
const r = { ...e };
|
|
97
|
-
for (const
|
|
98
|
-
const
|
|
99
|
-
|
|
88
|
+
for (const s in d) {
|
|
89
|
+
const n = d[s], t = r[s], E = (t == null || t === !1 || t === "" || Number.isNaN(t)) && t !== !1 && t !== 0;
|
|
90
|
+
n && !n.required && n.nullableOrUndefined && n.type !== "boolean" && (t === void 0 || E) && (r[s] = n.nullableOrUndefined === "undefined" ? void 0 : null);
|
|
100
91
|
}
|
|
101
92
|
return r;
|
|
102
|
-
}, O =
|
|
103
|
-
const e =
|
|
93
|
+
}, O = V(() => {
|
|
94
|
+
const e = p?.defaultValues ? c(p.defaultValues) : void 0;
|
|
104
95
|
if (e && !i?.persistency?.overrideDefaultValues)
|
|
105
96
|
return e;
|
|
106
97
|
let r;
|
|
107
|
-
const
|
|
108
|
-
if (!
|
|
109
|
-
if (
|
|
98
|
+
const s = i?.persistency;
|
|
99
|
+
if (!s?.policies || s.policies.length === 0) return {};
|
|
100
|
+
if (s.policies.includes("querystring"))
|
|
110
101
|
try {
|
|
111
|
-
const t = new URLSearchParams(window.location.search).get(
|
|
102
|
+
const t = new URLSearchParams(window.location.search).get(f.value);
|
|
112
103
|
F(), t && (r = JSON.parse(t));
|
|
113
|
-
} catch (
|
|
114
|
-
console.error(
|
|
104
|
+
} catch (n) {
|
|
105
|
+
console.error(n);
|
|
115
106
|
}
|
|
116
107
|
if (
|
|
117
108
|
// query string has higher priority than local/session storage
|
|
118
|
-
!r && (
|
|
109
|
+
!r && (s.policies.includes("local") || s.policies.includes("session"))
|
|
119
110
|
) {
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
111
|
+
const n = s.policies.includes("local") ? localStorage : sessionStorage;
|
|
112
|
+
if (n)
|
|
122
113
|
try {
|
|
123
114
|
const t = JSON.parse(
|
|
124
|
-
|
|
115
|
+
n.getItem(f.value) || "{}"
|
|
125
116
|
);
|
|
126
|
-
|
|
117
|
+
n.removeItem(f.value), r = t;
|
|
127
118
|
} catch (t) {
|
|
128
119
|
console.error(t);
|
|
129
120
|
}
|
|
130
121
|
}
|
|
131
122
|
return r ??= {}, e ? M(e, r) : r;
|
|
132
|
-
}), j = (e, r) => e ?
|
|
133
|
-
...
|
|
123
|
+
}), j = (e, r) => e ? L.with(x.setSpan(L.active(), e), r) : r(), o = Z({
|
|
124
|
+
...p,
|
|
134
125
|
validators: {
|
|
135
|
-
onSubmit:
|
|
136
|
-
...
|
|
126
|
+
onSubmit: h,
|
|
127
|
+
...p?.validators || {}
|
|
137
128
|
},
|
|
138
|
-
onSubmit:
|
|
139
|
-
const
|
|
129
|
+
onSubmit: p?.onSubmit ? ({ formApi: e, meta: r, value: s }) => j(r?.currentSpan, async () => {
|
|
130
|
+
const n = await l.runPromise(v(s)), t = p.onSubmit({
|
|
140
131
|
formApi: e,
|
|
141
132
|
meta: r,
|
|
142
|
-
value:
|
|
133
|
+
value: n
|
|
143
134
|
});
|
|
144
|
-
return N.isFiber(t) && N.isRuntimeFiber(t) ? await
|
|
135
|
+
return N.isFiber(t) && N.isRuntimeFiber(t) ? await Q(t) : l.isEffect(t) ? await l.runPromise(
|
|
145
136
|
t.pipe(
|
|
146
137
|
// meta?.currentSpan
|
|
147
138
|
// ? Effect.withParentSpan(meta.currentSpan)
|
|
148
139
|
// : (_) => _,
|
|
149
|
-
l.flatMap((
|
|
140
|
+
l.flatMap((u) => N.join(u))
|
|
150
141
|
)
|
|
151
142
|
) : t;
|
|
152
143
|
}) : void 0,
|
|
153
144
|
defaultValues: O.value
|
|
154
|
-
}),
|
|
155
|
-
Object.keys(
|
|
145
|
+
}), w = () => {
|
|
146
|
+
Object.keys(d).forEach((e) => {
|
|
156
147
|
o.setFieldValue(e, void 0);
|
|
157
148
|
});
|
|
158
|
-
}, a = (e) => e.reduce((r,
|
|
159
|
-
const
|
|
160
|
-
return
|
|
161
|
-
}, {}),
|
|
149
|
+
}, a = (e) => e.reduce((r, s) => {
|
|
150
|
+
const n = s.split(".");
|
|
151
|
+
return n.reduce((t, u, E) => (E === n.length - 1 ? t[u] = o.getFieldValue(s) : t[u] = t[u] ?? {}, t[u]), r), r;
|
|
152
|
+
}, {}), y = (e) => {
|
|
162
153
|
if (e) {
|
|
163
154
|
if (g.isArray(e.keys))
|
|
164
155
|
return a(e.keys);
|
|
165
156
|
if (g.isArray(e.banKeys)) {
|
|
166
|
-
const r = Object.keys(
|
|
157
|
+
const r = Object.keys(d).filter((s) => e.banKeys?.includes(s));
|
|
167
158
|
return a(r);
|
|
168
159
|
}
|
|
169
160
|
return o.store.state.values;
|
|
170
161
|
}
|
|
171
|
-
},
|
|
162
|
+
}, P = () => {
|
|
172
163
|
const e = i?.persistency;
|
|
173
164
|
if (!(!e?.policies || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
|
|
174
165
|
const r = e.policies.includes("local") ? localStorage : sessionStorage;
|
|
175
166
|
if (!r) return;
|
|
176
|
-
const
|
|
177
|
-
return r.setItem(
|
|
167
|
+
const s = y(e);
|
|
168
|
+
return r.setItem(f.value, JSON.stringify(s));
|
|
178
169
|
}
|
|
179
|
-
},
|
|
170
|
+
}, I = () => {
|
|
180
171
|
const e = i?.persistency;
|
|
181
172
|
if (!(!e?.policies || e.policies.length === 0) && e.policies.includes("querystring")) {
|
|
182
|
-
const r =
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
|
|
173
|
+
const r = y(e), s = new URLSearchParams(window.location.search);
|
|
174
|
+
s.set(f.value, JSON.stringify(r));
|
|
175
|
+
const n = new URL(window.location.href);
|
|
176
|
+
n.search = s.toString(), window.history.replaceState({}, "", n.toString());
|
|
186
177
|
}
|
|
187
178
|
}, _ = (e) => {
|
|
188
179
|
o.store.state.isDirty && e.preventDefault();
|
|
189
180
|
};
|
|
190
|
-
if (
|
|
191
|
-
window.addEventListener("beforeunload",
|
|
192
|
-
}),
|
|
193
|
-
window.removeEventListener("beforeunload",
|
|
181
|
+
if ($(P), Y(() => {
|
|
182
|
+
window.addEventListener("beforeunload", P), window.addEventListener("blur", I), i?.preventWindowExit && i.preventWindowExit !== "nope" && window.addEventListener("beforeunload", _);
|
|
183
|
+
}), C(() => {
|
|
184
|
+
window.removeEventListener("beforeunload", P), window.removeEventListener("blur", I), i?.preventWindowExit && i.preventWindowExit !== "nope" && window.removeEventListener("beforeunload", _);
|
|
194
185
|
}), i?.preventWindowExit === "prevent-and-reset") {
|
|
195
|
-
const e = o.useStore((t) => t.isSubmitting), r = o.useStore((t) => t.submissionAttempts),
|
|
196
|
-
|
|
197
|
-
|
|
186
|
+
const e = o.useStore((t) => t.isSubmitting), r = o.useStore((t) => t.submissionAttempts), s = o.useStore((t) => t.canSubmit), n = o.useStore((t) => t.values);
|
|
187
|
+
R([e, r], ([t, u], [E]) => {
|
|
188
|
+
E && !t && u > 0 && s.value && o.reset(n.value);
|
|
198
189
|
});
|
|
199
190
|
}
|
|
200
|
-
const
|
|
191
|
+
const D = (e) => l.currentSpan.pipe(
|
|
201
192
|
l.option,
|
|
202
193
|
l.flatMap(
|
|
203
|
-
(r) => l.promise(() => o.handleSubmit(
|
|
194
|
+
(r) => l.promise(() => o.handleSubmit(A.isSome(r) ? { currentSpan: r.value, ...e } : e))
|
|
204
195
|
)
|
|
205
|
-
),
|
|
196
|
+
), B = (e) => e?.checkErrors ? D(e?.meta).pipe(l.flatMap(l.fnUntraced(function* () {
|
|
206
197
|
const r = o.getAllErrors();
|
|
207
198
|
if (Object.keys(r.fields).length || r.form.errors.length)
|
|
208
|
-
return yield* new
|
|
209
|
-
}))) :
|
|
199
|
+
return yield* new le({ form: r.form, fields: r.fields });
|
|
200
|
+
}))) : D(e?.meta), q = o.handleSubmit, U = ee(/* @__PURE__ */ new Map()), S = Object.assign(o, {
|
|
210
201
|
i18nNamespace: i?.i18nNamespace,
|
|
211
202
|
ignorePreventCloseEvents: i?.ignorePreventCloseEvents,
|
|
212
|
-
meta:
|
|
213
|
-
clear:
|
|
203
|
+
meta: d,
|
|
204
|
+
clear: w,
|
|
214
205
|
handleSubmit: (e) => {
|
|
215
|
-
const r =
|
|
216
|
-
return
|
|
206
|
+
const r = x.getSpan(L.active());
|
|
207
|
+
return q({ currentSpan: r, ...e });
|
|
217
208
|
},
|
|
218
209
|
// /** @experimental */
|
|
219
|
-
handleSubmitEffect:
|
|
210
|
+
handleSubmitEffect: B,
|
|
220
211
|
registerField: (e) => {
|
|
221
|
-
|
|
212
|
+
R(e, (r) => U.value.set(r.name, { label: r.label, id: r.id }), { immediate: !0 }), $(() => U.value.delete(e.value.name));
|
|
222
213
|
}
|
|
223
|
-
}),
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
214
|
+
}), k = { form: S, fieldMap: U }, J = (e, r) => {
|
|
215
|
+
const s = i?.input ?? oe;
|
|
216
|
+
return b(s, {
|
|
217
|
+
...e,
|
|
218
|
+
form: S,
|
|
219
|
+
...r?.attrs
|
|
220
|
+
}, r?.slots);
|
|
221
|
+
}, z = (e, r) => b(ce(k)(se), {
|
|
222
|
+
...e,
|
|
223
|
+
...r?.attrs
|
|
224
|
+
}, r?.slots), K = (e, r) => b(ie, {
|
|
225
|
+
...e,
|
|
226
|
+
form: S,
|
|
227
|
+
...r?.attrs
|
|
228
|
+
}, r?.slots), T = (e, r) => b(re, {
|
|
229
|
+
...e,
|
|
230
|
+
form: S,
|
|
231
|
+
...r?.attrs
|
|
232
|
+
}, r?.slots), H = (e, r) => b(te, {
|
|
233
|
+
...e,
|
|
234
|
+
form: S,
|
|
235
|
+
...r?.attrs
|
|
236
|
+
}, r?.slots);
|
|
237
|
+
return Object.assign(S, {
|
|
238
|
+
errorContext: k,
|
|
239
|
+
Form: (e, r) => b(ae, {
|
|
240
|
+
...e,
|
|
241
|
+
form: S,
|
|
242
|
+
...r?.attrs
|
|
243
|
+
}, r?.slots),
|
|
244
|
+
Input: J,
|
|
245
|
+
TaggedUnion: K,
|
|
229
246
|
Field: o.Field,
|
|
230
|
-
Errors:
|
|
231
|
-
Array:
|
|
232
|
-
AutoGen:
|
|
247
|
+
Errors: z,
|
|
248
|
+
Array: T,
|
|
249
|
+
AutoGen: H
|
|
233
250
|
});
|
|
234
251
|
};
|
|
235
252
|
export {
|
|
236
|
-
|
|
237
|
-
|
|
253
|
+
le as FormErrors,
|
|
254
|
+
Oe as useOmegaForm
|
|
238
255
|
};
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function a(t) {
|
|
2
|
+
return Symbol.for(t);
|
|
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();
|
|
4
22
|
export {
|
|
5
|
-
|
|
23
|
+
x as ROOT_CONTEXT,
|
|
24
|
+
a as createContextKey
|
|
6
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.es43.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.es50.js";
|
|
2
|
+
import { getSpanContext as m, setSpan as d } from "./vue-components.es58.js";
|
|
3
|
+
import { NonRecordingSpan as p } from "./vue-components.es49.js";
|
|
4
|
+
import { isSpanContextValid as S } from "./vue-components.es47.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.es48.js";
|
|
5
|
-
var f = l.getInstance(), I = (
|
|
1
|
+
import { ProxyTracer as i } from "./vue-components.es42.js";
|
|
2
|
+
import { NoopTracerProvider as n } from "./vue-components.es45.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.es43.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
|
};
|