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