@levo-so/react 0.1.14 → 0.1.16
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 +124 -0
- package/dist/CollectionFormBuilder-MAo2Ob3a.js +1199 -0
- package/dist/{CurrencyWidget-COoMkfsA.js → CurrencyWidget-Cu1Cthnw.js} +5 -5
- package/dist/{DateTimeWidget-DcbQ3smI.js → DateTimeWidget-N-wuCRSJ.js} +3 -3
- package/dist/DefaultFormVariant-IqWi1BiT.js +81 -0
- package/dist/DropdownWidget-BFttB4b-.js +115 -0
- package/dist/{EmailWidget-CG9oNUM5.js → EmailWidget-D_SqXx3M.js} +11 -11
- package/dist/FormCaptcha-CJ9KgDu0.js +197 -0
- package/dist/GeocoderWidget-Bxt3TeAf.js +68 -0
- package/dist/LevoProvider-BAZy7_tP.js +223 -0
- package/dist/{MultiGeocoderWidget-D3Xmv8g4.js → MultiGeocoderWidget-DFjuXZBN.js} +6 -6
- package/dist/{MultiTextWidget-CyQRcWC8.js → MultiTextWidget-CZzT51cH.js} +14 -14
- package/dist/{PhoneWidget-C1Jt7kXL.js → PhoneWidget--K5aS16s.js} +5 -5
- package/dist/{RadioWidget-BrLNF-I2.js → RadioWidget-BbMPtR3P.js} +9 -9
- package/dist/{RichTextWidget-BogYcPtS.js → RichTextWidget-Cce3Bw8d.js} +21 -21
- package/dist/Spinner-Bzu2xCFZ.js +405 -0
- package/dist/{StepsFormVariant-Bx-jdciC.js → StepsFormVariant-5wZbYAA9.js} +58 -55
- package/dist/{SwitchWidget-BT0-waP9.js → SwitchWidget-B0wkSWxa.js} +5 -5
- package/dist/{TextWidget-Bvsz-hey.js → TextWidget-ldbMuLB0.js} +7 -7
- package/dist/{TextareaWidget-8SLym--T.js → TextareaWidget-S8bKUTv0.js} +3 -3
- package/dist/{ToggleCheckboxWidget-VrCQBF5C.js → ToggleCheckboxWidget-CPduXE6Y.js} +7 -7
- package/dist/Tooltip-DEBnSqlo.js +36 -0
- package/dist/{URLWidget-B99nKr6N.js → URLWidget-KbhE2ZUA.js} +2 -2
- package/dist/UploadWidget-DFvfDUT6.js +616 -0
- package/dist/audience/components/block.d.ts.map +1 -1
- package/dist/audience/components/component.d.ts.map +1 -1
- package/dist/audience/components/page.d.ts.map +1 -1
- package/dist/audience/index.js +1 -1
- package/dist/collection/components/Altcha.d.ts +10 -0
- package/dist/collection/components/Altcha.d.ts.map +1 -0
- package/dist/collection/components/FormCaptcha.d.ts +3 -0
- package/dist/collection/components/FormCaptcha.d.ts.map +1 -0
- package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts.map +1 -1
- package/dist/collection/components/core/Checkbox/Checbox.d.ts.map +1 -1
- package/dist/collection/components/core/Input/Input.d.ts.map +1 -1
- package/dist/collection/components/core/Switch/Switch.d.ts.map +1 -1
- package/dist/collection/components/renderer/RenderCommonField.d.ts.map +1 -1
- package/dist/collection/components/widgets/FieldWrapper.d.ts.map +1 -1
- package/dist/collection/components/widgets/FormHelperText.d.ts.map +1 -1
- package/dist/collection/components/widgets/FormLabel.d.ts.map +1 -1
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts +1 -1
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts +7 -0
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts.map +1 -0
- package/dist/collection/components/widgets/collectionWidget/{CollectionWidget.d.ts → CollectionWidgetM2O.d.ts} +1 -1
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2O.d.ts.map +1 -0
- package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts +8 -0
- package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts.map +1 -0
- package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/multiTextWidget/MultiTextWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/textWidget/TextWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts +11 -0
- package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts.map +1 -0
- package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts.map +1 -1
- package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts.map +1 -1
- package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts.map +1 -1
- package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts.map +1 -1
- package/dist/collection/index.js +13 -12
- package/dist/collection/lib/FormBuilder.d.ts.map +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/collection/lib/variants/DefaultFormVariant.d.ts.map +1 -1
- package/dist/collection/lib/variants/StepsFormVariant.d.ts.map +1 -1
- package/dist/collection/utils/formHelpers.d.ts.map +1 -1
- package/dist/collection/utils/index.d.ts +2 -0
- package/dist/collection/utils/index.d.ts.map +1 -1
- package/dist/components/Dialog.d.ts.map +1 -1
- package/dist/components/Spinner.d.ts.map +1 -1
- package/dist/components/Table.d.ts +11 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/components/Tooltip.d.ts.map +1 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/index.js +29 -29
- package/dist/constants/fileUploadPresets.d.ts +4 -2
- package/dist/constants/fileUploadPresets.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +75 -75
- package/dist/membership/components/Button.d.ts.map +1 -1
- package/dist/membership/components/Container.d.ts.map +1 -1
- package/dist/membership/components/Core.d.ts.map +1 -1
- package/dist/membership/index.js +2 -3
- package/dist/page-BKyDlf0z.js +212 -0
- package/dist/utils/errorHandler.d.ts.map +1 -1
- package/package.json +12 -11
- package/dist/CheckboxWidget-BctVOZiO.js +0 -118
- package/dist/CollectionFormBuilder-B6CAVKhg.js +0 -772
- package/dist/DefaultFormVariant-C6zbKgwB.js +0 -80
- package/dist/DropdownWidget-DszCTSWr.js +0 -115
- package/dist/GeocoderWidget-CXu17A7y.js +0 -310
- package/dist/LevoProvider-BI6g_T4E.js +0 -212
- package/dist/Spinner-DzGH5rKe.js +0 -297
- package/dist/Tooltip-CI4i4mYr.js +0 -144
- package/dist/UploadWidget-ZebPWZZZ.js +0 -505
- package/dist/collection/components/widgets/collectionWidget/CollectionWidget.d.ts.map +0 -1
- package/dist/fileUploadPresets-2raQmHT0.js +0 -74
- package/dist/page-yeiAPg3O.js +0 -200
- package/dist/useLevoForm-DjvUas25.js +0 -166
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var j = Object.defineProperty;
|
|
3
|
+
var D = (l, o, t) => o in l ? j(l, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[o] = t;
|
|
4
|
+
var p = (l, o, t) => D(l, typeof o != "symbol" ? o + "" : o, t);
|
|
5
|
+
import { j as B } from "./jsx-runtime-B6kdoens.js";
|
|
6
|
+
import k from "wretch";
|
|
7
|
+
import { createContext as G, useContext as W } from "react";
|
|
8
|
+
var q = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
9
|
+
function z(l) {
|
|
10
|
+
return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
|
|
11
|
+
}
|
|
12
|
+
var T = class {
|
|
13
|
+
constructor(l) {
|
|
14
|
+
p(this, "client");
|
|
15
|
+
this.client = l;
|
|
16
|
+
}
|
|
17
|
+
}, F = { exports: {} };
|
|
18
|
+
(function(l) {
|
|
19
|
+
(function(o, t) {
|
|
20
|
+
l.exports ? l.exports = t() : o.log = t();
|
|
21
|
+
})(q, function() {
|
|
22
|
+
var o = function() {
|
|
23
|
+
}, t = "undefined", L = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), g = [
|
|
24
|
+
"trace",
|
|
25
|
+
"debug",
|
|
26
|
+
"info",
|
|
27
|
+
"warn",
|
|
28
|
+
"error"
|
|
29
|
+
], f = {}, a = null;
|
|
30
|
+
function b(n, i) {
|
|
31
|
+
var e = n[i];
|
|
32
|
+
if (typeof e.bind == "function")
|
|
33
|
+
return e.bind(n);
|
|
34
|
+
try {
|
|
35
|
+
return Function.prototype.bind.call(e, n);
|
|
36
|
+
} catch {
|
|
37
|
+
return function() {
|
|
38
|
+
return Function.prototype.apply.apply(e, [n, arguments]);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function S() {
|
|
43
|
+
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
44
|
+
}
|
|
45
|
+
function U(n) {
|
|
46
|
+
return n === "debug" && (n = "log"), typeof console === t ? !1 : n === "trace" && L ? S : console[n] !== void 0 ? b(console, n) : console.log !== void 0 ? b(console, "log") : o;
|
|
47
|
+
}
|
|
48
|
+
function d() {
|
|
49
|
+
for (var n = this.getLevel(), i = 0; i < g.length; i++) {
|
|
50
|
+
var e = g[i];
|
|
51
|
+
this[e] = i < n ? o : this.methodFactory(e, n, this.name);
|
|
52
|
+
}
|
|
53
|
+
if (this.log = this.debug, typeof console === t && n < this.levels.SILENT)
|
|
54
|
+
return "No console available for logging";
|
|
55
|
+
}
|
|
56
|
+
function A(n) {
|
|
57
|
+
return function() {
|
|
58
|
+
typeof console !== t && (d.call(this), this[n].apply(this, arguments));
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function M(n, i, e) {
|
|
62
|
+
return U(n) || A.apply(this, arguments);
|
|
63
|
+
}
|
|
64
|
+
function E(n, i) {
|
|
65
|
+
var e = this, y, m, c, u = "loglevel";
|
|
66
|
+
typeof n == "string" ? u += ":" + n : typeof n == "symbol" && (u = void 0);
|
|
67
|
+
function O(r) {
|
|
68
|
+
var s = (g[r] || "silent").toUpperCase();
|
|
69
|
+
if (!(typeof window === t || !u)) {
|
|
70
|
+
try {
|
|
71
|
+
window.localStorage[u] = s;
|
|
72
|
+
return;
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
window.document.cookie = encodeURIComponent(u) + "=" + s + ";";
|
|
77
|
+
} catch {
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function C() {
|
|
82
|
+
var r;
|
|
83
|
+
if (!(typeof window === t || !u)) {
|
|
84
|
+
try {
|
|
85
|
+
r = window.localStorage[u];
|
|
86
|
+
} catch {
|
|
87
|
+
}
|
|
88
|
+
if (typeof r === t)
|
|
89
|
+
try {
|
|
90
|
+
var s = window.document.cookie, h = encodeURIComponent(u), I = s.indexOf(h + "=");
|
|
91
|
+
I !== -1 && (r = /^([^;]+)/.exec(
|
|
92
|
+
s.slice(I + h.length + 1)
|
|
93
|
+
)[1]);
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
return e.levels[r] === void 0 && (r = void 0), r;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function P() {
|
|
100
|
+
if (!(typeof window === t || !u)) {
|
|
101
|
+
try {
|
|
102
|
+
window.localStorage.removeItem(u);
|
|
103
|
+
} catch {
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
window.document.cookie = encodeURIComponent(u) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
107
|
+
} catch {
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function v(r) {
|
|
112
|
+
var s = r;
|
|
113
|
+
if (typeof s == "string" && e.levels[s.toUpperCase()] !== void 0 && (s = e.levels[s.toUpperCase()]), typeof s == "number" && s >= 0 && s <= e.levels.SILENT)
|
|
114
|
+
return s;
|
|
115
|
+
throw new TypeError("log.setLevel() called with invalid level: " + r);
|
|
116
|
+
}
|
|
117
|
+
e.name = n, e.levels = {
|
|
118
|
+
TRACE: 0,
|
|
119
|
+
DEBUG: 1,
|
|
120
|
+
INFO: 2,
|
|
121
|
+
WARN: 3,
|
|
122
|
+
ERROR: 4,
|
|
123
|
+
SILENT: 5
|
|
124
|
+
}, e.methodFactory = i || M, e.getLevel = function() {
|
|
125
|
+
return c ?? m ?? y;
|
|
126
|
+
}, e.setLevel = function(r, s) {
|
|
127
|
+
return c = v(r), s !== !1 && O(c), d.call(e);
|
|
128
|
+
}, e.setDefaultLevel = function(r) {
|
|
129
|
+
m = v(r), C() || e.setLevel(r, !1);
|
|
130
|
+
}, e.resetLevel = function() {
|
|
131
|
+
c = null, P(), d.call(e);
|
|
132
|
+
}, e.enableAll = function(r) {
|
|
133
|
+
e.setLevel(e.levels.TRACE, r);
|
|
134
|
+
}, e.disableAll = function(r) {
|
|
135
|
+
e.setLevel(e.levels.SILENT, r);
|
|
136
|
+
}, e.rebuild = function() {
|
|
137
|
+
if (a !== e && (y = v(a.getLevel())), d.call(e), a === e)
|
|
138
|
+
for (var r in f)
|
|
139
|
+
f[r].rebuild();
|
|
140
|
+
}, y = v(
|
|
141
|
+
a ? a.getLevel() : "WARN"
|
|
142
|
+
);
|
|
143
|
+
var x = C();
|
|
144
|
+
x != null && (c = v(x)), d.call(e);
|
|
145
|
+
}
|
|
146
|
+
a = new E(), a.getLogger = function(i) {
|
|
147
|
+
if (typeof i != "symbol" && typeof i != "string" || i === "")
|
|
148
|
+
throw new TypeError("You must supply a name when creating a logger.");
|
|
149
|
+
var e = f[i];
|
|
150
|
+
return e || (e = f[i] = new E(
|
|
151
|
+
i,
|
|
152
|
+
a.methodFactory
|
|
153
|
+
)), e;
|
|
154
|
+
};
|
|
155
|
+
var N = typeof window !== t ? window.log : void 0;
|
|
156
|
+
return a.noConflict = function() {
|
|
157
|
+
return typeof window !== t && window.log === a && (window.log = N), a;
|
|
158
|
+
}, a.getLoggers = function() {
|
|
159
|
+
return f;
|
|
160
|
+
}, a.default = a, a;
|
|
161
|
+
});
|
|
162
|
+
})(F);
|
|
163
|
+
var J = F.exports;
|
|
164
|
+
const w = /* @__PURE__ */ z(J);
|
|
165
|
+
var K = class extends T {
|
|
166
|
+
constructor(o) {
|
|
167
|
+
super(o);
|
|
168
|
+
p(this, "logger", w);
|
|
169
|
+
w.setLevel(
|
|
170
|
+
this.client.NODE_ENV === "production" ? w.levels.INFO : w.levels.DEBUG
|
|
171
|
+
), w.methodFactory = (t) => (L, g = {}) => {
|
|
172
|
+
k().url(`${this.client.apiUrl}/v1/apm/logs/json`).post({
|
|
173
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
174
|
+
level: t,
|
|
175
|
+
message: L,
|
|
176
|
+
...g
|
|
177
|
+
}).res().catch((f) => console.error(f));
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
error(...o) {
|
|
181
|
+
return this.logger.error(...o);
|
|
182
|
+
}
|
|
183
|
+
log(...o) {
|
|
184
|
+
return this.logger.debug(...o);
|
|
185
|
+
}
|
|
186
|
+
info(...o) {
|
|
187
|
+
return this.logger.info(...o);
|
|
188
|
+
}
|
|
189
|
+
warn(...o) {
|
|
190
|
+
return this.logger.warn(...o);
|
|
191
|
+
}
|
|
192
|
+
}, V = class extends T {
|
|
193
|
+
constructor() {
|
|
194
|
+
super(...arguments);
|
|
195
|
+
p(this, "mediaBulkUpload", (o, t = {}) => this.client.fetch.url("/v1/assets/media/bulk").options(t).post(o).json());
|
|
196
|
+
p(this, "getAllMedia", async (o = {}) => await this.client.fetch.url("/v1/assets/media/query").post(o).json());
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
const R = G(null), X = ({
|
|
200
|
+
children: l,
|
|
201
|
+
client: o,
|
|
202
|
+
...t
|
|
203
|
+
}) => /* @__PURE__ */ B.jsx(
|
|
204
|
+
R.Provider,
|
|
205
|
+
{
|
|
206
|
+
value: {
|
|
207
|
+
client: o,
|
|
208
|
+
media: new V(o),
|
|
209
|
+
logger: new K(o),
|
|
210
|
+
...t
|
|
211
|
+
},
|
|
212
|
+
children: l
|
|
213
|
+
}
|
|
214
|
+
), Z = () => {
|
|
215
|
+
const l = W(R);
|
|
216
|
+
if (!l)
|
|
217
|
+
throw new Error("useLevo must be used within LevoProvider");
|
|
218
|
+
return l;
|
|
219
|
+
};
|
|
220
|
+
export {
|
|
221
|
+
X as L,
|
|
222
|
+
Z as u
|
|
223
|
+
};
|
|
@@ -2,10 +2,10 @@
|
|
|
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 {
|
|
6
|
-
import { GeocoderWidget as d } from "./GeocoderWidget-
|
|
7
|
-
import { B as p } from "./Spinner-
|
|
8
|
-
const
|
|
5
|
+
import { B as c } from "./CollectionFormBuilder-MAo2Ob3a.js";
|
|
6
|
+
import { GeocoderWidget as d } from "./GeocoderWidget-Bxt3TeAf.js";
|
|
7
|
+
import { B as p } from "./Spinner-Bzu2xCFZ.js";
|
|
8
|
+
const k = ({
|
|
9
9
|
field: l
|
|
10
10
|
}) => {
|
|
11
11
|
const { key: s = "", label: o = "" } = l, { fields: r, ...i } = n({
|
|
@@ -44,6 +44,6 @@ const g = ({
|
|
|
44
44
|
] });
|
|
45
45
|
};
|
|
46
46
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
k as MultiGeocoderWidget,
|
|
48
|
+
k as default
|
|
49
49
|
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { j as a } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { useController as
|
|
3
|
-
import {
|
|
4
|
-
import { I
|
|
5
|
-
const
|
|
2
|
+
import { useController as A } from "react-hook-form";
|
|
3
|
+
import { z as C, A as b, B as q } from "./CollectionFormBuilder-MAo2Ob3a.js";
|
|
4
|
+
import { I } from "./Input-2CvZ90f8.js";
|
|
5
|
+
const f = ({ field: r }) => {
|
|
6
6
|
var l;
|
|
7
7
|
const { key: u = "", label: n = "", helper_text: c = "", readonly: x = !1 } = r, o = u, {
|
|
8
|
-
field: { value: e, onChange:
|
|
8
|
+
field: { value: e, onChange: d, ...h },
|
|
9
9
|
fieldState: s
|
|
10
|
-
} =
|
|
10
|
+
} = A({
|
|
11
11
|
name: o,
|
|
12
|
-
rules:
|
|
13
|
-
}),
|
|
14
|
-
return /* @__PURE__ */ a.jsxs(
|
|
15
|
-
n && /* @__PURE__ */ a.jsx(q, { htmlFor: o, isRequired:
|
|
12
|
+
rules: C(r)
|
|
13
|
+
}), g = !!(r != null && r.required), j = (l = s == null ? void 0 : s.error) == null ? void 0 : l.message, y = Array.isArray(e) ? e == null ? void 0 : e.join(",") : "";
|
|
14
|
+
return /* @__PURE__ */ a.jsxs(b, { error: j, helperText: c, children: [
|
|
15
|
+
n && /* @__PURE__ */ a.jsx(q, { htmlFor: o, isRequired: g, children: n }),
|
|
16
16
|
/* @__PURE__ */ a.jsx(
|
|
17
|
-
|
|
17
|
+
I,
|
|
18
18
|
{
|
|
19
19
|
id: o,
|
|
20
20
|
readOnly: x,
|
|
21
21
|
value: y,
|
|
22
22
|
onChange: (F) => {
|
|
23
23
|
var m, p, i;
|
|
24
|
-
|
|
24
|
+
d((i = (p = (m = F.target) == null ? void 0 : m.value) == null ? void 0 : p.split(",")) == null ? void 0 : i.map((t) => t == null ? void 0 : t.trim()));
|
|
25
25
|
},
|
|
26
|
-
...
|
|
26
|
+
...h
|
|
27
27
|
}
|
|
28
28
|
)
|
|
29
29
|
] });
|
|
30
30
|
};
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
f as default
|
|
33
33
|
};
|
|
@@ -3,8 +3,8 @@ 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 {
|
|
7
|
-
const
|
|
6
|
+
import { z as x, A as v, B as y } from "./CollectionFormBuilder-MAo2Ob3a.js";
|
|
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 },
|
|
10
10
|
fieldState: { error: r }
|
|
@@ -13,7 +13,7 @@ const k = ({ field: e }) => {
|
|
|
13
13
|
rules: x(e)
|
|
14
14
|
}), p = !!(e != null && e.required), h = r == null ? void 0 : r.message;
|
|
15
15
|
return /* @__PURE__ */ o.jsxs(v, { error: h, helperText: c, readOnly: n, children: [
|
|
16
|
-
t && /* @__PURE__ */ o.jsx(
|
|
16
|
+
t && /* @__PURE__ */ o.jsx(y, { htmlFor: s, isRequired: p, children: t }),
|
|
17
17
|
/* @__PURE__ */ o.jsx(
|
|
18
18
|
g,
|
|
19
19
|
{
|
|
@@ -43,6 +43,6 @@ const k = ({ field: e }) => {
|
|
|
43
43
|
] });
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
P as PhoneWidget,
|
|
47
|
+
P as default
|
|
48
48
|
};
|
|
@@ -3,12 +3,12 @@ import { j as r } from "./jsx-runtime-B6kdoens.js";
|
|
|
3
3
|
import * as n from "@radix-ui/react-radio-group";
|
|
4
4
|
import * as d from "react";
|
|
5
5
|
import { useController as F } from "react-hook-form";
|
|
6
|
-
import { G as
|
|
6
|
+
import { G as B } from "./Spinner-Bzu2xCFZ.js";
|
|
7
7
|
import { c as N } from "./cn-C9QoOYNG.js";
|
|
8
|
-
import {
|
|
9
|
-
import { I as
|
|
10
|
-
function
|
|
11
|
-
return
|
|
8
|
+
import { z as E, A as G, B as f } from "./CollectionFormBuilder-MAo2Ob3a.js";
|
|
9
|
+
import { I as V } from "./Input-2CvZ90f8.js";
|
|
10
|
+
function q(s) {
|
|
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);
|
|
12
12
|
}
|
|
13
13
|
const C = ({ field: s }) => {
|
|
14
14
|
var y;
|
|
@@ -24,11 +24,11 @@ const C = ({ field: s }) => {
|
|
|
24
24
|
fieldState: p
|
|
25
25
|
} = F({
|
|
26
26
|
name: a,
|
|
27
|
-
rules:
|
|
27
|
+
rules: E(s)
|
|
28
28
|
}), O = !!(s != null && s.required), k = (y = p == null ? void 0 : p.error) == null ? void 0 : y.message;
|
|
29
29
|
return d.useEffect(() => {
|
|
30
30
|
u || i && (t == null ? void 0 : t.findIndex((e) => e === i)) === -1 && (h(!0), m(i));
|
|
31
|
-
}, [i]), /* @__PURE__ */ r.jsxs(
|
|
31
|
+
}, [i]), /* @__PURE__ */ r.jsxs(G, { error: k, helperText: $, readOnly: g, children: [
|
|
32
32
|
j && /* @__PURE__ */ r.jsx(f, { htmlFor: a, isRequired: O, children: j }),
|
|
33
33
|
/* @__PURE__ */ r.jsxs(
|
|
34
34
|
n.Root,
|
|
@@ -69,7 +69,7 @@ const C = ({ field: s }) => {
|
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
71
|
/* @__PURE__ */ r.jsx(
|
|
72
|
-
|
|
72
|
+
V,
|
|
73
73
|
{
|
|
74
74
|
className: "max-w-[300px]",
|
|
75
75
|
name: `radio-other-${a}`,
|
|
@@ -98,7 +98,7 @@ const x = d.forwardRef(({ className: s, ...c }, m) => /* @__PURE__ */ r.jsx(
|
|
|
98
98
|
s
|
|
99
99
|
),
|
|
100
100
|
...c,
|
|
101
|
-
children: /* @__PURE__ */ r.jsx(n.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ r.jsx(
|
|
101
|
+
children: /* @__PURE__ */ r.jsx(n.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ r.jsx(q, { className: "h-3.5 w-3.5 fill-primary" }) })
|
|
102
102
|
}
|
|
103
103
|
));
|
|
104
104
|
x.displayName = n.Item.displayName;
|
|
@@ -3,8 +3,8 @@ import { j as l } from "./jsx-runtime-B6kdoens.js";
|
|
|
3
3
|
import B from "@tiptap/extension-bold";
|
|
4
4
|
import d from "@tiptap/extension-bullet-list";
|
|
5
5
|
import w from "@tiptap/extension-document";
|
|
6
|
-
import { HardBreak as
|
|
7
|
-
import
|
|
6
|
+
import { HardBreak as z } from "@tiptap/extension-hard-break";
|
|
7
|
+
import y from "@tiptap/extension-history";
|
|
8
8
|
import S from "@tiptap/extension-italic";
|
|
9
9
|
import R from "@tiptap/extension-link";
|
|
10
10
|
import M from "@tiptap/extension-list-item";
|
|
@@ -15,11 +15,11 @@ import N from "@tiptap/extension-text";
|
|
|
15
15
|
import O from "@tiptap/extension-text-align";
|
|
16
16
|
import F from "@tiptap/extension-underline";
|
|
17
17
|
import { useEditor as I, EditorContent as E } from "@tiptap/react";
|
|
18
|
-
import { useState as
|
|
19
|
-
import { useController as
|
|
20
|
-
import { G as p,
|
|
18
|
+
import { useState as q, useEffect as D } from "react";
|
|
19
|
+
import { useController as G } from "react-hook-form";
|
|
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 {
|
|
22
|
+
import { z as ln, A as en, B as sn } from "./CollectionFormBuilder-MAo2Ob3a.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
|
}
|
|
@@ -224,13 +224,13 @@ const e = ({
|
|
|
224
224
|
] });
|
|
225
225
|
}, Rn = ({ field: n }) => {
|
|
226
226
|
var b;
|
|
227
|
-
const [c, t] =
|
|
228
|
-
field: { value:
|
|
229
|
-
fieldState:
|
|
230
|
-
} =
|
|
227
|
+
const [c, t] = q(!1), { key: i = "", label: u = "", helper_text: r = "", readonly: x = !1 } = n, o = i, {
|
|
228
|
+
field: { value: g, onBlur: k, onChange: A, ...m },
|
|
229
|
+
fieldState: h
|
|
230
|
+
} = G({
|
|
231
231
|
name: o,
|
|
232
232
|
rules: ln(n)
|
|
233
|
-
}),
|
|
233
|
+
}), L = !!(n != null && n.required), v = (b = h == null ? void 0 : h.error) == null ? void 0 : b.message, s = I({
|
|
234
234
|
extensions: [
|
|
235
235
|
w,
|
|
236
236
|
T,
|
|
@@ -242,7 +242,7 @@ const e = ({
|
|
|
242
242
|
U,
|
|
243
243
|
d,
|
|
244
244
|
M,
|
|
245
|
-
|
|
245
|
+
z,
|
|
246
246
|
R.configure({
|
|
247
247
|
HTMLAttributes: {
|
|
248
248
|
target: "_blank"
|
|
@@ -252,30 +252,30 @@ const e = ({
|
|
|
252
252
|
O.configure({
|
|
253
253
|
types: ["heading", "paragraph"]
|
|
254
254
|
}),
|
|
255
|
-
|
|
255
|
+
y
|
|
256
256
|
],
|
|
257
|
-
content:
|
|
258
|
-
editable: !m.disabled && !
|
|
257
|
+
content: g,
|
|
258
|
+
editable: !m.disabled && !x,
|
|
259
259
|
onBlur: () => {
|
|
260
260
|
k();
|
|
261
261
|
},
|
|
262
262
|
onUpdate: ({ editor: f }) => {
|
|
263
263
|
const C = f.getHTML();
|
|
264
|
-
|
|
264
|
+
A(C);
|
|
265
265
|
},
|
|
266
266
|
immediatelyRender: !1
|
|
267
267
|
});
|
|
268
|
-
return
|
|
269
|
-
s != null && s.commands && !c && (s.commands.setContent(
|
|
270
|
-
}, [
|
|
271
|
-
u && /* @__PURE__ */ l.jsx(sn, { htmlFor: o, isRequired:
|
|
268
|
+
return D(() => {
|
|
269
|
+
s != null && s.commands && !c && (s.commands.setContent(g || ""), t(!0));
|
|
270
|
+
}, [g]), /* @__PURE__ */ l.jsxs(en, { error: v, helperText: r, readOnly: x, children: [
|
|
271
|
+
u && /* @__PURE__ */ l.jsx(sn, { htmlFor: o, isRequired: L, children: u }),
|
|
272
272
|
/* @__PURE__ */ l.jsxs(
|
|
273
273
|
"div",
|
|
274
274
|
{
|
|
275
275
|
className: j(
|
|
276
276
|
"w-full rounded-md border border-input placeholder:text-muted-foreground focus-within:outline-none focus-within:ring-1 focus-within:ring-ring overflow-hidden",
|
|
277
277
|
(m == null ? void 0 : m.disabled) && "cursor-not-allowed opacity-50 pointer-events-none",
|
|
278
|
-
|
|
278
|
+
x && "focus-visible:ring-0 pointer-events-none"
|
|
279
279
|
),
|
|
280
280
|
children: [
|
|
281
281
|
/* @__PURE__ */ l.jsx(rn, { editor: s }),
|