@effect-app/vue-components 4.0.0-beta.221 → 4.0.0-beta.223
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.es.js +15 -15
- package/dist/vue-components12.es.js +47 -25
- package/dist/vue-components13.es.js +120 -62
- package/dist/vue-components14.es.js +63 -13
- package/dist/vue-components15.es.js +60 -27
- package/dist/vue-components16.es.js +21 -52
- package/dist/vue-components17.es.js +4 -86
- package/dist/vue-components18.es.js +79 -3
- package/dist/vue-components19.es.js +92 -3
- package/dist/vue-components2.es.js +6 -15
- package/dist/vue-components20.es.js +71 -17
- package/dist/vue-components21.es.js +11 -72
- package/dist/vue-components22.es.js +54 -12
- package/dist/vue-components23.es.js +4 -25
- package/dist/vue-components24.es.js +41 -249
- package/dist/vue-components25.es.js +4 -64
- package/dist/vue-components26.es.js +81 -65
- package/dist/vue-components28.es.js +7 -11
- package/dist/vue-components29.es.js +8 -5
- package/dist/vue-components30.es.js +266 -25
- package/dist/vue-components32.es.js +7 -108
- package/dist/vue-components33.es.js +71 -55
- package/dist/vue-components34.es.js +4 -6
- package/dist/vue-components35.es.js +51 -3
- package/dist/vue-components36.es.js +4 -5
- package/dist/vue-components37.es.js +21 -685
- package/dist/vue-components38.es.js +4 -6
- package/dist/vue-components39.es.js +58 -4
- package/dist/vue-components40.es.js +4 -5
- package/dist/vue-components41.es.js +11 -26
- package/dist/vue-components42.es.js +21 -4
- package/dist/vue-components44.es.js +8 -69
- package/dist/vue-components45.es.js +3 -8
- package/dist/vue-components46.es.js +37 -9
- package/dist/vue-components47.es.js +26 -7
- package/dist/vue-components48.es.js +24 -169
- package/dist/vue-components49.es.js +6 -13
- package/dist/vue-components50.es.js +16 -9
- package/dist/vue-components51.es.js +35 -3
- package/dist/vue-components52.es.js +17 -6
- package/dist/vue-components53.es.js +19 -27
- package/dist/vue-components54.es.js +21 -212
- package/dist/vue-components55.es.js +6 -84
- package/dist/vue-components56.es.js +7 -72
- package/dist/vue-components57.es.js +26 -807
- package/dist/vue-components58.es.js +24 -3
- package/dist/vue-components59.es.js +122 -103
- package/dist/vue-components60.es.js +19 -49
- package/dist/vue-components61.es.js +15 -514
- package/dist/vue-components62.es.js +7 -438
- package/dist/vue-components63.es.js +18 -9
- package/dist/vue-components64.es.js +4 -12
- package/dist/vue-components65.es.js +26 -16
- package/dist/vue-components66.es.js +4 -28
- package/dist/vue-components67.es.js +42 -21
- package/dist/vue-components68.es.js +78 -26
- package/dist/vue-components69.es.js +32 -28
- package/dist/vue-components70.es.js +18 -72
- package/dist/vue-components71.es.js +47 -5
- package/package.json +3 -3
- package/dist/vue-components100.es.js +0 -269
- package/dist/vue-components102.es.js +0 -8
- package/dist/vue-components103.es.js +0 -73
- package/dist/vue-components104.es.js +0 -5
- package/dist/vue-components105.es.js +0 -52
- package/dist/vue-components106.es.js +0 -5
- package/dist/vue-components107.es.js +0 -24
- package/dist/vue-components108.es.js +0 -5
- package/dist/vue-components109.es.js +0 -59
- package/dist/vue-components110.es.js +0 -5
- package/dist/vue-components111.es.js +0 -12
- package/dist/vue-components112.es.js +0 -22
- package/dist/vue-components114.es.js +0 -9
- package/dist/vue-components115.es.js +0 -4
- package/dist/vue-components116.es.js +0 -38
- package/dist/vue-components117.es.js +0 -27
- package/dist/vue-components118.es.js +0 -28
- package/dist/vue-components119.es.js +0 -7
- package/dist/vue-components120.es.js +0 -18
- package/dist/vue-components121.es.js +0 -36
- package/dist/vue-components122.es.js +0 -18
- package/dist/vue-components123.es.js +0 -21
- package/dist/vue-components124.es.js +0 -30
- package/dist/vue-components125.es.js +0 -7
- package/dist/vue-components126.es.js +0 -9
- package/dist/vue-components127.es.js +0 -38
- package/dist/vue-components128.es.js +0 -25
- package/dist/vue-components129.es.js +0 -128
- package/dist/vue-components130.es.js +0 -24
- package/dist/vue-components131.es.js +0 -21
- package/dist/vue-components132.es.js +0 -9
- package/dist/vue-components133.es.js +0 -19
- package/dist/vue-components134.es.js +0 -5
- package/dist/vue-components135.es.js +0 -29
- package/dist/vue-components136.es.js +0 -5
- package/dist/vue-components137.es.js +0 -43
- package/dist/vue-components138.es.js +0 -82
- package/dist/vue-components139.es.js +0 -33
- package/dist/vue-components140.es.js +0 -19
- package/dist/vue-components141.es.js +0 -48
- package/dist/vue-components27.es.js +0 -8
- package/dist/vue-components31.es.js +0 -75
- package/dist/vue-components43.es.js +0 -48
- package/dist/vue-components72.es.js +0 -18
- package/dist/vue-components73.es.js +0 -5
- package/dist/vue-components74.es.js +0 -70
- package/dist/vue-components75.es.js +0 -140
- package/dist/vue-components76.es.js +0 -4
- package/dist/vue-components77.es.js +0 -21
- package/dist/vue-components78.es.js +0 -55
- package/dist/vue-components79.es.js +0 -9
- package/dist/vue-components80.es.js +0 -16
- package/dist/vue-components81.es.js +0 -39
- package/dist/vue-components82.es.js +0 -49
- package/dist/vue-components83.es.js +0 -128
- package/dist/vue-components84.es.js +0 -65
- package/dist/vue-components85.es.js +0 -63
- package/dist/vue-components86.es.js +0 -25
- package/dist/vue-components87.es.js +0 -5
- package/dist/vue-components88.es.js +0 -80
- package/dist/vue-components89.es.js +0 -95
- package/dist/vue-components90.es.js +0 -73
- package/dist/vue-components91.es.js +0 -12
- package/dist/vue-components92.es.js +0 -56
- package/dist/vue-components93.es.js +0 -5
- package/dist/vue-components94.es.js +0 -44
- package/dist/vue-components95.es.js +0 -5
- package/dist/vue-components96.es.js +0 -84
- package/dist/vue-components98.es.js +0 -8
- package/dist/vue-components99.es.js +0 -9
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { isDeclaration as e, isNull as t, isObjects as n, isUndefined as r, isUnion as i, toEncoded as a } from "./vue-components57.es.js";
|
|
2
|
-
import { NullishOr as o, RedactedFromValue as s, UndefinedOr as c, make as l } from "./vue-components62.es.js";
|
|
3
|
-
import { NullOr as u } from "./vue-components78.es.js";
|
|
4
|
-
import { Struct as d } from "./vue-components81.es.js";
|
|
5
|
-
//#region src/components/OmegaForm/meta/redacted.ts
|
|
6
|
-
var f = (t) => e(t) && t.annotations?.typeConstructor?._tag === "effect/Redacted" && !t.encoding, p = (p) => {
|
|
7
|
-
let m = p.ast, h = n(m) ? m : e(m) ? a(m) : null;
|
|
8
|
-
if (!h || !("propertySignatures" in h)) return p;
|
|
9
|
-
let g = !1, _ = {};
|
|
10
|
-
for (let e of h.propertySignatures) if (f(e.type)) {
|
|
11
|
-
g = !0;
|
|
12
|
-
let t = l(e.type.typeParameters[0]);
|
|
13
|
-
_[e.name] = s(t);
|
|
14
|
-
} else if (i(e.type)) {
|
|
15
|
-
let n = e.type.types, i = n.find(f);
|
|
16
|
-
if (i) {
|
|
17
|
-
g = !0;
|
|
18
|
-
let a = l(i.typeParameters[0]), d = n.some(t), f = n.some(r), p = s(a);
|
|
19
|
-
_[e.name] = d && f ? o(p) : d ? u(p) : f ? c(p) : p;
|
|
20
|
-
} else _[e.name] = l(e.type);
|
|
21
|
-
} else _[e.name] = l(e.type);
|
|
22
|
-
return g ? d(_) : p;
|
|
23
|
-
};
|
|
24
|
-
//#endregion
|
|
25
|
-
export { p as toFormSchema };
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { isObject as e } from "./vue-components87.es.js";
|
|
2
|
-
import { computed as t, onBeforeUnmount as n, onMounted as r, onUnmounted as i } from "vue";
|
|
3
|
-
//#region src/components/OmegaForm/persistency.ts
|
|
4
|
-
function a(t, n) {
|
|
5
|
-
let r = { ...t };
|
|
6
|
-
for (let t in n) Array.isArray(n[t]) ? r[t] = n[t] : n[t] && e(n[t]) ? r[t] = a(r[t], n[t]) : r[t] = n[t];
|
|
7
|
-
return r;
|
|
8
|
-
}
|
|
9
|
-
var o = (e, t) => e.includes(t), s = (e) => {
|
|
10
|
-
let { getForm: s, meta: c, persistency: l, preventWindowExit: u, schemaDefaultValues: d, tanstackDefaultValues: f } = e, p = t(() => l?.id ? l.id : `${window.location.pathname}-${Object.keys(c).join("-")}`), m = () => {
|
|
11
|
-
let e = new URLSearchParams(window.location.search);
|
|
12
|
-
e.delete(p.value);
|
|
13
|
-
let t = new URL(window.location.href);
|
|
14
|
-
t.search = e.toString(), window.history.replaceState({}, "", t.toString());
|
|
15
|
-
}, h = t(() => {
|
|
16
|
-
let t;
|
|
17
|
-
if (l?.policies && !t && (o(l.policies, "local") || o(l.policies, "session"))) {
|
|
18
|
-
let e = o(l.policies, "local") ? localStorage : sessionStorage;
|
|
19
|
-
if (e) try {
|
|
20
|
-
let n = JSON.parse(e.getItem(p.value) || "{}");
|
|
21
|
-
e.removeItem(p.value), t = n;
|
|
22
|
-
} catch (e) {
|
|
23
|
-
console.error(e);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (l?.policies && o(l.policies, "querystring")) try {
|
|
27
|
-
let e = new URLSearchParams(window.location.search).get(p.value);
|
|
28
|
-
m(), e && (t = a(t || {}, JSON.parse(e)));
|
|
29
|
-
} catch (e) {
|
|
30
|
-
console.error(e);
|
|
31
|
-
}
|
|
32
|
-
t ??= {};
|
|
33
|
-
let n = {
|
|
34
|
-
tanstack: f || {},
|
|
35
|
-
persistency: t,
|
|
36
|
-
schema: d()
|
|
37
|
-
};
|
|
38
|
-
return [...e.defaultValuesPriority || [
|
|
39
|
-
"tanstack",
|
|
40
|
-
"persistency",
|
|
41
|
-
"schema"
|
|
42
|
-
]].reverse().reduce((e, t) => Object.keys(e).length ? a(e, n[t]) : n[t], {});
|
|
43
|
-
}), g = (e) => e.reduce((e, t) => {
|
|
44
|
-
let n = t.split(".");
|
|
45
|
-
return n.reduce((e, r, i) => (i === n.length - 1 ? e[r] = s().getFieldValue(t) : e[r] = e[r] ?? {}, e[r]), e), e;
|
|
46
|
-
}, {}), _ = (e) => {
|
|
47
|
-
if (!e) return;
|
|
48
|
-
let { banKeys: t, keys: n } = e;
|
|
49
|
-
return Array.isArray(n) ? g(n) : Array.isArray(t) ? g(Object.keys(c).filter((e) => t.includes(e))) : s().store.state.values;
|
|
50
|
-
}, v = () => {
|
|
51
|
-
if (!(!l?.policies || l.policies.length === 0) && (o(l.policies, "local") || o(l.policies, "session"))) {
|
|
52
|
-
let e = o(l.policies, "local") ? localStorage : sessionStorage;
|
|
53
|
-
if (!e) return;
|
|
54
|
-
let t = _(l);
|
|
55
|
-
return e.setItem(p.value, JSON.stringify(t));
|
|
56
|
-
}
|
|
57
|
-
}, y = () => {
|
|
58
|
-
if (!(!l?.policies || l.policies.length === 0) && o(l.policies, "querystring")) {
|
|
59
|
-
let e = _(l), t = new URLSearchParams(window.location.search);
|
|
60
|
-
t.set(p.value, JSON.stringify(e));
|
|
61
|
-
let n = new URL(window.location.href);
|
|
62
|
-
n.search = t.toString(), window.history.replaceState({}, "", n.toString());
|
|
63
|
-
}
|
|
64
|
-
}, b = (e) => {
|
|
65
|
-
s().store.state.isDirty && e.preventDefault();
|
|
66
|
-
};
|
|
67
|
-
return i(v), r(() => {
|
|
68
|
-
window.addEventListener("beforeunload", v), window.addEventListener("blur", y), u && u !== "nope" && window.addEventListener("beforeunload", b);
|
|
69
|
-
}), n(() => {
|
|
70
|
-
window.removeEventListener("beforeunload", v), window.removeEventListener("blur", y), u && u !== "nope" && window.removeEventListener("beforeunload", b);
|
|
71
|
-
}), {
|
|
72
|
-
defaultValues: h,
|
|
73
|
-
persistencyKey: p,
|
|
74
|
-
persistData: v,
|
|
75
|
-
saveDataInUrl: y,
|
|
76
|
-
clearUrlParams: m
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
//#endregion
|
|
80
|
-
export { a as deepMerge, s as usePersistency };
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { isNone as e, isSome as t } from "./vue-components28.es.js";
|
|
2
|
-
import { defaultCheckHook as n } from "./vue-components54.es.js";
|
|
3
|
-
import { Arrays as r, Objects as i, PropertySignature as a, Union as o, isArrays as s, isBoolean as c, isLiteral as l, isNumber as u, isObjects as d, isString as f, isUnion as p } from "./vue-components57.es.js";
|
|
4
|
-
import { make as m, toStandardSchemaV1 as h } from "./vue-components62.es.js";
|
|
5
|
-
//#region src/components/OmegaForm/validation/localized.ts
|
|
6
|
-
var g = (r) => ({
|
|
7
|
-
leafHook: (n) => {
|
|
8
|
-
let i = n.annotations?.message;
|
|
9
|
-
if (i !== void 0) return String(i);
|
|
10
|
-
switch (n._tag) {
|
|
11
|
-
case "MissingKey": return r("validation.empty");
|
|
12
|
-
case "InvalidType": {
|
|
13
|
-
let i = n.ast;
|
|
14
|
-
return e(n.actual) || t(n.actual) && n.actual.value === void 0 || f(i) ? r("validation.empty") : c(i) ? r("validation.not_a_valid", { type: "boolean" }) : u(i) ? r("validation.number.expected", { actualValue: t(n.actual) ? String(n.actual.value) : "NaN" }) : r("validation.not_a_valid");
|
|
15
|
-
}
|
|
16
|
-
default: return r("validation.not_a_valid");
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
checkHook: (e) => {
|
|
20
|
-
if (e.filter.annotations?.identifier === "Email") return r("validation.email.invalid");
|
|
21
|
-
let t = e.filter.annotations?.meta ?? {};
|
|
22
|
-
switch (t._tag) {
|
|
23
|
-
case "isMinLength": return t.minLength === 1 ? r("validation.empty") : r("validation.string.minLength", { minLength: t.minLength });
|
|
24
|
-
case "isMaxLength": return r("validation.string.maxLength", { maxLength: t.maxLength });
|
|
25
|
-
case "isInt": return r("validation.integer.expected", { actualValue: e.actual === void 0 ? "NaN" : String(e.actual) });
|
|
26
|
-
case "isGreaterThanOrEqualTo": return r(t.minimum === 0 ? "validation.number.positive" : "validation.number.min", {
|
|
27
|
-
minimum: t.minimum,
|
|
28
|
-
isExclusive: !0
|
|
29
|
-
});
|
|
30
|
-
case "isGreaterThan": return r(t.exclusiveMinimum === 0 ? "validation.number.positive" : "validation.number.min", {
|
|
31
|
-
minimum: t.exclusiveMinimum,
|
|
32
|
-
isExclusive: !1
|
|
33
|
-
});
|
|
34
|
-
case "isLessThanOrEqualTo": return r("validation.number.max", {
|
|
35
|
-
maximum: t.maximum,
|
|
36
|
-
isExclusive: !0
|
|
37
|
-
});
|
|
38
|
-
case "isLessThan": return r("validation.number.max", {
|
|
39
|
-
maximum: t.exclusiveMaximum,
|
|
40
|
-
isExclusive: !1
|
|
41
|
-
});
|
|
42
|
-
default: return n(e);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}), _ = (e, t) => {
|
|
46
|
-
let { checkHook: n, leafHook: r } = g(t);
|
|
47
|
-
return h(e, {
|
|
48
|
-
leafHook: r,
|
|
49
|
-
checkHook: n
|
|
50
|
-
});
|
|
51
|
-
}, v = (e) => p(e) && e.types.every(l), y = (e, t) => {
|
|
52
|
-
if (v(e)) {
|
|
53
|
-
if (e.annotations?.message !== void 0) return e;
|
|
54
|
-
let n = e.types.map((e) => e.literal);
|
|
55
|
-
return new o(e.types, e.mode, {
|
|
56
|
-
...e.annotations,
|
|
57
|
-
message: t("validation.not_a_valid", {
|
|
58
|
-
type: "select",
|
|
59
|
-
message: n.join(", ")
|
|
60
|
-
})
|
|
61
|
-
}, e.checks, e.encoding, e.context);
|
|
62
|
-
}
|
|
63
|
-
if (p(e)) {
|
|
64
|
-
let n = e.types.map((e) => y(e, t));
|
|
65
|
-
return n.some((t, n) => t !== e.types[n]) ? new o(n, e.mode, e.annotations, e.checks, e.encoding, e.context) : e;
|
|
66
|
-
}
|
|
67
|
-
if (s(e)) {
|
|
68
|
-
let n = e.rest.map((e) => y(e, t)), i = e.elements.map((e) => y(e, t)), a = e.annotations;
|
|
69
|
-
if (e.annotations?.message === void 0 && e.rest.length === 1 && v(e.rest[0])) {
|
|
70
|
-
let n = e.rest[0].types.map((e) => e.literal);
|
|
71
|
-
a = {
|
|
72
|
-
...e.annotations,
|
|
73
|
-
message: t("validation.not_a_valid", {
|
|
74
|
-
type: "multiple",
|
|
75
|
-
message: n.join(", ")
|
|
76
|
-
})
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
let o = n.some((t, n) => t !== e.rest[n]), s = i.some((t, n) => t !== e.elements[n]);
|
|
80
|
-
return !o && !s && a === e.annotations ? e : new r(e.isMutable, i, n, a, e.checks, e.encoding, e.context);
|
|
81
|
-
}
|
|
82
|
-
if (d(e)) {
|
|
83
|
-
let n = e.propertySignatures.map((e) => {
|
|
84
|
-
let n = y(e.type, t);
|
|
85
|
-
return n === e.type ? e : new a(e.name, n);
|
|
86
|
-
});
|
|
87
|
-
return n.some((t, n) => t !== e.propertySignatures[n]) ? new i(n, e.indexSignatures, e.annotations, e.checks, e.encoding, e.context) : e;
|
|
88
|
-
}
|
|
89
|
-
return e;
|
|
90
|
-
}, b = (e, t) => {
|
|
91
|
-
let n = y(e.ast, t);
|
|
92
|
-
return n === e.ast ? e : m(n);
|
|
93
|
-
};
|
|
94
|
-
//#endregion
|
|
95
|
-
export { b as annotateLiteralUnionMessages, g as makeStandardSchemaV1Hooks, _ as toLocalizedStandardSchemaV1 };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { useIntl as e } from "./vue-components6.es.js";
|
|
2
|
-
import { computed as t, h as n, onUnmounted as r, ref as i, watch as a } from "vue";
|
|
3
|
-
//#region src/components/OmegaForm/errors.ts
|
|
4
|
-
var o = (t) => {
|
|
5
|
-
let { formatMessage: n } = e(), r = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (e) => e.toUpperCase()).trim(), i = (e) => n ? n({
|
|
6
|
-
id: `general.fields.${e}`,
|
|
7
|
-
defaultMessage: r(e)
|
|
8
|
-
}) : r(e);
|
|
9
|
-
return (e) => t.i18nNamespace ? n({
|
|
10
|
-
id: `${t.i18nNamespace}.fields.${e}`,
|
|
11
|
-
defaultMessage: i(e)
|
|
12
|
-
}) : i(e);
|
|
13
|
-
}, s = (e) => function(r) {
|
|
14
|
-
return {
|
|
15
|
-
setup() {
|
|
16
|
-
let { fieldMap: n, form: r } = e, i = r.useStore((e) => e.errors), a = r.useStore((e) => e.fieldMeta), s = r.useStore((e) => e.errorMap), c = o(r);
|
|
17
|
-
return {
|
|
18
|
-
generalErrors: i,
|
|
19
|
-
errors: t(() => {
|
|
20
|
-
let e = Object.entries(a.value).reduce((e, [t, r]) => {
|
|
21
|
-
let i = r?.errors ?? [];
|
|
22
|
-
if (!i.length) return e;
|
|
23
|
-
let a = n.value.get(t);
|
|
24
|
-
return a && e.push({
|
|
25
|
-
label: a.label,
|
|
26
|
-
inputId: a.id,
|
|
27
|
-
errors: [i[0]?.message].filter(Boolean)
|
|
28
|
-
}), e;
|
|
29
|
-
}, []), t = [], r = [s.value.onDynamic, s.value.onSubmit].filter(Boolean), i = /* @__PURE__ */ new Set();
|
|
30
|
-
for (let e of r) for (let [r, a] of Object.entries(e)) if (Array.isArray(a) && a.length) for (let e of a) {
|
|
31
|
-
let r = e;
|
|
32
|
-
if (r?.path && Array.isArray(r.path) && r.path.length) {
|
|
33
|
-
let e = r.path.join(".");
|
|
34
|
-
if (!n.value.has(e) && !i.has(e)) {
|
|
35
|
-
i.add(e), t.push({
|
|
36
|
-
label: c(e),
|
|
37
|
-
inputId: e,
|
|
38
|
-
errors: [r.message].filter(Boolean)
|
|
39
|
-
});
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return [...e, ...t];
|
|
45
|
-
})
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
render({ errors: e, generalErrors: t }) {
|
|
49
|
-
return n(r, {
|
|
50
|
-
errors: e,
|
|
51
|
-
generalErrors: t,
|
|
52
|
-
...this.$attrs
|
|
53
|
-
}, this.$slots);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}, c = () => {
|
|
57
|
-
let e = i(/* @__PURE__ */ new Map());
|
|
58
|
-
return {
|
|
59
|
-
fieldMap: e,
|
|
60
|
-
registerField: (t) => {
|
|
61
|
-
a(t, (t) => {
|
|
62
|
-
e.value.set(t.name, {
|
|
63
|
-
label: t.label,
|
|
64
|
-
id: t.id
|
|
65
|
-
});
|
|
66
|
-
}, { immediate: !0 }), r(() => {
|
|
67
|
-
e.value.get(t.value.name)?.id === t.value.id && e.value.delete(t.value.name);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
//#endregion
|
|
73
|
-
export { s as eHoc, c as makeFieldMap, o as useErrorLabel };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createElementBlock as r, defineComponent as i, guardReactiveProps as a, mergeProps as o, normalizeProps as s, onMounted as c, openBlock as l, provide as u, renderList as d, renderSlot as f, resolveDynamicComponent as p, withCtx as m } from "vue";
|
|
2
|
-
//#region src/components/OmegaForm/OmegaArray.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var h = /* @__PURE__ */ i({
|
|
4
|
-
inheritAttrs: !1,
|
|
5
|
-
__name: "OmegaArray",
|
|
6
|
-
props: {
|
|
7
|
-
form: {},
|
|
8
|
-
inputClass: {},
|
|
9
|
-
name: {},
|
|
10
|
-
defaultItems: {},
|
|
11
|
-
items: {}
|
|
12
|
-
},
|
|
13
|
-
setup(i) {
|
|
14
|
-
let h = i, g = h.form.useStore((e) => e.values), _ = t(() => {
|
|
15
|
-
let e = h.name.replace(/\[/g, ".").replace(/\]/g, "");
|
|
16
|
-
try {
|
|
17
|
-
return e.split(".").reduce((e, t) => e && e[t], g.value);
|
|
18
|
-
} catch (e) {
|
|
19
|
-
return console.error(e), [];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
return c(async () => {
|
|
23
|
-
h.defaultItems && !_.value && h.form.setFieldValue(h.name, h.defaultItems);
|
|
24
|
-
}), u("getMetaFromArray", t(() => (e) => {
|
|
25
|
-
let t = e.replace(/\[\d+\]/g, "");
|
|
26
|
-
return h.form.meta[t];
|
|
27
|
-
})), (t, c) => (l(), n(p(i.form.Field), { name: i.name }, {
|
|
28
|
-
default: m(({ field: c, state: u }) => [
|
|
29
|
-
f(t.$slots, "pre-array", s(a({
|
|
30
|
-
field: c,
|
|
31
|
-
state: u
|
|
32
|
-
}))),
|
|
33
|
-
(l(!0), r(e, null, d(_.value, (e, r) => (l(), n(p(i.form.Field), {
|
|
34
|
-
key: `${i.name}[${Number(r)}]`,
|
|
35
|
-
name: `${i.name}[${Number(r)}]`
|
|
36
|
-
}, {
|
|
37
|
-
default: m(({ field: e, state: n }) => [f(t.$slots, "default", o({ ref_for: !0 }, {
|
|
38
|
-
subField: e,
|
|
39
|
-
subState: n,
|
|
40
|
-
index: Number(r),
|
|
41
|
-
field: c
|
|
42
|
-
}))]),
|
|
43
|
-
_: 2
|
|
44
|
-
}, 1032, ["name"]))), 128)),
|
|
45
|
-
f(t.$slots, "post-array", s(a({
|
|
46
|
-
field: c,
|
|
47
|
-
state: u
|
|
48
|
-
}))),
|
|
49
|
-
f(t.$slots, "field", s(a({ field: c })))
|
|
50
|
-
]),
|
|
51
|
-
_: 3
|
|
52
|
-
}, 8, ["name"]));
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
//#endregion
|
|
56
|
-
export { h as default };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Number as e, mapInput as t } from "./vue-components27.es.js";
|
|
2
|
-
import { Fragment as n, computed as r, createElementBlock as i, createVNode as a, defineComponent as o, mergeProps as s, openBlock as c, renderList as l, renderSlot as u, unref as d } from "vue";
|
|
3
|
-
//#region src/components/OmegaForm/OmegaAutoGen.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var f = /* @__PURE__ */ o({
|
|
5
|
-
__name: "OmegaAutoGen",
|
|
6
|
-
props: {
|
|
7
|
-
form: {},
|
|
8
|
-
pick: {},
|
|
9
|
-
omit: {},
|
|
10
|
-
labelMap: { type: Function },
|
|
11
|
-
filterMap: { type: Function },
|
|
12
|
-
order: {},
|
|
13
|
-
sort: {}
|
|
14
|
-
},
|
|
15
|
-
setup(o) {
|
|
16
|
-
let f = (e) => (t) => Object.fromEntries(Object.entries(t).map(([t, n]) => [t, e(n, t)])), p = (e) => (t) => Object.fromEntries(Object.entries(t).filter(([t, n]) => e(n, t))), m = (e) => (t) => Object.entries(t).reduce((t, [n, r]) => {
|
|
17
|
-
let i = e(r, n);
|
|
18
|
-
return i !== !1 && (t[n] = i), t;
|
|
19
|
-
}, {}), h = o, g = (e, t) => {
|
|
20
|
-
let n = t?.indexOf(e) ?? -1;
|
|
21
|
-
return n === -1 ? 2 ** 53 - 1 : n;
|
|
22
|
-
}, _ = t(e, (e) => g(e.name, h.order || [])), v = r(() => {
|
|
23
|
-
let e = p((e, t) => !!e && (h.pick ? h.pick.includes(t) && !h.omit?.includes(t) : !h.omit?.includes(t)))(h.form.meta), t = f((e, t) => ({
|
|
24
|
-
name: t,
|
|
25
|
-
label: h.labelMap?.(t) || t,
|
|
26
|
-
...e
|
|
27
|
-
}))(e), n = h.filterMap ? m((e) => {
|
|
28
|
-
let t = h.filterMap?.(e.name, e);
|
|
29
|
-
return t === void 0 || t === !0 ? e : t;
|
|
30
|
-
})(t) : t, r = [...Object.values(n)].sort(_);
|
|
31
|
-
return h.sort ? r.sort(h.sort) : r;
|
|
32
|
-
});
|
|
33
|
-
return (e, t) => (c(!0), i(n, null, l(v.value, ({ name: t, label: n, ...r }) => u(e.$slots, "default", { child: {
|
|
34
|
-
name: t,
|
|
35
|
-
label: n,
|
|
36
|
-
...r
|
|
37
|
-
} }, () => [a(d(o.form).Input, s({
|
|
38
|
-
name: t,
|
|
39
|
-
label: n
|
|
40
|
-
}, { ref_for: !0 }, r), null, 16, ["name", "label"])])), 256));
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
//#endregion
|
|
44
|
-
export { f as default };
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { useIntl as e } from "./vue-components6.es.js";
|
|
2
|
-
import { Fragment as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, defineComponent as l, getCurrentInstance as u, guardReactiveProps as d, normalizeClass as f, normalizeProps as p, openBlock as m, renderList as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, withCtx as b } from "vue";
|
|
3
|
-
//#region src/components/OmegaForm/OmegaErrorsInternal.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var x = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "error-alert"
|
|
7
|
-
}, S = { class: "container" }, C = {
|
|
8
|
-
key: 0,
|
|
9
|
-
viewBox: "0 0 24 24",
|
|
10
|
-
fill: "none",
|
|
11
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
12
|
-
}, w = { class: "text-h6" }, T = {
|
|
13
|
-
key: 0,
|
|
14
|
-
class: "error-list"
|
|
15
|
-
}, E = ["for"], D = { key: 1 }, O = /* @__PURE__ */ l({
|
|
16
|
-
__name: "OmegaErrorsInternal",
|
|
17
|
-
props: {
|
|
18
|
-
generalErrors: {},
|
|
19
|
-
errors: {},
|
|
20
|
-
hideErrorDetails: { type: Boolean }
|
|
21
|
-
},
|
|
22
|
-
setup(l) {
|
|
23
|
-
let O = u()?.appContext.components.VAlert, k = l, { trans: A } = e(), j = r(() => k.generalErrors ? k.generalErrors.filter((e) => !!e).flatMap((e) => Object.values(e).filter((e) => !!e).flatMap((e) => e.filter((e) => !!e?.message).map((e) => e.message))) : []);
|
|
24
|
-
return (e, r) => (m(), i(n, null, {
|
|
25
|
-
default: b(() => [l.errors.length || j.value.length ? (m(), o("div", x, [g(e.$slots, "default", p(d({
|
|
26
|
-
errors: l.errors,
|
|
27
|
-
showedGeneralErrors: j.value
|
|
28
|
-
})), () => [(m(), i(_(y(O) ? "v-alert" : "div"), {
|
|
29
|
-
class: f([y(O) ? "mb-4" : "error-alert-content", "mb-4"]),
|
|
30
|
-
type: "error",
|
|
31
|
-
variant: "tonal",
|
|
32
|
-
role: "alert",
|
|
33
|
-
"aria-live": "polite"
|
|
34
|
-
}, {
|
|
35
|
-
default: b(() => [s("div", S, [g(e.$slots, "icon", {}, () => [y(O) ? a("", !0) : (m(), o("svg", C, [...r[0] ||= [
|
|
36
|
-
s("path", {
|
|
37
|
-
d: "M16 2H8L2 8V16L8 22H16L22 16V8L16 2Z",
|
|
38
|
-
stroke: "currentColor",
|
|
39
|
-
"stroke-width": "2",
|
|
40
|
-
"stroke-linecap": "round",
|
|
41
|
-
"stroke-linejoin": "round"
|
|
42
|
-
}, null, -1),
|
|
43
|
-
s("path", {
|
|
44
|
-
d: "M12 8V12",
|
|
45
|
-
stroke: "currentColor",
|
|
46
|
-
"stroke-width": "2",
|
|
47
|
-
"stroke-linecap": "round",
|
|
48
|
-
"stroke-linejoin": "round"
|
|
49
|
-
}, null, -1),
|
|
50
|
-
s("path", {
|
|
51
|
-
d: "M12 16.0195V16",
|
|
52
|
-
stroke: "currentColor",
|
|
53
|
-
"stroke-width": "2",
|
|
54
|
-
"stroke-linecap": "round",
|
|
55
|
-
"stroke-linejoin": "round"
|
|
56
|
-
}, null, -1)
|
|
57
|
-
]]))], !0), s("div", null, [s("div", w, v(y(A)("form.includes_error")) + ": ", 1), l.errors.length ? (m(), o("ul", T, [(m(!0), o(t, null, h(l.errors, (e) => (m(), o("li", {
|
|
58
|
-
key: e.inputId,
|
|
59
|
-
class: "error-item"
|
|
60
|
-
}, [s("div", null, [
|
|
61
|
-
s("label", {
|
|
62
|
-
for: e.inputId,
|
|
63
|
-
class: "error-link"
|
|
64
|
-
}, v(e.label), 9, E),
|
|
65
|
-
r[1] ||= c(" " + v(" ") + " ", -1),
|
|
66
|
-
l.hideErrorDetails ? a("", !0) : (m(), o("div", {
|
|
67
|
-
key: 0,
|
|
68
|
-
class: f(["error-message", e.errors.length < 2 && "single-error"])
|
|
69
|
-
}, [(m(), i(_(e.errors.length > 1 ? "ul" : "div"), { class: "error-list" }, {
|
|
70
|
-
default: b(() => [(m(!0), o(t, null, h(e.errors, (t) => (m(), i(_(e.errors.length > 1 ? "li" : "span"), { key: t }, {
|
|
71
|
-
default: b(() => [c(v(t), 1)]),
|
|
72
|
-
_: 2
|
|
73
|
-
}, 1024))), 128))]),
|
|
74
|
-
_: 2
|
|
75
|
-
}, 1024))], 2))
|
|
76
|
-
])]))), 128))])) : (m(), o("span", D, v(j.value[0]), 1))])])]),
|
|
77
|
-
_: 3
|
|
78
|
-
}, 8, ["class"]))], !0)])) : a("", !0)]),
|
|
79
|
-
_: 3
|
|
80
|
-
}));
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
//#endregion
|
|
84
|
-
export { O as default };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);if(e.appendChild(document.createTextNode(`.v-enter-from[data-v-5278f8d3],.v-leave-to[data-v-5278f8d3]{opacity:0;grid-template-rows:0fr;max-height:0}.v-enter-active[data-v-5278f8d3],.v-leave-active[data-v-5278f8d3]{transition:all .15s;display:grid}.v-enter-to[data-v-5278f8d3],.v-leave-from[data-v-5278f8d3]{opacity:1;grid-template-rows:1fr;max-height:50vh}.error-alert[data-v-5278f8d3]{transition-behavior:allow-discrete;min-height:0;display:grid;overflow:hidden}.error-alert>[data-v-5278f8d3]{min-height:0}.error-list[data-v-5278f8d3]{list-style-position:inside}.error-list [data-v-5278f8d3]::marker{margin:0;padding:0}.error-alert-content[data-v-5278f8d3]{background-color:var(--error-background,#fff5f5);color:var(--error-color,#c92a2a);padding:1em}.error-link[data-v-5278f8d3]{color:var(--error-color,#c92a2a);cursor:pointer;font-weight:700;position:relative}.error-link[data-v-5278f8d3]:after{content:"";background:rgba(from var(--error-color,#c92a2a) r g b / .5);height:1px;position:absolute;bottom:0;left:0;right:0}.text-h6[data-v-5278f8d3]{font-size:1.25em;font-weight:700}.error-message[data-v-5278f8d3]{font-style:italic}.error-item[data-v-5278f8d3]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-5278f8d3]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-5278f8d3]{gap:1.5em;display:flex}.container svg[data-v-5278f8d3]{width:3em}.container .single-error[data-v-5278f8d3]{display:inline-block}`)),document.head.appendChild(e),window.customElements){let e=window.customElements.define;window.customElements.define=function(t,n){let r=n.prototype.connectedCallback;return n.prototype.connectedCallback=function(){if(r&&r.call(this),this.shadowRoot){let e=document.createElement(`style`);e.appendChild(document.createTextNode(`.v-enter-from[data-v-5278f8d3],.v-leave-to[data-v-5278f8d3]{opacity:0;grid-template-rows:0fr;max-height:0}.v-enter-active[data-v-5278f8d3],.v-leave-active[data-v-5278f8d3]{transition:all .15s;display:grid}.v-enter-to[data-v-5278f8d3],.v-leave-from[data-v-5278f8d3]{opacity:1;grid-template-rows:1fr;max-height:50vh}.error-alert[data-v-5278f8d3]{transition-behavior:allow-discrete;min-height:0;display:grid;overflow:hidden}.error-alert>[data-v-5278f8d3]{min-height:0}.error-list[data-v-5278f8d3]{list-style-position:inside}.error-list [data-v-5278f8d3]::marker{margin:0;padding:0}.error-alert-content[data-v-5278f8d3]{background-color:var(--error-background,#fff5f5);color:var(--error-color,#c92a2a);padding:1em}.error-link[data-v-5278f8d3]{color:var(--error-color,#c92a2a);cursor:pointer;font-weight:700;position:relative}.error-link[data-v-5278f8d3]:after{content:"";background:rgba(from var(--error-color,#c92a2a) r g b / .5);height:1px;position:absolute;bottom:0;left:0;right:0}.text-h6[data-v-5278f8d3]{font-size:1.25em;font-weight:700}.error-message[data-v-5278f8d3]{font-style:italic}.error-item[data-v-5278f8d3]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-5278f8d3]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-5278f8d3]{gap:1.5em;display:flex}.container svg[data-v-5278f8d3]{width:3em}.container .single-error[data-v-5278f8d3]{display:inline-block}`)),this.shadowRoot.appendChild(e)}},e.call(window.customElements,t,n)}}}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);if(e.appendChild(document.createTextNode(`.v-enter-from[data-v-5278f8d3],.v-leave-to[data-v-5278f8d3]{opacity:0;grid-template-rows:0fr;max-height:0}.v-enter-active[data-v-5278f8d3],.v-leave-active[data-v-5278f8d3]{transition:all .15s;display:grid}.v-enter-to[data-v-5278f8d3],.v-leave-from[data-v-5278f8d3]{opacity:1;grid-template-rows:1fr;max-height:50vh}.error-alert[data-v-5278f8d3]{transition-behavior:allow-discrete;min-height:0;display:grid;overflow:hidden}.error-alert>[data-v-5278f8d3]{min-height:0}.error-list[data-v-5278f8d3]{list-style-position:inside}.error-list [data-v-5278f8d3]::marker{margin:0;padding:0}.error-alert-content[data-v-5278f8d3]{background-color:var(--error-background,#fff5f5);color:var(--error-color,#c92a2a);padding:1em}.error-link[data-v-5278f8d3]{color:var(--error-color,#c92a2a);cursor:pointer;font-weight:700;position:relative}.error-link[data-v-5278f8d3]:after{content:"";background:rgba(from var(--error-color,#c92a2a) r g b / .5);height:1px;position:absolute;bottom:0;left:0;right:0}.text-h6[data-v-5278f8d3]{font-size:1.25em;font-weight:700}.error-message[data-v-5278f8d3]{font-style:italic}.error-item[data-v-5278f8d3]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-5278f8d3]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-5278f8d3]{gap:1.5em;display:flex}.container svg[data-v-5278f8d3]{width:3em}.container .single-error[data-v-5278f8d3]{display:inline-block}`)),document.head.appendChild(e),window.customElements){let e=window.customElements.define;window.customElements.define=function(t,n){let r=n.prototype.connectedCallback;return n.prototype.connectedCallback=function(){if(r&&r.call(this),this.shadowRoot){let e=document.createElement(`style`);e.appendChild(document.createTextNode(`.v-enter-from[data-v-5278f8d3],.v-leave-to[data-v-5278f8d3]{opacity:0;grid-template-rows:0fr;max-height:0}.v-enter-active[data-v-5278f8d3],.v-leave-active[data-v-5278f8d3]{transition:all .15s;display:grid}.v-enter-to[data-v-5278f8d3],.v-leave-from[data-v-5278f8d3]{opacity:1;grid-template-rows:1fr;max-height:50vh}.error-alert[data-v-5278f8d3]{transition-behavior:allow-discrete;min-height:0;display:grid;overflow:hidden}.error-alert>[data-v-5278f8d3]{min-height:0}.error-list[data-v-5278f8d3]{list-style-position:inside}.error-list [data-v-5278f8d3]::marker{margin:0;padding:0}.error-alert-content[data-v-5278f8d3]{background-color:var(--error-background,#fff5f5);color:var(--error-color,#c92a2a);padding:1em}.error-link[data-v-5278f8d3]{color:var(--error-color,#c92a2a);cursor:pointer;font-weight:700;position:relative}.error-link[data-v-5278f8d3]:after{content:"";background:rgba(from var(--error-color,#c92a2a) r g b / .5);height:1px;position:absolute;bottom:0;left:0;right:0}.text-h6[data-v-5278f8d3]{font-size:1.25em;font-weight:700}.error-message[data-v-5278f8d3]{font-style:italic}.error-item[data-v-5278f8d3]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-5278f8d3]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-5278f8d3]{gap:1.5em;display:flex}.container svg[data-v-5278f8d3]{width:3em}.container .single-error[data-v-5278f8d3]{display:inline-block}`)),this.shadowRoot.appendChild(e)}},e.call(window.customElements,t,n)}}}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
3
|
-
import e from "./vue-components96.es.js";
|
|
4
|
-
|
|
5
|
-
import t from "./vue-components98.es.js";
|
|
6
|
-
//#region src/components/OmegaForm/OmegaErrorsInternal.vue
|
|
7
|
-
var n = /* @__PURE__ */ t(e, [["__scopeId", "data-v-5278f8d3"]]);
|
|
8
|
-
//#endregion
|
|
9
|
-
export { n as default };
|