@effect-app/vue-components 4.0.0-beta.13 → 4.0.0-beta.15
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/vue-components.es10.js +7 -7
- package/dist/vue-components.es11.js +2 -2
- package/dist/vue-components.es12.js +19 -19
- package/dist/vue-components.es16.js +11 -4
- package/dist/vue-components.es17.js +4 -11
- package/dist/vue-components.es18.js +11 -55
- package/dist/vue-components.es19.js +49 -48
- package/dist/vue-components.es20.js +54 -6
- package/dist/vue-components.es21.js +5 -5
- package/dist/vue-components.es22.js +6 -3
- package/dist/vue-components.es23.js +3 -3
- package/dist/vue-components.es24.js +3 -2
- package/dist/vue-components.es25.js +1 -1
- package/dist/vue-components.es26.js +1 -1
- package/dist/vue-components.es27.js +1 -1
- package/dist/vue-components.es28.js +2 -17
- package/dist/vue-components.es29.js +16 -10
- package/dist/vue-components.es32.js +1 -1
- package/dist/vue-components.es33.js +1 -1
- package/dist/vue-components.es5.js +1 -1
- package/package.json +3 -3
- package/src/components/OmegaForm/OmegaFormStuff.ts +4 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useForm as K } from "@tanstack/vue-form";
|
|
2
2
|
import { Data as T, S as I, Effect as m, Fiber as V, Option as z, Array as P } from "effect-app";
|
|
3
|
-
import { runtimeFiberAsPromise as W } from "./vue-components.
|
|
3
|
+
import { runtimeFiberAsPromise as W } from "./vue-components.es18.js";
|
|
4
4
|
import { computed as $, onUnmounted as D, onMounted as G, onBeforeUnmount as Z, watch as R, ref as Q, h as J } from "vue";
|
|
5
5
|
import { useIntl as X } from "./vue-components.es3.js";
|
|
6
|
-
import Y from "./vue-components.
|
|
7
|
-
import C from "./vue-components.
|
|
8
|
-
import ee from "./vue-components.
|
|
6
|
+
import Y from "./vue-components.es19.js";
|
|
7
|
+
import C from "./vue-components.es20.js";
|
|
8
|
+
import ee from "./vue-components.es21.js";
|
|
9
9
|
import { generateMetaFromSchema as re, deepMerge as N, defaultsValueFromSchema as te } from "./vue-components.es12.js";
|
|
10
10
|
import se from "./vue-components.es6.js";
|
|
11
11
|
import ne from "./vue-components.es8.js";
|
|
12
|
-
import oe from "./vue-components.
|
|
13
|
-
import { trace as H } from "./vue-components.
|
|
14
|
-
import { context as _ } from "./vue-components.
|
|
12
|
+
import oe from "./vue-components.es22.js";
|
|
13
|
+
import { trace as H } from "./vue-components.es23.js";
|
|
14
|
+
import { context as _ } from "./vue-components.es24.js";
|
|
15
15
|
class ie extends T.TaggedError("FormErrors") {
|
|
16
16
|
}
|
|
17
17
|
const M = (a) => function(s) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import l from "./vue-components.
|
|
1
|
+
import l from "./vue-components.es29.js";
|
|
2
2
|
import { inject as c, provide as u } from "vue";
|
|
3
|
-
import { onMountedWithCleanup as f } from "./vue-components.
|
|
3
|
+
import { onMountedWithCleanup as f } from "./vue-components.es16.js";
|
|
4
4
|
const p = () => l(), i = /* @__PURE__ */ Symbol("DialogBus"), r = () => c(i, null), g = () => {
|
|
5
5
|
const n = p();
|
|
6
6
|
return u(i, n), n;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { S as i, Effect as F, Option as U } from "effect-app";
|
|
2
2
|
import { useIntl as _, getTransformationFrom as q } from "./vue-components.es3.js";
|
|
3
|
-
import { isObject as P } from "./vue-components.
|
|
3
|
+
import { isObject as P } from "./vue-components.es17.js";
|
|
4
4
|
const b = (e) => {
|
|
5
5
|
let t = q(e);
|
|
6
6
|
for (; i.AST.isDeclaration(t) && t.typeParameters.length > 0; )
|
|
7
7
|
t = q(t.typeParameters[0]);
|
|
8
8
|
return t;
|
|
9
|
-
},
|
|
9
|
+
}, k = (e) => i.AST.isUndefined(e) || i.AST.isNull(e), D = (e) => i.AST.isUnion(e) ? e.types.find((t) => k(t)) : !1, g = (e) => !e || !i.AST.isUnion(e) ? !1 : e.types.find((t) => i.AST.isUndefined(t)) ? "undefined" : e.types.find((t) => i.AST.isNull(t)) ? "null" : !1, j = (e) => {
|
|
10
10
|
const t = [];
|
|
11
11
|
for (const n of e)
|
|
12
12
|
if (i.AST.isUnion(n)) {
|
|
@@ -15,7 +15,7 @@ const b = (e) => {
|
|
|
15
15
|
} else
|
|
16
16
|
t.push(n);
|
|
17
17
|
return t;
|
|
18
|
-
}, V = (e) => j(e).map(b).filter((t) => !
|
|
18
|
+
}, V = (e) => j(e).map(b).filter((t) => !k(t)), I = (e) => {
|
|
19
19
|
const t = i.AST.resolve(e)?.jsonSchema;
|
|
20
20
|
return t && typeof t == "object" ? t : {};
|
|
21
21
|
}, w = (e) => {
|
|
@@ -122,7 +122,7 @@ const b = (e) => {
|
|
|
122
122
|
const S = b(p.rest[0]);
|
|
123
123
|
if (i.AST.isObjects(S))
|
|
124
124
|
for (const y of S.propertySignatures) {
|
|
125
|
-
const A = `${l}.${y.name.toString()}`,
|
|
125
|
+
const A = `${l}.${y.name.toString()}`, h = d({
|
|
126
126
|
parent: A,
|
|
127
127
|
property: y.type,
|
|
128
128
|
meta: {
|
|
@@ -130,7 +130,7 @@ const b = (e) => {
|
|
|
130
130
|
nullableOrUndefined: g(y.type)
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
if (
|
|
133
|
+
if (h && typeof h == "object" && "type" in h && (o[A] = h, h.type === "multiple" && i.AST.isArrays(y.type) && y.type.rest && y.type.rest.length > 0)) {
|
|
134
134
|
const L = b(y.type.rest[0]);
|
|
135
135
|
if (i.AST.isObjects(L))
|
|
136
136
|
for (const v of L.propertySignatures) {
|
|
@@ -167,15 +167,15 @@ const b = (e) => {
|
|
|
167
167
|
);
|
|
168
168
|
else if (i.AST.isArrays(s.type))
|
|
169
169
|
if (s.type.rest.length > 0 && i.AST.isObjects(b(s.type.rest[0]))) {
|
|
170
|
-
const
|
|
171
|
-
if (i.AST.isObjects(
|
|
172
|
-
for (const f of
|
|
170
|
+
const T = b(s.type.rest[0]);
|
|
171
|
+
if (i.AST.isObjects(T))
|
|
172
|
+
for (const f of T.propertySignatures) {
|
|
173
173
|
const p = `${l}.${f.name.toString()}`;
|
|
174
174
|
if (i.AST.isArrays(f.type) && f.type.rest.length > 0) {
|
|
175
175
|
const S = b(f.type.rest[0]);
|
|
176
176
|
if (i.AST.isObjects(S))
|
|
177
177
|
for (const y of S.propertySignatures) {
|
|
178
|
-
const A = `${p}.${y.name.toString()}`,
|
|
178
|
+
const A = `${p}.${y.name.toString()}`, h = d({
|
|
179
179
|
parent: A,
|
|
180
180
|
property: y.type,
|
|
181
181
|
meta: {
|
|
@@ -183,7 +183,7 @@ const b = (e) => {
|
|
|
183
183
|
nullableOrUndefined: g(y.type)
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
|
-
o[A] =
|
|
186
|
+
o[A] = h;
|
|
187
187
|
}
|
|
188
188
|
else
|
|
189
189
|
o[p] = {
|
|
@@ -232,12 +232,12 @@ const b = (e) => {
|
|
|
232
232
|
if (n) {
|
|
233
233
|
const s = D(n);
|
|
234
234
|
if (n = b(n), Object.hasOwnProperty.call(e, "required") || (e.required = !s), i.AST.isUnion(n)) {
|
|
235
|
-
const l = j(n.types).map(b), a = l.find((u) => !
|
|
235
|
+
const l = j(n.types).map(b), a = l.find((u) => !k(u));
|
|
236
236
|
return i.AST.isObjects(a) ? d({
|
|
237
237
|
propertySignatures: a.propertySignatures,
|
|
238
238
|
parent: t,
|
|
239
239
|
meta: e
|
|
240
|
-
}) : l.every((u) =>
|
|
240
|
+
}) : l.every((u) => k(u) || i.AST.isLiteral(u)) ? {
|
|
241
241
|
...e,
|
|
242
242
|
type: "select",
|
|
243
243
|
members: l.filter(i.AST.isLiteral).map((u) => u.literal)
|
|
@@ -278,10 +278,10 @@ const b = (e) => {
|
|
|
278
278
|
);
|
|
279
279
|
let c = null;
|
|
280
280
|
m && i.AST.isLiteral(m.type) && (c = m.type.literal, a.push(c));
|
|
281
|
-
const
|
|
281
|
+
const T = d({
|
|
282
282
|
propertySignatures: u.propertySignatures
|
|
283
283
|
});
|
|
284
|
-
c && (o[c] = $(
|
|
284
|
+
c && (o[c] = $(T)), Object.assign(n, T);
|
|
285
285
|
}
|
|
286
286
|
return a.length > 0 && (n._tag = {
|
|
287
287
|
type: "select",
|
|
@@ -410,7 +410,7 @@ function R(e, t) {
|
|
|
410
410
|
Array.isArray(t[r]) ? n[r] = t[r] : t[r] && P(t[r]) ? n[r] = R(n[r], t[r]) : n[r] = t[r];
|
|
411
411
|
return n;
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function M(e) {
|
|
414
414
|
return e && "fields" in e && typeof e.fields == "object";
|
|
415
415
|
}
|
|
416
416
|
function C(e) {
|
|
@@ -423,7 +423,7 @@ const O = (e, t = {}) => {
|
|
|
423
423
|
if (g(e.ast) === "null")
|
|
424
424
|
return null;
|
|
425
425
|
if (g(e.ast) !== "undefined") {
|
|
426
|
-
if (
|
|
426
|
+
if (M(e)) {
|
|
427
427
|
const o = {};
|
|
428
428
|
for (const [s, l] of Object.entries(e.fields)) {
|
|
429
429
|
const a = l?.ast;
|
|
@@ -438,14 +438,14 @@ const O = (e, t = {}) => {
|
|
|
438
438
|
}
|
|
439
439
|
return { ...o, ...t };
|
|
440
440
|
}
|
|
441
|
-
if (e?.from &&
|
|
441
|
+
if (e?.from && M(e.from))
|
|
442
442
|
return O(e.from, t);
|
|
443
443
|
if (C(e)) {
|
|
444
|
-
const o = e.members.reduce((s, l) => (
|
|
444
|
+
const o = e.members.reduce((s, l) => (M(l) && Object.entries(l.fields).forEach(([a, u]) => {
|
|
445
445
|
const m = u.ast, c = s[a]?.ast;
|
|
446
446
|
(!s[a] || m?.defaultValue && !c?.defaultValue) && (s[a] = u);
|
|
447
447
|
}), s), {});
|
|
448
|
-
return Object.entries(o).reduce((s, [l, a]) => (s[l] = O(a, t[l] || {}), s), t);
|
|
448
|
+
return Object.keys(o).length === 0 ? Object.keys(t).length > 0 ? t : void 0 : Object.entries(o).reduce((s, [l, a]) => (s[l] = O(a, t[l] || {}), s), t);
|
|
449
449
|
}
|
|
450
450
|
if (Object.keys(t).length === 0) {
|
|
451
451
|
if (i.AST.isObjects(n)) {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import "vue";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { onMounted as e, onUnmounted as u } from "vue";
|
|
2
|
+
function p(t) {
|
|
3
|
+
let n;
|
|
4
|
+
e(() => {
|
|
5
|
+
const o = t();
|
|
6
|
+
o && (n = o);
|
|
7
|
+
}), u(() => {
|
|
8
|
+
n && n();
|
|
9
|
+
});
|
|
10
|
+
}
|
|
4
11
|
export {
|
|
5
|
-
|
|
12
|
+
p as onMountedWithCleanup
|
|
6
13
|
};
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const n = /* @__PURE__ */ Symbol.for("clone-trait"), a = i(2, (o, t) => n in o ? o[n](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(o)));
|
|
5
|
-
i(2, (o, t) => a(o, { ...o, ...m(t) ? t(o) : t }));
|
|
6
|
-
const O = (o, t) => new Promise((r, s) => o.addObserver((e) => {
|
|
7
|
-
c.isSuccess(e) ? r(e.value) : s(u.squash(e.cause));
|
|
8
|
-
}));
|
|
1
|
+
import "vue";
|
|
2
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
3
|
+
const t = Object.prototype.toString, c = (o) => t.call(o) === "[object Object]";
|
|
9
4
|
export {
|
|
10
|
-
|
|
11
|
-
n as cloneTrait,
|
|
12
|
-
O as runtimeFiberAsPromise
|
|
5
|
+
c as isObject
|
|
13
6
|
};
|
|
@@ -1,57 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
defaultItems: {},
|
|
10
|
-
items: {}
|
|
11
|
-
},
|
|
12
|
-
setup(n) {
|
|
13
|
-
const a = n, y = a.form.useStore((e) => e.values), i = f(() => {
|
|
14
|
-
const e = a.name.replace(/\[/g, ".").replace(/\]/g, "");
|
|
15
|
-
try {
|
|
16
|
-
return e.split(".").reduce((r, t) => r && r[t], y.value);
|
|
17
|
-
} catch (r) {
|
|
18
|
-
return console.error(r), [];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
M(async () => {
|
|
22
|
-
a.defaultItems && !i.value && a.form.setFieldValue(a.name, a.defaultItems);
|
|
23
|
-
});
|
|
24
|
-
const $ = f(() => (r) => {
|
|
25
|
-
const t = r.replace(/\[\d+\]/g, "");
|
|
26
|
-
return a.form.meta[t];
|
|
27
|
-
});
|
|
28
|
-
return P("getMetaFromArray", $), (e, r) => (s(), c(p(n.form.Field), { name: n.name }, {
|
|
29
|
-
default: g(({ field: t, state: d }) => [
|
|
30
|
-
o(e.$slots, "pre-array", l(u({ field: t, state: d }))),
|
|
31
|
-
(s(!0), k(A, null, C(i.value, (B, m) => (s(), c(p(n.form.Field), {
|
|
32
|
-
key: `${n.name}[${Number(m)}]`,
|
|
33
|
-
name: (
|
|
34
|
-
// eslint-disable-next-line
|
|
35
|
-
`${n.name}[${Number(m)}]`
|
|
36
|
-
)
|
|
37
|
-
}, {
|
|
38
|
-
default: g(({ field: v, state: h }) => [
|
|
39
|
-
o(e.$slots, "default", b({ ref_for: !0 }, {
|
|
40
|
-
subField: v,
|
|
41
|
-
subState: h,
|
|
42
|
-
index: Number(m),
|
|
43
|
-
field: t
|
|
44
|
-
}))
|
|
45
|
-
]),
|
|
46
|
-
_: 2
|
|
47
|
-
}, 1032, ["name"]))), 128)),
|
|
48
|
-
o(e.$slots, "post-array", l(u({ field: t, state: d }))),
|
|
49
|
-
o(e.$slots, "field", l(u({ field: t })))
|
|
50
|
-
]),
|
|
51
|
-
_: 3
|
|
52
|
-
}, 8, ["name"]));
|
|
53
|
-
}
|
|
54
|
-
});
|
|
1
|
+
import { Exit as c, Cause as u } from "effect";
|
|
2
|
+
import { dual as i } from "./vue-components.es30.js";
|
|
3
|
+
import { isFunction as m } from "./vue-components.es31.js";
|
|
4
|
+
const n = /* @__PURE__ */ Symbol.for("clone-trait"), a = i(2, (o, t) => n in o ? o[n](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(o)));
|
|
5
|
+
i(2, (o, t) => a(o, { ...o, ...m(t) ? t(o) : t }));
|
|
6
|
+
const O = (o, t) => new Promise((r, s) => o.addObserver((e) => {
|
|
7
|
+
c.isSuccess(e) ? r(e.value) : s(u.squash(e.cause));
|
|
8
|
+
}));
|
|
55
9
|
export {
|
|
56
|
-
|
|
10
|
+
a as clone,
|
|
11
|
+
n as cloneTrait,
|
|
12
|
+
O as runtimeFiberAsPromise
|
|
57
13
|
};
|
|
@@ -1,56 +1,57 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
__name: "
|
|
1
|
+
import { defineComponent as F, computed as f, onMounted as M, provide as P, createBlock as c, openBlock as s, resolveDynamicComponent as p, withCtx as g, renderSlot as o, createElementBlock as k, normalizeProps as l, guardReactiveProps as u, Fragment as A, renderList as C, mergeProps as b } from "vue";
|
|
2
|
+
const N = /* @__PURE__ */ F({
|
|
3
|
+
inheritAttrs: !1,
|
|
4
|
+
__name: "OmegaArray",
|
|
5
5
|
props: {
|
|
6
6
|
form: {},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
order: {},
|
|
12
|
-
sort: {}
|
|
7
|
+
inputClass: {},
|
|
8
|
+
name: {},
|
|
9
|
+
defaultItems: {},
|
|
10
|
+
items: {}
|
|
13
11
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return t !== !1 && (e[n] = t), e;
|
|
23
|
-
},
|
|
24
|
-
{}
|
|
25
|
-
), c = i, p = (r, s) => {
|
|
26
|
-
const e = s?.indexOf(r) ?? -1;
|
|
27
|
-
return e === -1 ? Number.MAX_SAFE_INTEGER : e;
|
|
28
|
-
}, f = l.mapInput(
|
|
29
|
-
l.Number,
|
|
30
|
-
(r) => p(r.name, c.order || [])
|
|
31
|
-
), m = O(() => {
|
|
32
|
-
const r = a(
|
|
33
|
-
(o, t) => !!o && (c.pick ? c.pick.includes(t) && !c.omit?.includes(t) : !c.omit?.includes(t))
|
|
34
|
-
)(c.form.meta), s = u((o, t) => ({
|
|
35
|
-
name: t,
|
|
36
|
-
label: c.labelMap?.(t) || t,
|
|
37
|
-
...o
|
|
38
|
-
}))(r), e = c.filterMap ? d((o) => {
|
|
39
|
-
const t = c.filterMap?.(o.name, o);
|
|
40
|
-
return t === void 0 || t === !0 ? o : t;
|
|
41
|
-
})(s) : s, n = [...Object.values(e)].sort(f);
|
|
42
|
-
return c.sort ? n.sort(c.sort) : n;
|
|
12
|
+
setup(n) {
|
|
13
|
+
const a = n, y = a.form.useStore((e) => e.values), i = f(() => {
|
|
14
|
+
const e = a.name.replace(/\[/g, ".").replace(/\]/g, "");
|
|
15
|
+
try {
|
|
16
|
+
return e.split(".").reduce((r, t) => r && r[t], y.value);
|
|
17
|
+
} catch (r) {
|
|
18
|
+
return console.error(r), [];
|
|
19
|
+
}
|
|
43
20
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
21
|
+
M(async () => {
|
|
22
|
+
a.defaultItems && !i.value && a.form.setFieldValue(a.name, a.defaultItems);
|
|
23
|
+
});
|
|
24
|
+
const $ = f(() => (r) => {
|
|
25
|
+
const t = r.replace(/\[\d+\]/g, "");
|
|
26
|
+
return a.form.meta[t];
|
|
27
|
+
});
|
|
28
|
+
return P("getMetaFromArray", $), (e, r) => (s(), c(p(n.form.Field), { name: n.name }, {
|
|
29
|
+
default: g(({ field: t, state: d }) => [
|
|
30
|
+
o(e.$slots, "pre-array", l(u({ field: t, state: d }))),
|
|
31
|
+
(s(!0), k(A, null, C(i.value, (B, m) => (s(), c(p(n.form.Field), {
|
|
32
|
+
key: `${n.name}[${Number(m)}]`,
|
|
33
|
+
name: (
|
|
34
|
+
// eslint-disable-next-line
|
|
35
|
+
`${n.name}[${Number(m)}]`
|
|
36
|
+
)
|
|
37
|
+
}, {
|
|
38
|
+
default: g(({ field: v, state: h }) => [
|
|
39
|
+
o(e.$slots, "default", b({ ref_for: !0 }, {
|
|
40
|
+
subField: v,
|
|
41
|
+
subState: h,
|
|
42
|
+
index: Number(m),
|
|
43
|
+
field: t
|
|
44
|
+
}))
|
|
45
|
+
]),
|
|
46
|
+
_: 2
|
|
47
|
+
}, 1032, ["name"]))), 128)),
|
|
48
|
+
o(e.$slots, "post-array", l(u({ field: t, state: d }))),
|
|
49
|
+
o(e.$slots, "field", l(u({ field: t })))
|
|
50
|
+
]),
|
|
51
|
+
_: 3
|
|
52
|
+
}, 8, ["name"]));
|
|
52
53
|
}
|
|
53
54
|
});
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
+
N as default
|
|
56
57
|
};
|
|
@@ -1,8 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { defineComponent as b, computed as O, createElementBlock as j, openBlock as M, Fragment as E, renderList as _, renderSlot as h, createVNode as B, unref as F, mergeProps as N } from "vue";
|
|
2
|
+
import { Order as l } from "effect-app";
|
|
3
|
+
const v = /* @__PURE__ */ b({
|
|
4
|
+
__name: "OmegaAutoGen",
|
|
5
|
+
props: {
|
|
6
|
+
form: {},
|
|
7
|
+
pick: {},
|
|
8
|
+
omit: {},
|
|
9
|
+
labelMap: { type: Function },
|
|
10
|
+
filterMap: { type: Function },
|
|
11
|
+
order: {},
|
|
12
|
+
sort: {}
|
|
13
|
+
},
|
|
14
|
+
setup(i) {
|
|
15
|
+
const u = (r) => (s) => Object.fromEntries(
|
|
16
|
+
Object.entries(s).map(([e, n]) => [e, r(n, e)])
|
|
17
|
+
), a = (r) => (s) => Object.fromEntries(
|
|
18
|
+
Object.entries(s).filter(([e, n]) => r(n, e))
|
|
19
|
+
), d = (r) => (s) => Object.entries(s).reduce(
|
|
20
|
+
(e, [n, o]) => {
|
|
21
|
+
const t = r(o, n);
|
|
22
|
+
return t !== !1 && (e[n] = t), e;
|
|
23
|
+
},
|
|
24
|
+
{}
|
|
25
|
+
), c = i, p = (r, s) => {
|
|
26
|
+
const e = s?.indexOf(r) ?? -1;
|
|
27
|
+
return e === -1 ? Number.MAX_SAFE_INTEGER : e;
|
|
28
|
+
}, f = l.mapInput(
|
|
29
|
+
l.Number,
|
|
30
|
+
(r) => p(r.name, c.order || [])
|
|
31
|
+
), m = O(() => {
|
|
32
|
+
const r = a(
|
|
33
|
+
(o, t) => !!o && (c.pick ? c.pick.includes(t) && !c.omit?.includes(t) : !c.omit?.includes(t))
|
|
34
|
+
)(c.form.meta), s = u((o, t) => ({
|
|
35
|
+
name: t,
|
|
36
|
+
label: c.labelMap?.(t) || t,
|
|
37
|
+
...o
|
|
38
|
+
}))(r), e = c.filterMap ? d((o) => {
|
|
39
|
+
const t = c.filterMap?.(o.name, o);
|
|
40
|
+
return t === void 0 || t === !0 ? o : t;
|
|
41
|
+
})(s) : s, n = [...Object.values(e)].sort(f);
|
|
42
|
+
return c.sort ? n.sort(c.sort) : n;
|
|
43
|
+
});
|
|
44
|
+
return (r, s) => (M(!0), j(E, null, _(m.value, ({ name: e, label: n, ...o }) => h(r.$slots, "default", {
|
|
45
|
+
child: { name: e, label: n, ...o }
|
|
46
|
+
}, () => [
|
|
47
|
+
B(F(i.form).Input, N({
|
|
48
|
+
name: e,
|
|
49
|
+
label: n
|
|
50
|
+
}, { ref_for: !0 }, o), null, 16, ["name", "label"])
|
|
51
|
+
])), 256));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
6
54
|
export {
|
|
7
|
-
|
|
55
|
+
v as default
|
|
8
56
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
import
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");if(a.appendChild(document.createTextNode('.v-enter-from[data-v-6b2bf87e],.v-leave-to[data-v-6b2bf87e]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-6b2bf87e],.v-leave-active[data-v-6b2bf87e]{display:grid;transition:all .15s}.v-enter-to[data-v-6b2bf87e],.v-leave-from[data-v-6b2bf87e]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-6b2bf87e]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-6b2bf87e]{min-height:0}.error-list[data-v-6b2bf87e]{list-style-position:inside}.error-list [data-v-6b2bf87e]::marker{margin:0;padding:0}.error-alert-content[data-v-6b2bf87e]{background-color:var(--error-background, #fff5f5);color:var(--error-color, #c92a2a);padding:1em}.error-link[data-v-6b2bf87e]{font-weight:700;position:relative;color:var(--error-color, #c92a2a);cursor:pointer}.error-link[data-v-6b2bf87e]:after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:rgba(from var(--error-color, #c92a2a) r g b / .5)}.text-h6[data-v-6b2bf87e]{font-weight:700;font-size:1.25em}.error-message[data-v-6b2bf87e]{font-style:italic}.error-item[data-v-6b2bf87e]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-6b2bf87e]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-6b2bf87e]{display:flex;gap:1.5em}.container svg[data-v-6b2bf87e]{width:3em}.container .single-error[data-v-6b2bf87e]{display:inline-block}')),document.head.appendChild(a),window.customElements){const e=window.customElements.define;window.customElements.define=function(i,t){const r=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(r&&r.call(this),this.shadowRoot){const o=document.createElement("style");o.appendChild(document.createTextNode('.v-enter-from[data-v-6b2bf87e],.v-leave-to[data-v-6b2bf87e]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-6b2bf87e],.v-leave-active[data-v-6b2bf87e]{display:grid;transition:all .15s}.v-enter-to[data-v-6b2bf87e],.v-leave-from[data-v-6b2bf87e]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-6b2bf87e]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-6b2bf87e]{min-height:0}.error-list[data-v-6b2bf87e]{list-style-position:inside}.error-list [data-v-6b2bf87e]::marker{margin:0;padding:0}.error-alert-content[data-v-6b2bf87e]{background-color:var(--error-background, #fff5f5);color:var(--error-color, #c92a2a);padding:1em}.error-link[data-v-6b2bf87e]{font-weight:700;position:relative;color:var(--error-color, #c92a2a);cursor:pointer}.error-link[data-v-6b2bf87e]:after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:rgba(from var(--error-color, #c92a2a) r g b / .5)}.text-h6[data-v-6b2bf87e]{font-weight:700;font-size:1.25em}.error-message[data-v-6b2bf87e]{font-style:italic}.error-item[data-v-6b2bf87e]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-6b2bf87e]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-6b2bf87e]{display:flex;gap:1.5em}.container svg[data-v-6b2bf87e]{width:3em}.container .single-error[data-v-6b2bf87e]{display:inline-block}')),this.shadowRoot.appendChild(o)}},e.call(window.customElements,i,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import r from "./vue-components.es34.js";
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import o from "./vue-components.es36.js";
|
|
5
|
+
const m = /* @__PURE__ */ o(r, [["__scopeId", "data-v-6b2bf87e"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode("fieldset[data-v-8c9cb27c]{display:contents}fieldset[disabled][data-v-8c9cb27c]>*{pointer-events:none}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(o,t){const d=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(d&&d.call(this),this.shadowRoot){const c=document.createElement("style");c.appendChild(document.createTextNode("fieldset[data-v-8c9cb27c]{display:contents}fieldset[disabled][data-v-8c9cb27c]>*{pointer-events:none}")),this.shadowRoot.appendChild(c)}},e.call(window.customElements,o,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import o from "./vue-components.es37.js";
|
|
3
|
+
|
|
4
|
+
import m from "./vue-components.es36.js";
|
|
5
|
+
const a = /* @__PURE__ */ m(o, [["__scopeId", "data-v-8c9cb27c"]]);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
a as default
|
|
5
8
|
};
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, f) {
|
|
3
|
-
var i = t.get(e);
|
|
4
|
-
i ? i.push(f) : t.set(e, [f]);
|
|
5
|
-
}, off: function(e, f) {
|
|
6
|
-
var i = t.get(e);
|
|
7
|
-
i && (f ? i.splice(i.indexOf(f) >>> 0, 1) : t.set(e, []));
|
|
8
|
-
}, emit: function(e, f) {
|
|
9
|
-
var i = t.get(e);
|
|
10
|
-
i && i.slice().map(function(a) {
|
|
11
|
-
a(f);
|
|
12
|
-
}), (i = t.get("*")) && i.slice().map(function(a) {
|
|
13
|
-
a(e, f);
|
|
14
|
-
});
|
|
15
|
-
} };
|
|
16
|
-
}
|
|
1
|
+
import f from "./vue-components.es9.js";
|
|
17
2
|
export {
|
|
18
|
-
|
|
3
|
+
f as default
|
|
19
4
|
};
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
function c(t) {
|
|
2
|
+
return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, f) {
|
|
3
|
+
var i = t.get(e);
|
|
4
|
+
i ? i.push(f) : t.set(e, [f]);
|
|
5
|
+
}, off: function(e, f) {
|
|
6
|
+
var i = t.get(e);
|
|
7
|
+
i && (f ? i.splice(i.indexOf(f) >>> 0, 1) : t.set(e, []));
|
|
8
|
+
}, emit: function(e, f) {
|
|
9
|
+
var i = t.get(e);
|
|
10
|
+
i && i.slice().map(function(a) {
|
|
11
|
+
a(f);
|
|
12
|
+
}), (i = t.get("*")) && i.slice().map(function(a) {
|
|
13
|
+
a(e, f);
|
|
14
|
+
});
|
|
15
|
+
} };
|
|
10
16
|
}
|
|
11
17
|
export {
|
|
12
|
-
|
|
18
|
+
c as default
|
|
13
19
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as v, mergeModels as C, useModel as k, useSlots as V, computed as _, resolveComponent as g, createBlock as y, openBlock as B, unref as a, createSlots as E, withCtx as u, renderSlot as d, renderList as M, normalizeProps as S, guardReactiveProps as w } from "vue";
|
|
2
2
|
import { useOnClose as L } from "./vue-components.es11.js";
|
|
3
|
-
import { onMountedWithCleanup as h } from "./vue-components.
|
|
3
|
+
import { onMountedWithCleanup as h } from "./vue-components.es16.js";
|
|
4
4
|
const z = /* @__PURE__ */ v({
|
|
5
5
|
__name: "Dialog",
|
|
6
6
|
props: /* @__PURE__ */ C({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.15",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"effect": "^4.0.0-beta.31",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"highlight.js": "^11.11.1",
|
|
54
54
|
"mitt": "^3.0.1",
|
|
55
55
|
"vue3-highlightjs": "^1.0.5",
|
|
56
|
-
"
|
|
57
|
-
"effect-app": "4.0.0-beta.
|
|
56
|
+
"effect-app": "4.0.0-beta.15",
|
|
57
|
+
"@effect-app/vue": "4.0.0-beta.15"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"check": "vue-tsc",
|
|
@@ -1132,6 +1132,10 @@ export const defaultsValueFromSchema = (
|
|
|
1132
1132
|
return acc
|
|
1133
1133
|
}, {} as Record<string, any>)
|
|
1134
1134
|
|
|
1135
|
+
if (Object.keys(mergedMembers).length === 0) {
|
|
1136
|
+
return Object.keys(record).length > 0 ? record : undefined
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1135
1139
|
// Use reduce to properly accumulate the merged fields
|
|
1136
1140
|
return Object.entries(mergedMembers).reduce((acc, [key, value]) => {
|
|
1137
1141
|
acc[key] = defaultsValueFromSchema(value, record[key] || {})
|