@object-ui/fields 13.1.0 → 13.2.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/CHANGELOG.md +51 -0
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +459 -351
- package/dist/widgets/CapabilityMultiSelectField.d.ts +11 -0
- package/dist/widgets/CapabilityMultiSelectField.test.d.ts +0 -0
- package/package.json +7 -7
- package/src/index.tsx +8 -0
- package/src/widgets/CapabilityMultiSelectField.test.tsx +143 -0
- package/src/widgets/CapabilityMultiSelectField.tsx +204 -0
package/dist/index.js
CHANGED
|
@@ -2313,8 +2313,115 @@ function Vn({ value: t, onChange: n, field: o, readonly: u, ...d }) {
|
|
|
2313
2313
|
}
|
|
2314
2314
|
var Hn, Un, Wn, Gn, Kn = Z((() => {
|
|
2315
2315
|
tn(), Tn(), Kt(), An(), xn(), un(), Pn(), gt(), Hn = 50, Un = Je, Wn = /^(sys_|cloud_|ai_)/, Gn = /* @__PURE__ */ new Set(["user", "users"]);
|
|
2316
|
-
}))
|
|
2317
|
-
|
|
2316
|
+
}));
|
|
2317
|
+
st(), ut(), pt(), yt(), wt(), Dt(), At(), Nt(), Rt(), Vt(), Wt(), Kn();
|
|
2318
|
+
function qn(e) {
|
|
2319
|
+
if (Array.isArray(e)) return e.map((e) => String(e)).filter(Boolean);
|
|
2320
|
+
if (typeof e == "string") {
|
|
2321
|
+
let t = e.trim();
|
|
2322
|
+
if (!t) return [];
|
|
2323
|
+
try {
|
|
2324
|
+
let e = JSON.parse(t);
|
|
2325
|
+
return Array.isArray(e) ? e.map((e) => String(e)).filter(Boolean) : [String(e)].filter(Boolean);
|
|
2326
|
+
} catch {
|
|
2327
|
+
return t.split(",").map((e) => e.trim()).filter(Boolean);
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
return [];
|
|
2331
|
+
}
|
|
2332
|
+
var Jn = [
|
|
2333
|
+
"platform",
|
|
2334
|
+
"org",
|
|
2335
|
+
"other"
|
|
2336
|
+
], Yn = {
|
|
2337
|
+
platform: "Platform",
|
|
2338
|
+
org: "Organization",
|
|
2339
|
+
other: "Other"
|
|
2340
|
+
};
|
|
2341
|
+
function Xn({ value: t, onChange: n, readonly: r, className: i, ...a }) {
|
|
2342
|
+
let o = e.useContext(Je), s = a.dataSource ?? o?.dataSource ?? null, c = a.disabled, [l, u] = e.useState(null), d = e.useMemo(() => qn(t), [t]);
|
|
2343
|
+
e.useEffect(() => {
|
|
2344
|
+
if (!s || typeof s.find != "function") return;
|
|
2345
|
+
let e = !1;
|
|
2346
|
+
return (async () => {
|
|
2347
|
+
try {
|
|
2348
|
+
let t = await s.find("sys_capability", {
|
|
2349
|
+
$filter: { active: !0 },
|
|
2350
|
+
$top: 500
|
|
2351
|
+
}), n = t?.data ?? t?.records ?? (Array.isArray(t) ? t : []);
|
|
2352
|
+
e || u(Array.isArray(n) ? n : []);
|
|
2353
|
+
} catch {
|
|
2354
|
+
e || u([]);
|
|
2355
|
+
}
|
|
2356
|
+
})(), () => {
|
|
2357
|
+
e = !0;
|
|
2358
|
+
};
|
|
2359
|
+
}, [s]);
|
|
2360
|
+
let f = e.useCallback((e) => n(JSON.stringify(e)), [n]), p = e.useMemo(() => {
|
|
2361
|
+
let e = /* @__PURE__ */ new Map();
|
|
2362
|
+
for (let t of l ?? []) t?.name && e.set(t.name, t);
|
|
2363
|
+
for (let t of d) e.has(t) || e.set(t, {
|
|
2364
|
+
name: t,
|
|
2365
|
+
label: t,
|
|
2366
|
+
scope: "other"
|
|
2367
|
+
});
|
|
2368
|
+
return e;
|
|
2369
|
+
}, [l, d]), m = (e) => p.get(e)?.label || e, h = e.useMemo(() => {
|
|
2370
|
+
let e = /* @__PURE__ */ new Map();
|
|
2371
|
+
for (let t of p.values()) {
|
|
2372
|
+
let n = Jn.includes(t.scope) ? t.scope : "other", r = e.get(n) ?? [];
|
|
2373
|
+
r.push(t), e.set(n, r);
|
|
2374
|
+
}
|
|
2375
|
+
return Jn.filter((t) => e.has(t)).map((t) => ({
|
|
2376
|
+
scope: t,
|
|
2377
|
+
label: Yn[t] ?? t,
|
|
2378
|
+
items: (e.get(t) ?? []).sort((e, t) => (e.label || e.name).localeCompare(t.label || t.name))
|
|
2379
|
+
}));
|
|
2380
|
+
}, [p]);
|
|
2381
|
+
if (r) return d.length === 0 ? /* @__PURE__ */ Y(N, {}) : /* @__PURE__ */ Y("div", {
|
|
2382
|
+
className: "flex flex-wrap gap-1",
|
|
2383
|
+
children: d.map((e) => /* @__PURE__ */ Y(w, {
|
|
2384
|
+
variant: "outline",
|
|
2385
|
+
title: p.get(e)?.description,
|
|
2386
|
+
children: m(e)
|
|
2387
|
+
}, e))
|
|
2388
|
+
});
|
|
2389
|
+
let g = (e) => {
|
|
2390
|
+
let t = d.includes(e) ? d.filter((t) => t !== e) : [...d, e];
|
|
2391
|
+
f(t);
|
|
2392
|
+
};
|
|
2393
|
+
return /* @__PURE__ */ X("div", {
|
|
2394
|
+
className: G("flex flex-col gap-3", i),
|
|
2395
|
+
children: [l === null && h.length === 0 && /* @__PURE__ */ Y("span", {
|
|
2396
|
+
className: "text-sm text-muted-foreground",
|
|
2397
|
+
children: "Loading capabilities…"
|
|
2398
|
+
}), h.map((e) => /* @__PURE__ */ X("div", {
|
|
2399
|
+
className: "flex flex-col gap-1.5",
|
|
2400
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2401
|
+
className: "text-xs font-medium uppercase tracking-wide text-muted-foreground",
|
|
2402
|
+
children: e.label
|
|
2403
|
+
}), /* @__PURE__ */ Y("div", {
|
|
2404
|
+
className: "flex flex-wrap gap-1.5",
|
|
2405
|
+
children: e.items.map((e) => {
|
|
2406
|
+
let t = d.includes(e.name);
|
|
2407
|
+
return /* @__PURE__ */ Y("button", {
|
|
2408
|
+
type: "button",
|
|
2409
|
+
onClick: () => g(e.name),
|
|
2410
|
+
disabled: c,
|
|
2411
|
+
"aria-pressed": t,
|
|
2412
|
+
title: e.description || void 0,
|
|
2413
|
+
className: G("rounded-full border px-3 py-1 text-sm transition-colors disabled:opacity-50", t ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background text-foreground hover:bg-accent"),
|
|
2414
|
+
children: e.label || e.name
|
|
2415
|
+
}, e.name);
|
|
2416
|
+
})
|
|
2417
|
+
})]
|
|
2418
|
+
}, e.scope))]
|
|
2419
|
+
});
|
|
2420
|
+
}
|
|
2421
|
+
//#endregion
|
|
2422
|
+
//#region src/widgets/DateTimeField.tsx
|
|
2423
|
+
var Zn = /* @__PURE__ */ Q({ DateTimeField: () => Qn });
|
|
2424
|
+
function Qn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
2318
2425
|
if (r) {
|
|
2319
2426
|
if (!e) return /* @__PURE__ */ Y(N, {});
|
|
2320
2427
|
let t = new Date(e);
|
|
@@ -2339,10 +2446,10 @@ function Jn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
|
2339
2446
|
disabled: r || o.disabled
|
|
2340
2447
|
});
|
|
2341
2448
|
}
|
|
2342
|
-
var
|
|
2449
|
+
var $n = Z((() => {
|
|
2343
2450
|
xt();
|
|
2344
|
-
})),
|
|
2345
|
-
function
|
|
2451
|
+
})), er = /* @__PURE__ */ Q({ TimeField: () => tr });
|
|
2452
|
+
function tr({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
2346
2453
|
if (r) return /* @__PURE__ */ Y("span", {
|
|
2347
2454
|
className: "text-sm",
|
|
2348
2455
|
children: e || /* @__PURE__ */ Y(N, {})
|
|
@@ -2359,10 +2466,10 @@ function Zn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
|
2359
2466
|
disabled: r || o.disabled
|
|
2360
2467
|
});
|
|
2361
2468
|
}
|
|
2362
|
-
var
|
|
2469
|
+
var nr = Z((() => {
|
|
2363
2470
|
xt();
|
|
2364
|
-
})),
|
|
2365
|
-
function
|
|
2471
|
+
})), rr = /* @__PURE__ */ Q({ PercentField: () => ir });
|
|
2472
|
+
function ir({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, className: a, ...o }) {
|
|
2366
2473
|
let s = n || o.schema, c = s?.precision ?? 2, l = typeof s?.max == "number" ? s.max : void 0, u = l != null && l > 1, d = (e) => u ? e : e * 100, f = (e) => u ? e : e / 100, p = u ? l : 100;
|
|
2367
2474
|
if (r) return e == null ? /* @__PURE__ */ Y(N, {}) : /* @__PURE__ */ X("span", {
|
|
2368
2475
|
className: "text-sm font-medium tabular-nums",
|
|
@@ -2415,8 +2522,8 @@ function er({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, cla
|
|
|
2415
2522
|
})]
|
|
2416
2523
|
});
|
|
2417
2524
|
}
|
|
2418
|
-
var
|
|
2419
|
-
function
|
|
2525
|
+
var ar = Z((() => {})), or = /* @__PURE__ */ Q({ PasswordField: () => sr });
|
|
2526
|
+
function sr({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
|
|
2420
2527
|
let [o, s] = l(!1), c = n || a.schema;
|
|
2421
2528
|
if (r) return /* @__PURE__ */ Y("span", {
|
|
2422
2529
|
className: "text-sm",
|
|
@@ -2444,8 +2551,8 @@ function rr({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
|
|
|
2444
2551
|
})]
|
|
2445
2552
|
});
|
|
2446
2553
|
}
|
|
2447
|
-
var
|
|
2448
|
-
function
|
|
2554
|
+
var cr = Z((() => {})), lr = /* @__PURE__ */ Q({ FileField: () => ur });
|
|
2555
|
+
function ur({ value: e, onChange: t, field: n, readonly: i, ...a }) {
|
|
2449
2556
|
let o = c(null), s = c(null), u = n || a.schema, d = u?.multiple || !1, f = u?.accept ? u.accept.join(",") : void 0, p = u?.maxSize, m = u?.capture ?? null, h = !f || f.split(",").some((e) => e.trim().startsWith("image/") || e.trim() === "image/*" || e.trim().startsWith(".jp") || e.trim().startsWith(".png") || e.trim().startsWith(".gif") || e.trim().startsWith(".webp")), g = typeof navigator < "u" && (navigator.maxTouchPoints > 0 || /Mobi|Android/i.test(navigator.userAgent)), _ = m === !1 ? !1 : m ?? (h && g ? "environment" : null), [v, y] = l(!1), [b, x] = l([]), { upload: S } = et(), [C, w] = l({}), [E, D] = l(!1), O = e ? Array.isArray(e) ? e : [e] : [], k = r(async (e) => {
|
|
2450
2557
|
if (e.length === 0) return;
|
|
2451
2558
|
let n = [], r = e.filter((e) => {
|
|
@@ -2633,8 +2740,8 @@ function or({ value: e, onChange: t, field: n, readonly: i, ...a }) {
|
|
|
2633
2740
|
]
|
|
2634
2741
|
});
|
|
2635
2742
|
}
|
|
2636
|
-
var
|
|
2637
|
-
|
|
2743
|
+
var dr = Z((() => {})), fr = /* @__PURE__ */ Q({ ImageCropperDialog: () => pr }), pr, mr = Z((() => {
|
|
2744
|
+
pr = ({ open: e, onOpenChange: t, src: n, outputType: i = "image/png", outputName: o = "cropped.png", onConfirm: s }) => {
|
|
2638
2745
|
let u = c(null), d = c(null), [f, p] = l(0), [m, h] = l({
|
|
2639
2746
|
x: 0,
|
|
2640
2747
|
y: 0,
|
|
@@ -2773,8 +2880,8 @@ var sr = Z((() => {})), cr = /* @__PURE__ */ Q({ ImageCropperDialog: () => lr })
|
|
|
2773
2880
|
})
|
|
2774
2881
|
});
|
|
2775
2882
|
};
|
|
2776
|
-
})),
|
|
2777
|
-
function
|
|
2883
|
+
})), hr = /* @__PURE__ */ Q({ ImageField: () => gr });
|
|
2884
|
+
function gr({ value: e, onChange: n, field: i, readonly: a, ...o }) {
|
|
2778
2885
|
let s = c(null), u = i || o.schema, d = u?.multiple || !1, f = u?.accept ? u.accept.join(",") : "image/*", p = u?.crop !== !1, [m, h] = l(null), { upload: g } = et(), [_, v] = l(!1);
|
|
2779
2886
|
if (a) return e ? /* @__PURE__ */ Y("div", {
|
|
2780
2887
|
className: "flex flex-wrap gap-2",
|
|
@@ -2896,7 +3003,7 @@ function fr({ value: e, onChange: n, field: i, readonly: a, ...o }) {
|
|
|
2896
3003
|
}),
|
|
2897
3004
|
p && m && /* @__PURE__ */ Y(t, {
|
|
2898
3005
|
fallback: null,
|
|
2899
|
-
children: /* @__PURE__ */ Y(
|
|
3006
|
+
children: /* @__PURE__ */ Y(_r, {
|
|
2900
3007
|
open: !0,
|
|
2901
3008
|
onOpenChange: (e) => !e && h(null),
|
|
2902
3009
|
src: m.src,
|
|
@@ -2907,10 +3014,10 @@ function fr({ value: e, onChange: n, field: i, readonly: a, ...o }) {
|
|
|
2907
3014
|
]
|
|
2908
3015
|
});
|
|
2909
3016
|
}
|
|
2910
|
-
var
|
|
2911
|
-
|
|
2912
|
-
})),
|
|
2913
|
-
function
|
|
3017
|
+
var _r, vr = Z((() => {
|
|
3018
|
+
_r = n(() => Promise.resolve().then(() => (mr(), fr)).then((e) => ({ default: e.ImageCropperDialog })));
|
|
3019
|
+
})), yr = /* @__PURE__ */ Q({ LocationField: () => br });
|
|
3020
|
+
function br({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
2914
3021
|
let a = n || i.schema, o = e && typeof e == "object" ? `${e.latitude || 0}, ${e.longitude || 0}` : "";
|
|
2915
3022
|
return r ? /* @__PURE__ */ Y("span", {
|
|
2916
3023
|
className: "text-sm",
|
|
@@ -2938,8 +3045,8 @@ function gr({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
|
2938
3045
|
className: i.className
|
|
2939
3046
|
});
|
|
2940
3047
|
}
|
|
2941
|
-
var
|
|
2942
|
-
function
|
|
3048
|
+
var xr = Z((() => {})), Sr = /* @__PURE__ */ Q({ FormulaField: () => Cr });
|
|
3049
|
+
function Cr({ value: e, field: t, ...n }) {
|
|
2943
3050
|
let r = (t || n.schema)?.return_type || "text";
|
|
2944
3051
|
if (e == null) return /* @__PURE__ */ Y(N, { className: n.className });
|
|
2945
3052
|
let i;
|
|
@@ -2948,8 +3055,8 @@ function yr({ value: e, field: t, ...n }) {
|
|
|
2948
3055
|
children: i
|
|
2949
3056
|
});
|
|
2950
3057
|
}
|
|
2951
|
-
var
|
|
2952
|
-
function
|
|
3058
|
+
var wr = Z((() => {})), Tr = /* @__PURE__ */ Q({ SummaryField: () => Er });
|
|
3059
|
+
function Er({ value: e, field: t, ...n }) {
|
|
2953
3060
|
let r = (t || n.schema)?.summary_type || "count";
|
|
2954
3061
|
if (e == null) return /* @__PURE__ */ Y(N, { className: n.className });
|
|
2955
3062
|
let i;
|
|
@@ -2963,15 +3070,15 @@ function Sr({ value: e, field: t, ...n }) {
|
|
|
2963
3070
|
children: i
|
|
2964
3071
|
});
|
|
2965
3072
|
}
|
|
2966
|
-
var
|
|
2967
|
-
function
|
|
3073
|
+
var Dr = Z((() => {})), Or = /* @__PURE__ */ Q({ AutoNumberField: () => kr });
|
|
3074
|
+
function kr({ value: e, field: t, ...n }) {
|
|
2968
3075
|
return e == null ? /* @__PURE__ */ Y(N, { className: n.className }) : /* @__PURE__ */ Y("span", {
|
|
2969
3076
|
className: `text-sm font-mono text-gray-700 ${n.className || ""}`,
|
|
2970
3077
|
children: String(e)
|
|
2971
3078
|
});
|
|
2972
3079
|
}
|
|
2973
|
-
var
|
|
2974
|
-
function
|
|
3080
|
+
var Ar = Z((() => {})), jr = /* @__PURE__ */ Q({ UserField: () => Nr });
|
|
3081
|
+
function Mr(e) {
|
|
2975
3082
|
let t = Array.isArray(e) ? e : [];
|
|
2976
3083
|
return t.some((e) => e?.field === "banned") ? t : [...t, {
|
|
2977
3084
|
field: "banned",
|
|
@@ -2979,7 +3086,7 @@ function Or(e) {
|
|
|
2979
3086
|
value: !0
|
|
2980
3087
|
}];
|
|
2981
3088
|
}
|
|
2982
|
-
function
|
|
3089
|
+
function Nr(e) {
|
|
2983
3090
|
let t = e.field || e.schema, n = t?.field && typeof t.field == "object" && ("reference" in t.field || "reference_to" in t.field || "type" in t.field), r = n ? t.field : t, i = {
|
|
2984
3091
|
...r || {},
|
|
2985
3092
|
reference: r?.reference || r?.reference_to || "sys_user",
|
|
@@ -2987,7 +3094,7 @@ function kr(e) {
|
|
|
2987
3094
|
picker: r?.picker ?? "search",
|
|
2988
3095
|
subtitle: r?.subtitle ?? ["primary_business_unit_id.name", "email"],
|
|
2989
3096
|
avatar_field: r?.avatar_field ?? r?.avatarField ?? "image",
|
|
2990
|
-
lookup_filters:
|
|
3097
|
+
lookup_filters: Mr(r?.lookup_filters ?? r?.lookupFilters)
|
|
2991
3098
|
}, a = n ? {
|
|
2992
3099
|
...t,
|
|
2993
3100
|
field: i
|
|
@@ -2997,10 +3104,8 @@ function kr(e) {
|
|
|
2997
3104
|
field: a
|
|
2998
3105
|
});
|
|
2999
3106
|
}
|
|
3000
|
-
var
|
|
3001
|
-
|
|
3002
|
-
})), jr = /* @__PURE__ */ Q({ ObjectField: () => Mr });
|
|
3003
|
-
function Mr({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
3107
|
+
var Pr = Z((() => {})), Fr = /* @__PURE__ */ Q({ ObjectField: () => Ir });
|
|
3108
|
+
function Ir({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
3004
3109
|
let o = n || i.schema, [s, c] = l(() => e == null ? "" : JSON.stringify(e, null, 2)), [u, d] = l(null);
|
|
3005
3110
|
return a(() => {
|
|
3006
3111
|
try {
|
|
@@ -3042,8 +3147,8 @@ function Mr({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
|
3042
3147
|
})]
|
|
3043
3148
|
});
|
|
3044
3149
|
}
|
|
3045
|
-
var
|
|
3046
|
-
function
|
|
3150
|
+
var Lr = Z((() => {})), Rr = /* @__PURE__ */ Q({ VectorField: () => zr });
|
|
3151
|
+
function zr({ value: e, field: t, ...n }) {
|
|
3047
3152
|
let r = (t || n.schema)?.dimensions || (Array.isArray(e) ? e.length : 0);
|
|
3048
3153
|
if (!e || !Array.isArray(e)) return /* @__PURE__ */ Y(N, {});
|
|
3049
3154
|
let i = e.slice(0, 3).map((e) => {
|
|
@@ -3069,27 +3174,27 @@ function Fr({ value: e, field: t, ...n }) {
|
|
|
3069
3174
|
})]
|
|
3070
3175
|
});
|
|
3071
3176
|
}
|
|
3072
|
-
var
|
|
3073
|
-
GridField: () =>
|
|
3074
|
-
LineItemsField: () =>
|
|
3075
|
-
computeRow: () =>
|
|
3076
|
-
evalArith: () =>
|
|
3077
|
-
lookupAutofillPatch: () =>
|
|
3078
|
-
sumColumn: () =>
|
|
3177
|
+
var Br = Z((() => {})), Vr = /* @__PURE__ */ Q({
|
|
3178
|
+
GridField: () => Zr,
|
|
3179
|
+
LineItemsField: () => ti,
|
|
3180
|
+
computeRow: () => qr,
|
|
3181
|
+
evalArith: () => Gr,
|
|
3182
|
+
lookupAutofillPatch: () => Kr,
|
|
3183
|
+
sumColumn: () => Xr
|
|
3079
3184
|
});
|
|
3080
|
-
function
|
|
3185
|
+
function Hr(e) {
|
|
3081
3186
|
if (e.width) return {
|
|
3082
3187
|
width: e.width,
|
|
3083
3188
|
minWidth: e.width
|
|
3084
3189
|
};
|
|
3085
3190
|
if ((e.type ?? "text") === "text") return { minWidth: 180 };
|
|
3086
|
-
let t =
|
|
3191
|
+
let t = $r[e.type ?? "text"] ?? 132;
|
|
3087
3192
|
return {
|
|
3088
3193
|
width: t,
|
|
3089
3194
|
minWidth: t
|
|
3090
3195
|
};
|
|
3091
3196
|
}
|
|
3092
|
-
function
|
|
3197
|
+
function Ur(e) {
|
|
3093
3198
|
let t = [], n = 0;
|
|
3094
3199
|
for (; n < e.length;) {
|
|
3095
3200
|
let r = e[n];
|
|
@@ -3140,14 +3245,14 @@ function zr(e) {
|
|
|
3140
3245
|
}
|
|
3141
3246
|
return t;
|
|
3142
3247
|
}
|
|
3143
|
-
function
|
|
3248
|
+
function Wr(e, t) {
|
|
3144
3249
|
let n = e.startsWith("record.") ? e.slice(7) : e, r = t?.[n];
|
|
3145
3250
|
if (r == null || r === "") return null;
|
|
3146
3251
|
let i = Number(r);
|
|
3147
3252
|
return Number.isFinite(i) ? i : null;
|
|
3148
3253
|
}
|
|
3149
|
-
function
|
|
3150
|
-
let n =
|
|
3254
|
+
function Gr(e, t) {
|
|
3255
|
+
let n = Ur(e);
|
|
3151
3256
|
if (!n || n.length === 0) return null;
|
|
3152
3257
|
let r = 0, i = !1, a = () => n[r], o = () => n[r++];
|
|
3153
3258
|
function s() {
|
|
@@ -3158,7 +3263,7 @@ function Vr(e, t) {
|
|
|
3158
3263
|
if (e.t === "num") return o(), Number(e.v);
|
|
3159
3264
|
if (e.t === "id") {
|
|
3160
3265
|
o();
|
|
3161
|
-
let n =
|
|
3266
|
+
let n = Wr(e.v, t);
|
|
3162
3267
|
return n === null ? (i = !0, NaN) : n;
|
|
3163
3268
|
}
|
|
3164
3269
|
if (e.t === "lp") {
|
|
@@ -3187,7 +3292,7 @@ function Vr(e, t) {
|
|
|
3187
3292
|
let u = l();
|
|
3188
3293
|
return i || r !== n.length || !Number.isFinite(u) ? null : u;
|
|
3189
3294
|
}
|
|
3190
|
-
function
|
|
3295
|
+
function Kr(e, t, n) {
|
|
3191
3296
|
let r = { [t.field]: n?.value ?? n?.id ?? n?._id };
|
|
3192
3297
|
if (t.autofill !== !1 && n && typeof n == "object") for (let i of e) {
|
|
3193
3298
|
if (i.field === t.field || i.computed || i.type === "lookup") continue;
|
|
@@ -3196,12 +3301,12 @@ function Hr(e, t, n) {
|
|
|
3196
3301
|
}
|
|
3197
3302
|
return r;
|
|
3198
3303
|
}
|
|
3199
|
-
function
|
|
3304
|
+
function qr(e, t) {
|
|
3200
3305
|
let n = e.filter((e) => e.computed && e.expr);
|
|
3201
3306
|
if (n.length === 0) return t;
|
|
3202
3307
|
let r = { ...t };
|
|
3203
3308
|
for (let e of n) {
|
|
3204
|
-
let t =
|
|
3309
|
+
let t = Gr(e.expr, r);
|
|
3205
3310
|
if (t === null) {
|
|
3206
3311
|
r[e.field] = null;
|
|
3207
3312
|
continue;
|
|
@@ -3211,33 +3316,33 @@ function Ur(e, t) {
|
|
|
3211
3316
|
}
|
|
3212
3317
|
return r;
|
|
3213
3318
|
}
|
|
3214
|
-
function
|
|
3319
|
+
function Jr(e, t) {
|
|
3215
3320
|
if (t == null || t === "") return "—";
|
|
3216
3321
|
if (e.type === "select" && Array.isArray(e.options)) {
|
|
3217
3322
|
let n = e.options.find((e) => String(e.value) === String(t));
|
|
3218
3323
|
return n ? n.label : String(t);
|
|
3219
3324
|
}
|
|
3220
|
-
if (
|
|
3325
|
+
if (Qr(e.type)) {
|
|
3221
3326
|
let n = Number(t);
|
|
3222
3327
|
if (Number.isFinite(n)) return e.type === "currency" ? `${e.prefix || "¥"}${n.toLocaleString()}` : n.toLocaleString();
|
|
3223
3328
|
}
|
|
3224
3329
|
return Array.isArray(t) ? t.join(", ") : String(t);
|
|
3225
3330
|
}
|
|
3226
|
-
function
|
|
3227
|
-
if (
|
|
3331
|
+
function Yr(e, t) {
|
|
3332
|
+
if (Qr(e)) {
|
|
3228
3333
|
if (t === "" || t == null) return null;
|
|
3229
3334
|
let e = Number(t);
|
|
3230
3335
|
return Number.isNaN(e) ? t : e;
|
|
3231
3336
|
}
|
|
3232
3337
|
return t;
|
|
3233
3338
|
}
|
|
3234
|
-
function
|
|
3339
|
+
function Xr(e, t) {
|
|
3235
3340
|
return Array.isArray(e) ? e.reduce((e, n) => {
|
|
3236
3341
|
let r = Number(n?.[t]);
|
|
3237
3342
|
return e + (Number.isFinite(r) ? r : 0);
|
|
3238
3343
|
}, 0) : 0;
|
|
3239
3344
|
}
|
|
3240
|
-
function
|
|
3345
|
+
function Zr({ value: t, onChange: n, field: i, readonly: a, disabled: o, className: s, onRowExpand: l, displayMode: u, onAdd: d, ...f }) {
|
|
3241
3346
|
let p = i || f.schema || {}, m = p.columns || [], h = Array.isArray(t) ? t : [], _ = f.contextRecord, v = r((e, t) => {
|
|
3242
3347
|
if (!e.readonlyWhen && !e.requiredWhen) return {
|
|
3243
3348
|
readonly: !1,
|
|
@@ -3271,13 +3376,13 @@ function qr({ value: t, onChange: n, field: i, readonly: a, disabled: o, classNa
|
|
|
3271
3376
|
}, [C]), le = r((e, t) => {
|
|
3272
3377
|
if (e >= h.length) {
|
|
3273
3378
|
if (N != null && h.length >= N) return;
|
|
3274
|
-
z([...h,
|
|
3379
|
+
z([...h, qr(C, {
|
|
3275
3380
|
...ce(),
|
|
3276
3381
|
...t
|
|
3277
3382
|
})]);
|
|
3278
3383
|
return;
|
|
3279
3384
|
}
|
|
3280
|
-
z(h.map((n, r) => r === e ?
|
|
3385
|
+
z(h.map((n, r) => r === e ? qr(C, {
|
|
3281
3386
|
...n,
|
|
3282
3387
|
...t
|
|
3283
3388
|
}) : n));
|
|
@@ -3288,9 +3393,9 @@ function qr({ value: t, onChange: n, field: i, readonly: a, disabled: o, classNa
|
|
|
3288
3393
|
ce,
|
|
3289
3394
|
z
|
|
3290
3395
|
]), ue = r((e, t, n) => le(e, { [t]: n }), [le]), de = r((e, t, n) => {
|
|
3291
|
-
le(e,
|
|
3396
|
+
le(e, Kr(C, t, n));
|
|
3292
3397
|
}, [C, le]), fe = r((e, t, n) => ue(e, t, n), [ue]), pe = r((e, t, n) => {
|
|
3293
|
-
ue(e, t.field,
|
|
3398
|
+
ue(e, t.field, Yr(t.type, n));
|
|
3294
3399
|
}, [ue]), B = r(() => {
|
|
3295
3400
|
N != null && h.length >= N || z([...h, ce()]);
|
|
3296
3401
|
}, [
|
|
@@ -3323,7 +3428,7 @@ function qr({ value: t, onChange: n, field: i, readonly: a, disabled: o, classNa
|
|
|
3323
3428
|
if (e === t || e < 0 || t < 0 || e >= h.length || t >= h.length) return;
|
|
3324
3429
|
let n = [...h], [r] = n.splice(e, 1);
|
|
3325
3430
|
n.splice(t, 0, r), z(n);
|
|
3326
|
-
}, [h, z]), W = c(null), K = A || O || k, _e = (+!!A + +!!k + +!!O) * 34 + 12, ve = !!re, ye = ve ?
|
|
3431
|
+
}, [h, z]), W = c(null), K = A || O || k, _e = (+!!A + +!!k + +!!O) * 34 + 12, ve = !!re, ye = ve ? Xr(h, re) : 0, be = ve ? Math.max(0, C.findIndex((e) => e.field === re)) : -1, q = S.length > 0 ? /* @__PURE__ */ X(ee, { children: [/* @__PURE__ */ Y(ne, {
|
|
3327
3432
|
asChild: !0,
|
|
3328
3433
|
children: /* @__PURE__ */ X(T, {
|
|
3329
3434
|
type: "button",
|
|
@@ -3382,8 +3487,8 @@ function qr({ value: t, onChange: n, field: i, readonly: a, disabled: o, classNa
|
|
|
3382
3487
|
className: "w-10 px-2 py-2 text-right text-xs font-medium text-muted-foreground",
|
|
3383
3488
|
children: "#"
|
|
3384
3489
|
}), C.map((e) => /* @__PURE__ */ Y("th", {
|
|
3385
|
-
style: { minWidth:
|
|
3386
|
-
className: G("px-3 py-2 text-xs font-medium text-muted-foreground whitespace-nowrap",
|
|
3490
|
+
style: { minWidth: ei(e) },
|
|
3491
|
+
className: G("px-3 py-2 text-xs font-medium text-muted-foreground whitespace-nowrap", Qr(e.type) ? "text-right" : "text-left"),
|
|
3387
3492
|
children: e.label || e.field
|
|
3388
3493
|
}, e.field))] })
|
|
3389
3494
|
}),
|
|
@@ -3397,7 +3502,7 @@ function qr({ value: t, onChange: n, field: i, readonly: a, disabled: o, classNa
|
|
|
3397
3502
|
className: "px-2 py-2 text-right text-muted-foreground tabular-nums",
|
|
3398
3503
|
children: t + 1
|
|
3399
3504
|
}), C.map((t) => /* @__PURE__ */ Y("td", {
|
|
3400
|
-
className: G("px-3 py-2 text-foreground",
|
|
3505
|
+
className: G("px-3 py-2 text-foreground", Qr(t.type) && "text-right tabular-nums"),
|
|
3401
3506
|
children: t.type === "lookup" && e[t.field] != null && e[t.field] !== "" ? /* @__PURE__ */ Y(Vn, {
|
|
3402
3507
|
value: e[t.field],
|
|
3403
3508
|
onChange: () => {},
|
|
@@ -3441,13 +3546,13 @@ function qr({ value: t, onChange: n, field: i, readonly: a, disabled: o, classNa
|
|
|
3441
3546
|
id_field: e.idField
|
|
3442
3547
|
}
|
|
3443
3548
|
}) : /* @__PURE__ */ Y("span", {
|
|
3444
|
-
className: G("px-2 text-sm text-foreground",
|
|
3445
|
-
children:
|
|
3549
|
+
className: G("px-2 text-sm text-foreground", Qr(e.type) && "tabular-nums", (i == null || i === "") && "text-muted-foreground"),
|
|
3550
|
+
children: Jr(e, i)
|
|
3446
3551
|
}) : e.computed ? /* @__PURE__ */ Y("span", {
|
|
3447
|
-
className: G("block px-2 text-sm tabular-nums",
|
|
3552
|
+
className: G("block px-2 text-sm tabular-nums", Qr(e.type) ? "text-right" : "text-left", i == null || i === "" ? "text-muted-foreground" : "text-foreground"),
|
|
3448
3553
|
title: "Computed",
|
|
3449
3554
|
"data-computed": e.field,
|
|
3450
|
-
children:
|
|
3555
|
+
children: Jr(e, i)
|
|
3451
3556
|
}) : e.type === "lookup" ? /* @__PURE__ */ Y(Vn, {
|
|
3452
3557
|
value: i,
|
|
3453
3558
|
onChange: (t) => fe(n, e.field, t),
|
|
@@ -3482,9 +3587,9 @@ function qr({ value: t, onChange: n, field: i, readonly: a, disabled: o, classNa
|
|
|
3482
3587
|
}), /* @__PURE__ */ Y(P, {
|
|
3483
3588
|
"data-cell": `${n}-${t}`,
|
|
3484
3589
|
onKeyDown: (e) => V(e, n, t),
|
|
3485
|
-
className: G("h-8 rounded-none border-0 bg-transparent px-2 shadow-none focus-visible:ring-1 focus-visible:ring-ring/60", e.type === "currency" && "pl-6",
|
|
3486
|
-
type: e.type === "date" ? "date" :
|
|
3487
|
-
step:
|
|
3590
|
+
className: G("h-8 rounded-none border-0 bg-transparent px-2 shadow-none focus-visible:ring-1 focus-visible:ring-ring/60", e.type === "currency" && "pl-6", Qr(e.type) && "text-right tabular-nums"),
|
|
3591
|
+
type: e.type === "date" ? "date" : Qr(e.type) ? "number" : "text",
|
|
3592
|
+
step: Qr(e.type) ? e.step ?? "any" : void 0,
|
|
3488
3593
|
"aria-label": e.label || e.field,
|
|
3489
3594
|
value: i == null ? "" : String(i),
|
|
3490
3595
|
onChange: (t) => pe(n, e, t.target.value),
|
|
@@ -3514,8 +3619,8 @@ function qr({ value: t, onChange: n, field: i, readonly: a, disabled: o, classNa
|
|
|
3514
3619
|
children: "#"
|
|
3515
3620
|
}),
|
|
3516
3621
|
C.map((e) => /* @__PURE__ */ X("th", {
|
|
3517
|
-
className: G("px-2 py-2 text-xs font-medium text-muted-foreground whitespace-nowrap",
|
|
3518
|
-
style:
|
|
3622
|
+
className: G("px-2 py-2 text-xs font-medium text-muted-foreground whitespace-nowrap", Qr(e.type) ? "text-right" : "text-left"),
|
|
3623
|
+
style: Hr(e),
|
|
3519
3624
|
children: [e.label || e.field, e.required && !e.computed && /* @__PURE__ */ Y("span", {
|
|
3520
3625
|
className: "text-destructive",
|
|
3521
3626
|
children: " *"
|
|
@@ -3657,17 +3762,17 @@ function qr({ value: t, onChange: n, field: i, readonly: a, disabled: o, classNa
|
|
|
3657
3762
|
]
|
|
3658
3763
|
});
|
|
3659
3764
|
}
|
|
3660
|
-
var
|
|
3661
|
-
Kn(),
|
|
3765
|
+
var Qr, $r, ei, ti, ni = Z((() => {
|
|
3766
|
+
Kn(), Qr = (e) => e === "number" || e === "currency", $r = {
|
|
3662
3767
|
text: 160,
|
|
3663
3768
|
select: 132,
|
|
3664
3769
|
lookup: 168,
|
|
3665
3770
|
number: 104,
|
|
3666
3771
|
currency: 116,
|
|
3667
3772
|
date: 150
|
|
3668
|
-
},
|
|
3669
|
-
})),
|
|
3670
|
-
function
|
|
3773
|
+
}, ei = (e) => e.width ?? $r[e.type ?? "text"] ?? 132, ti = Zr;
|
|
3774
|
+
})), ri = /* @__PURE__ */ Q({ ColorField: () => ii });
|
|
3775
|
+
function ii({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
3671
3776
|
let a = n || i.schema;
|
|
3672
3777
|
return r ? /* @__PURE__ */ X("div", {
|
|
3673
3778
|
className: "flex items-center gap-2",
|
|
@@ -3697,8 +3802,8 @@ function ei({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
|
3697
3802
|
})]
|
|
3698
3803
|
});
|
|
3699
3804
|
}
|
|
3700
|
-
var
|
|
3701
|
-
function
|
|
3805
|
+
var ai = Z((() => {})), oi = /* @__PURE__ */ Q({ SliderField: () => si });
|
|
3806
|
+
function si({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
3702
3807
|
let a = n || i.schema, o = a?.min ?? 0, s = a?.max ?? 100, c = a?.step ?? 1;
|
|
3703
3808
|
return r ? /* @__PURE__ */ X("div", {
|
|
3704
3809
|
className: "flex items-center gap-2",
|
|
@@ -3725,8 +3830,8 @@ function ri({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
|
3725
3830
|
})]
|
|
3726
3831
|
});
|
|
3727
3832
|
}
|
|
3728
|
-
var
|
|
3729
|
-
function
|
|
3833
|
+
var ci = Z((() => {})), li = /* @__PURE__ */ Q({ RatingField: () => ui });
|
|
3834
|
+
function ui({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }) {
|
|
3730
3835
|
let s = (r || o.schema)?.max ?? 5, c = t ?? 0, [l, u] = e.useState(null), d = l === null ? c : l;
|
|
3731
3836
|
return i ? /* @__PURE__ */ X("div", {
|
|
3732
3837
|
className: G("flex items-center gap-1", a),
|
|
@@ -3758,8 +3863,8 @@ function oi({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }
|
|
|
3758
3863
|
})]
|
|
3759
3864
|
});
|
|
3760
3865
|
}
|
|
3761
|
-
var
|
|
3762
|
-
function
|
|
3866
|
+
var di = Z((() => {})), fi = /* @__PURE__ */ Q({ CodeField: () => pi });
|
|
3867
|
+
function pi({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
3763
3868
|
let a = n || i.schema, o = a?.language ?? "javascript";
|
|
3764
3869
|
return r ? /* @__PURE__ */ Y("pre", {
|
|
3765
3870
|
className: G("text-sm bg-muted p-2 rounded overflow-x-auto border", i.className),
|
|
@@ -3774,8 +3879,8 @@ function li({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
|
3774
3879
|
spellCheck: !1
|
|
3775
3880
|
});
|
|
3776
3881
|
}
|
|
3777
|
-
var
|
|
3778
|
-
function
|
|
3882
|
+
var mi = Z((() => {})), hi = /* @__PURE__ */ Q({ AvatarField: () => gi });
|
|
3883
|
+
function gi({ value: t, onChange: n, field: r, readonly: i, ...a }) {
|
|
3779
3884
|
let [o, s] = e.useState(!1), c = e.useRef(null), l = r || a.schema, u = (e) => {
|
|
3780
3885
|
let t = e.target.files?.[0];
|
|
3781
3886
|
if (!t) return;
|
|
@@ -3848,8 +3953,8 @@ function fi({ value: t, onChange: n, field: r, readonly: i, ...a }) {
|
|
|
3848
3953
|
})]
|
|
3849
3954
|
});
|
|
3850
3955
|
}
|
|
3851
|
-
var
|
|
3852
|
-
function
|
|
3956
|
+
var _i = Z((() => {})), vi = /* @__PURE__ */ Q({ AddressField: () => yi });
|
|
3957
|
+
function yi({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
3853
3958
|
let a = e || {}, o = (e, n) => {
|
|
3854
3959
|
t({
|
|
3855
3960
|
...a,
|
|
@@ -3939,8 +4044,8 @@ function hi({ value: e, onChange: t, field: n, readonly: r, ...i }) {
|
|
|
3939
4044
|
]
|
|
3940
4045
|
});
|
|
3941
4046
|
}
|
|
3942
|
-
var
|
|
3943
|
-
function
|
|
4047
|
+
var bi = Z((() => {})), xi = /* @__PURE__ */ Q({ GeolocationField: () => Si });
|
|
4048
|
+
function Si({ value: t, onChange: n, field: r, readonly: i, ...a }) {
|
|
3944
4049
|
let [o, s] = e.useState(!1), c = t || {}, l = (e, t) => {
|
|
3945
4050
|
n({
|
|
3946
4051
|
...c,
|
|
@@ -4050,8 +4155,8 @@ function vi({ value: t, onChange: n, field: r, readonly: i, ...a }) {
|
|
|
4050
4155
|
]
|
|
4051
4156
|
});
|
|
4052
4157
|
}
|
|
4053
|
-
var
|
|
4054
|
-
function
|
|
4158
|
+
var Ci = Z((() => {})), wi = /* @__PURE__ */ Q({ SignatureField: () => Ti });
|
|
4159
|
+
function Ti({ value: t, onChange: n, readonly: r }) {
|
|
4055
4160
|
let i = c(null), [o, s] = e.useState(!1), [l, u] = e.useState(!t);
|
|
4056
4161
|
a(() => {
|
|
4057
4162
|
if (t && i.current) {
|
|
@@ -4136,8 +4241,8 @@ function xi({ value: t, onChange: n, readonly: r }) {
|
|
|
4136
4241
|
})]
|
|
4137
4242
|
});
|
|
4138
4243
|
}
|
|
4139
|
-
var
|
|
4140
|
-
function
|
|
4244
|
+
var Ei = Z((() => {})), Di = /* @__PURE__ */ Q({ QRCodeField: () => Oi });
|
|
4245
|
+
function Oi({ value: t, onChange: n, field: r, readonly: i, ...a }) {
|
|
4141
4246
|
let [o, s] = e.useState(!1), c = r || a.schema;
|
|
4142
4247
|
return i ? /* @__PURE__ */ X("div", {
|
|
4143
4248
|
className: "flex items-center gap-3",
|
|
@@ -4202,8 +4307,8 @@ function wi({ value: t, onChange: n, field: r, readonly: i, ...a }) {
|
|
|
4202
4307
|
]
|
|
4203
4308
|
});
|
|
4204
4309
|
}
|
|
4205
|
-
var
|
|
4206
|
-
function
|
|
4310
|
+
var ki = Z((() => {})), Ai = /* @__PURE__ */ Q({ MultiSelectField: () => ji });
|
|
4311
|
+
function ji({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
|
|
4207
4312
|
let o = (n || a.schema)?.options || [], s = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
4208
4313
|
if (r) return s.length === 0 ? /* @__PURE__ */ Y(N, {}) : /* @__PURE__ */ Y("div", {
|
|
4209
4314
|
className: "flex flex-wrap gap-1",
|
|
@@ -4230,8 +4335,8 @@ function Di({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
|
|
|
4230
4335
|
})
|
|
4231
4336
|
});
|
|
4232
4337
|
}
|
|
4233
|
-
var
|
|
4234
|
-
function
|
|
4338
|
+
var Mi = Z((() => {})), Ni = /* @__PURE__ */ Q({ RadioField: () => Pi });
|
|
4339
|
+
function Pi({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
|
|
4235
4340
|
let s = (n || a.schema)?.options || [], c = o();
|
|
4236
4341
|
return r ? e == null || e === "" ? /* @__PURE__ */ Y(N, {}) : /* @__PURE__ */ Y("span", {
|
|
4237
4342
|
className: "text-sm",
|
|
@@ -4257,8 +4362,8 @@ function Ai({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
|
|
|
4257
4362
|
})
|
|
4258
4363
|
});
|
|
4259
4364
|
}
|
|
4260
|
-
var
|
|
4261
|
-
function
|
|
4365
|
+
var Fi = Z((() => {})), Ii = /* @__PURE__ */ Q({ CheckboxesField: () => Li });
|
|
4366
|
+
function Li({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
|
|
4262
4367
|
let s = (n || a.schema)?.options || [], c = Array.isArray(e) ? e : e == null ? [] : [e], l = o();
|
|
4263
4368
|
if (r) return c.length === 0 ? /* @__PURE__ */ Y(N, {}) : /* @__PURE__ */ Y("div", {
|
|
4264
4369
|
className: "flex flex-wrap gap-1",
|
|
@@ -4290,8 +4395,8 @@ function Ni({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
|
|
|
4290
4395
|
})
|
|
4291
4396
|
});
|
|
4292
4397
|
}
|
|
4293
|
-
var
|
|
4294
|
-
function
|
|
4398
|
+
var Ri = Z((() => {})), zi = /* @__PURE__ */ Q({ TagsField: () => Bi });
|
|
4399
|
+
function Bi({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }) {
|
|
4295
4400
|
let s = Array.isArray(t) ? t : t == null ? [] : [t], [c, l] = e.useState("");
|
|
4296
4401
|
if (i) return s.length === 0 ? /* @__PURE__ */ Y(N, {}) : /* @__PURE__ */ Y("div", {
|
|
4297
4402
|
className: "flex flex-wrap gap-1",
|
|
@@ -4329,42 +4434,42 @@ function Ii({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }
|
|
|
4329
4434
|
})]
|
|
4330
4435
|
});
|
|
4331
4436
|
}
|
|
4332
|
-
var
|
|
4333
|
-
|
|
4334
|
-
var
|
|
4437
|
+
var Vi = Z((() => {}));
|
|
4438
|
+
cr(), dr(), vr(), wr(), Dr(), Ar(), Lr(), Br(), ni(), _i(), Ei(), ar(), ci(), di(), Mi(), Fi(), Ri(), Vi(), $n(), nr(), Kn(), Pr(), ai(), bi(), xr(), Ci(), mi(), ki();
|
|
4439
|
+
var Hi = {
|
|
4335
4440
|
text: ot,
|
|
4336
4441
|
textarea: Bt,
|
|
4337
4442
|
number: lt,
|
|
4338
4443
|
currency: Lt,
|
|
4339
|
-
percent:
|
|
4340
|
-
slider:
|
|
4341
|
-
progress:
|
|
4342
|
-
rating:
|
|
4444
|
+
percent: ir,
|
|
4445
|
+
slider: si,
|
|
4446
|
+
progress: si,
|
|
4447
|
+
rating: ui,
|
|
4343
4448
|
boolean: ft,
|
|
4344
4449
|
toggle: ft,
|
|
4345
4450
|
select: vt,
|
|
4346
4451
|
status: vt,
|
|
4347
|
-
multiselect:
|
|
4348
|
-
radio:
|
|
4349
|
-
checkboxes:
|
|
4350
|
-
tags:
|
|
4452
|
+
multiselect: ji,
|
|
4453
|
+
radio: Pi,
|
|
4454
|
+
checkboxes: Li,
|
|
4455
|
+
tags: Bi,
|
|
4351
4456
|
date: Ct,
|
|
4352
|
-
datetime:
|
|
4353
|
-
time:
|
|
4457
|
+
datetime: Qn,
|
|
4458
|
+
time: tr,
|
|
4354
4459
|
email: Et,
|
|
4355
4460
|
phone: kt,
|
|
4356
4461
|
url: Mt,
|
|
4357
4462
|
lookup: Vn,
|
|
4358
4463
|
master_detail: Vn,
|
|
4359
|
-
user:
|
|
4360
|
-
owner:
|
|
4361
|
-
color:
|
|
4362
|
-
address:
|
|
4363
|
-
location:
|
|
4364
|
-
geolocation:
|
|
4365
|
-
code:
|
|
4366
|
-
qrcode:
|
|
4367
|
-
},
|
|
4464
|
+
user: Nr,
|
|
4465
|
+
owner: Nr,
|
|
4466
|
+
color: ii,
|
|
4467
|
+
address: yi,
|
|
4468
|
+
location: br,
|
|
4469
|
+
geolocation: Si,
|
|
4470
|
+
code: pi,
|
|
4471
|
+
qrcode: Oi
|
|
4472
|
+
}, Ui = /* @__PURE__ */ new Set([
|
|
4368
4473
|
"formula",
|
|
4369
4474
|
"summary",
|
|
4370
4475
|
"auto_number",
|
|
@@ -4379,7 +4484,7 @@ var Ri = {
|
|
|
4379
4484
|
"object",
|
|
4380
4485
|
"grid",
|
|
4381
4486
|
"vector"
|
|
4382
|
-
]),
|
|
4487
|
+
]), Wi = /* @__PURE__ */ new Set([
|
|
4383
4488
|
"boolean",
|
|
4384
4489
|
"toggle",
|
|
4385
4490
|
"select",
|
|
@@ -4387,29 +4492,29 @@ var Ri = {
|
|
|
4387
4492
|
"radio",
|
|
4388
4493
|
"rating"
|
|
4389
4494
|
]);
|
|
4390
|
-
function
|
|
4391
|
-
return !!e && e in
|
|
4495
|
+
function Gi(e) {
|
|
4496
|
+
return !!e && e in Hi;
|
|
4392
4497
|
}
|
|
4393
|
-
var
|
|
4498
|
+
var Ki = /* @__PURE__ */ new Set([
|
|
4394
4499
|
"lookup",
|
|
4395
4500
|
"master_detail",
|
|
4396
4501
|
"user",
|
|
4397
4502
|
"owner"
|
|
4398
4503
|
]);
|
|
4399
|
-
function
|
|
4400
|
-
let i = e?.type ?
|
|
4504
|
+
function qi({ field: e, value: t, onChange: n, readonly: r }) {
|
|
4505
|
+
let i = e?.type ? Hi[e.type] : void 0;
|
|
4401
4506
|
return i ? /* @__PURE__ */ Y(i, {
|
|
4402
4507
|
field: e,
|
|
4403
4508
|
value: t,
|
|
4404
4509
|
onChange: n,
|
|
4405
4510
|
readonly: r,
|
|
4406
|
-
...e?.type &&
|
|
4511
|
+
...e?.type && Ki.has(e.type) ? { compact: !0 } : {}
|
|
4407
4512
|
}) : null;
|
|
4408
4513
|
}
|
|
4409
4514
|
//#endregion
|
|
4410
4515
|
//#region src/widgets/MasterDetailField.tsx
|
|
4411
|
-
|
|
4412
|
-
function
|
|
4516
|
+
mr();
|
|
4517
|
+
function Ji({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
|
|
4413
4518
|
let o = e || [], s = n || a.schema, c = () => {
|
|
4414
4519
|
let e = {
|
|
4415
4520
|
id: `new-${Date.now()}`,
|
|
@@ -4498,8 +4603,8 @@ function Wi({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
|
|
|
4498
4603
|
}
|
|
4499
4604
|
//#endregion
|
|
4500
4605
|
//#region src/widgets/MarkdownContent.tsx
|
|
4501
|
-
var
|
|
4502
|
-
function
|
|
4606
|
+
var Yi = /* @__PURE__ */ Q({ default: () => Xi });
|
|
4607
|
+
function Xi({ value: e }) {
|
|
4503
4608
|
return /* @__PURE__ */ Y("div", {
|
|
4504
4609
|
className: "prose prose-sm max-w-none dark:prose-invert break-words",
|
|
4505
4610
|
children: /* @__PURE__ */ Y(tt, {
|
|
@@ -4509,10 +4614,10 @@ function Ki({ value: e }) {
|
|
|
4509
4614
|
})
|
|
4510
4615
|
});
|
|
4511
4616
|
}
|
|
4512
|
-
var
|
|
4513
|
-
st(), ut(), pt(), yt(), wt(), Dt(), At(), Nt(), Rt(), Vt(), Kn(),
|
|
4514
|
-
var
|
|
4515
|
-
function
|
|
4617
|
+
var Zi = Z((() => {}));
|
|
4618
|
+
st(), ut(), pt(), yt(), wt(), Dt(), At(), Nt(), Rt(), Vt(), Kn(), $n(), nr(), ar(), xr(), Pr(), ai(), ci(), di(), mi(), bi(), Ci(), ki(), Pt(), Pn(), st(), ut(), pt(), yt(), wt(), $n(), nr(), Dt(), At(), Nt(), Rt(), ar(), cr(), Vt(), Wt(), Kn(), tn(), dr(), vr(), xr(), wr(), Dr(), Ar(), Pr(), Lr(), Br(), ni(), ai(), ci(), di(), mi(), _i(), bi(), Ci(), Ei(), ki(), Mi(), Fi(), Ri(), Vi();
|
|
4619
|
+
var Qi = /* @__PURE__ */ new Map();
|
|
4620
|
+
function $i(e, t) {
|
|
4516
4621
|
if (!e || typeof e != "object") return;
|
|
4517
4622
|
if (t) {
|
|
4518
4623
|
let n = e[t];
|
|
@@ -4561,16 +4666,16 @@ function Yi(e, t) {
|
|
|
4561
4666
|
if (typeof n == "number") return String(n);
|
|
4562
4667
|
}
|
|
4563
4668
|
}
|
|
4564
|
-
function
|
|
4669
|
+
function ea(e) {
|
|
4565
4670
|
if (typeof e != "string" || !/^[A-Za-z0-9_-]{12,32}$/.test(e)) return !1;
|
|
4566
4671
|
let t = /[A-Z]/.test(e), n = /[a-z]/.test(e), r = /[0-9_-]/.test(e);
|
|
4567
4672
|
return t && n || t && r || n && r;
|
|
4568
4673
|
}
|
|
4569
|
-
function
|
|
4674
|
+
function ta(t, n) {
|
|
4570
4675
|
let r = e.useContext(Je)?.dataSource, [, i] = e.useState(0), a = !!t && !!r && typeof r.find == "function" && (typeof n == "string" || typeof n == "number") && n !== "", o = a ? `${t}:${String(n)}` : "";
|
|
4571
4676
|
if (e.useEffect(() => {
|
|
4572
4677
|
if (!a) return;
|
|
4573
|
-
let e =
|
|
4678
|
+
let e = Qi.get(o);
|
|
4574
4679
|
if (e && e.state !== "pending" && e.promise == null || e?.state === "pending") return;
|
|
4575
4680
|
let s = (async () => {
|
|
4576
4681
|
try {
|
|
@@ -4583,17 +4688,17 @@ function Zi(t, n) {
|
|
|
4583
4688
|
});
|
|
4584
4689
|
e = (Array.isArray(i) ? i : i?.value || i?.data || [])[0];
|
|
4585
4690
|
}
|
|
4586
|
-
let i =
|
|
4587
|
-
|
|
4691
|
+
let i = $i(e);
|
|
4692
|
+
Qi.set(o, {
|
|
4588
4693
|
state: "ok",
|
|
4589
4694
|
name: i
|
|
4590
4695
|
});
|
|
4591
4696
|
} catch {
|
|
4592
|
-
|
|
4697
|
+
Qi.set(o, { state: "err" });
|
|
4593
4698
|
}
|
|
4594
4699
|
i((e) => e + 1);
|
|
4595
4700
|
})();
|
|
4596
|
-
|
|
4701
|
+
Qi.set(o, {
|
|
4597
4702
|
state: "pending",
|
|
4598
4703
|
promise: s
|
|
4599
4704
|
});
|
|
@@ -4604,10 +4709,10 @@ function Zi(t, n) {
|
|
|
4604
4709
|
n,
|
|
4605
4710
|
r
|
|
4606
4711
|
]), !a) return;
|
|
4607
|
-
let s =
|
|
4712
|
+
let s = Qi.get(o);
|
|
4608
4713
|
return s?.state === "ok" ? s.name : void 0;
|
|
4609
4714
|
}
|
|
4610
|
-
function
|
|
4715
|
+
function na() {
|
|
4611
4716
|
try {
|
|
4612
4717
|
let { t: e } = Ze();
|
|
4613
4718
|
return (t, n) => {
|
|
@@ -4618,12 +4723,12 @@ function Qi() {
|
|
|
4618
4723
|
return (e, t) => t;
|
|
4619
4724
|
}
|
|
4620
4725
|
}
|
|
4621
|
-
function
|
|
4726
|
+
function ra(e) {
|
|
4622
4727
|
if (e == null || typeof e == "number" || typeof e == "boolean") return e;
|
|
4623
4728
|
if (typeof e == "string") {
|
|
4624
4729
|
let t = e.trim();
|
|
4625
4730
|
if (t.startsWith("{") && t.endsWith("}") || t.startsWith("[") && t.endsWith("]")) try {
|
|
4626
|
-
return
|
|
4731
|
+
return ra(JSON.parse(t));
|
|
4627
4732
|
} catch {}
|
|
4628
4733
|
return e;
|
|
4629
4734
|
}
|
|
@@ -4641,9 +4746,9 @@ function $i(e) {
|
|
|
4641
4746
|
}
|
|
4642
4747
|
return String(e);
|
|
4643
4748
|
}
|
|
4644
|
-
function
|
|
4749
|
+
function ia(e, t) {
|
|
4645
4750
|
let n = Number.isFinite(e) && e === Math.trunc(e) ? 0 : 2;
|
|
4646
|
-
if (!t) return
|
|
4751
|
+
if (!t) return oa(e, n);
|
|
4647
4752
|
try {
|
|
4648
4753
|
return new Intl.NumberFormat("en-US", {
|
|
4649
4754
|
style: "currency",
|
|
@@ -4655,7 +4760,7 @@ function ea(e, t) {
|
|
|
4655
4760
|
return `${t} ${e.toFixed(n)}`;
|
|
4656
4761
|
}
|
|
4657
4762
|
}
|
|
4658
|
-
function
|
|
4763
|
+
function aa(e, t) {
|
|
4659
4764
|
if (!t) try {
|
|
4660
4765
|
return new Intl.NumberFormat("en-US", {
|
|
4661
4766
|
notation: "compact",
|
|
@@ -4675,7 +4780,7 @@ function ta(e, t) {
|
|
|
4675
4780
|
return `${t} ${e}`;
|
|
4676
4781
|
}
|
|
4677
4782
|
}
|
|
4678
|
-
function
|
|
4783
|
+
function oa(e, t = 2) {
|
|
4679
4784
|
try {
|
|
4680
4785
|
return new Intl.NumberFormat("en-US", {
|
|
4681
4786
|
minimumFractionDigits: t,
|
|
@@ -4685,13 +4790,13 @@ function na(e, t = 2) {
|
|
|
4685
4790
|
return e.toFixed(t);
|
|
4686
4791
|
}
|
|
4687
4792
|
}
|
|
4688
|
-
function
|
|
4793
|
+
function sa(e, t = 0) {
|
|
4689
4794
|
return `${m(e).toFixed(t)}%`;
|
|
4690
4795
|
}
|
|
4691
|
-
function
|
|
4796
|
+
function ca(e) {
|
|
4692
4797
|
return e.replace(/[_-]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
4693
4798
|
}
|
|
4694
|
-
function
|
|
4799
|
+
function la(e, t) {
|
|
4695
4800
|
if (e == null || e === "") return "—";
|
|
4696
4801
|
let n = e instanceof Date ? e : new Date(e);
|
|
4697
4802
|
if (!(n instanceof Date) || isNaN(n.getTime())) return "—";
|
|
@@ -4701,16 +4806,16 @@ function aa(e, t) {
|
|
|
4701
4806
|
if (o === -1) return "Yesterday";
|
|
4702
4807
|
if (o < -1) {
|
|
4703
4808
|
let e = Math.abs(o);
|
|
4704
|
-
return e <= 7 ? t?.dueLike ? `Overdue ${e}d` : `${e}d ago` :
|
|
4809
|
+
return e <= 7 ? t?.dueLike ? `Overdue ${e}d` : `${e}d ago` : ua(n);
|
|
4705
4810
|
}
|
|
4706
|
-
return o > 1 && o <= 7 ? `In ${o} days` :
|
|
4811
|
+
return o > 1 && o <= 7 ? `In ${o} days` : ua(n);
|
|
4707
4812
|
}
|
|
4708
|
-
function
|
|
4813
|
+
function ua(e, t, n) {
|
|
4709
4814
|
if (e == null || e === "") return "—";
|
|
4710
4815
|
let r = e instanceof Date ? e : new Date(e);
|
|
4711
4816
|
if (!(r instanceof Date) || isNaN(r.getTime())) return "—";
|
|
4712
4817
|
if (t === "short") return `${r.toLocaleDateString("en-US", { month: "short" })} ${r.getDate()}, '${String(r.getFullYear()).slice(-2)}`;
|
|
4713
|
-
if (t === "relative") return
|
|
4818
|
+
if (t === "relative") return la(r, n);
|
|
4714
4819
|
let i = r.getFullYear() === (/* @__PURE__ */ new Date()).getFullYear();
|
|
4715
4820
|
return r.toLocaleDateString(void 0, {
|
|
4716
4821
|
year: i ? void 0 : "numeric",
|
|
@@ -4718,7 +4823,7 @@ function oa(e, t, n) {
|
|
|
4718
4823
|
day: "numeric"
|
|
4719
4824
|
});
|
|
4720
4825
|
}
|
|
4721
|
-
function
|
|
4826
|
+
function da(e) {
|
|
4722
4827
|
if (e == null || e === "") return "—";
|
|
4723
4828
|
let t = e instanceof Date ? e : new Date(e);
|
|
4724
4829
|
return !(t instanceof Date) || isNaN(t.getTime()) ? "—" : t.toLocaleDateString(void 0, {
|
|
@@ -4729,16 +4834,16 @@ function sa(e) {
|
|
|
4729
4834
|
minute: "2-digit"
|
|
4730
4835
|
});
|
|
4731
4836
|
}
|
|
4732
|
-
function
|
|
4733
|
-
let t =
|
|
4837
|
+
function fa({ value: e }) {
|
|
4838
|
+
let t = ra(e);
|
|
4734
4839
|
return t == null || t === "" ? /* @__PURE__ */ Y(N, {}) : /* @__PURE__ */ Y("span", {
|
|
4735
4840
|
className: "truncate",
|
|
4736
4841
|
children: String(t)
|
|
4737
4842
|
});
|
|
4738
4843
|
}
|
|
4739
|
-
function
|
|
4844
|
+
function pa({ value: e, field: t }) {
|
|
4740
4845
|
if (e == null) return /* @__PURE__ */ Y(N, {});
|
|
4741
|
-
let n =
|
|
4846
|
+
let n = ra(e), r = t, i = typeof r.scale == "number" ? r.scale : void 0, a = Number(n);
|
|
4742
4847
|
return /* @__PURE__ */ Y("span", {
|
|
4743
4848
|
className: "tabular-nums",
|
|
4744
4849
|
children: isNaN(a) ? String(n) : new Intl.NumberFormat("en-US", {
|
|
@@ -4747,23 +4852,23 @@ function la({ value: e, field: t }) {
|
|
|
4747
4852
|
}).format(a)
|
|
4748
4853
|
});
|
|
4749
4854
|
}
|
|
4750
|
-
function
|
|
4855
|
+
function ma({ value: e, field: t }) {
|
|
4751
4856
|
if (e == null) return /* @__PURE__ */ Y(N, {});
|
|
4752
|
-
let n =
|
|
4857
|
+
let n = ra(e), { currency: r } = b(), i = y(t, r), a = Number(n);
|
|
4753
4858
|
return /* @__PURE__ */ Y("span", {
|
|
4754
4859
|
className: "tabular-nums font-medium whitespace-nowrap",
|
|
4755
|
-
children: isNaN(a) ? String(n) :
|
|
4860
|
+
children: isNaN(a) ? String(n) : ia(a, i)
|
|
4756
4861
|
});
|
|
4757
4862
|
}
|
|
4758
|
-
var
|
|
4759
|
-
function
|
|
4863
|
+
var ha = /progress|completion/;
|
|
4864
|
+
function ga({ value: e, field: t }) {
|
|
4760
4865
|
if (e == null) return /* @__PURE__ */ Y(N, {});
|
|
4761
|
-
let n =
|
|
4866
|
+
let n = ra(e), r = t.precision ?? 0, i = Number(n);
|
|
4762
4867
|
if (isNaN(i)) return /* @__PURE__ */ Y("span", {
|
|
4763
4868
|
className: "tabular-nums whitespace-nowrap",
|
|
4764
4869
|
children: String(n)
|
|
4765
4870
|
});
|
|
4766
|
-
let a =
|
|
4871
|
+
let a = ha.test(t?.name?.toLowerCase() || ""), o = a ? i : i > -1 && i < 1 ? i * 100 : i, s = a ? `${i.toFixed(r)}%` : sa(i, r), c = Math.max(0, Math.min(100, o));
|
|
4767
4872
|
return /* @__PURE__ */ X("div", {
|
|
4768
4873
|
className: "flex items-center gap-2",
|
|
4769
4874
|
children: [/* @__PURE__ */ Y("div", {
|
|
@@ -4782,7 +4887,7 @@ function fa({ value: e, field: t }) {
|
|
|
4782
4887
|
})]
|
|
4783
4888
|
});
|
|
4784
4889
|
}
|
|
4785
|
-
var
|
|
4890
|
+
var _a = /* @__PURE__ */ new Set([
|
|
4786
4891
|
"active",
|
|
4787
4892
|
"is_active",
|
|
4788
4893
|
"enabled",
|
|
@@ -4790,7 +4895,7 @@ var pa = /* @__PURE__ */ new Set([
|
|
|
4790
4895
|
"verified",
|
|
4791
4896
|
"is_verified"
|
|
4792
4897
|
]);
|
|
4793
|
-
function
|
|
4898
|
+
function va({ value: e, field: t }) {
|
|
4794
4899
|
if (e == null) return /* @__PURE__ */ Y("span", {
|
|
4795
4900
|
className: "flex items-center justify-center",
|
|
4796
4901
|
children: /* @__PURE__ */ Y(N, {})
|
|
@@ -4810,11 +4915,11 @@ function ma({ value: e, field: t }) {
|
|
|
4810
4915
|
"aria-label": "Not completed",
|
|
4811
4916
|
"data-testid": "completion-indicator"
|
|
4812
4917
|
})
|
|
4813
|
-
}) :
|
|
4918
|
+
}) : _a.has(n) && !e ? /* @__PURE__ */ X(w, {
|
|
4814
4919
|
variant: "destructive",
|
|
4815
4920
|
className: "text-xs",
|
|
4816
4921
|
"data-testid": "boolean-warning-badge",
|
|
4817
|
-
children: [t?.label ||
|
|
4922
|
+
children: [t?.label || ca(n), " — Off"]
|
|
4818
4923
|
}) : /* @__PURE__ */ Y("div", {
|
|
4819
4924
|
className: "flex items-center justify-start",
|
|
4820
4925
|
children: /* @__PURE__ */ Y(E, {
|
|
@@ -4824,9 +4929,9 @@ function ma({ value: e, field: t }) {
|
|
|
4824
4929
|
})
|
|
4825
4930
|
});
|
|
4826
4931
|
}
|
|
4827
|
-
function
|
|
4932
|
+
function ya({ value: e, field: t }) {
|
|
4828
4933
|
if (!e) return /* @__PURE__ */ Y(N, {});
|
|
4829
|
-
let n =
|
|
4934
|
+
let n = ra(e), r = t, i = r.format || "relative", a = String(r?.name || r?.accessorKey || r?.key || "").toLowerCase(), o = r?.dueLike === !0 || /(^|_)(due|deadline|expires?|expiry|expiration|expected_close|target_close|sla|return_by|renewal|next_action)(_|$)/.test(a), s = ua(n, i, { dueLike: o }), c = n == null ? null : new Date(n), l = c !== null && !isNaN(c.getTime()), u = /* @__PURE__ */ new Date();
|
|
4830
4935
|
u.setHours(0, 0, 0, 0);
|
|
4831
4936
|
let d = o && l && c < u, f = l ? c.toISOString() : String(n);
|
|
4832
4937
|
return /* @__PURE__ */ Y("span", {
|
|
@@ -4835,9 +4940,9 @@ function ha({ value: e, field: t }) {
|
|
|
4835
4940
|
children: s
|
|
4836
4941
|
});
|
|
4837
4942
|
}
|
|
4838
|
-
function
|
|
4943
|
+
function ba({ value: e }) {
|
|
4839
4944
|
if (!e) return /* @__PURE__ */ Y(N, {});
|
|
4840
|
-
let t =
|
|
4945
|
+
let t = ra(e), n = t == null ? null : new Date(t);
|
|
4841
4946
|
if (n === null || isNaN(n.getTime())) return /* @__PURE__ */ Y(N, {});
|
|
4842
4947
|
let r = n.toLocaleDateString(void 0, {
|
|
4843
4948
|
month: "numeric",
|
|
@@ -4856,7 +4961,7 @@ function ga({ value: e }) {
|
|
|
4856
4961
|
})]
|
|
4857
4962
|
});
|
|
4858
4963
|
}
|
|
4859
|
-
var
|
|
4964
|
+
var xa = {
|
|
4860
4965
|
critical: "red",
|
|
4861
4966
|
urgent: "red",
|
|
4862
4967
|
high: "orange",
|
|
@@ -4931,7 +5036,7 @@ var _a = {
|
|
|
4931
5036
|
逾期: "red",
|
|
4932
5037
|
流失: "red",
|
|
4933
5038
|
丢失: "red"
|
|
4934
|
-
},
|
|
5039
|
+
}, Sa = {
|
|
4935
5040
|
gray: "bg-gray-50 text-gray-700 border-gray-200 dark:bg-gray-800/50 dark:text-gray-200 dark:border-gray-700/60",
|
|
4936
5041
|
red: "bg-red-50 text-red-700 border-red-200 dark:bg-red-950/40 dark:text-red-300 dark:border-red-900/60",
|
|
4937
5042
|
orange: "bg-orange-50 text-orange-700 border-orange-200 dark:bg-orange-950/40 dark:text-orange-300 dark:border-orange-900/60",
|
|
@@ -4941,7 +5046,7 @@ var _a = {
|
|
|
4941
5046
|
indigo: "bg-indigo-50 text-indigo-700 border-indigo-200 dark:bg-indigo-950/40 dark:text-indigo-300 dark:border-indigo-900/60",
|
|
4942
5047
|
purple: "bg-purple-50 text-purple-700 border-purple-200 dark:bg-purple-950/40 dark:text-purple-300 dark:border-purple-900/60",
|
|
4943
5048
|
pink: "bg-pink-50 text-pink-700 border-pink-200 dark:bg-pink-950/40 dark:text-pink-300 dark:border-pink-900/60"
|
|
4944
|
-
},
|
|
5049
|
+
}, Ca = {
|
|
4945
5050
|
gray: "bg-gray-400 dark:bg-gray-500",
|
|
4946
5051
|
red: "bg-red-500",
|
|
4947
5052
|
orange: "bg-orange-500",
|
|
@@ -4951,7 +5056,7 @@ var _a = {
|
|
|
4951
5056
|
indigo: "bg-indigo-500",
|
|
4952
5057
|
purple: "bg-purple-500",
|
|
4953
5058
|
pink: "bg-pink-500"
|
|
4954
|
-
},
|
|
5059
|
+
}, wa = [
|
|
4955
5060
|
"blue",
|
|
4956
5061
|
"green",
|
|
4957
5062
|
"purple",
|
|
@@ -4961,12 +5066,12 @@ var _a = {
|
|
|
4961
5066
|
"yellow",
|
|
4962
5067
|
"red"
|
|
4963
5068
|
];
|
|
4964
|
-
function
|
|
5069
|
+
function Ta(e) {
|
|
4965
5070
|
let t = 5381;
|
|
4966
5071
|
for (let n = 0; n < e.length; n++) t = (t << 5) + t ^ e.charCodeAt(n);
|
|
4967
|
-
return
|
|
5072
|
+
return wa[Math.abs(t) % wa.length];
|
|
4968
5073
|
}
|
|
4969
|
-
function
|
|
5074
|
+
function Ea(e) {
|
|
4970
5075
|
let t = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.exec(e.trim());
|
|
4971
5076
|
if (!t) return;
|
|
4972
5077
|
let n = t[1];
|
|
@@ -4976,27 +5081,27 @@ function Sa(e) {
|
|
|
4976
5081
|
let u;
|
|
4977
5082
|
return u = o === r ? ((i - a) / c % 6 + 6) % 6 : o === i ? (a - r) / c + 2 : (r - i) / c + 4, u *= 60, u >= 345 || u < 15 ? "red" : u < 30 ? "orange" : u < 60 ? "yellow" : u < 170 ? "green" : u < 238 ? "blue" : u < 250 ? "indigo" : u < 295 ? "purple" : "pink";
|
|
4978
5083
|
}
|
|
4979
|
-
function
|
|
5084
|
+
function Da(e) {
|
|
4980
5085
|
if (e) {
|
|
4981
|
-
if (
|
|
4982
|
-
if (e.charAt(0) === "#") return
|
|
5086
|
+
if (Sa[e]) return e;
|
|
5087
|
+
if (e.charAt(0) === "#") return Ea(e);
|
|
4983
5088
|
}
|
|
4984
5089
|
}
|
|
4985
|
-
function
|
|
4986
|
-
let n =
|
|
4987
|
-
if (n &&
|
|
5090
|
+
function Oa(e, t) {
|
|
5091
|
+
let n = Da(e);
|
|
5092
|
+
if (n && Sa[n]) return Sa[n];
|
|
4988
5093
|
if (t == null || t === "") return "bg-muted text-muted-foreground border-border";
|
|
4989
|
-
let r = String(t).toLowerCase().replace(/[\s-]/g, "_"), i =
|
|
4990
|
-
return i &&
|
|
5094
|
+
let r = String(t).toLowerCase().replace(/[\s-]/g, "_"), i = xa[r];
|
|
5095
|
+
return i && Sa[i] ? Sa[i] : Sa[Ta(r)];
|
|
4991
5096
|
}
|
|
4992
|
-
function
|
|
4993
|
-
let n =
|
|
4994
|
-
if (n &&
|
|
5097
|
+
function ka(e, t) {
|
|
5098
|
+
let n = Da(e);
|
|
5099
|
+
if (n && Sa[n]) return n;
|
|
4995
5100
|
if (t == null || t === "") return;
|
|
4996
5101
|
let r = String(t).toLowerCase().replace(/[\s-]/g, "_");
|
|
4997
|
-
return
|
|
5102
|
+
return xa[r] || Ta(r);
|
|
4998
5103
|
}
|
|
4999
|
-
var
|
|
5104
|
+
var Aa = {
|
|
5000
5105
|
gray: "#6b7280",
|
|
5001
5106
|
red: "#ef4444",
|
|
5002
5107
|
orange: "#f97316",
|
|
@@ -5007,10 +5112,10 @@ var Ea = {
|
|
|
5007
5112
|
purple: "#a855f7",
|
|
5008
5113
|
pink: "#ec4899"
|
|
5009
5114
|
};
|
|
5010
|
-
function
|
|
5011
|
-
return e ?
|
|
5115
|
+
function ja(e, t = "#3b82f6") {
|
|
5116
|
+
return e ? Aa[e] ?? t : t;
|
|
5012
5117
|
}
|
|
5013
|
-
function
|
|
5118
|
+
function Ma({ value: e, field: t }) {
|
|
5014
5119
|
let n = t, r = n.options || [], i = n.appearance === "dot" ? "dot" : "badge";
|
|
5015
5120
|
if (e == null || e === "") return /* @__PURE__ */ Y(N, {});
|
|
5016
5121
|
let a = (e) => {
|
|
@@ -5019,11 +5124,11 @@ function Oa({ value: e, field: t }) {
|
|
|
5019
5124
|
let n = String(e).toLowerCase();
|
|
5020
5125
|
return r.find((e) => String(e.value).toLowerCase() === n);
|
|
5021
5126
|
}, o = (e, t) => {
|
|
5022
|
-
let n = a(e), r = n?.label ||
|
|
5127
|
+
let n = a(e), r = n?.label || ca(String(e));
|
|
5023
5128
|
return i === "dot" ? /* @__PURE__ */ X("span", {
|
|
5024
5129
|
className: "inline-flex items-center gap-1.5 text-sm",
|
|
5025
5130
|
children: [/* @__PURE__ */ Y("span", {
|
|
5026
|
-
className: G("h-1.5 w-1.5 rounded-full shrink-0",
|
|
5131
|
+
className: G("h-1.5 w-1.5 rounded-full shrink-0", Ca[Da(n?.color) || xa[String(e).toLowerCase().replace(/[\s-]/g, "_")] || Ta(String(e).toLowerCase().replace(/[\s-]/g, "_"))] || Ca.gray),
|
|
5027
5132
|
"aria-hidden": "true"
|
|
5028
5133
|
}), /* @__PURE__ */ Y("span", {
|
|
5029
5134
|
className: "truncate",
|
|
@@ -5031,7 +5136,7 @@ function Oa({ value: e, field: t }) {
|
|
|
5031
5136
|
})]
|
|
5032
5137
|
}, t) : /* @__PURE__ */ Y(w, {
|
|
5033
5138
|
variant: "outline",
|
|
5034
|
-
className:
|
|
5139
|
+
className: Oa(n?.color, e),
|
|
5035
5140
|
children: r
|
|
5036
5141
|
}, t);
|
|
5037
5142
|
};
|
|
@@ -5040,9 +5145,9 @@ function Oa({ value: e, field: t }) {
|
|
|
5040
5145
|
children: e.map((e, t) => o(e, t))
|
|
5041
5146
|
}) : o(e);
|
|
5042
5147
|
}
|
|
5043
|
-
function
|
|
5148
|
+
function Na({ value: t }) {
|
|
5044
5149
|
if (!t) return /* @__PURE__ */ Y(N, {});
|
|
5045
|
-
let n =
|
|
5150
|
+
let n = na(), r = String(ra(t) ?? ""), [i, a] = e.useState(!1);
|
|
5046
5151
|
return /* @__PURE__ */ X("span", {
|
|
5047
5152
|
className: "inline-flex items-center gap-1 group/email",
|
|
5048
5153
|
children: [/* @__PURE__ */ Y(T, {
|
|
@@ -5067,9 +5172,9 @@ function ka({ value: t }) {
|
|
|
5067
5172
|
})]
|
|
5068
5173
|
});
|
|
5069
5174
|
}
|
|
5070
|
-
function
|
|
5175
|
+
function Pa({ value: e }) {
|
|
5071
5176
|
if (!e) return /* @__PURE__ */ Y(N, {});
|
|
5072
|
-
let t = String(
|
|
5177
|
+
let t = String(ra(e) ?? "");
|
|
5073
5178
|
return /* @__PURE__ */ Y(T, {
|
|
5074
5179
|
variant: "link",
|
|
5075
5180
|
className: "p-0 h-auto font-normal text-blue-600 hover:text-blue-800",
|
|
@@ -5083,9 +5188,9 @@ function Aa({ value: e }) {
|
|
|
5083
5188
|
})
|
|
5084
5189
|
});
|
|
5085
5190
|
}
|
|
5086
|
-
function
|
|
5191
|
+
function Fa({ value: t }) {
|
|
5087
5192
|
if (!t) return /* @__PURE__ */ Y(N, {});
|
|
5088
|
-
let n =
|
|
5193
|
+
let n = na(), r = String(ra(t) ?? ""), [i, a] = e.useState(!1);
|
|
5089
5194
|
return /* @__PURE__ */ X("span", {
|
|
5090
5195
|
className: "inline-flex items-center gap-1 group/phone",
|
|
5091
5196
|
children: [/* @__PURE__ */ X("a", {
|
|
@@ -5106,7 +5211,7 @@ function ja({ value: t }) {
|
|
|
5106
5211
|
})]
|
|
5107
5212
|
});
|
|
5108
5213
|
}
|
|
5109
|
-
function
|
|
5214
|
+
function Ia({ value: e, field: t }) {
|
|
5110
5215
|
if (!e) return /* @__PURE__ */ Y(N, {});
|
|
5111
5216
|
if (t.multiple, Array.isArray(e)) {
|
|
5112
5217
|
let t = e.length;
|
|
@@ -5124,7 +5229,7 @@ function Ma({ value: e, field: t }) {
|
|
|
5124
5229
|
children: e.name || e.original_name || "File"
|
|
5125
5230
|
});
|
|
5126
5231
|
}
|
|
5127
|
-
function
|
|
5232
|
+
function La({ value: e }) {
|
|
5128
5233
|
if (!e) return /* @__PURE__ */ Y(N, {});
|
|
5129
5234
|
let t = (e) => typeof e == "string" ? e : e?.url || e?.src || e?.href || e?.thumbnailUrl || "", n = (e, t) => e && typeof e == "object" && (e.name || e.original_name) || t;
|
|
5130
5235
|
if (Array.isArray(e)) {
|
|
@@ -5151,18 +5256,18 @@ function Na({ value: e }) {
|
|
|
5151
5256
|
className: "size-10 rounded-md object-cover"
|
|
5152
5257
|
}) : /* @__PURE__ */ Y(N, {});
|
|
5153
5258
|
}
|
|
5154
|
-
function
|
|
5259
|
+
function Ra({ value: e, field: t }) {
|
|
5155
5260
|
let n = t.reference_to || t.reference, r = (() => {
|
|
5156
5261
|
if (Array.isArray(e)) return e.find((e) => e != null && (typeof e == "string" || typeof e == "number") && e !== "");
|
|
5157
5262
|
if (e != null && e !== "" && (typeof e == "string" || typeof e == "number") && typeof e != "object") return e;
|
|
5158
|
-
})(), i =
|
|
5263
|
+
})(), i = ta(n, r);
|
|
5159
5264
|
if (e == null || e === "") return /* @__PURE__ */ Y(N, {});
|
|
5160
5265
|
if (typeof e == "string") {
|
|
5161
5266
|
let t = e.trim();
|
|
5162
5267
|
if (t.startsWith("{") && t.endsWith("}")) try {
|
|
5163
5268
|
let e = JSON.parse(t);
|
|
5164
5269
|
if (e && typeof e == "object") {
|
|
5165
|
-
let t =
|
|
5270
|
+
let t = $i(e) || String(e.externalId ?? e.id ?? e._id ?? "");
|
|
5166
5271
|
if (t) return /* @__PURE__ */ Y("span", {
|
|
5167
5272
|
className: "truncate",
|
|
5168
5273
|
children: t
|
|
@@ -5171,7 +5276,7 @@ function Pa({ value: e, field: t }) {
|
|
|
5171
5276
|
} catch {}
|
|
5172
5277
|
}
|
|
5173
5278
|
if (!Array.isArray(e) && typeof e == "object") {
|
|
5174
|
-
let t = e, n =
|
|
5279
|
+
let t = e, n = $i(t) || String(t.id || t._id || "");
|
|
5175
5280
|
if (n) return /* @__PURE__ */ Y("span", {
|
|
5176
5281
|
className: "truncate",
|
|
5177
5282
|
children: n
|
|
@@ -5188,7 +5293,7 @@ function Pa({ value: e, field: t }) {
|
|
|
5188
5293
|
return e === r && i ? {
|
|
5189
5294
|
text: i,
|
|
5190
5295
|
muted: !1
|
|
5191
|
-
} :
|
|
5296
|
+
} : ea(e) ? {
|
|
5192
5297
|
text: "—",
|
|
5193
5298
|
muted: !0
|
|
5194
5299
|
} : {
|
|
@@ -5200,7 +5305,7 @@ function Pa({ value: e, field: t }) {
|
|
|
5200
5305
|
className: "flex flex-wrap gap-1",
|
|
5201
5306
|
children: e.map((e, t) => {
|
|
5202
5307
|
let n, r = !1;
|
|
5203
|
-
if (typeof e == "object" && e) n =
|
|
5308
|
+
if (typeof e == "object" && e) n = $i(e) || String(e.id || e._id || "[Object]");
|
|
5204
5309
|
else {
|
|
5205
5310
|
let t = o(e);
|
|
5206
5311
|
n = t.text, r = t.muted;
|
|
@@ -5213,7 +5318,7 @@ function Pa({ value: e, field: t }) {
|
|
|
5213
5318
|
});
|
|
5214
5319
|
if (typeof e == "object" && e) return /* @__PURE__ */ Y("span", {
|
|
5215
5320
|
className: "truncate",
|
|
5216
|
-
children:
|
|
5321
|
+
children: $i(e) || String(e.id || e._id || "[Object]")
|
|
5217
5322
|
});
|
|
5218
5323
|
let { text: s, muted: c } = o(e);
|
|
5219
5324
|
return /* @__PURE__ */ Y("span", {
|
|
@@ -5221,14 +5326,14 @@ function Pa({ value: e, field: t }) {
|
|
|
5221
5326
|
children: s
|
|
5222
5327
|
});
|
|
5223
5328
|
}
|
|
5224
|
-
function
|
|
5225
|
-
let t =
|
|
5329
|
+
function za({ value: e }) {
|
|
5330
|
+
let t = ra(e);
|
|
5226
5331
|
return t == null || t === "" ? /* @__PURE__ */ Y(N, {}) : /* @__PURE__ */ Y("span", {
|
|
5227
5332
|
className: "text-gray-700 font-mono text-sm",
|
|
5228
5333
|
children: String(t)
|
|
5229
5334
|
});
|
|
5230
5335
|
}
|
|
5231
|
-
function
|
|
5336
|
+
function Ba({ value: e }) {
|
|
5232
5337
|
if (!e) return /* @__PURE__ */ Y(N, {});
|
|
5233
5338
|
if (typeof e != "object") return /* @__PURE__ */ Y("span", {
|
|
5234
5339
|
className: "truncate",
|
|
@@ -5279,11 +5384,11 @@ function Ia({ value: e }) {
|
|
|
5279
5384
|
})]
|
|
5280
5385
|
});
|
|
5281
5386
|
}
|
|
5282
|
-
var
|
|
5283
|
-
function
|
|
5284
|
-
|
|
5387
|
+
var Va = /* @__PURE__ */ new Map();
|
|
5388
|
+
function Ha(e, t) {
|
|
5389
|
+
Va.set(e, t);
|
|
5285
5390
|
}
|
|
5286
|
-
var
|
|
5391
|
+
var Ua = {
|
|
5287
5392
|
phone: "phone",
|
|
5288
5393
|
tel: "phone",
|
|
5289
5394
|
telephone: "phone",
|
|
@@ -5295,20 +5400,20 @@ var za = {
|
|
|
5295
5400
|
money: "currency",
|
|
5296
5401
|
percent: "percent",
|
|
5297
5402
|
percentage: "percent"
|
|
5298
|
-
},
|
|
5403
|
+
}, Wa = /* @__PURE__ */ new Set([
|
|
5299
5404
|
"text",
|
|
5300
5405
|
"textarea",
|
|
5301
5406
|
"string",
|
|
5302
5407
|
"longtext",
|
|
5303
5408
|
""
|
|
5304
5409
|
]);
|
|
5305
|
-
function
|
|
5410
|
+
function Ga(e) {
|
|
5306
5411
|
if (!e) return "text";
|
|
5307
5412
|
if (typeof e == "string") return e;
|
|
5308
5413
|
let t = (e.type || "").toLowerCase(), n = e.format, r = typeof n == "string" ? n.toLowerCase() : "";
|
|
5309
|
-
return r &&
|
|
5414
|
+
return r && Ua[r] && Wa.has(t) ? Ua[r] : e.type || "text";
|
|
5310
5415
|
}
|
|
5311
|
-
function
|
|
5416
|
+
function Ka({ value: e }) {
|
|
5312
5417
|
if (e == null || e === "") return /* @__PURE__ */ Y(N, {});
|
|
5313
5418
|
let t;
|
|
5314
5419
|
if (typeof e == "object") try {
|
|
@@ -5323,7 +5428,7 @@ function Ha({ value: e }) {
|
|
|
5323
5428
|
children: t
|
|
5324
5429
|
});
|
|
5325
5430
|
}
|
|
5326
|
-
function
|
|
5431
|
+
function qa({ value: e }) {
|
|
5327
5432
|
if (e == null || e === "") return /* @__PURE__ */ Y(N, {});
|
|
5328
5433
|
let t = String(e);
|
|
5329
5434
|
return /* @__PURE__ */ X("span", {
|
|
@@ -5338,26 +5443,26 @@ function Ua({ value: e }) {
|
|
|
5338
5443
|
})]
|
|
5339
5444
|
});
|
|
5340
5445
|
}
|
|
5341
|
-
var
|
|
5342
|
-
function
|
|
5446
|
+
var Ja = e.lazy(() => Promise.resolve().then(() => (Zi(), Yi)));
|
|
5447
|
+
function Ya({ value: t }) {
|
|
5343
5448
|
return t == null || t === "" ? /* @__PURE__ */ Y(N, {}) : /* @__PURE__ */ Y(e.Suspense, {
|
|
5344
5449
|
fallback: /* @__PURE__ */ Y("span", {
|
|
5345
5450
|
className: "text-sm text-muted-foreground",
|
|
5346
5451
|
children: String(t).slice(0, 80)
|
|
5347
5452
|
}),
|
|
5348
|
-
children: /* @__PURE__ */ Y(
|
|
5453
|
+
children: /* @__PURE__ */ Y(Ja, { value: String(t) })
|
|
5349
5454
|
});
|
|
5350
5455
|
}
|
|
5351
|
-
function
|
|
5456
|
+
function Xa(e) {
|
|
5352
5457
|
return e.replace(/<\s*(script|style|iframe|object|embed)[^>]*>[\s\S]*?<\s*\/\s*\1\s*>/gi, "").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/(href|src)\s*=\s*("javascript:[^"]*"|'javascript:[^']*')/gi, "$1=\"#\"");
|
|
5353
5458
|
}
|
|
5354
|
-
function
|
|
5459
|
+
function Za({ value: e }) {
|
|
5355
5460
|
return e == null || e === "" ? /* @__PURE__ */ Y(N, {}) : /* @__PURE__ */ Y("div", {
|
|
5356
5461
|
className: "prose prose-sm max-w-none dark:prose-invert break-words",
|
|
5357
|
-
dangerouslySetInnerHTML: { __html:
|
|
5462
|
+
dangerouslySetInnerHTML: { __html: Xa(String(e)) }
|
|
5358
5463
|
});
|
|
5359
5464
|
}
|
|
5360
|
-
function
|
|
5465
|
+
function Qa({ value: e }) {
|
|
5361
5466
|
if (e == null || e === "") return /* @__PURE__ */ Y(N, {});
|
|
5362
5467
|
let t, n;
|
|
5363
5468
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
@@ -5379,64 +5484,64 @@ function Ja({ value: e }) {
|
|
|
5379
5484
|
", ",
|
|
5380
5485
|
n.toFixed(4)
|
|
5381
5486
|
]
|
|
5382
|
-
}) : /* @__PURE__ */ Y(
|
|
5487
|
+
}) : /* @__PURE__ */ Y(Ka, {
|
|
5383
5488
|
value: e,
|
|
5384
5489
|
field: {}
|
|
5385
5490
|
});
|
|
5386
5491
|
}
|
|
5387
|
-
function
|
|
5388
|
-
return
|
|
5389
|
-
text:
|
|
5390
|
-
textarea:
|
|
5391
|
-
markdown:
|
|
5392
|
-
html:
|
|
5393
|
-
richtext:
|
|
5394
|
-
code:
|
|
5395
|
-
qrcode:
|
|
5396
|
-
number:
|
|
5397
|
-
currency:
|
|
5398
|
-
percent:
|
|
5399
|
-
progress:
|
|
5400
|
-
slider:
|
|
5401
|
-
rating:
|
|
5402
|
-
boolean:
|
|
5403
|
-
toggle:
|
|
5404
|
-
date:
|
|
5405
|
-
datetime:
|
|
5406
|
-
time:
|
|
5407
|
-
select:
|
|
5408
|
-
status:
|
|
5409
|
-
multiselect:
|
|
5410
|
-
radio:
|
|
5411
|
-
checkboxes:
|
|
5412
|
-
tags:
|
|
5413
|
-
lookup:
|
|
5414
|
-
master_detail:
|
|
5415
|
-
tree:
|
|
5416
|
-
email:
|
|
5417
|
-
url:
|
|
5418
|
-
phone:
|
|
5419
|
-
file:
|
|
5420
|
-
video:
|
|
5421
|
-
audio:
|
|
5422
|
-
image:
|
|
5423
|
-
avatar:
|
|
5424
|
-
signature:
|
|
5425
|
-
formula:
|
|
5426
|
-
summary:
|
|
5427
|
-
auto_number:
|
|
5428
|
-
user:
|
|
5429
|
-
owner:
|
|
5492
|
+
function $a(e) {
|
|
5493
|
+
return Va.has(e) ? Va.get(e) : {
|
|
5494
|
+
text: fa,
|
|
5495
|
+
textarea: fa,
|
|
5496
|
+
markdown: Ya,
|
|
5497
|
+
html: Za,
|
|
5498
|
+
richtext: Ya,
|
|
5499
|
+
code: fa,
|
|
5500
|
+
qrcode: fa,
|
|
5501
|
+
number: pa,
|
|
5502
|
+
currency: ma,
|
|
5503
|
+
percent: ga,
|
|
5504
|
+
progress: ga,
|
|
5505
|
+
slider: pa,
|
|
5506
|
+
rating: pa,
|
|
5507
|
+
boolean: va,
|
|
5508
|
+
toggle: va,
|
|
5509
|
+
date: ya,
|
|
5510
|
+
datetime: ba,
|
|
5511
|
+
time: fa,
|
|
5512
|
+
select: Ma,
|
|
5513
|
+
status: Ma,
|
|
5514
|
+
multiselect: Ma,
|
|
5515
|
+
radio: Ma,
|
|
5516
|
+
checkboxes: Ma,
|
|
5517
|
+
tags: Ma,
|
|
5518
|
+
lookup: Ra,
|
|
5519
|
+
master_detail: Ra,
|
|
5520
|
+
tree: Ra,
|
|
5521
|
+
email: Na,
|
|
5522
|
+
url: Pa,
|
|
5523
|
+
phone: Fa,
|
|
5524
|
+
file: Ia,
|
|
5525
|
+
video: Ia,
|
|
5526
|
+
audio: Ia,
|
|
5527
|
+
image: La,
|
|
5528
|
+
avatar: La,
|
|
5529
|
+
signature: La,
|
|
5530
|
+
formula: za,
|
|
5531
|
+
summary: za,
|
|
5532
|
+
auto_number: fa,
|
|
5533
|
+
user: Ba,
|
|
5534
|
+
owner: Ba,
|
|
5430
5535
|
password: () => /* @__PURE__ */ Y("span", { children: "••••••" }),
|
|
5431
5536
|
secret: () => /* @__PURE__ */ Y("span", { children: "••••••" }),
|
|
5432
|
-
location:
|
|
5433
|
-
geolocation:
|
|
5434
|
-
address:
|
|
5435
|
-
color:
|
|
5436
|
-
json:
|
|
5437
|
-
object:
|
|
5438
|
-
composite:
|
|
5439
|
-
record:
|
|
5537
|
+
location: Qa,
|
|
5538
|
+
geolocation: Qa,
|
|
5539
|
+
address: Ka,
|
|
5540
|
+
color: qa,
|
|
5541
|
+
json: Ka,
|
|
5542
|
+
object: Ka,
|
|
5543
|
+
composite: Ka,
|
|
5544
|
+
record: Ka,
|
|
5440
5545
|
repeater: ({ value: e }) => {
|
|
5441
5546
|
let t = Array.isArray(e) ? e.length : 0;
|
|
5442
5547
|
return t > 0 ? /* @__PURE__ */ X("span", {
|
|
@@ -5452,10 +5557,10 @@ function Ya(e) {
|
|
|
5452
5557
|
className: "text-gray-500 italic",
|
|
5453
5558
|
children: "[Grid]"
|
|
5454
5559
|
})
|
|
5455
|
-
}[e] ||
|
|
5560
|
+
}[e] || fa;
|
|
5456
5561
|
}
|
|
5457
|
-
|
|
5458
|
-
function
|
|
5562
|
+
Ha("lookup", Ra), Ha("master_detail", Ra), Ha("select", Ma), Ha("status", Ma), Ha("user", Ba), Ha("owner", Ba), jn($a);
|
|
5563
|
+
function eo(e) {
|
|
5459
5564
|
return {
|
|
5460
5565
|
text: "field:text",
|
|
5461
5566
|
textarea: "field:textarea",
|
|
@@ -5511,7 +5616,7 @@ function Xa(e) {
|
|
|
5511
5616
|
auto_number: "field:auto_number"
|
|
5512
5617
|
}[e] || "field:text";
|
|
5513
5618
|
}
|
|
5514
|
-
function
|
|
5619
|
+
function to(e) {
|
|
5515
5620
|
if (e < 0 || !Number.isFinite(e) || e === 0) return "0 B";
|
|
5516
5621
|
let t = [
|
|
5517
5622
|
"B",
|
|
@@ -5523,7 +5628,7 @@ function Za(e) {
|
|
|
5523
5628
|
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r++;
|
|
5524
5629
|
return `${n.toFixed(+(r > 0))} ${t[r]}`;
|
|
5525
5630
|
}
|
|
5526
|
-
function
|
|
5631
|
+
function no(e) {
|
|
5527
5632
|
let t = {};
|
|
5528
5633
|
return e.required && (t.required = typeof e.required_message == "string" ? e.required_message : !0), e.min_length && (t.minLength = {
|
|
5529
5634
|
value: e.min_length,
|
|
@@ -5555,7 +5660,7 @@ function Qa(e) {
|
|
|
5555
5660
|
messageKey: "validation.url"
|
|
5556
5661
|
}), e.validate && (t.validate = e.validate), Object.keys(t).length > 0 ? t : void 0;
|
|
5557
5662
|
}
|
|
5558
|
-
function
|
|
5663
|
+
function ro(e, t) {
|
|
5559
5664
|
if (!e) return !0;
|
|
5560
5665
|
if (e.field && e.value !== void 0) {
|
|
5561
5666
|
let n = t[e.field];
|
|
@@ -5567,7 +5672,7 @@ function $a(e, t) {
|
|
|
5567
5672
|
if (e.operator === "<=") return n <= e.value;
|
|
5568
5673
|
if (e.operator === "in") return Array.isArray(e.value) && e.value.includes(n);
|
|
5569
5674
|
}
|
|
5570
|
-
return e.and && Array.isArray(e.and) ? e.and.every((e) =>
|
|
5675
|
+
return e.and && Array.isArray(e.and) ? e.and.every((e) => ro(e, t)) : e.or && Array.isArray(e.or) ? e.or.some((e) => ro(e, t)) : !0;
|
|
5571
5676
|
}
|
|
5572
5677
|
function $(t) {
|
|
5573
5678
|
let n = ({ schema: n, className: r, value: i, ...a }) => {
|
|
@@ -5611,51 +5716,51 @@ function $(t) {
|
|
|
5611
5716
|
};
|
|
5612
5717
|
return n.displayName = `FieldRenderer(${t.displayName || t.name || "Component"})`, n;
|
|
5613
5718
|
}
|
|
5614
|
-
var
|
|
5719
|
+
var io = {
|
|
5615
5720
|
text: () => Promise.resolve().then(() => (st(), at)).then((e) => ({ default: e.TextField })),
|
|
5616
5721
|
textarea: () => Promise.resolve().then(() => (Vt(), zt)).then((e) => ({ default: e.TextAreaField })),
|
|
5617
5722
|
number: () => Promise.resolve().then(() => (ut(), ct)).then((e) => ({ default: e.NumberField })),
|
|
5618
5723
|
boolean: () => Promise.resolve().then(() => (pt(), dt)).then((e) => ({ default: e.BooleanField })),
|
|
5619
5724
|
select: () => Promise.resolve().then(() => (yt(), _t)).then((e) => ({ default: e.SelectField })),
|
|
5620
5725
|
date: () => Promise.resolve().then(() => (wt(), St)).then((e) => ({ default: e.DateField })),
|
|
5621
|
-
datetime: () => Promise.resolve().then(() => (
|
|
5622
|
-
time: () => Promise.resolve().then(() => (
|
|
5726
|
+
datetime: () => Promise.resolve().then(() => ($n(), Zn)).then((e) => ({ default: e.DateTimeField })),
|
|
5727
|
+
time: () => Promise.resolve().then(() => (nr(), er)).then((e) => ({ default: e.TimeField })),
|
|
5623
5728
|
email: () => Promise.resolve().then(() => (Dt(), Tt)).then((e) => ({ default: e.EmailField })),
|
|
5624
5729
|
phone: () => Promise.resolve().then(() => (At(), Ot)).then((e) => ({ default: e.PhoneField })),
|
|
5625
5730
|
url: () => Promise.resolve().then(() => (Nt(), jt)).then((e) => ({ default: e.UrlField })),
|
|
5626
|
-
multiselect: () => Promise.resolve().then(() => (
|
|
5627
|
-
radio: () => Promise.resolve().then(() => (
|
|
5628
|
-
checkboxes: () => Promise.resolve().then(() => (
|
|
5629
|
-
tags: () => Promise.resolve().then(() => (
|
|
5731
|
+
multiselect: () => Promise.resolve().then(() => (Mi(), Ai)).then((e) => ({ default: e.MultiSelectField })),
|
|
5732
|
+
radio: () => Promise.resolve().then(() => (Fi(), Ni)).then((e) => ({ default: e.RadioField })),
|
|
5733
|
+
checkboxes: () => Promise.resolve().then(() => (Ri(), Ii)).then((e) => ({ default: e.CheckboxesField })),
|
|
5734
|
+
tags: () => Promise.resolve().then(() => (Vi(), zi)).then((e) => ({ default: e.TagsField })),
|
|
5630
5735
|
currency: () => Promise.resolve().then(() => (Rt(), Ft)).then((e) => ({ default: e.CurrencyField })),
|
|
5631
|
-
percent: () => Promise.resolve().then(() => (
|
|
5632
|
-
password: () => Promise.resolve().then(() => (
|
|
5736
|
+
percent: () => Promise.resolve().then(() => (ar(), rr)).then((e) => ({ default: e.PercentField })),
|
|
5737
|
+
password: () => Promise.resolve().then(() => (cr(), or)).then((e) => ({ default: e.PasswordField })),
|
|
5633
5738
|
markdown: () => Promise.resolve().then(() => (Wt(), Ht)).then((e) => ({ default: e.RichTextField })),
|
|
5634
5739
|
html: () => Promise.resolve().then(() => (Wt(), Ht)).then((e) => ({ default: e.RichTextField })),
|
|
5635
5740
|
richtext: () => Promise.resolve().then(() => (Wt(), Ht)).then((e) => ({ default: e.RichTextField })),
|
|
5636
5741
|
lookup: () => Promise.resolve().then(() => (Kn(), Fn)).then((e) => ({ default: e.LookupField })),
|
|
5637
5742
|
master_detail: () => Promise.resolve().then(() => (Kn(), Fn)).then((e) => ({ default: e.LookupField })),
|
|
5638
|
-
file: () => Promise.resolve().then(() => (
|
|
5639
|
-
image: () => Promise.resolve().then(() => (
|
|
5640
|
-
location: () => Promise.resolve().then(() => (
|
|
5641
|
-
formula: () => Promise.resolve().then(() => (
|
|
5642
|
-
summary: () => Promise.resolve().then(() => (
|
|
5643
|
-
auto_number: () => Promise.resolve().then(() => (
|
|
5644
|
-
user: () => Promise.resolve().then(() => (
|
|
5645
|
-
owner: () => Promise.resolve().then(() => (
|
|
5646
|
-
object: () => Promise.resolve().then(() => (
|
|
5647
|
-
vector: () => Promise.resolve().then(() => (
|
|
5648
|
-
grid: () => Promise.resolve().then(() => (
|
|
5649
|
-
color: () => Promise.resolve().then(() => (
|
|
5650
|
-
slider: () => Promise.resolve().then(() => (
|
|
5651
|
-
rating: () => Promise.resolve().then(() => (
|
|
5652
|
-
code: () => Promise.resolve().then(() => (
|
|
5653
|
-
avatar: () => Promise.resolve().then(() => (
|
|
5654
|
-
address: () => Promise.resolve().then(() => (
|
|
5655
|
-
geolocation: () => Promise.resolve().then(() => (
|
|
5656
|
-
signature: () => Promise.resolve().then(() => (
|
|
5657
|
-
qrcode: () => Promise.resolve().then(() => (
|
|
5658
|
-
},
|
|
5743
|
+
file: () => Promise.resolve().then(() => (dr(), lr)).then((e) => ({ default: e.FileField })),
|
|
5744
|
+
image: () => Promise.resolve().then(() => (vr(), hr)).then((e) => ({ default: e.ImageField })),
|
|
5745
|
+
location: () => Promise.resolve().then(() => (xr(), yr)).then((e) => ({ default: e.LocationField })),
|
|
5746
|
+
formula: () => Promise.resolve().then(() => (wr(), Sr)).then((e) => ({ default: e.FormulaField })),
|
|
5747
|
+
summary: () => Promise.resolve().then(() => (Dr(), Tr)).then((e) => ({ default: e.SummaryField })),
|
|
5748
|
+
auto_number: () => Promise.resolve().then(() => (Ar(), Or)).then((e) => ({ default: e.AutoNumberField })),
|
|
5749
|
+
user: () => Promise.resolve().then(() => (Pr(), jr)).then((e) => ({ default: e.UserField })),
|
|
5750
|
+
owner: () => Promise.resolve().then(() => (Pr(), jr)).then((e) => ({ default: e.UserField })),
|
|
5751
|
+
object: () => Promise.resolve().then(() => (Lr(), Fr)).then((e) => ({ default: e.ObjectField })),
|
|
5752
|
+
vector: () => Promise.resolve().then(() => (Br(), Rr)).then((e) => ({ default: e.VectorField })),
|
|
5753
|
+
grid: () => Promise.resolve().then(() => (ni(), Vr)).then((e) => ({ default: e.GridField })),
|
|
5754
|
+
color: () => Promise.resolve().then(() => (ai(), ri)).then((e) => ({ default: e.ColorField })),
|
|
5755
|
+
slider: () => Promise.resolve().then(() => (ci(), oi)).then((e) => ({ default: e.SliderField })),
|
|
5756
|
+
rating: () => Promise.resolve().then(() => (di(), li)).then((e) => ({ default: e.RatingField })),
|
|
5757
|
+
code: () => Promise.resolve().then(() => (mi(), fi)).then((e) => ({ default: e.CodeField })),
|
|
5758
|
+
avatar: () => Promise.resolve().then(() => (_i(), hi)).then((e) => ({ default: e.AvatarField })),
|
|
5759
|
+
address: () => Promise.resolve().then(() => (bi(), vi)).then((e) => ({ default: e.AddressField })),
|
|
5760
|
+
geolocation: () => Promise.resolve().then(() => (Ci(), xi)).then((e) => ({ default: e.GeolocationField })),
|
|
5761
|
+
signature: () => Promise.resolve().then(() => (Ei(), wi)).then((e) => ({ default: e.SignatureField })),
|
|
5762
|
+
qrcode: () => Promise.resolve().then(() => (ki(), Di)).then((e) => ({ default: e.QRCodeField }))
|
|
5763
|
+
}, ao = Object.freeze(Object.keys(io)), oo = /* @__PURE__ */ new Set([
|
|
5659
5764
|
"text",
|
|
5660
5765
|
"html",
|
|
5661
5766
|
"image",
|
|
@@ -5670,8 +5775,8 @@ var eo = {
|
|
|
5670
5775
|
"time",
|
|
5671
5776
|
"address"
|
|
5672
5777
|
]);
|
|
5673
|
-
function
|
|
5674
|
-
let n =
|
|
5778
|
+
function so(t) {
|
|
5779
|
+
let n = io[t];
|
|
5675
5780
|
if (!n) {
|
|
5676
5781
|
console.warn(`Unknown field type: ${t}`);
|
|
5677
5782
|
return;
|
|
@@ -5679,15 +5784,15 @@ function ro(t) {
|
|
|
5679
5784
|
let r = e.lazy(n);
|
|
5680
5785
|
u.register(t, r, {
|
|
5681
5786
|
namespace: "field",
|
|
5682
|
-
skipFallback:
|
|
5787
|
+
skipFallback: oo.has(t)
|
|
5683
5788
|
});
|
|
5684
5789
|
}
|
|
5685
|
-
function
|
|
5686
|
-
Object.keys(
|
|
5687
|
-
|
|
5790
|
+
function co() {
|
|
5791
|
+
Object.keys(io).forEach((e) => {
|
|
5792
|
+
so(e);
|
|
5688
5793
|
});
|
|
5689
5794
|
}
|
|
5690
|
-
function
|
|
5795
|
+
function lo() {
|
|
5691
5796
|
u.register("text", $(ot), {
|
|
5692
5797
|
namespace: "field",
|
|
5693
5798
|
skipFallback: !0
|
|
@@ -5697,13 +5802,13 @@ function ao() {
|
|
|
5697
5802
|
}), u.register("number", $(lt), { namespace: "field" }), u.register("boolean", $(ft), { namespace: "field" }), u.register("select", $(vt), {
|
|
5698
5803
|
namespace: "field",
|
|
5699
5804
|
skipFallback: !0
|
|
5700
|
-
}), u.register("date", $(Ct), { namespace: "field" }), u.register("datetime", $(
|
|
5805
|
+
}), u.register("date", $(Ct), { namespace: "field" }), u.register("datetime", $(Qn), { namespace: "field" }), u.register("time", $(tr), {
|
|
5701
5806
|
namespace: "field",
|
|
5702
5807
|
skipFallback: !0
|
|
5703
5808
|
}), u.register("email", $(Et), {
|
|
5704
5809
|
namespace: "field",
|
|
5705
5810
|
skipFallback: !0
|
|
5706
|
-
}), u.register("phone", $(kt), { namespace: "field" }), u.register("url", $(Mt), { namespace: "field" }), u.register("currency", $(Lt), { namespace: "field" }), u.register("percent", $(
|
|
5811
|
+
}), u.register("phone", $(kt), { namespace: "field" }), u.register("url", $(Mt), { namespace: "field" }), u.register("currency", $(Lt), { namespace: "field" }), u.register("percent", $(ir), { namespace: "field" }), u.register("password", $(sr), {
|
|
5707
5812
|
namespace: "field",
|
|
5708
5813
|
skipFallback: !0
|
|
5709
5814
|
}), u.register("markdown", $(Ut), {
|
|
@@ -5712,23 +5817,26 @@ function ao() {
|
|
|
5712
5817
|
}), u.register("html", $(Ut), {
|
|
5713
5818
|
namespace: "field",
|
|
5714
5819
|
skipFallback: !0
|
|
5715
|
-
}), u.register("lookup", $(Vn), { namespace: "field" }), u.register("
|
|
5820
|
+
}), u.register("lookup", $(Vn), { namespace: "field" }), u.register("capability-multiselect", Xn, {
|
|
5821
|
+
namespace: "field",
|
|
5822
|
+
skipFallback: !0
|
|
5823
|
+
}), u.register("master_detail", $(Vn), { namespace: "field" }), u.register("file", $(ur), { namespace: "field" }), u.register("image", $(gr), {
|
|
5716
5824
|
namespace: "field",
|
|
5717
5825
|
skipFallback: !0
|
|
5718
|
-
}), u.register("location", $(
|
|
5826
|
+
}), u.register("location", $(br), { namespace: "field" }), u.register("formula", $(Cr), { namespace: "field" }), u.register("summary", $(Er), { namespace: "field" }), u.register("auto_number", $(kr), { namespace: "field" }), u.register("user", $(Nr), { namespace: "field" }), u.register("owner", $(Nr), { namespace: "field" }), u.register("object", $(Ir), { namespace: "field" }), u.register("vector", $(zr), { namespace: "field" }), u.register("grid", $(Zr), {
|
|
5719
5827
|
namespace: "field",
|
|
5720
5828
|
skipFallback: !0
|
|
5721
|
-
}), u.register("color", $(
|
|
5829
|
+
}), u.register("color", $(ii), { namespace: "field" }), u.register("slider", $(si), {
|
|
5722
5830
|
namespace: "field",
|
|
5723
5831
|
skipFallback: !0
|
|
5724
|
-
}), u.register("rating", $(
|
|
5832
|
+
}), u.register("rating", $(ui), { namespace: "field" }), u.register("code", $(pi), { namespace: "field" }), u.register("avatar", $(gi), {
|
|
5725
5833
|
namespace: "field",
|
|
5726
5834
|
skipFallback: !0
|
|
5727
|
-
}), u.register("address", $(
|
|
5835
|
+
}), u.register("address", $(yi), {
|
|
5728
5836
|
namespace: "field",
|
|
5729
5837
|
skipFallback: !0
|
|
5730
|
-
}), u.register("geolocation", $(
|
|
5838
|
+
}), u.register("geolocation", $(Si), { namespace: "field" }), u.register("signature", $(Ti), { namespace: "field" }), u.register("qrcode", $(Oi), { namespace: "field" });
|
|
5731
5839
|
}
|
|
5732
|
-
|
|
5840
|
+
co();
|
|
5733
5841
|
//#endregion
|
|
5734
|
-
export {
|
|
5842
|
+
export { yi as AddressField, kr as AutoNumberField, gi as AvatarField, va as BooleanCellRenderer, ft as BooleanField, Xn as CapabilityMultiSelectField, Li as CheckboxesField, pi as CodeField, ii as ColorField, qa as ColorSwatchCellRenderer, ma as CurrencyCellRenderer, Lt as CurrencyField, Wi as DISCRETE_EDIT_TYPES, ya as DateCellRenderer, Ct as DateField, ba as DateTimeCellRenderer, Qn as DateTimeField, Na as EmailCellRenderer, Et as EmailField, ao as FORM_FIELD_TYPES, qi as FieldEditWidget, Ia as FileCellRenderer, ur as FileField, za as FormulaCellRenderer, Cr as FormulaField, Si as GeolocationField, Zr as GridField, Za as HtmlCellRenderer, Ui as INLINE_EXCLUDED_FIELD_TYPES, La as ImageCellRenderer, pr as ImageCropperDialog, gr as ImageField, Ka as JsonCellRenderer, ti as LineItemsField, Qa as LocationCellRenderer, br as LocationField, Ra as LookupCellRenderer, Vn as LookupField, Ya as MarkdownCellRenderer, Ji as MasterDetailField, ji as MultiSelectField, pa as NumberCellRenderer, lt as NumberField, Ir as ObjectField, sr as PasswordField, ga as PercentCellRenderer, ir as PercentField, Fa as PhoneCellRenderer, kt as PhoneField, Oi as QRCodeField, Pi as RadioField, ui as RatingField, Zt as RecordPickerDialog, Ut as RichTextField, Ma as SelectCellRenderer, vt as SelectField, Ti as SignatureField, si as SliderField, Er as SummaryField, Bi as TagsField, Bt as TextAreaField, fa as TextCellRenderer, ot as TextField, tr as TimeField, Pa as UrlCellRenderer, Mt as UrlField, Ba as UserCellRenderer, Nr as UserField, zr as VectorField, no as buildValidationRules, ra as coerceToSafeValue, qr as computeRow, Gr as evalArith, ro as evaluateCondition, aa as formatCompactCurrency, ia as formatCurrency, ua as formatDate, da as formatDateTime, to as formatFileSize, oa as formatNumber, sa as formatPercent, la as formatRelativeDate, Oa as getBadgeColorClasses, $a as getCellRenderer, ka as getSemanticColorName, ja as getSemanticHex, Gi as hasFieldEditWidget, ca as humanizeLabel, ea as isLikelyOpaqueId, Kr as lookupAutofillPatch, Yt as lookupFiltersToRecord, eo as mapFieldTypeToFormType, qn as parseCapabilityNames, $i as pickRecordDisplayName, co as registerAllFields, so as registerField, Ha as registerFieldRenderer, lo as registerFields, Ga as resolveCellRendererType, y as resolveFieldCurrency, Xr as sumColumn };
|