@appmax_npm/ds-prime 1.0.0-alpha.102 → 1.0.0-alpha.104
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/amform/index.js +32 -13
- package/package.json +1 -1
package/amform/index.js
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
|
-
import { defineComponent as m, openBlock as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { zodResolver as
|
|
4
|
-
const
|
|
5
|
-
...
|
|
6
|
-
props: {
|
|
1
|
+
import { defineComponent as v, mergeModels as p, ref as n, useModel as _, computed as h, watch as f, nextTick as m, openBlock as k, createBlock as w, unref as c, withCtx as y, renderSlot as R, normalizeProps as V, guardReactiveProps as g } from "vue";
|
|
2
|
+
import { Form as x } from "@primevue/forms";
|
|
3
|
+
import { zodResolver as M } from "@primevue/forms/resolvers/zod";
|
|
4
|
+
const b = { name: "AmForm" }, C = /* @__PURE__ */ v({
|
|
5
|
+
...b,
|
|
6
|
+
props: /* @__PURE__ */ p({
|
|
7
7
|
schema: {}
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
}, {
|
|
9
|
+
modelValue: { type: Object, default: () => ({}) },
|
|
10
|
+
modelModifiers: {}
|
|
11
|
+
}),
|
|
12
|
+
emits: ["update:modelValue"],
|
|
13
|
+
setup(s) {
|
|
14
|
+
const d = M(s.schema), r = n(), l = _(s, "modelValue"), t = n(!1), i = h(() => {
|
|
15
|
+
var o;
|
|
16
|
+
const e = (o = r.value) == null ? void 0 : o.states;
|
|
17
|
+
return e ? Object.keys(e).reduce((a, u) => (a[u] = e[u].value, a), {}) : {};
|
|
18
|
+
});
|
|
19
|
+
return f(
|
|
20
|
+
() => l.value,
|
|
21
|
+
async (e) => {
|
|
22
|
+
!r.value || t.value || (t.value = !0, r.value.setValues(e), await m(), t.value = !1);
|
|
23
|
+
}
|
|
24
|
+
), f(i, async (e) => {
|
|
25
|
+
t.value || (t.value = !0, l.value = e, await m(), t.value = !1);
|
|
26
|
+
}), (e, o) => (k(), w(c(x), {
|
|
27
|
+
ref_key: "formRef",
|
|
28
|
+
ref: r,
|
|
29
|
+
resolver: c(d)
|
|
30
|
+
}, {
|
|
31
|
+
default: y((a) => [
|
|
32
|
+
R(e.$slots, "default", V(g(a)))
|
|
14
33
|
]),
|
|
15
34
|
_: 3
|
|
16
35
|
}, 8, ["resolver"]));
|
|
17
36
|
}
|
|
18
37
|
});
|
|
19
38
|
export {
|
|
20
|
-
|
|
39
|
+
C as default
|
|
21
40
|
};
|