@effect-app/vue-components 0.12.19 → 0.12.21
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/InputProps.d.ts +5 -47
- package/dist/types/components/OmegaForm/OmegaArray.vue.d.ts +5 -5
- package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +8 -9
- package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +4 -3
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +14 -13
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +2 -3
- package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +2 -2
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +6 -6
- package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +3 -3
- package/dist/types/components/OmegaForm/index.d.ts +2 -1
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +2 -2
- package/dist/vue-components.es.js +15 -13
- package/dist/vue-components.es10.js +246 -6
- package/dist/vue-components.es11.js +5 -5
- package/dist/vue-components.es12.js +6 -111
- package/dist/vue-components.es13.js +113 -0
- package/dist/vue-components.es15.js +7 -2
- package/dist/vue-components.es16.js +2 -89
- package/dist/vue-components.es17.js +4 -0
- package/dist/vue-components.es18.js +89 -2
- package/dist/vue-components.es2.js +17 -15
- package/dist/vue-components.es20.js +2 -5
- package/dist/vue-components.es21.js +2 -32
- package/dist/vue-components.es22.js +5 -2
- package/dist/vue-components.es23.js +2 -2
- package/dist/vue-components.es24.js +90 -11
- package/dist/vue-components.es25.js +11 -90
- package/dist/vue-components.es26.js +1 -1
- package/dist/vue-components.es4.js +2 -2
- package/dist/vue-components.es5.js +28 -66
- package/dist/vue-components.es6.js +65 -55
- package/dist/vue-components.es7.js +60 -29
- package/dist/vue-components.es8.js +28 -124
- package/dist/vue-components.es9.js +118 -241
- package/package.json +5 -9
- package/src/components/OmegaForm/InputProps.ts +37 -64
- package/src/components/OmegaForm/OmegaArray.vue +5 -3
- package/src/components/OmegaForm/OmegaAutoGen.vue +10 -10
- package/src/components/OmegaForm/OmegaFormInput.vue +6 -8
- package/src/components/OmegaForm/OmegaFormStuff.ts +76 -77
- package/src/components/OmegaForm/OmegaInput.vue +1 -2
- package/src/components/OmegaForm/OmegaInputVuetify.vue +3 -3
- package/src/components/OmegaForm/OmegaInternalInput.vue +5 -5
- package/src/components/OmegaForm/OmegaWrapper.vue +2 -2
- package/src/components/OmegaForm/index.ts +2 -1
- package/src/components/OmegaForm/useOmegaForm.ts +20 -22
- package/dist/vue-components.es14.js +0 -9
- package/dist/vue-components.es19.js +0 -4
|
@@ -1,13 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
import { computed as f } from "vue";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");if(i.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),document.head.appendChild(i),window.customElements){const e=window.customElements.define;window.customElements.define=function(s,t){const n=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(n&&n.call(this),this.shadowRoot){const a=document.createElement("style");a.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),this.shadowRoot.appendChild(a)}},e.call(window.customElements,s,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { defineComponent as w, getCurrentInstance as x, useId as C, computed as a, watch as f, nextTick as N, onMounted as d, ref as $, watchEffect as k, renderSlot as B, normalizeProps as I, guardReactiveProps as O, createElementVNode as _, normalizeClass as q, createBlock as L, createCommentVNode as P, unref as F, openBlock as S, mergeProps as T } from "vue";
|
|
3
|
+
import { useStore as z } from "@tanstack/vue-form";
|
|
4
|
+
import { useOmegaErrors as A } from "./vue-components.es8.js";
|
|
5
|
+
import D from "./vue-components.es27.js";
|
|
6
|
+
|
|
7
|
+
const J = /* @__PURE__ */ w({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "OmegaInternalInput",
|
|
10
|
+
props: {
|
|
11
|
+
field: {},
|
|
12
|
+
meta: {},
|
|
13
|
+
label: {},
|
|
14
|
+
options: {},
|
|
15
|
+
type: {},
|
|
16
|
+
validators: {}
|
|
17
|
+
},
|
|
18
|
+
setup(c) {
|
|
19
|
+
const e = c, v = x()?.appContext.components.VTextField, l = C(), o = e.field, r = z(o.store, (t) => t), m = a(() => e.type ? e.type : e.meta?.type === "string" ? e.meta.format === "email" ? "email" : "string" : e.meta?.type || "unknown"), n = a(() => r.value.value), g = a(
|
|
20
|
+
() => (
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
+
r.value.meta.errors.map((t) => t?.message).filter(Boolean)
|
|
23
|
+
)
|
|
24
|
+
), y = (t) => t == null || t === !1 || t === "" || Number.isNaN(t);
|
|
25
|
+
f(
|
|
26
|
+
() => !!n.value,
|
|
27
|
+
() => {
|
|
28
|
+
y(n.value) && e.meta?.type !== "boolean" && N(() => {
|
|
29
|
+
o.setValue(
|
|
30
|
+
e.meta?.nullableOrUndefined === "undefined" ? void 0 : null
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
), d(() => {
|
|
35
|
+
!n.value && !e.meta?.required && e.meta?.nullableOrUndefined === "null" && o.setValue(null);
|
|
36
|
+
});
|
|
37
|
+
const { addError: h, removeError: b, showErrors: E, showErrorsOn: V } = A(), s = $(!1);
|
|
38
|
+
k(() => {
|
|
39
|
+
(E.value || V === "onChange") && (s.value = !0);
|
|
40
|
+
});
|
|
41
|
+
const u = () => {
|
|
42
|
+
s.value = !0;
|
|
43
|
+
};
|
|
44
|
+
d(() => {
|
|
45
|
+
n.value && u();
|
|
46
|
+
});
|
|
47
|
+
const p = a(() => !s.value && m.value !== "select" ? [] : g.value);
|
|
48
|
+
f(
|
|
49
|
+
() => r.value.meta.errors,
|
|
50
|
+
() => {
|
|
51
|
+
r.value.meta.errors.length ? h({
|
|
52
|
+
inputId: l,
|
|
53
|
+
errors: r.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
54
|
+
label: e.label
|
|
55
|
+
}) : b(l);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
const i = a(() => ({
|
|
59
|
+
id: l,
|
|
60
|
+
required: e.meta?.required,
|
|
61
|
+
minLength: e.meta?.type === "string" && e.meta?.minLength,
|
|
62
|
+
maxLength: e.meta?.type === "string" && e.meta?.maxLength,
|
|
63
|
+
max: e.meta?.type === "number" && e.meta?.maximum,
|
|
64
|
+
min: e.meta?.type === "number" && e.meta?.minimum,
|
|
65
|
+
name: e.field.name,
|
|
66
|
+
modelValue: e.field.state.value,
|
|
67
|
+
errorMessages: p.value,
|
|
68
|
+
error: !!p.value.length,
|
|
69
|
+
field: e.field,
|
|
70
|
+
setRealDirty: u,
|
|
71
|
+
type: m.value,
|
|
72
|
+
label: `${e.label}${e.meta?.required ? " *" : ""}`,
|
|
73
|
+
options: e.options
|
|
74
|
+
}));
|
|
75
|
+
return (t, R) => B(t.$slots, "default", I(O(i.value)), () => [
|
|
76
|
+
_("div", {
|
|
77
|
+
class: q(t.$attrs.class),
|
|
78
|
+
onFocusout: u
|
|
79
|
+
}, [
|
|
80
|
+
F(v) ? (S(), L(D, T({
|
|
81
|
+
key: 0,
|
|
82
|
+
"input-props": i.value
|
|
83
|
+
}, t.$attrs, {
|
|
84
|
+
"vuetify-value": i.value.field.state.value
|
|
85
|
+
}), null, 16, ["input-props", "vuetify-value"])) : P("", !0)
|
|
86
|
+
], 34)
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
11
90
|
export {
|
|
12
|
-
|
|
91
|
+
J as default
|
|
13
92
|
};
|
|
@@ -1,92 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
field: {},
|
|
12
|
-
meta: {},
|
|
13
|
-
label: {},
|
|
14
|
-
options: {},
|
|
15
|
-
type: {},
|
|
16
|
-
validators: {}
|
|
17
|
-
},
|
|
18
|
-
setup(c) {
|
|
19
|
-
const e = c, v = x()?.appContext.components.VTextField, l = C(), o = e.field, r = z(o.store, (t) => t), m = a(() => e.type ? e.type : e.meta?.type === "string" ? e.meta.format === "email" ? "email" : "string" : e.meta?.type || "unknown"), n = a(() => r.value.value), g = a(
|
|
20
|
-
() => (
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
r.value.meta.errors.map((t) => t?.message).filter(Boolean)
|
|
23
|
-
)
|
|
24
|
-
), y = (t) => t == null || t === !1 || t === "" || Number.isNaN(t);
|
|
25
|
-
f(
|
|
26
|
-
() => !!n.value,
|
|
27
|
-
() => {
|
|
28
|
-
y(n.value) && e.meta?.type !== "boolean" && N(() => {
|
|
29
|
-
o.setValue(
|
|
30
|
-
e.meta?.nullableOrUndefined === "undefined" ? void 0 : null
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
), d(() => {
|
|
35
|
-
!n.value && !e.meta?.required && e.meta?.nullableOrUndefined === "null" && o.setValue(null);
|
|
36
|
-
});
|
|
37
|
-
const { addError: h, removeError: b, showErrors: E, showErrorsOn: V } = A(), s = $(!1);
|
|
38
|
-
k(() => {
|
|
39
|
-
(E.value || V === "onChange") && (s.value = !0);
|
|
40
|
-
});
|
|
41
|
-
const u = () => {
|
|
42
|
-
s.value = !0;
|
|
43
|
-
};
|
|
44
|
-
d(() => {
|
|
45
|
-
n.value && u();
|
|
46
|
-
});
|
|
47
|
-
const p = a(() => !s.value && m.value !== "select" ? [] : g.value);
|
|
48
|
-
f(
|
|
49
|
-
() => r.value.meta.errors,
|
|
50
|
-
() => {
|
|
51
|
-
r.value.meta.errors.length ? h({
|
|
52
|
-
inputId: l,
|
|
53
|
-
errors: r.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
54
|
-
label: e.label
|
|
55
|
-
}) : b(l);
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
const i = a(() => ({
|
|
59
|
-
id: l,
|
|
60
|
-
required: e.meta?.required,
|
|
61
|
-
minLength: e.meta?.type === "string" && e.meta?.minLength,
|
|
62
|
-
maxLength: e.meta?.type === "string" && e.meta?.maxLength,
|
|
63
|
-
max: e.meta?.type === "number" && e.meta?.maximum,
|
|
64
|
-
min: e.meta?.type === "number" && e.meta?.minimum,
|
|
65
|
-
name: e.field.name,
|
|
66
|
-
modelValue: e.field.state.value,
|
|
67
|
-
errorMessages: p.value,
|
|
68
|
-
error: !!p.value.length,
|
|
69
|
-
field: e.field,
|
|
70
|
-
setRealDirty: u,
|
|
71
|
-
type: m.value,
|
|
72
|
-
label: `${e.label}${e.meta?.required ? " *" : ""}`,
|
|
73
|
-
options: e.options
|
|
74
|
-
}));
|
|
75
|
-
return (t, R) => B(t.$slots, "default", I(O(i.value)), () => [
|
|
76
|
-
_("div", {
|
|
77
|
-
class: q(t.$attrs.class),
|
|
78
|
-
onFocusout: u
|
|
79
|
-
}, [
|
|
80
|
-
F(v) ? (S(), L(D, T({
|
|
81
|
-
key: 0,
|
|
82
|
-
"input-props": i.value
|
|
83
|
-
}, t.$attrs, {
|
|
84
|
-
"vuetify-value": i.value.field.state.value
|
|
85
|
-
}), null, 16, ["input-props", "vuetify-value"])) : P("", !0)
|
|
86
|
-
], 34)
|
|
87
|
-
]);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
1
|
+
import { useStore as u } from "@tanstack/vue-form";
|
|
2
|
+
import { computed as f } from "vue";
|
|
3
|
+
function c(o, t) {
|
|
4
|
+
return f(() => t ? u(o.store, (n) => {
|
|
5
|
+
const r = {};
|
|
6
|
+
for (const e of t)
|
|
7
|
+
r[e] = n[e];
|
|
8
|
+
return r;
|
|
9
|
+
}).value : {});
|
|
10
|
+
}
|
|
90
11
|
export {
|
|
91
|
-
|
|
12
|
+
c as getOmegaStore
|
|
92
13
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as d, inject as f, computed as o, createBlock as n, openBlock as m, resolveDynamicComponent as v, withCtx as l, createCommentVNode as c, mergeProps as y, renderSlot as g, normalizeProps as h, guardReactiveProps as C } from "vue";
|
|
2
|
-
import { generateInputStandardSchemaFromFieldMeta as F } from "./vue-components.
|
|
3
|
-
import b from "./vue-components.
|
|
2
|
+
import { generateInputStandardSchemaFromFieldMeta as F } from "./vue-components.es10.js";
|
|
3
|
+
import b from "./vue-components.es24.js";
|
|
4
4
|
const P = /* @__PURE__ */ d({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "OmegaInput",
|
|
@@ -1,72 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
__name: "
|
|
1
|
+
import { defineComponent as a, inject as t, createBlock as n, openBlock as m, mergeProps as p, unref as s, withCtx as i, renderSlot as l, normalizeProps as f, guardReactiveProps as u } from "vue";
|
|
2
|
+
import d from "./vue-components.es4.js";
|
|
3
|
+
import { OmegaFormKey as c } from "./vue-components.es9.js";
|
|
4
|
+
const w = /* @__PURE__ */ a({
|
|
5
|
+
__name: "OmegaFormInput",
|
|
6
6
|
props: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
order: {},
|
|
13
|
-
sort: {}
|
|
7
|
+
name: {},
|
|
8
|
+
label: {},
|
|
9
|
+
validators: {},
|
|
10
|
+
options: {},
|
|
11
|
+
type: {}
|
|
14
12
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
), b = O(
|
|
33
|
-
() => k(
|
|
34
|
-
o.form.meta,
|
|
35
|
-
// include / exclude
|
|
36
|
-
u(
|
|
37
|
-
(e, r) => o.pick ? o.pick.includes(r) && !o.omit?.includes(r) : !o.omit?.includes(r)
|
|
38
|
-
),
|
|
39
|
-
(e) => e,
|
|
40
|
-
// labelMap and adding name
|
|
41
|
-
m((e, r) => ({
|
|
42
|
-
name: r,
|
|
43
|
-
label: o.labelMap?.(r) || r,
|
|
44
|
-
...e
|
|
45
|
-
})),
|
|
46
|
-
// filterMap
|
|
47
|
-
o.filterMap ? a((e) => {
|
|
48
|
-
const r = o.filterMap?.(e.name, e);
|
|
49
|
-
return r === void 0 || r === !0 ? e : r;
|
|
50
|
-
}) : (e) => e,
|
|
51
|
-
// transform to array
|
|
52
|
-
(e) => Object.values(e),
|
|
53
|
-
// order
|
|
54
|
-
l.sort(d),
|
|
55
|
-
// sort
|
|
56
|
-
o.sort ? l.sort(o.sort) : (e) => e
|
|
57
|
-
)
|
|
58
|
-
);
|
|
59
|
-
return (e, r) => (M(!0), j(E, null, A(b.value, ({ name: t, label: n, ...c }) => F(e.$slots, "default", {
|
|
60
|
-
child: { name: t, label: n, ...c }
|
|
61
|
-
}, () => [
|
|
62
|
-
g(v, h({
|
|
63
|
-
form: o.form,
|
|
64
|
-
name: t,
|
|
65
|
-
label: n
|
|
66
|
-
}, { ref_for: !0 }, c), null, 16, ["form", "name", "label"])
|
|
67
|
-
])), 256));
|
|
13
|
+
setup(g) {
|
|
14
|
+
const o = t(c);
|
|
15
|
+
if (!o)
|
|
16
|
+
throw new Error("OmegaFormInput must be used within an OmegaForm context");
|
|
17
|
+
return (e, b) => (m(), n(d, p(e.$props, {
|
|
18
|
+
form: s(o),
|
|
19
|
+
name: e.name,
|
|
20
|
+
label: e.label,
|
|
21
|
+
validators: e.validators,
|
|
22
|
+
options: e.options,
|
|
23
|
+
type: e.type
|
|
24
|
+
}), {
|
|
25
|
+
default: i((r) => [
|
|
26
|
+
l(e.$slots, "default", f(u(r)))
|
|
27
|
+
]),
|
|
28
|
+
_: 3
|
|
29
|
+
}, 16, ["form", "name", "label", "validators", "options", "type"]));
|
|
68
30
|
}
|
|
69
31
|
});
|
|
70
32
|
export {
|
|
71
|
-
|
|
33
|
+
w as default
|
|
72
34
|
};
|
|
@@ -1,62 +1,72 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
__name: "
|
|
1
|
+
import { defineComponent as _, computed as O, createElementBlock as j, openBlock as M, Fragment as E, renderList as A, renderSlot as F, createVNode as g, mergeProps as h } from "vue";
|
|
2
|
+
import { Order as s, pipe as k, Array as l } from "effect-app";
|
|
3
|
+
import v from "./vue-components.es4.js";
|
|
4
|
+
const R = /* @__PURE__ */ _({
|
|
5
|
+
__name: "OmegaAutoGen",
|
|
6
6
|
props: {
|
|
7
7
|
form: {},
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
pick: {},
|
|
9
|
+
omit: {},
|
|
10
|
+
labelMap: { type: Function },
|
|
11
|
+
filterMap: { type: Function },
|
|
12
|
+
order: {},
|
|
13
|
+
sort: {}
|
|
10
14
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
15
|
+
setup(p) {
|
|
16
|
+
const m = (e) => (r) => Object.fromEntries(
|
|
17
|
+
Object.entries(r).map(([t, n]) => [t, e(n, t)])
|
|
18
|
+
), u = (e) => (r) => Object.fromEntries(
|
|
19
|
+
Object.entries(r).filter(([t, n]) => e(n, t))
|
|
20
|
+
), a = (e) => (r) => Object.entries(r).reduce(
|
|
21
|
+
(t, [n, c]) => {
|
|
22
|
+
const i = e(c, n);
|
|
23
|
+
return i !== !1 && (t[n] = i), t;
|
|
24
|
+
},
|
|
25
|
+
{}
|
|
26
|
+
), o = p, f = (e, r) => {
|
|
27
|
+
const t = r?.indexOf(e) ?? -1;
|
|
28
|
+
return t === -1 ? Number.MAX_SAFE_INTEGER : t;
|
|
29
|
+
}, d = s.mapInput(
|
|
30
|
+
s.number,
|
|
31
|
+
(e) => f(e.name, o.order || [])
|
|
32
|
+
), b = O(
|
|
33
|
+
() => k(
|
|
34
|
+
o.form.meta,
|
|
35
|
+
// include / exclude
|
|
36
|
+
u(
|
|
37
|
+
(e, r) => o.pick ? o.pick.includes(r) && !o.omit?.includes(r) : !o.omit?.includes(r)
|
|
38
|
+
),
|
|
39
|
+
(e) => e,
|
|
40
|
+
// labelMap and adding name
|
|
41
|
+
m((e, r) => ({
|
|
42
|
+
name: r,
|
|
43
|
+
label: o.labelMap?.(r) || r,
|
|
44
|
+
...e
|
|
45
|
+
})),
|
|
46
|
+
// filterMap
|
|
47
|
+
o.filterMap ? a((e) => {
|
|
48
|
+
const r = o.filterMap?.(e.name, e);
|
|
49
|
+
return r === void 0 || r === !0 ? e : r;
|
|
50
|
+
}) : (e) => e,
|
|
51
|
+
// transform to array
|
|
52
|
+
(e) => Object.values(e),
|
|
53
|
+
// order
|
|
54
|
+
l.sort(d),
|
|
55
|
+
// sort
|
|
56
|
+
o.sort ? l.sort(o.sort) : (e) => e
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
return (e, r) => (M(!0), j(E, null, A(b.value, ({ name: t, label: n, ...c }) => F(e.$slots, "default", {
|
|
60
|
+
child: { name: t, label: n, ...c }
|
|
61
|
+
}, () => [
|
|
62
|
+
g(v, h({
|
|
63
|
+
form: o.form,
|
|
64
|
+
name: t,
|
|
65
|
+
label: n
|
|
66
|
+
}, { ref_for: !0 }, c), null, 16, ["form", "name", "label"])
|
|
67
|
+
])), 256));
|
|
58
68
|
}
|
|
59
69
|
});
|
|
60
70
|
export {
|
|
61
|
-
|
|
71
|
+
R as default
|
|
62
72
|
};
|
|
@@ -1,31 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { defineComponent as g, onMounted as c, computed as M, provide as F, createBlock as p, openBlock as s, resolveDynamicComponent as u, withCtx as i, createElementBlock as $, renderSlot as l, Fragment as h, renderList as k, mergeProps as v, normalizeProps as _, guardReactiveProps as A } from "vue";
|
|
2
|
+
import { createMeta as S } from "./vue-components.es10.js";
|
|
3
|
+
const C = /* @__PURE__ */ g({
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "OmegaArray",
|
|
6
|
+
props: {
|
|
7
|
+
form: {},
|
|
8
|
+
name: {},
|
|
9
|
+
items: {}
|
|
10
|
+
},
|
|
11
|
+
setup(f) {
|
|
12
|
+
const n = f;
|
|
13
|
+
c(() => {
|
|
14
|
+
n.items && n.form.setFieldValue(n.name, n.items);
|
|
15
|
+
});
|
|
16
|
+
const d = M(() => {
|
|
17
|
+
const e = n.form.meta[n.name];
|
|
18
|
+
if (e && e.type === "multiple") {
|
|
19
|
+
const o = e.rest.reduce((t, r) => r.type._tag === "TypeLiteral" ? {
|
|
20
|
+
...t,
|
|
21
|
+
propertySignatures: [
|
|
22
|
+
...t.propertySignatures || [],
|
|
23
|
+
...r.type.propertySignatures
|
|
24
|
+
]
|
|
25
|
+
} : {
|
|
26
|
+
...t,
|
|
27
|
+
property: r.type
|
|
28
|
+
}, {}), a = S({ ...o, meta: e });
|
|
29
|
+
return (t) => {
|
|
30
|
+
if (t.endsWith("]")) return a;
|
|
31
|
+
const r = t.split("]."), m = r[r.length - 1];
|
|
32
|
+
return a[m];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return (o) => {
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
return F("getMetaFromArray", d), (e, o) => (s(), p(u(e.form.Field), { name: e.name }, {
|
|
39
|
+
default: i(({ field: a }) => [
|
|
40
|
+
(s(!0), $(h, null, k(a.state.value, (y, t) => (s(), p(u(e.form.Field), {
|
|
41
|
+
key: `${e.name}[${Number(t)}]`,
|
|
42
|
+
name: `${e.name}[${Number(t)}]`
|
|
43
|
+
}, {
|
|
44
|
+
default: i(({ field: r, state: m }) => [
|
|
45
|
+
l(e.$slots, "default", v({ ref_for: !0 }, {
|
|
46
|
+
field: a,
|
|
47
|
+
subField: r,
|
|
48
|
+
subState: m,
|
|
49
|
+
index: Number(t)
|
|
50
|
+
}))
|
|
51
|
+
]),
|
|
52
|
+
_: 2
|
|
53
|
+
}, 1032, ["name"]))), 128)),
|
|
54
|
+
l(e.$slots, "field", _(A({ field: a })))
|
|
55
|
+
]),
|
|
56
|
+
_: 3
|
|
57
|
+
}, 8, ["name"]));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
27
60
|
export {
|
|
28
|
-
|
|
29
|
-
g as provideOmegaErrors,
|
|
30
|
-
O as useOmegaErrors
|
|
61
|
+
C as default
|
|
31
62
|
};
|