@levo-so/react 0.1.16 → 0.1.17
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/{CheckboxWidget-CNoS-2W3.js → CheckboxWidget-CZWSPzDj.js} +1 -1
- package/dist/{CollectionFormBuilder-MAo2Ob3a.js → CollectionFormBuilder-nZcXob6G.js} +17 -17
- package/dist/{CurrencyWidget-Cu1Cthnw.js → CurrencyWidget-CvosXYBi.js} +1 -1
- package/dist/{DateTimeWidget-N-wuCRSJ.js → DateTimeWidget-CE0EPFkl.js} +1 -1
- package/dist/{DefaultFormVariant-IqWi1BiT.js → DefaultFormVariant-DiaIcOyu.js} +2 -2
- package/dist/{DropdownWidget-BFttB4b-.js → DropdownWidget-BquZdGIL.js} +1 -1
- package/dist/{EmailWidget-D_SqXx3M.js → EmailWidget-KnkQjB4I.js} +1 -1
- package/dist/{FormCaptcha-CJ9KgDu0.js → FormCaptcha-DNPGf2xY.js} +68 -68
- package/dist/{GeocoderWidget-Bxt3TeAf.js → GeocoderWidget-DNkRmCVB.js} +1 -1
- package/dist/{MultiGeocoderWidget-DFjuXZBN.js → MultiGeocoderWidget-D2Vh9SuR.js} +2 -2
- package/dist/{MultiTextWidget-CZzT51cH.js → MultiTextWidget-Ktmx0-ou.js} +1 -1
- package/dist/{PhoneWidget--K5aS16s.js → PhoneWidget-2JMw1hQ-.js} +1 -1
- package/dist/{RadioWidget-BbMPtR3P.js → RadioWidget-CsMqjCtP.js} +1 -1
- package/dist/{RichTextWidget-Cce3Bw8d.js → RichTextWidget-CesaOZze.js} +1 -1
- package/dist/{StepsFormVariant-5wZbYAA9.js → StepsFormVariant-FXwgPUG0.js} +2 -2
- package/dist/{SwitchWidget-B0wkSWxa.js → SwitchWidget-W7FLoMLu.js} +1 -1
- package/dist/{TextWidget-ldbMuLB0.js → TextWidget-B6Y4Jjld.js} +1 -1
- package/dist/{TextareaWidget-S8bKUTv0.js → TextareaWidget-TszSrgEj.js} +1 -1
- package/dist/{ToggleCheckboxWidget-CPduXE6Y.js → ToggleCheckboxWidget-sJoiRMME.js} +1 -1
- package/dist/{URLWidget-KbhE2ZUA.js → URLWidget-BjFx8Uf7.js} +2 -2
- package/dist/{UploadWidget-DFvfDUT6.js → UploadWidget-Dzop6rEv.js} +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/collection/lib/SaveDraftValues.d.ts.map +1 -1
- package/dist/collection/lib/hooks/useLevoForm.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
|
@@ -3,7 +3,7 @@ import { j as a } from "./jsx-runtime-B6kdoens.js";
|
|
|
3
3
|
import { useState as w, useEffect as B } from "react";
|
|
4
4
|
import { useController as E } from "react-hook-form";
|
|
5
5
|
import { c as C } from "./cn-C9QoOYNG.js";
|
|
6
|
-
import { z as O, A as I, B as x } from "./CollectionFormBuilder-
|
|
6
|
+
import { z as O, A as I, B as x } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
7
7
|
import { C as g } from "./Checbox-sq-atGlJ.js";
|
|
8
8
|
import { I as S } from "./Input-2CvZ90f8.js";
|
|
9
9
|
const L = ({ field: i }) => {
|
|
@@ -919,26 +919,26 @@ const dt = E.lazy(
|
|
|
919
919
|
}
|
|
920
920
|
);
|
|
921
921
|
}, pt = v(
|
|
922
|
-
() => import("./MultiTextWidget-
|
|
923
|
-
), ie = v(() => import("./TextWidget-
|
|
924
|
-
() => import("./CurrencyWidget-
|
|
922
|
+
() => import("./MultiTextWidget-Ktmx0-ou.js")
|
|
923
|
+
), ie = v(() => import("./TextWidget-B6Y4Jjld.js")), xt = v(
|
|
924
|
+
() => import("./CurrencyWidget-CvosXYBi.js")
|
|
925
925
|
), ht = v(
|
|
926
|
-
() => import("./CheckboxWidget-
|
|
926
|
+
() => import("./CheckboxWidget-CZWSPzDj.js")
|
|
927
927
|
), ce = v(
|
|
928
|
-
() => import("./DateTimeWidget-
|
|
928
|
+
() => import("./DateTimeWidget-CE0EPFkl.js")
|
|
929
929
|
), de = v(
|
|
930
|
-
() => import("./DropdownWidget-
|
|
931
|
-
), yt = v(() => import("./EmailWidget-
|
|
932
|
-
() => import("./GeocoderWidget-
|
|
930
|
+
() => import("./DropdownWidget-BquZdGIL.js")
|
|
931
|
+
), yt = v(() => import("./EmailWidget-KnkQjB4I.js")), ft = v(
|
|
932
|
+
() => import("./GeocoderWidget-DNkRmCVB.js")
|
|
933
933
|
), jt = v(
|
|
934
|
-
() => import("./MultiGeocoderWidget-
|
|
935
|
-
), bt = v(() => import("./PhoneWidget
|
|
936
|
-
() => import("./RichTextWidget-
|
|
937
|
-
), wt = v(() => import("./SwitchWidget-
|
|
938
|
-
() => import("./TextareaWidget-
|
|
934
|
+
() => import("./MultiGeocoderWidget-D2Vh9SuR.js")
|
|
935
|
+
), bt = v(() => import("./PhoneWidget-2JMw1hQ-.js")), vt = v(() => import("./RadioWidget-CsMqjCtP.js")), Ct = v(
|
|
936
|
+
() => import("./RichTextWidget-CesaOZze.js")
|
|
937
|
+
), wt = v(() => import("./SwitchWidget-W7FLoMLu.js")), kt = v(
|
|
938
|
+
() => import("./TextareaWidget-TszSrgEj.js")
|
|
939
939
|
), Wt = v(
|
|
940
|
-
() => import("./ToggleCheckboxWidget-
|
|
941
|
-
), _t = v(() => import("./URLWidget-
|
|
940
|
+
() => import("./ToggleCheckboxWidget-sJoiRMME.js")
|
|
941
|
+
), _t = v(() => import("./URLWidget-BjFx8Uf7.js")), K = v(() => import("./UploadWidget-Dzop6rEv.js")), Nt = ({
|
|
942
942
|
field: e,
|
|
943
943
|
isInternal: n
|
|
944
944
|
}) => {
|
|
@@ -1107,9 +1107,9 @@ const dt = E.lazy(
|
|
|
1107
1107
|
e
|
|
1108
1108
|
] });
|
|
1109
1109
|
}, ns = () => E.useContext(Ce), Tt = E.lazy(
|
|
1110
|
-
() => import("./DefaultFormVariant-
|
|
1110
|
+
() => import("./DefaultFormVariant-DiaIcOyu.js")
|
|
1111
1111
|
), Mt = E.lazy(
|
|
1112
|
-
() => import("./StepsFormVariant-
|
|
1112
|
+
() => import("./StepsFormVariant-FXwgPUG0.js")
|
|
1113
1113
|
), At = ({
|
|
1114
1114
|
formVariant: e,
|
|
1115
1115
|
...n
|
|
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-B6kdoens.js";
|
|
|
2
2
|
import { useController as j } from "react-hook-form";
|
|
3
3
|
import { NumericFormat as F } from "react-number-format";
|
|
4
4
|
import { c as w } from "./cn-C9QoOYNG.js";
|
|
5
|
-
import { z as C, A as B, B as N } from "./CollectionFormBuilder-
|
|
5
|
+
import { z as C, A as B, B as N } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
6
6
|
const V = ({
|
|
7
7
|
field: r,
|
|
8
8
|
...m
|
|
@@ -4,7 +4,7 @@ import { Calendar as w, X as N } from "lucide-react";
|
|
|
4
4
|
import * as l from "react-datepicker";
|
|
5
5
|
import { useController as v } from "react-hook-form";
|
|
6
6
|
import { c as p } from "./cn-C9QoOYNG.js";
|
|
7
|
-
import { z as M, A as D, B as C } from "./CollectionFormBuilder-
|
|
7
|
+
import { z as M, A as D, B as C } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
8
8
|
import { I as F } from "./Input-2CvZ90f8.js";
|
|
9
9
|
const T = l.default.default || l.default || l, I = (e) => {
|
|
10
10
|
if (e) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import { FormProvider as y } from "react-hook-form";
|
|
3
3
|
import { c as t } from "./cn-C9QoOYNG.js";
|
|
4
|
-
import { D as F, F as g } from "./CollectionFormBuilder-
|
|
5
|
-
import { u as w, S as N, F as b } from "./FormCaptcha-
|
|
4
|
+
import { D as F, F as g } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
5
|
+
import { u as w, S as N, F as b } from "./FormCaptcha-DNPGf2xY.js";
|
|
6
6
|
import { B as D } from "./Spinner-Bzu2xCFZ.js";
|
|
7
7
|
const _ = () => {
|
|
8
8
|
var n;
|
|
@@ -4,7 +4,7 @@ import { useState as x, useEffect as w } from "react";
|
|
|
4
4
|
import { useController as B } from "react-hook-form";
|
|
5
5
|
import D from "react-select";
|
|
6
6
|
import { c as y } from "./cn-C9QoOYNG.js";
|
|
7
|
-
import { z as N, A as k, B as q } from "./CollectionFormBuilder-
|
|
7
|
+
import { z as N, A as k, B as q } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
8
8
|
import { I as L } from "./Input-2CvZ90f8.js";
|
|
9
9
|
const G = ({
|
|
10
10
|
field: s,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as r } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import { useController as y } from "react-hook-form";
|
|
3
3
|
import { G as C } from "./Spinner-Bzu2xCFZ.js";
|
|
4
|
-
import { z as F, A as I, B as V } from "./CollectionFormBuilder-
|
|
4
|
+
import { z as F, A as I, B as V } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
5
5
|
import { I as b } from "./Input-2CvZ90f8.js";
|
|
6
6
|
function w(e) {
|
|
7
7
|
return C({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M1.75 3h20.5c.966 0 1.75.784 1.75 1.75v14a1.75 1.75 0 0 1-1.75 1.75H1.75A1.75 1.75 0 0 1 0 18.75v-14C0 3.784.784 3 1.75 3ZM1.5 7.412V18.75c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25V7.412l-9.52 6.433c-.592.4-1.368.4-1.96 0Zm0-2.662v.852l10.36 7a.25.25 0 0 0 .28 0l10.36-7V4.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z" }, child: [] }] })(e);
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useEffect as O, useState as L, useRef as
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { useDebouncedCallback as
|
|
2
|
+
import { useEffect as O, useState as L, useRef as J } from "react";
|
|
3
|
+
import { useFormContext as W, useWatch as Y, useForm as B, useController as G } from "react-hook-form";
|
|
4
|
+
import { useDebouncedCallback as H } from "use-debounce";
|
|
5
5
|
import { u as x } from "./LevoProvider-BAZy7_tP.js";
|
|
6
|
-
import { D as C,
|
|
7
|
-
import { s as
|
|
8
|
-
import { e as
|
|
9
|
-
import { a as
|
|
10
|
-
import { j as
|
|
6
|
+
import { D as C, s as z, h as Q, c as X, A as Z } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
7
|
+
import { s as m } from "./Sonner-t6JVKA0a.js";
|
|
8
|
+
import { e as T } from "./errorHandler-_34Yv8wA.js";
|
|
9
|
+
import { a as h } from "./isEmptyObject-C5s4GzLE.js";
|
|
10
|
+
import { j as U } from "./jsx-runtime-B6kdoens.js";
|
|
11
11
|
import "altcha";
|
|
12
12
|
const R = {
|
|
13
13
|
FORM_DIRTY: "form-dirty",
|
|
14
14
|
FORM_VALUES: "form-values"
|
|
15
|
-
},
|
|
15
|
+
}, tt = (t) => {
|
|
16
16
|
const o = localStorage.getItem(`${t}-${R.FORM_VALUES}`);
|
|
17
17
|
return o ? JSON.parse(o) : {};
|
|
18
|
-
},
|
|
18
|
+
}, et = (t, o) => {
|
|
19
19
|
localStorage.setItem(
|
|
20
20
|
`${t}-${R.FORM_VALUES}`,
|
|
21
21
|
JSON.stringify(o)
|
|
22
22
|
);
|
|
23
|
-
},
|
|
23
|
+
}, M = (t) => {
|
|
24
24
|
localStorage.removeItem(`${t}-${R.FORM_VALUES}`);
|
|
25
|
-
},
|
|
25
|
+
}, rt = async ({
|
|
26
26
|
collection_key: t,
|
|
27
27
|
data: o
|
|
28
28
|
}) => {
|
|
@@ -37,93 +37,93 @@ const R = {
|
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
return e != null && e.ok ? await e.json() : null;
|
|
40
|
-
},
|
|
40
|
+
}, yt = ({ currentValues: t, isError: o, getContentId: c }) => {
|
|
41
41
|
var I;
|
|
42
|
-
const { schema: e, isLoggedIn:
|
|
43
|
-
e != null && e.key && !o && e != null && e.allow_draft && (
|
|
42
|
+
const { schema: e, isLoggedIn: a } = C(), r = W(), s = Y(), g = H((v) => {
|
|
43
|
+
e != null && e.key && !o && e != null && e.allow_draft && (a ? rt({
|
|
44
44
|
collection_key: e == null ? void 0 : e.key,
|
|
45
45
|
data: v
|
|
46
46
|
}).then((l) => {
|
|
47
|
-
var E,
|
|
48
|
-
(
|
|
49
|
-
}) :
|
|
47
|
+
var E, _, V, d;
|
|
48
|
+
(_ = (E = l == null ? void 0 : l.content) == null ? void 0 : E.data) != null && _._id && c((d = (V = l == null ? void 0 : l.content) == null ? void 0 : V.data) == null ? void 0 : d._id);
|
|
49
|
+
}) : et(e == null ? void 0 : e.key, v));
|
|
50
50
|
}, 2500);
|
|
51
51
|
return O(() => {
|
|
52
52
|
var v, l;
|
|
53
|
-
o || (v = r == null ? void 0 : r.formState) != null && v.isDirty && ((l = Object == null ? void 0 : Object.keys(s || {})) == null ? void 0 : l.length) > 0 &&
|
|
54
|
-
|
|
53
|
+
o || (v = r == null ? void 0 : r.formState) != null && v.isDirty && ((l = Object == null ? void 0 : Object.keys(s || {})) == null ? void 0 : l.length) > 0 && (g.cancel(), g({
|
|
54
|
+
...t,
|
|
55
55
|
...s
|
|
56
|
-
});
|
|
57
|
-
}, [(I = r == null ? void 0 : r.formState) == null ? void 0 : I.isDirty, o,
|
|
58
|
-
},
|
|
56
|
+
}));
|
|
57
|
+
}, [(I = r == null ? void 0 : r.formState) == null ? void 0 : I.isDirty, o, a, s]), null;
|
|
58
|
+
}, pt = ({
|
|
59
59
|
schema: t,
|
|
60
60
|
saveToRemote: o,
|
|
61
61
|
onSubmit: c,
|
|
62
62
|
onSubmitSuccess: e,
|
|
63
|
-
onSubmitError:
|
|
63
|
+
onSubmitError: a
|
|
64
64
|
}) => {
|
|
65
65
|
const { collection: r } = x(), {
|
|
66
66
|
toastConfig: s,
|
|
67
|
-
onSuccess:
|
|
67
|
+
onSuccess: g,
|
|
68
68
|
onError: I,
|
|
69
69
|
isLoggedIn: v,
|
|
70
70
|
isDisabled: l,
|
|
71
71
|
externalInitialValues: E = {}
|
|
72
|
-
} = C(), [
|
|
72
|
+
} = C(), [_, V] = L({}), [d, w] = L(null), [N, $] = L(!1), [P, A] = L(!1), n = J({}), F = B({
|
|
73
73
|
mode: "all",
|
|
74
74
|
disabled: l,
|
|
75
|
-
defaultValues:
|
|
76
|
-
values:
|
|
75
|
+
defaultValues: _,
|
|
76
|
+
values: _,
|
|
77
77
|
resetOptions: {
|
|
78
78
|
keepErrors: !0
|
|
79
79
|
}
|
|
80
|
-
}),
|
|
81
|
-
var
|
|
80
|
+
}), q = F.handleSubmit(async (y) => {
|
|
81
|
+
var k, S, p, i, j, D;
|
|
82
82
|
if (n.current = {
|
|
83
83
|
...n.current || {},
|
|
84
84
|
...y
|
|
85
85
|
}, o && r) {
|
|
86
86
|
if (t)
|
|
87
87
|
try {
|
|
88
|
-
const
|
|
88
|
+
const f = z(n == null ? void 0 : n.current, t);
|
|
89
89
|
let u = null;
|
|
90
|
-
if (d ? u = await (r == null ? void 0 : r.submitDraftEntry(t == null ? void 0 : t.key,
|
|
90
|
+
if (d ? u = await (r == null ? void 0 : r.submitDraftEntry(t == null ? void 0 : t.key, f).catch((b) => (T(b), null))) : u = await (r == null ? void 0 : r.saveCollectionData({
|
|
91
91
|
collection_id: t == null ? void 0 : t.id,
|
|
92
|
-
data:
|
|
93
|
-
}).catch((b) => (
|
|
94
|
-
return s != null && s.showSuccessToast &&
|
|
92
|
+
data: f
|
|
93
|
+
}).catch((b) => (T(b), null))), (k = u == null ? void 0 : u.content) != null && k.data)
|
|
94
|
+
return s != null && s.showSuccessToast && m(
|
|
95
95
|
s.successToastText || "Form submitted successfully."
|
|
96
|
-
), n.current =
|
|
96
|
+
), n.current = h(E) ? {} : { ...E }, M(t == null ? void 0 : t.key), w(null), g && g({
|
|
97
97
|
schemaId: t == null ? void 0 : t.id,
|
|
98
|
-
response: (
|
|
99
|
-
}), e && e(),
|
|
98
|
+
response: (S = u == null ? void 0 : u.content) == null ? void 0 : S.data
|
|
99
|
+
}), e && e(), F.reset(), F.clearErrors(), !0;
|
|
100
100
|
throw new Error("Failed to save form details, API response invalid");
|
|
101
|
-
} catch (
|
|
102
|
-
const u = (j = (i = (p =
|
|
103
|
-
return
|
|
101
|
+
} catch (f) {
|
|
102
|
+
const u = (j = (i = (p = f == null ? void 0 : f.response) == null ? void 0 : p.data) == null ? void 0 : i.content) == null ? void 0 : j.errors;
|
|
103
|
+
return Q(u, F.setError), a && a(u), I && I(((D = f == null ? void 0 : f.response) == null ? void 0 : D.data) || f), !1;
|
|
104
104
|
}
|
|
105
105
|
return !1;
|
|
106
106
|
}
|
|
107
107
|
y && c && c(y);
|
|
108
|
-
}),
|
|
108
|
+
}), K = (y) => {
|
|
109
109
|
y && y !== d && w(y);
|
|
110
110
|
};
|
|
111
111
|
return O(() => {
|
|
112
112
|
if (t && r) {
|
|
113
|
-
const y =
|
|
113
|
+
const y = X(t);
|
|
114
114
|
if (n.current = {
|
|
115
115
|
...y,
|
|
116
116
|
...E || {},
|
|
117
117
|
...n.current || {}
|
|
118
118
|
}, !d && t != null && t.allow_draft) {
|
|
119
119
|
if (v) {
|
|
120
|
-
$(!0), r == null || r.getDraftEntry(t == null ? void 0 : t.key).then((
|
|
121
|
-
if (
|
|
120
|
+
$(!0), r == null || r.getDraftEntry(t == null ? void 0 : t.key).then((S) => {
|
|
121
|
+
if (S === null) {
|
|
122
122
|
A(!0);
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
A(!1);
|
|
126
|
-
const p = Array.isArray(
|
|
126
|
+
const p = Array.isArray(S) ? S == null ? void 0 : S.filter((i) => (i == null ? void 0 : i._status) === "draft") : [];
|
|
127
127
|
if ((p == null ? void 0 : p.length) > 0) {
|
|
128
128
|
const i = (p == null ? void 0 : p[0]) || {};
|
|
129
129
|
i != null && i._id && (n.current = {
|
|
@@ -132,50 +132,50 @@ const R = {
|
|
|
132
132
|
}, w(i == null ? void 0 : i._id));
|
|
133
133
|
}
|
|
134
134
|
}).catch(() => null).finally(() => {
|
|
135
|
-
|
|
135
|
+
V({
|
|
136
136
|
...n == null ? void 0 : n.current
|
|
137
137
|
}), $(!1);
|
|
138
138
|
});
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
...
|
|
144
|
-
...
|
|
141
|
+
const k = tt(t == null ? void 0 : t.key);
|
|
142
|
+
k && (n.current = {
|
|
143
|
+
...n.current || {},
|
|
144
|
+
...k
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
V({
|
|
148
148
|
...(n == null ? void 0 : n.current) || {}
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
}, [t]), O(() => {
|
|
152
|
-
t && d &&
|
|
152
|
+
t && d && M(t == null ? void 0 : t.key);
|
|
153
153
|
}, [d]), {
|
|
154
|
-
methods:
|
|
155
|
-
isLoading:
|
|
156
|
-
isError:
|
|
154
|
+
methods: F,
|
|
155
|
+
isLoading: N,
|
|
156
|
+
isError: P,
|
|
157
157
|
contentId: d,
|
|
158
158
|
allFormValues: n.current,
|
|
159
|
-
handleContentId:
|
|
160
|
-
handleSubmit:
|
|
159
|
+
handleContentId: K,
|
|
160
|
+
handleSubmit: q
|
|
161
161
|
};
|
|
162
|
-
},
|
|
163
|
-
const { isInternal: t } = C(), { client: o } = x(), c =
|
|
162
|
+
}, gt = () => {
|
|
163
|
+
const { isInternal: t } = C(), { client: o } = x(), c = J(null), {
|
|
164
164
|
field: { onChange: e },
|
|
165
|
-
fieldState: { error:
|
|
166
|
-
} =
|
|
165
|
+
fieldState: { error: a }
|
|
166
|
+
} = G({
|
|
167
167
|
name: "__captcha",
|
|
168
168
|
rules: {
|
|
169
169
|
required: t ? !1 : "Verification is required"
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
return O(() => {
|
|
173
|
-
const r = (
|
|
174
|
-
"detail" in
|
|
173
|
+
const r = (g) => {
|
|
174
|
+
"detail" in g && e(g.detail.state || null);
|
|
175
175
|
}, { current: s } = c;
|
|
176
176
|
if (s)
|
|
177
177
|
return s.addEventListener("statechange", r), () => s.removeEventListener("statechange", r);
|
|
178
|
-
}, []), /* @__PURE__ */
|
|
178
|
+
}, []), /* @__PURE__ */ U.jsx(Z, { error: a == null ? void 0 : a.message, children: /* @__PURE__ */ U.jsx(
|
|
179
179
|
"altcha-widget",
|
|
180
180
|
{
|
|
181
181
|
ref: c,
|
|
@@ -191,7 +191,7 @@ const R = {
|
|
|
191
191
|
) });
|
|
192
192
|
};
|
|
193
193
|
export {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
gt as F,
|
|
195
|
+
yt as S,
|
|
196
|
+
pt as u
|
|
197
197
|
};
|
|
@@ -3,7 +3,7 @@ import { j as o } from "./jsx-runtime-B6kdoens.js";
|
|
|
3
3
|
import { useState as p, useEffect as v } from "react";
|
|
4
4
|
import { useController as z } from "react-hook-form";
|
|
5
5
|
import { n as T } from "./Spinner-Bzu2xCFZ.js";
|
|
6
|
-
import { z as k, A as q, B as A } from "./CollectionFormBuilder-
|
|
6
|
+
import { z as k, A as q, B as A } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
7
7
|
import { I as E } from "./Input-2CvZ90f8.js";
|
|
8
8
|
import { u as O } from "./LevoProvider-BAZy7_tP.js";
|
|
9
9
|
const $ = ({ field: t }) => {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
3
3
|
import { Plus as m } from "lucide-react";
|
|
4
4
|
import { useFieldArray as n } from "react-hook-form";
|
|
5
|
-
import { B as c } from "./CollectionFormBuilder-
|
|
6
|
-
import { GeocoderWidget as d } from "./GeocoderWidget-
|
|
5
|
+
import { B as c } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
6
|
+
import { GeocoderWidget as d } from "./GeocoderWidget-DNkRmCVB.js";
|
|
7
7
|
import { B as p } from "./Spinner-Bzu2xCFZ.js";
|
|
8
8
|
const k = ({
|
|
9
9
|
field: l
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as a } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import { useController as A } from "react-hook-form";
|
|
3
|
-
import { z as C, A as b, B as q } from "./CollectionFormBuilder-
|
|
3
|
+
import { z as C, A as b, B as q } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
4
4
|
import { I } from "./Input-2CvZ90f8.js";
|
|
5
5
|
const f = ({ field: r }) => {
|
|
6
6
|
var l;
|
|
@@ -3,7 +3,7 @@ import { j as o } from "./jsx-runtime-B6kdoens.js";
|
|
|
3
3
|
import { useController as f } from "react-hook-form";
|
|
4
4
|
import { PhoneInput as g } from "react-international-phone";
|
|
5
5
|
import { c as l } from "./cn-C9QoOYNG.js";
|
|
6
|
-
import { z as x, A as v, B as y } from "./CollectionFormBuilder-
|
|
6
|
+
import { z as x, A as v, B as y } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
7
7
|
const P = ({ field: e }) => {
|
|
8
8
|
const { key: u = "", label: t = "", helper_text: c = "", readonly: n = !1 } = e, s = u, {
|
|
9
9
|
field: { value: d, onBlur: a, onChange: i, ...m },
|
|
@@ -5,7 +5,7 @@ import * as d from "react";
|
|
|
5
5
|
import { useController as F } from "react-hook-form";
|
|
6
6
|
import { G as B } from "./Spinner-Bzu2xCFZ.js";
|
|
7
7
|
import { c as N } from "./cn-C9QoOYNG.js";
|
|
8
|
-
import { z as E, A as G, B as f } from "./CollectionFormBuilder-
|
|
8
|
+
import { z as E, A as G, B as f } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
9
9
|
import { I as V } from "./Input-2CvZ90f8.js";
|
|
10
10
|
function q(s) {
|
|
11
11
|
return B({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M416 128 192 384l-96-96" }, child: [] }] })(s);
|
|
@@ -19,7 +19,7 @@ import { useState as q, useEffect as D } from "react";
|
|
|
19
19
|
import { useController as G } from "react-hook-form";
|
|
20
20
|
import { G as p, o as J, p as V, q as W, r as Z, s as _, t as P, u as K, v as Q, w as X, x as Y, y as $, z as nn } from "./Spinner-Bzu2xCFZ.js";
|
|
21
21
|
import { c as j } from "./cn-C9QoOYNG.js";
|
|
22
|
-
import { z as ln, A as en, B as sn } from "./CollectionFormBuilder-
|
|
22
|
+
import { z as ln, A as en, B as sn } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
23
23
|
function an(n) {
|
|
24
24
|
return p({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 0 1-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 0 1-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 0 0-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z" }, child: [] }] })(n);
|
|
25
25
|
}
|
|
@@ -3,8 +3,8 @@ import { j as t } from "./jsx-runtime-B6kdoens.js";
|
|
|
3
3
|
import { useState as I, useMemo as y } from "react";
|
|
4
4
|
import { FormProvider as T } from "react-hook-form";
|
|
5
5
|
import { c as F } from "./cn-C9QoOYNG.js";
|
|
6
|
-
import { D as N, F as _ } from "./CollectionFormBuilder-
|
|
7
|
-
import { u as C, S as H, F as M } from "./FormCaptcha-
|
|
6
|
+
import { D as N, F as _ } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
7
|
+
import { u as C, S as H, F as M } from "./FormCaptcha-DNPGf2xY.js";
|
|
8
8
|
import { B as g } from "./Spinner-Bzu2xCFZ.js";
|
|
9
9
|
const Y = () => {
|
|
10
10
|
const [n, a] = I(0), { containerStyles: m } = N(), l = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as r } from "./jsx-runtime-B6kdoens.js";
|
|
3
3
|
import { useController as k } from "react-hook-form";
|
|
4
|
-
import { z as w, A as j, B as v } from "./CollectionFormBuilder-
|
|
4
|
+
import { z as w, A as j, B as v } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
5
5
|
import * as c from "@radix-ui/react-switch";
|
|
6
6
|
import * as y from "react";
|
|
7
7
|
import { c as d } from "./cn-C9QoOYNG.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import { useFormContext as g, get as h } from "react-hook-form";
|
|
3
3
|
import { c as j } from "./cn-C9QoOYNG.js";
|
|
4
|
-
import { A as F, B as b, z as y } from "./CollectionFormBuilder-
|
|
4
|
+
import { A as F, B as b, z as y } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
5
5
|
import { I as f } from "./Input-2CvZ90f8.js";
|
|
6
6
|
const k = ({
|
|
7
7
|
field: r,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import { useFormContext as u, get as x } from "react-hook-form";
|
|
3
3
|
import { c as b } from "./cn-C9QoOYNG.js";
|
|
4
|
-
import { A as g, B as f, z as h } from "./CollectionFormBuilder-
|
|
4
|
+
import { A as g, B as f, z as h } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
5
5
|
const w = ({ field: e }) => {
|
|
6
6
|
var a;
|
|
7
7
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as r } from "./jsx-runtime-B6kdoens.js";
|
|
3
3
|
import { useController as p } from "react-hook-form";
|
|
4
|
-
import { z as u, A as g, B as C } from "./CollectionFormBuilder-
|
|
4
|
+
import { z as u, A as g, B as C } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
5
5
|
import { C as f } from "./Checbox-sq-atGlJ.js";
|
|
6
6
|
const y = ({
|
|
7
7
|
field: e
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { H as s } from "./CollectionFormBuilder-
|
|
3
|
-
import r from "./TextWidget-
|
|
2
|
+
import { H as s } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
3
|
+
import r from "./TextWidget-B6Y4Jjld.js";
|
|
4
4
|
const a = (t) => /* @__PURE__ */ e.jsx(
|
|
5
5
|
r,
|
|
6
6
|
{
|
|
@@ -5,7 +5,7 @@ import { X, Upload as O, ExternalLink as aa } from "lucide-react";
|
|
|
5
5
|
import { useMemo as J, useState as U, useRef as ra, useEffect as M } from "react";
|
|
6
6
|
import { useController as ta } from "react-hook-form";
|
|
7
7
|
import { G as H, B as P, S as G, j as sa, T as ea, k as oa, l as $, m as V } from "./Spinner-Bzu2xCFZ.js";
|
|
8
|
-
import { t as na, g as ca, z as la, w as C, A as da, B as ia } from "./CollectionFormBuilder-
|
|
8
|
+
import { t as na, g as ca, z as la, w as C, A as da, B as ia } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
9
9
|
import { u as k } from "./LevoProvider-BAZy7_tP.js";
|
|
10
10
|
import { e as Y } from "./errorHandler-_34Yv8wA.js";
|
|
11
11
|
import { I as K } from "./Input-2CvZ90f8.js";
|
package/dist/collection/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as s, F as r, e as t, b as i, c as l, f as o, g as d, d as m, i as u, a as n, p as f, h as F, s as g, u as p, v as V } from "../CollectionFormBuilder-
|
|
1
|
+
import { C as s, F as r, e as t, b as i, c as l, f as o, g as d, d as m, i as u, a as n, p as f, h as F, s as g, u as p, v as V } from "../CollectionFormBuilder-nZcXob6G.js";
|
|
2
2
|
import { default as h } from "validatorjs";
|
|
3
3
|
export {
|
|
4
4
|
s as CollectionFormBuilder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveDraftValues.d.ts","sourceRoot":"","sources":["../../../src/collection/lib/SaveDraftValues.tsx"],"names":[],"mappings":"AAgDA,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,
|
|
1
|
+
{"version":3,"file":"SaveDraftValues.d.ts","sourceRoot":"","sources":["../../../src/collection/lib/SaveDraftValues.tsx"],"names":[],"mappings":"AAgDA,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAyCA,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLevoForm.d.ts","sourceRoot":"","sources":["../../../../src/collection/lib/hooks/useLevoForm.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAQrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMtD,eAAO,MAAM,WAAW,wEAMrB;IACD,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;CAC5C;;;;;;
|
|
1
|
+
{"version":3,"file":"useLevoForm.d.ts","sourceRoot":"","sources":["../../../../src/collection/lib/hooks/useLevoForm.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAQrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMtD,eAAO,MAAM,WAAW,wEAMrB;IACD,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;CAC5C;;;;;;0BA4G8B,MAAM;;CA6FpC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { L as s, u as o } from "./LevoProvider-BAZy7_tP.js";
|
|
2
2
|
import { L as t, a as r, b as l } from "./page-BKyDlf0z.js";
|
|
3
|
-
import { C as m, F as p, x as d, y as g, m as T, r as f, j as u, n as c, e as x, b, c as D, f as y, g as F, d as v, k as h, o as L, i as M, a as E, w as P, t as B, p as O, h as V, s as j, u as C, v as I, l as S, q as K } from "./CollectionFormBuilder-
|
|
3
|
+
import { C as m, F as p, x as d, y as g, m as T, r as f, j as u, n as c, e as x, b, c as D, f as y, g as F, d as v, k as h, o as L, i as M, a as E, w as P, t as B, p as O, h as V, s as j, u as C, v as I, l as S, q as K } from "./CollectionFormBuilder-nZcXob6G.js";
|
|
4
4
|
import { LevoOAuth as U } from "./membership/index.js";
|
|
5
5
|
import { B as H, D as N, e as q, i as w, g as z, f as A, c as R, a as G, h as J, d as Q, j as X, S as Y, T as Z, m as _, k as $, l as aa, b as ea } from "./Spinner-Bzu2xCFZ.js";
|
|
6
6
|
import { T as oa, e as ia, s as ta } from "./Sonner-t6JVKA0a.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levo-so/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"author": "Levo Engineering <devs@theinternetfolks.com>",
|
|
5
5
|
"description": "Levo suite for React based applications",
|
|
6
6
|
"type": "module",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"vite": "5.4.3",
|
|
92
92
|
"vite-plugin-dts": "4.1.0",
|
|
93
93
|
"@levo/eslint-config": "0.0.0",
|
|
94
|
-
"@levo/
|
|
95
|
-
"@levo/
|
|
94
|
+
"@levo/ts-config": "0.0.0",
|
|
95
|
+
"@levo/tw-config": "0.0.0"
|
|
96
96
|
},
|
|
97
97
|
"main": "./dist/index.js",
|
|
98
98
|
"module": "./dist/index.js",
|