@effect-app/vue-components 2.7.4 → 2.7.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/OmegaFormStuff.d.ts +1 -0
- package/dist/vue-components.es.js +12 -11
- package/dist/vue-components.es10.js +177 -179
- package/dist/vue-components.es12.js +1 -0
- package/dist/vue-components.es16.js +1 -1
- package/dist/vue-components.es17.js +1 -1
- package/dist/vue-components.es2.js +14 -13
- package/dist/vue-components.es20.js +2 -2
- package/dist/vue-components.es21.js +2 -2
- package/dist/vue-components.es22.js +1 -1
- package/dist/vue-components.es23.js +1 -1
- package/dist/vue-components.es30.js +41 -191
- package/dist/vue-components.es31.js +4 -0
- package/dist/vue-components.es32.js +2 -42
- package/dist/vue-components.es33.js +89 -2
- package/dist/vue-components.es35.js +7 -89
- package/dist/vue-components.es36.js +34 -0
- package/dist/vue-components.es38.js +187 -27
- 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 +11 -26
- package/dist/vue-components.es53.js +4 -11
- 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 +1 -1
- package/package.json +1 -1
- package/src/components/OmegaForm/OmegaFormStuff.ts +1 -1
- package/src/components/OmegaForm/useOmegaForm.ts +17 -57
- package/dist/vue-components.es34.js +0 -4
- package/dist/vue-components.es37.js +0 -9
|
@@ -136,6 +136,7 @@ export type CreateMeta = {
|
|
|
136
136
|
propertySignatures?: never;
|
|
137
137
|
property: S.AST.AST;
|
|
138
138
|
});
|
|
139
|
+
export declare const isNullableOrUndefined: (property: false | S.AST.AST | undefined) => false | "undefined" | "null";
|
|
139
140
|
export declare const createMeta: <T = any>({ meta, parent, property, propertySignatures }: CreateMeta, acc?: Partial<MetaRecord<T>>) => MetaRecord<T> | FieldMeta;
|
|
140
141
|
export declare const duplicateSchema: <From, To>(schema: S.Schema<To, From, never>) => S.extend<S.Schema<To, From, never>, S.Struct<{}>>;
|
|
141
142
|
export declare const generateMetaFromSchema: <From, To>(schema: S.Schema<To, From, never>) => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as o from "./vue-components.es2.js";
|
|
2
|
-
import { getTransformationFrom as f, provideIntl as
|
|
2
|
+
import { getTransformationFrom as f, provideIntl as l, useIntl as u, useIntlKey as s } from "./vue-components.es3.js";
|
|
3
3
|
import { default as i } from "./vue-components.es4.js";
|
|
4
4
|
import { default as g } from "./vue-components.es5.js";
|
|
5
5
|
import { default as I } from "./vue-components.es6.js";
|
|
6
6
|
import { default as y } from "./vue-components.es7.js";
|
|
7
7
|
import { default as h } from "./vue-components.es8.js";
|
|
8
|
-
import { default as
|
|
9
|
-
import { useOmegaForm as
|
|
10
|
-
import { useOnClose as
|
|
11
|
-
import { createMeta as P, duplicateSchema as k, generateInputStandardSchemaFromFieldMeta as w, generateMetaFromSchema as B, getInputType as D,
|
|
8
|
+
import { default as C } from "./vue-components.es9.js";
|
|
9
|
+
import { useOmegaForm as T } from "./vue-components.es10.js";
|
|
10
|
+
import { useOnClose as M, usePreventClose as j } from "./vue-components.es11.js";
|
|
11
|
+
import { createMeta as P, duplicateSchema as k, generateInputStandardSchemaFromFieldMeta as w, generateMetaFromSchema as B, getInputType as D, isNullableOrUndefined as K, nullableInput as N } from "./vue-components.es12.js";
|
|
12
12
|
import { createUseFormWithCustomInput as W } from "./vue-components.es13.js";
|
|
13
13
|
function r(a) {
|
|
14
14
|
for (const e in o)
|
|
@@ -23,7 +23,7 @@ export {
|
|
|
23
23
|
g as Dialog,
|
|
24
24
|
I as OmegaInput,
|
|
25
25
|
h as OmegaTaggedUnion,
|
|
26
|
-
|
|
26
|
+
C as OmegaTaggedUnionInternal,
|
|
27
27
|
y as OmegaVuetifyInput,
|
|
28
28
|
P as createMeta,
|
|
29
29
|
W as createUseFormWithCustomInput,
|
|
@@ -33,11 +33,12 @@ export {
|
|
|
33
33
|
B as generateMetaFromSchema,
|
|
34
34
|
D as getInputType,
|
|
35
35
|
f as getTransformationFrom,
|
|
36
|
-
K as
|
|
37
|
-
|
|
38
|
-
l as
|
|
36
|
+
K as isNullableOrUndefined,
|
|
37
|
+
N as nullableInput,
|
|
38
|
+
l as provideIntl,
|
|
39
|
+
u as useIntl,
|
|
39
40
|
s as useIntlKey,
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
T as useOmegaForm,
|
|
42
|
+
M as useOnClose,
|
|
42
43
|
j as usePreventClose
|
|
43
44
|
};
|
|
@@ -1,162 +1,151 @@
|
|
|
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
|
-
const
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
const o =
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
}),
|
|
22
|
-
...
|
|
1
|
+
import { useForm as G } from "@tanstack/vue-form";
|
|
2
|
+
import { Data as z, S as p, Effect as b, Array as g, Fiber as O, Option as x } 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 W, onMounted as Y, onBeforeUnmount as Z, watch as H, ref as C, h as q } from "vue";
|
|
6
|
+
import ee from "./vue-components.es18.js";
|
|
7
|
+
import te from "./vue-components.es19.js";
|
|
8
|
+
import re from "./vue-components.es20.js";
|
|
9
|
+
import { generateMetaFromSchema as ne, isNullableOrUndefined as se } 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 J } from "./vue-components.es22.js";
|
|
14
|
+
import { context as L } from "./vue-components.es23.js";
|
|
15
|
+
const _ = (l) => {
|
|
16
|
+
const i = l.ast;
|
|
17
|
+
if (i._tag === "Union") {
|
|
18
|
+
const o = i.types.map((u) => {
|
|
19
|
+
const c = p.make(u);
|
|
20
|
+
return _(c).ast;
|
|
21
|
+
}), m = {
|
|
22
|
+
...i,
|
|
23
23
|
types: o
|
|
24
24
|
};
|
|
25
|
-
return
|
|
25
|
+
return p.make(m);
|
|
26
26
|
}
|
|
27
|
-
if (
|
|
28
|
-
const o =
|
|
29
|
-
...
|
|
30
|
-
from:
|
|
31
|
-
to:
|
|
27
|
+
if (i._tag === "Transformation") {
|
|
28
|
+
const o = p.make(i.from), m = p.make(i.to), u = _(o), c = _(m), f = {
|
|
29
|
+
...i,
|
|
30
|
+
from: u.ast,
|
|
31
|
+
to: c.ast
|
|
32
32
|
};
|
|
33
|
-
return
|
|
33
|
+
return p.make(f);
|
|
34
34
|
}
|
|
35
|
-
if (
|
|
36
|
-
const o =
|
|
37
|
-
const
|
|
38
|
-
let
|
|
39
|
-
if (
|
|
40
|
-
const
|
|
41
|
-
|
|
35
|
+
if (i._tag === "TypeLiteral") {
|
|
36
|
+
const o = i.propertySignatures.map((u) => {
|
|
37
|
+
const c = u.type;
|
|
38
|
+
let f = c;
|
|
39
|
+
if (c._tag === "TypeLiteral" || c._tag === "Union" || c._tag === "Transformation") {
|
|
40
|
+
const k = p.make(c);
|
|
41
|
+
f = _(k).ast;
|
|
42
42
|
}
|
|
43
43
|
return {
|
|
44
|
-
...
|
|
45
|
-
type:
|
|
44
|
+
...u,
|
|
45
|
+
type: f,
|
|
46
46
|
isOptional: !0
|
|
47
47
|
};
|
|
48
|
-
}),
|
|
49
|
-
...
|
|
48
|
+
}), m = {
|
|
49
|
+
...i,
|
|
50
50
|
propertySignatures: o
|
|
51
51
|
};
|
|
52
|
-
return
|
|
52
|
+
return p.make(m);
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return l;
|
|
55
55
|
};
|
|
56
|
-
class
|
|
56
|
+
class le extends z.TaggedError("FormErrors") {
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const M = (l) => function(o) {
|
|
59
59
|
return {
|
|
60
60
|
render() {
|
|
61
|
-
return
|
|
62
|
-
form:
|
|
61
|
+
return q(o, {
|
|
62
|
+
form: l,
|
|
63
63
|
...this.$attrs
|
|
64
64
|
}, this.$slots);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
},
|
|
67
|
+
}, ce = (l) => function(o) {
|
|
68
68
|
return {
|
|
69
69
|
setup() {
|
|
70
|
-
const { fieldMap:
|
|
71
|
-
const
|
|
72
|
-
Object.entries(
|
|
73
|
-
([U,
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
76
|
-
const
|
|
77
|
-
return
|
|
78
|
-
label:
|
|
79
|
-
inputId:
|
|
70
|
+
const { fieldMap: m, form: u } = l, c = u.useStore((S) => S.errors), f = u.useStore((S) => S.fieldMeta), k = u.useStore((S) => S.errorMap), h = V(() => {
|
|
71
|
+
const S = g.filterMap(
|
|
72
|
+
Object.entries(f.value),
|
|
73
|
+
([U, w]) => {
|
|
74
|
+
const a = w.errors ?? [];
|
|
75
|
+
if (!a.length) return x.none();
|
|
76
|
+
const v = m.value.get(U);
|
|
77
|
+
return v ? x.some({
|
|
78
|
+
label: v.label,
|
|
79
|
+
inputId: v.id,
|
|
80
80
|
// Only show the first error
|
|
81
|
-
errors: [
|
|
82
|
-
}) :
|
|
81
|
+
errors: [a[0]?.message].filter(Boolean)
|
|
82
|
+
}) : x.none();
|
|
83
83
|
}
|
|
84
84
|
), F = [];
|
|
85
|
-
if (
|
|
86
|
-
for (const [U,
|
|
87
|
-
if (g.isArray(
|
|
88
|
-
for (const
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
85
|
+
if (k.value.onSubmit) {
|
|
86
|
+
for (const [U, w] of Object.entries(k.value.onSubmit))
|
|
87
|
+
if (g.isArray(w) && w.length)
|
|
88
|
+
for (const a of w) {
|
|
89
|
+
const v = a;
|
|
90
|
+
if (v?.path && g.isArray(v.path) && v.path.length) {
|
|
91
|
+
const A = v.path.join(".");
|
|
92
|
+
if (!m.value.has(A)) {
|
|
93
93
|
F.push({
|
|
94
|
-
label:
|
|
95
|
-
inputId:
|
|
96
|
-
errors: [
|
|
94
|
+
label: A,
|
|
95
|
+
inputId: A,
|
|
96
|
+
errors: [v.message].filter(Boolean)
|
|
97
97
|
});
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
return [...
|
|
103
|
+
return [...S, ...F];
|
|
104
104
|
});
|
|
105
105
|
return {
|
|
106
|
-
generalErrors:
|
|
107
|
-
errors:
|
|
106
|
+
generalErrors: c,
|
|
107
|
+
errors: h
|
|
108
108
|
};
|
|
109
109
|
},
|
|
110
|
-
render({ errors:
|
|
111
|
-
return
|
|
112
|
-
errors:
|
|
113
|
-
generalErrors:
|
|
110
|
+
render({ errors: m, generalErrors: u }) {
|
|
111
|
+
return q(o, {
|
|
112
|
+
errors: m,
|
|
113
|
+
generalErrors: u,
|
|
114
114
|
...this.$attrs
|
|
115
115
|
}, this.$slots);
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
|
-
},
|
|
119
|
-
if (!
|
|
120
|
-
const
|
|
118
|
+
}, Ae = (l, i, o) => {
|
|
119
|
+
if (!l) throw new Error("Schema is required");
|
|
120
|
+
const m = p.standardSchemaV1(l), u = p.decode(l), { meta: c } = ne(l), f = V(() => {
|
|
121
121
|
if (o?.persistency?.id)
|
|
122
122
|
return o.persistency.id;
|
|
123
|
-
const e = window.location.pathname, t = Object.keys(
|
|
123
|
+
const e = window.location.pathname, t = Object.keys(c);
|
|
124
124
|
return `${e}-${t.join("-")}`;
|
|
125
|
-
}),
|
|
125
|
+
}), k = () => {
|
|
126
126
|
const e = new URLSearchParams(window.location.search);
|
|
127
|
-
e.delete(
|
|
127
|
+
e.delete(f.value);
|
|
128
128
|
const t = new URL(window.location.href);
|
|
129
129
|
t.search = e.toString(), window.history.replaceState({}, "", t.toString());
|
|
130
130
|
};
|
|
131
|
-
function
|
|
131
|
+
function h(e, t) {
|
|
132
132
|
for (const r in t)
|
|
133
|
-
g.isArray(t[r]) ? e[r] = t[r] : t[r] &&
|
|
133
|
+
g.isArray(t[r]) ? e[r] = t[r] : t[r] && X(t[r]) ? (e[r] || (e[r] = {}), h(e[r], t[r])) : e[r] = t[r];
|
|
134
134
|
return e;
|
|
135
135
|
}
|
|
136
|
-
const
|
|
137
|
-
if (!e) return;
|
|
138
|
-
const t = { ...e }, r = (s, a) => a.split(".").reduce((l, E) => l?.[E], s), n = (s, a, l) => {
|
|
139
|
-
const E = a.split("."), N = E.pop(), X = E.reduce((L, O) => (L[O] || (L[O] = {}), L[O]), s);
|
|
140
|
-
X[N] = l;
|
|
141
|
-
};
|
|
142
|
-
for (const s in u) {
|
|
143
|
-
const a = u[s], l = r(t, s), N = (l == null || l === !1 || l === "" || Number.isNaN(l)) && l !== !1 && l !== 0;
|
|
144
|
-
a && !a.required && a.nullableOrUndefined && a.type !== "boolean" && (l === void 0 || N) && n(t, s, a.nullableOrUndefined === "undefined" ? void 0 : null);
|
|
145
|
-
}
|
|
146
|
-
return t;
|
|
147
|
-
}, F = (e) => {
|
|
136
|
+
const S = (e) => {
|
|
148
137
|
const t = {};
|
|
149
138
|
if (typeof e?.make == "function")
|
|
150
139
|
try {
|
|
151
140
|
return e.make({});
|
|
152
141
|
} catch {
|
|
153
142
|
}
|
|
154
|
-
const r = e?.members || (e?.ast?._tag === "Union" && e.ast.types ? e.ast.types.map((n) =>
|
|
143
|
+
const r = e?.members || (e?.ast?._tag === "Union" && e.ast.types ? e.ast.types.map((n) => p.make(n)) : null);
|
|
155
144
|
if (r && g.isArray(r)) {
|
|
156
145
|
for (const n of r) {
|
|
157
|
-
const s =
|
|
146
|
+
const s = S(n);
|
|
158
147
|
if (Object.keys(s).length > 0 && n?.fields && Object.entries(n.fields).some(
|
|
159
|
-
([
|
|
148
|
+
([y, R]) => y === "_tag" || y === "type" || y === "kind" ? R?.ast?.defaultValue !== void 0 : !1
|
|
160
149
|
))
|
|
161
150
|
return s;
|
|
162
151
|
}
|
|
@@ -166,30 +155,41 @@ const D = (f) => function(o) {
|
|
|
166
155
|
for (const [n, s] of Object.entries(e.fields)) {
|
|
167
156
|
if (s?.ast?.defaultValue)
|
|
168
157
|
try {
|
|
169
|
-
const
|
|
170
|
-
|
|
158
|
+
const y = s.ast.defaultValue();
|
|
159
|
+
t[n] = y;
|
|
171
160
|
} catch {
|
|
172
161
|
}
|
|
173
|
-
|
|
174
|
-
|
|
162
|
+
else {
|
|
163
|
+
const y = s.ast;
|
|
164
|
+
switch (se(y)) {
|
|
165
|
+
case "null":
|
|
166
|
+
t[n] = null;
|
|
167
|
+
break;
|
|
168
|
+
case "undefined":
|
|
169
|
+
t[n] = void 0;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const d = S(s);
|
|
174
|
+
Object.keys(d).length > 0 && (t[n] && typeof t[n] == "object" ? Object.assign(t[n], d) : t[n] || (t[n] = d));
|
|
175
175
|
}
|
|
176
176
|
return t;
|
|
177
|
-
},
|
|
177
|
+
}, F = (e = {}) => {
|
|
178
178
|
let t = {};
|
|
179
179
|
try {
|
|
180
|
-
const r =
|
|
181
|
-
t =
|
|
180
|
+
const r = l.make(e);
|
|
181
|
+
t = p.encodeSync(_(l))(r);
|
|
182
182
|
} catch (r) {
|
|
183
183
|
window.location.hostname === "localhost" && console.warn("schema.make() failed, extracting defaults from AST:", r);
|
|
184
184
|
try {
|
|
185
|
-
const n =
|
|
186
|
-
t =
|
|
185
|
+
const n = S(l);
|
|
186
|
+
t = p.encodeSync(_(l))(n);
|
|
187
187
|
} catch (n) {
|
|
188
188
|
window.location.hostname === "localhost" && console.warn("Could not extract defaults from AST:", n);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
return
|
|
192
|
-
},
|
|
191
|
+
return h(t, e);
|
|
192
|
+
}, U = V(() => {
|
|
193
193
|
let e;
|
|
194
194
|
const t = o?.persistency;
|
|
195
195
|
if (
|
|
@@ -200,132 +200,130 @@ const D = (f) => function(o) {
|
|
|
200
200
|
if (r)
|
|
201
201
|
try {
|
|
202
202
|
const n = JSON.parse(
|
|
203
|
-
r.getItem(
|
|
203
|
+
r.getItem(f.value) || "{}"
|
|
204
204
|
);
|
|
205
|
-
r.removeItem(
|
|
205
|
+
r.removeItem(f.value), e = n;
|
|
206
206
|
} catch (n) {
|
|
207
207
|
console.error(n);
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
if (t?.policies && t.policies.includes("querystring"))
|
|
211
211
|
try {
|
|
212
|
-
const n = new URLSearchParams(window.location.search).get(
|
|
213
|
-
|
|
212
|
+
const n = new URLSearchParams(window.location.search).get(f.value);
|
|
213
|
+
k(), n && (e = h(e || {}, JSON.parse(n)));
|
|
214
214
|
} catch (r) {
|
|
215
215
|
console.error(r);
|
|
216
216
|
}
|
|
217
|
-
return e ??= {},
|
|
218
|
-
|
|
219
|
-
o?.persistency?.overrideDefaultValues ? b(c?.defaultValues || {}, e) : b(e, c?.defaultValues || {})
|
|
220
|
-
)
|
|
217
|
+
return e ??= {}, F(
|
|
218
|
+
o?.persistency?.overrideDefaultValues ? h(i?.defaultValues || {}, e) : h(e, i?.defaultValues || {})
|
|
221
219
|
);
|
|
222
|
-
}),
|
|
223
|
-
...
|
|
220
|
+
}), w = (e, t) => e ? L.with(J.setSpan(L.active(), e), t) : t(), a = G({
|
|
221
|
+
...i,
|
|
224
222
|
validators: {
|
|
225
|
-
onSubmit:
|
|
226
|
-
...
|
|
223
|
+
onSubmit: m,
|
|
224
|
+
...i?.validators || {}
|
|
227
225
|
},
|
|
228
|
-
onSubmit:
|
|
229
|
-
const n = await
|
|
226
|
+
onSubmit: i?.onSubmit ? ({ formApi: e, meta: t, value: r }) => w(t?.currentSpan, async () => {
|
|
227
|
+
const n = await b.runPromise(u(r)), s = i.onSubmit({
|
|
230
228
|
formApi: e,
|
|
231
229
|
meta: t,
|
|
232
230
|
value: n
|
|
233
231
|
});
|
|
234
|
-
return
|
|
232
|
+
return O.isFiber(s) && O.isRuntimeFiber(s) ? await Q(s) : b.isEffect(s) ? await b.runPromise(
|
|
235
233
|
s.pipe(
|
|
236
234
|
// meta?.currentSpan
|
|
237
235
|
// ? Effect.withParentSpan(meta.currentSpan)
|
|
238
236
|
// : (_) => _,
|
|
239
|
-
|
|
237
|
+
b.flatMap((d) => O.join(d))
|
|
240
238
|
)
|
|
241
239
|
) : s;
|
|
242
240
|
}) : void 0,
|
|
243
|
-
defaultValues:
|
|
244
|
-
}),
|
|
245
|
-
Object.keys(
|
|
246
|
-
|
|
241
|
+
defaultValues: U.value
|
|
242
|
+
}), v = () => {
|
|
243
|
+
Object.keys(c).forEach((e) => {
|
|
244
|
+
a.setFieldValue(e, void 0);
|
|
247
245
|
});
|
|
248
|
-
},
|
|
246
|
+
}, A = (e) => e.reduce((t, r) => {
|
|
249
247
|
const n = r.split(".");
|
|
250
|
-
return n.reduce((s,
|
|
251
|
-
}, {}),
|
|
248
|
+
return n.reduce((s, d, y) => (y === n.length - 1 ? s[d] = a.getFieldValue(r) : s[d] = s[d] ?? {}, s[d]), t), t;
|
|
249
|
+
}, {}), j = (e) => {
|
|
252
250
|
if (e) {
|
|
253
251
|
if (g.isArray(e.keys))
|
|
254
|
-
return
|
|
252
|
+
return A(e.keys);
|
|
255
253
|
if (g.isArray(e.banKeys)) {
|
|
256
|
-
const t = Object.keys(
|
|
257
|
-
return
|
|
254
|
+
const t = Object.keys(c).filter((r) => e.banKeys?.includes(r));
|
|
255
|
+
return A(t);
|
|
258
256
|
}
|
|
259
|
-
return
|
|
257
|
+
return a.store.state.values;
|
|
260
258
|
}
|
|
261
|
-
},
|
|
259
|
+
}, D = () => {
|
|
262
260
|
const e = o?.persistency;
|
|
263
261
|
if (!(!e?.policies || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
|
|
264
262
|
const t = e.policies.includes("local") ? localStorage : sessionStorage;
|
|
265
263
|
if (!t) return;
|
|
266
|
-
const r =
|
|
267
|
-
return t.setItem(
|
|
264
|
+
const r = j(e);
|
|
265
|
+
return t.setItem(f.value, JSON.stringify(r));
|
|
268
266
|
}
|
|
269
|
-
},
|
|
267
|
+
}, T = () => {
|
|
270
268
|
const e = o?.persistency;
|
|
271
269
|
if (!(!e?.policies || e.policies.length === 0) && e.policies.includes("querystring")) {
|
|
272
|
-
const t =
|
|
273
|
-
r.set(
|
|
270
|
+
const t = j(e), r = new URLSearchParams(window.location.search);
|
|
271
|
+
r.set(f.value, JSON.stringify(t));
|
|
274
272
|
const n = new URL(window.location.href);
|
|
275
273
|
n.search = r.toString(), window.history.replaceState({}, "", n.toString());
|
|
276
274
|
}
|
|
277
|
-
},
|
|
278
|
-
|
|
275
|
+
}, I = (e) => {
|
|
276
|
+
a.store.state.isDirty && e.preventDefault();
|
|
279
277
|
};
|
|
280
|
-
if (
|
|
281
|
-
window.addEventListener("beforeunload",
|
|
282
|
-
}),
|
|
283
|
-
window.removeEventListener("beforeunload",
|
|
278
|
+
if (W(D), Y(() => {
|
|
279
|
+
window.addEventListener("beforeunload", D), window.addEventListener("blur", T), o?.preventWindowExit && o.preventWindowExit !== "nope" && window.addEventListener("beforeunload", I);
|
|
280
|
+
}), Z(() => {
|
|
281
|
+
window.removeEventListener("beforeunload", D), window.removeEventListener("blur", T), o?.preventWindowExit && o.preventWindowExit !== "nope" && window.removeEventListener("beforeunload", I);
|
|
284
282
|
}), o?.preventWindowExit === "prevent-and-reset") {
|
|
285
|
-
const e =
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
const e = a.useStore((s) => s.isSubmitting), t = a.useStore((s) => s.submissionAttempts), r = a.useStore((s) => s.canSubmit), n = a.useStore((s) => s.values);
|
|
284
|
+
H([e, t], ([s, d], [y]) => {
|
|
285
|
+
y && !s && d > 0 && r.value && a.reset(n.value);
|
|
288
286
|
});
|
|
289
287
|
}
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
(t) =>
|
|
288
|
+
const $ = (e) => b.currentSpan.pipe(
|
|
289
|
+
b.option,
|
|
290
|
+
b.flatMap(
|
|
291
|
+
(t) => b.promise(() => a.handleSubmit(x.isSome(t) ? { currentSpan: t.value, ...e } : e))
|
|
294
292
|
)
|
|
295
|
-
),
|
|
296
|
-
const t =
|
|
293
|
+
), B = (e) => e?.checkErrors ? $(e?.meta).pipe(b.flatMap(b.fnUntraced(function* () {
|
|
294
|
+
const t = a.getAllErrors();
|
|
297
295
|
if (Object.keys(t.fields).length || t.form.errors.length)
|
|
298
|
-
return yield* new
|
|
299
|
-
}))) :
|
|
296
|
+
return yield* new le({ form: t.form, fields: t.fields });
|
|
297
|
+
}))) : $(e?.meta), K = a.handleSubmit, P = C(/* @__PURE__ */ new Map()), E = Object.assign(a, {
|
|
300
298
|
i18nNamespace: o?.i18nNamespace,
|
|
301
299
|
ignorePreventCloseEvents: o?.ignorePreventCloseEvents,
|
|
302
|
-
meta:
|
|
303
|
-
clear:
|
|
300
|
+
meta: c,
|
|
301
|
+
clear: v,
|
|
304
302
|
handleSubmit: (e) => {
|
|
305
|
-
const t =
|
|
306
|
-
return
|
|
303
|
+
const t = J.getSpan(L.active());
|
|
304
|
+
return K({ currentSpan: t, ...e });
|
|
307
305
|
},
|
|
308
306
|
// /** @experimental */
|
|
309
|
-
handleSubmitEffect:
|
|
307
|
+
handleSubmitEffect: B,
|
|
310
308
|
registerField: (e) => {
|
|
311
|
-
|
|
309
|
+
H(e, (t) => P.value.set(t.name, { label: t.label, id: t.id }), { immediate: !0 }), W(() => P.value.delete(e.value.name));
|
|
312
310
|
}
|
|
313
|
-
}),
|
|
314
|
-
return Object.assign(
|
|
311
|
+
}), N = { form: E, fieldMap: P };
|
|
312
|
+
return Object.assign(E, {
|
|
315
313
|
// Type-level properties for performance optimization (not used at runtime)
|
|
316
314
|
_paths: void 0,
|
|
317
315
|
_keys: void 0,
|
|
318
|
-
errorContext:
|
|
319
|
-
Form:
|
|
320
|
-
Input:
|
|
321
|
-
TaggedUnion:
|
|
322
|
-
Field:
|
|
323
|
-
Errors:
|
|
324
|
-
Array:
|
|
325
|
-
AutoGen:
|
|
316
|
+
errorContext: N,
|
|
317
|
+
Form: M(E)(ae),
|
|
318
|
+
Input: M(E)(o?.input ?? oe),
|
|
319
|
+
TaggedUnion: M(E)(ie),
|
|
320
|
+
Field: a.Field,
|
|
321
|
+
Errors: ce(N)(re),
|
|
322
|
+
Array: M(E)(ee),
|
|
323
|
+
AutoGen: M(E)(te)
|
|
326
324
|
});
|
|
327
325
|
};
|
|
328
326
|
export {
|
|
329
|
-
|
|
330
|
-
|
|
327
|
+
le as FormErrors,
|
|
328
|
+
Ae as useOmegaForm
|
|
331
329
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Exit as c, Runtime as u } from "effect";
|
|
2
|
-
import { dual as n, isFunction as m } from "./vue-components.
|
|
2
|
+
import { dual as n, isFunction as m } from "./vue-components.es30.js";
|
|
3
3
|
const i = Symbol.for("clone-trait"), a = n(2, (e, t) => i in e ? e[i](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(e)));
|
|
4
4
|
n(2, (e, t) => a(e, { ...e, ...m(t) ? t(e) : t }));
|
|
5
5
|
const p = (e, t) => new Promise((o, s) => e.addObserver((r) => {
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { default as a } from "./vue-components.es4.js";
|
|
2
2
|
import { default as r } from "./vue-components.es5.js";
|
|
3
|
-
import { createMeta as n, duplicateSchema as u, generateInputStandardSchemaFromFieldMeta as
|
|
4
|
-
import { useOmegaForm as
|
|
5
|
-
import { default as
|
|
3
|
+
import { createMeta as n, duplicateSchema as u, generateInputStandardSchemaFromFieldMeta as f, generateMetaFromSchema as l, getInputType as p, isNullableOrUndefined as d, nullableInput as s } from "./vue-components.es12.js";
|
|
4
|
+
import { useOmegaForm as x } from "./vue-components.es10.js";
|
|
5
|
+
import { default as I } from "./vue-components.es6.js";
|
|
6
6
|
import { default as c } from "./vue-components.es7.js";
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
7
|
+
import { default as h } from "./vue-components.es8.js";
|
|
8
|
+
import { default as S } from "./vue-components.es9.js";
|
|
9
9
|
import { useOnClose as M, usePreventClose as T } from "./vue-components.es11.js";
|
|
10
10
|
import { createUseFormWithCustomInput as y } from "./vue-components.es13.js";
|
|
11
11
|
export {
|
|
12
12
|
a as CommandButton,
|
|
13
13
|
r as Dialog,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
I as OmegaInput,
|
|
15
|
+
h as OmegaTaggedUnion,
|
|
16
|
+
S as OmegaTaggedUnionInternal,
|
|
17
17
|
c as OmegaVuetifyInput,
|
|
18
18
|
n as createMeta,
|
|
19
19
|
y as createUseFormWithCustomInput,
|
|
20
20
|
u as duplicateSchema,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
d as
|
|
25
|
-
s as
|
|
21
|
+
f as generateInputStandardSchemaFromFieldMeta,
|
|
22
|
+
l as generateMetaFromSchema,
|
|
23
|
+
p as getInputType,
|
|
24
|
+
d as isNullableOrUndefined,
|
|
25
|
+
s as nullableInput,
|
|
26
|
+
x as useOmegaForm,
|
|
26
27
|
M as useOnClose,
|
|
27
28
|
T as usePreventClose
|
|
28
29
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");if(a.appendChild(document.createTextNode(".v-enter-from[data-v-d4ffe76f],.v-leave-to[data-v-d4ffe76f]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-d4ffe76f],.v-leave-active[data-v-d4ffe76f]{display:grid;transition:all .15s}.v-enter-to[data-v-d4ffe76f],.v-leave-from[data-v-d4ffe76f]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-d4ffe76f]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-d4ffe76f]{min-height:0}.error-list[data-v-d4ffe76f]{list-style-position:inside}div.error-list[data-v-d4ffe76f]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:auto 1fr}.error-link[data-v-d4ffe76f]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:1fr}.error-message[data-v-d4ffe76f]{grid-column:1 / -1}}.error-item[data-v-d4ffe76f]{display:contents}a[data-v-d4ffe76f]{min-width:min-content}.error-link[data-v-d4ffe76f]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),document.head.appendChild(a),window.customElements){const e=window.customElements.define;window.customElements.define=function(r,t){const i=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(i&&i.call(this),this.shadowRoot){const d=document.createElement("style");d.appendChild(document.createTextNode(".v-enter-from[data-v-d4ffe76f],.v-leave-to[data-v-d4ffe76f]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-d4ffe76f],.v-leave-active[data-v-d4ffe76f]{display:grid;transition:all .15s}.v-enter-to[data-v-d4ffe76f],.v-leave-from[data-v-d4ffe76f]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-d4ffe76f]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-d4ffe76f]{min-height:0}.error-list[data-v-d4ffe76f]{list-style-position:inside}div.error-list[data-v-d4ffe76f]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:auto 1fr}.error-link[data-v-d4ffe76f]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:1fr}.error-message[data-v-d4ffe76f]{grid-column:1 / -1}}.error-item[data-v-d4ffe76f]{display:contents}a[data-v-d4ffe76f]{min-width:min-content}.error-link[data-v-d4ffe76f]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),this.shadowRoot.appendChild(d)}},e.call(window.customElements,r,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import r from "./vue-components.
|
|
2
|
+
import r from "./vue-components.es33.js";
|
|
3
3
|
|
|
4
|
-
import o from "./vue-components.
|
|
4
|
+
import o from "./vue-components.es35.js";
|
|
5
5
|
const e = /* @__PURE__ */ o(r, [["__scopeId", "data-v-d4ffe76f"]]);
|
|
6
6
|
export {
|
|
7
7
|
e as default
|