@object-ui/fields 0.3.0 → 0.5.0
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/fields/src/complex-widgets.test.d.ts +1 -0
- package/dist/fields/src/datetime-widgets.test.d.ts +1 -0
- package/dist/fields/src/fields.stories.d.ts +56 -0
- package/dist/fields/src/index.d.ts +48 -0
- package/dist/fields/src/new-widgets.test.d.ts +8 -0
- package/dist/fields/src/remaining-widgets.test.d.ts +1 -0
- package/dist/fields/src/standard-widgets.test.d.ts +0 -0
- package/dist/fields/src/text-rich-widgets.test.d.ts +1 -0
- package/dist/fields/src/visual-widgets.test.d.ts +1 -0
- package/dist/fields/src/widgets/AddressField.d.ts +16 -0
- package/dist/fields/src/widgets/AutoNumberField.d.ts +6 -0
- package/dist/fields/src/widgets/AvatarField.d.ts +6 -0
- package/dist/fields/src/widgets/CodeField.d.ts +7 -0
- package/dist/fields/src/widgets/ColorField.d.ts +6 -0
- package/dist/fields/src/widgets/CurrencyField.d.ts +1 -1
- package/dist/fields/src/widgets/DateTimeField.d.ts +2 -0
- package/dist/fields/src/widgets/FileField.d.ts +2 -0
- package/dist/fields/src/widgets/FormulaField.d.ts +6 -0
- package/dist/fields/src/widgets/GeolocationField.d.ts +14 -0
- package/dist/fields/src/widgets/GridField.d.ts +7 -0
- package/dist/fields/src/widgets/ImageField.d.ts +2 -0
- package/dist/fields/src/widgets/LocationField.d.ts +2 -0
- package/dist/fields/src/widgets/LookupField.d.ts +1 -1
- package/dist/fields/src/widgets/MasterDetailField.d.ts +14 -0
- package/dist/fields/src/widgets/ObjectField.d.ts +6 -0
- package/dist/fields/src/widgets/PasswordField.d.ts +2 -0
- package/dist/fields/src/widgets/PercentField.d.ts +2 -0
- package/dist/fields/src/widgets/QRCodeField.d.ts +6 -0
- package/dist/fields/src/widgets/RatingField.d.ts +6 -0
- package/dist/fields/src/widgets/SignatureField.d.ts +6 -0
- package/dist/fields/src/widgets/SliderField.d.ts +6 -0
- package/dist/fields/src/widgets/SummaryField.d.ts +6 -0
- package/dist/fields/src/widgets/TimeField.d.ts +2 -0
- package/dist/fields/src/widgets/UserField.d.ts +6 -0
- package/dist/fields/src/widgets/VectorField.d.ts +6 -0
- package/dist/fields/src/widgets/types.d.ts +2 -0
- package/dist/index.cjs +4 -2
- package/dist/index.js +2003 -618
- package/package.json +10 -8
- package/src/complex-widgets.test.tsx +146 -0
- package/src/datetime-widgets.test.tsx +93 -0
- package/src/fields.stories.tsx +566 -0
- package/src/index.tsx +303 -68
- package/src/new-widgets.test.tsx +302 -0
- package/src/remaining-widgets.test.tsx +172 -0
- package/src/standard-widgets.test.tsx +278 -0
- package/src/text-rich-widgets.test.tsx +104 -0
- package/src/visual-widgets.test.tsx +97 -0
- package/src/widgets/AddressField.tsx +112 -0
- package/src/widgets/AutoNumberField.tsx +16 -0
- package/src/widgets/AvatarField.tsx +110 -0
- package/src/widgets/BooleanField.tsx +19 -11
- package/src/widgets/CodeField.tsx +34 -0
- package/src/widgets/ColorField.tsx +44 -0
- package/src/widgets/CurrencyField.tsx +8 -7
- package/src/widgets/DateField.tsx +5 -2
- package/src/widgets/DateTimeField.tsx +28 -0
- package/src/widgets/EmailField.tsx +7 -3
- package/src/widgets/FileField.tsx +114 -0
- package/src/widgets/FormulaField.tsx +31 -0
- package/src/widgets/GeolocationField.tsx +151 -0
- package/src/widgets/GridField.tsx +63 -0
- package/src/widgets/ImageField.tsx +108 -0
- package/src/widgets/LocationField.tsx +46 -0
- package/src/widgets/LookupField.tsx +5 -5
- package/src/widgets/MasterDetailField.tsx +131 -0
- package/src/widgets/NumberField.tsx +8 -4
- package/src/widgets/ObjectField.tsx +85 -0
- package/src/widgets/PasswordField.tsx +45 -0
- package/src/widgets/PercentField.tsx +49 -0
- package/src/widgets/PhoneField.tsx +7 -3
- package/src/widgets/QRCodeField.tsx +96 -0
- package/src/widgets/RatingField.tsx +66 -0
- package/src/widgets/RichTextField.tsx +5 -5
- package/src/widgets/SelectField.tsx +7 -5
- package/src/widgets/SignatureField.tsx +140 -0
- package/src/widgets/SliderField.tsx +39 -0
- package/src/widgets/SummaryField.tsx +29 -0
- package/src/widgets/TextAreaField.tsx +9 -6
- package/src/widgets/TextField.tsx +13 -8
- package/src/widgets/TimeField.tsx +22 -0
- package/src/widgets/UrlField.tsx +7 -3
- package/src/widgets/UserField.tsx +88 -0
- package/src/widgets/VectorField.tsx +28 -0
- package/src/widgets/types.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -1,622 +1,688 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"),
|
|
11
|
-
function n(s,
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
for (var
|
|
16
|
-
|
|
17
|
-
} else
|
|
18
|
-
return
|
|
1
|
+
import P, { useId as xt, useState as L, useRef as te, useEffect as ve } from "react";
|
|
2
|
+
import { ComponentRegistry as g } from "@object-ui/core";
|
|
3
|
+
import { Textarea as V, Input as _, Checkbox as ht, Label as R, Switch as pt, Select as gt, SelectTrigger as bt, SelectValue as jt, SelectContent as yt, SelectItem as Nt, Badge as k, Dialog as vt, DialogTrigger as _t, Button as F, DialogContent as Ft, DialogHeader as wt, DialogTitle as St, Avatar as $, AvatarFallback as z, cn as O, Slider as Ct, AvatarImage as ce } from "@object-ui/components";
|
|
4
|
+
import { X as E, Search as Pt, EyeOff as Ot, Eye as Tt, File as Rt, Upload as _e, Image as kt, Star as de, MapPin as ue, Crosshair as At, Eraser as $t, QrCode as me, Copy as zt, ExternalLink as fe, Plus as Et, Check as Mt } from "lucide-react";
|
|
5
|
+
var Y = { exports: {} }, D = {};
|
|
6
|
+
var xe;
|
|
7
|
+
function Ut() {
|
|
8
|
+
if (xe) return D;
|
|
9
|
+
xe = 1;
|
|
10
|
+
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
11
|
+
function n(s, a, l) {
|
|
12
|
+
var i = null;
|
|
13
|
+
if (l !== void 0 && (i = "" + l), a.key !== void 0 && (i = "" + a.key), "key" in a) {
|
|
14
|
+
l = {};
|
|
15
|
+
for (var o in a)
|
|
16
|
+
o !== "key" && (l[o] = a[o]);
|
|
17
|
+
} else l = a;
|
|
18
|
+
return a = l.ref, {
|
|
19
19
|
$$typeof: e,
|
|
20
20
|
type: s,
|
|
21
|
-
key:
|
|
22
|
-
ref:
|
|
23
|
-
props:
|
|
21
|
+
key: i,
|
|
22
|
+
ref: a !== void 0 ? a : null,
|
|
23
|
+
props: l
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
return
|
|
27
|
-
}
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
function
|
|
31
|
-
return
|
|
32
|
-
function e(
|
|
33
|
-
if (
|
|
34
|
-
if (typeof
|
|
35
|
-
return
|
|
36
|
-
if (typeof
|
|
37
|
-
switch (
|
|
38
|
-
case
|
|
26
|
+
return D.Fragment = r, D.jsx = n, D.jsxs = n, D;
|
|
27
|
+
}
|
|
28
|
+
var I = {};
|
|
29
|
+
var he;
|
|
30
|
+
function Dt() {
|
|
31
|
+
return he || (he = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
32
|
+
function e(u) {
|
|
33
|
+
if (u == null) return null;
|
|
34
|
+
if (typeof u == "function")
|
|
35
|
+
return u.$$typeof === ut ? null : u.displayName || u.name || null;
|
|
36
|
+
if (typeof u == "string") return u;
|
|
37
|
+
switch (u) {
|
|
38
|
+
case T:
|
|
39
39
|
return "Fragment";
|
|
40
|
-
case
|
|
40
|
+
case C:
|
|
41
41
|
return "Profiler";
|
|
42
|
-
case
|
|
42
|
+
case y:
|
|
43
43
|
return "StrictMode";
|
|
44
|
-
case
|
|
44
|
+
case it:
|
|
45
45
|
return "Suspense";
|
|
46
|
-
case
|
|
46
|
+
case ot:
|
|
47
47
|
return "SuspenseList";
|
|
48
|
-
case
|
|
48
|
+
case dt:
|
|
49
49
|
return "Activity";
|
|
50
50
|
}
|
|
51
|
-
if (typeof
|
|
52
|
-
switch (typeof
|
|
51
|
+
if (typeof u == "object")
|
|
52
|
+
switch (typeof u.tag == "number" && console.error(
|
|
53
53
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
54
|
-
),
|
|
55
|
-
case
|
|
54
|
+
), u.$$typeof) {
|
|
55
|
+
case N:
|
|
56
56
|
return "Portal";
|
|
57
|
-
case
|
|
58
|
-
return
|
|
59
|
-
case
|
|
60
|
-
return (
|
|
61
|
-
case
|
|
62
|
-
var
|
|
63
|
-
return
|
|
64
|
-
case
|
|
65
|
-
return
|
|
66
|
-
case
|
|
67
|
-
|
|
57
|
+
case J:
|
|
58
|
+
return u.displayName || "Context";
|
|
59
|
+
case U:
|
|
60
|
+
return (u._context.displayName || "Context") + ".Consumer";
|
|
61
|
+
case lt:
|
|
62
|
+
var b = u.render;
|
|
63
|
+
return u = u.displayName, u || (u = b.displayName || b.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
|
|
64
|
+
case ct:
|
|
65
|
+
return b = u.displayName || null, b !== null ? b : e(u.type) || "Memo";
|
|
66
|
+
case G:
|
|
67
|
+
b = u._payload, u = u._init;
|
|
68
68
|
try {
|
|
69
|
-
return e(
|
|
69
|
+
return e(u(b));
|
|
70
70
|
} catch {
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return "" +
|
|
75
|
+
function r(u) {
|
|
76
|
+
return "" + u;
|
|
77
77
|
}
|
|
78
|
-
function n(
|
|
78
|
+
function n(u) {
|
|
79
79
|
try {
|
|
80
|
-
|
|
81
|
-
var
|
|
80
|
+
r(u);
|
|
81
|
+
var b = !1;
|
|
82
82
|
} catch {
|
|
83
|
-
|
|
83
|
+
b = !0;
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
var
|
|
88
|
-
return
|
|
89
|
-
|
|
85
|
+
if (b) {
|
|
86
|
+
b = console;
|
|
87
|
+
var v = b.error, w = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
|
|
88
|
+
return v.call(
|
|
89
|
+
b,
|
|
90
90
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
91
|
-
|
|
92
|
-
),
|
|
91
|
+
w
|
|
92
|
+
), r(u);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
function s(
|
|
96
|
-
if (
|
|
97
|
-
if (typeof
|
|
95
|
+
function s(u) {
|
|
96
|
+
if (u === T) return "<>";
|
|
97
|
+
if (typeof u == "object" && u !== null && u.$$typeof === G)
|
|
98
98
|
return "<...>";
|
|
99
99
|
try {
|
|
100
|
-
var
|
|
101
|
-
return
|
|
100
|
+
var b = e(u);
|
|
101
|
+
return b ? "<" + b + ">" : "<...>";
|
|
102
102
|
} catch {
|
|
103
103
|
return "<...>";
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
var
|
|
108
|
-
return
|
|
106
|
+
function a() {
|
|
107
|
+
var u = W.A;
|
|
108
|
+
return u === null ? null : u.getOwner();
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function l() {
|
|
111
111
|
return Error("react-stack-top-frame");
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
if (
|
|
115
|
-
var
|
|
116
|
-
if (
|
|
113
|
+
function i(u) {
|
|
114
|
+
if (se.call(u, "key")) {
|
|
115
|
+
var b = Object.getOwnPropertyDescriptor(u, "key").get;
|
|
116
|
+
if (b && b.isReactWarning) return !1;
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return u.key !== void 0;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
function
|
|
122
|
-
|
|
120
|
+
function o(u, b) {
|
|
121
|
+
function v() {
|
|
122
|
+
ne || (ne = !0, console.error(
|
|
123
123
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
124
|
-
|
|
124
|
+
b
|
|
125
125
|
));
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
get:
|
|
127
|
+
v.isReactWarning = !0, Object.defineProperty(u, "key", {
|
|
128
|
+
get: v,
|
|
129
129
|
configurable: !0
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
var
|
|
134
|
-
return
|
|
132
|
+
function c() {
|
|
133
|
+
var u = e(this.type);
|
|
134
|
+
return ae[u] || (ae[u] = !0, console.error(
|
|
135
135
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
136
|
-
)),
|
|
136
|
+
)), u = this.props.ref, u !== void 0 ? u : null;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
var
|
|
140
|
-
return
|
|
141
|
-
$$typeof:
|
|
142
|
-
type:
|
|
143
|
-
key:
|
|
144
|
-
props:
|
|
145
|
-
_owner:
|
|
146
|
-
}, (
|
|
138
|
+
function m(u, b, v, w, B, X) {
|
|
139
|
+
var S = v.ref;
|
|
140
|
+
return u = {
|
|
141
|
+
$$typeof: p,
|
|
142
|
+
type: u,
|
|
143
|
+
key: b,
|
|
144
|
+
props: v,
|
|
145
|
+
_owner: w
|
|
146
|
+
}, (S !== void 0 ? S : null) !== null ? Object.defineProperty(u, "ref", {
|
|
147
147
|
enumerable: !1,
|
|
148
|
-
get:
|
|
149
|
-
}) : Object.defineProperty(
|
|
148
|
+
get: c
|
|
149
|
+
}) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
|
|
150
150
|
configurable: !1,
|
|
151
151
|
enumerable: !1,
|
|
152
152
|
writable: !0,
|
|
153
153
|
value: 0
|
|
154
|
-
}), Object.defineProperty(
|
|
154
|
+
}), Object.defineProperty(u, "_debugInfo", {
|
|
155
155
|
configurable: !1,
|
|
156
156
|
enumerable: !1,
|
|
157
157
|
writable: !0,
|
|
158
158
|
value: null
|
|
159
|
-
}), Object.defineProperty(
|
|
159
|
+
}), Object.defineProperty(u, "_debugStack", {
|
|
160
160
|
configurable: !1,
|
|
161
161
|
enumerable: !1,
|
|
162
162
|
writable: !0,
|
|
163
|
-
value:
|
|
164
|
-
}), Object.defineProperty(
|
|
163
|
+
value: B
|
|
164
|
+
}), Object.defineProperty(u, "_debugTask", {
|
|
165
165
|
configurable: !1,
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
writable: !0,
|
|
168
|
-
value:
|
|
169
|
-
}), Object.freeze && (Object.freeze(
|
|
168
|
+
value: X
|
|
169
|
+
}), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
var
|
|
173
|
-
if (
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
for (
|
|
177
|
-
|
|
178
|
-
Object.freeze && Object.freeze(
|
|
171
|
+
function h(u, b, v, w, B, X) {
|
|
172
|
+
var S = b.children;
|
|
173
|
+
if (S !== void 0)
|
|
174
|
+
if (w)
|
|
175
|
+
if (mt(S)) {
|
|
176
|
+
for (w = 0; w < S.length; w++)
|
|
177
|
+
x(S[w]);
|
|
178
|
+
Object.freeze && Object.freeze(S);
|
|
179
179
|
} else
|
|
180
180
|
console.error(
|
|
181
181
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
182
182
|
);
|
|
183
|
-
else
|
|
184
|
-
if (
|
|
185
|
-
|
|
186
|
-
var
|
|
187
|
-
return
|
|
183
|
+
else x(S);
|
|
184
|
+
if (se.call(b, "key")) {
|
|
185
|
+
S = e(u);
|
|
186
|
+
var M = Object.keys(b).filter(function(ft) {
|
|
187
|
+
return ft !== "key";
|
|
188
188
|
});
|
|
189
|
-
|
|
189
|
+
w = 0 < M.length ? "{key: someKey, " + M.join(": ..., ") + ": ...}" : "{key: someKey}", oe[S + w] || (M = 0 < M.length ? "{" + M.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
190
190
|
`A props object containing a "key" prop is being spread into JSX:
|
|
191
191
|
let props = %s;
|
|
192
192
|
<%s {...props} />
|
|
193
193
|
React keys must be passed directly to JSX without using spread:
|
|
194
194
|
let props = %s;
|
|
195
195
|
<%s key={someKey} {...props} />`,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
),
|
|
196
|
+
w,
|
|
197
|
+
S,
|
|
198
|
+
M,
|
|
199
|
+
S
|
|
200
|
+
), oe[S + w] = !0);
|
|
201
201
|
}
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
for (var
|
|
205
|
-
|
|
206
|
-
} else
|
|
207
|
-
return
|
|
208
|
-
|
|
209
|
-
typeof
|
|
210
|
-
),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
202
|
+
if (S = null, v !== void 0 && (n(v), S = "" + v), i(b) && (n(b.key), S = "" + b.key), "key" in b) {
|
|
203
|
+
v = {};
|
|
204
|
+
for (var H in b)
|
|
205
|
+
H !== "key" && (v[H] = b[H]);
|
|
206
|
+
} else v = b;
|
|
207
|
+
return S && o(
|
|
208
|
+
v,
|
|
209
|
+
typeof u == "function" ? u.displayName || u.name || "Unknown" : u
|
|
210
|
+
), m(
|
|
211
|
+
u,
|
|
212
|
+
S,
|
|
213
|
+
v,
|
|
214
|
+
a(),
|
|
215
|
+
B,
|
|
216
|
+
X
|
|
217
217
|
);
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
|
|
219
|
+
function x(u) {
|
|
220
|
+
d(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === G && (u._payload.status === "fulfilled" ? d(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
return typeof
|
|
222
|
+
function d(u) {
|
|
223
|
+
return typeof u == "object" && u !== null && u.$$typeof === p;
|
|
224
224
|
}
|
|
225
|
-
var
|
|
225
|
+
var f = P, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), N = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), y = /* @__PURE__ */ Symbol.for("react.strict_mode"), C = /* @__PURE__ */ Symbol.for("react.profiler"), U = /* @__PURE__ */ Symbol.for("react.consumer"), J = /* @__PURE__ */ Symbol.for("react.context"), lt = /* @__PURE__ */ Symbol.for("react.forward_ref"), it = /* @__PURE__ */ Symbol.for("react.suspense"), ot = /* @__PURE__ */ Symbol.for("react.suspense_list"), ct = /* @__PURE__ */ Symbol.for("react.memo"), G = /* @__PURE__ */ Symbol.for("react.lazy"), dt = /* @__PURE__ */ Symbol.for("react.activity"), ut = /* @__PURE__ */ Symbol.for("react.client.reference"), W = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, se = Object.prototype.hasOwnProperty, mt = Array.isArray, Q = console.createTask ? console.createTask : function() {
|
|
226
226
|
return null;
|
|
227
227
|
};
|
|
228
|
-
|
|
229
|
-
react_stack_bottom_frame: function(
|
|
230
|
-
return
|
|
228
|
+
f = {
|
|
229
|
+
react_stack_bottom_frame: function(u) {
|
|
230
|
+
return u();
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
|
-
var
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
)(),
|
|
237
|
-
|
|
238
|
-
var
|
|
239
|
-
return
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
233
|
+
var ne, ae = {}, le = f.react_stack_bottom_frame.bind(
|
|
234
|
+
f,
|
|
235
|
+
l
|
|
236
|
+
)(), ie = Q(s(l)), oe = {};
|
|
237
|
+
I.Fragment = T, I.jsx = function(u, b, v) {
|
|
238
|
+
var w = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
239
|
+
return h(
|
|
240
|
+
u,
|
|
241
|
+
b,
|
|
242
|
+
v,
|
|
243
243
|
!1,
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
w ? Error("react-stack-top-frame") : le,
|
|
245
|
+
w ? Q(s(u)) : ie
|
|
246
246
|
);
|
|
247
|
-
},
|
|
248
|
-
var
|
|
249
|
-
return
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
247
|
+
}, I.jsxs = function(u, b, v) {
|
|
248
|
+
var w = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
249
|
+
return h(
|
|
250
|
+
u,
|
|
251
|
+
b,
|
|
252
|
+
v,
|
|
253
253
|
!0,
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
w ? Error("react-stack-top-frame") : le,
|
|
255
|
+
w ? Q(s(u)) : ie
|
|
256
256
|
);
|
|
257
257
|
};
|
|
258
|
-
})()),
|
|
258
|
+
})()), I;
|
|
259
259
|
}
|
|
260
|
-
var
|
|
261
|
-
function
|
|
262
|
-
return
|
|
260
|
+
var pe;
|
|
261
|
+
function It() {
|
|
262
|
+
return pe || (pe = 1, process.env.NODE_ENV === "production" ? Y.exports = Ut() : Y.exports = Dt()), Y.exports;
|
|
263
263
|
}
|
|
264
|
-
var
|
|
265
|
-
function
|
|
264
|
+
var t = It();
|
|
265
|
+
function Fe({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
266
|
+
const l = n || a.schema;
|
|
266
267
|
if (s)
|
|
267
|
-
return /* @__PURE__ */
|
|
268
|
-
const i =
|
|
269
|
-
return i && i > 1 ? /* @__PURE__ */
|
|
270
|
-
|
|
268
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e || "-" });
|
|
269
|
+
const i = l?.rows, { inputType: o, ...c } = a;
|
|
270
|
+
return i && i > 1 ? /* @__PURE__ */ t.jsx(
|
|
271
|
+
V,
|
|
271
272
|
{
|
|
273
|
+
...c,
|
|
272
274
|
value: e || "",
|
|
273
|
-
onChange: (
|
|
274
|
-
placeholder:
|
|
275
|
-
disabled: s
|
|
276
|
-
className: l.className
|
|
275
|
+
onChange: (m) => r(m.target.value),
|
|
276
|
+
placeholder: l?.placeholder,
|
|
277
|
+
disabled: s || c.disabled
|
|
277
278
|
}
|
|
278
|
-
) : /* @__PURE__ */
|
|
279
|
+
) : /* @__PURE__ */ t.jsx(
|
|
279
280
|
_,
|
|
280
281
|
{
|
|
281
|
-
|
|
282
|
+
...c,
|
|
283
|
+
type: l?.type === "password" ? "password" : "text",
|
|
282
284
|
value: e || "",
|
|
283
|
-
onChange: (
|
|
284
|
-
placeholder:
|
|
285
|
-
disabled: s
|
|
286
|
-
className: l.className
|
|
285
|
+
onChange: (m) => r(m.target.value),
|
|
286
|
+
placeholder: l?.placeholder,
|
|
287
|
+
disabled: s || c.disabled
|
|
287
288
|
}
|
|
288
289
|
);
|
|
289
290
|
}
|
|
290
|
-
|
|
291
|
+
const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
292
|
+
__proto__: null,
|
|
293
|
+
TextField: Fe
|
|
294
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
295
|
+
function we({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
291
296
|
if (s)
|
|
292
|
-
return /* @__PURE__ */
|
|
293
|
-
const
|
|
294
|
-
return /* @__PURE__ */
|
|
297
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e ?? "-" });
|
|
298
|
+
const l = n || a.schema, i = l?.precision, { inputType: o, ...c } = a;
|
|
299
|
+
return /* @__PURE__ */ t.jsx(
|
|
295
300
|
_,
|
|
296
301
|
{
|
|
302
|
+
...c,
|
|
297
303
|
type: "number",
|
|
298
304
|
value: e ?? "",
|
|
299
|
-
onChange: (
|
|
300
|
-
const
|
|
301
|
-
|
|
305
|
+
onChange: (m) => {
|
|
306
|
+
const h = m.target.value;
|
|
307
|
+
r(h === "" ? null : Number(h));
|
|
302
308
|
},
|
|
303
|
-
placeholder:
|
|
304
|
-
disabled: s,
|
|
305
|
-
step: i ? Math.pow(10, -i) : "any"
|
|
306
|
-
className: l.className
|
|
309
|
+
placeholder: l?.placeholder,
|
|
310
|
+
disabled: s || c.disabled,
|
|
311
|
+
step: i ? Math.pow(10, -i) : "any"
|
|
307
312
|
}
|
|
308
313
|
);
|
|
309
314
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
315
|
+
const Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
316
|
+
__proto__: null,
|
|
317
|
+
NumberField: we
|
|
318
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
319
|
+
function Se({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
320
|
+
const l = n || a.schema, i = l?.widget, o = xt(), c = l?.name || o, m = l?.label || "Checkbox";
|
|
321
|
+
if (s)
|
|
322
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e ? "Yes" : "No" });
|
|
323
|
+
const { inputType: h, ...x } = a;
|
|
324
|
+
return i === "checkbox" ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
325
|
+
/* @__PURE__ */ t.jsx(
|
|
326
|
+
ht,
|
|
314
327
|
{
|
|
315
|
-
|
|
328
|
+
...x,
|
|
329
|
+
id: c,
|
|
316
330
|
checked: !!e,
|
|
317
|
-
onCheckedChange: (
|
|
318
|
-
disabled: s
|
|
319
|
-
className: l.className
|
|
331
|
+
onCheckedChange: (d) => r(!!d),
|
|
332
|
+
disabled: s || x.disabled
|
|
320
333
|
}
|
|
321
334
|
),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
] }) : /* @__PURE__ */
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
|
|
335
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: c, children: m })
|
|
336
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
337
|
+
/* @__PURE__ */ t.jsx(
|
|
338
|
+
pt,
|
|
326
339
|
{
|
|
327
|
-
|
|
340
|
+
...x,
|
|
341
|
+
id: c,
|
|
328
342
|
checked: !!e,
|
|
329
|
-
onCheckedChange:
|
|
330
|
-
disabled: s
|
|
331
|
-
className: l.className
|
|
343
|
+
onCheckedChange: r,
|
|
344
|
+
disabled: s || x.disabled
|
|
332
345
|
}
|
|
333
346
|
),
|
|
334
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: c, children: m })
|
|
335
348
|
] });
|
|
336
349
|
}
|
|
337
|
-
|
|
338
|
-
|
|
350
|
+
const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
351
|
+
__proto__: null,
|
|
352
|
+
BooleanField: Se
|
|
353
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
354
|
+
function Ce({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
355
|
+
const l = n || a.schema, i = l?.options || [];
|
|
339
356
|
if (s) {
|
|
340
|
-
const
|
|
341
|
-
return /* @__PURE__ */
|
|
357
|
+
const o = i.find((c) => c.value === e);
|
|
358
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: o?.label || e || "-" });
|
|
342
359
|
}
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
-
|
|
360
|
+
return /* @__PURE__ */ t.jsxs(
|
|
361
|
+
gt,
|
|
345
362
|
{
|
|
363
|
+
...a,
|
|
346
364
|
value: e,
|
|
347
|
-
onValueChange:
|
|
348
|
-
disabled: s,
|
|
365
|
+
onValueChange: r,
|
|
366
|
+
disabled: s || a.disabled,
|
|
349
367
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ t.jsx(bt, { className: a.className, id: a.id, children: /* @__PURE__ */ t.jsx(jt, { placeholder: l?.placeholder || "Select an option" }) }),
|
|
369
|
+
/* @__PURE__ */ t.jsx(yt, { position: "popper", children: i.map((o) => /* @__PURE__ */ t.jsx(Nt, { value: o.value, children: o.label }, o.value)) })
|
|
352
370
|
]
|
|
353
371
|
}
|
|
354
372
|
);
|
|
355
373
|
}
|
|
356
|
-
|
|
357
|
-
|
|
374
|
+
const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
375
|
+
__proto__: null,
|
|
376
|
+
SelectField: Ce
|
|
377
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
378
|
+
function Pe({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
379
|
+
if (s)
|
|
380
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e ? new Date(e).toLocaleDateString() : "-" });
|
|
381
|
+
const { inputType: l, ...i } = a;
|
|
382
|
+
return /* @__PURE__ */ t.jsx(
|
|
358
383
|
_,
|
|
359
384
|
{
|
|
385
|
+
...i,
|
|
360
386
|
type: "date",
|
|
361
387
|
value: e || "",
|
|
362
|
-
onChange: (
|
|
363
|
-
disabled: s
|
|
364
|
-
className: l.className
|
|
388
|
+
onChange: (o) => r(o.target.value),
|
|
389
|
+
disabled: s || i.disabled
|
|
365
390
|
}
|
|
366
391
|
);
|
|
367
392
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
393
|
+
const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
394
|
+
__proto__: null,
|
|
395
|
+
DateField: Pe
|
|
396
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
397
|
+
function Oe({ value: e, onChange: r, field: n, readonly: s, errorMessage: a, ...l }) {
|
|
398
|
+
const i = n || l.schema;
|
|
399
|
+
if (s)
|
|
400
|
+
return e ? /* @__PURE__ */ t.jsx(
|
|
401
|
+
"a",
|
|
402
|
+
{
|
|
403
|
+
href: `mailto:${e}`,
|
|
404
|
+
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
405
|
+
children: e
|
|
406
|
+
}
|
|
407
|
+
) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
|
|
408
|
+
const { inputType: o, ...c } = l;
|
|
409
|
+
return /* @__PURE__ */ t.jsx(
|
|
377
410
|
_,
|
|
378
411
|
{
|
|
412
|
+
...c,
|
|
379
413
|
type: "email",
|
|
380
414
|
value: e || "",
|
|
381
|
-
onChange: (
|
|
382
|
-
placeholder:
|
|
383
|
-
disabled: s,
|
|
384
|
-
|
|
385
|
-
"aria-invalid": !!l
|
|
415
|
+
onChange: (m) => r(m.target.value),
|
|
416
|
+
placeholder: i?.placeholder || "email@example.com",
|
|
417
|
+
disabled: s || c.disabled,
|
|
418
|
+
"aria-invalid": !!a
|
|
386
419
|
}
|
|
387
420
|
);
|
|
388
421
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
422
|
+
const Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
423
|
+
__proto__: null,
|
|
424
|
+
EmailField: Oe
|
|
425
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
426
|
+
function Te({ value: e, onChange: r, field: n, readonly: s, errorMessage: a, ...l }) {
|
|
427
|
+
const i = n || l.schema;
|
|
428
|
+
if (s)
|
|
429
|
+
return e ? /* @__PURE__ */ t.jsx(
|
|
430
|
+
"a",
|
|
431
|
+
{
|
|
432
|
+
href: `tel:${e}`,
|
|
433
|
+
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
434
|
+
children: e
|
|
435
|
+
}
|
|
436
|
+
) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
|
|
437
|
+
const { inputType: o, ...c } = l;
|
|
438
|
+
return /* @__PURE__ */ t.jsx(
|
|
398
439
|
_,
|
|
399
440
|
{
|
|
441
|
+
...c,
|
|
400
442
|
type: "tel",
|
|
401
443
|
value: e || "",
|
|
402
|
-
onChange: (
|
|
403
|
-
placeholder:
|
|
404
|
-
disabled: s,
|
|
405
|
-
|
|
406
|
-
"aria-invalid": !!l
|
|
444
|
+
onChange: (m) => r(m.target.value),
|
|
445
|
+
placeholder: i?.placeholder || "(555) 123-4567",
|
|
446
|
+
disabled: s || c.disabled,
|
|
447
|
+
"aria-invalid": !!a
|
|
407
448
|
}
|
|
408
449
|
);
|
|
409
450
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
451
|
+
const Gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
452
|
+
__proto__: null,
|
|
453
|
+
PhoneField: Te
|
|
454
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
455
|
+
function Re({ value: e, onChange: r, field: n, readonly: s, errorMessage: a, ...l }) {
|
|
456
|
+
const i = n || l.schema;
|
|
457
|
+
if (s)
|
|
458
|
+
return e ? e.startsWith("http://") || e.startsWith("https://") ? /* @__PURE__ */ t.jsx(
|
|
459
|
+
"a",
|
|
460
|
+
{
|
|
461
|
+
href: e,
|
|
462
|
+
target: "_blank",
|
|
463
|
+
rel: "noopener noreferrer",
|
|
464
|
+
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
465
|
+
children: e
|
|
466
|
+
}
|
|
467
|
+
) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
|
|
468
|
+
const { inputType: o, ...c } = l;
|
|
469
|
+
return /* @__PURE__ */ t.jsx(
|
|
421
470
|
_,
|
|
422
471
|
{
|
|
472
|
+
...c,
|
|
423
473
|
type: "url",
|
|
424
474
|
value: e || "",
|
|
425
|
-
onChange: (
|
|
426
|
-
placeholder:
|
|
427
|
-
disabled: s,
|
|
428
|
-
|
|
429
|
-
"aria-invalid": !!l
|
|
475
|
+
onChange: (m) => r(m.target.value),
|
|
476
|
+
placeholder: i?.placeholder || "https://example.com",
|
|
477
|
+
disabled: s || c.disabled,
|
|
478
|
+
"aria-invalid": !!a
|
|
430
479
|
}
|
|
431
480
|
);
|
|
432
481
|
}
|
|
433
|
-
|
|
482
|
+
const Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
483
|
+
__proto__: null,
|
|
484
|
+
UrlField: Re
|
|
485
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
486
|
+
function Qt(e, r = "USD") {
|
|
434
487
|
try {
|
|
435
488
|
return new Intl.NumberFormat("en-US", {
|
|
436
489
|
style: "currency",
|
|
437
|
-
currency:
|
|
490
|
+
currency: r
|
|
438
491
|
}).format(e);
|
|
439
492
|
} catch {
|
|
440
|
-
return `${
|
|
493
|
+
return `${r} ${e.toFixed(2)}`;
|
|
441
494
|
}
|
|
442
495
|
}
|
|
443
|
-
function
|
|
444
|
-
const
|
|
496
|
+
function ke({ value: e, onChange: r, field: n, readonly: s, errorMessage: a, className: l, ...i }) {
|
|
497
|
+
const o = n || i.schema, c = o?.currency || "USD", m = o?.precision ?? 2;
|
|
445
498
|
if (s)
|
|
446
|
-
return e == null ? /* @__PURE__ */
|
|
447
|
-
const
|
|
448
|
-
const
|
|
449
|
-
isNaN(
|
|
499
|
+
return e == null ? /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium tabular-nums", children: Qt(Number(e), c) });
|
|
500
|
+
const h = (x) => {
|
|
501
|
+
const d = parseFloat(x.target.value);
|
|
502
|
+
isNaN(d) || r(parseFloat(d.toFixed(m)));
|
|
450
503
|
};
|
|
451
|
-
return /* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
/* @__PURE__ */
|
|
504
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
|
|
505
|
+
/* @__PURE__ */ t.jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500", children: c === "USD" ? "$" : c }),
|
|
506
|
+
/* @__PURE__ */ t.jsx(
|
|
454
507
|
_,
|
|
455
508
|
{
|
|
509
|
+
...i,
|
|
456
510
|
type: "number",
|
|
457
511
|
value: e ?? "",
|
|
458
|
-
onChange: (
|
|
459
|
-
const
|
|
460
|
-
|
|
512
|
+
onChange: (x) => {
|
|
513
|
+
const d = x.target.value === "" ? null : parseFloat(x.target.value);
|
|
514
|
+
r(d);
|
|
461
515
|
},
|
|
462
|
-
onBlur:
|
|
463
|
-
placeholder:
|
|
464
|
-
disabled: s,
|
|
465
|
-
className: `pl-8 ${
|
|
466
|
-
step: Math.pow(10, -
|
|
467
|
-
"aria-invalid": !!
|
|
516
|
+
onBlur: h,
|
|
517
|
+
placeholder: o?.placeholder || "0.00",
|
|
518
|
+
disabled: s || i.disabled,
|
|
519
|
+
className: `pl-8 ${l || ""}`,
|
|
520
|
+
step: Math.pow(10, -m).toFixed(m),
|
|
521
|
+
"aria-invalid": !!a
|
|
468
522
|
}
|
|
469
523
|
)
|
|
470
524
|
] });
|
|
471
525
|
}
|
|
472
|
-
|
|
526
|
+
const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
527
|
+
__proto__: null,
|
|
528
|
+
CurrencyField: ke
|
|
529
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
530
|
+
function Ae({ value: e, onChange: r, field: n, readonly: s, errorMessage: a, ...l }) {
|
|
473
531
|
if (s)
|
|
474
|
-
return /* @__PURE__ */
|
|
475
|
-
const
|
|
476
|
-
return /* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
|
|
532
|
+
return /* @__PURE__ */ t.jsx("div", { className: "text-sm whitespace-pre-wrap", children: e || "-" });
|
|
533
|
+
const i = n || l.schema, o = i?.rows || 4, c = i?.max_length, { inputType: m, ...h } = l;
|
|
534
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
|
|
535
|
+
/* @__PURE__ */ t.jsx(
|
|
536
|
+
V,
|
|
479
537
|
{
|
|
538
|
+
...h,
|
|
480
539
|
value: e || "",
|
|
481
|
-
onChange: (
|
|
482
|
-
placeholder:
|
|
483
|
-
disabled: s,
|
|
484
|
-
rows:
|
|
485
|
-
maxLength:
|
|
486
|
-
|
|
487
|
-
"aria-invalid": !!l
|
|
540
|
+
onChange: (x) => r(x.target.value),
|
|
541
|
+
placeholder: i?.placeholder,
|
|
542
|
+
disabled: s || h.disabled,
|
|
543
|
+
rows: o,
|
|
544
|
+
maxLength: c,
|
|
545
|
+
"aria-invalid": !!a
|
|
488
546
|
}
|
|
489
547
|
),
|
|
490
|
-
|
|
548
|
+
c && /* @__PURE__ */ t.jsxs(
|
|
491
549
|
"div",
|
|
492
550
|
{
|
|
493
551
|
className: "absolute bottom-2 right-2 text-xs text-gray-400",
|
|
494
552
|
"aria-live": "polite",
|
|
495
|
-
"aria-label": `Character count: ${(e || "").length} of ${
|
|
553
|
+
"aria-label": `Character count: ${(e || "").length} of ${c}`,
|
|
496
554
|
children: [
|
|
497
555
|
(e || "").length,
|
|
498
556
|
"/",
|
|
499
|
-
|
|
557
|
+
c
|
|
500
558
|
]
|
|
501
559
|
}
|
|
502
560
|
)
|
|
503
561
|
] });
|
|
504
562
|
}
|
|
505
|
-
|
|
563
|
+
const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
564
|
+
__proto__: null,
|
|
565
|
+
TextAreaField: Ae
|
|
566
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
567
|
+
function Z({ value: e, onChange: r, field: n, readonly: s, errorMessage: a, ...l }) {
|
|
506
568
|
if (s)
|
|
507
|
-
return /* @__PURE__ */
|
|
569
|
+
return /* @__PURE__ */ t.jsx(
|
|
508
570
|
"div",
|
|
509
571
|
{
|
|
510
572
|
className: "text-sm prose prose-sm max-w-none",
|
|
511
573
|
children: e || "-"
|
|
512
574
|
}
|
|
513
575
|
);
|
|
514
|
-
const
|
|
515
|
-
return /* @__PURE__ */
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */
|
|
576
|
+
const i = n || l.schema, o = i?.rows || 8, c = i?.format || "markdown";
|
|
577
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
|
|
578
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between text-xs text-gray-500", children: [
|
|
579
|
+
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
518
580
|
"Format: ",
|
|
519
|
-
|
|
581
|
+
c
|
|
520
582
|
] }),
|
|
521
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ t.jsx("span", { className: "italic", children: "Rich text editor (basic)" })
|
|
522
584
|
] }),
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
|
|
585
|
+
/* @__PURE__ */ t.jsx(
|
|
586
|
+
V,
|
|
525
587
|
{
|
|
526
588
|
value: e || "",
|
|
527
|
-
onChange: (
|
|
528
|
-
placeholder:
|
|
529
|
-
disabled: s,
|
|
530
|
-
rows:
|
|
531
|
-
className: `font-mono text-sm ${
|
|
532
|
-
"aria-invalid": !!
|
|
589
|
+
onChange: (m) => r(m.target.value),
|
|
590
|
+
placeholder: i?.placeholder || "Enter text...",
|
|
591
|
+
disabled: s || l.disabled,
|
|
592
|
+
rows: o,
|
|
593
|
+
className: `font-mono text-sm ${l.className || ""}`,
|
|
594
|
+
"aria-invalid": !!a
|
|
533
595
|
}
|
|
534
596
|
)
|
|
535
597
|
] });
|
|
536
598
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
599
|
+
const ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
600
|
+
__proto__: null,
|
|
601
|
+
RichTextField: Z
|
|
602
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
603
|
+
function $e({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
604
|
+
const [l, i] = L(!1), [o, c] = L(""), m = n || a.schema, h = m?.options || [], x = m.multiple || !1, d = m.display_field || "label", f = h.filter(
|
|
605
|
+
(y) => y.label.toLowerCase().includes(o.toLowerCase())
|
|
606
|
+
), p = x ? (Array.isArray(e) ? e : []).map(
|
|
607
|
+
(y) => h.find((C) => C.value === y)
|
|
608
|
+
).filter(Boolean) : e ? [h.find((y) => y.value === e)].filter(Boolean) : [], N = (y) => {
|
|
609
|
+
if (x) {
|
|
610
|
+
const C = Array.isArray(e) ? e : [], U = C.includes(y.value);
|
|
611
|
+
r(U ? C.filter((J) => J !== y.value) : [...C, y.value]);
|
|
546
612
|
} else
|
|
547
|
-
|
|
548
|
-
},
|
|
549
|
-
if (
|
|
550
|
-
const
|
|
551
|
-
|
|
613
|
+
r(y.value), i(!1);
|
|
614
|
+
}, T = (y) => {
|
|
615
|
+
if (x) {
|
|
616
|
+
const C = Array.isArray(e) ? e : [];
|
|
617
|
+
r(C.filter((U) => U !== y));
|
|
552
618
|
} else
|
|
553
|
-
|
|
619
|
+
r(null);
|
|
554
620
|
};
|
|
555
|
-
return s ?
|
|
556
|
-
|
|
557
|
-
|
|
621
|
+
return s ? p.length ? x ? /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: p.map((y, C) => /* @__PURE__ */ t.jsx(k, { variant: "outline", children: y?.[d] || y?.label }, C)) }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: p[0]?.[d] || p[0]?.label }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
|
|
622
|
+
p.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: p.map((y, C) => /* @__PURE__ */ t.jsxs(
|
|
623
|
+
k,
|
|
558
624
|
{
|
|
559
625
|
variant: "outline",
|
|
560
626
|
className: "gap-1",
|
|
561
627
|
children: [
|
|
562
|
-
|
|
563
|
-
/* @__PURE__ */
|
|
628
|
+
y?.[d] || y?.label,
|
|
629
|
+
/* @__PURE__ */ t.jsx(
|
|
564
630
|
"button",
|
|
565
631
|
{
|
|
566
|
-
onClick: () =>
|
|
632
|
+
onClick: () => T(y?.value),
|
|
567
633
|
className: "ml-1 hover:text-destructive",
|
|
568
634
|
type: "button",
|
|
569
|
-
"aria-label": `Remove ${
|
|
570
|
-
children: /* @__PURE__ */
|
|
635
|
+
"aria-label": `Remove ${y?.[d] || y?.label}`,
|
|
636
|
+
children: /* @__PURE__ */ t.jsx(E, { className: "size-3" })
|
|
571
637
|
}
|
|
572
638
|
)
|
|
573
639
|
]
|
|
574
640
|
},
|
|
575
|
-
|
|
641
|
+
C
|
|
576
642
|
)) }),
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
|
|
643
|
+
/* @__PURE__ */ t.jsxs(vt, { open: l, onOpenChange: i, children: [
|
|
644
|
+
/* @__PURE__ */ t.jsx(_t, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
|
|
645
|
+
F,
|
|
580
646
|
{
|
|
581
647
|
variant: "outline",
|
|
582
648
|
className: "w-full justify-start text-left font-normal",
|
|
583
649
|
type: "button",
|
|
584
650
|
children: [
|
|
585
|
-
/* @__PURE__ */
|
|
586
|
-
|
|
651
|
+
/* @__PURE__ */ t.jsx(Pt, { className: "mr-2 size-4" }),
|
|
652
|
+
p.length === 0 ? m?.placeholder || "Select..." : x ? `${p.length} selected` : "Change selection"
|
|
587
653
|
]
|
|
588
654
|
}
|
|
589
655
|
) }),
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
-
/* @__PURE__ */
|
|
592
|
-
|
|
656
|
+
/* @__PURE__ */ t.jsxs(Ft, { className: "max-w-md", children: [
|
|
657
|
+
/* @__PURE__ */ t.jsx(wt, { children: /* @__PURE__ */ t.jsxs(St, { children: [
|
|
658
|
+
m?.label || "Select",
|
|
593
659
|
" ",
|
|
594
|
-
|
|
660
|
+
x && "(multiple)"
|
|
595
661
|
] }) }),
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
|
|
663
|
+
/* @__PURE__ */ t.jsx(
|
|
598
664
|
_,
|
|
599
665
|
{
|
|
600
666
|
placeholder: "Search...",
|
|
601
|
-
value:
|
|
602
|
-
onChange: (
|
|
667
|
+
value: o,
|
|
668
|
+
onChange: (y) => c(y.target.value),
|
|
603
669
|
className: "w-full"
|
|
604
670
|
}
|
|
605
671
|
),
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
const
|
|
608
|
-
return /* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ t.jsx("div", { className: "max-h-64 overflow-y-auto space-y-1", children: f.length === 0 ? /* @__PURE__ */ t.jsx("p", { className: "text-sm text-gray-500 text-center py-4", children: "No options found" }) : f.map((y) => {
|
|
673
|
+
const C = x ? (Array.isArray(e) ? e : []).includes(y.value) : e === y.value;
|
|
674
|
+
return /* @__PURE__ */ t.jsxs(
|
|
609
675
|
"button",
|
|
610
676
|
{
|
|
611
|
-
onClick: () =>
|
|
612
|
-
className: `w-full text-left px-3 py-2 rounded-md text-sm hover:bg-gray-100 flex items-center justify-between ${
|
|
677
|
+
onClick: () => N(y),
|
|
678
|
+
className: `w-full text-left px-3 py-2 rounded-md text-sm hover:bg-gray-100 flex items-center justify-between ${C ? "bg-blue-50 text-blue-700" : ""}`,
|
|
613
679
|
type: "button",
|
|
614
680
|
children: [
|
|
615
|
-
/* @__PURE__ */
|
|
616
|
-
|
|
681
|
+
/* @__PURE__ */ t.jsx("span", { children: y.label }),
|
|
682
|
+
C && /* @__PURE__ */ t.jsx(k, { variant: "default", className: "ml-2", children: "Selected" })
|
|
617
683
|
]
|
|
618
684
|
},
|
|
619
|
-
|
|
685
|
+
y.value
|
|
620
686
|
);
|
|
621
687
|
}) })
|
|
622
688
|
] })
|
|
@@ -624,20 +690,1216 @@ function B({ value: e, onChange: t, field: n, readonly: s }) {
|
|
|
624
690
|
] })
|
|
625
691
|
] });
|
|
626
692
|
}
|
|
627
|
-
|
|
693
|
+
const Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
694
|
+
__proto__: null,
|
|
695
|
+
LookupField: $e
|
|
696
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
697
|
+
function ze({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
698
|
+
if (s) {
|
|
699
|
+
if (!e) return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
|
|
700
|
+
const o = new Date(e);
|
|
701
|
+
return /* @__PURE__ */ t.jsxs("span", { className: "text-sm", children: [
|
|
702
|
+
o.toLocaleDateString(),
|
|
703
|
+
" ",
|
|
704
|
+
o.toLocaleTimeString()
|
|
705
|
+
] });
|
|
706
|
+
}
|
|
707
|
+
const { inputType: l, ...i } = a;
|
|
708
|
+
return /* @__PURE__ */ t.jsx(
|
|
709
|
+
_,
|
|
710
|
+
{
|
|
711
|
+
...i,
|
|
712
|
+
type: "datetime-local",
|
|
713
|
+
value: e || "",
|
|
714
|
+
onChange: (o) => r(o.target.value),
|
|
715
|
+
disabled: s || i.disabled
|
|
716
|
+
}
|
|
717
|
+
);
|
|
718
|
+
}
|
|
719
|
+
const Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
720
|
+
__proto__: null,
|
|
721
|
+
DateTimeField: ze
|
|
722
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
723
|
+
function Ee({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
724
|
+
if (s)
|
|
725
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e || "-" });
|
|
726
|
+
const { inputType: l, ...i } = a;
|
|
727
|
+
return /* @__PURE__ */ t.jsx(
|
|
728
|
+
_,
|
|
729
|
+
{
|
|
730
|
+
...i,
|
|
731
|
+
type: "time",
|
|
732
|
+
value: e || "",
|
|
733
|
+
onChange: (o) => r(o.target.value),
|
|
734
|
+
disabled: s || i.disabled
|
|
735
|
+
}
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
const er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
739
|
+
__proto__: null,
|
|
740
|
+
TimeField: Ee
|
|
741
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
742
|
+
function Me({ value: e, onChange: r, field: n, readonly: s, errorMessage: a, className: l, ...i }) {
|
|
743
|
+
const o = n || i.schema, c = o?.precision ?? 2;
|
|
744
|
+
if (s)
|
|
745
|
+
return e == null ? /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ t.jsxs("span", { className: "text-sm font-medium tabular-nums", children: [
|
|
746
|
+
(e * 100).toFixed(c),
|
|
747
|
+
"%"
|
|
748
|
+
] });
|
|
749
|
+
const m = e != null ? e * 100 : "", h = (x) => {
|
|
750
|
+
if (x.target.value === "") {
|
|
751
|
+
r(null);
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
const d = parseFloat(x.target.value), f = isNaN(d) ? null : d / 100;
|
|
755
|
+
r(f);
|
|
756
|
+
};
|
|
757
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
|
|
758
|
+
/* @__PURE__ */ t.jsx(
|
|
759
|
+
_,
|
|
760
|
+
{
|
|
761
|
+
...i,
|
|
762
|
+
type: "number",
|
|
763
|
+
value: m,
|
|
764
|
+
onChange: h,
|
|
765
|
+
placeholder: o?.placeholder || "0",
|
|
766
|
+
disabled: s || i.disabled,
|
|
767
|
+
className: `pr-8 ${l || ""}`,
|
|
768
|
+
step: Math.pow(10, -c).toFixed(c),
|
|
769
|
+
"aria-invalid": !!a
|
|
770
|
+
}
|
|
771
|
+
),
|
|
772
|
+
/* @__PURE__ */ t.jsx("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500", children: "%" })
|
|
773
|
+
] });
|
|
774
|
+
}
|
|
775
|
+
const tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
776
|
+
__proto__: null,
|
|
777
|
+
PercentField: Me
|
|
778
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
779
|
+
function Ue({ value: e, onChange: r, field: n, readonly: s, className: a, ...l }) {
|
|
780
|
+
const [i, o] = L(!1), c = n || l.schema;
|
|
781
|
+
if (s)
|
|
782
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "••••••••" });
|
|
783
|
+
const { inputType: m, ...h } = l;
|
|
784
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
|
|
785
|
+
/* @__PURE__ */ t.jsx(
|
|
786
|
+
_,
|
|
787
|
+
{
|
|
788
|
+
...h,
|
|
789
|
+
type: i ? "text" : "password",
|
|
790
|
+
value: e || "",
|
|
791
|
+
onChange: (x) => r(x.target.value),
|
|
792
|
+
placeholder: c?.placeholder,
|
|
793
|
+
disabled: s || h.disabled,
|
|
794
|
+
className: `pr-10 ${a || ""}`
|
|
795
|
+
}
|
|
796
|
+
),
|
|
797
|
+
/* @__PURE__ */ t.jsx(
|
|
798
|
+
F,
|
|
799
|
+
{
|
|
800
|
+
type: "button",
|
|
801
|
+
variant: "ghost",
|
|
802
|
+
size: "sm",
|
|
803
|
+
className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
|
|
804
|
+
onClick: () => o(!i),
|
|
805
|
+
tabIndex: -1,
|
|
806
|
+
children: i ? /* @__PURE__ */ t.jsx(Ot, { className: "size-4 text-gray-500" }) : /* @__PURE__ */ t.jsx(Tt, { className: "size-4 text-gray-500" })
|
|
807
|
+
}
|
|
808
|
+
)
|
|
809
|
+
] });
|
|
810
|
+
}
|
|
811
|
+
const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
812
|
+
__proto__: null,
|
|
813
|
+
PasswordField: Ue
|
|
814
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
815
|
+
function De({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
816
|
+
const l = te(null), i = n || a.schema, o = i?.multiple || !1, c = i?.accept ? i.accept.join(",") : void 0;
|
|
817
|
+
if (s) {
|
|
818
|
+
if (!e) return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
|
|
819
|
+
const d = Array.isArray(e) ? e : [e];
|
|
820
|
+
return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-2", children: d.map((f, p) => /* @__PURE__ */ t.jsx("span", { className: "text-sm truncate max-w-xs", children: f.name || f.original_name || "File" }, p)) });
|
|
821
|
+
}
|
|
822
|
+
const m = e ? Array.isArray(e) ? e : [e] : [], h = (d) => {
|
|
823
|
+
const f = Array.from(d.target.files || []);
|
|
824
|
+
if (f.length === 0) return;
|
|
825
|
+
const p = f.map((N) => ({
|
|
826
|
+
name: N.name,
|
|
827
|
+
original_name: N.name,
|
|
828
|
+
size: N.size,
|
|
829
|
+
mime_type: N.type,
|
|
830
|
+
// In a real implementation, this would upload the file and return a URL
|
|
831
|
+
url: URL.createObjectURL(N)
|
|
832
|
+
}));
|
|
833
|
+
r(o ? [...m, ...p] : p[0]);
|
|
834
|
+
}, x = (d) => {
|
|
835
|
+
if (o) {
|
|
836
|
+
const f = m.filter((p, N) => N !== d);
|
|
837
|
+
r(f.length > 0 ? f : null);
|
|
838
|
+
} else
|
|
839
|
+
r(null);
|
|
840
|
+
};
|
|
841
|
+
return /* @__PURE__ */ t.jsxs("div", { className: a.className, children: [
|
|
842
|
+
/* @__PURE__ */ t.jsx(
|
|
843
|
+
"input",
|
|
844
|
+
{
|
|
845
|
+
ref: l,
|
|
846
|
+
type: "file",
|
|
847
|
+
multiple: o,
|
|
848
|
+
accept: c,
|
|
849
|
+
onChange: h,
|
|
850
|
+
className: "hidden"
|
|
851
|
+
}
|
|
852
|
+
),
|
|
853
|
+
/* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
|
|
854
|
+
m.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "space-y-1", children: m.map((d, f) => /* @__PURE__ */ t.jsxs(
|
|
855
|
+
"div",
|
|
856
|
+
{
|
|
857
|
+
className: "flex items-center justify-between gap-2 p-2 bg-gray-50 rounded-md border border-gray-200",
|
|
858
|
+
children: [
|
|
859
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
860
|
+
/* @__PURE__ */ t.jsx(Rt, { className: "size-4 text-gray-500 flex-shrink-0" }),
|
|
861
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-sm truncate", children: d.name || d.original_name || "File" }),
|
|
862
|
+
d.size && /* @__PURE__ */ t.jsxs("span", { className: "text-xs text-gray-500", children: [
|
|
863
|
+
"(",
|
|
864
|
+
(d.size / 1024).toFixed(1),
|
|
865
|
+
" KB)"
|
|
866
|
+
] })
|
|
867
|
+
] }),
|
|
868
|
+
/* @__PURE__ */ t.jsx(
|
|
869
|
+
F,
|
|
870
|
+
{
|
|
871
|
+
type: "button",
|
|
872
|
+
variant: "ghost",
|
|
873
|
+
size: "sm",
|
|
874
|
+
onClick: () => x(f),
|
|
875
|
+
className: "h-6 w-6 p-0",
|
|
876
|
+
children: /* @__PURE__ */ t.jsx(E, { className: "size-3" })
|
|
877
|
+
}
|
|
878
|
+
)
|
|
879
|
+
]
|
|
880
|
+
},
|
|
881
|
+
f
|
|
882
|
+
)) }),
|
|
883
|
+
/* @__PURE__ */ t.jsxs(
|
|
884
|
+
F,
|
|
885
|
+
{
|
|
886
|
+
type: "button",
|
|
887
|
+
variant: "outline",
|
|
888
|
+
onClick: () => l.current?.click(),
|
|
889
|
+
className: "w-full",
|
|
890
|
+
children: [
|
|
891
|
+
/* @__PURE__ */ t.jsx(_e, { className: "size-4 mr-2" }),
|
|
892
|
+
m.length > 0 ? "Add More Files" : "Upload File"
|
|
893
|
+
]
|
|
894
|
+
}
|
|
895
|
+
)
|
|
896
|
+
] })
|
|
897
|
+
] });
|
|
898
|
+
}
|
|
899
|
+
const sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
900
|
+
__proto__: null,
|
|
901
|
+
FileField: De
|
|
902
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
903
|
+
function Ie({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
904
|
+
const l = te(null), i = n || a.schema, o = i?.multiple || !1, c = i?.accept ? i.accept.join(",") : "image/*";
|
|
905
|
+
if (s) {
|
|
906
|
+
if (!e) return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
|
|
907
|
+
const d = Array.isArray(e) ? e : [e];
|
|
908
|
+
return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-2", children: d.map((f, p) => /* @__PURE__ */ t.jsx(
|
|
909
|
+
"img",
|
|
910
|
+
{
|
|
911
|
+
src: f.url || "",
|
|
912
|
+
alt: f.name || `Image ${p + 1}`,
|
|
913
|
+
className: "size-20 rounded-md object-cover border border-gray-200"
|
|
914
|
+
},
|
|
915
|
+
p
|
|
916
|
+
)) });
|
|
917
|
+
}
|
|
918
|
+
const m = e ? Array.isArray(e) ? e : [e] : [], h = (d) => {
|
|
919
|
+
const f = Array.from(d.target.files || []);
|
|
920
|
+
if (f.length === 0) return;
|
|
921
|
+
const p = f.map((N) => ({
|
|
922
|
+
name: N.name,
|
|
923
|
+
original_name: N.name,
|
|
924
|
+
size: N.size,
|
|
925
|
+
mime_type: N.type,
|
|
926
|
+
// In a real implementation, this would upload the image and return a URL
|
|
927
|
+
url: URL.createObjectURL(N)
|
|
928
|
+
}));
|
|
929
|
+
r(o ? [...m, ...p] : p[0]);
|
|
930
|
+
}, x = (d) => {
|
|
931
|
+
if (o) {
|
|
932
|
+
const f = m.filter((p, N) => N !== d);
|
|
933
|
+
r(f.length > 0 ? f : null);
|
|
934
|
+
} else
|
|
935
|
+
r(null);
|
|
936
|
+
};
|
|
937
|
+
return /* @__PURE__ */ t.jsxs("div", { className: a.className, children: [
|
|
938
|
+
/* @__PURE__ */ t.jsx(
|
|
939
|
+
"input",
|
|
940
|
+
{
|
|
941
|
+
ref: l,
|
|
942
|
+
type: "file",
|
|
943
|
+
multiple: o,
|
|
944
|
+
accept: c,
|
|
945
|
+
onChange: h,
|
|
946
|
+
className: "hidden"
|
|
947
|
+
}
|
|
948
|
+
),
|
|
949
|
+
/* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
|
|
950
|
+
m.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "grid grid-cols-4 gap-2", children: m.map((d, f) => /* @__PURE__ */ t.jsxs("div", { className: "relative group", children: [
|
|
951
|
+
/* @__PURE__ */ t.jsx(
|
|
952
|
+
"img",
|
|
953
|
+
{
|
|
954
|
+
src: d.url || "",
|
|
955
|
+
alt: d.name || `Image ${f + 1}`,
|
|
956
|
+
className: "size-20 rounded-md object-cover border border-gray-200"
|
|
957
|
+
}
|
|
958
|
+
),
|
|
959
|
+
/* @__PURE__ */ t.jsx(
|
|
960
|
+
F,
|
|
961
|
+
{
|
|
962
|
+
type: "button",
|
|
963
|
+
variant: "destructive",
|
|
964
|
+
size: "sm",
|
|
965
|
+
onClick: () => x(f),
|
|
966
|
+
className: "absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
967
|
+
children: /* @__PURE__ */ t.jsx(E, { className: "size-3" })
|
|
968
|
+
}
|
|
969
|
+
)
|
|
970
|
+
] }, f)) }),
|
|
971
|
+
/* @__PURE__ */ t.jsxs(
|
|
972
|
+
F,
|
|
973
|
+
{
|
|
974
|
+
type: "button",
|
|
975
|
+
variant: "outline",
|
|
976
|
+
onClick: () => l.current?.click(),
|
|
977
|
+
className: "w-full",
|
|
978
|
+
children: [
|
|
979
|
+
/* @__PURE__ */ t.jsx(kt, { className: "size-4 mr-2" }),
|
|
980
|
+
m.length > 0 ? "Add More Images" : "Upload Image"
|
|
981
|
+
]
|
|
982
|
+
}
|
|
983
|
+
)
|
|
984
|
+
] })
|
|
985
|
+
] });
|
|
986
|
+
}
|
|
987
|
+
const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
988
|
+
__proto__: null,
|
|
989
|
+
ImageField: Ie
|
|
990
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
991
|
+
function Le({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
992
|
+
const l = n || a.schema, i = e && typeof e == "object" ? `${e.latitude || 0}, ${e.longitude || 0}` : "";
|
|
993
|
+
if (s)
|
|
994
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: i || "-" });
|
|
995
|
+
const o = (c) => {
|
|
996
|
+
const m = c.target.value;
|
|
997
|
+
if (!m.trim()) {
|
|
998
|
+
r(null);
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
const h = m.split(",").map((x) => x.trim());
|
|
1002
|
+
if (h.length === 2) {
|
|
1003
|
+
const x = parseFloat(h[0]), d = parseFloat(h[1]);
|
|
1004
|
+
!isNaN(x) && !isNaN(d) && r({ latitude: x, longitude: d });
|
|
1005
|
+
}
|
|
1006
|
+
};
|
|
1007
|
+
return /* @__PURE__ */ t.jsx(
|
|
1008
|
+
_,
|
|
1009
|
+
{
|
|
1010
|
+
type: "text",
|
|
1011
|
+
value: i,
|
|
1012
|
+
onChange: o,
|
|
1013
|
+
placeholder: l?.placeholder || "latitude, longitude",
|
|
1014
|
+
disabled: s || a.disabled,
|
|
1015
|
+
className: a.className
|
|
1016
|
+
}
|
|
1017
|
+
);
|
|
1018
|
+
}
|
|
1019
|
+
const ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1020
|
+
__proto__: null,
|
|
1021
|
+
LocationField: Le
|
|
1022
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1023
|
+
function Ve({ value: e, field: r, ...n }) {
|
|
1024
|
+
const a = (r || n.schema)?.return_type || "text";
|
|
1025
|
+
let l = "-";
|
|
1026
|
+
return e != null && (a === "number" || a === "currency" ? l = typeof e == "number" ? e.toFixed(2) : String(e) : a === "boolean" ? l = e ? "Yes" : "No" : a === "date" ? l = new Date(e).toLocaleDateString() : l = String(e)), /* @__PURE__ */ t.jsx("span", { className: `text-sm font-mono text-gray-700 ${n.className || ""}`, children: l });
|
|
1027
|
+
}
|
|
1028
|
+
const lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1029
|
+
__proto__: null,
|
|
1030
|
+
FormulaField: Ve
|
|
1031
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1032
|
+
function Be({ value: e, field: r, ...n }) {
|
|
1033
|
+
const a = (r || n.schema)?.summary_type || "count";
|
|
1034
|
+
let l = "-";
|
|
1035
|
+
return e != null && (a === "count" ? l = String(e) : ["sum", "avg", "min", "max"].includes(a) ? l = typeof e == "number" ? e.toFixed(2) : String(e) : l = String(e)), /* @__PURE__ */ t.jsx("span", { className: `text-sm font-medium tabular-nums text-gray-700 ${n.className || ""}`, children: l });
|
|
1036
|
+
}
|
|
1037
|
+
const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1038
|
+
__proto__: null,
|
|
1039
|
+
SummaryField: Be
|
|
1040
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1041
|
+
function Ye({ value: e, field: r, ...n }) {
|
|
1042
|
+
const s = e != null ? String(e) : "-";
|
|
1043
|
+
return /* @__PURE__ */ t.jsx("span", { className: `text-sm font-mono text-gray-700 ${n.className || ""}`, children: s });
|
|
1044
|
+
}
|
|
1045
|
+
const or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1046
|
+
__proto__: null,
|
|
1047
|
+
AutoNumberField: Ye
|
|
1048
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1049
|
+
function K({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
1050
|
+
const i = (n || a.schema)?.multiple || !1;
|
|
1051
|
+
if (s) {
|
|
1052
|
+
if (!e) return /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
|
|
1053
|
+
const m = Array.isArray(e) ? e : [e];
|
|
1054
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex -space-x-2", children: [
|
|
1055
|
+
m.slice(0, 3).map((h, x) => {
|
|
1056
|
+
const d = h.name || h.username || "User", f = d.split(" ").map((p) => p[0]).join("").toUpperCase().slice(0, 2);
|
|
1057
|
+
return /* @__PURE__ */ t.jsx($, { className: "size-8 border-2 border-white", title: d, children: /* @__PURE__ */ t.jsx(z, { className: "bg-blue-500 text-white text-xs", children: f }) }, x);
|
|
1058
|
+
}),
|
|
1059
|
+
m.length > 3 && /* @__PURE__ */ t.jsx($, { className: "size-8 border-2 border-white", children: /* @__PURE__ */ t.jsxs(z, { className: "bg-gray-200 text-gray-600 text-xs", children: [
|
|
1060
|
+
"+",
|
|
1061
|
+
m.length - 3
|
|
1062
|
+
] }) })
|
|
1063
|
+
] });
|
|
1064
|
+
}
|
|
1065
|
+
const o = e ? Array.isArray(e) ? e : [e] : [], c = (m) => {
|
|
1066
|
+
if (i) {
|
|
1067
|
+
const h = o.filter((x, d) => d !== m);
|
|
1068
|
+
r(h.length > 0 ? h : null);
|
|
1069
|
+
} else
|
|
1070
|
+
r(null);
|
|
1071
|
+
};
|
|
1072
|
+
return /* @__PURE__ */ t.jsxs("div", { className: a.className, children: [
|
|
1073
|
+
o.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: o.map((m, h) => {
|
|
1074
|
+
const x = m.name || m.username || "User", d = x.split(" ").map((f) => f[0]).join("").toUpperCase().slice(0, 2);
|
|
1075
|
+
return /* @__PURE__ */ t.jsxs(k, { variant: "outline", className: "gap-2 pr-1", children: [
|
|
1076
|
+
/* @__PURE__ */ t.jsx($, { className: "size-5", children: /* @__PURE__ */ t.jsx(z, { className: "bg-blue-500 text-white text-xs", children: d }) }),
|
|
1077
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-sm", children: x }),
|
|
1078
|
+
/* @__PURE__ */ t.jsx(
|
|
1079
|
+
"button",
|
|
1080
|
+
{
|
|
1081
|
+
type: "button",
|
|
1082
|
+
onClick: () => c(h),
|
|
1083
|
+
className: "ml-1 rounded-full hover:bg-gray-200 p-0.5",
|
|
1084
|
+
children: /* @__PURE__ */ t.jsx(E, { className: "size-3" })
|
|
1085
|
+
}
|
|
1086
|
+
)
|
|
1087
|
+
] }, h);
|
|
1088
|
+
}) }),
|
|
1089
|
+
/* @__PURE__ */ t.jsx("div", { className: "text-sm text-gray-500 italic", children: "User selection component requires integration with user management system" })
|
|
1090
|
+
] });
|
|
1091
|
+
}
|
|
1092
|
+
const be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1093
|
+
__proto__: null,
|
|
1094
|
+
UserField: K
|
|
1095
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1096
|
+
function qe({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
1097
|
+
const l = n || a.schema, i = () => e == null ? "" : JSON.stringify(e, null, 2), [o, c] = L(i), [m, h] = L(null);
|
|
1098
|
+
if (ve(() => {
|
|
1099
|
+
try {
|
|
1100
|
+
if (e == null) {
|
|
1101
|
+
c("");
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
const d = o ? JSON.parse(o) : null;
|
|
1105
|
+
JSON.stringify(d) !== JSON.stringify(e) && c(JSON.stringify(e, null, 2));
|
|
1106
|
+
} catch {
|
|
1107
|
+
c(JSON.stringify(e, null, 2));
|
|
1108
|
+
}
|
|
1109
|
+
}, [e, o]), s)
|
|
1110
|
+
return e ? /* @__PURE__ */ t.jsx("pre", { className: O("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40", a.className), children: JSON.stringify(e, null, 2) }) : /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: "-" });
|
|
1111
|
+
const x = (d) => {
|
|
1112
|
+
const f = d.target.value;
|
|
1113
|
+
if (c(f), h(null), !f.trim()) {
|
|
1114
|
+
r(null);
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
try {
|
|
1118
|
+
const p = JSON.parse(f);
|
|
1119
|
+
r(p);
|
|
1120
|
+
} catch {
|
|
1121
|
+
h("Invalid JSON");
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1125
|
+
/* @__PURE__ */ t.jsx(
|
|
1126
|
+
V,
|
|
1127
|
+
{
|
|
1128
|
+
value: o,
|
|
1129
|
+
onChange: x,
|
|
1130
|
+
placeholder: l?.placeholder || `{
|
|
1131
|
+
"key": "value"
|
|
1132
|
+
}`,
|
|
1133
|
+
disabled: s || a.disabled,
|
|
1134
|
+
className: O("font-mono text-xs", m ? "border-red-500 focus-visible:ring-red-500" : "", a.className),
|
|
1135
|
+
rows: 6
|
|
1136
|
+
}
|
|
1137
|
+
),
|
|
1138
|
+
m && /* @__PURE__ */ t.jsx("p", { className: "text-xs text-red-500", children: m })
|
|
1139
|
+
] });
|
|
1140
|
+
}
|
|
1141
|
+
const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1142
|
+
__proto__: null,
|
|
1143
|
+
ObjectField: qe
|
|
1144
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1145
|
+
function Je({ value: e, field: r, ...n }) {
|
|
1146
|
+
const a = (r || n.schema)?.dimensions || (Array.isArray(e) ? e.length : 0);
|
|
1147
|
+
if (!e || !Array.isArray(e))
|
|
1148
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-sm text-gray-500", children: "-" });
|
|
1149
|
+
const l = e.slice(0, 3).map((i) => {
|
|
1150
|
+
const o = Number(i);
|
|
1151
|
+
return isNaN(o) ? "0" : o.toFixed(4);
|
|
1152
|
+
}).join(", ");
|
|
1153
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `text-sm ${n.className || ""}`, children: [
|
|
1154
|
+
/* @__PURE__ */ t.jsxs("span", { className: "font-mono text-gray-700", children: [
|
|
1155
|
+
"[",
|
|
1156
|
+
l,
|
|
1157
|
+
"...]"
|
|
1158
|
+
] }),
|
|
1159
|
+
/* @__PURE__ */ t.jsxs("span", { className: "text-gray-500 ml-2", children: [
|
|
1160
|
+
"(",
|
|
1161
|
+
a,
|
|
1162
|
+
"D)"
|
|
1163
|
+
] })
|
|
1164
|
+
] });
|
|
1165
|
+
}
|
|
1166
|
+
const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1167
|
+
__proto__: null,
|
|
1168
|
+
VectorField: Je
|
|
1169
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1170
|
+
function Ge({ value: e, field: r, readonly: n, ...s }) {
|
|
1171
|
+
const l = (r || s.schema)?.columns || [];
|
|
1172
|
+
return !e || !Array.isArray(e) ? /* @__PURE__ */ t.jsx("span", { className: "text-sm text-gray-500", children: "-" }) : n ? /* @__PURE__ */ t.jsx("div", { className: O("text-sm", s.className), children: /* @__PURE__ */ t.jsxs("span", { className: "text-gray-700", children: [
|
|
1173
|
+
e.length,
|
|
1174
|
+
" rows"
|
|
1175
|
+
] }) }) : /* @__PURE__ */ t.jsxs("div", { className: O("border border-gray-200 rounded-md overflow-hidden", s.className), children: [
|
|
1176
|
+
/* @__PURE__ */ t.jsx("div", { className: "overflow-auto max-h-60", children: /* @__PURE__ */ t.jsxs("table", { className: "w-full text-sm", children: [
|
|
1177
|
+
/* @__PURE__ */ t.jsx("thead", { className: "bg-gray-50 border-b border-gray-200", children: /* @__PURE__ */ t.jsx("tr", { children: l.map((i, o) => /* @__PURE__ */ t.jsx(
|
|
1178
|
+
"th",
|
|
1179
|
+
{
|
|
1180
|
+
className: "px-3 py-2 text-left text-xs font-medium text-gray-700",
|
|
1181
|
+
children: i.label || i.name
|
|
1182
|
+
},
|
|
1183
|
+
o
|
|
1184
|
+
)) }) }),
|
|
1185
|
+
/* @__PURE__ */ t.jsx("tbody", { className: "divide-y divide-gray-200", children: e.slice(0, 5).map((i, o) => /* @__PURE__ */ t.jsx("tr", { className: "hover:bg-gray-50", children: l.map((c, m) => /* @__PURE__ */ t.jsx("td", { className: "px-3 py-2 text-gray-900", children: i[c.name] != null ? String(i[c.name]) : "-" }, m)) }, o)) })
|
|
1186
|
+
] }) }),
|
|
1187
|
+
e.length > 5 && /* @__PURE__ */ t.jsxs("div", { className: "bg-gray-50 px-3 py-2 text-xs text-gray-500 border-t border-gray-200", children: [
|
|
1188
|
+
"Showing 5 of ",
|
|
1189
|
+
e.length,
|
|
1190
|
+
" rows"
|
|
1191
|
+
] })
|
|
1192
|
+
] });
|
|
1193
|
+
}
|
|
1194
|
+
const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1195
|
+
__proto__: null,
|
|
1196
|
+
GridField: Ge
|
|
1197
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1198
|
+
function We({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
1199
|
+
const l = n || a.schema;
|
|
1200
|
+
return s ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1201
|
+
/* @__PURE__ */ t.jsx(
|
|
1202
|
+
"div",
|
|
1203
|
+
{
|
|
1204
|
+
className: "w-6 h-6 rounded border border-input",
|
|
1205
|
+
style: { backgroundColor: e || "#000000" }
|
|
1206
|
+
}
|
|
1207
|
+
),
|
|
1208
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-sm", children: e || "-" })
|
|
1209
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1210
|
+
/* @__PURE__ */ t.jsx(
|
|
1211
|
+
"input",
|
|
1212
|
+
{
|
|
1213
|
+
type: "color",
|
|
1214
|
+
value: e || "#000000",
|
|
1215
|
+
onChange: (i) => r(i.target.value),
|
|
1216
|
+
disabled: s || a.disabled,
|
|
1217
|
+
className: "w-10 h-10 rounded border border-input cursor-pointer"
|
|
1218
|
+
}
|
|
1219
|
+
),
|
|
1220
|
+
/* @__PURE__ */ t.jsx(
|
|
1221
|
+
_,
|
|
1222
|
+
{
|
|
1223
|
+
type: "text",
|
|
1224
|
+
value: e || "",
|
|
1225
|
+
onChange: (i) => r(i.target.value),
|
|
1226
|
+
placeholder: l?.placeholder || "#000000",
|
|
1227
|
+
disabled: s || a.disabled,
|
|
1228
|
+
className: a.className,
|
|
1229
|
+
pattern: "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
|
|
1230
|
+
}
|
|
1231
|
+
)
|
|
1232
|
+
] });
|
|
1233
|
+
}
|
|
1234
|
+
const mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1235
|
+
__proto__: null,
|
|
1236
|
+
ColorField: We
|
|
1237
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1238
|
+
function Qe({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
1239
|
+
const l = n || a.schema, i = l?.min ?? 0, o = l?.max ?? 100, c = l?.step ?? 1;
|
|
1240
|
+
return s ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1241
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium", children: e ?? i }),
|
|
1242
|
+
/* @__PURE__ */ t.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
1243
|
+
"/ ",
|
|
1244
|
+
o
|
|
1245
|
+
] })
|
|
1246
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
1247
|
+
/* @__PURE__ */ t.jsx(
|
|
1248
|
+
Ct,
|
|
1249
|
+
{
|
|
1250
|
+
value: [e ?? i],
|
|
1251
|
+
onValueChange: (m) => r(m[0]),
|
|
1252
|
+
min: i,
|
|
1253
|
+
max: o,
|
|
1254
|
+
step: c,
|
|
1255
|
+
disabled: s || a.disabled,
|
|
1256
|
+
className: a.className
|
|
1257
|
+
}
|
|
1258
|
+
),
|
|
1259
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium w-12 text-right", children: e ?? i })
|
|
1260
|
+
] });
|
|
1261
|
+
}
|
|
1262
|
+
const fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1263
|
+
__proto__: null,
|
|
1264
|
+
SliderField: Qe
|
|
1265
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1266
|
+
function Xe({ value: e, onChange: r, field: n, readonly: s, className: a, ...l }) {
|
|
1267
|
+
const o = (n || l.schema)?.max ?? 5, c = e ?? 0, [m, h] = P.useState(null), x = m !== null ? m : c;
|
|
1268
|
+
return s ? /* @__PURE__ */ t.jsxs("div", { className: O("flex items-center gap-1", a), children: [
|
|
1269
|
+
Array.from({ length: o }, (d, f) => /* @__PURE__ */ t.jsx(
|
|
1270
|
+
de,
|
|
1271
|
+
{
|
|
1272
|
+
className: `w-5 h-5 ${f < c ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground"}`
|
|
1273
|
+
},
|
|
1274
|
+
f
|
|
1275
|
+
)),
|
|
1276
|
+
/* @__PURE__ */ t.jsxs("span", { className: "ml-2 text-sm text-muted-foreground", children: [
|
|
1277
|
+
c,
|
|
1278
|
+
" / ",
|
|
1279
|
+
o
|
|
1280
|
+
] })
|
|
1281
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: O("flex items-center gap-1", a), children: [
|
|
1282
|
+
Array.from({ length: o }, (d, f) => /* @__PURE__ */ t.jsx(
|
|
1283
|
+
"button",
|
|
1284
|
+
{
|
|
1285
|
+
type: "button",
|
|
1286
|
+
onClick: () => r(f + 1),
|
|
1287
|
+
onMouseEnter: () => h(f + 1),
|
|
1288
|
+
onMouseLeave: () => h(null),
|
|
1289
|
+
className: "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded",
|
|
1290
|
+
disabled: s || l.disabled,
|
|
1291
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1292
|
+
de,
|
|
1293
|
+
{
|
|
1294
|
+
className: `w-5 h-5 transition-colors ${f < x ? "fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500" : "text-muted-foreground hover:text-yellow-400"}`
|
|
1295
|
+
}
|
|
1296
|
+
)
|
|
1297
|
+
},
|
|
1298
|
+
f
|
|
1299
|
+
)),
|
|
1300
|
+
/* @__PURE__ */ t.jsxs("span", { className: "ml-2 text-sm text-muted-foreground", children: [
|
|
1301
|
+
c,
|
|
1302
|
+
" / ",
|
|
1303
|
+
o
|
|
1304
|
+
] })
|
|
1305
|
+
] });
|
|
1306
|
+
}
|
|
1307
|
+
const xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1308
|
+
__proto__: null,
|
|
1309
|
+
RatingField: Xe
|
|
1310
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1311
|
+
function He({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
1312
|
+
const l = n || a.schema, i = l?.language ?? "javascript";
|
|
1313
|
+
return s ? /* @__PURE__ */ t.jsx("pre", { className: O("text-sm bg-muted p-2 rounded overflow-x-auto border", a.className), children: /* @__PURE__ */ t.jsx("code", { children: e || "-" }) }) : /* @__PURE__ */ t.jsx(
|
|
1314
|
+
V,
|
|
1315
|
+
{
|
|
1316
|
+
value: e || "",
|
|
1317
|
+
onChange: (o) => r(o.target.value),
|
|
1318
|
+
placeholder: l?.placeholder || `// Write ${i} code here...`,
|
|
1319
|
+
disabled: s || a.disabled,
|
|
1320
|
+
className: O("font-mono text-sm", a.className),
|
|
1321
|
+
rows: 12,
|
|
1322
|
+
spellCheck: !1
|
|
1323
|
+
}
|
|
1324
|
+
);
|
|
1325
|
+
}
|
|
1326
|
+
const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1327
|
+
__proto__: null,
|
|
1328
|
+
CodeField: He
|
|
1329
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1330
|
+
function Ze({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
1331
|
+
const [l, i] = P.useState(!1), o = P.useRef(null), c = n || a.schema, m = (d) => {
|
|
1332
|
+
const f = d.target.files?.[0];
|
|
1333
|
+
if (!f) return;
|
|
1334
|
+
if (!f.type.startsWith("image/")) {
|
|
1335
|
+
console.error("Please select an image file");
|
|
1336
|
+
return;
|
|
1337
|
+
}
|
|
1338
|
+
if (f.size > 5 * 1024 * 1024) {
|
|
1339
|
+
console.error("File size must be less than 5MB");
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1342
|
+
const p = new FileReader();
|
|
1343
|
+
p.onloadend = () => {
|
|
1344
|
+
r(p.result);
|
|
1345
|
+
}, p.readAsDataURL(f);
|
|
1346
|
+
}, h = () => {
|
|
1347
|
+
r("");
|
|
1348
|
+
}, x = () => (c?.defaultName || c?.label || "User").split(" ").map((f) => f[0]).join("").toUpperCase().slice(0, 2);
|
|
1349
|
+
return s ? /* @__PURE__ */ t.jsxs($, { className: "w-16 h-16", children: [
|
|
1350
|
+
e && /* @__PURE__ */ t.jsx(ce, { src: e, alt: c?.label }),
|
|
1351
|
+
/* @__PURE__ */ t.jsx(z, { children: x() })
|
|
1352
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
1353
|
+
/* @__PURE__ */ t.jsxs(
|
|
1354
|
+
"div",
|
|
1355
|
+
{
|
|
1356
|
+
className: "relative",
|
|
1357
|
+
onMouseEnter: () => i(!0),
|
|
1358
|
+
onMouseLeave: () => i(!1),
|
|
1359
|
+
children: [
|
|
1360
|
+
/* @__PURE__ */ t.jsxs($, { className: "w-16 h-16", children: [
|
|
1361
|
+
e && /* @__PURE__ */ t.jsx(ce, { src: e, alt: c?.label }),
|
|
1362
|
+
/* @__PURE__ */ t.jsx(z, { children: x() })
|
|
1363
|
+
] }),
|
|
1364
|
+
!s && l && e && /* @__PURE__ */ t.jsx(
|
|
1365
|
+
"button",
|
|
1366
|
+
{
|
|
1367
|
+
type: "button",
|
|
1368
|
+
onClick: h,
|
|
1369
|
+
className: "absolute -top-1 -right-1 bg-destructive text-destructive-foreground rounded-full p-1 hover:bg-destructive/90",
|
|
1370
|
+
children: /* @__PURE__ */ t.jsx(E, { className: "w-3 h-3" })
|
|
1371
|
+
}
|
|
1372
|
+
)
|
|
1373
|
+
]
|
|
1374
|
+
}
|
|
1375
|
+
),
|
|
1376
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
1377
|
+
/* @__PURE__ */ t.jsx(
|
|
1378
|
+
"input",
|
|
1379
|
+
{
|
|
1380
|
+
ref: o,
|
|
1381
|
+
type: "file",
|
|
1382
|
+
accept: "image/*",
|
|
1383
|
+
onChange: m,
|
|
1384
|
+
className: "hidden"
|
|
1385
|
+
}
|
|
1386
|
+
),
|
|
1387
|
+
/* @__PURE__ */ t.jsxs(
|
|
1388
|
+
F,
|
|
1389
|
+
{
|
|
1390
|
+
type: "button",
|
|
1391
|
+
variant: "outline",
|
|
1392
|
+
size: "sm",
|
|
1393
|
+
onClick: () => o.current?.click(),
|
|
1394
|
+
disabled: s || a.disabled,
|
|
1395
|
+
children: [
|
|
1396
|
+
/* @__PURE__ */ t.jsx(_e, { className: "w-4 h-4 mr-2" }),
|
|
1397
|
+
e ? "Change" : "Upload",
|
|
1398
|
+
" Avatar"
|
|
1399
|
+
]
|
|
1400
|
+
}
|
|
1401
|
+
),
|
|
1402
|
+
/* @__PURE__ */ t.jsx("p", { className: "text-xs text-muted-foreground", children: "PNG, JPG up to 5MB" })
|
|
1403
|
+
] })
|
|
1404
|
+
] });
|
|
1405
|
+
}
|
|
1406
|
+
const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1407
|
+
__proto__: null,
|
|
1408
|
+
AvatarField: Ze
|
|
1409
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1410
|
+
function Ke({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
1411
|
+
const l = e || {}, i = (c, m) => {
|
|
1412
|
+
r({
|
|
1413
|
+
...l,
|
|
1414
|
+
[c]: m
|
|
1415
|
+
});
|
|
1416
|
+
}, o = (c) => [
|
|
1417
|
+
c.street,
|
|
1418
|
+
c.city,
|
|
1419
|
+
[c.state, c.zipCode].filter(Boolean).join(" "),
|
|
1420
|
+
c.country
|
|
1421
|
+
].filter(Boolean).join(", ") || "-";
|
|
1422
|
+
return s ? /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: o(l) }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-3", children: [
|
|
1423
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1424
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "street", className: "text-xs", children: "Street Address" }),
|
|
1425
|
+
/* @__PURE__ */ t.jsx(
|
|
1426
|
+
_,
|
|
1427
|
+
{
|
|
1428
|
+
id: "street",
|
|
1429
|
+
type: "text",
|
|
1430
|
+
value: l.street || "",
|
|
1431
|
+
onChange: (c) => i("street", c.target.value),
|
|
1432
|
+
placeholder: "123 Main St",
|
|
1433
|
+
disabled: s || a.disabled,
|
|
1434
|
+
className: a.className
|
|
1435
|
+
}
|
|
1436
|
+
)
|
|
1437
|
+
] }),
|
|
1438
|
+
/* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
1439
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1440
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "city", className: "text-xs", children: "City" }),
|
|
1441
|
+
/* @__PURE__ */ t.jsx(
|
|
1442
|
+
_,
|
|
1443
|
+
{
|
|
1444
|
+
id: "city",
|
|
1445
|
+
type: "text",
|
|
1446
|
+
value: l.city || "",
|
|
1447
|
+
onChange: (c) => i("city", c.target.value),
|
|
1448
|
+
placeholder: "San Francisco",
|
|
1449
|
+
disabled: s || a.disabled
|
|
1450
|
+
}
|
|
1451
|
+
)
|
|
1452
|
+
] }),
|
|
1453
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1454
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "state", className: "text-xs", children: "State / Province" }),
|
|
1455
|
+
/* @__PURE__ */ t.jsx(
|
|
1456
|
+
_,
|
|
1457
|
+
{
|
|
1458
|
+
id: "state",
|
|
1459
|
+
type: "text",
|
|
1460
|
+
value: l.state || "",
|
|
1461
|
+
onChange: (c) => i("state", c.target.value),
|
|
1462
|
+
placeholder: "CA",
|
|
1463
|
+
disabled: s || a.disabled
|
|
1464
|
+
}
|
|
1465
|
+
)
|
|
1466
|
+
] })
|
|
1467
|
+
] }),
|
|
1468
|
+
/* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
1469
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1470
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "zipCode", className: "text-xs", children: "ZIP / Postal Code" }),
|
|
1471
|
+
/* @__PURE__ */ t.jsx(
|
|
1472
|
+
_,
|
|
1473
|
+
{
|
|
1474
|
+
id: "zipCode",
|
|
1475
|
+
type: "text",
|
|
1476
|
+
value: l.zipCode || "",
|
|
1477
|
+
onChange: (c) => i("zipCode", c.target.value),
|
|
1478
|
+
placeholder: "94102",
|
|
1479
|
+
disabled: s || a.disabled
|
|
1480
|
+
}
|
|
1481
|
+
)
|
|
1482
|
+
] }),
|
|
1483
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1484
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "country", className: "text-xs", children: "Country" }),
|
|
1485
|
+
/* @__PURE__ */ t.jsx(
|
|
1486
|
+
_,
|
|
1487
|
+
{
|
|
1488
|
+
id: "country",
|
|
1489
|
+
type: "text",
|
|
1490
|
+
value: l.country || "",
|
|
1491
|
+
onChange: (c) => i("country", c.target.value),
|
|
1492
|
+
placeholder: "United States",
|
|
1493
|
+
disabled: s || a.disabled
|
|
1494
|
+
}
|
|
1495
|
+
)
|
|
1496
|
+
] })
|
|
1497
|
+
] })
|
|
1498
|
+
] });
|
|
1499
|
+
}
|
|
1500
|
+
const gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1501
|
+
__proto__: null,
|
|
1502
|
+
AddressField: Ke
|
|
1503
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1504
|
+
function et({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
1505
|
+
const [l, i] = P.useState(!1), o = e || {}, c = (d, f) => {
|
|
1506
|
+
r({
|
|
1507
|
+
...o,
|
|
1508
|
+
[d]: f ? Number(f) : void 0
|
|
1509
|
+
});
|
|
1510
|
+
}, m = () => {
|
|
1511
|
+
if (!navigator.geolocation) {
|
|
1512
|
+
console.error("Geolocation is not supported by this browser");
|
|
1513
|
+
return;
|
|
1514
|
+
}
|
|
1515
|
+
i(!0), navigator.geolocation.getCurrentPosition(
|
|
1516
|
+
(d) => {
|
|
1517
|
+
r({
|
|
1518
|
+
latitude: d.coords.latitude,
|
|
1519
|
+
longitude: d.coords.longitude,
|
|
1520
|
+
accuracy: d.coords.accuracy
|
|
1521
|
+
}), i(!1);
|
|
1522
|
+
},
|
|
1523
|
+
(d) => {
|
|
1524
|
+
console.error("Error getting location:", d.message), i(!1);
|
|
1525
|
+
},
|
|
1526
|
+
{
|
|
1527
|
+
enableHighAccuracy: !0,
|
|
1528
|
+
timeout: 5e3,
|
|
1529
|
+
maximumAge: 0
|
|
1530
|
+
}
|
|
1531
|
+
);
|
|
1532
|
+
}, h = (d) => !d.latitude || !d.longitude ? "-" : `${d.latitude.toFixed(6)}, ${d.longitude.toFixed(6)}`, x = () => {
|
|
1533
|
+
if (!o.latitude || !o.longitude) return;
|
|
1534
|
+
const d = `https://www.google.com/maps?q=${o.latitude},${o.longitude}`;
|
|
1535
|
+
window.open(d, "_blank");
|
|
1536
|
+
};
|
|
1537
|
+
return s ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1538
|
+
/* @__PURE__ */ t.jsx(ue, { className: "w-4 h-4 text-muted-foreground" }),
|
|
1539
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-sm", children: h(o) }),
|
|
1540
|
+
o.latitude && o.longitude && /* @__PURE__ */ t.jsx(
|
|
1541
|
+
F,
|
|
1542
|
+
{
|
|
1543
|
+
type: "button",
|
|
1544
|
+
variant: "link",
|
|
1545
|
+
size: "sm",
|
|
1546
|
+
onClick: x,
|
|
1547
|
+
className: "p-0 h-auto",
|
|
1548
|
+
children: "View on map"
|
|
1549
|
+
}
|
|
1550
|
+
)
|
|
1551
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-3", children: [
|
|
1552
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1553
|
+
/* @__PURE__ */ t.jsxs(
|
|
1554
|
+
F,
|
|
1555
|
+
{
|
|
1556
|
+
type: "button",
|
|
1557
|
+
variant: "outline",
|
|
1558
|
+
size: "sm",
|
|
1559
|
+
onClick: m,
|
|
1560
|
+
disabled: s || l,
|
|
1561
|
+
children: [
|
|
1562
|
+
/* @__PURE__ */ t.jsx(At, { className: "w-4 h-4 mr-2" }),
|
|
1563
|
+
l ? "Getting location..." : "Use Current Location"
|
|
1564
|
+
]
|
|
1565
|
+
}
|
|
1566
|
+
),
|
|
1567
|
+
o.latitude && o.longitude && /* @__PURE__ */ t.jsxs(
|
|
1568
|
+
F,
|
|
1569
|
+
{
|
|
1570
|
+
type: "button",
|
|
1571
|
+
variant: "link",
|
|
1572
|
+
size: "sm",
|
|
1573
|
+
onClick: x,
|
|
1574
|
+
children: [
|
|
1575
|
+
/* @__PURE__ */ t.jsx(ue, { className: "w-4 h-4 mr-2" }),
|
|
1576
|
+
"View on map"
|
|
1577
|
+
]
|
|
1578
|
+
}
|
|
1579
|
+
)
|
|
1580
|
+
] }),
|
|
1581
|
+
/* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
1582
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1583
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "latitude", className: "text-xs", children: "Latitude" }),
|
|
1584
|
+
/* @__PURE__ */ t.jsx(
|
|
1585
|
+
_,
|
|
1586
|
+
{
|
|
1587
|
+
id: "latitude",
|
|
1588
|
+
type: "number",
|
|
1589
|
+
value: o.latitude ?? "",
|
|
1590
|
+
onChange: (d) => c("latitude", d.target.value),
|
|
1591
|
+
placeholder: "37.7749",
|
|
1592
|
+
disabled: s || a.disabled,
|
|
1593
|
+
step: "any",
|
|
1594
|
+
className: a.className
|
|
1595
|
+
}
|
|
1596
|
+
)
|
|
1597
|
+
] }),
|
|
1598
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1599
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "longitude", className: "text-xs", children: "Longitude" }),
|
|
1600
|
+
/* @__PURE__ */ t.jsx(
|
|
1601
|
+
_,
|
|
1602
|
+
{
|
|
1603
|
+
id: "longitude",
|
|
1604
|
+
type: "number",
|
|
1605
|
+
value: o.longitude ?? "",
|
|
1606
|
+
onChange: (d) => c("longitude", d.target.value),
|
|
1607
|
+
placeholder: "-122.4194",
|
|
1608
|
+
disabled: s || a.disabled,
|
|
1609
|
+
step: "any"
|
|
1610
|
+
}
|
|
1611
|
+
)
|
|
1612
|
+
] })
|
|
1613
|
+
] }),
|
|
1614
|
+
o.accuracy && /* @__PURE__ */ t.jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
1615
|
+
"Accuracy: ±",
|
|
1616
|
+
o.accuracy.toFixed(0),
|
|
1617
|
+
"m"
|
|
1618
|
+
] })
|
|
1619
|
+
] });
|
|
1620
|
+
}
|
|
1621
|
+
const br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1622
|
+
__proto__: null,
|
|
1623
|
+
GeolocationField: et
|
|
1624
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1625
|
+
function tt({ value: e, onChange: r, readonly: n }) {
|
|
1626
|
+
const s = te(null), [a, l] = P.useState(!1), [i, o] = P.useState(!e);
|
|
1627
|
+
ve(() => {
|
|
1628
|
+
if (e && s.current) {
|
|
1629
|
+
const f = s.current.getContext("2d");
|
|
1630
|
+
if (f) {
|
|
1631
|
+
const p = new Image();
|
|
1632
|
+
p.onload = () => {
|
|
1633
|
+
f.drawImage(p, 0, 0), o(!1);
|
|
1634
|
+
}, p.src = e;
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
}, [e]);
|
|
1638
|
+
const c = (d) => {
|
|
1639
|
+
if (n) return;
|
|
1640
|
+
l(!0), o(!1);
|
|
1641
|
+
const f = s.current;
|
|
1642
|
+
if (!f) return;
|
|
1643
|
+
const p = f.getContext("2d");
|
|
1644
|
+
if (!p) return;
|
|
1645
|
+
const N = f.getBoundingClientRect(), T = "touches" in d ? d.touches[0].clientX - N.left : d.clientX - N.left, y = "touches" in d ? d.touches[0].clientY - N.top : d.clientY - N.top;
|
|
1646
|
+
p.beginPath(), p.moveTo(T, y);
|
|
1647
|
+
}, m = (d) => {
|
|
1648
|
+
if (!a || n) return;
|
|
1649
|
+
const f = s.current;
|
|
1650
|
+
if (!f) return;
|
|
1651
|
+
const p = f.getContext("2d");
|
|
1652
|
+
if (!p) return;
|
|
1653
|
+
const N = f.getBoundingClientRect(), T = "touches" in d ? d.touches[0].clientX - N.left : d.clientX - N.left, y = "touches" in d ? d.touches[0].clientY - N.top : d.clientY - N.top;
|
|
1654
|
+
p.lineTo(T, y), p.strokeStyle = "#000", p.lineWidth = 2, p.lineCap = "round", p.lineJoin = "round", p.stroke();
|
|
1655
|
+
}, h = () => {
|
|
1656
|
+
if (!a) return;
|
|
1657
|
+
l(!1);
|
|
1658
|
+
const d = s.current;
|
|
1659
|
+
if (!d) return;
|
|
1660
|
+
const f = d.toDataURL("image/png");
|
|
1661
|
+
r(f);
|
|
1662
|
+
}, x = () => {
|
|
1663
|
+
const d = s.current;
|
|
1664
|
+
if (!d) return;
|
|
1665
|
+
const f = d.getContext("2d");
|
|
1666
|
+
f && (f.clearRect(0, 0, d.width, d.height), o(!0), r(""));
|
|
1667
|
+
};
|
|
1668
|
+
return n && e ? /* @__PURE__ */ t.jsx("div", { className: "border rounded p-2 bg-white", children: /* @__PURE__ */ t.jsx("img", { src: e, alt: "Signature", className: "max-w-full h-auto" }) }) : n && !e ? /* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: "No signature" }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
|
|
1669
|
+
/* @__PURE__ */ t.jsx("div", { className: "border rounded bg-white", children: /* @__PURE__ */ t.jsx(
|
|
1670
|
+
"canvas",
|
|
1671
|
+
{
|
|
1672
|
+
ref: s,
|
|
1673
|
+
width: 400,
|
|
1674
|
+
height: 200,
|
|
1675
|
+
className: "w-full touch-none cursor-crosshair",
|
|
1676
|
+
onMouseDown: c,
|
|
1677
|
+
onMouseMove: m,
|
|
1678
|
+
onMouseUp: h,
|
|
1679
|
+
onMouseLeave: h,
|
|
1680
|
+
onTouchStart: c,
|
|
1681
|
+
onTouchMove: m,
|
|
1682
|
+
onTouchEnd: h
|
|
1683
|
+
}
|
|
1684
|
+
) }),
|
|
1685
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
1686
|
+
/* @__PURE__ */ t.jsx("p", { className: "text-xs text-muted-foreground", children: i ? "Sign above" : "Signature captured" }),
|
|
1687
|
+
/* @__PURE__ */ t.jsxs(
|
|
1688
|
+
F,
|
|
1689
|
+
{
|
|
1690
|
+
type: "button",
|
|
1691
|
+
variant: "outline",
|
|
1692
|
+
size: "sm",
|
|
1693
|
+
onClick: x,
|
|
1694
|
+
disabled: n || i,
|
|
1695
|
+
children: [
|
|
1696
|
+
/* @__PURE__ */ t.jsx($t, { className: "w-4 h-4 mr-2" }),
|
|
1697
|
+
"Clear"
|
|
1698
|
+
]
|
|
1699
|
+
}
|
|
1700
|
+
)
|
|
1701
|
+
] })
|
|
1702
|
+
] });
|
|
1703
|
+
}
|
|
1704
|
+
const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1705
|
+
__proto__: null,
|
|
1706
|
+
SignatureField: tt
|
|
1707
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1708
|
+
function rt({ value: e, onChange: r, field: n, readonly: s, ...a }) {
|
|
1709
|
+
const [l, i] = P.useState(!1), o = n || a.schema, c = (h) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(h)}`, m = () => {
|
|
1710
|
+
e && navigator.clipboard.writeText(e);
|
|
1711
|
+
};
|
|
1712
|
+
return s ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1713
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-sm flex-1 truncate", children: e || "-" }),
|
|
1714
|
+
e && /* @__PURE__ */ t.jsxs(
|
|
1715
|
+
F,
|
|
1716
|
+
{
|
|
1717
|
+
type: "button",
|
|
1718
|
+
variant: "outline",
|
|
1719
|
+
size: "sm",
|
|
1720
|
+
onClick: () => i(!l),
|
|
1721
|
+
children: [
|
|
1722
|
+
/* @__PURE__ */ t.jsx(me, { className: "w-4 h-4 mr-2" }),
|
|
1723
|
+
l ? "Hide" : "Show",
|
|
1724
|
+
" QR"
|
|
1725
|
+
]
|
|
1726
|
+
}
|
|
1727
|
+
)
|
|
1728
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-3", children: [
|
|
1729
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1730
|
+
/* @__PURE__ */ t.jsx(
|
|
1731
|
+
_,
|
|
1732
|
+
{
|
|
1733
|
+
type: "text",
|
|
1734
|
+
value: e || "",
|
|
1735
|
+
onChange: (h) => r(h.target.value),
|
|
1736
|
+
placeholder: o?.placeholder || "Enter text for QR code",
|
|
1737
|
+
disabled: s || a.disabled,
|
|
1738
|
+
className: a.className
|
|
1739
|
+
}
|
|
1740
|
+
),
|
|
1741
|
+
e && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1742
|
+
/* @__PURE__ */ t.jsx(
|
|
1743
|
+
F,
|
|
1744
|
+
{
|
|
1745
|
+
type: "button",
|
|
1746
|
+
variant: "outline",
|
|
1747
|
+
size: "sm",
|
|
1748
|
+
onClick: m,
|
|
1749
|
+
children: /* @__PURE__ */ t.jsx(zt, { className: "w-4 h-4" })
|
|
1750
|
+
}
|
|
1751
|
+
),
|
|
1752
|
+
/* @__PURE__ */ t.jsx(
|
|
1753
|
+
F,
|
|
1754
|
+
{
|
|
1755
|
+
type: "button",
|
|
1756
|
+
variant: "outline",
|
|
1757
|
+
size: "sm",
|
|
1758
|
+
onClick: () => i(!l),
|
|
1759
|
+
children: /* @__PURE__ */ t.jsx(me, { className: "w-4 h-4" })
|
|
1760
|
+
}
|
|
1761
|
+
)
|
|
1762
|
+
] })
|
|
1763
|
+
] }),
|
|
1764
|
+
l && e && /* @__PURE__ */ t.jsx("div", { className: "border rounded p-4 bg-white flex justify-center", children: /* @__PURE__ */ t.jsx(
|
|
1765
|
+
"img",
|
|
1766
|
+
{
|
|
1767
|
+
src: c(e),
|
|
1768
|
+
alt: "QR Code",
|
|
1769
|
+
className: "w-48 h-48"
|
|
1770
|
+
}
|
|
1771
|
+
) }),
|
|
1772
|
+
e && /* @__PURE__ */ t.jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
1773
|
+
"QR code contains: ",
|
|
1774
|
+
e.length,
|
|
1775
|
+
" characters"
|
|
1776
|
+
] })
|
|
1777
|
+
] });
|
|
1778
|
+
}
|
|
1779
|
+
const yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1780
|
+
__proto__: null,
|
|
1781
|
+
QRCodeField: rt
|
|
1782
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1783
|
+
function st({
|
|
1784
|
+
value: e,
|
|
1785
|
+
onChange: r,
|
|
1786
|
+
field: n,
|
|
1787
|
+
readonly: s,
|
|
1788
|
+
className: a,
|
|
1789
|
+
...l
|
|
1790
|
+
}) {
|
|
1791
|
+
const i = e || [], o = n || l.schema, c = () => {
|
|
1792
|
+
const x = {
|
|
1793
|
+
id: `new-${Date.now()}`,
|
|
1794
|
+
label: "New Related Record"
|
|
1795
|
+
};
|
|
1796
|
+
r([...i, x]);
|
|
1797
|
+
}, m = (x) => {
|
|
1798
|
+
r(i.filter((d) => d.id !== x));
|
|
1799
|
+
}, h = (x) => {
|
|
1800
|
+
console.log("View detail:", x);
|
|
1801
|
+
};
|
|
1802
|
+
return s ? /* @__PURE__ */ t.jsxs("div", { className: O("space-y-2", a), children: [
|
|
1803
|
+
i.length === 0 ? /* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: "No related records" }) : i.map((x) => /* @__PURE__ */ t.jsxs(
|
|
1804
|
+
"div",
|
|
1805
|
+
{
|
|
1806
|
+
className: "flex items-center justify-between p-2 border rounded hover:bg-muted/50",
|
|
1807
|
+
children: [
|
|
1808
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-sm", children: x.label }),
|
|
1809
|
+
/* @__PURE__ */ t.jsx(
|
|
1810
|
+
F,
|
|
1811
|
+
{
|
|
1812
|
+
type: "button",
|
|
1813
|
+
variant: "ghost",
|
|
1814
|
+
size: "sm",
|
|
1815
|
+
onClick: () => h(x),
|
|
1816
|
+
children: /* @__PURE__ */ t.jsx(fe, { className: "w-4 h-4" })
|
|
1817
|
+
}
|
|
1818
|
+
)
|
|
1819
|
+
]
|
|
1820
|
+
},
|
|
1821
|
+
x.id
|
|
1822
|
+
)),
|
|
1823
|
+
/* @__PURE__ */ t.jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
1824
|
+
i.length,
|
|
1825
|
+
" ",
|
|
1826
|
+
i.length === 1 ? "record" : "records"
|
|
1827
|
+
] })
|
|
1828
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: O("space-y-3", a), children: [
|
|
1829
|
+
/* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
|
|
1830
|
+
i.map((x) => /* @__PURE__ */ t.jsxs(
|
|
1831
|
+
"div",
|
|
1832
|
+
{
|
|
1833
|
+
className: "flex items-center justify-between gap-2 p-2 border rounded hover:bg-muted/50",
|
|
1834
|
+
children: [
|
|
1835
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
1836
|
+
/* @__PURE__ */ t.jsx(k, { variant: "outline", children: x.id }),
|
|
1837
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-sm flex-1", children: x.label })
|
|
1838
|
+
] }),
|
|
1839
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
1840
|
+
/* @__PURE__ */ t.jsx(
|
|
1841
|
+
F,
|
|
1842
|
+
{
|
|
1843
|
+
type: "button",
|
|
1844
|
+
variant: "ghost",
|
|
1845
|
+
size: "sm",
|
|
1846
|
+
onClick: () => h(x),
|
|
1847
|
+
children: /* @__PURE__ */ t.jsx(fe, { className: "w-4 h-4" })
|
|
1848
|
+
}
|
|
1849
|
+
),
|
|
1850
|
+
/* @__PURE__ */ t.jsx(
|
|
1851
|
+
F,
|
|
1852
|
+
{
|
|
1853
|
+
type: "button",
|
|
1854
|
+
variant: "ghost",
|
|
1855
|
+
size: "sm",
|
|
1856
|
+
onClick: () => m(x.id),
|
|
1857
|
+
disabled: l.disabled,
|
|
1858
|
+
children: /* @__PURE__ */ t.jsx(E, { className: "w-4 h-4" })
|
|
1859
|
+
}
|
|
1860
|
+
)
|
|
1861
|
+
] })
|
|
1862
|
+
]
|
|
1863
|
+
},
|
|
1864
|
+
x.id
|
|
1865
|
+
)),
|
|
1866
|
+
i.length === 0 && /* @__PURE__ */ t.jsx("div", { className: "text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20", children: "No related records" })
|
|
1867
|
+
] }),
|
|
1868
|
+
/* @__PURE__ */ t.jsxs(
|
|
1869
|
+
F,
|
|
1870
|
+
{
|
|
1871
|
+
type: "button",
|
|
1872
|
+
variant: "outline",
|
|
1873
|
+
className: "w-full",
|
|
1874
|
+
onClick: c,
|
|
1875
|
+
disabled: l.disabled,
|
|
1876
|
+
children: [
|
|
1877
|
+
/* @__PURE__ */ t.jsx(Et, { className: "w-4 h-4 mr-2" }),
|
|
1878
|
+
"Add ",
|
|
1879
|
+
o?.label || "Record"
|
|
1880
|
+
]
|
|
1881
|
+
}
|
|
1882
|
+
)
|
|
1883
|
+
] });
|
|
1884
|
+
}
|
|
1885
|
+
const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1886
|
+
__proto__: null,
|
|
1887
|
+
MasterDetailField: st
|
|
1888
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1889
|
+
function vr(e, r = "USD") {
|
|
628
1890
|
try {
|
|
629
1891
|
return new Intl.NumberFormat("en-US", {
|
|
630
1892
|
style: "currency",
|
|
631
|
-
currency:
|
|
1893
|
+
currency: r
|
|
632
1894
|
}).format(e);
|
|
633
1895
|
} catch {
|
|
634
|
-
return `${
|
|
1896
|
+
return `${r} ${e.toFixed(2)}`;
|
|
635
1897
|
}
|
|
636
1898
|
}
|
|
637
|
-
function
|
|
638
|
-
return `${(e * 100).toFixed(
|
|
1899
|
+
function _r(e, r = 2) {
|
|
1900
|
+
return `${(e * 100).toFixed(r)}%`;
|
|
639
1901
|
}
|
|
640
|
-
function
|
|
1902
|
+
function Fr(e, r) {
|
|
641
1903
|
if (!e) return "-";
|
|
642
1904
|
const n = typeof e == "string" ? new Date(e) : e;
|
|
643
1905
|
return isNaN(n.getTime()) ? "-" : n.toLocaleDateString("en-US", {
|
|
@@ -646,10 +1908,10 @@ function Qe(e, t) {
|
|
|
646
1908
|
day: "numeric"
|
|
647
1909
|
});
|
|
648
1910
|
}
|
|
649
|
-
function
|
|
1911
|
+
function wr(e) {
|
|
650
1912
|
if (!e) return "-";
|
|
651
|
-
const
|
|
652
|
-
return isNaN(
|
|
1913
|
+
const r = typeof e == "string" ? new Date(e) : e;
|
|
1914
|
+
return isNaN(r.getTime()) ? "-" : r.toLocaleDateString("en-US", {
|
|
653
1915
|
year: "numeric",
|
|
654
1916
|
month: "short",
|
|
655
1917
|
day: "numeric",
|
|
@@ -657,46 +1919,46 @@ function Ze(e) {
|
|
|
657
1919
|
minute: "2-digit"
|
|
658
1920
|
});
|
|
659
1921
|
}
|
|
660
|
-
function
|
|
661
|
-
return /* @__PURE__ */
|
|
1922
|
+
function A({ value: e }) {
|
|
1923
|
+
return /* @__PURE__ */ t.jsx("span", { className: "truncate", children: e || "-" });
|
|
662
1924
|
}
|
|
663
|
-
function
|
|
664
|
-
if (e == null) return /* @__PURE__ */
|
|
665
|
-
const s =
|
|
666
|
-
return /* @__PURE__ */
|
|
1925
|
+
function Sr({ value: e, field: r }) {
|
|
1926
|
+
if (e == null) return /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
1927
|
+
const s = r.precision ?? 0, a = typeof e == "number" ? e.toFixed(s) : e;
|
|
1928
|
+
return /* @__PURE__ */ t.jsx("span", { className: "tabular-nums", children: a });
|
|
667
1929
|
}
|
|
668
|
-
function
|
|
669
|
-
if (e == null) return /* @__PURE__ */
|
|
670
|
-
const s =
|
|
671
|
-
return /* @__PURE__ */
|
|
1930
|
+
function Cr({ value: e, field: r }) {
|
|
1931
|
+
if (e == null) return /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
1932
|
+
const s = r.currency || "USD", a = vr(Number(e), s);
|
|
1933
|
+
return /* @__PURE__ */ t.jsx("span", { className: "tabular-nums font-medium", children: a });
|
|
672
1934
|
}
|
|
673
|
-
function
|
|
674
|
-
if (e == null) return /* @__PURE__ */
|
|
675
|
-
const s =
|
|
676
|
-
return /* @__PURE__ */
|
|
1935
|
+
function Pr({ value: e, field: r }) {
|
|
1936
|
+
if (e == null) return /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
1937
|
+
const s = r.precision ?? 2, a = _r(Number(e), s);
|
|
1938
|
+
return /* @__PURE__ */ t.jsx("span", { className: "tabular-nums", children: a });
|
|
677
1939
|
}
|
|
678
|
-
function
|
|
679
|
-
return /* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
1940
|
+
function Or({ value: e }) {
|
|
1941
|
+
return /* @__PURE__ */ t.jsx("div", { className: "flex items-center", children: e ? /* @__PURE__ */ t.jsxs(k, { variant: "outline", className: "bg-green-50 text-green-700 border-green-200 gap-1", children: [
|
|
1942
|
+
/* @__PURE__ */ t.jsx(Mt, { className: "size-3" }),
|
|
681
1943
|
"True"
|
|
682
|
-
] }) : /* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
1944
|
+
] }) : /* @__PURE__ */ t.jsxs(k, { variant: "outline", className: "bg-gray-50 text-gray-500 border-gray-200 gap-1", children: [
|
|
1945
|
+
/* @__PURE__ */ t.jsx(E, { className: "size-3" }),
|
|
684
1946
|
"False"
|
|
685
1947
|
] }) });
|
|
686
1948
|
}
|
|
687
|
-
function
|
|
688
|
-
const s =
|
|
689
|
-
return /* @__PURE__ */
|
|
1949
|
+
function Tr({ value: e, field: r }) {
|
|
1950
|
+
const s = Fr(e, r.format);
|
|
1951
|
+
return /* @__PURE__ */ t.jsx("span", { className: "tabular-nums", children: s });
|
|
690
1952
|
}
|
|
691
|
-
function
|
|
692
|
-
const
|
|
693
|
-
return /* @__PURE__ */
|
|
1953
|
+
function Rr({ value: e }) {
|
|
1954
|
+
const r = wr(e);
|
|
1955
|
+
return /* @__PURE__ */ t.jsx("span", { className: "tabular-nums text-sm", children: r });
|
|
694
1956
|
}
|
|
695
|
-
function
|
|
696
|
-
const s =
|
|
697
|
-
if (!e) return /* @__PURE__ */
|
|
698
|
-
const
|
|
699
|
-
const
|
|
1957
|
+
function q({ value: e, field: r }) {
|
|
1958
|
+
const s = r.options || [];
|
|
1959
|
+
if (!e) return /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
1960
|
+
const a = (c) => {
|
|
1961
|
+
const m = {
|
|
700
1962
|
gray: "bg-gray-100 text-gray-800 border-gray-300",
|
|
701
1963
|
red: "bg-red-100 text-red-800 border-red-300",
|
|
702
1964
|
orange: "bg-orange-100 text-orange-800 border-orange-300",
|
|
@@ -707,123 +1969,123 @@ function O({ value: e, field: t }) {
|
|
|
707
1969
|
purple: "bg-purple-100 text-purple-800 border-purple-300",
|
|
708
1970
|
pink: "bg-pink-100 text-pink-800 border-pink-300"
|
|
709
1971
|
};
|
|
710
|
-
return
|
|
1972
|
+
return m[c || "blue"] || m.blue;
|
|
711
1973
|
};
|
|
712
1974
|
if (Array.isArray(e))
|
|
713
|
-
return /* @__PURE__ */
|
|
714
|
-
const
|
|
715
|
-
return /* @__PURE__ */
|
|
716
|
-
|
|
1975
|
+
return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: e.map((c, m) => {
|
|
1976
|
+
const h = s.find((f) => f.value === c), x = h?.label || c, d = a(h?.color);
|
|
1977
|
+
return /* @__PURE__ */ t.jsx(
|
|
1978
|
+
k,
|
|
717
1979
|
{
|
|
718
1980
|
variant: "outline",
|
|
719
|
-
className:
|
|
720
|
-
children:
|
|
1981
|
+
className: d,
|
|
1982
|
+
children: x
|
|
721
1983
|
},
|
|
722
|
-
|
|
1984
|
+
m
|
|
723
1985
|
);
|
|
724
1986
|
}) });
|
|
725
|
-
const
|
|
726
|
-
return /* @__PURE__ */
|
|
727
|
-
|
|
1987
|
+
const l = s.find((c) => c.value === e), i = l?.label || e, o = a(l?.color);
|
|
1988
|
+
return /* @__PURE__ */ t.jsx(
|
|
1989
|
+
k,
|
|
728
1990
|
{
|
|
729
1991
|
variant: "outline",
|
|
730
|
-
className:
|
|
731
|
-
children:
|
|
1992
|
+
className: o,
|
|
1993
|
+
children: i
|
|
732
1994
|
}
|
|
733
1995
|
);
|
|
734
1996
|
}
|
|
735
|
-
function
|
|
736
|
-
return e ? /* @__PURE__ */
|
|
737
|
-
|
|
1997
|
+
function kr({ value: e }) {
|
|
1998
|
+
return e ? /* @__PURE__ */ t.jsx(
|
|
1999
|
+
F,
|
|
738
2000
|
{
|
|
739
2001
|
variant: "link",
|
|
740
2002
|
className: "p-0 h-auto font-normal text-blue-600 hover:text-blue-800",
|
|
741
2003
|
asChild: !0,
|
|
742
|
-
children: /* @__PURE__ */
|
|
2004
|
+
children: /* @__PURE__ */ t.jsx(
|
|
743
2005
|
"a",
|
|
744
2006
|
{
|
|
745
2007
|
href: `mailto:${e}`,
|
|
746
|
-
onClick: (
|
|
2008
|
+
onClick: (r) => r.stopPropagation(),
|
|
747
2009
|
children: e
|
|
748
2010
|
}
|
|
749
2011
|
)
|
|
750
2012
|
}
|
|
751
|
-
) : /* @__PURE__ */
|
|
2013
|
+
) : /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
752
2014
|
}
|
|
753
|
-
function
|
|
754
|
-
return e ? /* @__PURE__ */
|
|
755
|
-
|
|
2015
|
+
function Ar({ value: e }) {
|
|
2016
|
+
return e ? /* @__PURE__ */ t.jsx(
|
|
2017
|
+
F,
|
|
756
2018
|
{
|
|
757
2019
|
variant: "link",
|
|
758
2020
|
className: "p-0 h-auto font-normal text-blue-600 hover:text-blue-800",
|
|
759
2021
|
asChild: !0,
|
|
760
|
-
children: /* @__PURE__ */
|
|
2022
|
+
children: /* @__PURE__ */ t.jsx(
|
|
761
2023
|
"a",
|
|
762
2024
|
{
|
|
763
2025
|
href: e,
|
|
764
2026
|
target: "_blank",
|
|
765
2027
|
rel: "noopener noreferrer",
|
|
766
|
-
onClick: (
|
|
2028
|
+
onClick: (r) => r.stopPropagation(),
|
|
767
2029
|
children: e
|
|
768
2030
|
}
|
|
769
2031
|
)
|
|
770
2032
|
}
|
|
771
|
-
) : /* @__PURE__ */
|
|
2033
|
+
) : /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
772
2034
|
}
|
|
773
|
-
function
|
|
774
|
-
return e ? /* @__PURE__ */
|
|
2035
|
+
function $r({ value: e }) {
|
|
2036
|
+
return e ? /* @__PURE__ */ t.jsx(
|
|
775
2037
|
"a",
|
|
776
2038
|
{
|
|
777
2039
|
href: `tel:${e}`,
|
|
778
2040
|
className: "text-blue-600 hover:text-blue-800",
|
|
779
|
-
onClick: (
|
|
2041
|
+
onClick: (r) => r.stopPropagation(),
|
|
780
2042
|
children: e
|
|
781
2043
|
}
|
|
782
|
-
) : /* @__PURE__ */
|
|
2044
|
+
) : /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
783
2045
|
}
|
|
784
|
-
function
|
|
785
|
-
if (!e) return /* @__PURE__ */
|
|
786
|
-
if (
|
|
787
|
-
const
|
|
788
|
-
return /* @__PURE__ */
|
|
789
|
-
|
|
2046
|
+
function zr({ value: e, field: r }) {
|
|
2047
|
+
if (!e) return /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
2048
|
+
if (r.multiple, Array.isArray(e)) {
|
|
2049
|
+
const a = e.length;
|
|
2050
|
+
return /* @__PURE__ */ t.jsxs("span", { className: "text-sm text-gray-600", children: [
|
|
2051
|
+
a,
|
|
790
2052
|
" ",
|
|
791
|
-
|
|
2053
|
+
a === 1 ? "file" : "files"
|
|
792
2054
|
] });
|
|
793
2055
|
}
|
|
794
2056
|
const s = e.name || e.original_name || "File";
|
|
795
|
-
return /* @__PURE__ */
|
|
2057
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-sm truncate", children: s });
|
|
796
2058
|
}
|
|
797
|
-
function
|
|
798
|
-
return e ? Array.isArray(e) ? /* @__PURE__ */
|
|
799
|
-
e.slice(0, 3).map((
|
|
2059
|
+
function Er({ value: e }) {
|
|
2060
|
+
return e ? Array.isArray(e) ? /* @__PURE__ */ t.jsxs("div", { className: "flex -space-x-2", children: [
|
|
2061
|
+
e.slice(0, 3).map((r, n) => /* @__PURE__ */ t.jsx(
|
|
800
2062
|
"img",
|
|
801
2063
|
{
|
|
802
|
-
src:
|
|
803
|
-
alt:
|
|
2064
|
+
src: r.url || "",
|
|
2065
|
+
alt: r.name || `Image ${n + 1}`,
|
|
804
2066
|
className: "size-8 rounded-md border-2 border-white object-cover"
|
|
805
2067
|
},
|
|
806
2068
|
n
|
|
807
2069
|
)),
|
|
808
|
-
e.length > 3 && /* @__PURE__ */
|
|
2070
|
+
e.length > 3 && /* @__PURE__ */ t.jsxs("div", { className: "size-8 rounded-md border-2 border-white bg-gray-100 flex items-center justify-center text-xs font-medium text-gray-600", children: [
|
|
809
2071
|
"+",
|
|
810
2072
|
e.length - 3
|
|
811
2073
|
] })
|
|
812
|
-
] }) : /* @__PURE__ */
|
|
2074
|
+
] }) : /* @__PURE__ */ t.jsx(
|
|
813
2075
|
"img",
|
|
814
2076
|
{
|
|
815
2077
|
src: e.url || "",
|
|
816
2078
|
alt: e.name || "Image",
|
|
817
2079
|
className: "size-10 rounded-md object-cover"
|
|
818
2080
|
}
|
|
819
|
-
) : /* @__PURE__ */
|
|
2081
|
+
) : /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
820
2082
|
}
|
|
821
|
-
function
|
|
822
|
-
if (!e) return /* @__PURE__ */
|
|
2083
|
+
function nt({ value: e }) {
|
|
2084
|
+
if (!e) return /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
823
2085
|
if (Array.isArray(e))
|
|
824
|
-
return /* @__PURE__ */
|
|
825
|
-
const s =
|
|
826
|
-
return /* @__PURE__ */
|
|
2086
|
+
return /* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-1", children: e.map((r, n) => {
|
|
2087
|
+
const s = r.name || r.label || r._id || String(r);
|
|
2088
|
+
return /* @__PURE__ */ t.jsx(
|
|
827
2089
|
"span",
|
|
828
2090
|
{
|
|
829
2091
|
className: "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800",
|
|
@@ -833,170 +2095,162 @@ function ge({ value: e }) {
|
|
|
833
2095
|
);
|
|
834
2096
|
}) });
|
|
835
2097
|
if (typeof e == "object" && e !== null) {
|
|
836
|
-
const
|
|
837
|
-
return /* @__PURE__ */
|
|
2098
|
+
const r = e.name || e.label || e._id || "[Object]";
|
|
2099
|
+
return /* @__PURE__ */ t.jsx("span", { className: "truncate", children: r });
|
|
838
2100
|
}
|
|
839
|
-
return /* @__PURE__ */
|
|
2101
|
+
return /* @__PURE__ */ t.jsx("span", { className: "truncate", children: String(e) });
|
|
840
2102
|
}
|
|
841
|
-
function
|
|
842
|
-
return /* @__PURE__ */
|
|
2103
|
+
function je({ value: e }) {
|
|
2104
|
+
return /* @__PURE__ */ t.jsx("span", { className: "text-gray-700 font-mono text-sm", children: e != null ? String(e) : "-" });
|
|
843
2105
|
}
|
|
844
|
-
function
|
|
845
|
-
if (!e) return /* @__PURE__ */
|
|
2106
|
+
function ye({ value: e }) {
|
|
2107
|
+
if (!e) return /* @__PURE__ */ t.jsx("span", { children: "-" });
|
|
846
2108
|
if (Array.isArray(e))
|
|
847
|
-
return /* @__PURE__ */
|
|
848
|
-
e.slice(0, 3).map((s,
|
|
849
|
-
const
|
|
850
|
-
return /* @__PURE__ */
|
|
851
|
-
|
|
2109
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex -space-x-2", children: [
|
|
2110
|
+
e.slice(0, 3).map((s, a) => {
|
|
2111
|
+
const l = s.name || s.username || "User", i = l.split(" ").map((o) => o[0]).join("").toUpperCase().slice(0, 2);
|
|
2112
|
+
return /* @__PURE__ */ t.jsx(
|
|
2113
|
+
$,
|
|
852
2114
|
{
|
|
853
2115
|
className: "size-8 border-2 border-white",
|
|
854
|
-
title:
|
|
855
|
-
children: /* @__PURE__ */
|
|
2116
|
+
title: l,
|
|
2117
|
+
children: /* @__PURE__ */ t.jsx(z, { className: "bg-blue-500 text-white text-xs", children: i })
|
|
856
2118
|
},
|
|
857
|
-
|
|
2119
|
+
a
|
|
858
2120
|
);
|
|
859
2121
|
}),
|
|
860
|
-
e.length > 3 && /* @__PURE__ */
|
|
2122
|
+
e.length > 3 && /* @__PURE__ */ t.jsx($, { className: "size-8 border-2 border-white", children: /* @__PURE__ */ t.jsxs(z, { className: "bg-gray-200 text-gray-600 text-xs", children: [
|
|
861
2123
|
"+",
|
|
862
2124
|
e.length - 3
|
|
863
2125
|
] }) })
|
|
864
2126
|
] });
|
|
865
|
-
const
|
|
866
|
-
return /* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
2127
|
+
const r = e.name || e.username || "User", n = r.split(" ").map((s) => s[0]).join("").toUpperCase().slice(0, 2);
|
|
2128
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2129
|
+
/* @__PURE__ */ t.jsx($, { className: "size-8", children: /* @__PURE__ */ t.jsx(z, { className: "bg-blue-500 text-white text-xs", children: n }) }),
|
|
2130
|
+
/* @__PURE__ */ t.jsx("span", { className: "truncate", children: r })
|
|
869
2131
|
] });
|
|
870
2132
|
}
|
|
871
|
-
const
|
|
872
|
-
function
|
|
873
|
-
|
|
874
|
-
}
|
|
875
|
-
function
|
|
876
|
-
return
|
|
877
|
-
text:
|
|
878
|
-
textarea:
|
|
879
|
-
markdown:
|
|
880
|
-
html:
|
|
881
|
-
number:
|
|
882
|
-
currency:
|
|
883
|
-
percent:
|
|
884
|
-
boolean:
|
|
885
|
-
date:
|
|
886
|
-
datetime:
|
|
887
|
-
time:
|
|
888
|
-
select:
|
|
889
|
-
lookup:
|
|
2133
|
+
const ee = /* @__PURE__ */ new Map();
|
|
2134
|
+
function re(e, r) {
|
|
2135
|
+
ee.set(e, r);
|
|
2136
|
+
}
|
|
2137
|
+
function Br(e) {
|
|
2138
|
+
return ee.has(e) ? ee.get(e) : {
|
|
2139
|
+
text: A,
|
|
2140
|
+
textarea: A,
|
|
2141
|
+
markdown: A,
|
|
2142
|
+
html: A,
|
|
2143
|
+
number: Sr,
|
|
2144
|
+
currency: Cr,
|
|
2145
|
+
percent: Pr,
|
|
2146
|
+
boolean: Or,
|
|
2147
|
+
date: Tr,
|
|
2148
|
+
datetime: Rr,
|
|
2149
|
+
time: A,
|
|
2150
|
+
select: q,
|
|
2151
|
+
lookup: q,
|
|
890
2152
|
// Default fallback
|
|
891
|
-
master_detail:
|
|
2153
|
+
master_detail: q,
|
|
892
2154
|
// Default fallback
|
|
893
|
-
email:
|
|
894
|
-
url:
|
|
895
|
-
phone:
|
|
896
|
-
file:
|
|
897
|
-
image:
|
|
898
|
-
formula:
|
|
899
|
-
summary:
|
|
900
|
-
auto_number:
|
|
901
|
-
user:
|
|
902
|
-
owner:
|
|
903
|
-
password: () => /* @__PURE__ */
|
|
904
|
-
location:
|
|
2155
|
+
email: kr,
|
|
2156
|
+
url: Ar,
|
|
2157
|
+
phone: $r,
|
|
2158
|
+
file: zr,
|
|
2159
|
+
image: Er,
|
|
2160
|
+
formula: je,
|
|
2161
|
+
summary: je,
|
|
2162
|
+
auto_number: A,
|
|
2163
|
+
user: ye,
|
|
2164
|
+
owner: ye,
|
|
2165
|
+
password: () => /* @__PURE__ */ t.jsx("span", { children: "••••••" }),
|
|
2166
|
+
location: A,
|
|
905
2167
|
// Default fallback
|
|
906
|
-
object: () => /* @__PURE__ */
|
|
907
|
-
vector: () => /* @__PURE__ */
|
|
908
|
-
grid: () => /* @__PURE__ */
|
|
909
|
-
}[e] ||
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
function
|
|
2168
|
+
object: () => /* @__PURE__ */ t.jsx("span", { className: "text-gray-500 italic", children: "[Object]" }),
|
|
2169
|
+
vector: () => /* @__PURE__ */ t.jsx("span", { className: "text-gray-500 italic", children: "[Vector]" }),
|
|
2170
|
+
grid: () => /* @__PURE__ */ t.jsx("span", { className: "text-gray-500 italic", children: "[Grid]" })
|
|
2171
|
+
}[e] || A;
|
|
2172
|
+
}
|
|
2173
|
+
re("lookup", nt);
|
|
2174
|
+
re("master_detail", nt);
|
|
2175
|
+
re("select", q);
|
|
2176
|
+
function Yr(e) {
|
|
915
2177
|
return {
|
|
916
2178
|
// Text-based fields
|
|
917
|
-
text: "
|
|
918
|
-
textarea: "textarea",
|
|
919
|
-
markdown: "
|
|
2179
|
+
text: "field:text",
|
|
2180
|
+
textarea: "field:textarea",
|
|
2181
|
+
markdown: "field:markdown",
|
|
920
2182
|
// Markdown editor (fallback to textarea)
|
|
921
|
-
html: "
|
|
2183
|
+
html: "field:html",
|
|
922
2184
|
// Rich text editor (fallback to textarea)
|
|
923
2185
|
// Numeric fields
|
|
924
|
-
number: "
|
|
925
|
-
currency: "
|
|
926
|
-
percent: "
|
|
2186
|
+
number: "field:number",
|
|
2187
|
+
currency: "field:currency",
|
|
2188
|
+
percent: "field:percent",
|
|
927
2189
|
// Date/Time fields
|
|
928
|
-
date: "date
|
|
929
|
-
datetime: "
|
|
930
|
-
time: "
|
|
931
|
-
// Time picker (fallback to input with type="time")
|
|
2190
|
+
date: "field:date",
|
|
2191
|
+
datetime: "field:datetime",
|
|
2192
|
+
time: "field:time",
|
|
932
2193
|
// Boolean
|
|
933
|
-
boolean: "
|
|
2194
|
+
boolean: "field:boolean",
|
|
934
2195
|
// Selection fields
|
|
935
|
-
select: "select",
|
|
936
|
-
lookup: "
|
|
937
|
-
master_detail: "
|
|
2196
|
+
select: "field:select",
|
|
2197
|
+
lookup: "field:lookup",
|
|
2198
|
+
master_detail: "field:master_detail",
|
|
938
2199
|
// Contact fields
|
|
939
|
-
email: "
|
|
940
|
-
phone: "
|
|
941
|
-
url: "
|
|
2200
|
+
email: "field:email",
|
|
2201
|
+
phone: "field:phone",
|
|
2202
|
+
url: "field:url",
|
|
942
2203
|
// File fields
|
|
943
|
-
file: "file
|
|
944
|
-
image: "
|
|
2204
|
+
file: "field:file",
|
|
2205
|
+
image: "field:image",
|
|
945
2206
|
// Special fields
|
|
946
|
-
password: "
|
|
947
|
-
location: "
|
|
2207
|
+
password: "field:password",
|
|
2208
|
+
location: "field:location",
|
|
948
2209
|
// Location/map field (fallback to input)
|
|
949
2210
|
// Auto-generated/computed fields (typically read-only)
|
|
950
|
-
formula: "
|
|
951
|
-
summary: "
|
|
952
|
-
auto_number: "
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
vector: "input",
|
|
957
|
-
// Vector/embedding data (fallback to input)
|
|
958
|
-
grid: "input"
|
|
959
|
-
// Grid/table data (fallback to input)
|
|
960
|
-
}[e] || "input";
|
|
961
|
-
}
|
|
962
|
-
function hr(e) {
|
|
2211
|
+
formula: "field:formula",
|
|
2212
|
+
summary: "field:summary",
|
|
2213
|
+
auto_number: "field:auto_number"
|
|
2214
|
+
}[e] || "field:text";
|
|
2215
|
+
}
|
|
2216
|
+
function qr(e) {
|
|
963
2217
|
if (e < 0 || !Number.isFinite(e) || e === 0)
|
|
964
2218
|
return "0 B";
|
|
965
|
-
const
|
|
2219
|
+
const r = ["B", "KB", "MB", "GB", "TB"];
|
|
966
2220
|
let n = e, s = 0;
|
|
967
|
-
for (; n >= 1024 && s <
|
|
2221
|
+
for (; n >= 1024 && s < r.length - 1; )
|
|
968
2222
|
n /= 1024, s++;
|
|
969
|
-
return `${n.toFixed(s > 0 ? 1 : 0)} ${
|
|
2223
|
+
return `${n.toFixed(s > 0 ? 1 : 0)} ${r[s]}`;
|
|
970
2224
|
}
|
|
971
|
-
function
|
|
972
|
-
const
|
|
973
|
-
return e.required && (
|
|
2225
|
+
function Jr(e) {
|
|
2226
|
+
const r = {};
|
|
2227
|
+
return e.required && (r.required = typeof e.required_message == "string" ? e.required_message : `${e.label || e.name} is required`), e.min_length && (r.minLength = {
|
|
974
2228
|
value: e.min_length,
|
|
975
2229
|
message: e.min_length_message || `Minimum length is ${e.min_length} characters`
|
|
976
|
-
}), e.max_length && (
|
|
2230
|
+
}), e.max_length && (r.maxLength = {
|
|
977
2231
|
value: e.max_length,
|
|
978
2232
|
message: e.max_length_message || `Maximum length is ${e.max_length} characters`
|
|
979
|
-
}), e.min !== void 0 && (
|
|
2233
|
+
}), e.min !== void 0 && (r.min = {
|
|
980
2234
|
value: e.min,
|
|
981
2235
|
message: e.min_message || `Minimum value is ${e.min}`
|
|
982
|
-
}), e.max !== void 0 && (
|
|
2236
|
+
}), e.max !== void 0 && (r.max = {
|
|
983
2237
|
value: e.max,
|
|
984
2238
|
message: e.max_message || `Maximum value is ${e.max}`
|
|
985
|
-
}), e.pattern && (
|
|
2239
|
+
}), e.pattern && (r.pattern = {
|
|
986
2240
|
value: typeof e.pattern == "string" ? new RegExp(e.pattern) : e.pattern,
|
|
987
2241
|
message: e.pattern_message || "Invalid format"
|
|
988
|
-
}), e.type === "email" && (
|
|
2242
|
+
}), e.type === "email" && (r.pattern = {
|
|
989
2243
|
value: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
990
2244
|
message: "Please enter a valid email address"
|
|
991
|
-
}), e.type === "url" && (
|
|
2245
|
+
}), e.type === "url" && (r.pattern = {
|
|
992
2246
|
value: /^https?:\/\/.+/,
|
|
993
2247
|
message: "Please enter a valid URL"
|
|
994
|
-
}), e.validate && (
|
|
2248
|
+
}), e.validate && (r.validate = e.validate), Object.keys(r).length > 0 ? r : void 0;
|
|
995
2249
|
}
|
|
996
|
-
function
|
|
2250
|
+
function Ne(e, r) {
|
|
997
2251
|
if (!e) return !0;
|
|
998
2252
|
if (e.field && e.value !== void 0) {
|
|
999
|
-
const n =
|
|
2253
|
+
const n = r[e.field];
|
|
1000
2254
|
if (e.operator === "=" || e.operator === "==")
|
|
1001
2255
|
return n === e.value;
|
|
1002
2256
|
if (e.operator === "!=")
|
|
@@ -1012,49 +2266,180 @@ function fe(e, t) {
|
|
|
1012
2266
|
if (e.operator === "in")
|
|
1013
2267
|
return Array.isArray(e.value) && e.value.includes(n);
|
|
1014
2268
|
}
|
|
1015
|
-
return e.and && Array.isArray(e.and) ? e.and.every((n) =>
|
|
2269
|
+
return e.and && Array.isArray(e.and) ? e.and.every((n) => Ne(n, r)) : e.or && Array.isArray(e.or) ? e.or.some((n) => Ne(n, r)) : !0;
|
|
2270
|
+
}
|
|
2271
|
+
function j(e) {
|
|
2272
|
+
const r = ({ schema: n, className: s, value: a, ...l }) => {
|
|
2273
|
+
const [i, o] = P.useState(a ?? n?.value ?? ""), c = {
|
|
2274
|
+
name: n?.name || "field",
|
|
2275
|
+
label: n?.label,
|
|
2276
|
+
type: n?.type,
|
|
2277
|
+
placeholder: n?.placeholder,
|
|
2278
|
+
required: n?.required,
|
|
2279
|
+
readonly: n?.readonly || n?.readOnly,
|
|
2280
|
+
help: n?.help,
|
|
2281
|
+
description: n?.description,
|
|
2282
|
+
defaultValue: n?.defaultValue || n?.value,
|
|
2283
|
+
...n
|
|
2284
|
+
}, m = P.useCallback((x) => {
|
|
2285
|
+
o(x), l.onChange && l.onChange(x);
|
|
2286
|
+
}, [l]), h = n?.readonly || n?.readOnly || !1;
|
|
2287
|
+
return /* @__PURE__ */ t.jsxs(
|
|
2288
|
+
"div",
|
|
2289
|
+
{
|
|
2290
|
+
className: "grid w-full items-center gap-1.5",
|
|
2291
|
+
"data-obj-id": n?.id,
|
|
2292
|
+
"data-obj-type": n?.type,
|
|
2293
|
+
children: [
|
|
2294
|
+
n?.label && /* @__PURE__ */ t.jsx("label", { htmlFor: n.id, className: n.required ? "after:content-['*'] after:ml-0.5 after:text-red-500" : "", children: n.label }),
|
|
2295
|
+
/* @__PURE__ */ t.jsx(
|
|
2296
|
+
e,
|
|
2297
|
+
{
|
|
2298
|
+
value: i,
|
|
2299
|
+
onChange: m,
|
|
2300
|
+
field: c,
|
|
2301
|
+
readonly: h,
|
|
2302
|
+
className: s
|
|
2303
|
+
}
|
|
2304
|
+
),
|
|
2305
|
+
n?.description && /* @__PURE__ */ t.jsx("p", { className: "text-sm text-gray-500", children: n.description })
|
|
2306
|
+
]
|
|
2307
|
+
}
|
|
2308
|
+
);
|
|
2309
|
+
};
|
|
2310
|
+
return r.displayName = `FieldRenderer(${e.displayName || e.name || "Component"})`, r;
|
|
2311
|
+
}
|
|
2312
|
+
const at = {
|
|
2313
|
+
// Basic fields
|
|
2314
|
+
text: () => Promise.resolve().then(() => Lt).then((e) => ({ default: e.TextField })),
|
|
2315
|
+
textarea: () => Promise.resolve().then(() => Ht).then((e) => ({ default: e.TextAreaField })),
|
|
2316
|
+
number: () => Promise.resolve().then(() => Vt).then((e) => ({ default: e.NumberField })),
|
|
2317
|
+
boolean: () => Promise.resolve().then(() => Bt).then((e) => ({ default: e.BooleanField })),
|
|
2318
|
+
select: () => Promise.resolve().then(() => Yt).then((e) => ({ default: e.SelectField })),
|
|
2319
|
+
date: () => Promise.resolve().then(() => qt).then((e) => ({ default: e.DateField })),
|
|
2320
|
+
datetime: () => Promise.resolve().then(() => Kt).then((e) => ({ default: e.DateTimeField })),
|
|
2321
|
+
time: () => Promise.resolve().then(() => er).then((e) => ({ default: e.TimeField })),
|
|
2322
|
+
// Contact fields
|
|
2323
|
+
email: () => Promise.resolve().then(() => Jt).then((e) => ({ default: e.EmailField })),
|
|
2324
|
+
phone: () => Promise.resolve().then(() => Gt).then((e) => ({ default: e.PhoneField })),
|
|
2325
|
+
url: () => Promise.resolve().then(() => Wt).then((e) => ({ default: e.UrlField })),
|
|
2326
|
+
// Specialized fields
|
|
2327
|
+
currency: () => Promise.resolve().then(() => Xt).then((e) => ({ default: e.CurrencyField })),
|
|
2328
|
+
percent: () => Promise.resolve().then(() => tr).then((e) => ({ default: e.PercentField })),
|
|
2329
|
+
password: () => Promise.resolve().then(() => rr).then((e) => ({ default: e.PasswordField })),
|
|
2330
|
+
markdown: () => Promise.resolve().then(() => ge).then((e) => ({ default: e.RichTextField })),
|
|
2331
|
+
html: () => Promise.resolve().then(() => ge).then((e) => ({ default: e.RichTextField })),
|
|
2332
|
+
lookup: () => Promise.resolve().then(() => Zt).then((e) => ({ default: e.LookupField })),
|
|
2333
|
+
master_detail: () => Promise.resolve().then(() => Nr).then((e) => ({ default: e.MasterDetailField })),
|
|
2334
|
+
// File fields
|
|
2335
|
+
file: () => Promise.resolve().then(() => sr).then((e) => ({ default: e.FileField })),
|
|
2336
|
+
image: () => Promise.resolve().then(() => nr).then((e) => ({ default: e.ImageField })),
|
|
2337
|
+
// Location field
|
|
2338
|
+
location: () => Promise.resolve().then(() => ar).then((e) => ({ default: e.LocationField })),
|
|
2339
|
+
// Computed/Read-only fields
|
|
2340
|
+
formula: () => Promise.resolve().then(() => lr).then((e) => ({ default: e.FormulaField })),
|
|
2341
|
+
summary: () => Promise.resolve().then(() => ir).then((e) => ({ default: e.SummaryField })),
|
|
2342
|
+
auto_number: () => Promise.resolve().then(() => or).then((e) => ({ default: e.AutoNumberField })),
|
|
2343
|
+
// User fields
|
|
2344
|
+
user: () => Promise.resolve().then(() => be).then((e) => ({ default: e.UserField })),
|
|
2345
|
+
owner: () => Promise.resolve().then(() => be).then((e) => ({ default: e.UserField })),
|
|
2346
|
+
// Complex data types
|
|
2347
|
+
object: () => Promise.resolve().then(() => cr).then((e) => ({ default: e.ObjectField })),
|
|
2348
|
+
vector: () => Promise.resolve().then(() => dr).then((e) => ({ default: e.VectorField })),
|
|
2349
|
+
grid: () => Promise.resolve().then(() => ur).then((e) => ({ default: e.GridField })),
|
|
2350
|
+
// Additional field types from @objectstack/spec
|
|
2351
|
+
color: () => Promise.resolve().then(() => mr).then((e) => ({ default: e.ColorField })),
|
|
2352
|
+
slider: () => Promise.resolve().then(() => fr).then((e) => ({ default: e.SliderField })),
|
|
2353
|
+
rating: () => Promise.resolve().then(() => xr).then((e) => ({ default: e.RatingField })),
|
|
2354
|
+
code: () => Promise.resolve().then(() => hr).then((e) => ({ default: e.CodeField })),
|
|
2355
|
+
avatar: () => Promise.resolve().then(() => pr).then((e) => ({ default: e.AvatarField })),
|
|
2356
|
+
address: () => Promise.resolve().then(() => gr).then((e) => ({ default: e.AddressField })),
|
|
2357
|
+
geolocation: () => Promise.resolve().then(() => br).then((e) => ({ default: e.GeolocationField })),
|
|
2358
|
+
signature: () => Promise.resolve().then(() => jr).then((e) => ({ default: e.SignatureField })),
|
|
2359
|
+
qrcode: () => Promise.resolve().then(() => yr).then((e) => ({ default: e.QRCodeField }))
|
|
2360
|
+
};
|
|
2361
|
+
function Mr(e) {
|
|
2362
|
+
const r = at[e];
|
|
2363
|
+
if (!r) {
|
|
2364
|
+
console.warn(`Unknown field type: ${e}`);
|
|
2365
|
+
return;
|
|
2366
|
+
}
|
|
2367
|
+
const n = P.lazy(r);
|
|
2368
|
+
g.register(e, n, { namespace: "field" });
|
|
2369
|
+
}
|
|
2370
|
+
function Ur() {
|
|
2371
|
+
Object.keys(at).forEach((e) => {
|
|
2372
|
+
Mr(e);
|
|
2373
|
+
});
|
|
1016
2374
|
}
|
|
1017
|
-
function
|
|
1018
|
-
|
|
2375
|
+
function Gr() {
|
|
2376
|
+
g.register("text", j(Fe), { namespace: "field" }), g.register("textarea", j(Ae), { namespace: "field" }), g.register("number", j(we), { namespace: "field" }), g.register("boolean", j(Se), { namespace: "field" }), g.register("select", j(Ce), { namespace: "field" }), g.register("date", j(Pe), { namespace: "field" }), g.register("datetime", j(ze), { namespace: "field" }), g.register("time", j(Ee), { namespace: "field" }), g.register("email", j(Oe), { namespace: "field" }), g.register("phone", j(Te), { namespace: "field" }), g.register("url", j(Re), { namespace: "field" }), g.register("currency", j(ke), { namespace: "field" }), g.register("percent", j(Me), { namespace: "field" }), g.register("password", j(Ue), { namespace: "field" }), g.register("markdown", j(Z), { namespace: "field" }), g.register("html", j(Z), { namespace: "field" }), g.register("lookup", j($e), { namespace: "field" }), g.register("master_detail", j(st), { namespace: "field" }), g.register("file", j(De), { namespace: "field" }), g.register("image", j(Ie), { namespace: "field" }), g.register("location", j(Le), { namespace: "field" }), g.register("formula", j(Ve), { namespace: "field" }), g.register("summary", j(Be), { namespace: "field" }), g.register("auto_number", j(Ye), { namespace: "field" }), g.register("user", j(K), { namespace: "field" }), g.register("owner", j(K), { namespace: "field" }), g.register("object", j(qe), { namespace: "field" }), g.register("vector", j(Je), { namespace: "field" }), g.register("grid", j(Ge), { namespace: "field" }), g.register("color", j(We), { namespace: "field" }), g.register("slider", j(Qe), { namespace: "field" }), g.register("rating", j(Xe), { namespace: "field" }), g.register("code", j(He), { namespace: "field" }), g.register("avatar", j(Ze), { namespace: "field" }), g.register("address", j(Ke), { namespace: "field" }), g.register("geolocation", j(et), { namespace: "field" }), g.register("signature", j(tt), { namespace: "field" }), g.register("qrcode", j(rt), { namespace: "field" });
|
|
1019
2377
|
}
|
|
2378
|
+
Ur();
|
|
1020
2379
|
export {
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
2380
|
+
Ke as AddressField,
|
|
2381
|
+
Ye as AutoNumberField,
|
|
2382
|
+
Ze as AvatarField,
|
|
2383
|
+
Or as BooleanCellRenderer,
|
|
2384
|
+
Se as BooleanField,
|
|
2385
|
+
He as CodeField,
|
|
2386
|
+
We as ColorField,
|
|
2387
|
+
Cr as CurrencyCellRenderer,
|
|
2388
|
+
ke as CurrencyField,
|
|
2389
|
+
Tr as DateCellRenderer,
|
|
2390
|
+
Pe as DateField,
|
|
2391
|
+
Rr as DateTimeCellRenderer,
|
|
2392
|
+
ze as DateTimeField,
|
|
2393
|
+
kr as EmailCellRenderer,
|
|
2394
|
+
Oe as EmailField,
|
|
2395
|
+
zr as FileCellRenderer,
|
|
2396
|
+
De as FileField,
|
|
2397
|
+
je as FormulaCellRenderer,
|
|
2398
|
+
Ve as FormulaField,
|
|
2399
|
+
et as GeolocationField,
|
|
2400
|
+
Ge as GridField,
|
|
2401
|
+
Er as ImageCellRenderer,
|
|
2402
|
+
Ie as ImageField,
|
|
2403
|
+
Le as LocationField,
|
|
2404
|
+
nt as LookupCellRenderer,
|
|
2405
|
+
$e as LookupField,
|
|
2406
|
+
st as MasterDetailField,
|
|
2407
|
+
Sr as NumberCellRenderer,
|
|
2408
|
+
we as NumberField,
|
|
2409
|
+
qe as ObjectField,
|
|
2410
|
+
Ue as PasswordField,
|
|
2411
|
+
Pr as PercentCellRenderer,
|
|
2412
|
+
Me as PercentField,
|
|
2413
|
+
$r as PhoneCellRenderer,
|
|
2414
|
+
Te as PhoneField,
|
|
2415
|
+
rt as QRCodeField,
|
|
2416
|
+
Xe as RatingField,
|
|
2417
|
+
Z as RichTextField,
|
|
2418
|
+
q as SelectCellRenderer,
|
|
2419
|
+
Ce as SelectField,
|
|
2420
|
+
tt as SignatureField,
|
|
2421
|
+
Qe as SliderField,
|
|
2422
|
+
Be as SummaryField,
|
|
2423
|
+
Ae as TextAreaField,
|
|
2424
|
+
A as TextCellRenderer,
|
|
2425
|
+
Fe as TextField,
|
|
2426
|
+
Ee as TimeField,
|
|
2427
|
+
Ar as UrlCellRenderer,
|
|
2428
|
+
Re as UrlField,
|
|
2429
|
+
ye as UserCellRenderer,
|
|
2430
|
+
K as UserField,
|
|
2431
|
+
Je as VectorField,
|
|
2432
|
+
Jr as buildValidationRules,
|
|
2433
|
+
Ne as evaluateCondition,
|
|
2434
|
+
vr as formatCurrency,
|
|
2435
|
+
Fr as formatDate,
|
|
2436
|
+
wr as formatDateTime,
|
|
2437
|
+
qr as formatFileSize,
|
|
2438
|
+
_r as formatPercent,
|
|
2439
|
+
Br as getCellRenderer,
|
|
2440
|
+
Yr as mapFieldTypeToFormType,
|
|
2441
|
+
Ur as registerAllFields,
|
|
2442
|
+
Mr as registerField,
|
|
2443
|
+
re as registerFieldRenderer,
|
|
2444
|
+
Gr as registerFields
|
|
1060
2445
|
};
|