@declarion/react 0.27.0 → 0.28.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-lib/{ActionRunner-D9fJRkNV.js → ActionRunner-DtUDeH4F.js} +595 -579
- package/dist-lib/{DraggableChildrenTable-C1s26ScM.js → DraggableChildrenTable-D4WoV6ck.js} +5 -5
- package/dist-lib/{Grid-C4fCdbYW.js → Grid-CsK_TuK_.js} +2 -2
- package/dist-lib/{MarkdownRenderer-VQnKhMQx.js → MarkdownRenderer-CwlNQju5.js} +1 -1
- package/dist-lib/embed/EmbedHistoryTracker.d.ts +1 -0
- package/dist-lib/embed/embed-history.d.ts +19 -0
- package/dist-lib/embed/index.d.ts +3 -1
- package/dist-lib/embed/useEmbedNavigate.d.ts +12 -0
- package/dist-lib/hooks/useActionData.d.ts +61 -0
- package/dist-lib/hooks/useCursorEntityData.d.ts +13 -0
- package/dist-lib/hooks/useEntityData.d.ts +8 -0
- package/dist-lib/hooks/useEntityItem.d.ts +8 -0
- package/dist-lib/hooks/usePageState.d.ts +32 -0
- package/dist-lib/hooks/usePageStateRuntime.d.ts +27 -0
- package/dist-lib/hooks/usePageStateTtl.d.ts +11 -0
- package/dist-lib/hooks/useRegisterScreenTab.d.ts +9 -0
- package/dist-lib/hooks/useScreenTab.d.ts +10 -0
- package/dist-lib/index.d.ts +16 -3
- package/dist-lib/index.js +4356 -3879
- package/dist-lib/lib/canonical-url.d.ts +27 -0
- package/dist-lib/lib/scroll-restoration.d.ts +90 -0
- package/dist-lib/stores/page-state.d.ts +61 -0
- package/dist-lib/testing.js +7 -7
- package/dist-lib/{value-BQWyqKHC.js → value-CNUbJNK-.js} +29 -29
- package/package.json +1 -1
|
@@ -2245,6 +2245,19 @@ function hr() {
|
|
|
2245
2245
|
}, [e]);
|
|
2246
2246
|
}
|
|
2247
2247
|
function gr() {
|
|
2248
|
+
let e = m();
|
|
2249
|
+
return o(() => {
|
|
2250
|
+
let t = () => {
|
|
2251
|
+
e(-1);
|
|
2252
|
+
};
|
|
2253
|
+
if (sr.getState().isDirty) {
|
|
2254
|
+
lr.getState().requestNavigation(t);
|
|
2255
|
+
return;
|
|
2256
|
+
}
|
|
2257
|
+
t();
|
|
2258
|
+
}, [e]);
|
|
2259
|
+
}
|
|
2260
|
+
function _r() {
|
|
2248
2261
|
let e = or();
|
|
2249
2262
|
return o((t, n) => {
|
|
2250
2263
|
e.enabled && it(e.parentOrigin, rt.navigationFailed, {
|
|
@@ -2255,7 +2268,7 @@ function gr() {
|
|
|
2255
2268
|
}
|
|
2256
2269
|
//#endregion
|
|
2257
2270
|
//#region src/components/shared/toast/DeclarionToast.tsx
|
|
2258
|
-
var
|
|
2271
|
+
var vr = {
|
|
2259
2272
|
success: {
|
|
2260
2273
|
tone: "success",
|
|
2261
2274
|
defaultTitle: "Success"
|
|
@@ -2276,8 +2289,8 @@ var _r = {
|
|
|
2276
2289
|
tone: "info",
|
|
2277
2290
|
defaultTitle: "Working…"
|
|
2278
2291
|
}
|
|
2279
|
-
},
|
|
2280
|
-
function
|
|
2292
|
+
}, yr = 200;
|
|
2293
|
+
function br({ type: t }) {
|
|
2281
2294
|
let n = { display: "flex" };
|
|
2282
2295
|
return t === "loading" ? /* @__PURE__ */ v("span", {
|
|
2283
2296
|
style: {
|
|
@@ -2290,9 +2303,9 @@ function yr({ type: t }) {
|
|
|
2290
2303
|
children: /* @__PURE__ */ v(t === "success" ? e.check : t === "error" ? e.x : t === "warning" ? e.warning : e.info, { size: 11 })
|
|
2291
2304
|
});
|
|
2292
2305
|
}
|
|
2293
|
-
function
|
|
2294
|
-
let r =
|
|
2295
|
-
S.current || (S.current = !0, g(!0), window.setTimeout(n,
|
|
2306
|
+
function xr({ model: t, onClose: n }) {
|
|
2307
|
+
let r = vr[t.type] ?? vr.info, i = r.tone, [a, s] = f(!1), [l, u] = f(!1), [p, m] = f(!1), [h, g] = f(!1), [_, b] = f(1), x = d(t.duration), S = d(!1), C = !t.sticky && t.duration > 0, w = o(() => {
|
|
2308
|
+
S.current || (S.current = !0, g(!0), window.setTimeout(n, yr));
|
|
2296
2309
|
}, [n]);
|
|
2297
2310
|
c(() => {
|
|
2298
2311
|
x.current = t.duration, b(1);
|
|
@@ -2341,7 +2354,7 @@ function br({ model: t, onClose: n }) {
|
|
|
2341
2354
|
boxShadow: "var(--shadow-toast)",
|
|
2342
2355
|
overflow: "hidden",
|
|
2343
2356
|
position: "relative",
|
|
2344
|
-
animation: h ? `dz-toast-out ${
|
|
2357
|
+
animation: h ? `dz-toast-out ${yr}ms ease-in forwards` : "dz-toast-in 0.24s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
2345
2358
|
},
|
|
2346
2359
|
children: [/* @__PURE__ */ y("div", {
|
|
2347
2360
|
style: {
|
|
@@ -2363,7 +2376,7 @@ function br({ model: t, onClose: n }) {
|
|
|
2363
2376
|
justifyContent: "center",
|
|
2364
2377
|
color: E("")
|
|
2365
2378
|
},
|
|
2366
|
-
children: /* @__PURE__ */ v(
|
|
2379
|
+
children: /* @__PURE__ */ v(br, { type: t.type })
|
|
2367
2380
|
}),
|
|
2368
2381
|
/* @__PURE__ */ y("div", {
|
|
2369
2382
|
style: {
|
|
@@ -2556,28 +2569,28 @@ function br({ model: t, onClose: n }) {
|
|
|
2556
2569
|
}
|
|
2557
2570
|
//#endregion
|
|
2558
2571
|
//#region src/lib/toast.tsx
|
|
2559
|
-
var
|
|
2572
|
+
var Sr = {
|
|
2560
2573
|
success: 4e3,
|
|
2561
2574
|
info: 6e3,
|
|
2562
2575
|
warning: 8e3,
|
|
2563
2576
|
error: 0,
|
|
2564
2577
|
loading: 0
|
|
2565
|
-
}, X = /* @__PURE__ */ new Map(),
|
|
2566
|
-
function
|
|
2567
|
-
g.custom(() => /* @__PURE__ */ v(
|
|
2578
|
+
}, X = /* @__PURE__ */ new Map(), Cr = /* @__PURE__ */ new Map(), wr = 0, Tr = () => `dz-${++wr}`;
|
|
2579
|
+
function Er(e) {
|
|
2580
|
+
g.custom(() => /* @__PURE__ */ v(xr, {
|
|
2568
2581
|
model: e,
|
|
2569
2582
|
onClose: () => g.dismiss(e.id)
|
|
2570
2583
|
}), {
|
|
2571
2584
|
id: e.id,
|
|
2572
2585
|
duration: Infinity,
|
|
2573
2586
|
onDismiss: () => {
|
|
2574
|
-
X.delete(String(e.id)), e.group &&
|
|
2587
|
+
X.delete(String(e.id)), e.group && Cr.get(e.group) === e.id && Cr.delete(e.group);
|
|
2575
2588
|
}
|
|
2576
2589
|
});
|
|
2577
2590
|
}
|
|
2578
|
-
function
|
|
2591
|
+
function Dr(e, t, n, r = {}) {
|
|
2579
2592
|
if (r.group) {
|
|
2580
|
-
let e =
|
|
2593
|
+
let e = Cr.get(r.group);
|
|
2581
2594
|
if (e && X.has(e)) {
|
|
2582
2595
|
let r = X.get(e), i = {
|
|
2583
2596
|
...r,
|
|
@@ -2586,10 +2599,10 @@ function Er(e, t, n, r = {}) {
|
|
|
2586
2599
|
count: (r.count ?? 1) + 1,
|
|
2587
2600
|
createdAt: Date.now()
|
|
2588
2601
|
};
|
|
2589
|
-
return X.set(e, i),
|
|
2602
|
+
return X.set(e, i), Er(i), e;
|
|
2590
2603
|
}
|
|
2591
2604
|
}
|
|
2592
|
-
let i = r.id ??
|
|
2605
|
+
let i = r.id ?? Tr(), a = r.duration ?? Sr[e], o = {
|
|
2593
2606
|
id: i,
|
|
2594
2607
|
type: e,
|
|
2595
2608
|
title: t,
|
|
@@ -2603,12 +2616,12 @@ function Er(e, t, n, r = {}) {
|
|
|
2603
2616
|
createdAt: Date.now(),
|
|
2604
2617
|
group: r.group
|
|
2605
2618
|
};
|
|
2606
|
-
return X.set(i, o), r.group &&
|
|
2619
|
+
return X.set(i, o), r.group && Cr.set(r.group, i), Er(o), i;
|
|
2607
2620
|
}
|
|
2608
|
-
function
|
|
2621
|
+
function Or(e, t) {
|
|
2609
2622
|
let n = X.get(e);
|
|
2610
2623
|
if (!n) return;
|
|
2611
|
-
let r = t.type ?? n.type, i = t.duration ?? (t.type ?
|
|
2624
|
+
let r = t.type ?? n.type, i = t.duration ?? (t.type ? Sr[r] : n.duration), a = {
|
|
2612
2625
|
...n,
|
|
2613
2626
|
...t,
|
|
2614
2627
|
type: r,
|
|
@@ -2616,35 +2629,35 @@ function Dr(e, t) {
|
|
|
2616
2629
|
sticky: t.sticky ?? i === 0,
|
|
2617
2630
|
createdAt: Date.now()
|
|
2618
2631
|
};
|
|
2619
|
-
X.set(e, a),
|
|
2632
|
+
X.set(e, a), Er(a);
|
|
2620
2633
|
}
|
|
2621
2634
|
var Z = {
|
|
2622
|
-
success: (e, t, n) =>
|
|
2623
|
-
info: (e, t, n) =>
|
|
2624
|
-
warning: (e, t, n) =>
|
|
2625
|
-
error: (e, t, n) =>
|
|
2626
|
-
loading: (e, t, n) =>
|
|
2627
|
-
update:
|
|
2635
|
+
success: (e, t, n) => Dr("success", e, t, n),
|
|
2636
|
+
info: (e, t, n) => Dr("info", e, t, n),
|
|
2637
|
+
warning: (e, t, n) => Dr("warning", e, t, n),
|
|
2638
|
+
error: (e, t, n) => Dr("error", e, t, n),
|
|
2639
|
+
loading: (e, t, n) => Dr("loading", e, t, n),
|
|
2640
|
+
update: Or,
|
|
2628
2641
|
dismiss: (e) => g.dismiss(e),
|
|
2629
2642
|
dismissAll: () => g.dismiss()
|
|
2630
2643
|
};
|
|
2631
2644
|
//#endregion
|
|
2632
2645
|
//#region src/api/data.ts
|
|
2633
|
-
function
|
|
2646
|
+
function kr(e, t) {
|
|
2634
2647
|
let n = new URL(`/api/data/${e}`, window.location.origin);
|
|
2635
2648
|
if (t.page && n.searchParams.set("page", String(t.page)), t.per_page && n.searchParams.set("per_page", String(t.per_page)), t.sort && n.searchParams.set("sort", t.sort), t.search && n.searchParams.set("search", t.search), t.filters && t.filters.length > 0 && n.searchParams.set("filters", JSON.stringify(t.filters)), t.include_deleted && n.searchParams.set("include_deleted", "true"), t.expand) for (let e of t.expand) n.searchParams.append("expand", e);
|
|
2636
2649
|
return t.select && t.select.length > 0 && n.searchParams.set("select", t.select.join(",")), t.screen && n.searchParams.set("screen", t.screen), t.preview && n.searchParams.set("preview", "true"), t.count && n.searchParams.set("count", t.count), n.pathname + n.search;
|
|
2637
2650
|
}
|
|
2638
|
-
async function
|
|
2639
|
-
if (
|
|
2640
|
-
let n =
|
|
2651
|
+
async function Ar(e, t = {}, n = {}) {
|
|
2652
|
+
if (Ur) {
|
|
2653
|
+
let n = Ur(e, t);
|
|
2641
2654
|
if (n !== void 0) return n;
|
|
2642
2655
|
}
|
|
2643
|
-
return K(
|
|
2656
|
+
return K(kr(e, t), { signal: n.signal });
|
|
2644
2657
|
}
|
|
2645
|
-
async function
|
|
2646
|
-
if (
|
|
2647
|
-
let n =
|
|
2658
|
+
async function jr(e, t) {
|
|
2659
|
+
if (Wr) {
|
|
2660
|
+
let n = Wr(e, t);
|
|
2648
2661
|
if (n !== void 0) return n;
|
|
2649
2662
|
}
|
|
2650
2663
|
let n = new URLSearchParams();
|
|
@@ -2652,39 +2665,39 @@ async function Ar(e, t) {
|
|
|
2652
2665
|
else for (let [e, r] of Object.entries(t)) n.set(e, r);
|
|
2653
2666
|
return K(`/api/data/${e}?${n.toString()}`);
|
|
2654
2667
|
}
|
|
2655
|
-
async function
|
|
2656
|
-
return { data: ((await
|
|
2668
|
+
async function Mr(e, t) {
|
|
2669
|
+
return { data: ((await qr(`${e}.__create`, {
|
|
2657
2670
|
entity: e,
|
|
2658
2671
|
fields: t
|
|
2659
2672
|
})).result?.rows ?? [])[0] };
|
|
2660
2673
|
}
|
|
2661
|
-
async function
|
|
2662
|
-
let r = typeof t == "string" ? t :
|
|
2663
|
-
return { data: ((await
|
|
2674
|
+
async function Nr(e, t, n) {
|
|
2675
|
+
let r = typeof t == "string" ? t : Fr(t);
|
|
2676
|
+
return { data: ((await qr(`${e}.__update`, {
|
|
2664
2677
|
object_ids: [r],
|
|
2665
2678
|
entity: e,
|
|
2666
2679
|
fields: n
|
|
2667
2680
|
})).result?.rows ?? [])[0] };
|
|
2668
2681
|
}
|
|
2669
|
-
async function
|
|
2670
|
-
let n = typeof t == "string" ? t :
|
|
2671
|
-
await
|
|
2682
|
+
async function Pr(e, t) {
|
|
2683
|
+
let n = typeof t == "string" ? t : Fr(t);
|
|
2684
|
+
await qr(`${e}.__delete`, {
|
|
2672
2685
|
object_ids: [n],
|
|
2673
2686
|
entity: e
|
|
2674
2687
|
});
|
|
2675
2688
|
}
|
|
2676
|
-
function
|
|
2689
|
+
function Fr(e) {
|
|
2677
2690
|
let t = Object.values(e);
|
|
2678
2691
|
return t.length === 1 ? t[0] : t.join("");
|
|
2679
2692
|
}
|
|
2680
|
-
async function
|
|
2681
|
-
let n = typeof t == "string" ? t :
|
|
2682
|
-
await
|
|
2693
|
+
async function Ir(e, t) {
|
|
2694
|
+
let n = typeof t == "string" ? t : Fr(t);
|
|
2695
|
+
await qr(`${e}.__restore`, {
|
|
2683
2696
|
object_ids: [n],
|
|
2684
2697
|
entity: e
|
|
2685
2698
|
});
|
|
2686
2699
|
}
|
|
2687
|
-
async function
|
|
2700
|
+
async function Lr(e, t) {
|
|
2688
2701
|
let n = await sn(`/api/data/${e}/export`, {
|
|
2689
2702
|
method: "POST",
|
|
2690
2703
|
body: JSON.stringify(t)
|
|
@@ -2694,7 +2707,7 @@ async function Ir(e, t) {
|
|
|
2694
2707
|
filename: n.filename
|
|
2695
2708
|
};
|
|
2696
2709
|
}
|
|
2697
|
-
var
|
|
2710
|
+
var Rr = class extends Error {
|
|
2698
2711
|
status;
|
|
2699
2712
|
response;
|
|
2700
2713
|
constructor(e, t) {
|
|
@@ -2702,64 +2715,64 @@ var Lr = class extends Error {
|
|
|
2702
2715
|
super(n || "Action failed"), this.name = "ActionBatchError", this.status = e, this.response = t;
|
|
2703
2716
|
}
|
|
2704
2717
|
};
|
|
2705
|
-
function
|
|
2718
|
+
function zr(e) {
|
|
2706
2719
|
if (!e || typeof e != "object") return !1;
|
|
2707
2720
|
let t = e;
|
|
2708
2721
|
return typeof t.status == "string" && Array.isArray(t.errors);
|
|
2709
2722
|
}
|
|
2710
|
-
function
|
|
2723
|
+
function Br(e, t) {
|
|
2711
2724
|
let n = { ...e ?? {} };
|
|
2712
2725
|
if ("object_ids" in n) throw Error("handler param \"object_ids\" collides with reserved key");
|
|
2713
2726
|
if ("_ids" in n) throw Error("handler param \"_ids\" is a removed legacy key; use object_ids");
|
|
2714
2727
|
return t !== void 0 && (n.object_ids = t), n;
|
|
2715
2728
|
}
|
|
2716
|
-
var
|
|
2717
|
-
function
|
|
2718
|
-
let t =
|
|
2719
|
-
return
|
|
2720
|
-
}
|
|
2721
|
-
var Hr = null, Ur = null;
|
|
2722
|
-
function Wr(e) {
|
|
2723
|
-
let t = Hr;
|
|
2724
|
-
return Hr = e, t;
|
|
2729
|
+
var Vr = null;
|
|
2730
|
+
function Hr(e) {
|
|
2731
|
+
let t = Vr;
|
|
2732
|
+
return Vr = e, t;
|
|
2725
2733
|
}
|
|
2734
|
+
var Ur = null, Wr = null;
|
|
2726
2735
|
function Gr(e) {
|
|
2727
2736
|
let t = Ur;
|
|
2728
2737
|
return Ur = e, t;
|
|
2729
2738
|
}
|
|
2730
|
-
|
|
2731
|
-
|
|
2739
|
+
function Kr(e) {
|
|
2740
|
+
let t = Wr;
|
|
2741
|
+
return Wr = e, t;
|
|
2742
|
+
}
|
|
2743
|
+
async function qr(e, t) {
|
|
2744
|
+
if (Vr) return Vr(e, t);
|
|
2732
2745
|
try {
|
|
2733
2746
|
return await K(`/api/actions/${e}`, {
|
|
2734
2747
|
method: "POST",
|
|
2735
2748
|
body: JSON.stringify(t)
|
|
2736
2749
|
});
|
|
2737
2750
|
} catch (e) {
|
|
2738
|
-
throw e instanceof z &&
|
|
2751
|
+
throw e instanceof z && zr(e.raw) ? new Rr(e.status, e.raw) : e;
|
|
2739
2752
|
}
|
|
2740
2753
|
}
|
|
2741
|
-
async function
|
|
2754
|
+
async function Jr(e, t) {
|
|
2742
2755
|
let n = new URLSearchParams();
|
|
2743
2756
|
return n.set("ids", t.join(",")), K(`/api/associations/${e}?${n.toString()}`);
|
|
2744
2757
|
}
|
|
2745
2758
|
//#endregion
|
|
2746
2759
|
//#region src/components/shared/Markdown.tsx
|
|
2747
|
-
var
|
|
2748
|
-
function
|
|
2760
|
+
var Yr = a(() => import("./MarkdownRenderer-CwlNQju5.js").then((e) => ({ default: e.MarkdownRenderer })));
|
|
2761
|
+
function Xr() {
|
|
2749
2762
|
return /* @__PURE__ */ v("div", { className: "h-4 w-2/3 rounded bg-muted animate-pulse" });
|
|
2750
2763
|
}
|
|
2751
|
-
function
|
|
2764
|
+
function Zr(e) {
|
|
2752
2765
|
return /* @__PURE__ */ v(n, {
|
|
2753
|
-
fallback: /* @__PURE__ */ v(
|
|
2754
|
-
children: /* @__PURE__ */ v(
|
|
2766
|
+
fallback: /* @__PURE__ */ v(Xr, {}),
|
|
2767
|
+
children: /* @__PURE__ */ v(Yr, { ...e })
|
|
2755
2768
|
});
|
|
2756
2769
|
}
|
|
2757
2770
|
//#endregion
|
|
2758
2771
|
//#region src/types/fieldType.ts
|
|
2759
|
-
var
|
|
2772
|
+
var Qr = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.float.int.int_array.json.multilang.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
|
|
2760
2773
|
//#endregion
|
|
2761
2774
|
//#region src/components/shared/CopyButton.tsx
|
|
2762
|
-
function
|
|
2775
|
+
function $r({ value: t, title: n, size: r = "icon" }) {
|
|
2763
2776
|
let [i, a] = f(!1), s = o(async (e) => {
|
|
2764
2777
|
e.stopPropagation(), e.preventDefault();
|
|
2765
2778
|
try {
|
|
@@ -2778,7 +2791,7 @@ function Qr({ value: t, title: n, size: r = "icon" }) {
|
|
|
2778
2791
|
}
|
|
2779
2792
|
//#endregion
|
|
2780
2793
|
//#region src/components/fields/StringField.tsx
|
|
2781
|
-
function
|
|
2794
|
+
function ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
2782
2795
|
if (r === "display") {
|
|
2783
2796
|
let t = F(n);
|
|
2784
2797
|
return e.copyable && t ? /* @__PURE__ */ y("span", {
|
|
@@ -2790,7 +2803,7 @@ function $r({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
2790
2803
|
children: [/* @__PURE__ */ v("span", {
|
|
2791
2804
|
style: { fontSize: 12.5 },
|
|
2792
2805
|
children: t
|
|
2793
|
-
}), /* @__PURE__ */ v(
|
|
2806
|
+
}), /* @__PURE__ */ v($r, {
|
|
2794
2807
|
value: t,
|
|
2795
2808
|
size: "sm"
|
|
2796
2809
|
})]
|
|
@@ -2812,7 +2825,7 @@ function $r({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
2812
2825
|
}
|
|
2813
2826
|
//#endregion
|
|
2814
2827
|
//#region src/components/fields/TextField.tsx
|
|
2815
|
-
function
|
|
2828
|
+
function ti({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, compact: o, fieldId: s }) {
|
|
2816
2829
|
let c = e.display?.widget;
|
|
2817
2830
|
if (r === "display") {
|
|
2818
2831
|
let t = F(n);
|
|
@@ -2823,7 +2836,7 @@ function ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
2823
2836
|
},
|
|
2824
2837
|
children: "—"
|
|
2825
2838
|
});
|
|
2826
|
-
let r = c === "markdown" ? /* @__PURE__ */ v(
|
|
2839
|
+
let r = c === "markdown" ? /* @__PURE__ */ v(Zr, { content: t }) : c === "code" ? /* @__PURE__ */ v("pre", {
|
|
2827
2840
|
className: "mono",
|
|
2828
2841
|
style: {
|
|
2829
2842
|
fontSize: 12,
|
|
@@ -2855,7 +2868,7 @@ function ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
2855
2868
|
top: 0,
|
|
2856
2869
|
right: 0
|
|
2857
2870
|
},
|
|
2858
|
-
children: /* @__PURE__ */ v(
|
|
2871
|
+
children: /* @__PURE__ */ v($r, {
|
|
2859
2872
|
value: t,
|
|
2860
2873
|
size: "sm"
|
|
2861
2874
|
})
|
|
@@ -2882,8 +2895,8 @@ function ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
|
|
|
2882
2895
|
}
|
|
2883
2896
|
//#endregion
|
|
2884
2897
|
//#region src/components/fields/EnumField.tsx
|
|
2885
|
-
var
|
|
2886
|
-
function
|
|
2898
|
+
var ni = "__declarion_enum_null__";
|
|
2899
|
+
function ri({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }) {
|
|
2887
2900
|
let o = e.values ?? [], s = o.find((e) => e.code === t);
|
|
2888
2901
|
if (n === "display") return s ? /* @__PURE__ */ v(D, {
|
|
2889
2902
|
tone: s.color ?? "slate",
|
|
@@ -2896,8 +2909,8 @@ function ni({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
|
|
|
2896
2909
|
},
|
|
2897
2910
|
children: "—"
|
|
2898
2911
|
});
|
|
2899
|
-
let c = !e.required, l = t != null && t !== "" ? F(t) :
|
|
2900
|
-
value:
|
|
2912
|
+
let c = !e.required, l = t != null && t !== "" ? F(t) : ni, u = [...c ? [{
|
|
2913
|
+
value: ni,
|
|
2901
2914
|
label: "— None —"
|
|
2902
2915
|
}] : [], ...o.map((e) => ({
|
|
2903
2916
|
value: e.code,
|
|
@@ -2909,13 +2922,13 @@ function ni({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
|
|
|
2909
2922
|
"aria-required": e.required || void 0,
|
|
2910
2923
|
value: l,
|
|
2911
2924
|
options: u,
|
|
2912
|
-
onChange: (e) => r?.(e ===
|
|
2925
|
+
onChange: (e) => r?.(e === ni ? null : e),
|
|
2913
2926
|
placeholder: "Select…"
|
|
2914
2927
|
});
|
|
2915
2928
|
}
|
|
2916
2929
|
//#endregion
|
|
2917
2930
|
//#region src/components/fields/EmailField.tsx
|
|
2918
|
-
function
|
|
2931
|
+
function ii({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
2919
2932
|
return /* @__PURE__ */ v(N, {
|
|
2920
2933
|
id: i,
|
|
2921
2934
|
name: t,
|
|
@@ -2927,7 +2940,7 @@ function ri({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
2927
2940
|
}
|
|
2928
2941
|
//#endregion
|
|
2929
2942
|
//#region src/components/fields/UrlField.tsx
|
|
2930
|
-
function
|
|
2943
|
+
function ai({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
2931
2944
|
return /* @__PURE__ */ v(N, {
|
|
2932
2945
|
id: i,
|
|
2933
2946
|
name: t,
|
|
@@ -2940,7 +2953,7 @@ function ii({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
2940
2953
|
}
|
|
2941
2954
|
//#endregion
|
|
2942
2955
|
//#region src/components/fields/PhoneField.tsx
|
|
2943
|
-
function
|
|
2956
|
+
function oi({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
2944
2957
|
return /* @__PURE__ */ v(N, {
|
|
2945
2958
|
id: i,
|
|
2946
2959
|
name: t,
|
|
@@ -2953,10 +2966,10 @@ function ai({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
|
|
|
2953
2966
|
}
|
|
2954
2967
|
//#endregion
|
|
2955
2968
|
//#region src/lib/timestamp.ts
|
|
2956
|
-
function
|
|
2969
|
+
function si(e = /* @__PURE__ */ new Date()) {
|
|
2957
2970
|
return w(e);
|
|
2958
2971
|
}
|
|
2959
|
-
function
|
|
2972
|
+
function ci(e, t) {
|
|
2960
2973
|
let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
|
|
2961
2974
|
if (isNaN(i.getTime())) return e;
|
|
2962
2975
|
if (n || r) {
|
|
@@ -2982,13 +2995,13 @@ function si(e, t) {
|
|
|
2982
2995
|
}
|
|
2983
2996
|
return new Intl.DateTimeFormat(void 0, t).format(i);
|
|
2984
2997
|
}
|
|
2985
|
-
function
|
|
2986
|
-
return
|
|
2998
|
+
function li(e) {
|
|
2999
|
+
return ci(e, {
|
|
2987
3000
|
dateStyle: "medium",
|
|
2988
3001
|
timeStyle: "short"
|
|
2989
3002
|
});
|
|
2990
3003
|
}
|
|
2991
|
-
function
|
|
3004
|
+
function ui(e, t = /* @__PURE__ */ new Date()) {
|
|
2992
3005
|
if (e == null || e === "") return {
|
|
2993
3006
|
text: "—",
|
|
2994
3007
|
absolute: ""
|
|
@@ -3001,7 +3014,7 @@ function li(e, t = /* @__PURE__ */ new Date()) {
|
|
|
3001
3014
|
absolute: t
|
|
3002
3015
|
};
|
|
3003
3016
|
}
|
|
3004
|
-
let r =
|
|
3017
|
+
let r = li(typeof e == "string" ? e : n.toISOString()), i = t.getTime() - n.getTime();
|
|
3005
3018
|
return Math.abs(i) > 720 * 60 * 60 * 1e3 ? {
|
|
3006
3019
|
text: w(n, { representation: "date" }),
|
|
3007
3020
|
absolute: r
|
|
@@ -3012,23 +3025,23 @@ function li(e, t = /* @__PURE__ */ new Date()) {
|
|
|
3012
3025
|
}
|
|
3013
3026
|
//#endregion
|
|
3014
3027
|
//#region src/components/fields/TimestampField.tsx
|
|
3015
|
-
var
|
|
3028
|
+
var di = {
|
|
3016
3029
|
year: "numeric",
|
|
3017
3030
|
month: "short",
|
|
3018
3031
|
day: "numeric"
|
|
3019
|
-
},
|
|
3020
|
-
...
|
|
3032
|
+
}, fi = {
|
|
3033
|
+
...di,
|
|
3021
3034
|
hour: "2-digit",
|
|
3022
3035
|
minute: "2-digit"
|
|
3023
3036
|
};
|
|
3024
|
-
function
|
|
3037
|
+
function pi(e, t) {
|
|
3025
3038
|
if (t) {
|
|
3026
3039
|
let t = /* @__PURE__ */ new Date(e + "T00:00:00");
|
|
3027
|
-
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0,
|
|
3040
|
+
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, di).format(t);
|
|
3028
3041
|
}
|
|
3029
|
-
return
|
|
3042
|
+
return ci(e, fi);
|
|
3030
3043
|
}
|
|
3031
|
-
function
|
|
3044
|
+
function mi(e, t) {
|
|
3032
3045
|
if (t) {
|
|
3033
3046
|
let t = /* @__PURE__ */ new Date(e + "T00:00:00");
|
|
3034
3047
|
return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, {
|
|
@@ -3046,14 +3059,14 @@ function pi(e, t) {
|
|
|
3046
3059
|
minute: "2-digit"
|
|
3047
3060
|
}).format(n);
|
|
3048
3061
|
}
|
|
3049
|
-
function
|
|
3062
|
+
function hi(e) {
|
|
3050
3063
|
if (e.endsWith("Z")) return "UTC";
|
|
3051
3064
|
let t = e.match(/([+-]\d{2}:\d{2})$/);
|
|
3052
3065
|
if (!t) return null;
|
|
3053
3066
|
let n = t[1].charAt(0), r = parseInt(t[1].substring(1, 3), 10), i = parseInt(t[1].substring(4, 6), 10);
|
|
3054
3067
|
return r === 0 && i === 0 ? "UTC" : `UTC${n}${r}${i > 0 ? `:${String(i).padStart(2, "0")}` : ""}`;
|
|
3055
3068
|
}
|
|
3056
|
-
function
|
|
3069
|
+
function gi(e, t) {
|
|
3057
3070
|
let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
|
|
3058
3071
|
if (isNaN(i.getTime())) return "";
|
|
3059
3072
|
if (r) {
|
|
@@ -3066,13 +3079,13 @@ function hi(e, t) {
|
|
|
3066
3079
|
}
|
|
3067
3080
|
return t ? e.slice(0, 10) : e.slice(0, 16);
|
|
3068
3081
|
}
|
|
3069
|
-
function
|
|
3082
|
+
function _i(e, t) {
|
|
3070
3083
|
let n = new Date(e);
|
|
3071
3084
|
if (isNaN(n.getTime())) return "";
|
|
3072
3085
|
let r = n.getFullYear(), i = String(n.getMonth() + 1).padStart(2, "0"), a = String(n.getDate()).padStart(2, "0");
|
|
3073
3086
|
return t ? `${r}-${i}-${a}` : `${r}-${i}-${a}T${String(n.getHours()).padStart(2, "0")}:${String(n.getMinutes()).padStart(2, "0")}`;
|
|
3074
3087
|
}
|
|
3075
|
-
function
|
|
3088
|
+
function vi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3076
3089
|
let o = e.type === "date", s = !!e.timezone;
|
|
3077
3090
|
if (r === "display") {
|
|
3078
3091
|
if (!n) return /* @__PURE__ */ v("span", {
|
|
@@ -3082,7 +3095,7 @@ function _i({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3082
3095
|
},
|
|
3083
3096
|
children: "—"
|
|
3084
3097
|
});
|
|
3085
|
-
let e = F(n), t = s ?
|
|
3098
|
+
let e = F(n), t = s ? pi(e, o) : mi(e, o), r = s && !o ? hi(e) : null;
|
|
3086
3099
|
return /* @__PURE__ */ y("span", {
|
|
3087
3100
|
style: { fontSize: 12.5 },
|
|
3088
3101
|
children: [t, r && /* @__PURE__ */ v("span", {
|
|
@@ -3094,7 +3107,7 @@ function _i({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3094
3107
|
})]
|
|
3095
3108
|
});
|
|
3096
3109
|
}
|
|
3097
|
-
let c = n ? s ?
|
|
3110
|
+
let c = n ? s ? gi(F(n), o) : _i(F(n), o) : "";
|
|
3098
3111
|
return /* @__PURE__ */ v(N, {
|
|
3099
3112
|
id: a,
|
|
3100
3113
|
name: t,
|
|
@@ -3115,13 +3128,13 @@ function _i({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3115
3128
|
i?.(e);
|
|
3116
3129
|
return;
|
|
3117
3130
|
}
|
|
3118
|
-
i?.(
|
|
3131
|
+
i?.(si(t));
|
|
3119
3132
|
}
|
|
3120
3133
|
});
|
|
3121
3134
|
}
|
|
3122
3135
|
//#endregion
|
|
3123
3136
|
//#region src/components/fields/BoolField.tsx
|
|
3124
|
-
function
|
|
3137
|
+
function yi({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
3125
3138
|
let a = !!e;
|
|
3126
3139
|
return t === "display" ? /* @__PURE__ */ y("span", {
|
|
3127
3140
|
style: {
|
|
@@ -3146,7 +3159,7 @@ function vi({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
|
|
|
3146
3159
|
}
|
|
3147
3160
|
//#endregion
|
|
3148
3161
|
//#region src/components/fields/NumberField.tsx
|
|
3149
|
-
function
|
|
3162
|
+
function bi(e) {
|
|
3150
3163
|
let t = e.trim();
|
|
3151
3164
|
if (t === "" || t === "-") return t;
|
|
3152
3165
|
let n = t.startsWith("-"), [r, i] = (n ? t.slice(1) : t).split("."), a;
|
|
@@ -3158,8 +3171,8 @@ function yi(e) {
|
|
|
3158
3171
|
let o = n ? `-${a}` : a;
|
|
3159
3172
|
return i !== void 0 && (o += `.${i}`), o;
|
|
3160
3173
|
}
|
|
3161
|
-
var
|
|
3162
|
-
function
|
|
3174
|
+
var xi = new Intl.NumberFormat();
|
|
3175
|
+
function Si({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3163
3176
|
let s = e.display?.widget === "money", c = e.type === "decimal" || s, l = a?.$units?.[t], u = !l && e.unit ? e.unit.display || e.unit.storage : void 0, d = l || (u && !u.startsWith("$") ? u : void 0);
|
|
3164
3177
|
if (r === "display") {
|
|
3165
3178
|
if (n == null) return /* @__PURE__ */ v("span", {
|
|
@@ -3170,10 +3183,10 @@ function xi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3170
3183
|
children: "—"
|
|
3171
3184
|
});
|
|
3172
3185
|
let e;
|
|
3173
|
-
if (c && typeof n == "string") e =
|
|
3186
|
+
if (c && typeof n == "string") e = bi(n);
|
|
3174
3187
|
else {
|
|
3175
3188
|
let t = Number(n);
|
|
3176
|
-
e = isNaN(t) ? null :
|
|
3189
|
+
e = isNaN(t) ? null : xi.format(t);
|
|
3177
3190
|
}
|
|
3178
3191
|
return e == null ? /* @__PURE__ */ v("span", {
|
|
3179
3192
|
style: { fontSize: 12.5 },
|
|
@@ -3218,29 +3231,32 @@ function xi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3218
3231
|
}
|
|
3219
3232
|
//#endregion
|
|
3220
3233
|
//#region src/hooks/useEntity.ts
|
|
3221
|
-
function
|
|
3234
|
+
function Ci(e) {
|
|
3222
3235
|
let { data: t } = J();
|
|
3223
3236
|
if (!(!t || !e)) return t.entities[e];
|
|
3224
3237
|
}
|
|
3225
3238
|
//#endregion
|
|
3226
3239
|
//#region src/hooks/useEntityData.ts
|
|
3227
|
-
function
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3240
|
+
function wi(e, t) {
|
|
3241
|
+
return [
|
|
3242
|
+
"entity-data",
|
|
3243
|
+
e,
|
|
3244
|
+
{
|
|
3245
|
+
...t,
|
|
3246
|
+
count: "window"
|
|
3247
|
+
}
|
|
3248
|
+
];
|
|
3249
|
+
}
|
|
3250
|
+
function Ti(e, t, n = !0) {
|
|
3251
|
+
let r = wi(e, t), i = r[2];
|
|
3232
3252
|
return h({
|
|
3233
|
-
queryKey:
|
|
3234
|
-
|
|
3235
|
-
e,
|
|
3236
|
-
r
|
|
3237
|
-
],
|
|
3238
|
-
queryFn: ({ signal: t }) => kr(e, r, { signal: t }),
|
|
3253
|
+
queryKey: r,
|
|
3254
|
+
queryFn: ({ signal: t }) => Ar(e, i, { signal: t }),
|
|
3239
3255
|
enabled: !!e && n,
|
|
3240
3256
|
placeholderData: (t, n) => n?.queryKey?.[1] === e ? t : void 0
|
|
3241
3257
|
});
|
|
3242
3258
|
}
|
|
3243
|
-
function
|
|
3259
|
+
function Ei(e, t, n = !0) {
|
|
3244
3260
|
let r = {
|
|
3245
3261
|
...t,
|
|
3246
3262
|
count: "only",
|
|
@@ -3256,7 +3272,7 @@ function wi(e, t, n = !0) {
|
|
|
3256
3272
|
e,
|
|
3257
3273
|
r
|
|
3258
3274
|
],
|
|
3259
|
-
queryFn: ({ signal: t }) =>
|
|
3275
|
+
queryFn: ({ signal: t }) => Ar(e, r, { signal: t }),
|
|
3260
3276
|
enabled: !!e && n,
|
|
3261
3277
|
retry: 1,
|
|
3262
3278
|
staleTime: 3e4,
|
|
@@ -3265,7 +3281,7 @@ function wi(e, t, n = !0) {
|
|
|
3265
3281
|
}
|
|
3266
3282
|
//#endregion
|
|
3267
3283
|
//#region src/hooks/useDebounce.ts
|
|
3268
|
-
function
|
|
3284
|
+
function Di(e, t) {
|
|
3269
3285
|
let [n, r] = f(e);
|
|
3270
3286
|
return c(() => {
|
|
3271
3287
|
let n = setTimeout(() => r(e), t);
|
|
@@ -3274,17 +3290,17 @@ function Ti(e, t) {
|
|
|
3274
3290
|
}
|
|
3275
3291
|
//#endregion
|
|
3276
3292
|
//#region src/components/fields/RefCombobox.tsx
|
|
3277
|
-
var
|
|
3278
|
-
function
|
|
3279
|
-
let m = e?.entity, h =
|
|
3280
|
-
per_page:
|
|
3293
|
+
var Oi = 200;
|
|
3294
|
+
function ki({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, id: a, labelId: o, ariaLabel: s, required: c, placeholder: l = "Select…", specialValues: p }) {
|
|
3295
|
+
let m = e?.entity, h = Ci(m), g = i ?? e?.display?.field ?? h?.display?.display_field, _ = u(() => h ? R(h)[0] ?? "id" : "id", [h]), y = e?.field || _, [b, x] = f(""), S = Di(b, 300), { data: C, isLoading: w } = Ti(m, {
|
|
3296
|
+
per_page: Oi,
|
|
3281
3297
|
sort: g ? `${g}:asc` : void 0,
|
|
3282
3298
|
search: S || void 0
|
|
3283
3299
|
}), T = u(() => C?.data ?? [], [C?.data]), E = t == null ? "" : F(t), D = u(() => T.some((e) => String(e[y]) === E), [
|
|
3284
3300
|
T,
|
|
3285
3301
|
y,
|
|
3286
3302
|
E
|
|
3287
|
-
]), O = r && m ? r[m]?.[E] : void 0, k = !!p?.some((e) => e.code === E), { data: ee } =
|
|
3303
|
+
]), O = r && m ? r[m]?.[E] : void 0, k = !!p?.some((e) => e.code === E), { data: ee } = Ti(E && !D && !k && !O && !w ? m : void 0, {
|
|
3288
3304
|
per_page: 1,
|
|
3289
3305
|
filters: [{
|
|
3290
3306
|
field: y,
|
|
@@ -3371,8 +3387,8 @@ function Di({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
|
|
|
3371
3387
|
}
|
|
3372
3388
|
//#endregion
|
|
3373
3389
|
//#region src/components/fields/RefField.tsx
|
|
3374
|
-
function
|
|
3375
|
-
let s = e.ref?.entity, c =
|
|
3390
|
+
function Ai({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, labelId: o }) {
|
|
3391
|
+
let s = e.ref?.entity, c = Ci(s), l = e.display?.ref_display_field ?? e.ref?.display?.field ?? c?.display?.display_field, d = u(() => {
|
|
3376
3392
|
if (t == null) return "—";
|
|
3377
3393
|
let e = F(t);
|
|
3378
3394
|
if (i && s) {
|
|
@@ -3389,7 +3405,7 @@ function Oi({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
|
|
|
3389
3405
|
return n === "display" ? /* @__PURE__ */ v("span", {
|
|
3390
3406
|
style: { fontSize: 12.5 },
|
|
3391
3407
|
children: d
|
|
3392
|
-
}) : /* @__PURE__ */ v(
|
|
3408
|
+
}) : /* @__PURE__ */ v(ki, {
|
|
3393
3409
|
ref: e.ref,
|
|
3394
3410
|
value: t,
|
|
3395
3411
|
onChange: (e) => r?.(e),
|
|
@@ -3402,29 +3418,29 @@ function Oi({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
|
|
|
3402
3418
|
}
|
|
3403
3419
|
//#endregion
|
|
3404
3420
|
//#region src/components/fields/JsonField.tsx
|
|
3405
|
-
var
|
|
3406
|
-
function
|
|
3421
|
+
var ji = a(() => import("./JsonEditor-KelPV-OQ.js").then((e) => ({ default: e.JsonEditor })));
|
|
3422
|
+
function Mi() {
|
|
3407
3423
|
return /* @__PURE__ */ v("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
|
|
3408
3424
|
}
|
|
3409
|
-
function
|
|
3425
|
+
function Ni(e) {
|
|
3410
3426
|
return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1;
|
|
3411
3427
|
}
|
|
3412
|
-
function
|
|
3413
|
-
return t === "display" ?
|
|
3428
|
+
function Pi({ value: e, mode: t, onChange: r, fieldId: i }) {
|
|
3429
|
+
return t === "display" ? Ni(e) ? /* @__PURE__ */ v("span", {
|
|
3414
3430
|
style: {
|
|
3415
3431
|
fontSize: 12.5,
|
|
3416
3432
|
color: "var(--text-4)"
|
|
3417
3433
|
},
|
|
3418
3434
|
children: "—"
|
|
3419
3435
|
}) : /* @__PURE__ */ v(n, {
|
|
3420
|
-
fallback: /* @__PURE__ */ v(
|
|
3421
|
-
children: /* @__PURE__ */ v(
|
|
3436
|
+
fallback: /* @__PURE__ */ v(Mi, {}),
|
|
3437
|
+
children: /* @__PURE__ */ v(ji, {
|
|
3422
3438
|
value: e,
|
|
3423
3439
|
readOnly: !0
|
|
3424
3440
|
})
|
|
3425
3441
|
}) : /* @__PURE__ */ v(n, {
|
|
3426
|
-
fallback: /* @__PURE__ */ v(
|
|
3427
|
-
children: /* @__PURE__ */ v(
|
|
3442
|
+
fallback: /* @__PURE__ */ v(Mi, {}),
|
|
3443
|
+
children: /* @__PURE__ */ v(ji, {
|
|
3428
3444
|
value: e,
|
|
3429
3445
|
onChange: r,
|
|
3430
3446
|
id: i
|
|
@@ -3433,14 +3449,14 @@ function Mi({ value: e, mode: t, onChange: r, fieldId: i }) {
|
|
|
3433
3449
|
}
|
|
3434
3450
|
//#endregion
|
|
3435
3451
|
//#region src/components/fields/MultilangField.tsx
|
|
3436
|
-
function
|
|
3452
|
+
function Fi(e) {
|
|
3437
3453
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
3438
3454
|
}
|
|
3439
|
-
function
|
|
3455
|
+
function Ii({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3440
3456
|
let { data: o } = J(), s = o?.languages?.length ? o.languages : [{
|
|
3441
3457
|
code: "en",
|
|
3442
3458
|
name: { en: "English" }
|
|
3443
|
-
}], c =
|
|
3459
|
+
}], c = Fi(n);
|
|
3444
3460
|
if (r === "display") return /* @__PURE__ */ v("span", {
|
|
3445
3461
|
style: { fontSize: 12.5 },
|
|
3446
3462
|
children: Object.values(c)[0] ?? "—"
|
|
@@ -3496,14 +3512,14 @@ function Pi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3496
3512
|
}
|
|
3497
3513
|
//#endregion
|
|
3498
3514
|
//#region src/components/fields/MultilangTextField.tsx
|
|
3499
|
-
function
|
|
3515
|
+
function Li(e) {
|
|
3500
3516
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
3501
3517
|
}
|
|
3502
|
-
function
|
|
3518
|
+
function Ri({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
|
|
3503
3519
|
let { data: o } = J(), s = o?.languages?.length ? o.languages : [{
|
|
3504
3520
|
code: "en",
|
|
3505
3521
|
name: { en: "English" }
|
|
3506
|
-
}], c =
|
|
3522
|
+
}], c = Li(n);
|
|
3507
3523
|
if (r === "display") return /* @__PURE__ */ v("p", {
|
|
3508
3524
|
style: {
|
|
3509
3525
|
fontSize: 12.5,
|
|
@@ -3559,25 +3575,25 @@ function Ii({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
|
|
|
3559
3575
|
}
|
|
3560
3576
|
//#endregion
|
|
3561
3577
|
//#region src/components/fields/StructureField.tsx
|
|
3562
|
-
function
|
|
3578
|
+
function zi(e) {
|
|
3563
3579
|
let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = J(), c = t.structure ? s?.structures?.[t.structure] : void 0;
|
|
3564
|
-
return c ? t.array ? /* @__PURE__ */ v(
|
|
3580
|
+
return c ? t.array ? /* @__PURE__ */ v(Vi, {
|
|
3565
3581
|
structDef: c,
|
|
3566
3582
|
value: n,
|
|
3567
3583
|
mode: r,
|
|
3568
3584
|
onChange: i,
|
|
3569
3585
|
locale: a,
|
|
3570
3586
|
fieldId: o
|
|
3571
|
-
}) : /* @__PURE__ */ v(
|
|
3587
|
+
}) : /* @__PURE__ */ v(Bi, {
|
|
3572
3588
|
structDef: c,
|
|
3573
3589
|
value: n,
|
|
3574
3590
|
mode: r,
|
|
3575
3591
|
onChange: i,
|
|
3576
3592
|
locale: a,
|
|
3577
3593
|
fieldId: o
|
|
3578
|
-
}) : /* @__PURE__ */ v(
|
|
3594
|
+
}) : /* @__PURE__ */ v(Pi, { ...e });
|
|
3579
3595
|
}
|
|
3580
|
-
function
|
|
3596
|
+
function Bi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
|
|
3581
3597
|
let o = typeof t == "object" && t && !Array.isArray(t) ? t : {}, s = e.fields.names(), c = {
|
|
3582
3598
|
display: "flex",
|
|
3583
3599
|
flexDirection: "column",
|
|
@@ -3613,13 +3629,13 @@ function Ri({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3613
3629
|
minWidth: 0,
|
|
3614
3630
|
flex: 1
|
|
3615
3631
|
},
|
|
3616
|
-
children: n.type === "structure" && n.structure ? /* @__PURE__ */ v(
|
|
3632
|
+
children: n.type === "structure" && n.structure ? /* @__PURE__ */ v(zi, {
|
|
3617
3633
|
field: n,
|
|
3618
3634
|
fieldName: t,
|
|
3619
3635
|
value: r,
|
|
3620
3636
|
mode: "display",
|
|
3621
3637
|
locale: i
|
|
3622
|
-
}) :
|
|
3638
|
+
}) : ss({
|
|
3623
3639
|
field: n,
|
|
3624
3640
|
fieldName: t,
|
|
3625
3641
|
value: r,
|
|
@@ -3657,14 +3673,14 @@ function Ri({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3657
3673
|
children: [/* @__PURE__ */ v(ce, {
|
|
3658
3674
|
required: n.required,
|
|
3659
3675
|
children: n.display ? I(n.display.name) : t
|
|
3660
|
-
}), n.type === "structure" && n.structure ? /* @__PURE__ */ v(
|
|
3676
|
+
}), n.type === "structure" && n.structure ? /* @__PURE__ */ v(zi, {
|
|
3661
3677
|
field: n,
|
|
3662
3678
|
fieldName: t,
|
|
3663
3679
|
value: o[t],
|
|
3664
3680
|
mode: "edit",
|
|
3665
3681
|
onChange: l(t),
|
|
3666
3682
|
locale: i
|
|
3667
|
-
}) :
|
|
3683
|
+
}) : ss({
|
|
3668
3684
|
field: n,
|
|
3669
3685
|
fieldName: t,
|
|
3670
3686
|
value: o[t],
|
|
@@ -3676,7 +3692,7 @@ function Ri({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
|
|
|
3676
3692
|
})
|
|
3677
3693
|
});
|
|
3678
3694
|
}
|
|
3679
|
-
function
|
|
3695
|
+
function Vi({ structDef: t, value: n, mode: r, onChange: i, locale: a, fieldId: o }) {
|
|
3680
3696
|
let s = Array.isArray(n) ? n : [];
|
|
3681
3697
|
if (r === "display") return s.length === 0 ? /* @__PURE__ */ v("span", {
|
|
3682
3698
|
style: {
|
|
@@ -3690,7 +3706,7 @@ function zi({ structDef: t, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3690
3706
|
flexDirection: "column",
|
|
3691
3707
|
gap: 8
|
|
3692
3708
|
},
|
|
3693
|
-
children: s.map((e, n) => /* @__PURE__ */ v(
|
|
3709
|
+
children: s.map((e, n) => /* @__PURE__ */ v(Bi, {
|
|
3694
3710
|
structDef: t,
|
|
3695
3711
|
value: e,
|
|
3696
3712
|
mode: "display",
|
|
@@ -3716,7 +3732,7 @@ function zi({ structDef: t, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3716
3732
|
role: "group",
|
|
3717
3733
|
children: [s.map((n, r) => /* @__PURE__ */ y("div", {
|
|
3718
3734
|
style: { position: "relative" },
|
|
3719
|
-
children: [/* @__PURE__ */ v(
|
|
3735
|
+
children: [/* @__PURE__ */ v(Bi, {
|
|
3720
3736
|
structDef: t,
|
|
3721
3737
|
value: n,
|
|
3722
3738
|
mode: "edit",
|
|
@@ -3744,16 +3760,16 @@ function zi({ structDef: t, value: n, mode: r, onChange: i, locale: a, fieldId:
|
|
|
3744
3760
|
}
|
|
3745
3761
|
//#endregion
|
|
3746
3762
|
//#region src/components/fields/SecretField.tsx
|
|
3747
|
-
var
|
|
3748
|
-
function
|
|
3749
|
-
let [s, c] = f(""), l = a !== void 0, u = n ===
|
|
3763
|
+
var Hi = "[SET]";
|
|
3764
|
+
function Ui({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3765
|
+
let [s, c] = f(""), l = a !== void 0, u = n === Hi || typeof n == "string" && n !== "";
|
|
3750
3766
|
return r === "display" ? u ? /* @__PURE__ */ v("span", {
|
|
3751
3767
|
className: "mono",
|
|
3752
3768
|
style: {
|
|
3753
3769
|
fontSize: 12.5,
|
|
3754
3770
|
color: "var(--text-3)"
|
|
3755
3771
|
},
|
|
3756
|
-
children:
|
|
3772
|
+
children: Hi
|
|
3757
3773
|
}) : /* @__PURE__ */ v("span", {
|
|
3758
3774
|
style: {
|
|
3759
3775
|
fontSize: 12.5,
|
|
@@ -3767,23 +3783,23 @@ function Vi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3767
3783
|
ariaRequired: e.required,
|
|
3768
3784
|
value: s,
|
|
3769
3785
|
onChange: (e) => {
|
|
3770
|
-
c(e), l && e === "" ? i?.(u ?
|
|
3786
|
+
c(e), l && e === "" ? i?.(u ? Hi : "") : i?.(e);
|
|
3771
3787
|
},
|
|
3772
3788
|
placeholder: l ? "Leave blank to keep existing value" : "Enter value"
|
|
3773
3789
|
});
|
|
3774
3790
|
}
|
|
3775
3791
|
//#endregion
|
|
3776
3792
|
//#region src/components/fields/PasswordField.tsx
|
|
3777
|
-
var
|
|
3778
|
-
function
|
|
3779
|
-
let [s, c] = f(""), l = a !== void 0, u = n ===
|
|
3793
|
+
var Wi = "[SET]";
|
|
3794
|
+
function Gi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
|
|
3795
|
+
let [s, c] = f(""), l = a !== void 0, u = n === Wi || typeof n == "string" && n !== "";
|
|
3780
3796
|
return r === "display" ? u ? /* @__PURE__ */ v("span", {
|
|
3781
3797
|
className: "mono",
|
|
3782
3798
|
style: {
|
|
3783
3799
|
fontSize: 12.5,
|
|
3784
3800
|
color: "var(--text-3)"
|
|
3785
3801
|
},
|
|
3786
|
-
children:
|
|
3802
|
+
children: Wi
|
|
3787
3803
|
}) : /* @__PURE__ */ v("span", {
|
|
3788
3804
|
style: {
|
|
3789
3805
|
fontSize: 12.5,
|
|
@@ -3797,18 +3813,18 @@ function Ui({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
|
|
|
3797
3813
|
ariaRequired: e.required,
|
|
3798
3814
|
value: s,
|
|
3799
3815
|
onChange: (e) => {
|
|
3800
|
-
c(e), l && e === "" ? i?.(u ?
|
|
3816
|
+
c(e), l && e === "" ? i?.(u ? Wi : "") : i?.(e);
|
|
3801
3817
|
},
|
|
3802
3818
|
placeholder: l ? "Leave blank to keep existing value" : "Enter password"
|
|
3803
3819
|
});
|
|
3804
3820
|
}
|
|
3805
3821
|
//#endregion
|
|
3806
3822
|
//#region src/components/fields/StringArrayField.tsx
|
|
3807
|
-
function
|
|
3823
|
+
function Ki(e) {
|
|
3808
3824
|
return Array.isArray(e) ? e.filter((e) => e != null).map(String) : [];
|
|
3809
3825
|
}
|
|
3810
|
-
function
|
|
3811
|
-
let s =
|
|
3826
|
+
function qi({ field: t, fieldName: n, value: r, mode: i, onChange: a, fieldId: o }) {
|
|
3827
|
+
let s = Ki(r), [c, l] = f("");
|
|
3812
3828
|
if (i === "display") return s.length === 0 ? /* @__PURE__ */ v("span", {
|
|
3813
3829
|
style: {
|
|
3814
3830
|
fontSize: 12.5,
|
|
@@ -3877,11 +3893,11 @@ function Gi({ field: t, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
|
|
|
3877
3893
|
}
|
|
3878
3894
|
//#endregion
|
|
3879
3895
|
//#region src/components/fields/IntArrayField.tsx
|
|
3880
|
-
function
|
|
3896
|
+
function Ji(e) {
|
|
3881
3897
|
return Array.isArray(e) ? e.filter((e) => e != null).map(Number).filter((e) => !isNaN(e)) : [];
|
|
3882
3898
|
}
|
|
3883
|
-
function
|
|
3884
|
-
let s =
|
|
3899
|
+
function Yi({ field: t, fieldName: n, value: r, mode: i, onChange: a, fieldId: o }) {
|
|
3900
|
+
let s = Ji(r), [c, l] = f("");
|
|
3885
3901
|
if (i === "display") return s.length === 0 ? /* @__PURE__ */ v("span", {
|
|
3886
3902
|
style: {
|
|
3887
3903
|
fontSize: 12.5,
|
|
@@ -3953,47 +3969,47 @@ function qi({ field: t, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
|
|
|
3953
3969
|
}
|
|
3954
3970
|
//#endregion
|
|
3955
3971
|
//#region src/lib/rich-text.ts
|
|
3956
|
-
var
|
|
3957
|
-
function
|
|
3958
|
-
return typeof e == "string" ? e :
|
|
3972
|
+
var Xi = /declarion:\/\/file\/([0-9a-fA-F-]{36})/g;
|
|
3973
|
+
function Zi(e) {
|
|
3974
|
+
return typeof e == "string" ? e : aa(e) && typeof e.markdown == "string" ? e.markdown : "";
|
|
3959
3975
|
}
|
|
3960
|
-
function
|
|
3976
|
+
function Qi(e, t) {
|
|
3961
3977
|
return {
|
|
3962
|
-
markdown:
|
|
3963
|
-
files:
|
|
3978
|
+
markdown: Zi(e),
|
|
3979
|
+
files: ta(t)
|
|
3964
3980
|
};
|
|
3965
3981
|
}
|
|
3966
|
-
function
|
|
3967
|
-
let n =
|
|
3982
|
+
function $i(e, t) {
|
|
3983
|
+
let n = Qi(e, null);
|
|
3968
3984
|
return n.files[t.id] = t, n;
|
|
3969
3985
|
}
|
|
3970
|
-
function
|
|
3971
|
-
let n =
|
|
3986
|
+
function ea(e, t) {
|
|
3987
|
+
let n = Qi(e, null);
|
|
3972
3988
|
for (let e of t) delete n.files[e];
|
|
3973
3989
|
return n;
|
|
3974
3990
|
}
|
|
3975
|
-
function
|
|
3991
|
+
function ta(e) {
|
|
3976
3992
|
if (!Array.isArray(e)) return {};
|
|
3977
3993
|
let t = {};
|
|
3978
|
-
for (let n of e)
|
|
3994
|
+
for (let n of e) aa(n) && typeof n.id == "string" && (t[n.id] = n);
|
|
3979
3995
|
return t;
|
|
3980
3996
|
}
|
|
3981
|
-
function
|
|
3997
|
+
function na(e) {
|
|
3982
3998
|
let t = /* @__PURE__ */ new Set(), n = [], r;
|
|
3983
|
-
for (
|
|
3999
|
+
for (Xi.lastIndex = 0; (r = Xi.exec(e)) !== null;) {
|
|
3984
4000
|
let e = r[1];
|
|
3985
4001
|
t.has(e) || (t.add(e), n.push(e));
|
|
3986
4002
|
}
|
|
3987
4003
|
return n;
|
|
3988
4004
|
}
|
|
3989
|
-
function
|
|
4005
|
+
function ra(e) {
|
|
3990
4006
|
return e ? /^declarion:\/\/file\/([0-9a-fA-F-]{36})$/.exec(e)?.[1] ?? null : null;
|
|
3991
4007
|
}
|
|
3992
|
-
function
|
|
4008
|
+
function ia(e) {
|
|
3993
4009
|
let t = `declarion://file/${e.id}`;
|
|
3994
4010
|
return e.content_type.startsWith("image/") ? `` : `[${e.filename || e.id}](${t})`;
|
|
3995
4011
|
}
|
|
3996
|
-
function
|
|
4012
|
+
function aa(e) {
|
|
3997
4013
|
return typeof e == "object" && !!e;
|
|
3998
4014
|
}
|
|
3999
4015
|
//#endregion
|
|
@@ -4005,10 +4021,10 @@ var Q = class extends Error {
|
|
|
4005
4021
|
super(n), this.code = t, this.status = e;
|
|
4006
4022
|
}
|
|
4007
4023
|
};
|
|
4008
|
-
async function
|
|
4024
|
+
async function oa(e) {
|
|
4009
4025
|
let t = ct();
|
|
4010
4026
|
try {
|
|
4011
|
-
return await
|
|
4027
|
+
return await sa(e, t ? await mt() : null);
|
|
4012
4028
|
} catch (n) {
|
|
4013
4029
|
if (!(n instanceof Q && n.status === 401 && (n.code === "TOKEN_REFRESH_NEEDED" || n.code === "UNAUTHORIZED"))) throw n;
|
|
4014
4030
|
let r = null;
|
|
@@ -4018,17 +4034,17 @@ async function ia(e) {
|
|
|
4018
4034
|
throw en()(), n;
|
|
4019
4035
|
}
|
|
4020
4036
|
try {
|
|
4021
|
-
return await
|
|
4037
|
+
return await sa(e, r);
|
|
4022
4038
|
} catch (e) {
|
|
4023
4039
|
throw e instanceof Q && e.status === 401 && en()(), e;
|
|
4024
4040
|
}
|
|
4025
4041
|
}
|
|
4026
4042
|
}
|
|
4027
|
-
function
|
|
4043
|
+
function sa(e, t) {
|
|
4028
4044
|
let { file: n, entityCode: r, fieldCode: i, slotCode: a, onProgress: o, signal: s } = e;
|
|
4029
4045
|
return new Promise((e, c) => {
|
|
4030
4046
|
let l = new XMLHttpRequest();
|
|
4031
|
-
if (l.open("POST",
|
|
4047
|
+
if (l.open("POST", ca(r, i, a)), l.withCredentials = t === null, t && l.setRequestHeader("Authorization", `Bearer ${t}`), l.upload.onprogress = (e) => {
|
|
4032
4048
|
if (!o) return;
|
|
4033
4049
|
let t = e.lengthComputable ? e.total : n.size, r = t > 0 ? Math.min(100, Math.round(e.loaded / t * 100)) : 0;
|
|
4034
4050
|
o({
|
|
@@ -4042,7 +4058,7 @@ function aa(e, t) {
|
|
|
4042
4058
|
n = t ? JSON.parse(t) : null;
|
|
4043
4059
|
} catch {}
|
|
4044
4060
|
if (l.status >= 200 && l.status < 300) {
|
|
4045
|
-
let t =
|
|
4061
|
+
let t = la(n);
|
|
4046
4062
|
if (!t || !t.id) {
|
|
4047
4063
|
c(new Q(l.status, "BAD_RESPONSE", "Upload returned no file id"));
|
|
4048
4064
|
return;
|
|
@@ -4067,56 +4083,56 @@ function aa(e, t) {
|
|
|
4067
4083
|
u.append("file", n, n.name), l.send(u);
|
|
4068
4084
|
});
|
|
4069
4085
|
}
|
|
4070
|
-
function
|
|
4086
|
+
function ca(e, t, n) {
|
|
4071
4087
|
let r = new URLSearchParams();
|
|
4072
4088
|
e && t && (r.set("entity_code", e), r.set("field_code", t), n && r.set("slot_code", n));
|
|
4073
4089
|
let i = r.toString();
|
|
4074
4090
|
return i ? `/api/files/upload?${i}` : "/api/files/upload";
|
|
4075
4091
|
}
|
|
4076
|
-
function
|
|
4077
|
-
return
|
|
4092
|
+
function la(e) {
|
|
4093
|
+
return da(e) ? da(e.result) ? la(e.result) : da(e.file) ? ua(e.file) : typeof e.id == "string" ? e : null : null;
|
|
4078
4094
|
}
|
|
4079
|
-
function
|
|
4080
|
-
let t =
|
|
4095
|
+
function ua(e) {
|
|
4096
|
+
let t = fa(e.file_id);
|
|
4081
4097
|
return t ? {
|
|
4082
4098
|
id: t,
|
|
4083
|
-
filename:
|
|
4084
|
-
content_type:
|
|
4085
|
-
size_bytes:
|
|
4086
|
-
sha256:
|
|
4087
|
-
dedup:
|
|
4099
|
+
filename: fa(e.filename_original) ?? fa(e.filename_normalized) ?? t,
|
|
4100
|
+
content_type: fa(e.content_type) ?? "application/octet-stream",
|
|
4101
|
+
size_bytes: pa(e.size_bytes) ?? 0,
|
|
4102
|
+
sha256: fa(e.sha256) ?? "",
|
|
4103
|
+
dedup: ma(e.dedup)
|
|
4088
4104
|
} : null;
|
|
4089
4105
|
}
|
|
4090
|
-
function
|
|
4106
|
+
function da(e) {
|
|
4091
4107
|
return typeof e == "object" && !!e;
|
|
4092
4108
|
}
|
|
4093
|
-
function
|
|
4109
|
+
function fa(e) {
|
|
4094
4110
|
return typeof e == "string" ? e : void 0;
|
|
4095
4111
|
}
|
|
4096
|
-
function
|
|
4112
|
+
function pa(e) {
|
|
4097
4113
|
return typeof e == "number" ? e : void 0;
|
|
4098
4114
|
}
|
|
4099
|
-
function
|
|
4115
|
+
function ma(e) {
|
|
4100
4116
|
return typeof e == "boolean" ? e : void 0;
|
|
4101
4117
|
}
|
|
4102
|
-
async function
|
|
4118
|
+
async function ha(e) {
|
|
4103
4119
|
await q("files.discard", { file_id: e });
|
|
4104
4120
|
}
|
|
4105
|
-
function
|
|
4121
|
+
function ga(e, t, n) {
|
|
4106
4122
|
if (n && e.size > n) return {
|
|
4107
4123
|
code: "FILE_TOO_LARGE",
|
|
4108
|
-
message: `File is ${
|
|
4124
|
+
message: `File is ${va(e.size)}, max ${va(n)}`
|
|
4109
4125
|
};
|
|
4110
4126
|
if (t && t.length > 0) {
|
|
4111
4127
|
let n = e.type || "application/octet-stream";
|
|
4112
|
-
if (!t.some((e) =>
|
|
4128
|
+
if (!t.some((e) => _a(e, n))) return {
|
|
4113
4129
|
code: "MIME_NOT_ACCEPTED",
|
|
4114
4130
|
message: `File type ${n} is not accepted`
|
|
4115
4131
|
};
|
|
4116
4132
|
}
|
|
4117
4133
|
return null;
|
|
4118
4134
|
}
|
|
4119
|
-
function
|
|
4135
|
+
function _a(e, t) {
|
|
4120
4136
|
if (e === "*/*" || e === "*") return !0;
|
|
4121
4137
|
if (e.endsWith("/*")) {
|
|
4122
4138
|
let n = e.slice(0, e.length - 1);
|
|
@@ -4124,7 +4140,7 @@ function ha(e, t) {
|
|
|
4124
4140
|
}
|
|
4125
4141
|
return e === t;
|
|
4126
4142
|
}
|
|
4127
|
-
function
|
|
4143
|
+
function va(e) {
|
|
4128
4144
|
if (e < 1024) return `${e} B`;
|
|
4129
4145
|
let t = [
|
|
4130
4146
|
"KB",
|
|
@@ -4136,7 +4152,7 @@ function ga(e) {
|
|
|
4136
4152
|
}
|
|
4137
4153
|
//#endregion
|
|
4138
4154
|
//#region src/components/file-widgets/draft-scope.tsx
|
|
4139
|
-
var
|
|
4155
|
+
var ya = r({
|
|
4140
4156
|
registerDraft() {},
|
|
4141
4157
|
unregisterDraft() {},
|
|
4142
4158
|
hasDraft() {
|
|
@@ -4145,7 +4161,7 @@ var _a = r({
|
|
|
4145
4161
|
flushAllDrafts: async () => {},
|
|
4146
4162
|
markCommitted() {}
|
|
4147
4163
|
});
|
|
4148
|
-
function
|
|
4164
|
+
function ba({ children: e }) {
|
|
4149
4165
|
let t = d(/* @__PURE__ */ new Map()), n = u(() => ({
|
|
4150
4166
|
registerDraft(e) {
|
|
4151
4167
|
t.current.set(e.fileId, e);
|
|
@@ -4164,16 +4180,16 @@ function va({ children: e }) {
|
|
|
4164
4180
|
t.current.clear(), await Promise.allSettled(e.map((e) => Promise.resolve(e.discard())));
|
|
4165
4181
|
}
|
|
4166
4182
|
}), []);
|
|
4167
|
-
return /* @__PURE__ */ v(
|
|
4183
|
+
return /* @__PURE__ */ v(ya.Provider, {
|
|
4168
4184
|
value: n,
|
|
4169
4185
|
children: e
|
|
4170
4186
|
});
|
|
4171
4187
|
}
|
|
4172
|
-
function
|
|
4173
|
-
return s(
|
|
4188
|
+
function xa() {
|
|
4189
|
+
return s(ya);
|
|
4174
4190
|
}
|
|
4175
|
-
function
|
|
4176
|
-
let e =
|
|
4191
|
+
function Sa() {
|
|
4192
|
+
let e = xa();
|
|
4177
4193
|
return {
|
|
4178
4194
|
register: o((t, n) => {
|
|
4179
4195
|
e.registerDraft({
|
|
@@ -4192,17 +4208,17 @@ function ba() {
|
|
|
4192
4208
|
}
|
|
4193
4209
|
//#endregion
|
|
4194
4210
|
//#region src/components/fields/RichTextField.tsx
|
|
4195
|
-
function
|
|
4196
|
-
let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: p } = t, m = d(null), h = d(null), g = d(/* @__PURE__ */ new Map()), _ = d(/* @__PURE__ */ new Set()), [b, x] = f(0), [S, C] = f(null), { register: w, unregister: E } =
|
|
4197
|
-
let n = new Set(
|
|
4211
|
+
function Ca(t) {
|
|
4212
|
+
let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: p } = t, m = d(null), h = d(null), g = d(/* @__PURE__ */ new Map()), _ = d(/* @__PURE__ */ new Set()), [b, x] = f(0), [S, C] = f(null), { register: w, unregister: E } = Sa(), D = c?.$files?.[i], O = u(() => Qi(a, D), [D, a]), k = O.markdown, ee = n.files?.accepts, te = n.files?.max_size_bytes, A = (e, t = O.files) => {
|
|
4213
|
+
let n = new Set(na(e)), r = [];
|
|
4198
4214
|
for (let e of _.current) n.has(e) || r.push(e);
|
|
4199
4215
|
if (r.length > 0) {
|
|
4200
4216
|
for (let e of r) {
|
|
4201
|
-
_.current.delete(e), E(e),
|
|
4217
|
+
_.current.delete(e), E(e), ha(e).catch(() => {});
|
|
4202
4218
|
let t = g.current.get(e);
|
|
4203
4219
|
t && (URL.revokeObjectURL(t), g.current.delete(e));
|
|
4204
4220
|
}
|
|
4205
|
-
s?.(
|
|
4221
|
+
s?.(ea({
|
|
4206
4222
|
markdown: e,
|
|
4207
4223
|
files: t
|
|
4208
4224
|
}, r));
|
|
@@ -4214,7 +4230,7 @@ function xa(t) {
|
|
|
4214
4230
|
});
|
|
4215
4231
|
}, ne = (e, t, n) => {
|
|
4216
4232
|
let r = m.current, i = r?.selectionStart ?? e.markdown.length, a = r?.selectionEnd ?? e.markdown.length;
|
|
4217
|
-
A(`${e.markdown.slice(0, i)}${t}${e.markdown.slice(a)}`, n ?
|
|
4233
|
+
A(`${e.markdown.slice(0, i)}${t}${e.markdown.slice(a)}`, n ? $i(e, n).files : e.files), requestAnimationFrame(() => {
|
|
4218
4234
|
if (!r) return;
|
|
4219
4235
|
let e = i + t.length;
|
|
4220
4236
|
r.focus(), r.setSelectionRange(e, e);
|
|
@@ -4229,28 +4245,28 @@ function xa(t) {
|
|
|
4229
4245
|
files: O.files
|
|
4230
4246
|
};
|
|
4231
4247
|
for (let e of t) {
|
|
4232
|
-
let n =
|
|
4248
|
+
let n = ga(e, ee, te);
|
|
4233
4249
|
if (n) {
|
|
4234
4250
|
C(n.message), x((e) => e - 1);
|
|
4235
4251
|
continue;
|
|
4236
4252
|
}
|
|
4237
4253
|
try {
|
|
4238
|
-
let n = await
|
|
4254
|
+
let n = await oa({
|
|
4239
4255
|
file: e,
|
|
4240
4256
|
entityCode: r,
|
|
4241
4257
|
fieldCode: i
|
|
4242
4258
|
}), o = e.type.startsWith("image/") ? URL.createObjectURL(e) : void 0;
|
|
4243
4259
|
o && g.current.set(n.id, o);
|
|
4244
|
-
let s =
|
|
4245
|
-
if (w(n.id, () =>
|
|
4246
|
-
let e =
|
|
4247
|
-
ne(a, e, s), a =
|
|
4260
|
+
let s = Ta(n, o);
|
|
4261
|
+
if (w(n.id, () => ha(n.id)), _.current.add(n.id), t.length === 1) {
|
|
4262
|
+
let e = wa(a.markdown, ia(s));
|
|
4263
|
+
ne(a, e, s), a = $i({
|
|
4248
4264
|
markdown: `${a.markdown}${e}`,
|
|
4249
4265
|
files: a.files
|
|
4250
4266
|
}, s);
|
|
4251
4267
|
} else {
|
|
4252
|
-
let e =
|
|
4253
|
-
a =
|
|
4268
|
+
let e = wa(a.markdown, ia(s));
|
|
4269
|
+
a = $i({
|
|
4254
4270
|
markdown: `${a.markdown}${e}`,
|
|
4255
4271
|
files: a.files
|
|
4256
4272
|
}, s), A(a.markdown, a.files);
|
|
@@ -4262,7 +4278,7 @@ function xa(t) {
|
|
|
4262
4278
|
}
|
|
4263
4279
|
}
|
|
4264
4280
|
};
|
|
4265
|
-
return o === "display" ? k ? /* @__PURE__ */ v(
|
|
4281
|
+
return o === "display" ? k ? /* @__PURE__ */ v(Zr, {
|
|
4266
4282
|
content: k,
|
|
4267
4283
|
files: O.files
|
|
4268
4284
|
}) : /* @__PURE__ */ v("span", {
|
|
@@ -4377,7 +4393,7 @@ function xa(t) {
|
|
|
4377
4393
|
marginBottom: 8
|
|
4378
4394
|
},
|
|
4379
4395
|
children: "Preview"
|
|
4380
|
-
}), k ? /* @__PURE__ */ v(
|
|
4396
|
+
}), k ? /* @__PURE__ */ v(Zr, {
|
|
4381
4397
|
content: k,
|
|
4382
4398
|
files: O.files
|
|
4383
4399
|
}) : /* @__PURE__ */ v("span", {
|
|
@@ -4391,10 +4407,10 @@ function xa(t) {
|
|
|
4391
4407
|
]
|
|
4392
4408
|
});
|
|
4393
4409
|
}
|
|
4394
|
-
function
|
|
4410
|
+
function wa(e, t) {
|
|
4395
4411
|
return e ? e.endsWith("\n\n") ? t : e.endsWith("\n") ? `\n${t}` : `\n\n${t}` : `${t}\n`;
|
|
4396
4412
|
}
|
|
4397
|
-
function
|
|
4413
|
+
function Ta(e, t) {
|
|
4398
4414
|
return {
|
|
4399
4415
|
id: e.id,
|
|
4400
4416
|
filename: e.filename,
|
|
@@ -4409,8 +4425,8 @@ function Ca(e, t) {
|
|
|
4409
4425
|
}
|
|
4410
4426
|
//#endregion
|
|
4411
4427
|
//#region src/components/fields/cells/factories/text.ts
|
|
4412
|
-
var
|
|
4413
|
-
let { field: t, fieldName: n, locale: r = "en" } = e, i =
|
|
4428
|
+
var Ea = () => (e) => e == null || e === "" ? "—" : F(e), Da = (e) => {
|
|
4429
|
+
let { field: t, fieldName: n, locale: r = "en" } = e, i = Oa(t, n, r);
|
|
4414
4430
|
return (e) => {
|
|
4415
4431
|
if (e == null) return "—";
|
|
4416
4432
|
let t = !!e;
|
|
@@ -4421,7 +4437,7 @@ var wa = () => (e) => e == null || e === "" ? "—" : F(e), Ta = (e) => {
|
|
|
4421
4437
|
});
|
|
4422
4438
|
};
|
|
4423
4439
|
};
|
|
4424
|
-
function
|
|
4440
|
+
function Oa(e, t, n) {
|
|
4425
4441
|
if (e.display?.bool_labels) return {
|
|
4426
4442
|
trueLabel: I(e.display.bool_labels.true, n) || "Yes",
|
|
4427
4443
|
falseLabel: I(e.display.bool_labels.false, n) || "No"
|
|
@@ -4442,14 +4458,14 @@ function Ea(e, t, n) {
|
|
|
4442
4458
|
};
|
|
4443
4459
|
}
|
|
4444
4460
|
if (t.startsWith("is_")) {
|
|
4445
|
-
let e =
|
|
4461
|
+
let e = ka(t.slice(3));
|
|
4446
4462
|
return {
|
|
4447
4463
|
trueLabel: e,
|
|
4448
4464
|
falseLabel: `Not ${e}`
|
|
4449
4465
|
};
|
|
4450
4466
|
}
|
|
4451
4467
|
if (t.startsWith("has_")) {
|
|
4452
|
-
let e =
|
|
4468
|
+
let e = ka(t.slice(4));
|
|
4453
4469
|
return {
|
|
4454
4470
|
trueLabel: e,
|
|
4455
4471
|
falseLabel: `No ${e}`
|
|
@@ -4460,12 +4476,12 @@ function Ea(e, t, n) {
|
|
|
4460
4476
|
falseLabel: "No"
|
|
4461
4477
|
};
|
|
4462
4478
|
}
|
|
4463
|
-
function
|
|
4479
|
+
function ka(e) {
|
|
4464
4480
|
return e.split("_").map((e) => e && e[0].toUpperCase() + e.slice(1)).join(" ");
|
|
4465
4481
|
}
|
|
4466
4482
|
//#endregion
|
|
4467
4483
|
//#region src/components/fields/cells/factories/badge.tsx
|
|
4468
|
-
var
|
|
4484
|
+
var Aa = /* @__PURE__ */ new Set([
|
|
4469
4485
|
"indigo",
|
|
4470
4486
|
"emerald",
|
|
4471
4487
|
"amber",
|
|
@@ -4475,17 +4491,17 @@ var Oa = /* @__PURE__ */ new Set([
|
|
|
4475
4491
|
"slate",
|
|
4476
4492
|
"teal"
|
|
4477
4493
|
]);
|
|
4478
|
-
function
|
|
4479
|
-
return e &&
|
|
4494
|
+
function ja(e) {
|
|
4495
|
+
return e && Aa.has(e) ? e : "slate";
|
|
4480
4496
|
}
|
|
4481
|
-
var
|
|
4497
|
+
var Ma = (e) => {
|
|
4482
4498
|
let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4483
4499
|
if (t.values) for (let e of t.values) r.set(e.code, {
|
|
4484
|
-
tone:
|
|
4500
|
+
tone: ja(e.color),
|
|
4485
4501
|
label: I(e.name, n) || e.code
|
|
4486
4502
|
});
|
|
4487
4503
|
if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) {
|
|
4488
|
-
let t = r.get(e), a = i.color ?
|
|
4504
|
+
let t = r.get(e), a = i.color ? ja(i.color) : t?.tone ?? "slate", o = (i.label ? I(i.label, n) : "") || t?.label || e;
|
|
4489
4505
|
r.set(e, {
|
|
4490
4506
|
tone: a,
|
|
4491
4507
|
label: o
|
|
@@ -4500,7 +4516,7 @@ var Aa = (e) => {
|
|
|
4500
4516
|
children: n?.label ?? t
|
|
4501
4517
|
});
|
|
4502
4518
|
};
|
|
4503
|
-
},
|
|
4519
|
+
}, Na = /* @__PURE__ */ new Set([
|
|
4504
4520
|
"indigo",
|
|
4505
4521
|
"emerald",
|
|
4506
4522
|
"amber",
|
|
@@ -4510,13 +4526,13 @@ var Aa = (e) => {
|
|
|
4510
4526
|
"slate",
|
|
4511
4527
|
"teal"
|
|
4512
4528
|
]);
|
|
4513
|
-
function
|
|
4514
|
-
return e &&
|
|
4529
|
+
function Pa(e) {
|
|
4530
|
+
return e && Na.has(e) ? e : "slate";
|
|
4515
4531
|
}
|
|
4516
|
-
var
|
|
4532
|
+
var Fa = (e) => {
|
|
4517
4533
|
let { entity: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4518
4534
|
if (t?.status_groups) for (let e of Object.values(t.status_groups)) for (let t of e.statuses) r.set(t.code, {
|
|
4519
|
-
tone:
|
|
4535
|
+
tone: Pa(t.color),
|
|
4520
4536
|
label: I(t.name, n) || t.code
|
|
4521
4537
|
});
|
|
4522
4538
|
return (e) => {
|
|
@@ -4528,7 +4544,7 @@ var Na = (e) => {
|
|
|
4528
4544
|
children: n?.label ?? t
|
|
4529
4545
|
});
|
|
4530
4546
|
};
|
|
4531
|
-
},
|
|
4547
|
+
}, Ia = /* @__PURE__ */ new Set([
|
|
4532
4548
|
"indigo",
|
|
4533
4549
|
"emerald",
|
|
4534
4550
|
"amber",
|
|
@@ -4538,14 +4554,14 @@ var Na = (e) => {
|
|
|
4538
4554
|
"slate",
|
|
4539
4555
|
"teal"
|
|
4540
4556
|
]);
|
|
4541
|
-
function
|
|
4542
|
-
return e &&
|
|
4557
|
+
function La(e) {
|
|
4558
|
+
return e && Ia.has(e) ? e : null;
|
|
4543
4559
|
}
|
|
4544
|
-
var
|
|
4560
|
+
var Ra = (e) => {
|
|
4545
4561
|
let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
|
|
4546
4562
|
if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) r.set(e, {
|
|
4547
4563
|
label: i.label && I(i.label, n) || e,
|
|
4548
|
-
tone:
|
|
4564
|
+
tone: La(i.color)
|
|
4549
4565
|
});
|
|
4550
4566
|
return (e) => !Array.isArray(e) || e.length === 0 ? "—" : /* @__PURE__ */ v("span", {
|
|
4551
4567
|
style: {
|
|
@@ -4562,23 +4578,23 @@ var Ia = (e) => {
|
|
|
4562
4578
|
}, `${n}-${t}`) : /* @__PURE__ */ v(M, { children: i?.label ?? n }, `${n}-${t}`);
|
|
4563
4579
|
})
|
|
4564
4580
|
});
|
|
4565
|
-
},
|
|
4581
|
+
}, za = () => (e) => {
|
|
4566
4582
|
if (e == null || e === "") return "—";
|
|
4567
|
-
let { text: t, absolute: n } =
|
|
4583
|
+
let { text: t, absolute: n } = ui(typeof e == "string" ? e : F(e));
|
|
4568
4584
|
return /* @__PURE__ */ v("span", {
|
|
4569
4585
|
title: n,
|
|
4570
4586
|
children: t
|
|
4571
4587
|
});
|
|
4572
|
-
},
|
|
4588
|
+
}, Ba = () => (e) => e == null || e === "" ? "—" : li(typeof e == "string" ? e : F(e)), Va = 60 * 1e3, Ha = 300 * 1e3, Ua = () => (e) => {
|
|
4573
4589
|
if (e == null || e === "") return "—";
|
|
4574
4590
|
let t = typeof e == "string" ? e : F(e), n = new Date(t);
|
|
4575
4591
|
if (isNaN(n.getTime())) return t;
|
|
4576
|
-
let r =
|
|
4592
|
+
let r = li(t), i = Date.now() - n.getTime();
|
|
4577
4593
|
if (i <= 0) return /* @__PURE__ */ y("span", {
|
|
4578
4594
|
title: r,
|
|
4579
4595
|
children: ["in ", S(n, /* @__PURE__ */ new Date(), { addSuffix: !1 })]
|
|
4580
4596
|
});
|
|
4581
|
-
if (i <=
|
|
4597
|
+
if (i <= Va) return /* @__PURE__ */ v("span", {
|
|
4582
4598
|
title: r,
|
|
4583
4599
|
children: /* @__PURE__ */ v(D, {
|
|
4584
4600
|
tone: "slate",
|
|
@@ -4590,13 +4606,13 @@ var Ia = (e) => {
|
|
|
4590
4606
|
return /* @__PURE__ */ v("span", {
|
|
4591
4607
|
title: r,
|
|
4592
4608
|
children: /* @__PURE__ */ y(D, {
|
|
4593
|
-
tone: i <=
|
|
4609
|
+
tone: i <= Ha ? "amber" : "rose",
|
|
4594
4610
|
size: "xs",
|
|
4595
4611
|
children: ["overdue ", a]
|
|
4596
4612
|
})
|
|
4597
4613
|
});
|
|
4598
|
-
},
|
|
4599
|
-
let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a =
|
|
4614
|
+
}, Wa = (e) => {
|
|
4615
|
+
let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a = Ga(t.display?.currency_display), o = Ka(typeof t.scale == "number" ? t.scale : 2, 0, 6), s = /* @__PURE__ */ new Map();
|
|
4600
4616
|
return (e, t = {}) => {
|
|
4601
4617
|
if (e == null || e === "") return "—";
|
|
4602
4618
|
let c = typeof e == "number" ? e : Number(e);
|
|
@@ -4611,7 +4627,7 @@ var Ia = (e) => {
|
|
|
4611
4627
|
}), s.set(d, f)), f.format(c);
|
|
4612
4628
|
};
|
|
4613
4629
|
};
|
|
4614
|
-
function
|
|
4630
|
+
function Ga(e) {
|
|
4615
4631
|
switch (e) {
|
|
4616
4632
|
case "narrow_symbol": return "narrowSymbol";
|
|
4617
4633
|
case "code":
|
|
@@ -4620,16 +4636,16 @@ function Ua(e) {
|
|
|
4620
4636
|
default: return "symbol";
|
|
4621
4637
|
}
|
|
4622
4638
|
}
|
|
4623
|
-
function
|
|
4639
|
+
function Ka(e, t, n) {
|
|
4624
4640
|
return e < t ? t : e > n ? n : e;
|
|
4625
4641
|
}
|
|
4626
4642
|
//#endregion
|
|
4627
4643
|
//#region src/components/fields/cells/factories/refLink.tsx
|
|
4628
|
-
var
|
|
4644
|
+
var qa = (e) => {
|
|
4629
4645
|
let { field: n, entities: r, screens: i, refs: a, surface: o } = e, s = n.ref?.entity, c = s ? r?.[s] : void 0, l = typeof a == "function" ? a : () => a, u = o === "detail", d = c?.display?.icon, f = n.display?.ref_display_field ?? n.ref?.display?.field ?? c?.display?.display_field, p = c?.detail_screen, m = (p ? i?.[p] : void 0)?.route;
|
|
4630
4646
|
return (e, n) => {
|
|
4631
4647
|
if (e == null || e === "") return "—";
|
|
4632
|
-
let r = F(e), i =
|
|
4648
|
+
let r = F(e), i = Ja(r, s, l(), f), a = m ? m.replace(":id", encodeURIComponent(r)) : void 0;
|
|
4633
4649
|
if (u) {
|
|
4634
4650
|
let e = /* @__PURE__ */ y(_, { children: [d && /* @__PURE__ */ v("span", {
|
|
4635
4651
|
style: {
|
|
@@ -4671,29 +4687,29 @@ var Ga = (e) => {
|
|
|
4671
4687
|
}) : i;
|
|
4672
4688
|
};
|
|
4673
4689
|
};
|
|
4674
|
-
function
|
|
4690
|
+
function Ja(e, t, n, r) {
|
|
4675
4691
|
let i = t && n ? n[t]?.[e] : void 0;
|
|
4676
4692
|
return i ? L(i, r, e) : e;
|
|
4677
4693
|
}
|
|
4678
4694
|
//#endregion
|
|
4679
4695
|
//#region src/components/fields/cells/factories/url-helpers.ts
|
|
4680
|
-
var
|
|
4681
|
-
function
|
|
4682
|
-
return /^[a-z]{2,3}$/i.test(e) ||
|
|
4696
|
+
var Ya = /^(https?|ftps?|ssh|mailto|tel):/i, Xa = /^(info|name|tech|site|cloud|online|store|shop|blog|space|world|link|live|page|zone|life|team|work|host|land|news|wiki|mobi|coop|aero|asia)$/i;
|
|
4697
|
+
function Za(e) {
|
|
4698
|
+
return /^[a-z]{2,3}$/i.test(e) || Xa.test(e);
|
|
4683
4699
|
}
|
|
4684
|
-
function
|
|
4700
|
+
function Qa(e) {
|
|
4685
4701
|
if (!e.includes(".")) return !1;
|
|
4686
4702
|
let t = e.split(".");
|
|
4687
4703
|
if (t.length < 3) return !0;
|
|
4688
4704
|
let n = t[0].toLowerCase();
|
|
4689
|
-
return /^(com|org|net|edu|gov)$/.test(n) ? !1 : /^(io|app|dev)$/.test(n) ?
|
|
4705
|
+
return /^(com|org|net|edu|gov)$/.test(n) ? !1 : /^(io|app|dev)$/.test(n) ? Za(t[t.length - 1]) : !0;
|
|
4690
4706
|
}
|
|
4691
|
-
function
|
|
4692
|
-
if (
|
|
4707
|
+
function $a(e) {
|
|
4708
|
+
if (Ya.test(e)) return e;
|
|
4693
4709
|
let t = e.match(/^([a-z][a-z0-9+.-]*):/i);
|
|
4694
4710
|
if (t) {
|
|
4695
4711
|
let n = t[1], r = e.slice(t[0].length);
|
|
4696
|
-
if (/^\d+([/?#]|$)/.test(r) &&
|
|
4712
|
+
if (/^\d+([/?#]|$)/.test(r) && Qa(n)) {
|
|
4697
4713
|
let t = parseInt(r, 10);
|
|
4698
4714
|
if (t >= 1 && t <= 65535) return `https://${e}`;
|
|
4699
4715
|
}
|
|
@@ -4701,14 +4717,14 @@ function Za(e) {
|
|
|
4701
4717
|
}
|
|
4702
4718
|
return `https://${e}`;
|
|
4703
4719
|
}
|
|
4704
|
-
function
|
|
4720
|
+
function eo(e) {
|
|
4705
4721
|
try {
|
|
4706
4722
|
return new URL(e).hostname.replace(/^www\./i, "") || null;
|
|
4707
4723
|
} catch {
|
|
4708
4724
|
return null;
|
|
4709
4725
|
}
|
|
4710
4726
|
}
|
|
4711
|
-
function
|
|
4727
|
+
function to(e, t) {
|
|
4712
4728
|
if (t !== "linkedin.com") return null;
|
|
4713
4729
|
try {
|
|
4714
4730
|
let t = new URL(e).pathname.match(/^\/(in|company|school)\/([^/]+)/i);
|
|
@@ -4716,7 +4732,7 @@ function $a(e, t) {
|
|
|
4716
4732
|
} catch {}
|
|
4717
4733
|
return null;
|
|
4718
4734
|
}
|
|
4719
|
-
function
|
|
4735
|
+
function no(e) {
|
|
4720
4736
|
try {
|
|
4721
4737
|
return new URL(e), !0;
|
|
4722
4738
|
} catch {
|
|
@@ -4725,7 +4741,7 @@ function eo(e) {
|
|
|
4725
4741
|
}
|
|
4726
4742
|
//#endregion
|
|
4727
4743
|
//#region src/components/fields/cells/factories/host-icons.tsx
|
|
4728
|
-
function
|
|
4744
|
+
function ro(e, t = "0 0 24 24") {
|
|
4729
4745
|
return (n) => /* @__PURE__ */ v("svg", {
|
|
4730
4746
|
width: 16,
|
|
4731
4747
|
height: 16,
|
|
@@ -4741,11 +4757,11 @@ function to(e, t = "0 0 24 24") {
|
|
|
4741
4757
|
children: e
|
|
4742
4758
|
});
|
|
4743
4759
|
}
|
|
4744
|
-
var
|
|
4760
|
+
var io = ro(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
4745
4761
|
cx: "12",
|
|
4746
4762
|
cy: "12",
|
|
4747
4763
|
r: "9"
|
|
4748
|
-
}), /* @__PURE__ */ v("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })),
|
|
4764
|
+
}), /* @__PURE__ */ v("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), ao = (e) => /* @__PURE__ */ v("svg", {
|
|
4749
4765
|
width: 16,
|
|
4750
4766
|
height: 16,
|
|
4751
4767
|
viewBox: "0 0 24 24",
|
|
@@ -4754,7 +4770,7 @@ var no = to(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4754
4770
|
style: { flexShrink: 0 },
|
|
4755
4771
|
...e,
|
|
4756
4772
|
children: /* @__PURE__ */ v("path", { d: "M20.45 20.45h-3.55v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.13 1.45-2.13 2.94v5.67H9.36V9h3.41v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.12 2.06 2.06 0 0 1 0 4.12zM7.12 20.45H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z" })
|
|
4757
|
-
}),
|
|
4773
|
+
}), oo = (e) => /* @__PURE__ */ v("svg", {
|
|
4758
4774
|
width: 16,
|
|
4759
4775
|
height: 16,
|
|
4760
4776
|
viewBox: "0 0 24 24",
|
|
@@ -4763,7 +4779,7 @@ var no = to(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4763
4779
|
style: { flexShrink: 0 },
|
|
4764
4780
|
...e,
|
|
4765
4781
|
children: /* @__PURE__ */ v("path", { d: "M12 .5a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56 0-.27-.01-1-.02-1.96-3.21.7-3.89-1.55-3.89-1.55-.52-1.34-1.28-1.7-1.28-1.7-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.2 1.77 1.2 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.26-1.28-5.26-5.71 0-1.26.45-2.3 1.19-3.11-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.19a11.05 11.05 0 0 1 5.79 0c2.21-1.5 3.18-1.19 3.18-1.19.63 1.59.23 2.76.11 3.05.74.81 1.19 1.85 1.19 3.11 0 4.44-2.71 5.42-5.29 5.7.41.36.78 1.07.78 2.16 0 1.56-.01 2.81-.01 3.19 0 .31.21.68.8.56A11.5 11.5 0 0 0 12 .5z" })
|
|
4766
|
-
}),
|
|
4782
|
+
}), so = (e) => /* @__PURE__ */ v("svg", {
|
|
4767
4783
|
width: 16,
|
|
4768
4784
|
height: 16,
|
|
4769
4785
|
viewBox: "0 0 24 24",
|
|
@@ -4772,7 +4788,7 @@ var no = to(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4772
4788
|
style: { flexShrink: 0 },
|
|
4773
4789
|
...e,
|
|
4774
4790
|
children: /* @__PURE__ */ v("path", { d: "M18.244 2H21.5l-7.62 8.71L23 22h-7.05l-5.52-7.21L4.07 22H.81l8.18-9.34L1 2h7.22l5 6.59L18.244 2zm-2.47 18h1.95L7.32 4h-2.1l10.55 16z" })
|
|
4775
|
-
}),
|
|
4791
|
+
}), co = (e) => /* @__PURE__ */ v("svg", {
|
|
4776
4792
|
width: 16,
|
|
4777
4793
|
height: 16,
|
|
4778
4794
|
viewBox: "0 0 24 24",
|
|
@@ -4781,7 +4797,7 @@ var no = to(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4781
4797
|
style: { flexShrink: 0 },
|
|
4782
4798
|
...e,
|
|
4783
4799
|
children: /* @__PURE__ */ v("path", { d: "M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.6 12 3.6 12 3.6s-7.5 0-9.4.5A3 3 0 0 0 .5 6.2C0 8.1 0 12 0 12s0 3.9.5 5.8a3 3 0 0 0 2.1 2.1c1.9.5 9.4.5 9.4.5s7.5 0 9.4-.5a3 3 0 0 0 2.1-2.1c.5-1.9.5-5.8.5-5.8s0-3.9-.5-5.8zM9.6 15.6V8.4l6.2 3.6-6.2 3.6z" })
|
|
4784
|
-
}),
|
|
4800
|
+
}), lo = (e) => /* @__PURE__ */ v("svg", {
|
|
4785
4801
|
width: 16,
|
|
4786
4802
|
height: 16,
|
|
4787
4803
|
viewBox: "0 0 24 24",
|
|
@@ -4790,7 +4806,7 @@ var no = to(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4790
4806
|
style: { flexShrink: 0 },
|
|
4791
4807
|
...e,
|
|
4792
4808
|
children: /* @__PURE__ */ v("path", { d: "M24 5.45v13.1A1.45 1.45 0 0 1 22.55 20H19.5V9.27L12 14.7 4.5 9.27V20H1.45A1.45 1.45 0 0 1 0 18.55V5.45A1.45 1.45 0 0 1 1.45 4h.5l10.05 7.27L22.05 4h.5A1.45 1.45 0 0 1 24 5.45z" })
|
|
4793
|
-
}),
|
|
4809
|
+
}), uo = (e) => /* @__PURE__ */ y("svg", {
|
|
4794
4810
|
width: 16,
|
|
4795
4811
|
height: 16,
|
|
4796
4812
|
viewBox: "0 0 24 24",
|
|
@@ -4815,7 +4831,7 @@ var no = to(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4815
4831
|
d: "M15.17 18.96a2.52 2.52 0 1 1-2.52 2.52v-2.52h2.52zm0-1.27a2.52 2.52 0 1 1 0-5.04h6.31a2.52 2.52 0 1 1 0 5.04h-6.31z"
|
|
4816
4832
|
})
|
|
4817
4833
|
]
|
|
4818
|
-
}),
|
|
4834
|
+
}), fo = (e) => /* @__PURE__ */ v("svg", {
|
|
4819
4835
|
width: 16,
|
|
4820
4836
|
height: 16,
|
|
4821
4837
|
viewBox: "0 0 24 24",
|
|
@@ -4824,39 +4840,39 @@ var no = to(/* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("circle", {
|
|
|
4824
4840
|
style: { flexShrink: 0 },
|
|
4825
4841
|
...e,
|
|
4826
4842
|
children: /* @__PURE__ */ v("path", { d: "M4.46 3.83 14.94 3a3.7 3.7 0 0 1 2.5.62l3 2.16a1.4 1.4 0 0 1 .56 1.31v13.06a1.7 1.7 0 0 1-1.66 1.7l-12.5.78a2.4 2.4 0 0 1-1.85-.62L2.5 19.7a1.7 1.7 0 0 1-.5-1.2V5.16c0-.74.6-1.27 1.46-1.33l1-.01zm.46 1.86c-.31 0-.46.16-.46.47v12.25c0 .31.16.47.46.47l11.62-.7c.31 0 .46-.16.46-.47V6c0-.32-.16-.47-.46-.47L4.92 5.7zm5.57 2.32c.16 0 .31.16.31.31v.46l3.7.23c.31 0 .46.16.46.47v8.32c0 .31-.16.47-.46.47l-3.7.23c-.31 0-.46-.16-.46-.47V8.78c0-.16.15-.32.15-.46l-.04-.31z" })
|
|
4827
|
-
}),
|
|
4828
|
-
"linkedin.com":
|
|
4829
|
-
"github.com":
|
|
4830
|
-
"x.com":
|
|
4831
|
-
"twitter.com":
|
|
4832
|
-
"youtube.com":
|
|
4833
|
-
"youtu.be":
|
|
4834
|
-
"gmail.com":
|
|
4835
|
-
"mail.google.com":
|
|
4836
|
-
"slack.com":
|
|
4837
|
-
"notion.so":
|
|
4838
|
-
"notion.com":
|
|
4843
|
+
}), po = {
|
|
4844
|
+
"linkedin.com": ao,
|
|
4845
|
+
"github.com": oo,
|
|
4846
|
+
"x.com": so,
|
|
4847
|
+
"twitter.com": so,
|
|
4848
|
+
"youtube.com": co,
|
|
4849
|
+
"youtu.be": co,
|
|
4850
|
+
"gmail.com": lo,
|
|
4851
|
+
"mail.google.com": lo,
|
|
4852
|
+
"slack.com": uo,
|
|
4853
|
+
"notion.so": fo,
|
|
4854
|
+
"notion.com": fo
|
|
4839
4855
|
};
|
|
4840
|
-
function
|
|
4856
|
+
function mo(e, t) {
|
|
4841
4857
|
return !e || t === "none" ? null : t === "google" ? `https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=32` : `https://${e}/favicon.ico`;
|
|
4842
4858
|
}
|
|
4843
|
-
var
|
|
4859
|
+
var ho = {
|
|
4844
4860
|
width: 16,
|
|
4845
4861
|
height: 16,
|
|
4846
4862
|
flexShrink: 0,
|
|
4847
4863
|
objectFit: "contain"
|
|
4848
4864
|
};
|
|
4849
|
-
function
|
|
4850
|
-
let t = Kn((e) => e.faviconSource), n = e ? e.toLowerCase() : "", r = n ?
|
|
4865
|
+
function go({ domain: e }) {
|
|
4866
|
+
let t = Kn((e) => e.faviconSource), n = e ? e.toLowerCase() : "", r = n ? po[n] : void 0;
|
|
4851
4867
|
if (r) return /* @__PURE__ */ v(r, {});
|
|
4852
|
-
let i =
|
|
4853
|
-
return i ? /* @__PURE__ */ v(
|
|
4868
|
+
let i = mo(n, t);
|
|
4869
|
+
return i ? /* @__PURE__ */ v(_o, { src: i }) : /* @__PURE__ */ v(io, {});
|
|
4854
4870
|
}
|
|
4855
|
-
function
|
|
4871
|
+
function _o({ src: e }) {
|
|
4856
4872
|
let [t, n] = f(!1);
|
|
4857
4873
|
return c(() => {
|
|
4858
4874
|
n(!1);
|
|
4859
|
-
}, [e]), t ? /* @__PURE__ */ v(
|
|
4875
|
+
}, [e]), t ? /* @__PURE__ */ v(io, {}) : /* @__PURE__ */ v("img", {
|
|
4860
4876
|
src: e,
|
|
4861
4877
|
alt: "",
|
|
4862
4878
|
width: 16,
|
|
@@ -4864,7 +4880,7 @@ function ho({ src: e }) {
|
|
|
4864
4880
|
loading: "lazy",
|
|
4865
4881
|
decoding: "async",
|
|
4866
4882
|
referrerPolicy: "no-referrer",
|
|
4867
|
-
style:
|
|
4883
|
+
style: ho,
|
|
4868
4884
|
onError: () => n(!0)
|
|
4869
4885
|
});
|
|
4870
4886
|
}
|
|
@@ -4874,72 +4890,72 @@ var $ = /* @__PURE__ */ v("span", {
|
|
|
4874
4890
|
color: "var(--text-4)"
|
|
4875
4891
|
},
|
|
4876
4892
|
children: "—"
|
|
4877
|
-
}),
|
|
4893
|
+
}), vo = {
|
|
4878
4894
|
display: "inline-flex",
|
|
4879
4895
|
alignItems: "center",
|
|
4880
4896
|
gap: 4,
|
|
4881
4897
|
fontSize: 12.5,
|
|
4882
4898
|
color: "var(--accent)",
|
|
4883
4899
|
textDecoration: "none"
|
|
4884
|
-
},
|
|
4900
|
+
}, yo = { fontSize: 12.5 }, bo = () => (t) => {
|
|
4885
4901
|
let n = t == null ? "" : F(t);
|
|
4886
4902
|
if (!n) return $;
|
|
4887
|
-
let r =
|
|
4888
|
-
if (r == null || !
|
|
4889
|
-
style:
|
|
4903
|
+
let r = $a(n);
|
|
4904
|
+
if (r == null || !no(r)) return /* @__PURE__ */ v("span", {
|
|
4905
|
+
style: yo,
|
|
4890
4906
|
children: n
|
|
4891
4907
|
});
|
|
4892
|
-
let i =
|
|
4908
|
+
let i = eo(r), a = to(r, i ?? "") ?? i ?? n;
|
|
4893
4909
|
return /* @__PURE__ */ y("a", {
|
|
4894
4910
|
href: r,
|
|
4895
4911
|
target: "_blank",
|
|
4896
4912
|
rel: "noopener noreferrer",
|
|
4897
4913
|
title: n,
|
|
4898
4914
|
className: "mono",
|
|
4899
|
-
style:
|
|
4915
|
+
style: vo,
|
|
4900
4916
|
children: [
|
|
4901
|
-
/* @__PURE__ */ v(
|
|
4917
|
+
/* @__PURE__ */ v(go, { domain: i }),
|
|
4902
4918
|
a,
|
|
4903
4919
|
/* @__PURE__ */ v(e.external, { size: 11 })
|
|
4904
4920
|
]
|
|
4905
4921
|
});
|
|
4906
|
-
},
|
|
4922
|
+
}, xo = {
|
|
4907
4923
|
fontSize: 12.5,
|
|
4908
4924
|
color: "var(--accent)",
|
|
4909
4925
|
textDecoration: "none"
|
|
4910
|
-
},
|
|
4926
|
+
}, So = () => (e) => {
|
|
4911
4927
|
let t = e == null ? "" : F(e);
|
|
4912
4928
|
return t ? /* @__PURE__ */ v("a", {
|
|
4913
4929
|
href: `mailto:${t}`,
|
|
4914
4930
|
className: "mono",
|
|
4915
|
-
style:
|
|
4931
|
+
style: xo,
|
|
4916
4932
|
children: t
|
|
4917
4933
|
}) : $;
|
|
4918
|
-
},
|
|
4934
|
+
}, Co = {
|
|
4919
4935
|
fontSize: 12.5,
|
|
4920
4936
|
color: "var(--accent)",
|
|
4921
4937
|
textDecoration: "none"
|
|
4922
|
-
},
|
|
4938
|
+
}, wo = { fontSize: 12.5 }, To = /^[+()\-.\s\d]+$/, Eo = () => (e) => {
|
|
4923
4939
|
let t = e == null ? "" : F(e);
|
|
4924
4940
|
if (!t) return $;
|
|
4925
4941
|
let n = t.trim();
|
|
4926
|
-
return
|
|
4942
|
+
return To.test(n) ? /* @__PURE__ */ v("a", {
|
|
4927
4943
|
href: `tel:${n.replace(/\s+/g, "")}`,
|
|
4928
4944
|
className: "mono",
|
|
4929
|
-
style:
|
|
4945
|
+
style: Co,
|
|
4930
4946
|
children: t
|
|
4931
4947
|
}) : /* @__PURE__ */ v("span", {
|
|
4932
|
-
style:
|
|
4948
|
+
style: wo,
|
|
4933
4949
|
children: t
|
|
4934
4950
|
});
|
|
4935
|
-
},
|
|
4951
|
+
}, Do = {
|
|
4936
4952
|
fontSize: 12.5,
|
|
4937
4953
|
fontVariantNumeric: "tabular-nums"
|
|
4938
|
-
},
|
|
4954
|
+
}, Oo = {
|
|
4939
4955
|
color: "var(--text-3)",
|
|
4940
4956
|
marginLeft: 4
|
|
4941
|
-
},
|
|
4942
|
-
function
|
|
4957
|
+
}, ko = { fontSize: 12.5 };
|
|
4958
|
+
function Ao(e, t) {
|
|
4943
4959
|
let n = e.trim();
|
|
4944
4960
|
if (n === "" || n === "-") return n;
|
|
4945
4961
|
let r = n.startsWith("-"), [i, a] = (r ? n.slice(1) : n).split("."), o;
|
|
@@ -4951,45 +4967,45 @@ function Oo(e, t) {
|
|
|
4951
4967
|
let s = r ? `-${o}` : o;
|
|
4952
4968
|
return a !== void 0 && (s += `.${a}`), s;
|
|
4953
4969
|
}
|
|
4954
|
-
var
|
|
4970
|
+
var jo = (e) => {
|
|
4955
4971
|
let { field: t, fieldName: n, locale: r = "en" } = e, i = new Intl.NumberFormat(r), a = t.type === "decimal", o = t.unit ? t.unit.display || t.unit.storage : void 0;
|
|
4956
4972
|
return (e, t) => {
|
|
4957
4973
|
if (e == null) return $;
|
|
4958
4974
|
let r = t.$units?.[n] || (o && !o.startsWith("$") ? o : void 0), s;
|
|
4959
|
-
if (a && typeof e == "string") s =
|
|
4975
|
+
if (a && typeof e == "string") s = Ao(e, i);
|
|
4960
4976
|
else {
|
|
4961
4977
|
let t = typeof e == "number" ? e : Number(e);
|
|
4962
4978
|
s = Number.isFinite(t) ? i.format(t) : null;
|
|
4963
4979
|
}
|
|
4964
4980
|
return s == null ? /* @__PURE__ */ v("span", {
|
|
4965
|
-
style:
|
|
4981
|
+
style: ko,
|
|
4966
4982
|
children: "—"
|
|
4967
4983
|
}) : /* @__PURE__ */ y("span", {
|
|
4968
4984
|
className: "num",
|
|
4969
|
-
style:
|
|
4985
|
+
style: Do,
|
|
4970
4986
|
children: [s, r && /* @__PURE__ */ v("span", {
|
|
4971
|
-
style:
|
|
4987
|
+
style: Oo,
|
|
4972
4988
|
children: r
|
|
4973
4989
|
})]
|
|
4974
4990
|
});
|
|
4975
4991
|
};
|
|
4976
|
-
},
|
|
4992
|
+
}, Mo = { fontSize: 12.5 }, No = () => (e) => e == null || e === "" ? $ : /* @__PURE__ */ v("code", {
|
|
4977
4993
|
className: "mono",
|
|
4978
|
-
style:
|
|
4994
|
+
style: Mo,
|
|
4979
4995
|
children: F(e)
|
|
4980
|
-
}),
|
|
4996
|
+
}), Po = {
|
|
4981
4997
|
display: "inline-flex",
|
|
4982
4998
|
alignItems: "center",
|
|
4983
4999
|
gap: 4,
|
|
4984
5000
|
fontSize: 12.5,
|
|
4985
5001
|
color: "var(--accent)",
|
|
4986
5002
|
textDecoration: "none"
|
|
4987
|
-
},
|
|
5003
|
+
}, Fo = { fontSize: 12.5 }, Io = () => (t) => {
|
|
4988
5004
|
let n = t == null ? "" : F(t);
|
|
4989
5005
|
if (!n) return $;
|
|
4990
|
-
let r =
|
|
4991
|
-
return r == null || !
|
|
4992
|
-
style:
|
|
5006
|
+
let r = $a(n);
|
|
5007
|
+
return r == null || !no(r) ? /* @__PURE__ */ v("span", {
|
|
5008
|
+
style: Fo,
|
|
4993
5009
|
children: n
|
|
4994
5010
|
}) : /* @__PURE__ */ y("a", {
|
|
4995
5011
|
href: r,
|
|
@@ -4997,21 +5013,21 @@ var ko = (e) => {
|
|
|
4997
5013
|
rel: "noopener noreferrer",
|
|
4998
5014
|
title: n,
|
|
4999
5015
|
className: "mono",
|
|
5000
|
-
style:
|
|
5016
|
+
style: Po,
|
|
5001
5017
|
children: [n, /* @__PURE__ */ v(e.external, { size: 11 })]
|
|
5002
5018
|
});
|
|
5003
|
-
},
|
|
5004
|
-
function
|
|
5005
|
-
return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) :
|
|
5019
|
+
}, Lo = 400, Ro = 2e3;
|
|
5020
|
+
function zo(e) {
|
|
5021
|
+
return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) : Lo, Ro));
|
|
5006
5022
|
}
|
|
5007
|
-
function
|
|
5023
|
+
function Bo(e, t) {
|
|
5008
5024
|
return e.length <= t ? e : `${e.slice(0, t)}...`;
|
|
5009
5025
|
}
|
|
5010
|
-
function
|
|
5026
|
+
function Vo(e, t, n, r = 0) {
|
|
5011
5027
|
if (e == null || e === "") return "";
|
|
5012
|
-
if (typeof e == "string") return
|
|
5028
|
+
if (typeof e == "string") return Bo(e, t);
|
|
5013
5029
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
5014
|
-
if (typeof e != "object") return
|
|
5030
|
+
if (typeof e != "object") return Bo(F(e), t);
|
|
5015
5031
|
if (n.has(e)) return "[Circular]";
|
|
5016
5032
|
if (r >= 3) return Array.isArray(e) ? "[...]" : "{...}";
|
|
5017
5033
|
n.add(e);
|
|
@@ -5022,30 +5038,30 @@ function zo(e, t, n, r = 0) {
|
|
|
5022
5038
|
a.push(a.length > 1 ? ",..." : "...");
|
|
5023
5039
|
break;
|
|
5024
5040
|
}
|
|
5025
|
-
let f =
|
|
5041
|
+
let f = Vo(c, d, n, r + 1);
|
|
5026
5042
|
if (a.push(u, f), a.join("").length >= t) {
|
|
5027
5043
|
a.push(",...");
|
|
5028
5044
|
break;
|
|
5029
5045
|
}
|
|
5030
5046
|
}
|
|
5031
|
-
return a.push(i), n.delete(e),
|
|
5047
|
+
return a.push(i), n.delete(e), Bo(a.join(""), t);
|
|
5032
5048
|
}
|
|
5033
|
-
function
|
|
5034
|
-
return
|
|
5049
|
+
function Ho(e, t) {
|
|
5050
|
+
return Vo(e, t, /* @__PURE__ */ new WeakSet());
|
|
5035
5051
|
}
|
|
5036
|
-
var
|
|
5037
|
-
let t = e.surface ?? "detail", n =
|
|
5052
|
+
var Uo = (e) => {
|
|
5053
|
+
let t = e.surface ?? "detail", n = zo(e.field.display?.list_preview?.max_chars);
|
|
5038
5054
|
return (r) => {
|
|
5039
|
-
if (
|
|
5055
|
+
if (Ni(r)) return $;
|
|
5040
5056
|
if (t === "list") {
|
|
5041
|
-
let e =
|
|
5057
|
+
let e = Ho(r, n);
|
|
5042
5058
|
return /* @__PURE__ */ v("span", {
|
|
5043
5059
|
className: "font-mono text-xs text-muted-foreground",
|
|
5044
5060
|
title: e,
|
|
5045
5061
|
children: e
|
|
5046
5062
|
});
|
|
5047
5063
|
}
|
|
5048
|
-
return /* @__PURE__ */ v(
|
|
5064
|
+
return /* @__PURE__ */ v(Pi, {
|
|
5049
5065
|
field: e.field,
|
|
5050
5066
|
fieldName: e.fieldName,
|
|
5051
5067
|
value: r,
|
|
@@ -5053,7 +5069,7 @@ var Vo = (e) => {
|
|
|
5053
5069
|
locale: e.locale
|
|
5054
5070
|
});
|
|
5055
5071
|
};
|
|
5056
|
-
},
|
|
5072
|
+
}, Wo = [
|
|
5057
5073
|
{
|
|
5058
5074
|
pattern: /```[^\n]*\n?([\s\S]*?)```/g,
|
|
5059
5075
|
replacement: "$1"
|
|
@@ -5116,13 +5132,13 @@ var Vo = (e) => {
|
|
|
5116
5132
|
replacement: ""
|
|
5117
5133
|
}
|
|
5118
5134
|
];
|
|
5119
|
-
function
|
|
5135
|
+
function Go(e) {
|
|
5120
5136
|
if (!e) return {
|
|
5121
5137
|
text: "",
|
|
5122
5138
|
isPlain: !0
|
|
5123
5139
|
};
|
|
5124
5140
|
let t = e, n = !1;
|
|
5125
|
-
for (let e of
|
|
5141
|
+
for (let e of Wo) {
|
|
5126
5142
|
let r = t.replace(e.pattern, e.replacement);
|
|
5127
5143
|
r !== t && e.structural !== !1 && (n = !0), t = r;
|
|
5128
5144
|
}
|
|
@@ -5133,123 +5149,123 @@ function Uo(e) {
|
|
|
5133
5149
|
}
|
|
5134
5150
|
//#endregion
|
|
5135
5151
|
//#region src/components/fields/cells/factories/markdown.tsx
|
|
5136
|
-
function
|
|
5137
|
-
return /* @__PURE__ */ v(
|
|
5152
|
+
function Ko(e) {
|
|
5153
|
+
return /* @__PURE__ */ v(Zr, { content: e });
|
|
5138
5154
|
}
|
|
5139
|
-
var
|
|
5155
|
+
var qo = (e) => {
|
|
5140
5156
|
let t = e.surface === "list";
|
|
5141
5157
|
return (e) => {
|
|
5142
5158
|
let n = e == null ? "" : F(e);
|
|
5143
5159
|
if (!n) return $;
|
|
5144
|
-
if (!t) return
|
|
5145
|
-
let { text: r, isPlain: i } =
|
|
5160
|
+
if (!t) return Ko(n);
|
|
5161
|
+
let { text: r, isPlain: i } = Go(n);
|
|
5146
5162
|
return i ? /* @__PURE__ */ v("span", {
|
|
5147
5163
|
title: r,
|
|
5148
5164
|
children: r
|
|
5149
5165
|
}) : /* @__PURE__ */ v(ie, {
|
|
5150
|
-
content:
|
|
5166
|
+
content: Ko(n),
|
|
5151
5167
|
children: /* @__PURE__ */ v("span", {
|
|
5152
5168
|
title: r,
|
|
5153
5169
|
children: r
|
|
5154
5170
|
})
|
|
5155
5171
|
});
|
|
5156
5172
|
};
|
|
5157
|
-
},
|
|
5173
|
+
}, Jo = "[SET]", Yo = {
|
|
5158
5174
|
fontSize: 12.5,
|
|
5159
5175
|
color: "var(--text-3)"
|
|
5160
|
-
},
|
|
5176
|
+
}, Xo = {
|
|
5161
5177
|
fontSize: 12.5,
|
|
5162
5178
|
color: "var(--text-4)",
|
|
5163
5179
|
fontStyle: "italic"
|
|
5164
|
-
},
|
|
5180
|
+
}, Zo = () => (e) => e === Jo || typeof e == "string" && e !== "" ? /* @__PURE__ */ v("span", {
|
|
5165
5181
|
className: "mono",
|
|
5166
|
-
style:
|
|
5167
|
-
children:
|
|
5182
|
+
style: Yo,
|
|
5183
|
+
children: Jo
|
|
5168
5184
|
}) : /* @__PURE__ */ v("span", {
|
|
5169
|
-
style:
|
|
5185
|
+
style: Xo,
|
|
5170
5186
|
children: "Not set"
|
|
5171
5187
|
});
|
|
5172
5188
|
//#endregion
|
|
5173
5189
|
//#region src/components/fields/cells/factories/richTextPreview.tsx
|
|
5174
|
-
function
|
|
5175
|
-
return /* @__PURE__ */ v(
|
|
5190
|
+
function Qo(e, t) {
|
|
5191
|
+
return /* @__PURE__ */ v(Zr, {
|
|
5176
5192
|
content: e,
|
|
5177
5193
|
files: t
|
|
5178
5194
|
});
|
|
5179
5195
|
}
|
|
5180
|
-
var
|
|
5196
|
+
var $o = (e) => {
|
|
5181
5197
|
let { fieldName: t } = e, n = e.surface === "list";
|
|
5182
5198
|
return (e, r) => {
|
|
5183
|
-
let i = r?.$files?.[t], a =
|
|
5199
|
+
let i = r?.$files?.[t], a = Qi(e, i);
|
|
5184
5200
|
if (!a.markdown) return $;
|
|
5185
|
-
if (!n) return
|
|
5186
|
-
let { text: o, isPlain: s } =
|
|
5201
|
+
if (!n) return Qo(a.markdown, a.files);
|
|
5202
|
+
let { text: o, isPlain: s } = Go(a.markdown);
|
|
5187
5203
|
return s ? /* @__PURE__ */ v("span", {
|
|
5188
5204
|
title: o,
|
|
5189
5205
|
children: o
|
|
5190
5206
|
}) : /* @__PURE__ */ v(ie, {
|
|
5191
|
-
content:
|
|
5207
|
+
content: Qo(a.markdown, a.files),
|
|
5192
5208
|
children: /* @__PURE__ */ v("span", {
|
|
5193
5209
|
title: o,
|
|
5194
5210
|
children: o
|
|
5195
5211
|
})
|
|
5196
5212
|
});
|
|
5197
5213
|
};
|
|
5198
|
-
},
|
|
5214
|
+
}, es = { fontSize: 12.5 }, ts = {
|
|
5199
5215
|
fontSize: 12.5,
|
|
5200
5216
|
whiteSpace: "pre-wrap",
|
|
5201
5217
|
margin: 0
|
|
5202
5218
|
};
|
|
5203
|
-
function
|
|
5219
|
+
function ns(e) {
|
|
5204
5220
|
return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
|
|
5205
5221
|
}
|
|
5206
|
-
function
|
|
5222
|
+
function rs(e, t) {
|
|
5207
5223
|
if (t && typeof e[t] == "string" && e[t] !== "") return [t, e[t]];
|
|
5208
5224
|
for (let [t, n] of Object.entries(e)) if (typeof n == "string" && n !== "") return [t, n];
|
|
5209
5225
|
return null;
|
|
5210
5226
|
}
|
|
5211
5227
|
//#endregion
|
|
5212
5228
|
//#region src/components/fields/cells/registry.ts
|
|
5213
|
-
var
|
|
5214
|
-
text:
|
|
5215
|
-
bool_pill:
|
|
5216
|
-
badge:
|
|
5217
|
-
status_pill:
|
|
5218
|
-
tag_list:
|
|
5219
|
-
time_ago:
|
|
5220
|
-
timestamp_full:
|
|
5221
|
-
next_run:
|
|
5222
|
-
money:
|
|
5223
|
-
ref_link:
|
|
5224
|
-
url:
|
|
5225
|
-
email:
|
|
5226
|
-
phone:
|
|
5227
|
-
number:
|
|
5228
|
-
code:
|
|
5229
|
-
link:
|
|
5230
|
-
json:
|
|
5231
|
-
markdown:
|
|
5232
|
-
password_mask:
|
|
5233
|
-
rich_text_preview:
|
|
5229
|
+
var is = {
|
|
5230
|
+
text: Ea,
|
|
5231
|
+
bool_pill: Da,
|
|
5232
|
+
badge: Ma,
|
|
5233
|
+
status_pill: Fa,
|
|
5234
|
+
tag_list: Ra,
|
|
5235
|
+
time_ago: za,
|
|
5236
|
+
timestamp_full: Ba,
|
|
5237
|
+
next_run: Ua,
|
|
5238
|
+
money: Wa,
|
|
5239
|
+
ref_link: qa,
|
|
5240
|
+
url: bo,
|
|
5241
|
+
email: So,
|
|
5242
|
+
phone: Eo,
|
|
5243
|
+
number: jo,
|
|
5244
|
+
code: No,
|
|
5245
|
+
link: Io,
|
|
5246
|
+
json: Uo,
|
|
5247
|
+
markdown: qo,
|
|
5248
|
+
password_mask: Zo,
|
|
5249
|
+
rich_text_preview: $o,
|
|
5234
5250
|
multilang_inline: (e) => {
|
|
5235
5251
|
let { field: t, locale: n } = e, r = t.type === "multilang_text";
|
|
5236
5252
|
return (e) => {
|
|
5237
|
-
let t =
|
|
5253
|
+
let t = rs(ns(e), n);
|
|
5238
5254
|
if (!t) return r ? /* @__PURE__ */ v("p", {
|
|
5239
|
-
style:
|
|
5255
|
+
style: ts,
|
|
5240
5256
|
children: "—"
|
|
5241
5257
|
}) : /* @__PURE__ */ v("span", {
|
|
5242
|
-
style:
|
|
5258
|
+
style: es,
|
|
5243
5259
|
children: "—"
|
|
5244
5260
|
});
|
|
5245
5261
|
let [i, a] = t;
|
|
5246
5262
|
return r ? /* @__PURE__ */ v("p", {
|
|
5247
|
-
style:
|
|
5263
|
+
style: ts,
|
|
5248
5264
|
lang: i,
|
|
5249
5265
|
dir: "auto",
|
|
5250
5266
|
children: a
|
|
5251
5267
|
}) : /* @__PURE__ */ v("span", {
|
|
5252
|
-
style:
|
|
5268
|
+
style: es,
|
|
5253
5269
|
lang: i,
|
|
5254
5270
|
dir: "auto",
|
|
5255
5271
|
children: a
|
|
@@ -5257,53 +5273,53 @@ var ns = {
|
|
|
5257
5273
|
};
|
|
5258
5274
|
}
|
|
5259
5275
|
};
|
|
5260
|
-
Object.keys(
|
|
5261
|
-
function
|
|
5262
|
-
let t = e.field.display?.widget ?? "text", n =
|
|
5276
|
+
Object.keys(is).sort();
|
|
5277
|
+
function as(e) {
|
|
5278
|
+
let t = e.field.display?.widget ?? "text", n = is[t];
|
|
5263
5279
|
if (!n) throw Error(`resolveCellRenderer: no factory registered for widget "${t}" (field "${e.fieldName}"). The engine must stamp a smart default at YAML-load time; an unknown widget here indicates an out-of-sync allow-list.`);
|
|
5264
5280
|
return n(e);
|
|
5265
5281
|
}
|
|
5266
5282
|
//#endregion
|
|
5267
5283
|
//#region src/components/fields/index.tsx
|
|
5268
|
-
var
|
|
5269
|
-
string:
|
|
5270
|
-
text:
|
|
5271
|
-
rich_text:
|
|
5272
|
-
int:
|
|
5273
|
-
float:
|
|
5274
|
-
decimal:
|
|
5275
|
-
bool:
|
|
5276
|
-
timestamp:
|
|
5277
|
-
date:
|
|
5278
|
-
time:
|
|
5279
|
-
enum:
|
|
5280
|
-
email:
|
|
5281
|
-
url:
|
|
5282
|
-
phone:
|
|
5283
|
-
uuid:
|
|
5284
|
-
bytes:
|
|
5285
|
-
ref:
|
|
5286
|
-
json:
|
|
5287
|
-
tags:
|
|
5288
|
-
string_array:
|
|
5289
|
-
int_array:
|
|
5290
|
-
uuid_array:
|
|
5291
|
-
multilang:
|
|
5292
|
-
multilang_text:
|
|
5293
|
-
structure:
|
|
5294
|
-
secret:
|
|
5295
|
-
password:
|
|
5284
|
+
var os = {
|
|
5285
|
+
string: ei,
|
|
5286
|
+
text: ti,
|
|
5287
|
+
rich_text: Ca,
|
|
5288
|
+
int: Si,
|
|
5289
|
+
float: Si,
|
|
5290
|
+
decimal: Si,
|
|
5291
|
+
bool: yi,
|
|
5292
|
+
timestamp: vi,
|
|
5293
|
+
date: vi,
|
|
5294
|
+
time: vi,
|
|
5295
|
+
enum: ri,
|
|
5296
|
+
email: ii,
|
|
5297
|
+
url: ai,
|
|
5298
|
+
phone: oi,
|
|
5299
|
+
uuid: ei,
|
|
5300
|
+
bytes: ei,
|
|
5301
|
+
ref: Ai,
|
|
5302
|
+
json: Pi,
|
|
5303
|
+
tags: ei,
|
|
5304
|
+
string_array: qi,
|
|
5305
|
+
int_array: Yi,
|
|
5306
|
+
uuid_array: qi,
|
|
5307
|
+
multilang: Ii,
|
|
5308
|
+
multilang_text: Ri,
|
|
5309
|
+
structure: zi,
|
|
5310
|
+
secret: Ui,
|
|
5311
|
+
password: Gi
|
|
5296
5312
|
};
|
|
5297
|
-
for (let e of
|
|
5298
|
-
function
|
|
5299
|
-
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ v(
|
|
5313
|
+
for (let e of Qr) if (!os[e]) throw Error(`editRegistry: missing entry for FieldType "${e}". The TS union (types/fieldType.ts) and editRegistry must stay in sync with golang/internal/engine/types.go.`);
|
|
5314
|
+
function ss(e) {
|
|
5315
|
+
if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ v(zi, { ...e });
|
|
5300
5316
|
if (e.mode === "edit") {
|
|
5301
|
-
let t =
|
|
5317
|
+
let t = os[e.field.type];
|
|
5302
5318
|
if (!t) throw Error(`renderField: no edit-mode renderer for FieldType "${e.field.type}" (field "${e.fieldName}"). editRegistry must be total over FieldType; check types/fieldType.ts and components/fields/index.tsx.`);
|
|
5303
5319
|
return /* @__PURE__ */ v(t, { ...e });
|
|
5304
5320
|
}
|
|
5305
5321
|
if (!e.field.display?.widget) throw Error(`renderField: display mode requires a non-empty field.display.widget (field "${e.fieldName}", type "${e.field.type}"). The engine must stamp a smart default; an empty widget here means the field bypassed ResolveDefaultWidgets.`);
|
|
5306
|
-
return
|
|
5322
|
+
return as({
|
|
5307
5323
|
field: e.field,
|
|
5308
5324
|
fieldName: e.fieldName,
|
|
5309
5325
|
surface: e.surface ?? "detail",
|
|
@@ -5316,98 +5332,98 @@ function as(e) {
|
|
|
5316
5332
|
}
|
|
5317
5333
|
//#endregion
|
|
5318
5334
|
//#region src/hooks/useUserLocale.ts
|
|
5319
|
-
var
|
|
5320
|
-
function
|
|
5335
|
+
var cs = "en";
|
|
5336
|
+
function ls() {
|
|
5321
5337
|
if (typeof navigator > "u") return;
|
|
5322
5338
|
let e = navigator.language;
|
|
5323
5339
|
if (e) return e.split("-")[0] || void 0;
|
|
5324
5340
|
}
|
|
5325
|
-
function
|
|
5341
|
+
function us() {
|
|
5326
5342
|
let e = Dn((e) => e.user), { data: t } = J(), n = e?.language;
|
|
5327
5343
|
if (n && n.trim()) return n;
|
|
5328
5344
|
let r = t?.languages?.[0]?.code;
|
|
5329
|
-
return r && r.trim() ? r :
|
|
5345
|
+
return r && r.trim() ? r : ls() || cs;
|
|
5330
5346
|
}
|
|
5331
5347
|
//#endregion
|
|
5332
5348
|
//#region src/lib/field-regions.ts
|
|
5333
|
-
var
|
|
5334
|
-
function
|
|
5335
|
-
return
|
|
5336
|
-
|
|
5349
|
+
var ds = /* @__PURE__ */ new Map();
|
|
5350
|
+
function fs(e, t) {
|
|
5351
|
+
return ds.set(e, t), () => {
|
|
5352
|
+
ds.get(e) === t && ds.delete(e);
|
|
5337
5353
|
};
|
|
5338
5354
|
}
|
|
5339
|
-
function
|
|
5340
|
-
return
|
|
5355
|
+
function ps(e) {
|
|
5356
|
+
return ds.get(e);
|
|
5341
5357
|
}
|
|
5342
5358
|
//#endregion
|
|
5343
5359
|
//#region src/lib/ui-actions.ts
|
|
5344
|
-
var
|
|
5345
|
-
function
|
|
5346
|
-
let n = e.match(
|
|
5360
|
+
var ms = /\$\{\s*([^}]+?)\s*\}/g, hs = /^\s*\$\{\s*([^}]+?)\s*\}\s*$/, gs = Symbol("unresolved");
|
|
5361
|
+
function _s(e, t) {
|
|
5362
|
+
let n = e.match(hs);
|
|
5347
5363
|
if (n) {
|
|
5348
|
-
let r =
|
|
5349
|
-
return r ===
|
|
5364
|
+
let r = vs(n[1], t);
|
|
5365
|
+
return r === gs ? e : r;
|
|
5350
5366
|
}
|
|
5351
|
-
return e.replace(
|
|
5352
|
-
let r =
|
|
5353
|
-
return r ===
|
|
5367
|
+
return e.replace(ms, (e, n) => {
|
|
5368
|
+
let r = vs(n, t);
|
|
5369
|
+
return r === gs ? e : F(r);
|
|
5354
5370
|
});
|
|
5355
5371
|
}
|
|
5356
|
-
function
|
|
5357
|
-
if (e === "now") return
|
|
5372
|
+
function vs(e, t) {
|
|
5373
|
+
if (e === "now") return si();
|
|
5358
5374
|
let [n, ...r] = e.split(".");
|
|
5359
|
-
if (n === "row") return !t.row || r.length === 0 ?
|
|
5375
|
+
if (n === "row") return !t.row || r.length === 0 ? gs : ys(t.row, r);
|
|
5360
5376
|
if (n === "field" && r.length >= 2) {
|
|
5361
|
-
let [e, t] = r, n =
|
|
5362
|
-
return n ? n.getField(t) :
|
|
5377
|
+
let [e, t] = r, n = ps(e);
|
|
5378
|
+
return n ? n.getField(t) : gs;
|
|
5363
5379
|
}
|
|
5364
|
-
return n === "params" ? !t.params || r.length === 0 ?
|
|
5380
|
+
return n === "params" ? !t.params || r.length === 0 ? gs : ys(t.params, r) : gs;
|
|
5365
5381
|
}
|
|
5366
|
-
function
|
|
5382
|
+
function ys(e, t) {
|
|
5367
5383
|
return t.reduce((e, t) => {
|
|
5368
5384
|
if (e && typeof e == "object") return e[t];
|
|
5369
5385
|
}, e);
|
|
5370
5386
|
}
|
|
5371
|
-
async function
|
|
5387
|
+
async function bs(e, t) {
|
|
5372
5388
|
for (let n of e) try {
|
|
5373
|
-
await
|
|
5389
|
+
await xs(n, t);
|
|
5374
5390
|
} catch (e) {
|
|
5375
5391
|
let t = e instanceof Error ? e.message : String(e);
|
|
5376
5392
|
Z.error(`ui_step failed: ${t}`);
|
|
5377
5393
|
return;
|
|
5378
5394
|
}
|
|
5379
5395
|
}
|
|
5380
|
-
async function
|
|
5396
|
+
async function xs(e, t) {
|
|
5381
5397
|
if (e.copy_to_clipboard != null) {
|
|
5382
|
-
let n =
|
|
5398
|
+
let n = Cs(e.copy_to_clipboard, t);
|
|
5383
5399
|
await navigator.clipboard.writeText(n);
|
|
5384
5400
|
return;
|
|
5385
5401
|
}
|
|
5386
5402
|
if (e.set_field) {
|
|
5387
|
-
let { target: n, value: r } = e.set_field, { region: i, field: a } =
|
|
5403
|
+
let { target: n, value: r } = e.set_field, { region: i, field: a } = ws(n), o = ps(i);
|
|
5388
5404
|
if (!o) throw Error(`region "${i}" not registered`);
|
|
5389
|
-
o.setField(a,
|
|
5405
|
+
o.setField(a, Ss(r, t));
|
|
5390
5406
|
return;
|
|
5391
5407
|
}
|
|
5392
5408
|
if (e.focus_field) {
|
|
5393
|
-
let { region: t, field: n } =
|
|
5409
|
+
let { region: t, field: n } = ws(e.focus_field), r = ps(t);
|
|
5394
5410
|
if (!r) throw Error(`region "${t}" not registered`);
|
|
5395
5411
|
r.focusField(n);
|
|
5396
5412
|
return;
|
|
5397
5413
|
}
|
|
5398
5414
|
if (e.show_toast) {
|
|
5399
|
-
let n =
|
|
5415
|
+
let n = Cs(e.show_toast.message, t), r = e.show_toast.kind ?? "info";
|
|
5400
5416
|
r === "success" ? Z.success(n) : r === "error" ? Z.error(n) : Z.info(n);
|
|
5401
5417
|
return;
|
|
5402
5418
|
}
|
|
5403
5419
|
}
|
|
5404
|
-
function
|
|
5405
|
-
return typeof e == "string" ?
|
|
5420
|
+
function Ss(e, t) {
|
|
5421
|
+
return typeof e == "string" ? _s(e, t) : e;
|
|
5406
5422
|
}
|
|
5407
|
-
function
|
|
5408
|
-
return F(
|
|
5423
|
+
function Cs(e, t) {
|
|
5424
|
+
return F(_s(e, t));
|
|
5409
5425
|
}
|
|
5410
|
-
function
|
|
5426
|
+
function ws(e) {
|
|
5411
5427
|
let t = e.indexOf(".");
|
|
5412
5428
|
if (t <= 0) throw Error(`invalid path "${e}" (expected "region.field")`);
|
|
5413
5429
|
return {
|
|
@@ -5415,12 +5431,12 @@ function Ss(e) {
|
|
|
5415
5431
|
field: e.slice(t + 1)
|
|
5416
5432
|
};
|
|
5417
5433
|
}
|
|
5418
|
-
function
|
|
5434
|
+
function Ts(e) {
|
|
5419
5435
|
return !e.handler && !!e.ui_steps && e.ui_steps.length > 0;
|
|
5420
5436
|
}
|
|
5421
5437
|
//#endregion
|
|
5422
5438
|
//#region src/lib/mass-edit.ts
|
|
5423
|
-
function
|
|
5439
|
+
function Es(e) {
|
|
5424
5440
|
if (!e) return [];
|
|
5425
5441
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
5426
5442
|
for (let r of e.split(",")) {
|
|
@@ -5429,17 +5445,17 @@ function ws(e) {
|
|
|
5429
5445
|
}
|
|
5430
5446
|
return n;
|
|
5431
5447
|
}
|
|
5432
|
-
function
|
|
5448
|
+
function Ds(e, t) {
|
|
5433
5449
|
if (!e || !Pe(e, "update")) return [];
|
|
5434
|
-
let n = Array.isArray(t) ? t :
|
|
5450
|
+
let n = Array.isArray(t) ? t : Es(t), r = n.length > 0 ? new Set(n) : null, i = Ge(e), a = new Set(R(e)), o = r ? n : Os(e, i, a), s = [];
|
|
5435
5451
|
for (let t of o) {
|
|
5436
5452
|
if (r && !r.has(t)) continue;
|
|
5437
|
-
let n =
|
|
5453
|
+
let n = ks(e, t, i, a);
|
|
5438
5454
|
n && s.push(n);
|
|
5439
5455
|
}
|
|
5440
5456
|
return s;
|
|
5441
5457
|
}
|
|
5442
|
-
function
|
|
5458
|
+
function Os(e, t, n) {
|
|
5443
5459
|
let r = [];
|
|
5444
5460
|
for (let [t, i] of e.fields) n.has(t) || i.auto || r.push(t);
|
|
5445
5461
|
if (!t) {
|
|
@@ -5448,7 +5464,7 @@ function Es(e, t, n) {
|
|
|
5448
5464
|
}
|
|
5449
5465
|
return r;
|
|
5450
5466
|
}
|
|
5451
|
-
function
|
|
5467
|
+
function ks(e, t, n, r) {
|
|
5452
5468
|
if (t.startsWith("$status.")) {
|
|
5453
5469
|
if (n) return null;
|
|
5454
5470
|
let r = t.slice(8), i = e.status_groups?.[r];
|
|
@@ -5456,7 +5472,7 @@ function Ds(e, t, n, r) {
|
|
|
5456
5472
|
code: t,
|
|
5457
5473
|
bare: r,
|
|
5458
5474
|
kind: "status",
|
|
5459
|
-
label:
|
|
5475
|
+
label: As(i.name, r),
|
|
5460
5476
|
statusGroup: i
|
|
5461
5477
|
} : null;
|
|
5462
5478
|
}
|
|
@@ -5467,7 +5483,7 @@ function Ds(e, t, n, r) {
|
|
|
5467
5483
|
code: t,
|
|
5468
5484
|
bare: r,
|
|
5469
5485
|
kind: "property",
|
|
5470
|
-
label:
|
|
5486
|
+
label: As(i.name, r),
|
|
5471
5487
|
property: i
|
|
5472
5488
|
} : null;
|
|
5473
5489
|
}
|
|
@@ -5477,18 +5493,18 @@ function Ds(e, t, n, r) {
|
|
|
5477
5493
|
code: t,
|
|
5478
5494
|
bare: t,
|
|
5479
5495
|
kind: "field",
|
|
5480
|
-
label:
|
|
5496
|
+
label: As(i.display?.name, t),
|
|
5481
5497
|
field: i
|
|
5482
5498
|
};
|
|
5483
5499
|
}
|
|
5484
|
-
function
|
|
5500
|
+
function As(e, t) {
|
|
5485
5501
|
return e && I(e) || t;
|
|
5486
5502
|
}
|
|
5487
5503
|
//#endregion
|
|
5488
5504
|
//#region src/components/mass-edit/PropertyGridEditor.tsx
|
|
5489
|
-
var
|
|
5490
|
-
function
|
|
5491
|
-
let a = u(() =>
|
|
5505
|
+
var js = Symbol.for("declarion.mass-edit.multiple");
|
|
5506
|
+
function Ms({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange: i }) {
|
|
5507
|
+
let a = u(() => Ds(e, t), [e, t]), s = u(() => Object.keys(r).map((e) => {
|
|
5492
5508
|
let t = a.find((t) => t.code === e);
|
|
5493
5509
|
return t ? {
|
|
5494
5510
|
target: t,
|
|
@@ -5498,8 +5514,8 @@ function As({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
5498
5514
|
let e = new Set(s.map((e) => e.target.code));
|
|
5499
5515
|
return a.filter((t) => !e.has(t.code));
|
|
5500
5516
|
}, [s, a]), l = o((e) => {
|
|
5501
|
-
let t =
|
|
5502
|
-
a[e.code] = t ===
|
|
5517
|
+
let t = Ls(e, n), a = { ...r };
|
|
5518
|
+
a[e.code] = t === js ? void 0 : t, i(a);
|
|
5503
5519
|
}, [
|
|
5504
5520
|
r,
|
|
5505
5521
|
n,
|
|
@@ -5527,12 +5543,12 @@ function As({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
5527
5543
|
},
|
|
5528
5544
|
children: "No targets selected. Add a field, status, or property to edit across all selected rows."
|
|
5529
5545
|
}),
|
|
5530
|
-
s.map((e) => /* @__PURE__ */ v(
|
|
5546
|
+
s.map((e) => /* @__PURE__ */ v(Ns, {
|
|
5531
5547
|
row: e,
|
|
5532
5548
|
onChange: (t) => d(e.target.code, t),
|
|
5533
5549
|
onRemove: () => f(e.target.code)
|
|
5534
5550
|
}, e.target.code)),
|
|
5535
|
-
/* @__PURE__ */ v(
|
|
5551
|
+
/* @__PURE__ */ v(Is, {
|
|
5536
5552
|
targets: c,
|
|
5537
5553
|
onPick: l
|
|
5538
5554
|
})
|
|
@@ -5545,7 +5561,7 @@ function As({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
|
|
|
5545
5561
|
children: "Entity schema unavailable. Mass edit requires an entity-bound action."
|
|
5546
5562
|
});
|
|
5547
5563
|
}
|
|
5548
|
-
function
|
|
5564
|
+
function Ns({ row: t, onChange: n, onRemove: r }) {
|
|
5549
5565
|
let { target: i } = t;
|
|
5550
5566
|
return /* @__PURE__ */ y("div", {
|
|
5551
5567
|
"data-testid": "mass-edit-row",
|
|
@@ -5564,7 +5580,7 @@ function js({ row: t, onChange: n, onRemove: r }) {
|
|
|
5564
5580
|
title: i.code,
|
|
5565
5581
|
children: i.label
|
|
5566
5582
|
}),
|
|
5567
|
-
/* @__PURE__ */ v(
|
|
5583
|
+
/* @__PURE__ */ v(Ps, {
|
|
5568
5584
|
row: t,
|
|
5569
5585
|
onChange: n
|
|
5570
5586
|
}),
|
|
@@ -5576,8 +5592,8 @@ function js({ row: t, onChange: n, onRemove: r }) {
|
|
|
5576
5592
|
]
|
|
5577
5593
|
});
|
|
5578
5594
|
}
|
|
5579
|
-
function
|
|
5580
|
-
let { target: n } = e, r =
|
|
5595
|
+
function Ps({ row: e, onChange: t }) {
|
|
5596
|
+
let { target: n } = e, r = us(), i = e.value === js, a = i ? "<multiple values>" : void 0, o = i ? "" : e.value;
|
|
5581
5597
|
if (n.kind === "status" && n.statusGroup) {
|
|
5582
5598
|
let e = n.statusGroup.statuses.map((e) => ({
|
|
5583
5599
|
value: e.code,
|
|
@@ -5593,11 +5609,11 @@ function Ms({ row: e, onChange: t }) {
|
|
|
5593
5609
|
})
|
|
5594
5610
|
});
|
|
5595
5611
|
}
|
|
5596
|
-
let s =
|
|
5612
|
+
let s = Fs(n);
|
|
5597
5613
|
return /* @__PURE__ */ y("div", {
|
|
5598
5614
|
"data-testid": `value-${n.code}`,
|
|
5599
5615
|
style: { position: "relative" },
|
|
5600
|
-
children: [
|
|
5616
|
+
children: [ss({
|
|
5601
5617
|
field: s,
|
|
5602
5618
|
fieldName: n.bare,
|
|
5603
5619
|
value: o ?? "",
|
|
@@ -5616,7 +5632,7 @@ function Ms({ row: e, onChange: t }) {
|
|
|
5616
5632
|
})]
|
|
5617
5633
|
});
|
|
5618
5634
|
}
|
|
5619
|
-
function
|
|
5635
|
+
function Fs(e) {
|
|
5620
5636
|
if (e.kind === "field" && e.field) return e.field;
|
|
5621
5637
|
if (e.kind === "property" && e.property) {
|
|
5622
5638
|
let t = e.property;
|
|
@@ -5631,7 +5647,7 @@ function Ns(e) {
|
|
|
5631
5647
|
}
|
|
5632
5648
|
return { type: "string" };
|
|
5633
5649
|
}
|
|
5634
|
-
function
|
|
5650
|
+
function Is({ targets: t, onPick: n }) {
|
|
5635
5651
|
let [r, i] = f(!1);
|
|
5636
5652
|
return t.length === 0 ? null : r ? /* @__PURE__ */ v("div", {
|
|
5637
5653
|
"data-testid": "mass-edit-target-picker",
|
|
@@ -5658,7 +5674,7 @@ function Ps({ targets: t, onPick: n }) {
|
|
|
5658
5674
|
children: [/* @__PURE__ */ v(e.plus, { size: 12 }), " Add target"]
|
|
5659
5675
|
});
|
|
5660
5676
|
}
|
|
5661
|
-
function
|
|
5677
|
+
function Ls(e, t) {
|
|
5662
5678
|
if (!t || t.length === 0 || e.kind !== "field") return;
|
|
5663
5679
|
let n, r = !1;
|
|
5664
5680
|
for (let i of t) {
|
|
@@ -5667,21 +5683,21 @@ function Fs(e, t) {
|
|
|
5667
5683
|
n = t, r = !0;
|
|
5668
5684
|
continue;
|
|
5669
5685
|
}
|
|
5670
|
-
if (n !== t) return
|
|
5686
|
+
if (n !== t) return js;
|
|
5671
5687
|
}
|
|
5672
5688
|
return n;
|
|
5673
5689
|
}
|
|
5674
5690
|
//#endregion
|
|
5675
5691
|
//#region src/components/shared/ActionDialog.tsx
|
|
5676
|
-
var
|
|
5677
|
-
function
|
|
5692
|
+
var Rs = /^\$row\.([a-zA-Z_][a-zA-Z0-9_]*)$/;
|
|
5693
|
+
function zs(e, t) {
|
|
5678
5694
|
if (typeof e != "string") return e ?? "";
|
|
5679
|
-
let n = e.match(
|
|
5695
|
+
let n = e.match(Rs);
|
|
5680
5696
|
if (!n) return e;
|
|
5681
5697
|
let r = n[1];
|
|
5682
5698
|
return t && r in t ? t[r] ?? "" : (typeof console < "u" && console.warn && console.warn(`ActionDialog: prefill template ${e} could not be resolved; row missing or has no field '${r}'`), "");
|
|
5683
5699
|
}
|
|
5684
|
-
function
|
|
5700
|
+
function Bs(e) {
|
|
5685
5701
|
return {
|
|
5686
5702
|
type: e.type ?? "string",
|
|
5687
5703
|
required: e.required,
|
|
@@ -5694,18 +5710,18 @@ function Rs(e) {
|
|
|
5694
5710
|
ref: je(e.ref)
|
|
5695
5711
|
};
|
|
5696
5712
|
}
|
|
5697
|
-
function
|
|
5713
|
+
function Vs(e, t) {
|
|
5698
5714
|
if (!e.includes("${")) return e;
|
|
5699
|
-
let n =
|
|
5715
|
+
let n = _s(e, { params: t });
|
|
5700
5716
|
return n == null ? "" : F(n);
|
|
5701
5717
|
}
|
|
5702
|
-
var
|
|
5703
|
-
function
|
|
5718
|
+
var Hs = /\$\{\s*([^}]+?)\s*\}/g;
|
|
5719
|
+
function Us(e, t) {
|
|
5704
5720
|
let n = `params.${t}`;
|
|
5705
|
-
for (let t of e.matchAll(
|
|
5721
|
+
for (let t of e.matchAll(Hs)) if (t[1] === n) return !0;
|
|
5706
5722
|
return !1;
|
|
5707
5723
|
}
|
|
5708
|
-
function
|
|
5724
|
+
function Ws({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
5709
5725
|
let i = u(() => {
|
|
5710
5726
|
let t = r ? Object.entries(r) : [];
|
|
5711
5727
|
return [{
|
|
@@ -5723,12 +5739,12 @@ function Hs({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
|
5723
5739
|
placeholder: "Select status group…"
|
|
5724
5740
|
});
|
|
5725
5741
|
}
|
|
5726
|
-
function
|
|
5742
|
+
function Gs({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
5727
5743
|
let a = u(() => {
|
|
5728
5744
|
if (!r) return [];
|
|
5729
5745
|
let t = e.filter?.status_group;
|
|
5730
5746
|
if (t) {
|
|
5731
|
-
let e =
|
|
5747
|
+
let e = Vs(t, i);
|
|
5732
5748
|
return e && r[e] ? r[e].statuses : [];
|
|
5733
5749
|
}
|
|
5734
5750
|
return Object.values(r).flatMap((e) => e.statuses);
|
|
@@ -5750,8 +5766,8 @@ function Us({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
|
5750
5766
|
placeholder: "Select status…"
|
|
5751
5767
|
});
|
|
5752
5768
|
}
|
|
5753
|
-
function
|
|
5754
|
-
let { data: d } = J(), p =
|
|
5769
|
+
function Ks({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, isPending: s, row: c, bulkSelection: l }) {
|
|
5770
|
+
let { data: d } = J(), p = us(), m = r.resolved_params, h = r.resolved_hidden_defaults ?? {}, g = u(() => m ? Array.from(m) : [], [m]), b = u(() => {
|
|
5755
5771
|
if (!(!r.entity || !d)) return d.entities[r.entity]?.status_groups;
|
|
5756
5772
|
}, [r.entity, d]), x = u(() => {
|
|
5757
5773
|
if (!(!r.entity || !d)) return d.entities[r.entity];
|
|
@@ -5775,7 +5791,7 @@ function Ws({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5775
5791
|
e[t] = n.default === !0 || n.default === "true";
|
|
5776
5792
|
continue;
|
|
5777
5793
|
}
|
|
5778
|
-
e[t] =
|
|
5794
|
+
e[t] = zs(n.default, c);
|
|
5779
5795
|
}
|
|
5780
5796
|
return e;
|
|
5781
5797
|
}, [
|
|
@@ -5793,7 +5809,7 @@ function Ws({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5793
5809
|
for (let [t, n] of m) {
|
|
5794
5810
|
if (n.type !== "status") continue;
|
|
5795
5811
|
let i = n.filter?.status_group;
|
|
5796
|
-
i &&
|
|
5812
|
+
i && Us(i, e) && (r[t] = "");
|
|
5797
5813
|
}
|
|
5798
5814
|
return r;
|
|
5799
5815
|
});
|
|
@@ -5898,26 +5914,26 @@ function Ws({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5898
5914
|
let n = I(t.display?.name) || e;
|
|
5899
5915
|
if (t.type === "id_array") return null;
|
|
5900
5916
|
let r;
|
|
5901
|
-
return r = t.type === "entity_patch" ? /* @__PURE__ */ v(
|
|
5917
|
+
return r = t.type === "entity_patch" ? /* @__PURE__ */ v(Ms, {
|
|
5902
5918
|
entity: x,
|
|
5903
5919
|
filterTargets: typeof t.filter?.targets == "string" ? t.filter.targets : void 0,
|
|
5904
5920
|
selectedRows: l,
|
|
5905
5921
|
value: C[e] ?? {},
|
|
5906
5922
|
onChange: (t) => D(e, t)
|
|
5907
|
-
}) : t.type === "status_group" ? /* @__PURE__ */ v(
|
|
5923
|
+
}) : t.type === "status_group" ? /* @__PURE__ */ v(Ws, {
|
|
5908
5924
|
param: t,
|
|
5909
5925
|
value: C[e],
|
|
5910
5926
|
onChange: (t) => D(e, t),
|
|
5911
5927
|
statusGroups: b,
|
|
5912
5928
|
formData: C
|
|
5913
|
-
}) : t.type === "status" ? /* @__PURE__ */ v(
|
|
5929
|
+
}) : t.type === "status" ? /* @__PURE__ */ v(Gs, {
|
|
5914
5930
|
param: t,
|
|
5915
5931
|
value: C[e],
|
|
5916
5932
|
onChange: (t) => D(e, t),
|
|
5917
5933
|
statusGroups: b,
|
|
5918
5934
|
formData: C
|
|
5919
|
-
}) :
|
|
5920
|
-
field:
|
|
5935
|
+
}) : ss({
|
|
5936
|
+
field: Bs(t),
|
|
5921
5937
|
fieldName: e,
|
|
5922
5938
|
value: C[e],
|
|
5923
5939
|
mode: "edit",
|
|
@@ -5971,7 +5987,7 @@ function Ws({ open: t, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
|
|
|
5971
5987
|
}
|
|
5972
5988
|
//#endregion
|
|
5973
5989
|
//#region src/components/shared/ActionResultDialog.tsx
|
|
5974
|
-
function
|
|
5990
|
+
function qs({ open: t, onClose: n, display: r }) {
|
|
5975
5991
|
return t ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("div", { style: {
|
|
5976
5992
|
position: "fixed",
|
|
5977
5993
|
inset: 0,
|
|
@@ -6053,7 +6069,7 @@ function Gs({ open: t, onClose: n, display: r }) {
|
|
|
6053
6069
|
gap: 12,
|
|
6054
6070
|
overflowY: "auto"
|
|
6055
6071
|
},
|
|
6056
|
-
children: r.fields.map((e, t) => /* @__PURE__ */ v(
|
|
6072
|
+
children: r.fields.map((e, t) => /* @__PURE__ */ v(Js, { field: e }, t))
|
|
6057
6073
|
}),
|
|
6058
6074
|
/* @__PURE__ */ y("div", {
|
|
6059
6075
|
style: {
|
|
@@ -6073,7 +6089,7 @@ function Gs({ open: t, onClose: n, display: r }) {
|
|
|
6073
6089
|
]
|
|
6074
6090
|
})] }) : null;
|
|
6075
6091
|
}
|
|
6076
|
-
function
|
|
6092
|
+
function Js({ field: e }) {
|
|
6077
6093
|
return /* @__PURE__ */ y("div", {
|
|
6078
6094
|
style: {
|
|
6079
6095
|
display: "flex",
|
|
@@ -6110,14 +6126,14 @@ function Ks({ field: e }) {
|
|
|
6110
6126
|
top: 4,
|
|
6111
6127
|
right: 4
|
|
6112
6128
|
},
|
|
6113
|
-
children: /* @__PURE__ */ v(
|
|
6129
|
+
children: /* @__PURE__ */ v($r, { value: e.value })
|
|
6114
6130
|
})]
|
|
6115
6131
|
})]
|
|
6116
6132
|
});
|
|
6117
6133
|
}
|
|
6118
6134
|
//#endregion
|
|
6119
6135
|
//#region src/components/shared/ActionRunner.tsx
|
|
6120
|
-
function
|
|
6136
|
+
function Ys(e) {
|
|
6121
6137
|
if (!e || typeof e != "object") return { kind: "success" };
|
|
6122
6138
|
let t = e, n = t.status, r = t.success?.length ?? 0, i = t.errors?.length ?? 0, a = t.skipped?.length ?? 0, o = t.errors?.[0]?.error;
|
|
6123
6139
|
if (n === "partial") {
|
|
@@ -6132,20 +6148,20 @@ function qs(e) {
|
|
|
6132
6148
|
detail: "No items matched"
|
|
6133
6149
|
} : n === "accepted" ? { kind: "accepted" } : { kind: "success" };
|
|
6134
6150
|
}
|
|
6135
|
-
function
|
|
6151
|
+
function Xs(e) {
|
|
6136
6152
|
if (!e || typeof e != "object") return null;
|
|
6137
6153
|
let t = e.result;
|
|
6138
6154
|
if (!t || typeof t != "object") return null;
|
|
6139
6155
|
let n = t.$display;
|
|
6140
6156
|
return !n || typeof n != "object" ? null : n;
|
|
6141
6157
|
}
|
|
6142
|
-
function
|
|
6158
|
+
function Zs(e) {
|
|
6143
6159
|
if (!e || typeof e != "object") return;
|
|
6144
6160
|
let t = e.result;
|
|
6145
6161
|
!t || typeof t != "object" || "impersonation_session_id" in t && window.location.assign("/");
|
|
6146
6162
|
}
|
|
6147
|
-
function
|
|
6148
|
-
if (e instanceof
|
|
6163
|
+
function Qs(e) {
|
|
6164
|
+
if (e instanceof Rr) {
|
|
6149
6165
|
let t = e.response.errors ?? [];
|
|
6150
6166
|
if (t.length === 1) return {
|
|
6151
6167
|
kind: "error",
|
|
@@ -6165,23 +6181,23 @@ function Xs(e) {
|
|
|
6165
6181
|
detail: e instanceof Error ? e.message : String(e)
|
|
6166
6182
|
};
|
|
6167
6183
|
}
|
|
6168
|
-
var
|
|
6169
|
-
function
|
|
6170
|
-
let e = s(
|
|
6184
|
+
var $s = r(null);
|
|
6185
|
+
function ec() {
|
|
6186
|
+
let e = s($s);
|
|
6171
6187
|
if (!e) throw Error("useActionRunner must be used within <ActionRunnerProvider>");
|
|
6172
6188
|
return e;
|
|
6173
6189
|
}
|
|
6174
|
-
function
|
|
6190
|
+
function tc(e) {
|
|
6175
6191
|
let t = {}, n = e.action?.resolved_hidden_defaults;
|
|
6176
6192
|
if (n) for (let [e, r] of Object.entries(n)) r !== void 0 && (t[e] = r);
|
|
6177
6193
|
return t;
|
|
6178
6194
|
}
|
|
6179
|
-
function
|
|
6195
|
+
function nc({ children: e }) {
|
|
6180
6196
|
let t = hr(), { data: n } = J(), [r, i] = f(null), [a, s] = f(null), c = o((e) => {
|
|
6181
6197
|
if (e?.progress_screen) return n?.screens[e.progress_screen]?.route;
|
|
6182
6198
|
}, [n?.screens]), l = o((e, n, r, i, a) => {
|
|
6183
6199
|
let o = () => {
|
|
6184
|
-
let n =
|
|
6200
|
+
let n = rc(a), i = c(r), o = n ? `Job ${n} queued` : "Running in background";
|
|
6185
6201
|
Z.success(`${e} started`, o, i ? { action: {
|
|
6186
6202
|
label: "View",
|
|
6187
6203
|
onClick: () => t(i)
|
|
@@ -6220,16 +6236,16 @@ function ec({ children: e }) {
|
|
|
6220
6236
|
pending: !1
|
|
6221
6237
|
}), Promise.resolve()) : (async (n) => {
|
|
6222
6238
|
try {
|
|
6223
|
-
let i = await e.execute(n), o =
|
|
6239
|
+
let i = await e.execute(n), o = Ys(i);
|
|
6224
6240
|
if (l(a, r, t, o, i), o.kind === "success" || o.kind === "accepted") {
|
|
6225
6241
|
e.onSuccess?.(i);
|
|
6226
|
-
let t =
|
|
6227
|
-
t && s(t),
|
|
6242
|
+
let t = Xs(i);
|
|
6243
|
+
t && s(t), Zs(i);
|
|
6228
6244
|
}
|
|
6229
6245
|
} catch (e) {
|
|
6230
|
-
l(a, r, t,
|
|
6246
|
+
l(a, r, t, Qs(e));
|
|
6231
6247
|
}
|
|
6232
|
-
})(
|
|
6248
|
+
})(tc(e));
|
|
6233
6249
|
}, [l]), p = u(() => ({ run: d }), [d]), m = r?.opts.action, h = o(async (e) => {
|
|
6234
6250
|
if (!r) return;
|
|
6235
6251
|
let t = r.id, n = r, a = n.opts.action, o = n.opts.longRunning ?? a?.long_running ?? !1;
|
|
@@ -6238,15 +6254,15 @@ function ec({ children: e }) {
|
|
|
6238
6254
|
pending: !0
|
|
6239
6255
|
} : e);
|
|
6240
6256
|
try {
|
|
6241
|
-
let r = await n.opts.execute(e), c =
|
|
6257
|
+
let r = await n.opts.execute(e), c = Ys(r);
|
|
6242
6258
|
if (l(n.title, o, a, c, r), c.kind === "success" || c.kind === "accepted") {
|
|
6243
6259
|
n.opts.onSuccess?.(r);
|
|
6244
|
-
let e =
|
|
6245
|
-
e && s(e),
|
|
6260
|
+
let e = Xs(r);
|
|
6261
|
+
e && s(e), Zs(r);
|
|
6246
6262
|
}
|
|
6247
6263
|
c.kind !== "partial" && i((e) => e?.id === t ? null : e);
|
|
6248
6264
|
} catch (e) {
|
|
6249
|
-
l(n.title, o, a,
|
|
6265
|
+
l(n.title, o, a, Qs(e));
|
|
6250
6266
|
} finally {
|
|
6251
6267
|
i((e) => e?.id === t ? {
|
|
6252
6268
|
...e,
|
|
@@ -6254,16 +6270,16 @@ function ec({ children: e }) {
|
|
|
6254
6270
|
} : e);
|
|
6255
6271
|
}
|
|
6256
6272
|
}, [r, l]);
|
|
6257
|
-
return /* @__PURE__ */ y(
|
|
6273
|
+
return /* @__PURE__ */ y($s.Provider, {
|
|
6258
6274
|
value: p,
|
|
6259
6275
|
children: [
|
|
6260
6276
|
e,
|
|
6261
|
-
a && /* @__PURE__ */ v(
|
|
6277
|
+
a && /* @__PURE__ */ v(qs, {
|
|
6262
6278
|
open: !0,
|
|
6263
6279
|
onClose: () => s(null),
|
|
6264
6280
|
display: a
|
|
6265
6281
|
}),
|
|
6266
|
-
r?.kind === "params" && m && /* @__PURE__ */ v(
|
|
6282
|
+
r?.kind === "params" && m && /* @__PURE__ */ v(Ks, {
|
|
6267
6283
|
open: !0,
|
|
6268
6284
|
onOpenChange: (e) => {
|
|
6269
6285
|
e || i(null);
|
|
@@ -6274,21 +6290,21 @@ function ec({ children: e }) {
|
|
|
6274
6290
|
isPending: r.pending,
|
|
6275
6291
|
bulkSelection: r.opts.bulkSelection
|
|
6276
6292
|
}),
|
|
6277
|
-
r?.kind === "confirm" && /* @__PURE__ */ v(
|
|
6293
|
+
r?.kind === "confirm" && /* @__PURE__ */ v(ic, {
|
|
6278
6294
|
state: r,
|
|
6279
6295
|
onClose: () => i(null),
|
|
6280
6296
|
onExecute: async (e) => {
|
|
6281
6297
|
let t = r.id, n = r, a = n.opts.action, o = n.opts.longRunning ?? a?.long_running ?? !1, c = !1;
|
|
6282
6298
|
try {
|
|
6283
|
-
let t = await n.opts.execute(e), r =
|
|
6299
|
+
let t = await n.opts.execute(e), r = Ys(t);
|
|
6284
6300
|
if (l(n.title, o, a, r, t), r.kind === "success" || r.kind === "accepted") {
|
|
6285
6301
|
n.opts.onSuccess?.(t);
|
|
6286
|
-
let e =
|
|
6287
|
-
e && s(e),
|
|
6302
|
+
let e = Xs(t);
|
|
6303
|
+
e && s(e), Zs(t);
|
|
6288
6304
|
}
|
|
6289
6305
|
c = r.kind === "partial";
|
|
6290
6306
|
} catch (e) {
|
|
6291
|
-
l(n.title, o, a,
|
|
6307
|
+
l(n.title, o, a, Qs(e));
|
|
6292
6308
|
} finally {
|
|
6293
6309
|
c || i((e) => e?.id === t ? null : e);
|
|
6294
6310
|
}
|
|
@@ -6297,12 +6313,12 @@ function ec({ children: e }) {
|
|
|
6297
6313
|
]
|
|
6298
6314
|
});
|
|
6299
6315
|
}
|
|
6300
|
-
function
|
|
6316
|
+
function rc(e) {
|
|
6301
6317
|
if (!e || typeof e != "object") return;
|
|
6302
6318
|
let t = e, n = t.job_id ?? t.id;
|
|
6303
6319
|
return typeof n == "string" ? n : void 0;
|
|
6304
6320
|
}
|
|
6305
|
-
function
|
|
6321
|
+
function ic({ state: t, onClose: n, onExecute: r }) {
|
|
6306
6322
|
let { title: i, opts: a } = t, [o, s] = f(!1), c = a.action, l = a.destructive ?? c?.destructive ?? !1;
|
|
6307
6323
|
return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("div", {
|
|
6308
6324
|
onClick: n,
|
|
@@ -6392,7 +6408,7 @@ function nc({ state: t, onClose: n, onExecute: r }) {
|
|
|
6392
6408
|
onClick: async () => {
|
|
6393
6409
|
s(!0);
|
|
6394
6410
|
try {
|
|
6395
|
-
await r(
|
|
6411
|
+
await r(tc(a));
|
|
6396
6412
|
} finally {
|
|
6397
6413
|
s(!1);
|
|
6398
6414
|
}
|
|
@@ -6404,4 +6420,4 @@ function nc({ state: t, onClose: n, onExecute: r }) {
|
|
|
6404
6420
|
})] });
|
|
6405
6421
|
}
|
|
6406
6422
|
//#endregion
|
|
6407
|
-
export {
|
|
6423
|
+
export { Z as $, We as $t, wi as A, oe as An, Qt as At, Mr as B, ft as Bt, ga as C, xe as Cn, hn as Ct, Zi as D, N as Dn, W as Dt, na as E, ue as En, yn as Et, si as F, O as Fn, mt as Ft, jr as G, $e as Gt, Fr as H, rt as Ht, $r as I, D as In, pt as It, Ir as J, Ke as Jt, Ar as K, z as Kt, Zr as L, E as Ln, lt as Lt, Ti as M, M as Mn, $t as Mt, Ci as N, ie as Nn, bt as Nt, ki as O, Se as On, K as Ot, li as P, k as Pn, Ct as Pt, Nr as Q, Ue as Qt, Rr as R, T as Rn, st as Rt, oa as S, Ce as Sn, vn as St, ra as T, ye as Tn, Sn as Tt, qr as U, it as Ut, Pr as V, nt as Vt, Lr as W, et as Wt, Kr as X, Te as Xt, Hr as Y, Je as Yt, Gr as Z, He as Zt, Sa as _, we as _n, _n as _t, js as a, R as an, lr as at, ha as b, be as bn, wn as bt, Ds as c, Be as cn, ar as ct, Ts as d, Ne as dn, Vn as dt, Me as en, hr as et, fs as f, Ve as fn, Kn as ft, ba as g, F as gn, mn as gt, as as h, ze as hn, En as ht, Ks as i, Ee as in, fr as it, Ei as j, ae as jn, en as jt, Di as k, se as kn, q as kt, Es as l, Re as ln, or as lt, ss as m, ke as mn, Dn as mt, ec as n, Fe as nn, gr as nt, Ms as o, I as on, sr as ot, us as p, L as pn, J as pt, Jr as q, qe as qt, qs as r, Ae as rn, mr as rt, Ls as s, Ie as sn, cr as st, nc as t, Pe as tn, _r as tt, bs as u, Le as un, Zn as ut, xa as v, me as vn, Tn as vt, Qi as w, P as wn, gn as wt, va as x, ve as xn, xn as xt, Q as y, ce as yn, Cn as yt, Br as z, ct as zt };
|