@declarion/react 0.1.48 → 0.1.51
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/components/detail-layout/AssociatedBlock.d.ts +4 -0
- package/dist-lib/components/primitives/Icons.d.ts +30 -0
- package/dist-lib/components/shared/RowActionsKebab.d.ts +19 -0
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/index.js +1152 -777
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/types/schema.d.ts +1 -2
- package/package.json +1 -1
package/dist-lib/index.js
CHANGED
|
@@ -5,9 +5,9 @@ import { Toaster as A, toast as j } from "sonner";
|
|
|
5
5
|
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
6
6
|
import { createPortal as F } from "react-dom";
|
|
7
7
|
import { create as I } from "zustand";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { flexRender as
|
|
8
|
+
import ee from "react-markdown";
|
|
9
|
+
import L from "remark-breaks";
|
|
10
|
+
import { flexRender as R, getCoreRowModel as te, useReactTable as ne } from "@tanstack/react-table";
|
|
11
11
|
import { useVirtualizer as re } from "@tanstack/react-virtual";
|
|
12
12
|
import { clsx as ie } from "clsx";
|
|
13
13
|
import { twMerge as ae } from "tailwind-merge";
|
|
@@ -409,7 +409,239 @@ var z = (e, t = {}) => ({ size: n = 14, cls: r = "", style: i = {} }) => /* @__P
|
|
|
409
409
|
width: "18",
|
|
410
410
|
height: "14",
|
|
411
411
|
rx: "1"
|
|
412
|
-
}), /* @__PURE__ */ N("path", { d: "M3 9h18M3 13h18M9 9v10M15 9v10" })] }))
|
|
412
|
+
}), /* @__PURE__ */ N("path", { d: "M3 9h18M3 13h18M9 9v10M15 9v10" })] })),
|
|
413
|
+
"users-round": z(/* @__PURE__ */ P(M, { children: [
|
|
414
|
+
/* @__PURE__ */ N("circle", {
|
|
415
|
+
cx: "10",
|
|
416
|
+
cy: "8",
|
|
417
|
+
r: "5"
|
|
418
|
+
}),
|
|
419
|
+
/* @__PURE__ */ N("path", { d: "M2 21a8 8 0 0 1 16 0" }),
|
|
420
|
+
/* @__PURE__ */ N("path", { d: "M17 4a5 5 0 0 1 0 8" }),
|
|
421
|
+
/* @__PURE__ */ N("path", { d: "M22 21a6 6 0 0 0-4-5.6" })
|
|
422
|
+
] })),
|
|
423
|
+
user: z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("circle", {
|
|
424
|
+
cx: "12",
|
|
425
|
+
cy: "7",
|
|
426
|
+
r: "4"
|
|
427
|
+
}), /* @__PURE__ */ N("path", { d: "M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2" })] })),
|
|
428
|
+
"user-plus": z(/* @__PURE__ */ P(M, { children: [
|
|
429
|
+
/* @__PURE__ */ N("circle", {
|
|
430
|
+
cx: "9",
|
|
431
|
+
cy: "7",
|
|
432
|
+
r: "4"
|
|
433
|
+
}),
|
|
434
|
+
/* @__PURE__ */ N("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
|
|
435
|
+
/* @__PURE__ */ N("path", { d: "M19 8v6M22 11h-6" })
|
|
436
|
+
] })),
|
|
437
|
+
"shield-check": z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("path", { d: "M12 3 4 6v6c0 4.5 3.5 8 8 9 4.5-1 8-4.5 8-9V6z" }), /* @__PURE__ */ N("path", { d: "m9 12 2 2 4-4" })] })),
|
|
438
|
+
"shield-plus": z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("path", { d: "M12 3 4 6v6c0 4.5 3.5 8 8 9 4.5-1 8-4.5 8-9V6z" }), /* @__PURE__ */ N("path", { d: "M9 12h6M12 9v6" })] })),
|
|
439
|
+
"key-round": z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("path", { d: "M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4z" }), /* @__PURE__ */ N("circle", {
|
|
440
|
+
cx: "16.5",
|
|
441
|
+
cy: "7.5",
|
|
442
|
+
r: "0.5",
|
|
443
|
+
fill: "currentColor"
|
|
444
|
+
})] })),
|
|
445
|
+
"list-checks": z(/* @__PURE__ */ P(M, { children: [
|
|
446
|
+
/* @__PURE__ */ N("path", { d: "m3 17 2 2 4-4" }),
|
|
447
|
+
/* @__PURE__ */ N("path", { d: "m3 7 2 2 4-4" }),
|
|
448
|
+
/* @__PURE__ */ N("path", { d: "M13 6h8M13 12h8M13 18h8" })
|
|
449
|
+
] })),
|
|
450
|
+
list: z(/* @__PURE__ */ P(M, { children: [
|
|
451
|
+
/* @__PURE__ */ N("path", { d: "M8 6h13M8 12h13M8 18h13" }),
|
|
452
|
+
/* @__PURE__ */ N("circle", {
|
|
453
|
+
cx: "3.5",
|
|
454
|
+
cy: "6",
|
|
455
|
+
r: "0.5",
|
|
456
|
+
fill: "currentColor"
|
|
457
|
+
}),
|
|
458
|
+
/* @__PURE__ */ N("circle", {
|
|
459
|
+
cx: "3.5",
|
|
460
|
+
cy: "12",
|
|
461
|
+
r: "0.5",
|
|
462
|
+
fill: "currentColor"
|
|
463
|
+
}),
|
|
464
|
+
/* @__PURE__ */ N("circle", {
|
|
465
|
+
cx: "3.5",
|
|
466
|
+
cy: "18",
|
|
467
|
+
r: "0.5",
|
|
468
|
+
fill: "currentColor"
|
|
469
|
+
})
|
|
470
|
+
] })),
|
|
471
|
+
"play-circle": z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("circle", {
|
|
472
|
+
cx: "12",
|
|
473
|
+
cy: "12",
|
|
474
|
+
r: "9"
|
|
475
|
+
}), /* @__PURE__ */ N("path", { d: "M10 8.5v7L16 12z" })] })),
|
|
476
|
+
play: z(/* @__PURE__ */ N(M, { children: /* @__PURE__ */ N("path", { d: "M6 3 20 12 6 21z" }) })),
|
|
477
|
+
layers: z(/* @__PURE__ */ P(M, { children: [
|
|
478
|
+
/* @__PURE__ */ N("path", { d: "M12 2 2 7l10 5 10-5z" }),
|
|
479
|
+
/* @__PURE__ */ N("path", { d: "m2 12 10 5 10-5" }),
|
|
480
|
+
/* @__PURE__ */ N("path", { d: "m2 17 10 5 10-5" })
|
|
481
|
+
] })),
|
|
482
|
+
layout: z(/* @__PURE__ */ P(M, { children: [
|
|
483
|
+
/* @__PURE__ */ N("rect", {
|
|
484
|
+
x: "3",
|
|
485
|
+
y: "3",
|
|
486
|
+
width: "18",
|
|
487
|
+
height: "18",
|
|
488
|
+
rx: "2"
|
|
489
|
+
}),
|
|
490
|
+
/* @__PURE__ */ N("path", { d: "M3 9h18" }),
|
|
491
|
+
/* @__PURE__ */ N("path", { d: "M9 21V9" })
|
|
492
|
+
] })),
|
|
493
|
+
"layout-dashboard": z(/* @__PURE__ */ P(M, { children: [
|
|
494
|
+
/* @__PURE__ */ N("rect", {
|
|
495
|
+
x: "3",
|
|
496
|
+
y: "3",
|
|
497
|
+
width: "7",
|
|
498
|
+
height: "9",
|
|
499
|
+
rx: "1"
|
|
500
|
+
}),
|
|
501
|
+
/* @__PURE__ */ N("rect", {
|
|
502
|
+
x: "14",
|
|
503
|
+
y: "3",
|
|
504
|
+
width: "7",
|
|
505
|
+
height: "5",
|
|
506
|
+
rx: "1"
|
|
507
|
+
}),
|
|
508
|
+
/* @__PURE__ */ N("rect", {
|
|
509
|
+
x: "14",
|
|
510
|
+
y: "12",
|
|
511
|
+
width: "7",
|
|
512
|
+
height: "9",
|
|
513
|
+
rx: "1"
|
|
514
|
+
}),
|
|
515
|
+
/* @__PURE__ */ N("rect", {
|
|
516
|
+
x: "3",
|
|
517
|
+
y: "16",
|
|
518
|
+
width: "7",
|
|
519
|
+
height: "5",
|
|
520
|
+
rx: "1"
|
|
521
|
+
})
|
|
522
|
+
] })),
|
|
523
|
+
database: z(/* @__PURE__ */ P(M, { children: [
|
|
524
|
+
/* @__PURE__ */ N("ellipse", {
|
|
525
|
+
cx: "12",
|
|
526
|
+
cy: "5",
|
|
527
|
+
rx: "9",
|
|
528
|
+
ry: "3"
|
|
529
|
+
}),
|
|
530
|
+
/* @__PURE__ */ N("path", { d: "M3 5v14c0 1.7 4 3 9 3s9-1.3 9-3V5" }),
|
|
531
|
+
/* @__PURE__ */ N("path", { d: "M3 12c0 1.7 4 3 9 3s9-1.3 9-3" })
|
|
532
|
+
] })),
|
|
533
|
+
zap: z(/* @__PURE__ */ N(M, { children: /* @__PURE__ */ N("path", { d: "M13 3 4 14h6l-1 7 9-11h-6z" }) })),
|
|
534
|
+
cpu: z(/* @__PURE__ */ P(M, { children: [
|
|
535
|
+
/* @__PURE__ */ N("rect", {
|
|
536
|
+
x: "4",
|
|
537
|
+
y: "4",
|
|
538
|
+
width: "16",
|
|
539
|
+
height: "16",
|
|
540
|
+
rx: "2"
|
|
541
|
+
}),
|
|
542
|
+
/* @__PURE__ */ N("rect", {
|
|
543
|
+
x: "9",
|
|
544
|
+
y: "9",
|
|
545
|
+
width: "6",
|
|
546
|
+
height: "6"
|
|
547
|
+
}),
|
|
548
|
+
/* @__PURE__ */ N("path", { d: "M9 2v2M15 2v2M9 20v2M15 20v2M2 9h2M2 15h2M20 9h2M20 15h2" })
|
|
549
|
+
] })),
|
|
550
|
+
"circle-dot": z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("circle", {
|
|
551
|
+
cx: "12",
|
|
552
|
+
cy: "12",
|
|
553
|
+
r: "9"
|
|
554
|
+
}), /* @__PURE__ */ N("circle", {
|
|
555
|
+
cx: "12",
|
|
556
|
+
cy: "12",
|
|
557
|
+
r: "1.5",
|
|
558
|
+
fill: "currentColor"
|
|
559
|
+
})] })),
|
|
560
|
+
"toggle-right": z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("rect", {
|
|
561
|
+
x: "2",
|
|
562
|
+
y: "6",
|
|
563
|
+
width: "20",
|
|
564
|
+
height: "12",
|
|
565
|
+
rx: "6"
|
|
566
|
+
}), /* @__PURE__ */ N("circle", {
|
|
567
|
+
cx: "16",
|
|
568
|
+
cy: "12",
|
|
569
|
+
r: "2.5",
|
|
570
|
+
fill: "currentColor"
|
|
571
|
+
})] })),
|
|
572
|
+
sliders: z(/* @__PURE__ */ N(M, { children: /* @__PURE__ */ N("path", { d: "M21 4h-7M10 4H3M21 12h-9M8 12H3M21 20h-5M12 20H3M14 2v4M8 10v4M16 18v4" }) })),
|
|
573
|
+
"sliders-horizontal": z(/* @__PURE__ */ N(M, { children: /* @__PURE__ */ N("path", { d: "M21 4h-7M10 4H3M21 12h-9M8 12H3M21 20h-5M12 20H3M14 2v4M8 10v4M16 18v4" }) })),
|
|
574
|
+
box: z(/* @__PURE__ */ P(M, { children: [
|
|
575
|
+
/* @__PURE__ */ N("path", { d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" }),
|
|
576
|
+
/* @__PURE__ */ N("path", { d: "m3.3 7 8.7 5 8.7-5" }),
|
|
577
|
+
/* @__PURE__ */ N("path", { d: "M12 22V12" })
|
|
578
|
+
] })),
|
|
579
|
+
"columns-3": z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("rect", {
|
|
580
|
+
x: "3",
|
|
581
|
+
y: "4",
|
|
582
|
+
width: "18",
|
|
583
|
+
height: "16",
|
|
584
|
+
rx: "1"
|
|
585
|
+
}), /* @__PURE__ */ N("path", { d: "M9 4v16M15 4v16" })] })),
|
|
586
|
+
"settings-2": z(/* @__PURE__ */ P(M, { children: [
|
|
587
|
+
/* @__PURE__ */ N("path", { d: "M20 7h-9M14 17H5" }),
|
|
588
|
+
/* @__PURE__ */ N("circle", {
|
|
589
|
+
cx: "17",
|
|
590
|
+
cy: "17",
|
|
591
|
+
r: "3"
|
|
592
|
+
}),
|
|
593
|
+
/* @__PURE__ */ N("circle", {
|
|
594
|
+
cx: "7",
|
|
595
|
+
cy: "7",
|
|
596
|
+
r: "3"
|
|
597
|
+
})
|
|
598
|
+
] })),
|
|
599
|
+
"file-diff": z(/* @__PURE__ */ P(M, { children: [
|
|
600
|
+
/* @__PURE__ */ N("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
601
|
+
/* @__PURE__ */ N("path", { d: "M14 2v6h6" }),
|
|
602
|
+
/* @__PURE__ */ N("path", { d: "M12 12v6M9 15h6M9 18h6" })
|
|
603
|
+
] })),
|
|
604
|
+
"git-branch": z(/* @__PURE__ */ P(M, { children: [
|
|
605
|
+
/* @__PURE__ */ N("circle", {
|
|
606
|
+
cx: "6",
|
|
607
|
+
cy: "6",
|
|
608
|
+
r: "2"
|
|
609
|
+
}),
|
|
610
|
+
/* @__PURE__ */ N("circle", {
|
|
611
|
+
cx: "6",
|
|
612
|
+
cy: "18",
|
|
613
|
+
r: "2"
|
|
614
|
+
}),
|
|
615
|
+
/* @__PURE__ */ N("circle", {
|
|
616
|
+
cx: "18",
|
|
617
|
+
cy: "8",
|
|
618
|
+
r: "2"
|
|
619
|
+
}),
|
|
620
|
+
/* @__PURE__ */ N("path", { d: "M6 8v8" }),
|
|
621
|
+
/* @__PURE__ */ N("path", { d: "M18 10a6 6 0 0 1-6 6h-2" })
|
|
622
|
+
] })),
|
|
623
|
+
"log-in": z(/* @__PURE__ */ P(M, { children: [
|
|
624
|
+
/* @__PURE__ */ N("path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" }),
|
|
625
|
+
/* @__PURE__ */ N("path", { d: "m10 17 5-5-5-5" }),
|
|
626
|
+
/* @__PURE__ */ N("path", { d: "M15 12H3" })
|
|
627
|
+
] })),
|
|
628
|
+
"plus-circle": z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("circle", {
|
|
629
|
+
cx: "12",
|
|
630
|
+
cy: "12",
|
|
631
|
+
r: "9"
|
|
632
|
+
}), /* @__PURE__ */ N("path", { d: "M8 12h8M12 8v8" })] })),
|
|
633
|
+
repeat: z(/* @__PURE__ */ P(M, { children: [
|
|
634
|
+
/* @__PURE__ */ N("path", { d: "m17 2 4 4-4 4" }),
|
|
635
|
+
/* @__PURE__ */ N("path", { d: "M3 11v-1a4 4 0 0 1 4-4h14" }),
|
|
636
|
+
/* @__PURE__ */ N("path", { d: "m7 22-4-4 4-4" }),
|
|
637
|
+
/* @__PURE__ */ N("path", { d: "M21 13v1a4 4 0 0 1-4 4H3" })
|
|
638
|
+
] })),
|
|
639
|
+
ban: z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("circle", {
|
|
640
|
+
cx: "12",
|
|
641
|
+
cy: "12",
|
|
642
|
+
r: "9"
|
|
643
|
+
}), /* @__PURE__ */ N("path", { d: "m5.6 5.6 12.8 12.8" })] })),
|
|
644
|
+
"trash-2": z(/* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("path", { d: "M4 7h16M9 7V4h6v3M6 7l1 13a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-13" }), /* @__PURE__ */ N("path", { d: "M10 11v6M14 11v6" })] }))
|
|
413
645
|
}, V = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r, children: i, onClick: a, active: o, danger: s, style: c, disabled: l, type: u = "button", title: d, ...f }, p) {
|
|
414
646
|
let m = {
|
|
415
647
|
display: "inline-flex",
|
|
@@ -542,7 +774,7 @@ function U({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style:
|
|
|
542
774
|
}
|
|
543
775
|
//#endregion
|
|
544
776
|
//#region src/components/primitives/Kbd.tsx
|
|
545
|
-
function
|
|
777
|
+
function W({ children: e }) {
|
|
546
778
|
return /* @__PURE__ */ N("span", {
|
|
547
779
|
className: "mono",
|
|
548
780
|
style: {
|
|
@@ -563,7 +795,7 @@ function ge({ children: e }) {
|
|
|
563
795
|
}
|
|
564
796
|
//#endregion
|
|
565
797
|
//#region src/components/primitives/Avatar.tsx
|
|
566
|
-
function
|
|
798
|
+
function ge({ name: e, size: t = 22, color: n }) {
|
|
567
799
|
let r = e.split(/\s+/).map((e) => e[0]).slice(0, 2).join("").toUpperCase(), i = e.split("").reduce((e, t) => e + t.charCodeAt(0), 0), a = [
|
|
568
800
|
"#DCE4F6",
|
|
569
801
|
"#E4DCF6",
|
|
@@ -593,7 +825,7 @@ function _e({ name: e, size: t = 22, color: n }) {
|
|
|
593
825
|
}
|
|
594
826
|
//#endregion
|
|
595
827
|
//#region src/components/primitives/Dropdown.tsx
|
|
596
|
-
function
|
|
828
|
+
function _e({ open: e, onClose: t, anchor: n, children: r, align: i = "start", width: a, style: o }) {
|
|
597
829
|
let s = f(null), [c, d] = p(null);
|
|
598
830
|
return u(() => {
|
|
599
831
|
if (!e || !n) return;
|
|
@@ -639,7 +871,7 @@ function ve({ open: e, onClose: t, anchor: n, children: r, align: i = "start", w
|
|
|
639
871
|
}
|
|
640
872
|
//#endregion
|
|
641
873
|
//#region src/components/primitives/Chip.tsx
|
|
642
|
-
function
|
|
874
|
+
function ve({ icon: e, children: t, onRemove: n, onClick: r }) {
|
|
643
875
|
return /* @__PURE__ */ P("span", {
|
|
644
876
|
onClick: r,
|
|
645
877
|
style: {
|
|
@@ -679,7 +911,7 @@ function ye({ icon: e, children: t, onRemove: n, onClick: r }) {
|
|
|
679
911
|
}
|
|
680
912
|
//#endregion
|
|
681
913
|
//#region src/components/primitives/SectionCard.tsx
|
|
682
|
-
function
|
|
914
|
+
function ye({ title: e, subtitle: t, right: n, badge: r, children: i, collapsible: a = !0, defaultOpen: o = !0, icon: s, padding: c = "16px" }) {
|
|
683
915
|
let [l, u] = p(o);
|
|
684
916
|
return /* @__PURE__ */ P("div", {
|
|
685
917
|
style: {
|
|
@@ -760,14 +992,14 @@ function be({ title: e, subtitle: t, right: n, badge: r, children: i, collapsibl
|
|
|
760
992
|
}
|
|
761
993
|
//#endregion
|
|
762
994
|
//#region src/components/primitives/RecordIdBadge.tsx
|
|
763
|
-
var
|
|
764
|
-
function
|
|
765
|
-
let [t, n] = p(!1), r =
|
|
995
|
+
var be = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, xe = 1200;
|
|
996
|
+
function Se({ value: e }) {
|
|
997
|
+
let [t, n] = p(!1), r = be.test(e) ? `${e.slice(0, 8)}…` : e;
|
|
766
998
|
return /* @__PURE__ */ P("button", {
|
|
767
999
|
type: "button",
|
|
768
1000
|
onClick: s(async () => {
|
|
769
1001
|
try {
|
|
770
|
-
await navigator.clipboard.writeText(e), n(!0), window.setTimeout(() => n(!1),
|
|
1002
|
+
await navigator.clipboard.writeText(e), n(!0), window.setTimeout(() => n(!1), xe);
|
|
771
1003
|
} catch {}
|
|
772
1004
|
}, [e]),
|
|
773
1005
|
title: t ? "Copied" : `Copy ${e}`,
|
|
@@ -889,7 +1121,7 @@ function K({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, div
|
|
|
889
1121
|
style: { flex: 1 },
|
|
890
1122
|
children: t
|
|
891
1123
|
}),
|
|
892
|
-
i && /* @__PURE__ */ N(
|
|
1124
|
+
i && /* @__PURE__ */ N(W, { children: i })
|
|
893
1125
|
]
|
|
894
1126
|
});
|
|
895
1127
|
}
|
|
@@ -931,7 +1163,7 @@ function we({ checked: e, onChange: t, indeterminate: n, size: r = 14 }) {
|
|
|
931
1163
|
}
|
|
932
1164
|
//#endregion
|
|
933
1165
|
//#region src/components/primitives/Spinner.tsx
|
|
934
|
-
function
|
|
1166
|
+
function q({ size: e = 14 }) {
|
|
935
1167
|
return /* @__PURE__ */ P("svg", {
|
|
936
1168
|
width: e,
|
|
937
1169
|
height: e,
|
|
@@ -959,7 +1191,7 @@ function Te({ size: e = 14 }) {
|
|
|
959
1191
|
}
|
|
960
1192
|
//#endregion
|
|
961
1193
|
//#region src/components/primitives/Fields.tsx
|
|
962
|
-
var
|
|
1194
|
+
var J = ({ children: e, required: t, hint: n }) => /* @__PURE__ */ P("div", {
|
|
963
1195
|
style: {
|
|
964
1196
|
display: "flex",
|
|
965
1197
|
alignItems: "center",
|
|
@@ -986,7 +1218,7 @@ var q = ({ children: e, required: t, hint: n }) => /* @__PURE__ */ P("div", {
|
|
|
986
1218
|
children: /* @__PURE__ */ N(B.info, { size: 11 })
|
|
987
1219
|
})
|
|
988
1220
|
]
|
|
989
|
-
}),
|
|
1221
|
+
}), Te = {
|
|
990
1222
|
width: "100%",
|
|
991
1223
|
height: 30,
|
|
992
1224
|
padding: "0 10px",
|
|
@@ -999,14 +1231,14 @@ var q = ({ children: e, required: t, hint: n }) => /* @__PURE__ */ P("div", {
|
|
|
999
1231
|
outline: "none",
|
|
1000
1232
|
transition: "border-color .12s, box-shadow .12s"
|
|
1001
1233
|
};
|
|
1002
|
-
function
|
|
1234
|
+
function Y({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style: a, ...o }) {
|
|
1003
1235
|
let [s, c] = p(!1);
|
|
1004
1236
|
return /* @__PURE__ */ P("div", {
|
|
1005
1237
|
style: {
|
|
1006
1238
|
display: "flex",
|
|
1007
1239
|
alignItems: "center",
|
|
1008
1240
|
gap: 6,
|
|
1009
|
-
...
|
|
1241
|
+
...Te,
|
|
1010
1242
|
padding: r || i ? "0 8px" : "0 10px",
|
|
1011
1243
|
borderColor: s ? "var(--accent)" : "var(--border)",
|
|
1012
1244
|
boxShadow: s ? "0 0 0 3px var(--accent-ring)" : "none",
|
|
@@ -1048,7 +1280,7 @@ function J({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
|
|
|
1048
1280
|
]
|
|
1049
1281
|
});
|
|
1050
1282
|
}
|
|
1051
|
-
function
|
|
1283
|
+
function Ee({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i }) {
|
|
1052
1284
|
let [a, o] = p(!1), s = i ? {
|
|
1053
1285
|
flex: 1,
|
|
1054
1286
|
height: "100%",
|
|
@@ -1066,7 +1298,7 @@ function De({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i }) {
|
|
|
1066
1298
|
onFocus: () => o(!0),
|
|
1067
1299
|
onBlur: () => o(!1),
|
|
1068
1300
|
style: {
|
|
1069
|
-
...
|
|
1301
|
+
...Te,
|
|
1070
1302
|
padding: "8px 10px",
|
|
1071
1303
|
lineHeight: 1.5,
|
|
1072
1304
|
...s,
|
|
@@ -1076,14 +1308,14 @@ function De({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i }) {
|
|
|
1076
1308
|
}
|
|
1077
1309
|
});
|
|
1078
1310
|
}
|
|
1079
|
-
function
|
|
1311
|
+
function De({ value: e, options: t, onChange: n, placeholder: r = "Select..." }) {
|
|
1080
1312
|
let [i, a] = p(!1), o = f(null), s = t.find((t) => t.value === e);
|
|
1081
1313
|
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P("button", {
|
|
1082
1314
|
type: "button",
|
|
1083
1315
|
ref: o,
|
|
1084
1316
|
onClick: () => a(!i),
|
|
1085
1317
|
style: {
|
|
1086
|
-
...
|
|
1318
|
+
...Te,
|
|
1087
1319
|
display: "flex",
|
|
1088
1320
|
alignItems: "center",
|
|
1089
1321
|
justifyContent: "space-between",
|
|
@@ -1105,7 +1337,7 @@ function Oe({ value: e, options: t, onChange: n, placeholder: r = "Select..." })
|
|
|
1105
1337
|
cls: "",
|
|
1106
1338
|
style: { color: "var(--text-3)" }
|
|
1107
1339
|
})]
|
|
1108
|
-
}), /* @__PURE__ */ N(
|
|
1340
|
+
}), /* @__PURE__ */ N(_e, {
|
|
1109
1341
|
open: i,
|
|
1110
1342
|
anchor: o.current,
|
|
1111
1343
|
onClose: () => a(!1),
|
|
@@ -1119,35 +1351,35 @@ function Oe({ value: e, options: t, onChange: n, placeholder: r = "Select..." })
|
|
|
1119
1351
|
}, t.value))
|
|
1120
1352
|
})] });
|
|
1121
1353
|
}
|
|
1122
|
-
function
|
|
1123
|
-
return /* @__PURE__ */ N(
|
|
1354
|
+
function Oe({ value: e, onChange: t }) {
|
|
1355
|
+
return /* @__PURE__ */ N(Y, {
|
|
1124
1356
|
value: e || "",
|
|
1125
1357
|
onChange: t,
|
|
1126
1358
|
placeholder: "YYYY-MM-DD HH:mm",
|
|
1127
1359
|
prefix: /* @__PURE__ */ N(B.calendar, { size: 13 })
|
|
1128
1360
|
});
|
|
1129
1361
|
}
|
|
1130
|
-
function
|
|
1362
|
+
function ke(e) {
|
|
1131
1363
|
if (!e) return 0;
|
|
1132
1364
|
let t = 0;
|
|
1133
1365
|
return e.length >= 8 && t++, e.length >= 12 && t++, /[A-Z]/.test(e) && /[a-z]/.test(e) && t++, /\d/.test(e) && t++, /[^A-Za-z0-9]/.test(e) && t++, Math.min(4, t);
|
|
1134
1366
|
}
|
|
1135
|
-
var
|
|
1367
|
+
var Ae = [
|
|
1136
1368
|
"Too short",
|
|
1137
1369
|
"Weak",
|
|
1138
1370
|
"Fair",
|
|
1139
1371
|
"Good",
|
|
1140
1372
|
"Strong"
|
|
1141
|
-
],
|
|
1373
|
+
], je = [
|
|
1142
1374
|
"var(--danger)",
|
|
1143
1375
|
"var(--danger)",
|
|
1144
1376
|
"var(--warning, #B45309)",
|
|
1145
1377
|
"var(--accent)",
|
|
1146
1378
|
"var(--success, #3FBF8F)"
|
|
1147
1379
|
];
|
|
1148
|
-
function
|
|
1149
|
-
let [i, a] = p(!1), o = e || "", s =
|
|
1150
|
-
return /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
1380
|
+
function Me({ value: e, onChange: t, placeholder: n = "Enter password", showStrength: r }) {
|
|
1381
|
+
let [i, a] = p(!1), o = e || "", s = ke(o);
|
|
1382
|
+
return /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(Y, {
|
|
1151
1383
|
type: i ? "text" : "password",
|
|
1152
1384
|
value: o,
|
|
1153
1385
|
onChange: t,
|
|
@@ -1188,7 +1420,7 @@ function Y({ value: e, onChange: t, placeholder: n = "Enter password", showStren
|
|
|
1188
1420
|
flex: 1,
|
|
1189
1421
|
height: 3,
|
|
1190
1422
|
borderRadius: 999,
|
|
1191
|
-
background: e < s ?
|
|
1423
|
+
background: e < s ? je[s] : "var(--surface-3)",
|
|
1192
1424
|
transition: "background .15s"
|
|
1193
1425
|
} }, e))
|
|
1194
1426
|
}), /* @__PURE__ */ N("span", {
|
|
@@ -1198,7 +1430,7 @@ function Y({ value: e, onChange: t, placeholder: n = "Enter password", showStren
|
|
|
1198
1430
|
minWidth: 54,
|
|
1199
1431
|
textAlign: "right"
|
|
1200
1432
|
},
|
|
1201
|
-
children: o ?
|
|
1433
|
+
children: o ? Ae[s] : ""
|
|
1202
1434
|
})]
|
|
1203
1435
|
})] });
|
|
1204
1436
|
}
|
|
@@ -1206,7 +1438,7 @@ function Ne({ value: e = [], onChange: t }) {
|
|
|
1206
1438
|
let [n, r] = p("");
|
|
1207
1439
|
return /* @__PURE__ */ P("div", {
|
|
1208
1440
|
style: {
|
|
1209
|
-
...
|
|
1441
|
+
...Te,
|
|
1210
1442
|
height: "auto",
|
|
1211
1443
|
minHeight: 30,
|
|
1212
1444
|
display: "flex",
|
|
@@ -1215,7 +1447,7 @@ function Ne({ value: e = [], onChange: t }) {
|
|
|
1215
1447
|
padding: "4px 6px",
|
|
1216
1448
|
alignItems: "center"
|
|
1217
1449
|
},
|
|
1218
|
-
children: [e.map((n, r) => /* @__PURE__ */ N(
|
|
1450
|
+
children: [e.map((n, r) => /* @__PURE__ */ N(ve, {
|
|
1219
1451
|
tone: "slate",
|
|
1220
1452
|
onRemove: () => t(e.filter((e, t) => t !== r)),
|
|
1221
1453
|
children: n
|
|
@@ -1304,7 +1536,7 @@ function Fe({ value: e, entity: t = "company", onChange: n, items: r = [] }) {
|
|
|
1304
1536
|
ref: o,
|
|
1305
1537
|
onClick: () => a(!0),
|
|
1306
1538
|
style: {
|
|
1307
|
-
...
|
|
1539
|
+
...Te,
|
|
1308
1540
|
display: "flex",
|
|
1309
1541
|
alignItems: "center",
|
|
1310
1542
|
justifyContent: "space-between",
|
|
@@ -1339,14 +1571,14 @@ function Fe({ value: e, entity: t = "company", onChange: n, items: r = [] }) {
|
|
|
1339
1571
|
cls: "",
|
|
1340
1572
|
style: { color: "var(--text-3)" }
|
|
1341
1573
|
})]
|
|
1342
|
-
}), /* @__PURE__ */ P(
|
|
1574
|
+
}), /* @__PURE__ */ P(_e, {
|
|
1343
1575
|
open: i,
|
|
1344
1576
|
anchor: o.current,
|
|
1345
1577
|
onClose: () => a(!1),
|
|
1346
1578
|
width: o.current?.offsetWidth,
|
|
1347
1579
|
children: [/* @__PURE__ */ N("div", {
|
|
1348
1580
|
style: { padding: 4 },
|
|
1349
|
-
children: /* @__PURE__ */ N(
|
|
1581
|
+
children: /* @__PURE__ */ N(Y, {
|
|
1350
1582
|
placeholder: `Search ${t}…`,
|
|
1351
1583
|
prefix: /* @__PURE__ */ N(B.search, { size: 12 }),
|
|
1352
1584
|
style: { marginBottom: 4 }
|
|
@@ -1408,7 +1640,7 @@ function Le({ value: e, onChange: t, type: n = "text", options: r }) {
|
|
|
1408
1640
|
onKeyDown: (e) => {
|
|
1409
1641
|
e.key === "Enter" && c(), e.key === "Escape" && l();
|
|
1410
1642
|
},
|
|
1411
|
-
children: [n === "select" ? /* @__PURE__ */ N(
|
|
1643
|
+
children: [n === "select" ? /* @__PURE__ */ N(De, {
|
|
1412
1644
|
value: o,
|
|
1413
1645
|
options: r || [],
|
|
1414
1646
|
onChange: (e) => {
|
|
@@ -1420,7 +1652,7 @@ function Le({ value: e, onChange: t, type: n = "text", options: r }) {
|
|
|
1420
1652
|
let n = String(e);
|
|
1421
1653
|
s(n), t && t(n), a(!1);
|
|
1422
1654
|
}
|
|
1423
|
-
}) : /* @__PURE__ */ N(
|
|
1655
|
+
}) : /* @__PURE__ */ N(Y, {
|
|
1424
1656
|
value: o ?? "",
|
|
1425
1657
|
onChange: s,
|
|
1426
1658
|
autoFocus: !0
|
|
@@ -2203,7 +2435,7 @@ function Nt({ activeArea: e }) {
|
|
|
2203
2435
|
color: "var(--text-4)"
|
|
2204
2436
|
},
|
|
2205
2437
|
children: "Docs · API · Help"
|
|
2206
|
-
}), /* @__PURE__ */ N(
|
|
2438
|
+
}), /* @__PURE__ */ N(W, { children: "?" })] })]
|
|
2207
2439
|
})
|
|
2208
2440
|
]
|
|
2209
2441
|
});
|
|
@@ -2578,7 +2810,7 @@ function Qt({ tenant: e, tenants: t, onSwitch: n, busy: r }) {
|
|
|
2578
2810
|
style: { color: "var(--text-3)" }
|
|
2579
2811
|
})
|
|
2580
2812
|
]
|
|
2581
|
-
}), /* @__PURE__ */ P(
|
|
2813
|
+
}), /* @__PURE__ */ P(_e, {
|
|
2582
2814
|
open: i,
|
|
2583
2815
|
anchor: o.current,
|
|
2584
2816
|
onClose: () => a(!1),
|
|
@@ -2893,7 +3125,7 @@ function nn({ breadcrumbs: e, onCrumbClick: t, onCmdK: n, onToggleAI: r, aiOpen:
|
|
|
2893
3125
|
},
|
|
2894
3126
|
children: "Search or run command…"
|
|
2895
3127
|
}),
|
|
2896
|
-
/* @__PURE__ */ N(
|
|
3128
|
+
/* @__PURE__ */ N(W, { children: "⌘K" })
|
|
2897
3129
|
]
|
|
2898
3130
|
}),
|
|
2899
3131
|
/* @__PURE__ */ N(H, {
|
|
@@ -2933,7 +3165,7 @@ function nn({ breadcrumbs: e, onCrumbClick: t, onCmdK: n, onToggleAI: r, aiOpen:
|
|
|
2933
3165
|
cursor: "pointer"
|
|
2934
3166
|
},
|
|
2935
3167
|
children: [
|
|
2936
|
-
/* @__PURE__ */ N(
|
|
3168
|
+
/* @__PURE__ */ N(ge, {
|
|
2937
3169
|
name: C,
|
|
2938
3170
|
size: 22
|
|
2939
3171
|
}),
|
|
@@ -2949,7 +3181,7 @@ function nn({ breadcrumbs: e, onCrumbClick: t, onCmdK: n, onToggleAI: r, aiOpen:
|
|
|
2949
3181
|
style: { color: "var(--text-3)" }
|
|
2950
3182
|
})
|
|
2951
3183
|
]
|
|
2952
|
-
}), /* @__PURE__ */ P(
|
|
3184
|
+
}), /* @__PURE__ */ P(_e, {
|
|
2953
3185
|
open: _,
|
|
2954
3186
|
anchor: y.current,
|
|
2955
3187
|
onClose: () => v(!1),
|
|
@@ -2967,7 +3199,7 @@ function nn({ breadcrumbs: e, onCrumbClick: t, onCmdK: n, onToggleAI: r, aiOpen:
|
|
|
2967
3199
|
gap: 8,
|
|
2968
3200
|
alignItems: "center"
|
|
2969
3201
|
},
|
|
2970
|
-
children: [/* @__PURE__ */ N(
|
|
3202
|
+
children: [/* @__PURE__ */ N(ge, {
|
|
2971
3203
|
name: C,
|
|
2972
3204
|
size: 28
|
|
2973
3205
|
}), /* @__PURE__ */ P("div", {
|
|
@@ -3422,7 +3654,7 @@ function cn({ open: e, onClose: t, onAction: n, mode: r = "default", navigation:
|
|
|
3422
3654
|
color: "var(--text)"
|
|
3423
3655
|
}
|
|
3424
3656
|
}),
|
|
3425
|
-
/* @__PURE__ */ N(
|
|
3657
|
+
/* @__PURE__ */ N(W, { children: "Esc" })
|
|
3426
3658
|
]
|
|
3427
3659
|
}),
|
|
3428
3660
|
/* @__PURE__ */ P("div", {
|
|
@@ -3532,7 +3764,7 @@ function cn({ open: e, onClose: t, onAction: n, mode: r = "default", navigation:
|
|
|
3532
3764
|
alignItems: "center",
|
|
3533
3765
|
gap: 4
|
|
3534
3766
|
},
|
|
3535
|
-
children: [/* @__PURE__ */ N(
|
|
3767
|
+
children: [/* @__PURE__ */ N(W, { children: "↑↓" }), " navigate"]
|
|
3536
3768
|
}),
|
|
3537
3769
|
/* @__PURE__ */ P("span", {
|
|
3538
3770
|
style: {
|
|
@@ -3540,7 +3772,7 @@ function cn({ open: e, onClose: t, onAction: n, mode: r = "default", navigation:
|
|
|
3540
3772
|
alignItems: "center",
|
|
3541
3773
|
gap: 4
|
|
3542
3774
|
},
|
|
3543
|
-
children: [/* @__PURE__ */ N(
|
|
3775
|
+
children: [/* @__PURE__ */ N(W, { children: "↵" }), " select"]
|
|
3544
3776
|
}),
|
|
3545
3777
|
o && /* @__PURE__ */ P("span", {
|
|
3546
3778
|
style: {
|
|
@@ -3548,7 +3780,7 @@ function cn({ open: e, onClose: t, onAction: n, mode: r = "default", navigation:
|
|
|
3548
3780
|
alignItems: "center",
|
|
3549
3781
|
gap: 4
|
|
3550
3782
|
},
|
|
3551
|
-
children: [/* @__PURE__ */ N(
|
|
3783
|
+
children: [/* @__PURE__ */ N(W, { children: "/" }), " ask AI"]
|
|
3552
3784
|
}),
|
|
3553
3785
|
/* @__PURE__ */ N("div", { style: { flex: 1 } }),
|
|
3554
3786
|
/* @__PURE__ */ N("span", {
|
|
@@ -3852,7 +4084,7 @@ function fn({ open: e, onClose: t, context: n }) {
|
|
|
3852
4084
|
color: "var(--text-3)",
|
|
3853
4085
|
fontSize: 11.5
|
|
3854
4086
|
},
|
|
3855
|
-
children: [/* @__PURE__ */ N(
|
|
4087
|
+
children: [/* @__PURE__ */ N(q, { size: 12 }), "Thinking…"]
|
|
3856
4088
|
})]
|
|
3857
4089
|
}),
|
|
3858
4090
|
r.length <= 1 && /* @__PURE__ */ N("div", {
|
|
@@ -4000,14 +4232,14 @@ function mn({ field: e, value: t, mode: n, onChange: r }) {
|
|
|
4000
4232
|
})
|
|
4001
4233
|
});
|
|
4002
4234
|
}
|
|
4003
|
-
return /* @__PURE__ */ N(
|
|
4235
|
+
return /* @__PURE__ */ N(Y, {
|
|
4004
4236
|
value: String(t ?? ""),
|
|
4005
4237
|
onChange: (e) => r?.(e)
|
|
4006
4238
|
});
|
|
4007
4239
|
}
|
|
4008
4240
|
//#endregion
|
|
4009
4241
|
//#region src/components/fields/TextField.tsx
|
|
4010
|
-
var hn = [
|
|
4242
|
+
var hn = [L];
|
|
4011
4243
|
function gn({ field: e, value: t, mode: n, onChange: r, fill: i }) {
|
|
4012
4244
|
let a = e.display?.widget;
|
|
4013
4245
|
if (n === "display") {
|
|
@@ -4021,7 +4253,7 @@ function gn({ field: e, value: t, mode: n, onChange: r, fill: i }) {
|
|
|
4021
4253
|
});
|
|
4022
4254
|
let r = a === "markdown" ? /* @__PURE__ */ N("div", {
|
|
4023
4255
|
className: "prose prose-sm dark:prose-invert max-w-none break-words overflow-hidden",
|
|
4024
|
-
children: /* @__PURE__ */ N(
|
|
4256
|
+
children: /* @__PURE__ */ N(ee, {
|
|
4025
4257
|
skipHtml: !0,
|
|
4026
4258
|
remarkPlugins: hn,
|
|
4027
4259
|
children: n
|
|
@@ -4065,7 +4297,7 @@ function gn({ field: e, value: t, mode: n, onChange: r, fill: i }) {
|
|
|
4065
4297
|
})]
|
|
4066
4298
|
}) : r;
|
|
4067
4299
|
}
|
|
4068
|
-
return /* @__PURE__ */ N(
|
|
4300
|
+
return /* @__PURE__ */ N(Ee, {
|
|
4069
4301
|
value: String(t ?? ""),
|
|
4070
4302
|
onChange: (e) => r?.(e),
|
|
4071
4303
|
rows: a === "markdown" || a === "code" ? 10 : 4,
|
|
@@ -4089,7 +4321,7 @@ function vn({ field: e, value: t, mode: n, onChange: r }) {
|
|
|
4089
4321
|
children: "—"
|
|
4090
4322
|
});
|
|
4091
4323
|
let o = !e.required;
|
|
4092
|
-
return /* @__PURE__ */ N(
|
|
4324
|
+
return /* @__PURE__ */ N(De, {
|
|
4093
4325
|
value: t != null && t !== "" ? String(t) : _n,
|
|
4094
4326
|
options: [...o ? [{
|
|
4095
4327
|
value: _n,
|
|
@@ -4121,7 +4353,7 @@ function yn({ value: e, mode: t, onChange: n }) {
|
|
|
4121
4353
|
color: "var(--text-4)"
|
|
4122
4354
|
},
|
|
4123
4355
|
children: "—"
|
|
4124
|
-
}) : /* @__PURE__ */ N(
|
|
4356
|
+
}) : /* @__PURE__ */ N(Y, {
|
|
4125
4357
|
type: "email",
|
|
4126
4358
|
value: r,
|
|
4127
4359
|
onChange: (e) => n?.(e)
|
|
@@ -4220,7 +4452,7 @@ function kn({ field: e, value: t, mode: n, onChange: r }) {
|
|
|
4220
4452
|
]
|
|
4221
4453
|
});
|
|
4222
4454
|
}
|
|
4223
|
-
return /* @__PURE__ */ N(
|
|
4455
|
+
return /* @__PURE__ */ N(Y, {
|
|
4224
4456
|
type: "url",
|
|
4225
4457
|
value: i,
|
|
4226
4458
|
onChange: (e) => r?.(e),
|
|
@@ -4342,7 +4574,7 @@ function Fn({ field: e, value: t, mode: n, onChange: r }) {
|
|
|
4342
4574
|
});
|
|
4343
4575
|
}
|
|
4344
4576
|
let o = t ? a ? Nn(String(t), i) : Pn(String(t), i) : "";
|
|
4345
|
-
return /* @__PURE__ */ N(
|
|
4577
|
+
return /* @__PURE__ */ N(Y, {
|
|
4346
4578
|
type: i ? "date" : "datetime-local",
|
|
4347
4579
|
value: o,
|
|
4348
4580
|
onChange: (e) => {
|
|
@@ -4435,7 +4667,7 @@ function zn({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a
|
|
|
4435
4667
|
})]
|
|
4436
4668
|
});
|
|
4437
4669
|
}
|
|
4438
|
-
return s ? /* @__PURE__ */ N(
|
|
4670
|
+
return s ? /* @__PURE__ */ N(Y, {
|
|
4439
4671
|
type: "text",
|
|
4440
4672
|
inputMode: "decimal",
|
|
4441
4673
|
pattern: "-?\\d*\\.?\\d*",
|
|
@@ -4443,7 +4675,7 @@ function zn({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a
|
|
|
4443
4675
|
onChange: (e) => {
|
|
4444
4676
|
e === "" ? i?.(null) : i?.(e);
|
|
4445
4677
|
}
|
|
4446
|
-
}) : /* @__PURE__ */ N(
|
|
4678
|
+
}) : /* @__PURE__ */ N(Y, {
|
|
4447
4679
|
type: "number",
|
|
4448
4680
|
step: e.type === "float" ? "0.01" : "1",
|
|
4449
4681
|
value: n == null ? "" : String(n),
|
|
@@ -4592,7 +4824,7 @@ function tr({ field: e, value: t, mode: n, onChange: r, refs: i }) {
|
|
|
4592
4824
|
children: p
|
|
4593
4825
|
});
|
|
4594
4826
|
let m = String(t ?? ""), h = f.some((e) => String(e[c]) === m);
|
|
4595
|
-
return /* @__PURE__ */ N(
|
|
4827
|
+
return /* @__PURE__ */ N(De, {
|
|
4596
4828
|
value: m,
|
|
4597
4829
|
options: [
|
|
4598
4830
|
{
|
|
@@ -4690,7 +4922,7 @@ function or({ value: e, mode: t, onChange: n }) {
|
|
|
4690
4922
|
children: e.code
|
|
4691
4923
|
}), /* @__PURE__ */ N("div", {
|
|
4692
4924
|
style: { flex: 1 },
|
|
4693
|
-
children: /* @__PURE__ */ N(
|
|
4925
|
+
children: /* @__PURE__ */ N(Y, {
|
|
4694
4926
|
value: a[e.code] ?? "",
|
|
4695
4927
|
onChange: (t) => o(e.code, t),
|
|
4696
4928
|
placeholder: `Value (${e.code})`
|
|
@@ -4746,7 +4978,7 @@ function cr({ value: e, mode: t, onChange: n }) {
|
|
|
4746
4978
|
fontWeight: 500
|
|
4747
4979
|
},
|
|
4748
4980
|
children: e.code
|
|
4749
|
-
}), /* @__PURE__ */ N(
|
|
4981
|
+
}), /* @__PURE__ */ N(Ee, {
|
|
4750
4982
|
value: a[e.code] ?? "",
|
|
4751
4983
|
onChange: (t) => o(e.code, t),
|
|
4752
4984
|
placeholder: `Value (${e.code})`,
|
|
@@ -4844,7 +5076,7 @@ function ur({ structDef: e, value: t, mode: n, onChange: r }) {
|
|
|
4844
5076
|
flexDirection: "column",
|
|
4845
5077
|
gap: 2
|
|
4846
5078
|
},
|
|
4847
|
-
children: [/* @__PURE__ */ N(
|
|
5079
|
+
children: [/* @__PURE__ */ N(J, {
|
|
4848
5080
|
required: n.required,
|
|
4849
5081
|
children: n.display ? X(n.display.name) : t
|
|
4850
5082
|
}), n.type === "structure" && n.structure ? /* @__PURE__ */ N(lr, {
|
|
@@ -4945,7 +5177,7 @@ function pr({ value: e, mode: t, onChange: n, record: r }) {
|
|
|
4945
5177
|
fontStyle: "italic"
|
|
4946
5178
|
},
|
|
4947
5179
|
children: "Not set"
|
|
4948
|
-
}) : /* @__PURE__ */ N(
|
|
5180
|
+
}) : /* @__PURE__ */ N(Me, {
|
|
4949
5181
|
value: i,
|
|
4950
5182
|
onChange: (e) => {
|
|
4951
5183
|
a(e), o && e === "" ? n?.(s ? fr : "") : n?.(e);
|
|
@@ -4972,7 +5204,7 @@ function hr({ value: e, mode: t, onChange: n, record: r }) {
|
|
|
4972
5204
|
fontStyle: "italic"
|
|
4973
5205
|
},
|
|
4974
5206
|
children: "Not set"
|
|
4975
|
-
}) : /* @__PURE__ */ N(
|
|
5207
|
+
}) : /* @__PURE__ */ N(Me, {
|
|
4976
5208
|
value: i,
|
|
4977
5209
|
onChange: (e) => {
|
|
4978
5210
|
a(e), o && e === "" ? n?.(s ? mr : "") : n?.(e);
|
|
@@ -4999,7 +5231,7 @@ function _r({ value: e, mode: t, onChange: n }) {
|
|
|
4999
5231
|
flexWrap: "wrap",
|
|
5000
5232
|
gap: 4
|
|
5001
5233
|
},
|
|
5002
|
-
children: r.map((e, t) => /* @__PURE__ */ N(
|
|
5234
|
+
children: r.map((e, t) => /* @__PURE__ */ N(ve, {
|
|
5003
5235
|
tone: "slate",
|
|
5004
5236
|
children: e
|
|
5005
5237
|
}, t))
|
|
@@ -5022,7 +5254,7 @@ function _r({ value: e, mode: t, onChange: n }) {
|
|
|
5022
5254
|
flexWrap: "wrap",
|
|
5023
5255
|
gap: 4
|
|
5024
5256
|
},
|
|
5025
|
-
children: r.map((e, t) => /* @__PURE__ */ N(
|
|
5257
|
+
children: r.map((e, t) => /* @__PURE__ */ N(ve, {
|
|
5026
5258
|
tone: "slate",
|
|
5027
5259
|
onRemove: () => s(t),
|
|
5028
5260
|
children: e
|
|
@@ -5034,7 +5266,7 @@ function _r({ value: e, mode: t, onChange: n }) {
|
|
|
5034
5266
|
},
|
|
5035
5267
|
children: [/* @__PURE__ */ N("div", {
|
|
5036
5268
|
style: { flex: 1 },
|
|
5037
|
-
children: /* @__PURE__ */ N(
|
|
5269
|
+
children: /* @__PURE__ */ N(Y, {
|
|
5038
5270
|
value: i,
|
|
5039
5271
|
onChange: a,
|
|
5040
5272
|
onKeyDown: (e) => {
|
|
@@ -5069,7 +5301,7 @@ function yr({ value: e, mode: t, onChange: n }) {
|
|
|
5069
5301
|
flexWrap: "wrap",
|
|
5070
5302
|
gap: 4
|
|
5071
5303
|
},
|
|
5072
|
-
children: r.map((e, t) => /* @__PURE__ */ N(
|
|
5304
|
+
children: r.map((e, t) => /* @__PURE__ */ N(ve, {
|
|
5073
5305
|
tone: "slate",
|
|
5074
5306
|
children: e
|
|
5075
5307
|
}, t))
|
|
@@ -5094,7 +5326,7 @@ function yr({ value: e, mode: t, onChange: n }) {
|
|
|
5094
5326
|
flexWrap: "wrap",
|
|
5095
5327
|
gap: 4
|
|
5096
5328
|
},
|
|
5097
|
-
children: r.map((e, t) => /* @__PURE__ */ N(
|
|
5329
|
+
children: r.map((e, t) => /* @__PURE__ */ N(ve, {
|
|
5098
5330
|
tone: "slate",
|
|
5099
5331
|
onRemove: () => s(t),
|
|
5100
5332
|
children: e
|
|
@@ -5106,7 +5338,7 @@ function yr({ value: e, mode: t, onChange: n }) {
|
|
|
5106
5338
|
},
|
|
5107
5339
|
children: [/* @__PURE__ */ N("div", {
|
|
5108
5340
|
style: { flex: 1 },
|
|
5109
|
-
children: /* @__PURE__ */ N(
|
|
5341
|
+
children: /* @__PURE__ */ N(Y, {
|
|
5110
5342
|
type: "number",
|
|
5111
5343
|
value: i,
|
|
5112
5344
|
onChange: a,
|
|
@@ -5296,7 +5528,7 @@ function Hr({ param: e, value: t, onChange: n, statusGroups: r }) {
|
|
|
5296
5528
|
label: X(t.name) || e
|
|
5297
5529
|
}))];
|
|
5298
5530
|
}, [r, e.required]);
|
|
5299
|
-
return /* @__PURE__ */ N(
|
|
5531
|
+
return /* @__PURE__ */ N(De, {
|
|
5300
5532
|
value: typeof t == "string" ? t : "",
|
|
5301
5533
|
options: i,
|
|
5302
5534
|
onChange: (e) => n(e),
|
|
@@ -5323,7 +5555,7 @@ function Ur({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
|
|
|
5323
5555
|
value: e.code,
|
|
5324
5556
|
label: X(e.name) || e.code
|
|
5325
5557
|
}))], [a]);
|
|
5326
|
-
return /* @__PURE__ */ N(
|
|
5558
|
+
return /* @__PURE__ */ N(De, {
|
|
5327
5559
|
value: typeof t == "string" ? t : "",
|
|
5328
5560
|
options: o,
|
|
5329
5561
|
onChange: (e) => n(e),
|
|
@@ -5467,7 +5699,7 @@ function Wr({ open: e, onOpenChange: t, action: n, actionName: r, onSubmit: i, i
|
|
|
5467
5699
|
mode: "edit",
|
|
5468
5700
|
onChange: (t) => _(e, t)
|
|
5469
5701
|
}), /* @__PURE__ */ P("div", { children: [
|
|
5470
|
-
/* @__PURE__ */ N(
|
|
5702
|
+
/* @__PURE__ */ N(J, {
|
|
5471
5703
|
required: t.required,
|
|
5472
5704
|
children: n
|
|
5473
5705
|
}),
|
|
@@ -5502,7 +5734,7 @@ function Wr({ open: e, onOpenChange: t, action: n, actionName: r, onSubmit: i, i
|
|
|
5502
5734
|
}),
|
|
5503
5735
|
/* @__PURE__ */ N(V, {
|
|
5504
5736
|
kind: "primary",
|
|
5505
|
-
icon: N(a ?
|
|
5737
|
+
icon: N(a ? q : B.bolt, { size: 13 }),
|
|
5506
5738
|
onClick: v,
|
|
5507
5739
|
disabled: a,
|
|
5508
5740
|
children: a ? "Executing…" : "Execute"
|
|
@@ -5779,7 +6011,7 @@ function Qr({ state: e, onClose: t, onExecute: n }) {
|
|
|
5779
6011
|
/* @__PURE__ */ N(V, {
|
|
5780
6012
|
kind: "primary",
|
|
5781
6013
|
danger: l,
|
|
5782
|
-
icon: N(a ?
|
|
6014
|
+
icon: N(a ? q : B.bolt, { size: 13 }),
|
|
5783
6015
|
onClick: async () => {
|
|
5784
6016
|
o(!0);
|
|
5785
6017
|
try {
|
|
@@ -5960,7 +6192,7 @@ function di(e) {
|
|
|
5960
6192
|
//#region src/components/layout/Layout.tsx
|
|
5961
6193
|
var fi = "default";
|
|
5962
6194
|
function pi() {
|
|
5963
|
-
let { isAuthenticated: e, isLoading: t, user: n, activeTenant: r } = qt(), i = x(), a = b(), { data: o } = st(), s = Q((e) => e.sidebar), c = Q((e) => e.tabsPosition), u = Q((e) => e.aiSurface), f = Q((e) => e.theme), m = Q((e) => e.set), h = Q((e) => e.hydrateFromParams), { data: g } = ui(), v = jt((e) => e.tabs), y = jt((e) => e.activeTabId), S = jt((e) => e.closeTab), C = jt((e) => e.setScope), w = jt((e) => e.hydrate), [T, E] = p(fi), [D, O] = p(!1), [k, A] = p("default"), [j, M] = p(!1), F = u !== "off", I = u === "panel" || u === "both",
|
|
6195
|
+
let { isAuthenticated: e, isLoading: t, user: n, activeTenant: r } = qt(), i = x(), a = b(), { data: o } = st(), s = Q((e) => e.sidebar), c = Q((e) => e.tabsPosition), u = Q((e) => e.aiSurface), f = Q((e) => e.theme), m = Q((e) => e.set), h = Q((e) => e.hydrateFromParams), { data: g } = ui(), v = jt((e) => e.tabs), y = jt((e) => e.activeTabId), S = jt((e) => e.closeTab), C = jt((e) => e.setScope), w = jt((e) => e.hydrate), [T, E] = p(fi), [D, O] = p(!1), [k, A] = p("default"), [j, M] = p(!1), F = u !== "off", I = u === "panel" || u === "both", ee = u === "command" || u === "both", L = (e = "default") => {
|
|
5964
6196
|
F && (A(e), O(!0));
|
|
5965
6197
|
};
|
|
5966
6198
|
oi(), l(() => {
|
|
@@ -5990,11 +6222,22 @@ function pi() {
|
|
|
5990
6222
|
}, [g, h]), l(() => {
|
|
5991
6223
|
if (!o) return;
|
|
5992
6224
|
let e = mi(o.navigation, o.screens, a.pathname);
|
|
5993
|
-
|
|
5994
|
-
|
|
6225
|
+
if (e) {
|
|
6226
|
+
E(e);
|
|
6227
|
+
return;
|
|
6228
|
+
}
|
|
6229
|
+
let t = T;
|
|
6230
|
+
if ((o.navigation ?? []).some((e) => (e.area || fi) === t)) return;
|
|
6231
|
+
let n = (o.navigation ?? [])[0]?.area || fi;
|
|
6232
|
+
n !== t && E(n);
|
|
6233
|
+
}, [
|
|
6234
|
+
o,
|
|
6235
|
+
a.pathname,
|
|
6236
|
+
T
|
|
6237
|
+
]), l(() => {
|
|
5995
6238
|
let e = (e) => {
|
|
5996
6239
|
let t = document.activeElement, n = !!t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable), r = e.metaKey || e.ctrlKey;
|
|
5997
|
-
r && e.key.toLowerCase() === "k" ? (e.preventDefault(),
|
|
6240
|
+
r && e.key.toLowerCase() === "k" ? (e.preventDefault(), L("default")) : r && e.key.toLowerCase() === "t" ? (e.preventDefault(), L("new")) : r && e.key.toLowerCase() === "b" ? (e.preventDefault(), m("sidebar", s === "collapsed" ? "wide" : "collapsed")) : r && e.key.toLowerCase() === "w" ? (e.preventDefault(), y && S(y)) : r && e.key === "/" ? (e.preventDefault(), I && M((e) => !e)) : e.key === "/" && !n ? (e.preventDefault(), L("default")) : e.key === "Escape" && O(!1);
|
|
5998
6241
|
};
|
|
5999
6242
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
6000
6243
|
}, [
|
|
@@ -6005,7 +6248,7 @@ function pi() {
|
|
|
6005
6248
|
F,
|
|
6006
6249
|
I
|
|
6007
6250
|
]);
|
|
6008
|
-
let
|
|
6251
|
+
let R = d(() => o ? hi(o.navigation, o.screens, a.pathname, v, y, i) : [], [
|
|
6009
6252
|
o,
|
|
6010
6253
|
a.pathname,
|
|
6011
6254
|
v,
|
|
@@ -6057,9 +6300,9 @@ function pi() {
|
|
|
6057
6300
|
style: { height: "100vh" },
|
|
6058
6301
|
children: [
|
|
6059
6302
|
/* @__PURE__ */ N(nn, {
|
|
6060
|
-
breadcrumbs:
|
|
6303
|
+
breadcrumbs: R,
|
|
6061
6304
|
onCrumbClick: (e) => e.onClick && e.onClick(),
|
|
6062
|
-
onCmdK: () =>
|
|
6305
|
+
onCmdK: () => L("default"),
|
|
6063
6306
|
onToggleAI: () => I && M((e) => !e),
|
|
6064
6307
|
aiOpen: j,
|
|
6065
6308
|
onOpenProfile: () => i("/profile"),
|
|
@@ -6070,7 +6313,7 @@ function pi() {
|
|
|
6070
6313
|
onPick: te,
|
|
6071
6314
|
onToggleAI: () => I && M((e) => !e),
|
|
6072
6315
|
aiOpen: j,
|
|
6073
|
-
onCmdK: () =>
|
|
6316
|
+
onCmdK: () => L("default"),
|
|
6074
6317
|
areas: o?.areas
|
|
6075
6318
|
}),
|
|
6076
6319
|
/* @__PURE__ */ N(Nt, { activeArea: T }),
|
|
@@ -6083,7 +6326,7 @@ function pi() {
|
|
|
6083
6326
|
minWidth: 0
|
|
6084
6327
|
},
|
|
6085
6328
|
children: [
|
|
6086
|
-
c === "top" && /* @__PURE__ */ N(an, { onNew: () =>
|
|
6329
|
+
c === "top" && /* @__PURE__ */ N(an, { onNew: () => L("new") }),
|
|
6087
6330
|
/* @__PURE__ */ N("div", {
|
|
6088
6331
|
style: {
|
|
6089
6332
|
flex: 1,
|
|
@@ -6094,7 +6337,7 @@ function pi() {
|
|
|
6094
6337
|
},
|
|
6095
6338
|
children: /* @__PURE__ */ N(_, {})
|
|
6096
6339
|
}),
|
|
6097
|
-
c === "bottom" && /* @__PURE__ */ N(an, { onNew: () =>
|
|
6340
|
+
c === "bottom" && /* @__PURE__ */ N(an, { onNew: () => L("new") })
|
|
6098
6341
|
]
|
|
6099
6342
|
}),
|
|
6100
6343
|
F && /* @__PURE__ */ N(cn, {
|
|
@@ -6104,7 +6347,7 @@ function pi() {
|
|
|
6104
6347
|
onAction: (e) => ne(e),
|
|
6105
6348
|
navigation: o?.navigation,
|
|
6106
6349
|
screens: o?.screens,
|
|
6107
|
-
includeAI:
|
|
6350
|
+
includeAI: ee
|
|
6108
6351
|
}),
|
|
6109
6352
|
I && /* @__PURE__ */ N(fn, {
|
|
6110
6353
|
open: j,
|
|
@@ -6694,7 +6937,7 @@ function Ci() {
|
|
|
6694
6937
|
gap: 12
|
|
6695
6938
|
},
|
|
6696
6939
|
children: [
|
|
6697
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
6940
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, { children: "Email" }), /* @__PURE__ */ N(Y, {
|
|
6698
6941
|
value: a,
|
|
6699
6942
|
onChange: o,
|
|
6700
6943
|
prefix: /* @__PURE__ */ N(B.email, { size: 13 }),
|
|
@@ -6708,7 +6951,7 @@ function Ci() {
|
|
|
6708
6951
|
alignItems: "center"
|
|
6709
6952
|
},
|
|
6710
6953
|
children: [
|
|
6711
|
-
/* @__PURE__ */ N(
|
|
6954
|
+
/* @__PURE__ */ N(J, { children: "Password" }),
|
|
6712
6955
|
/* @__PURE__ */ N("div", { style: { flex: 1 } }),
|
|
6713
6956
|
/* @__PURE__ */ N(h, {
|
|
6714
6957
|
to: "/forgot",
|
|
@@ -6721,7 +6964,7 @@ function Ci() {
|
|
|
6721
6964
|
children: "Forgot?"
|
|
6722
6965
|
})
|
|
6723
6966
|
]
|
|
6724
|
-
}), /* @__PURE__ */ N(
|
|
6967
|
+
}), /* @__PURE__ */ N(Me, {
|
|
6725
6968
|
value: s,
|
|
6726
6969
|
onChange: c,
|
|
6727
6970
|
placeholder: "Your password"
|
|
@@ -6834,28 +7077,28 @@ function wi() {
|
|
|
6834
7077
|
gridTemplateColumns: "1fr 1fr",
|
|
6835
7078
|
gap: 10
|
|
6836
7079
|
},
|
|
6837
|
-
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
7080
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, { children: "First name" }), /* @__PURE__ */ N(Y, {
|
|
6838
7081
|
value: i,
|
|
6839
7082
|
onChange: a
|
|
6840
|
-
})] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
7083
|
+
})] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, { children: "Last name" }), /* @__PURE__ */ N(Y, {
|
|
6841
7084
|
value: o,
|
|
6842
7085
|
onChange: s
|
|
6843
7086
|
})] })]
|
|
6844
7087
|
}),
|
|
6845
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
7088
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, { children: "Work email" }), /* @__PURE__ */ N(Y, {
|
|
6846
7089
|
value: c,
|
|
6847
7090
|
onChange: u,
|
|
6848
7091
|
prefix: /* @__PURE__ */ N(B.email, { size: 13 }),
|
|
6849
7092
|
placeholder: "name@company.com",
|
|
6850
7093
|
required: !0
|
|
6851
7094
|
})] }),
|
|
6852
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
7095
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, { children: "Company" }), /* @__PURE__ */ N(Y, {
|
|
6853
7096
|
value: d,
|
|
6854
7097
|
onChange: f,
|
|
6855
7098
|
prefix: /* @__PURE__ */ N(B.building, { size: 13 }),
|
|
6856
7099
|
placeholder: "Acme, Inc."
|
|
6857
7100
|
})] }),
|
|
6858
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
7101
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, { children: "Workspace URL" }), /* @__PURE__ */ P("div", {
|
|
6859
7102
|
style: {
|
|
6860
7103
|
display: "flex",
|
|
6861
7104
|
alignItems: "stretch",
|
|
@@ -6863,7 +7106,7 @@ function wi() {
|
|
|
6863
7106
|
borderRadius: 6,
|
|
6864
7107
|
overflow: "hidden"
|
|
6865
7108
|
},
|
|
6866
|
-
children: [/* @__PURE__ */ N(
|
|
7109
|
+
children: [/* @__PURE__ */ N(Y, {
|
|
6867
7110
|
value: m,
|
|
6868
7111
|
onChange: g,
|
|
6869
7112
|
style: {
|
|
@@ -6884,7 +7127,7 @@ function wi() {
|
|
|
6884
7127
|
children: ".declarion.app"
|
|
6885
7128
|
})]
|
|
6886
7129
|
})] }),
|
|
6887
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
7130
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, { children: "Password" }), /* @__PURE__ */ N(Me, {
|
|
6888
7131
|
value: _,
|
|
6889
7132
|
onChange: v,
|
|
6890
7133
|
placeholder: "At least 12 characters",
|
|
@@ -7011,7 +7254,7 @@ function Ti() {
|
|
|
7011
7254
|
gap: 12
|
|
7012
7255
|
},
|
|
7013
7256
|
children: [
|
|
7014
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
7257
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, { children: "Email" }), /* @__PURE__ */ N(Y, {
|
|
7015
7258
|
value: e,
|
|
7016
7259
|
onChange: t,
|
|
7017
7260
|
prefix: /* @__PURE__ */ N(B.email, { size: 13 }),
|
|
@@ -7308,27 +7551,27 @@ function ki({ open: e, onClose: t, onSubmit: n }) {
|
|
|
7308
7551
|
gap: 12
|
|
7309
7552
|
},
|
|
7310
7553
|
children: [
|
|
7311
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
7554
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, {
|
|
7312
7555
|
required: !0,
|
|
7313
7556
|
children: "Current password"
|
|
7314
|
-
}), /* @__PURE__ */ N(
|
|
7557
|
+
}), /* @__PURE__ */ N(Me, {
|
|
7315
7558
|
value: r,
|
|
7316
7559
|
onChange: i,
|
|
7317
7560
|
placeholder: "Enter your current password"
|
|
7318
7561
|
})] }),
|
|
7319
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
7562
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, {
|
|
7320
7563
|
required: !0,
|
|
7321
7564
|
children: "New password"
|
|
7322
|
-
}), /* @__PURE__ */ N(
|
|
7565
|
+
}), /* @__PURE__ */ N(Me, {
|
|
7323
7566
|
value: a,
|
|
7324
7567
|
onChange: o,
|
|
7325
7568
|
placeholder: "At least 8 characters",
|
|
7326
7569
|
showStrength: !0
|
|
7327
7570
|
})] }),
|
|
7328
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(
|
|
7571
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(J, {
|
|
7329
7572
|
required: !0,
|
|
7330
7573
|
children: "Confirm new password"
|
|
7331
|
-
}), /* @__PURE__ */ N(
|
|
7574
|
+
}), /* @__PURE__ */ N(Me, {
|
|
7332
7575
|
value: s,
|
|
7333
7576
|
onChange: c,
|
|
7334
7577
|
placeholder: "Re-enter new password"
|
|
@@ -7372,7 +7615,7 @@ function ki({ open: e, onClose: t, onSubmit: n }) {
|
|
|
7372
7615
|
}),
|
|
7373
7616
|
/* @__PURE__ */ N(V, {
|
|
7374
7617
|
kind: "primary",
|
|
7375
|
-
icon: N(l ?
|
|
7618
|
+
icon: N(l ? q : B.key, { size: 13 }),
|
|
7376
7619
|
onClick: async () => {
|
|
7377
7620
|
if (!g) {
|
|
7378
7621
|
a.length < 8 ? f("New password must be at least 8 characters.") : f(s === a ? "Fill in all fields." : "Passwords do not match.");
|
|
@@ -7432,7 +7675,7 @@ function Ai() {
|
|
|
7432
7675
|
marginBottom: 14
|
|
7433
7676
|
},
|
|
7434
7677
|
children: [
|
|
7435
|
-
/* @__PURE__ */ N(
|
|
7678
|
+
/* @__PURE__ */ N(ge, {
|
|
7436
7679
|
name: s,
|
|
7437
7680
|
size: 56
|
|
7438
7681
|
}),
|
|
@@ -7507,7 +7750,7 @@ function Ai() {
|
|
|
7507
7750
|
gap: 14
|
|
7508
7751
|
},
|
|
7509
7752
|
children: [
|
|
7510
|
-
/* @__PURE__ */ N(
|
|
7753
|
+
/* @__PURE__ */ N(ye, {
|
|
7511
7754
|
title: "Personal info",
|
|
7512
7755
|
icon: /* @__PURE__ */ N(B.users, { size: 14 }),
|
|
7513
7756
|
children: /* @__PURE__ */ P("div", {
|
|
@@ -7554,7 +7797,7 @@ function Ai() {
|
|
|
7554
7797
|
]
|
|
7555
7798
|
})
|
|
7556
7799
|
}),
|
|
7557
|
-
/* @__PURE__ */ N(
|
|
7800
|
+
/* @__PURE__ */ N(ye, {
|
|
7558
7801
|
title: "Security",
|
|
7559
7802
|
icon: /* @__PURE__ */ N(B.shield, { size: 14 }),
|
|
7560
7803
|
children: /* @__PURE__ */ P("div", {
|
|
@@ -7607,7 +7850,7 @@ function Ai() {
|
|
|
7607
7850
|
]
|
|
7608
7851
|
})
|
|
7609
7852
|
}),
|
|
7610
|
-
/* @__PURE__ */ N(
|
|
7853
|
+
/* @__PURE__ */ N(ye, {
|
|
7611
7854
|
title: "Access",
|
|
7612
7855
|
icon: /* @__PURE__ */ N(B.key, { size: 14 }),
|
|
7613
7856
|
children: /* @__PURE__ */ P("div", {
|
|
@@ -7634,7 +7877,7 @@ function Ai() {
|
|
|
7634
7877
|
gap: 4,
|
|
7635
7878
|
flexWrap: "wrap"
|
|
7636
7879
|
},
|
|
7637
|
-
children: t.roles.map((e) => /* @__PURE__ */ N(
|
|
7880
|
+
children: t.roles.map((e) => /* @__PURE__ */ N(ve, { children: e }, e))
|
|
7638
7881
|
}) : /* @__PURE__ */ N("span", {
|
|
7639
7882
|
style: { color: "var(--text-4)" },
|
|
7640
7883
|
children: "—"
|
|
@@ -7661,7 +7904,7 @@ function Ai() {
|
|
|
7661
7904
|
]
|
|
7662
7905
|
})
|
|
7663
7906
|
}),
|
|
7664
|
-
/* @__PURE__ */ N(
|
|
7907
|
+
/* @__PURE__ */ N(ye, {
|
|
7665
7908
|
title: "Notifications",
|
|
7666
7909
|
icon: /* @__PURE__ */ N(B.bell, { size: 14 }),
|
|
7667
7910
|
children: /* @__PURE__ */ N("div", {
|
|
@@ -7896,7 +8139,7 @@ function Li() {
|
|
|
7896
8139
|
]
|
|
7897
8140
|
})]
|
|
7898
8141
|
}),
|
|
7899
|
-
/* @__PURE__ */ N(
|
|
8142
|
+
/* @__PURE__ */ N(ye, {
|
|
7900
8143
|
title: "Appearance",
|
|
7901
8144
|
icon: /* @__PURE__ */ N(B.moon, { size: 14 }),
|
|
7902
8145
|
children: /* @__PURE__ */ P("div", {
|
|
@@ -7990,7 +8233,7 @@ function Li() {
|
|
|
7990
8233
|
})
|
|
7991
8234
|
}),
|
|
7992
8235
|
/* @__PURE__ */ N("div", { style: { height: 12 } }),
|
|
7993
|
-
/* @__PURE__ */ N(
|
|
8236
|
+
/* @__PURE__ */ N(ye, {
|
|
7994
8237
|
title: "Keyboard",
|
|
7995
8238
|
icon: /* @__PURE__ */ N(B.command, { size: 14 }),
|
|
7996
8239
|
children: /* @__PURE__ */ N("div", {
|
|
@@ -8012,7 +8255,7 @@ function Li() {
|
|
|
8012
8255
|
color: "var(--text-2)"
|
|
8013
8256
|
},
|
|
8014
8257
|
children: e
|
|
8015
|
-
}), /* @__PURE__ */ N(
|
|
8258
|
+
}), /* @__PURE__ */ N(W, { children: t })]
|
|
8016
8259
|
}, e))
|
|
8017
8260
|
})
|
|
8018
8261
|
})
|
|
@@ -9150,7 +9393,7 @@ function Da({ record: e, title: t, recordId: n, avatarName: r, fields: i, refs:
|
|
|
9150
9393
|
gap: 10
|
|
9151
9394
|
},
|
|
9152
9395
|
children: [
|
|
9153
|
-
/* @__PURE__ */ N(
|
|
9396
|
+
/* @__PURE__ */ N(ge, {
|
|
9154
9397
|
name: r || t,
|
|
9155
9398
|
size: 28
|
|
9156
9399
|
}),
|
|
@@ -9212,9 +9455,9 @@ function Da({ record: e, title: t, recordId: n, avatarName: r, fields: i, refs:
|
|
|
9212
9455
|
children: [
|
|
9213
9456
|
/* @__PURE__ */ N(B.sparkle, { size: 12 }),
|
|
9214
9457
|
" Inline quick-edit — click any field to change.",
|
|
9215
|
-
/* @__PURE__ */ N(
|
|
9458
|
+
/* @__PURE__ */ N(W, { children: "Tab" }),
|
|
9216
9459
|
" to move, ",
|
|
9217
|
-
/* @__PURE__ */ N(
|
|
9460
|
+
/* @__PURE__ */ N(W, { children: "Esc" }),
|
|
9218
9461
|
" to close."
|
|
9219
9462
|
]
|
|
9220
9463
|
}), i.map((e) => /* @__PURE__ */ N(Oa, {
|
|
@@ -9268,7 +9511,7 @@ function Da({ record: e, title: t, recordId: n, avatarName: r, fields: i, refs:
|
|
|
9268
9511
|
}),
|
|
9269
9512
|
onClick: () => x(!b),
|
|
9270
9513
|
children: "Actions"
|
|
9271
|
-
}), /* @__PURE__ */ N(
|
|
9514
|
+
}), /* @__PURE__ */ N(_e, {
|
|
9272
9515
|
open: b,
|
|
9273
9516
|
anchor: S.current,
|
|
9274
9517
|
onClose: () => x(!1),
|
|
@@ -9435,7 +9678,7 @@ function Na({ count: e, actions: t, onClear: n, onDelete: r, onExport: i }) {
|
|
|
9435
9678
|
onMouseEnter: (e) => e.currentTarget.style.background = "var(--inverted-overlay)",
|
|
9436
9679
|
onMouseLeave: (e) => e.currentTarget.style.background = "transparent",
|
|
9437
9680
|
children: [/* @__PURE__ */ N(B.more, { size: 13 }), " More"]
|
|
9438
|
-
}), /* @__PURE__ */ P(
|
|
9681
|
+
}), /* @__PURE__ */ P(_e, {
|
|
9439
9682
|
open: a,
|
|
9440
9683
|
anchor: s.current,
|
|
9441
9684
|
onClose: () => o(!1),
|
|
@@ -9521,7 +9764,7 @@ function Fa({ filters: e, onRemove: t, onClearAll: n, onChipClick: r, fieldLabel
|
|
|
9521
9764
|
padding: "0 4px"
|
|
9522
9765
|
},
|
|
9523
9766
|
children: "OR"
|
|
9524
|
-
}), /* @__PURE__ */ N(
|
|
9767
|
+
}), /* @__PURE__ */ N(ve, {
|
|
9525
9768
|
tone: "slate",
|
|
9526
9769
|
onClick: r,
|
|
9527
9770
|
children: e.filter((e) => e.field && e.op).map((e) => `${i(e.field)} ${La(e)}`).join(" AND ")
|
|
@@ -9562,7 +9805,7 @@ function Fa({ filters: e, onRemove: t, onClearAll: n, onChipClick: r, fieldLabel
|
|
|
9562
9805
|
});
|
|
9563
9806
|
}
|
|
9564
9807
|
function Ia({ node: e, fieldLabel: t, onRemove: n, onClick: r }) {
|
|
9565
|
-
return /* @__PURE__ */ N(
|
|
9808
|
+
return /* @__PURE__ */ N(ve, {
|
|
9566
9809
|
tone: "slate",
|
|
9567
9810
|
icon: /* @__PURE__ */ N(B.filter, { size: 11 }),
|
|
9568
9811
|
onClick: r,
|
|
@@ -9793,12 +10036,12 @@ function za({ node: e, meta: t, onUpdate: n, onRemove: r }) {
|
|
|
9793
10036
|
title: t.label,
|
|
9794
10037
|
children: t.label
|
|
9795
10038
|
}),
|
|
9796
|
-
/* @__PURE__ */ N(
|
|
10039
|
+
/* @__PURE__ */ N(De, {
|
|
9797
10040
|
value: e.op ?? a[0]?.value,
|
|
9798
10041
|
options: a,
|
|
9799
10042
|
onChange: (e) => n({ op: e })
|
|
9800
10043
|
}),
|
|
9801
|
-
i ? /* @__PURE__ */ N("span", {}) : t.options ? /* @__PURE__ */ N(
|
|
10044
|
+
i ? /* @__PURE__ */ N("span", {}) : t.options ? /* @__PURE__ */ N(De, {
|
|
9802
10045
|
value: String(e.value ?? ""),
|
|
9803
10046
|
options: t.options.map((e) => ({
|
|
9804
10047
|
value: e.value,
|
|
@@ -9806,7 +10049,7 @@ function za({ node: e, meta: t, onUpdate: n, onRemove: r }) {
|
|
|
9806
10049
|
})),
|
|
9807
10050
|
onChange: (e) => n({ value: e }),
|
|
9808
10051
|
placeholder: "Select…"
|
|
9809
|
-
}) : /* @__PURE__ */ N(
|
|
10052
|
+
}) : /* @__PURE__ */ N(Y, {
|
|
9810
10053
|
value: String(e.value ?? ""),
|
|
9811
10054
|
onChange: (e) => n({ value: e }),
|
|
9812
10055
|
placeholder: "Value…"
|
|
@@ -9925,7 +10168,7 @@ function Va({ fields: e, activeFields: t, onSelect: n, onCancel: r }) {
|
|
|
9925
10168
|
gap: 6
|
|
9926
10169
|
},
|
|
9927
10170
|
children: [
|
|
9928
|
-
/* @__PURE__ */ N(
|
|
10171
|
+
/* @__PURE__ */ N(Y, {
|
|
9929
10172
|
value: i,
|
|
9930
10173
|
onChange: a,
|
|
9931
10174
|
placeholder: "Search fields…",
|
|
@@ -9993,7 +10236,7 @@ function Ha({ availableColumns: e, visibleColumns: t, onToggle: n, onReset: r, o
|
|
|
9993
10236
|
onClick: () => c(!s),
|
|
9994
10237
|
active: s,
|
|
9995
10238
|
children: "Columns"
|
|
9996
|
-
}), /* @__PURE__ */ P(
|
|
10239
|
+
}), /* @__PURE__ */ P(_e, {
|
|
9997
10240
|
open: s,
|
|
9998
10241
|
anchor: o.current,
|
|
9999
10242
|
onClose: () => c(!1),
|
|
@@ -10087,7 +10330,7 @@ function Wa({ views: e, activeViewId: t, isDirty: n, onSelect: r, onSave: i, onS
|
|
|
10087
10330
|
/* @__PURE__ */ N(B.down, { size: 11 })
|
|
10088
10331
|
]
|
|
10089
10332
|
}),
|
|
10090
|
-
/* @__PURE__ */ P(
|
|
10333
|
+
/* @__PURE__ */ P(_e, {
|
|
10091
10334
|
open: s,
|
|
10092
10335
|
anchor: o.current,
|
|
10093
10336
|
onClose: () => c(!1),
|
|
@@ -10258,7 +10501,7 @@ function Xa({ screenCode: e }) {
|
|
|
10258
10501
|
E?.actions,
|
|
10259
10502
|
T?.row_actions,
|
|
10260
10503
|
O
|
|
10261
|
-
]), F = T?.row_actions !== void 0, I = d(() => k.some((e) => (e.action.visibility ?? []).includes("list_toolbar")), [k]),
|
|
10504
|
+
]), F = T?.row_actions !== void 0, I = d(() => k.some((e) => (e.action.visibility ?? []).includes("list_toolbar")), [k]), ee = !!E?.soft_delete, L = ee && (S?.permissions ?? []).some((e) => e === "feature:view_deleted" || e === "feature:*" || e === "*"), ie = L && n.get("include_deleted") === "true", { openTab: ae, updateTabSearch: oe, findTabByPathname: se } = jt();
|
|
10262
10505
|
l(() => {
|
|
10263
10506
|
if (T?.route && E) {
|
|
10264
10507
|
let e = X(T.display?.name) || X(E.display.name_plural), t = T.display?.icon || E.display.icon;
|
|
@@ -10296,16 +10539,16 @@ function Xa({ screenCode: e }) {
|
|
|
10296
10539
|
include_deleted: ie || void 0,
|
|
10297
10540
|
expand: pe,
|
|
10298
10541
|
screen: T?.fixed_filters ? e : void 0
|
|
10299
|
-
}),
|
|
10542
|
+
}), ge = Ji(D ?? ""), _e = qi(D ?? ""), ve = d(() => {
|
|
10300
10543
|
if (!ue) return [];
|
|
10301
10544
|
let [e, t] = ue.split(":");
|
|
10302
10545
|
return [{
|
|
10303
10546
|
id: e,
|
|
10304
10547
|
desc: t === "desc"
|
|
10305
10548
|
}];
|
|
10306
|
-
}, [ue]),
|
|
10307
|
-
|
|
10308
|
-
let [
|
|
10549
|
+
}, [ue]), ye = d(() => E?.fields.names().find((e) => E.fields.get(e)?.primary) ?? "id", [E]), be = me?.$refs, xe = f(be);
|
|
10550
|
+
xe.current = be;
|
|
10551
|
+
let [Se, G] = p(null), Ce = T?.on_row_click === "peek" && T.quick_peek?.enabled !== !1, q = d(() => {
|
|
10309
10552
|
if (fe.length === 0 || !E) return [];
|
|
10310
10553
|
let e = [];
|
|
10311
10554
|
I && e.push({
|
|
@@ -10381,7 +10624,7 @@ function Xa({ screenCode: e }) {
|
|
|
10381
10624
|
value: e(),
|
|
10382
10625
|
mode: "display",
|
|
10383
10626
|
record: r.original,
|
|
10384
|
-
refs:
|
|
10627
|
+
refs: xe.current
|
|
10385
10628
|
})
|
|
10386
10629
|
});
|
|
10387
10630
|
}
|
|
@@ -10392,7 +10635,7 @@ function Xa({ screenCode: e }) {
|
|
|
10392
10635
|
size: 40,
|
|
10393
10636
|
cell: ({ row: e }) => /* @__PURE__ */ N($a, {
|
|
10394
10637
|
row: e.original,
|
|
10395
|
-
rowId: String(e.original[
|
|
10638
|
+
rowId: String(e.original[ye] ?? ""),
|
|
10396
10639
|
screen: T,
|
|
10397
10640
|
entity: E,
|
|
10398
10641
|
entityCode: D,
|
|
@@ -10416,19 +10659,19 @@ function Xa({ screenCode: e }) {
|
|
|
10416
10659
|
A,
|
|
10417
10660
|
F,
|
|
10418
10661
|
D,
|
|
10419
|
-
|
|
10420
|
-
]),
|
|
10421
|
-
data:
|
|
10422
|
-
columns:
|
|
10662
|
+
ye
|
|
10663
|
+
]), J = me?.data ?? [], Te = me?.meta, Ee = ne({
|
|
10664
|
+
data: J,
|
|
10665
|
+
columns: q,
|
|
10423
10666
|
getCoreRowModel: te(),
|
|
10424
10667
|
manualSorting: !0,
|
|
10425
10668
|
manualPagination: !0,
|
|
10426
10669
|
state: {
|
|
10427
|
-
sorting:
|
|
10670
|
+
sorting: ve,
|
|
10428
10671
|
rowSelection: c
|
|
10429
10672
|
},
|
|
10430
10673
|
onSortingChange: (e) => {
|
|
10431
|
-
let t = typeof e == "function" ? e(
|
|
10674
|
+
let t = typeof e == "function" ? e(ve) : e, i = new URLSearchParams(n);
|
|
10432
10675
|
if (t.length === 0) i.delete("sort");
|
|
10433
10676
|
else {
|
|
10434
10677
|
let e = t[0];
|
|
@@ -10437,9 +10680,9 @@ function Xa({ screenCode: e }) {
|
|
|
10437
10680
|
i.set("page", "1"), r(i);
|
|
10438
10681
|
},
|
|
10439
10682
|
onRowSelectionChange: u,
|
|
10440
|
-
getRowId: (e) => String(e[
|
|
10441
|
-
rowCount:
|
|
10442
|
-
}),
|
|
10683
|
+
getRowId: (e) => String(e[ye] ?? ""),
|
|
10684
|
+
rowCount: Te?.total ?? 0
|
|
10685
|
+
}), De = d(() => Object.keys(c).filter((e) => c[e]), [c]);
|
|
10443
10686
|
l(() => {
|
|
10444
10687
|
u({});
|
|
10445
10688
|
}, [
|
|
@@ -10458,15 +10701,15 @@ function Xa({ screenCode: e }) {
|
|
|
10458
10701
|
};
|
|
10459
10702
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
10460
10703
|
}, []);
|
|
10461
|
-
let
|
|
10462
|
-
count:
|
|
10463
|
-
getScrollElement: () =>
|
|
10704
|
+
let Oe = f(null), { rows: ke } = Ee.getRowModel(), Ae = Q((e) => e.density), je = Q((e) => e.zebra), Me = re({
|
|
10705
|
+
count: ke.length,
|
|
10706
|
+
getScrollElement: () => Oe.current,
|
|
10464
10707
|
estimateSize: () => 48,
|
|
10465
10708
|
overscan: 10
|
|
10466
10709
|
});
|
|
10467
10710
|
l(() => {
|
|
10468
|
-
|
|
10469
|
-
}, [
|
|
10711
|
+
Me.measure();
|
|
10712
|
+
}, [Ae, Me]);
|
|
10470
10713
|
let Ne = s((e) => {
|
|
10471
10714
|
r((t) => {
|
|
10472
10715
|
let n = new URLSearchParams(t);
|
|
@@ -10514,7 +10757,7 @@ function Xa({ screenCode: e }) {
|
|
|
10514
10757
|
}
|
|
10515
10758
|
Le(e);
|
|
10516
10759
|
}, [Ce, Le]), Be = d(() => {
|
|
10517
|
-
if (!Ce || !E || !
|
|
10760
|
+
if (!Ce || !E || !Se) return [];
|
|
10518
10761
|
let e = T?.quick_peek?.fields, t = T?.quick_peek?.sections, n;
|
|
10519
10762
|
if (e && e.length > 0) n = e.filter((e) => E.fields.get(e));
|
|
10520
10763
|
else if (t && t.length > 0) {
|
|
@@ -10542,17 +10785,17 @@ function Xa({ screenCode: e }) {
|
|
|
10542
10785
|
});
|
|
10543
10786
|
}, [
|
|
10544
10787
|
Ce,
|
|
10545
|
-
|
|
10788
|
+
Se,
|
|
10546
10789
|
E,
|
|
10547
10790
|
T,
|
|
10548
10791
|
i?.entities
|
|
10549
10792
|
]), Ve = d(() => E?.actions ? E.actions : {}, [E?.actions]), He = s(async (e, t, n) => {
|
|
10550
|
-
let r = E?.fields.names().find((e) => E.fields.get(e)?.primary), i = r &&
|
|
10793
|
+
let r = E?.fields.names().find((e) => E.fields.get(e)?.primary), i = r && Se ? [String(Se[r] ?? "")] : void 0;
|
|
10551
10794
|
return Xn(t.entity ? `${t.entity}.${e}` : e, Yn(n, i));
|
|
10552
|
-
}, [E,
|
|
10795
|
+
}, [E, Se]), Ue = s(async () => {
|
|
10553
10796
|
if (!a || a.ids.length === 0) return;
|
|
10554
10797
|
o(null);
|
|
10555
|
-
let e = await Promise.allSettled(a.ids.map((e) =>
|
|
10798
|
+
let e = await Promise.allSettled(a.ids.map((e) => ge.mutateAsync(e))), t = e.filter((e) => e.status === "rejected").length;
|
|
10556
10799
|
if (t === 0) u({});
|
|
10557
10800
|
else if (t < a.ids.length) {
|
|
10558
10801
|
let n = new Set(a.ids.filter((t, n) => e[n].status === "fulfilled"));
|
|
@@ -10562,7 +10805,7 @@ function Xa({ screenCode: e }) {
|
|
|
10562
10805
|
return t;
|
|
10563
10806
|
}), j.warning(`${t} of ${a.ids.length} deletes failed`);
|
|
10564
10807
|
}
|
|
10565
|
-
}, [a,
|
|
10808
|
+
}, [a, ge]);
|
|
10566
10809
|
if (!T || !E) return null;
|
|
10567
10810
|
let We = E.display, Ge = X(T.display?.name) || X(We.name), Ke = T.display?.icon || We.icon;
|
|
10568
10811
|
return /* @__PURE__ */ P("div", {
|
|
@@ -10576,17 +10819,17 @@ function Xa({ screenCode: e }) {
|
|
|
10576
10819
|
/* @__PURE__ */ P(M, { children: [
|
|
10577
10820
|
/* @__PURE__ */ N(eo, {
|
|
10578
10821
|
title: Ge,
|
|
10579
|
-
total:
|
|
10580
|
-
loaded:
|
|
10822
|
+
total: Te?.total,
|
|
10823
|
+
loaded: J.length,
|
|
10581
10824
|
screenRoute: T.route,
|
|
10582
10825
|
entityName: X(We.name),
|
|
10583
10826
|
screenIcon: Ke,
|
|
10584
10827
|
readonly: !!E?.readonly,
|
|
10585
10828
|
screenHasExplicitActions: T.actions !== void 0,
|
|
10586
10829
|
toolbarActions: k,
|
|
10587
|
-
selectedIds:
|
|
10588
|
-
data:
|
|
10589
|
-
pkField:
|
|
10830
|
+
selectedIds: De,
|
|
10831
|
+
data: J,
|
|
10832
|
+
pkField: ye,
|
|
10590
10833
|
entityCode: D,
|
|
10591
10834
|
onOpenDelete: (e, t) => o({
|
|
10592
10835
|
ids: e,
|
|
@@ -10623,7 +10866,7 @@ function Xa({ screenCode: e }) {
|
|
|
10623
10866
|
position: "relative",
|
|
10624
10867
|
width: 260
|
|
10625
10868
|
},
|
|
10626
|
-
children: [/* @__PURE__ */ N(
|
|
10869
|
+
children: [/* @__PURE__ */ N(Y, {
|
|
10627
10870
|
value: le,
|
|
10628
10871
|
onChange: Ne,
|
|
10629
10872
|
placeholder: `Search ${Ge.toLowerCase()}…`,
|
|
@@ -10636,7 +10879,7 @@ function Xa({ screenCode: e }) {
|
|
|
10636
10879
|
transform: "translateY(-50%)",
|
|
10637
10880
|
pointerEvents: "none"
|
|
10638
10881
|
},
|
|
10639
|
-
children: /* @__PURE__ */ N(
|
|
10882
|
+
children: /* @__PURE__ */ N(W, { children: "/" })
|
|
10640
10883
|
})]
|
|
10641
10884
|
}),
|
|
10642
10885
|
/* @__PURE__ */ P(V, {
|
|
@@ -10686,14 +10929,14 @@ function Xa({ screenCode: e }) {
|
|
|
10686
10929
|
/* @__PURE__ */ N(H, {
|
|
10687
10930
|
icon: /* @__PURE__ */ N(B.grid, { size: 14 }),
|
|
10688
10931
|
title: "Density",
|
|
10689
|
-
active:
|
|
10932
|
+
active: Ae !== "compact",
|
|
10690
10933
|
onClick: () => {
|
|
10691
|
-
let e =
|
|
10934
|
+
let e = Ae === "compact" ? "comfortable" : Ae === "comfortable" ? "cozy" : "compact";
|
|
10692
10935
|
Q.getState().setMany({ density: e });
|
|
10693
10936
|
}
|
|
10694
10937
|
}),
|
|
10695
10938
|
/* @__PURE__ */ N("div", { style: { flex: 1 } }),
|
|
10696
|
-
|
|
10939
|
+
L && /* @__PURE__ */ N(V, {
|
|
10697
10940
|
kind: "ghost",
|
|
10698
10941
|
size: "sm",
|
|
10699
10942
|
icon: N(ie ? B.eyeOff : B.eye, { size: 12 }),
|
|
@@ -10739,7 +10982,7 @@ function Xa({ screenCode: e }) {
|
|
|
10739
10982
|
title: "Failed to load data",
|
|
10740
10983
|
description: "Something went wrong. Please try again."
|
|
10741
10984
|
})
|
|
10742
|
-
}) :
|
|
10985
|
+
}) : J.length === 0 ? /* @__PURE__ */ N("div", {
|
|
10743
10986
|
style: { padding: "0 20px" },
|
|
10744
10987
|
children: /* @__PURE__ */ N(Qi, {
|
|
10745
10988
|
icon: Ke,
|
|
@@ -10756,12 +10999,12 @@ function Xa({ screenCode: e }) {
|
|
|
10756
10999
|
}) : void 0
|
|
10757
11000
|
})
|
|
10758
11001
|
}) : /* @__PURE__ */ N("div", {
|
|
10759
|
-
ref: ke,
|
|
10760
11002
|
style: {
|
|
10761
11003
|
flex: 1,
|
|
10762
|
-
|
|
11004
|
+
minHeight: 0,
|
|
10763
11005
|
padding: "0 20px 16px",
|
|
10764
|
-
|
|
11006
|
+
display: "flex",
|
|
11007
|
+
flexDirection: "column"
|
|
10765
11008
|
},
|
|
10766
11009
|
children: /* @__PURE__ */ P("div", {
|
|
10767
11010
|
style: {
|
|
@@ -10769,10 +11012,19 @@ function Xa({ screenCode: e }) {
|
|
|
10769
11012
|
border: "1px solid var(--border)",
|
|
10770
11013
|
borderRadius: 8,
|
|
10771
11014
|
overflow: "hidden",
|
|
10772
|
-
boxShadow: "var(--shadow-xs)"
|
|
11015
|
+
boxShadow: "var(--shadow-xs)",
|
|
11016
|
+
display: "flex",
|
|
11017
|
+
flexDirection: "column",
|
|
11018
|
+
flex: 1,
|
|
11019
|
+
minHeight: 0
|
|
10773
11020
|
},
|
|
10774
11021
|
children: [/* @__PURE__ */ N("div", {
|
|
10775
|
-
|
|
11022
|
+
ref: Oe,
|
|
11023
|
+
style: {
|
|
11024
|
+
overflow: "auto",
|
|
11025
|
+
flex: 1,
|
|
11026
|
+
minHeight: 0
|
|
11027
|
+
},
|
|
10776
11028
|
children: /* @__PURE__ */ P("table", {
|
|
10777
11029
|
style: {
|
|
10778
11030
|
width: "100%",
|
|
@@ -10781,7 +11033,7 @@ function Xa({ screenCode: e }) {
|
|
|
10781
11033
|
fontSize: 12.5,
|
|
10782
11034
|
color: "var(--text)"
|
|
10783
11035
|
},
|
|
10784
|
-
children: [/* @__PURE__ */ N("thead", { children:
|
|
11036
|
+
children: [/* @__PURE__ */ N("thead", { children: Ee.getHeaderGroups().map((e) => /* @__PURE__ */ N("tr", {
|
|
10785
11037
|
style: {
|
|
10786
11038
|
height: 32,
|
|
10787
11039
|
background: "var(--surface-2)"
|
|
@@ -10803,9 +11055,10 @@ function Xa({ screenCode: e }) {
|
|
|
10803
11055
|
minWidth: e.getSize(),
|
|
10804
11056
|
borderBottom: "1px solid var(--border)",
|
|
10805
11057
|
background: "var(--surface-2)",
|
|
10806
|
-
position:
|
|
11058
|
+
position: "sticky",
|
|
11059
|
+
top: 0,
|
|
10807
11060
|
left: r ? 0 : "auto",
|
|
10808
|
-
zIndex: r ?
|
|
11061
|
+
zIndex: r ? 3 : 2
|
|
10809
11062
|
},
|
|
10810
11063
|
children: e.isPlaceholder ? null : t ? /* @__PURE__ */ P("span", {
|
|
10811
11064
|
style: {
|
|
@@ -10816,23 +11069,23 @@ function Xa({ screenCode: e }) {
|
|
|
10816
11069
|
fontSize: 10.5,
|
|
10817
11070
|
letterSpacing: "0.04em"
|
|
10818
11071
|
},
|
|
10819
|
-
children: [
|
|
11072
|
+
children: [R(e.column.columnDef.header, e.getContext()), n === "asc" ? /* @__PURE__ */ N(B.arrowUp, { size: 11 }) : n === "desc" ? /* @__PURE__ */ N(B.arrowDown, { size: 11 }) : /* @__PURE__ */ N(B.sort, {
|
|
10820
11073
|
size: 11,
|
|
10821
11074
|
style: { opacity: .35 }
|
|
10822
11075
|
})]
|
|
10823
|
-
}) :
|
|
11076
|
+
}) : R(e.column.columnDef.header, e.getContext())
|
|
10824
11077
|
}, e.id);
|
|
10825
11078
|
})
|
|
10826
11079
|
}, e.id)) }), /* @__PURE__ */ P("tbody", { children: [
|
|
10827
|
-
|
|
10828
|
-
style: { height:
|
|
10829
|
-
colSpan:
|
|
11080
|
+
Me.getVirtualItems().length > 0 && /* @__PURE__ */ N("tr", { children: /* @__PURE__ */ N("td", {
|
|
11081
|
+
style: { height: Me.getVirtualItems()[0]?.start ?? 0 },
|
|
11082
|
+
colSpan: q.length
|
|
10830
11083
|
}) }),
|
|
10831
|
-
|
|
10832
|
-
let t =
|
|
11084
|
+
Me.getVirtualItems().map((e) => {
|
|
11085
|
+
let t = ke[e.index], n = ee && t.original[E.soft_delete] != null, r = t.getIsSelected(), i = je && e.index % 2 == 1, a = r ? "var(--row-selected-bg)" : i ? "var(--surface-2)" : "transparent";
|
|
10833
11086
|
return /* @__PURE__ */ N("tr", {
|
|
10834
11087
|
"data-index": e.index,
|
|
10835
|
-
ref: (e) =>
|
|
11088
|
+
ref: (e) => Me.measureElement(e),
|
|
10836
11089
|
style: {
|
|
10837
11090
|
height: "var(--row-h)",
|
|
10838
11091
|
cursor: Ie ? "pointer" : "default",
|
|
@@ -10878,18 +11131,18 @@ function Xa({ screenCode: e }) {
|
|
|
10878
11131
|
zIndex: +!!n
|
|
10879
11132
|
},
|
|
10880
11133
|
onClick: n || r ? (e) => e.stopPropagation() : void 0,
|
|
10881
|
-
children:
|
|
11134
|
+
children: R(e.column.columnDef.cell, e.getContext())
|
|
10882
11135
|
}, e.id);
|
|
10883
11136
|
})
|
|
10884
11137
|
}, t.id);
|
|
10885
11138
|
}),
|
|
10886
|
-
|
|
10887
|
-
style: { height:
|
|
10888
|
-
colSpan:
|
|
11139
|
+
Me.getVirtualItems().length > 0 && /* @__PURE__ */ N("tr", { children: /* @__PURE__ */ N("td", {
|
|
11140
|
+
style: { height: Me.getTotalSize() - (Me.getVirtualItems().at(-1)?.end ?? 0) },
|
|
11141
|
+
colSpan: q.length
|
|
10889
11142
|
}) })
|
|
10890
11143
|
] })]
|
|
10891
11144
|
})
|
|
10892
|
-
}),
|
|
11145
|
+
}), Te && /* @__PURE__ */ P("div", {
|
|
10893
11146
|
style: {
|
|
10894
11147
|
display: "flex",
|
|
10895
11148
|
alignItems: "center",
|
|
@@ -10904,9 +11157,9 @@ function Xa({ screenCode: e }) {
|
|
|
10904
11157
|
/* @__PURE__ */ P("span", {
|
|
10905
11158
|
className: "num",
|
|
10906
11159
|
children: [
|
|
10907
|
-
|
|
11160
|
+
Te.total,
|
|
10908
11161
|
" ",
|
|
10909
|
-
|
|
11162
|
+
Te.total === 1 ? "record" : "records"
|
|
10910
11163
|
]
|
|
10911
11164
|
}),
|
|
10912
11165
|
/* @__PURE__ */ N("span", { children: "·" }),
|
|
@@ -10919,7 +11172,7 @@ function Xa({ screenCode: e }) {
|
|
|
10919
11172
|
color: "var(--text-2)",
|
|
10920
11173
|
fontWeight: 500
|
|
10921
11174
|
},
|
|
10922
|
-
children:
|
|
11175
|
+
children: De.length
|
|
10923
11176
|
})
|
|
10924
11177
|
] }),
|
|
10925
11178
|
/* @__PURE__ */ N("div", { style: { flex: 1 } }),
|
|
@@ -10937,7 +11190,7 @@ function Xa({ screenCode: e }) {
|
|
|
10937
11190
|
},
|
|
10938
11191
|
children: /* @__PURE__ */ N("option", { children: "50" })
|
|
10939
11192
|
}),
|
|
10940
|
-
|
|
11193
|
+
Te.total_pages > 1 && /* @__PURE__ */ P("div", {
|
|
10941
11194
|
style: {
|
|
10942
11195
|
display: "flex",
|
|
10943
11196
|
alignItems: "center",
|
|
@@ -10955,16 +11208,16 @@ function Xa({ screenCode: e }) {
|
|
|
10955
11208
|
style: { padding: "0 6px" },
|
|
10956
11209
|
children: [
|
|
10957
11210
|
"Page ",
|
|
10958
|
-
|
|
11211
|
+
Te.page,
|
|
10959
11212
|
" of ",
|
|
10960
|
-
|
|
11213
|
+
Te.total_pages
|
|
10961
11214
|
]
|
|
10962
11215
|
}),
|
|
10963
11216
|
/* @__PURE__ */ N(H, {
|
|
10964
11217
|
size: 22,
|
|
10965
11218
|
icon: /* @__PURE__ */ N(B.right, { size: 12 }),
|
|
10966
11219
|
onClick: () => Fe(ce + 1),
|
|
10967
|
-
disabled: ce >=
|
|
11220
|
+
disabled: ce >= Te.total_pages
|
|
10968
11221
|
})
|
|
10969
11222
|
]
|
|
10970
11223
|
})
|
|
@@ -10983,16 +11236,16 @@ function Xa({ screenCode: e }) {
|
|
|
10983
11236
|
open: a !== null,
|
|
10984
11237
|
onOpenChange: (e) => !e && o(null),
|
|
10985
11238
|
title: `Delete ${X(We.name)}`,
|
|
10986
|
-
description: a?.confirmation ? a.confirmation :
|
|
11239
|
+
description: a?.confirmation ? a.confirmation : ee ? `Are you sure you want to delete this ${X(We.name).toLowerCase()}? It can be restored later by an admin.` : `Are you sure you want to delete this ${X(We.name).toLowerCase()}? This action cannot be undone.`,
|
|
10987
11240
|
confirmLabel: "Delete",
|
|
10988
11241
|
onConfirm: Ue,
|
|
10989
11242
|
destructive: !0
|
|
10990
11243
|
}),
|
|
10991
|
-
I &&
|
|
10992
|
-
selectedIds:
|
|
11244
|
+
I && De.length > 0 && /* @__PURE__ */ N(to, {
|
|
11245
|
+
selectedIds: De,
|
|
10993
11246
|
toolbarActions: k,
|
|
10994
|
-
data:
|
|
10995
|
-
pkField:
|
|
11247
|
+
data: J,
|
|
11248
|
+
pkField: ye,
|
|
10996
11249
|
entityCode: D,
|
|
10997
11250
|
entityName: X(We.name),
|
|
10998
11251
|
onClear: () => u({}),
|
|
@@ -11056,29 +11309,29 @@ function Xa({ screenCode: e }) {
|
|
|
11056
11309
|
}
|
|
11057
11310
|
})]
|
|
11058
11311
|
}),
|
|
11059
|
-
Ce &&
|
|
11060
|
-
record:
|
|
11312
|
+
Ce && Se && E && /* @__PURE__ */ N(Da, {
|
|
11313
|
+
record: Se,
|
|
11061
11314
|
title: (() => {
|
|
11062
11315
|
let e = T.columns?.find((e) => !e.startsWith("$status.") && !e.startsWith("$property."));
|
|
11063
|
-
return e ? String(
|
|
11316
|
+
return e ? String(Se[e] ?? X(E.display.name)) : X(E.display.name);
|
|
11064
11317
|
})(),
|
|
11065
11318
|
recordId: (() => {
|
|
11066
11319
|
let e = E.fields.names()?.find((e) => E.fields.get(e)?.primary);
|
|
11067
|
-
return e ? String(
|
|
11320
|
+
return e ? String(Se[e] ?? "") : void 0;
|
|
11068
11321
|
})(),
|
|
11069
11322
|
fields: Be,
|
|
11070
11323
|
screen: T,
|
|
11071
11324
|
actions: Ve,
|
|
11072
11325
|
executeAction: He,
|
|
11073
11326
|
onClose: () => {
|
|
11074
|
-
if (E &&
|
|
11327
|
+
if (E && Se) {
|
|
11075
11328
|
let e = E.fields.names()?.find((e) => E.fields.get(e)?.primary);
|
|
11076
|
-
e && Ma(String(
|
|
11329
|
+
e && Ma(String(Se[e] ?? ""));
|
|
11077
11330
|
}
|
|
11078
11331
|
G(null);
|
|
11079
11332
|
},
|
|
11080
11333
|
onOpen: (e) => {
|
|
11081
|
-
let t =
|
|
11334
|
+
let t = Se;
|
|
11082
11335
|
G(null), Le(t, { draft: e });
|
|
11083
11336
|
},
|
|
11084
11337
|
onSave: (e) => {
|
|
@@ -11087,10 +11340,10 @@ function Xa({ screenCode: e }) {
|
|
|
11087
11340
|
if (!t) return;
|
|
11088
11341
|
let n = String(e[t] ?? ""), r = {};
|
|
11089
11342
|
for (let t of Object.keys(e)) {
|
|
11090
|
-
let n =
|
|
11343
|
+
let n = Se[t], i = e[t];
|
|
11091
11344
|
n !== i && (r[t] = i);
|
|
11092
11345
|
}
|
|
11093
|
-
Object.keys(r).length !== 0 &&
|
|
11346
|
+
Object.keys(r).length !== 0 && _e.mutate({
|
|
11094
11347
|
pkValues: n,
|
|
11095
11348
|
data: r
|
|
11096
11349
|
});
|
|
@@ -11272,7 +11525,7 @@ function $a({ row: e, rowId: t, screen: n, entity: r, allScreens: i, hasDefaultA
|
|
|
11272
11525
|
onClick: () => m(!d),
|
|
11273
11526
|
title: "Actions"
|
|
11274
11527
|
}),
|
|
11275
|
-
/* @__PURE__ */ P(
|
|
11528
|
+
/* @__PURE__ */ P(_e, {
|
|
11276
11529
|
open: d,
|
|
11277
11530
|
anchor: u.current,
|
|
11278
11531
|
onClose: () => m(!1),
|
|
@@ -11418,7 +11671,7 @@ function eo({ title: e, total: t, loaded: n, screenRoute: r, entityName: i, scre
|
|
|
11418
11671
|
onClick: () => b(!y),
|
|
11419
11672
|
active: y,
|
|
11420
11673
|
children: "Actions"
|
|
11421
|
-
}), /* @__PURE__ */ P(
|
|
11674
|
+
}), /* @__PURE__ */ P(_e, {
|
|
11422
11675
|
open: y,
|
|
11423
11676
|
anchor: v.current,
|
|
11424
11677
|
onClose: () => b(!1),
|
|
@@ -11610,7 +11863,7 @@ function io({ entityCode: e, recordId: t, associations: n, schema: r }) {
|
|
|
11610
11863
|
let i = d(() => Object.entries(n), [n]), [a, o] = p(0);
|
|
11611
11864
|
if (i.length === 0) return null;
|
|
11612
11865
|
let [s, c] = i[a];
|
|
11613
|
-
return /* @__PURE__ */ N(
|
|
11866
|
+
return /* @__PURE__ */ N(ye, {
|
|
11614
11867
|
title: /* @__PURE__ */ N("div", {
|
|
11615
11868
|
style: {
|
|
11616
11869
|
display: "flex",
|
|
@@ -11859,7 +12112,7 @@ function lo({ config: e, ctx: t }) {
|
|
|
11859
12112
|
style: c ? void 0 : uo(r.width ?? r.column?.width ?? r.row?.width ?? e.width, y[a], r.min_width, r.max_width),
|
|
11860
12113
|
children: [/* @__PURE__ */ N("div", {
|
|
11861
12114
|
className: oo("flex-1 min-w-0 flex flex-col", b && "overflow-y-auto overflow-x-hidden"),
|
|
11862
|
-
children: /* @__PURE__ */ N(
|
|
12115
|
+
children: /* @__PURE__ */ N(Ts, {
|
|
11863
12116
|
node: r,
|
|
11864
12117
|
ctx: t
|
|
11865
12118
|
})
|
|
@@ -11897,7 +12150,7 @@ function po({ config: e, ctx: t }) {
|
|
|
11897
12150
|
return /* @__PURE__ */ N("div", {
|
|
11898
12151
|
className: "flex flex-col h-full",
|
|
11899
12152
|
style: { gap: r ? `${r}px` : void 0 },
|
|
11900
|
-
children: n.map((e, n) => /* @__PURE__ */ N(
|
|
12153
|
+
children: n.map((e, n) => /* @__PURE__ */ N(Ts, {
|
|
11901
12154
|
node: e,
|
|
11902
12155
|
ctx: t
|
|
11903
12156
|
}, n))
|
|
@@ -11926,7 +12179,7 @@ function ho(e, t) {
|
|
|
11926
12179
|
}
|
|
11927
12180
|
function go({ config: e, ctx: t }) {
|
|
11928
12181
|
let { items: n } = e, [r, i] = p(0);
|
|
11929
|
-
return n.length === 0 ? null : /* @__PURE__ */ N(
|
|
12182
|
+
return n.length === 0 ? null : /* @__PURE__ */ N(ye, {
|
|
11930
12183
|
title: /* @__PURE__ */ N("div", {
|
|
11931
12184
|
style: {
|
|
11932
12185
|
display: "flex",
|
|
@@ -11967,7 +12220,7 @@ function go({ config: e, ctx: t }) {
|
|
|
11967
12220
|
}),
|
|
11968
12221
|
collapsible: !1,
|
|
11969
12222
|
padding: "14px",
|
|
11970
|
-
children: /* @__PURE__ */ N(
|
|
12223
|
+
children: /* @__PURE__ */ N(Ts, {
|
|
11971
12224
|
node: n[r],
|
|
11972
12225
|
ctx: t
|
|
11973
12226
|
}, r)
|
|
@@ -11984,12 +12237,12 @@ function _o({ config: e, ctx: t }) {
|
|
|
11984
12237
|
tone: s.tone,
|
|
11985
12238
|
dot: s.dot
|
|
11986
12239
|
} : void 0;
|
|
11987
|
-
return /* @__PURE__ */ N(
|
|
12240
|
+
return /* @__PURE__ */ N(ye, {
|
|
11988
12241
|
title: X(n),
|
|
11989
12242
|
defaultOpen: !i,
|
|
11990
12243
|
icon: u,
|
|
11991
12244
|
badge: d,
|
|
11992
|
-
children: /* @__PURE__ */ N(
|
|
12245
|
+
children: /* @__PURE__ */ N(ws, {
|
|
11993
12246
|
nodes: r,
|
|
11994
12247
|
ctx: c
|
|
11995
12248
|
})
|
|
@@ -12978,7 +13231,7 @@ function qo({ row: e, rowId: t, childEntity: n, entityCode: r, parentEntity: i,
|
|
|
12978
13231
|
children: [/* @__PURE__ */ N(V, {
|
|
12979
13232
|
kind: "primary",
|
|
12980
13233
|
size: "xs",
|
|
12981
|
-
icon: b.isPending ? /* @__PURE__ */ N(
|
|
13234
|
+
icon: b.isPending ? /* @__PURE__ */ N(q, { size: 12 }) : /* @__PURE__ */ N(B.check, { size: 12 }),
|
|
12982
13235
|
onClick: () => b.mutate(_),
|
|
12983
13236
|
disabled: b.isPending,
|
|
12984
13237
|
children: b.isPending ? "Saving…" : "Save"
|
|
@@ -13760,7 +14013,7 @@ function ts({ open: e, onOpenChange: t, actionName: n, message: r, onConfirm: i,
|
|
|
13760
14013
|
}),
|
|
13761
14014
|
/* @__PURE__ */ N(V, {
|
|
13762
14015
|
kind: "primary",
|
|
13763
|
-
icon: N(a ?
|
|
14016
|
+
icon: N(a ? q : B.bolt, { size: 13 }),
|
|
13764
14017
|
onClick: i,
|
|
13765
14018
|
disabled: a,
|
|
13766
14019
|
children: a ? "Executing…" : "Confirm"
|
|
@@ -13889,24 +14142,29 @@ function rs({ field: e }) {
|
|
|
13889
14142
|
children: e.label
|
|
13890
14143
|
}), /* @__PURE__ */ P("div", {
|
|
13891
14144
|
style: {
|
|
13892
|
-
|
|
13893
|
-
|
|
13894
|
-
gap: 8
|
|
14145
|
+
position: "relative",
|
|
14146
|
+
width: "100%"
|
|
13895
14147
|
},
|
|
13896
14148
|
children: [/* @__PURE__ */ N("div", {
|
|
13897
14149
|
className: e.monospace ? "mono" : void 0,
|
|
13898
14150
|
style: {
|
|
13899
|
-
flex: 1,
|
|
13900
14151
|
borderRadius: 6,
|
|
13901
14152
|
border: "1px solid var(--border)",
|
|
13902
14153
|
background: "var(--surface-2)",
|
|
13903
|
-
padding: "8px 10px",
|
|
14154
|
+
padding: e.copyable ? "8px 40px 8px 10px" : "8px 10px",
|
|
13904
14155
|
fontSize: 12.5,
|
|
13905
14156
|
wordBreak: "break-all",
|
|
13906
14157
|
color: "var(--text)"
|
|
13907
14158
|
},
|
|
13908
14159
|
children: e.value
|
|
13909
|
-
}), e.copyable && /* @__PURE__ */ N(
|
|
14160
|
+
}), e.copyable && /* @__PURE__ */ N("div", {
|
|
14161
|
+
style: {
|
|
14162
|
+
position: "absolute",
|
|
14163
|
+
top: 4,
|
|
14164
|
+
right: 4
|
|
14165
|
+
},
|
|
14166
|
+
children: /* @__PURE__ */ N(pn, { value: e.value })
|
|
14167
|
+
})]
|
|
13910
14168
|
})]
|
|
13911
14169
|
});
|
|
13912
14170
|
}
|
|
@@ -13961,7 +14219,7 @@ function is({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i
|
|
|
13961
14219
|
r.length,
|
|
13962
14220
|
c,
|
|
13963
14221
|
d
|
|
13964
|
-
]),
|
|
14222
|
+
]), ee = s(() => {
|
|
13965
14223
|
if (Fr(t)) {
|
|
13966
14224
|
Ar(t.ui_steps, { row: i }).then(() => c?.());
|
|
13967
14225
|
return;
|
|
@@ -13993,7 +14251,7 @@ function is({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i
|
|
|
13993
14251
|
l,
|
|
13994
14252
|
u,
|
|
13995
14253
|
c
|
|
13996
|
-
]),
|
|
14254
|
+
]), L = s(() => {
|
|
13997
14255
|
l?.(r.length), x.mutate({
|
|
13998
14256
|
actionCode: k,
|
|
13999
14257
|
body: Yn(F, A)
|
|
@@ -14010,7 +14268,7 @@ function is({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i
|
|
|
14010
14268
|
I,
|
|
14011
14269
|
l,
|
|
14012
14270
|
u
|
|
14013
|
-
]),
|
|
14271
|
+
]), R = s((e) => {
|
|
14014
14272
|
l?.(r.length), x.mutate({
|
|
14015
14273
|
actionCode: k,
|
|
14016
14274
|
body: Yn(e, A)
|
|
@@ -14033,14 +14291,14 @@ function is({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i
|
|
|
14033
14291
|
return /* @__PURE__ */ P(M, { children: [
|
|
14034
14292
|
o === "icon" ? /* @__PURE__ */ N(H, {
|
|
14035
14293
|
icon: ie ?? /* @__PURE__ */ N(B.bolt, { size: 13 }),
|
|
14036
|
-
onClick:
|
|
14294
|
+
onClick: ee,
|
|
14037
14295
|
title: te
|
|
14038
14296
|
}) : /* @__PURE__ */ N(V, {
|
|
14039
14297
|
kind: a === "default" ? "primary" : a === "ghost" ? "ghost" : "default",
|
|
14040
14298
|
size: "sm",
|
|
14041
14299
|
icon: ie,
|
|
14042
14300
|
danger: t.destructive,
|
|
14043
|
-
onClick:
|
|
14301
|
+
onClick: ee,
|
|
14044
14302
|
disabled: ae,
|
|
14045
14303
|
title: te,
|
|
14046
14304
|
"aria-label": te,
|
|
@@ -14051,7 +14309,7 @@ function is({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i
|
|
|
14051
14309
|
onOpenChange: m,
|
|
14052
14310
|
action: t,
|
|
14053
14311
|
actionName: te,
|
|
14054
|
-
onSubmit:
|
|
14312
|
+
onSubmit: R,
|
|
14055
14313
|
isPending: x.isPending,
|
|
14056
14314
|
row: i
|
|
14057
14315
|
}),
|
|
@@ -14060,7 +14318,7 @@ function is({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i
|
|
|
14060
14318
|
onOpenChange: g,
|
|
14061
14319
|
actionName: te,
|
|
14062
14320
|
message: X(t.confirmation),
|
|
14063
|
-
onConfirm:
|
|
14321
|
+
onConfirm: L,
|
|
14064
14322
|
isPending: x.isPending
|
|
14065
14323
|
}),
|
|
14066
14324
|
y && /* @__PURE__ */ N(ns, {
|
|
@@ -14073,8 +14331,63 @@ function is({ actionCode: e, action: t, entityCode: n, objectIds: r = [], row: i
|
|
|
14073
14331
|
] });
|
|
14074
14332
|
}
|
|
14075
14333
|
//#endregion
|
|
14334
|
+
//#region src/components/shared/RowActionsKebab.tsx
|
|
14335
|
+
function as({ actions: e, objectIds: t, row: n, onSuccess: r, preMenu: i, divider: a, size: o = 22, align: s = "end" }) {
|
|
14336
|
+
let c = f(null), [l, u] = p(!1), { run: d } = Jr();
|
|
14337
|
+
if (!i && e.length === 0) return null;
|
|
14338
|
+
let m = (e) => () => {
|
|
14339
|
+
u(!1), e();
|
|
14340
|
+
};
|
|
14341
|
+
return /* @__PURE__ */ P("div", {
|
|
14342
|
+
className: "sl-row-actions",
|
|
14343
|
+
"data-open": l ? "true" : void 0,
|
|
14344
|
+
style: {
|
|
14345
|
+
display: "flex",
|
|
14346
|
+
alignItems: "center",
|
|
14347
|
+
justifyContent: "flex-end"
|
|
14348
|
+
},
|
|
14349
|
+
children: [/* @__PURE__ */ N(H, {
|
|
14350
|
+
ref: c,
|
|
14351
|
+
size: o,
|
|
14352
|
+
icon: /* @__PURE__ */ N(B.more, { size: Math.round(o * .55) }),
|
|
14353
|
+
onClick: () => u(!l),
|
|
14354
|
+
title: "Actions"
|
|
14355
|
+
}), /* @__PURE__ */ P(_e, {
|
|
14356
|
+
open: l,
|
|
14357
|
+
anchor: c.current,
|
|
14358
|
+
onClose: () => u(!1),
|
|
14359
|
+
width: 200,
|
|
14360
|
+
align: s,
|
|
14361
|
+
children: [
|
|
14362
|
+
i,
|
|
14363
|
+
i && a && e.length > 0 && /* @__PURE__ */ N(K, { divider: !0 }),
|
|
14364
|
+
e.map(({ code: e, action: i }) => {
|
|
14365
|
+
let a = n ? ia(i.conditions, n) : !0, o = X(i.display?.name) || e, s = i.display?.icon, c = s && B[s] ? B[s] : void 0;
|
|
14366
|
+
return /* @__PURE__ */ N(K, {
|
|
14367
|
+
icon: c ? /* @__PURE__ */ N(c, { size: 12 }) : null,
|
|
14368
|
+
danger: i.destructive,
|
|
14369
|
+
onClick: m(() => {
|
|
14370
|
+
if (!a) return;
|
|
14371
|
+
let n = i.entity ? `${i.entity}.${e}` : e;
|
|
14372
|
+
d({
|
|
14373
|
+
action: i,
|
|
14374
|
+
title: o,
|
|
14375
|
+
execute: async (e) => {
|
|
14376
|
+
let i = await Xn(n, Yn(e, t));
|
|
14377
|
+
return r?.(), i;
|
|
14378
|
+
}
|
|
14379
|
+
});
|
|
14380
|
+
}),
|
|
14381
|
+
children: o
|
|
14382
|
+
}, e);
|
|
14383
|
+
})
|
|
14384
|
+
]
|
|
14385
|
+
})]
|
|
14386
|
+
});
|
|
14387
|
+
}
|
|
14388
|
+
//#endregion
|
|
14076
14389
|
//#region src/components/detail-layout/AssociatedToolbar.tsx
|
|
14077
|
-
function
|
|
14390
|
+
function os({ entity: e, searchable: t, filterFields: n, searchValue: r, onSearchChange: i, filters: a, onFilterChange: o, allEntities: s }) {
|
|
14078
14391
|
let c = t === !0, l = n && n.length > 0;
|
|
14079
14392
|
return !c && !l ? null : /* @__PURE__ */ P("div", {
|
|
14080
14393
|
style: {
|
|
@@ -14088,7 +14401,7 @@ function as({ entity: e, searchable: t, filterFields: n, searchValue: r, onSearc
|
|
|
14088
14401
|
flex: 1,
|
|
14089
14402
|
maxWidth: 220
|
|
14090
14403
|
},
|
|
14091
|
-
children: /* @__PURE__ */ N(
|
|
14404
|
+
children: /* @__PURE__ */ N(Y, {
|
|
14092
14405
|
value: r,
|
|
14093
14406
|
onChange: i,
|
|
14094
14407
|
placeholder: "Search…",
|
|
@@ -14098,14 +14411,14 @@ function as({ entity: e, searchable: t, filterFields: n, searchValue: r, onSearc
|
|
|
14098
14411
|
let n = e.fields.get(t);
|
|
14099
14412
|
if (!n) return null;
|
|
14100
14413
|
let r = a[t] ?? "__all__", i = ze(n, t, s);
|
|
14101
|
-
return n.type === "ref" && n.ref?.entity ? /* @__PURE__ */ N(
|
|
14414
|
+
return n.type === "ref" && n.ref?.entity ? /* @__PURE__ */ N(ss, {
|
|
14102
14415
|
field: n,
|
|
14103
14416
|
label: i,
|
|
14104
14417
|
value: r,
|
|
14105
14418
|
onChange: (e) => o(t, e)
|
|
14106
14419
|
}, t) : n.values ? /* @__PURE__ */ N("div", {
|
|
14107
14420
|
style: { width: 160 },
|
|
14108
|
-
children: /* @__PURE__ */ N(
|
|
14421
|
+
children: /* @__PURE__ */ N(De, {
|
|
14109
14422
|
value: r,
|
|
14110
14423
|
options: [{
|
|
14111
14424
|
value: "__all__",
|
|
@@ -14121,7 +14434,7 @@ function as({ entity: e, searchable: t, filterFields: n, searchValue: r, onSearc
|
|
|
14121
14434
|
})]
|
|
14122
14435
|
});
|
|
14123
14436
|
}
|
|
14124
|
-
function
|
|
14437
|
+
function ss({ field: e, label: t, value: n, onChange: r }) {
|
|
14125
14438
|
let i = $n(e.ref?.entity), a = e.display?.ref_display_field ?? i?.display?.display_field, o = d(() => i ? [...i.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [i]), { data: s } = Qn(e.ref?.entity, {
|
|
14126
14439
|
per_page: 200,
|
|
14127
14440
|
sort: a ? `${a}:asc` : void 0
|
|
@@ -14135,7 +14448,7 @@ function os({ field: e, label: t, value: n, onChange: r }) {
|
|
|
14135
14448
|
};
|
|
14136
14449
|
return /* @__PURE__ */ N("div", {
|
|
14137
14450
|
style: { width: 160 },
|
|
14138
|
-
children: /* @__PURE__ */ N(
|
|
14451
|
+
children: /* @__PURE__ */ N(De, {
|
|
14139
14452
|
value: n,
|
|
14140
14453
|
options: [{
|
|
14141
14454
|
value: "__all__",
|
|
@@ -14154,7 +14467,16 @@ function os({ field: e, label: t, value: n, onChange: r }) {
|
|
|
14154
14467
|
}
|
|
14155
14468
|
//#endregion
|
|
14156
14469
|
//#region src/components/detail-layout/AssociatedBlock.tsx
|
|
14157
|
-
function
|
|
14470
|
+
function cs(e) {
|
|
14471
|
+
if (!e) return [];
|
|
14472
|
+
let t = [];
|
|
14473
|
+
for (let [n, r] of Object.entries(e)) (r.visibility ?? []).includes("list_row") && (r.association || t.push({
|
|
14474
|
+
code: n,
|
|
14475
|
+
action: r
|
|
14476
|
+
}));
|
|
14477
|
+
return t;
|
|
14478
|
+
}
|
|
14479
|
+
function ls(e, t, n) {
|
|
14158
14480
|
if (!e) return [];
|
|
14159
14481
|
let r = [];
|
|
14160
14482
|
for (let [i, a] of Object.entries(e)) {
|
|
@@ -14180,7 +14502,7 @@ function ss(e, t, n) {
|
|
|
14180
14502
|
}
|
|
14181
14503
|
return r;
|
|
14182
14504
|
}
|
|
14183
|
-
function
|
|
14505
|
+
function us({ node: e, ctx: t }) {
|
|
14184
14506
|
let n = e.associated;
|
|
14185
14507
|
if (!n || t.isNew) return null;
|
|
14186
14508
|
let r = t.schema.entities[n];
|
|
@@ -14192,12 +14514,24 @@ function cs({ node: e, ctx: t }) {
|
|
|
14192
14514
|
},
|
|
14193
14515
|
children: ["Entity not found: ", n]
|
|
14194
14516
|
});
|
|
14195
|
-
let i = null;
|
|
14196
|
-
for (let [e, n] of r.fields)
|
|
14197
|
-
|
|
14198
|
-
|
|
14517
|
+
let i = t.schema.entities[t.entityCode]?.table, a = null;
|
|
14518
|
+
for (let [e, n] of r.fields) {
|
|
14519
|
+
let r = n.ref?.entity;
|
|
14520
|
+
if (r) {
|
|
14521
|
+
if (r === t.entityCode) {
|
|
14522
|
+
a = e;
|
|
14523
|
+
break;
|
|
14524
|
+
}
|
|
14525
|
+
if (i) {
|
|
14526
|
+
let n = t.schema.entities[r]?.table;
|
|
14527
|
+
if (n && n === i) {
|
|
14528
|
+
a = e;
|
|
14529
|
+
break;
|
|
14530
|
+
}
|
|
14531
|
+
}
|
|
14532
|
+
}
|
|
14199
14533
|
}
|
|
14200
|
-
if (!
|
|
14534
|
+
if (!a) return /* @__PURE__ */ P("div", {
|
|
14201
14535
|
style: {
|
|
14202
14536
|
fontSize: 12.5,
|
|
14203
14537
|
color: "var(--text-3)",
|
|
@@ -14210,20 +14544,20 @@ function cs({ node: e, ctx: t }) {
|
|
|
14210
14544
|
t.entityCode
|
|
14211
14545
|
]
|
|
14212
14546
|
});
|
|
14213
|
-
let
|
|
14214
|
-
if (e ===
|
|
14547
|
+
let o = e.columns && e.columns.length > 0 ? e.columns.filter((e) => e === a ? !1 : !!r.fields.get(e)) : r.fields.names().filter((e) => {
|
|
14548
|
+
if (e === a) return !1;
|
|
14215
14549
|
let t = r.fields.get(e);
|
|
14216
14550
|
return !(!t || t.primary || t.display?.is_listable === !1);
|
|
14217
|
-
}),
|
|
14551
|
+
}), c = e.interaction ?? (r.readonly ? "readonly" : "navigate"), l = c === "inline_edit" && !r.readonly && e.editable !== !1, u = X(r.display?.name_plural) || X(r.display?.name) || n, f = e.searchable === !0 || e.filters && e.filters.length > 0, p = d(() => ls(r.actions, a, t.recordId), [
|
|
14218
14552
|
r.actions,
|
|
14219
|
-
|
|
14553
|
+
a,
|
|
14220
14554
|
t.recordId
|
|
14221
|
-
]),
|
|
14222
|
-
|
|
14555
|
+
]), m = k(), h = s(() => {
|
|
14556
|
+
m.invalidateQueries({ predicate: (e) => {
|
|
14223
14557
|
let t = e.queryKey;
|
|
14224
14558
|
return t[0] === "entity-children" && t[3] === n;
|
|
14225
14559
|
} });
|
|
14226
|
-
}, [
|
|
14560
|
+
}, [m, n]);
|
|
14227
14561
|
return /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ P("div", {
|
|
14228
14562
|
style: {
|
|
14229
14563
|
display: "flex",
|
|
@@ -14241,50 +14575,50 @@ function cs({ node: e, ctx: t }) {
|
|
|
14241
14575
|
textTransform: "uppercase",
|
|
14242
14576
|
margin: 0
|
|
14243
14577
|
},
|
|
14244
|
-
children:
|
|
14245
|
-
}),
|
|
14578
|
+
children: u
|
|
14579
|
+
}), p.length > 0 && /* @__PURE__ */ N("div", {
|
|
14246
14580
|
style: {
|
|
14247
14581
|
display: "flex",
|
|
14248
14582
|
gap: 6
|
|
14249
14583
|
},
|
|
14250
|
-
children:
|
|
14584
|
+
children: p.map(({ code: e, action: t }) => /* @__PURE__ */ N(is, {
|
|
14251
14585
|
actionCode: e,
|
|
14252
14586
|
action: t,
|
|
14253
14587
|
entityCode: n,
|
|
14254
14588
|
variant: "ghost",
|
|
14255
14589
|
size: "sm",
|
|
14256
|
-
onSuccess:
|
|
14590
|
+
onSuccess: h
|
|
14257
14591
|
}, e))
|
|
14258
14592
|
})]
|
|
14259
|
-
}),
|
|
14593
|
+
}), f ? /* @__PURE__ */ N(fs, {
|
|
14260
14594
|
entityCode: n,
|
|
14261
14595
|
entity: r,
|
|
14262
14596
|
parentEntity: t.entityCode,
|
|
14263
14597
|
parentId: t.recordId,
|
|
14264
|
-
foreignKey:
|
|
14265
|
-
columns:
|
|
14266
|
-
editable:
|
|
14267
|
-
interaction:
|
|
14598
|
+
foreignKey: a,
|
|
14599
|
+
columns: o,
|
|
14600
|
+
editable: l,
|
|
14601
|
+
interaction: c,
|
|
14268
14602
|
ctx: t,
|
|
14269
14603
|
searchable: e.searchable,
|
|
14270
14604
|
filterFields: e.filters,
|
|
14271
14605
|
sort: e.sort
|
|
14272
|
-
}) : /* @__PURE__ */ N(
|
|
14606
|
+
}) : /* @__PURE__ */ N(ds, {
|
|
14273
14607
|
entityCode: n,
|
|
14274
14608
|
entity: r,
|
|
14275
14609
|
parentEntity: t.entityCode,
|
|
14276
14610
|
parentId: t.recordId,
|
|
14277
|
-
foreignKey:
|
|
14278
|
-
columns:
|
|
14279
|
-
editable:
|
|
14280
|
-
interaction:
|
|
14611
|
+
foreignKey: a,
|
|
14612
|
+
columns: o,
|
|
14613
|
+
editable: l,
|
|
14614
|
+
interaction: c,
|
|
14281
14615
|
ctx: t,
|
|
14282
14616
|
sort: e.sort
|
|
14283
14617
|
})] });
|
|
14284
14618
|
}
|
|
14285
|
-
function
|
|
14619
|
+
function ds({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: c, ctx: l, sort: u }) {
|
|
14286
14620
|
let d = k(), { data: f, isLoading: p, isError: m } = ti(n, r, e, i, u), h = f?.data ?? [], g = f?.$refs;
|
|
14287
|
-
return /* @__PURE__ */ N(
|
|
14621
|
+
return /* @__PURE__ */ N(ps, {
|
|
14288
14622
|
entityCode: e,
|
|
14289
14623
|
entity: t,
|
|
14290
14624
|
parentId: r,
|
|
@@ -14312,7 +14646,7 @@ function ls({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
14312
14646
|
])
|
|
14313
14647
|
});
|
|
14314
14648
|
}
|
|
14315
|
-
function
|
|
14649
|
+
function fs({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: c, ctx: u, searchable: m, filterFields: h, sort: g }) {
|
|
14316
14650
|
let _ = k(), [v, y] = p(""), [b, x] = p(""), [S, C] = p({}), w = f(void 0);
|
|
14317
14651
|
l(() => (w.current && clearTimeout(w.current), w.current = setTimeout(() => {
|
|
14318
14652
|
x(v);
|
|
@@ -14330,7 +14664,7 @@ function us({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
14330
14664
|
[e]: t
|
|
14331
14665
|
};
|
|
14332
14666
|
});
|
|
14333
|
-
}, []), E = d(() => Object.keys(S).length > 0 ? S : void 0, [S]), { data: D, isLoading: O, isError: A, hasNextPage: j, fetchNextPage: M, isFetchingNextPage: F } = es(n, r, e, i, g, void 0, b || void 0, E), { rows: I, refs:
|
|
14667
|
+
}, []), E = d(() => Object.keys(S).length > 0 ? S : void 0, [S]), { data: D, isLoading: O, isError: A, hasNextPage: j, fetchNextPage: M, isFetchingNextPage: F } = es(n, r, e, i, g, void 0, b || void 0, E), { rows: I, refs: ee } = d(() => {
|
|
14334
14668
|
if (!D?.pages) return {
|
|
14335
14669
|
rows: [],
|
|
14336
14670
|
refs: void 0
|
|
@@ -14345,14 +14679,14 @@ function us({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
14345
14679
|
rows: e,
|
|
14346
14680
|
refs: t
|
|
14347
14681
|
};
|
|
14348
|
-
}, [D]),
|
|
14682
|
+
}, [D]), L = s(() => {
|
|
14349
14683
|
_.invalidateQueries({ predicate: (t) => {
|
|
14350
14684
|
let n = t.queryKey;
|
|
14351
14685
|
return n[0] === "entity-children" && n[3] === e;
|
|
14352
14686
|
} });
|
|
14353
14687
|
}, [_, e]);
|
|
14354
14688
|
return /* @__PURE__ */ P("div", { children: [
|
|
14355
|
-
/* @__PURE__ */ N(
|
|
14689
|
+
/* @__PURE__ */ N(os, {
|
|
14356
14690
|
entity: t,
|
|
14357
14691
|
searchable: m,
|
|
14358
14692
|
filterFields: h,
|
|
@@ -14362,7 +14696,7 @@ function us({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
14362
14696
|
onFilterChange: T,
|
|
14363
14697
|
allEntities: u.schema.entities
|
|
14364
14698
|
}),
|
|
14365
|
-
/* @__PURE__ */ N(
|
|
14699
|
+
/* @__PURE__ */ N(ps, {
|
|
14366
14700
|
entityCode: e,
|
|
14367
14701
|
entity: t,
|
|
14368
14702
|
parentId: r,
|
|
@@ -14372,17 +14706,17 @@ function us({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
14372
14706
|
interaction: c,
|
|
14373
14707
|
ctx: u,
|
|
14374
14708
|
rows: I,
|
|
14375
|
-
refs:
|
|
14709
|
+
refs: ee,
|
|
14376
14710
|
isLoading: O,
|
|
14377
14711
|
isError: A,
|
|
14378
|
-
invalidateQuery:
|
|
14712
|
+
invalidateQuery: L
|
|
14379
14713
|
}),
|
|
14380
14714
|
j && /* @__PURE__ */ N("div", {
|
|
14381
14715
|
style: { marginTop: 4 },
|
|
14382
14716
|
children: /* @__PURE__ */ N(V, {
|
|
14383
14717
|
kind: "ghost",
|
|
14384
14718
|
size: "xs",
|
|
14385
|
-
icon: F ? /* @__PURE__ */ N(
|
|
14719
|
+
icon: F ? /* @__PURE__ */ N(q, { size: 12 }) : void 0,
|
|
14386
14720
|
onClick: () => M(),
|
|
14387
14721
|
disabled: F,
|
|
14388
14722
|
children: "Load more"
|
|
@@ -14390,7 +14724,7 @@ function us({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
14390
14724
|
})
|
|
14391
14725
|
] });
|
|
14392
14726
|
}
|
|
14393
|
-
function
|
|
14727
|
+
function ps({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i, editable: a, interaction: o, ctx: c, rows: u, refs: m, isLoading: h, isError: g, invalidateQuery: _ }) {
|
|
14394
14728
|
let v = Mt(), y = i.find((e) => e !== r), b = d(() => o === "navigate" ? Object.values(c.schema.screens ?? {}).find((t) => t.type === "detail" && t.entity === e) : void 0, [
|
|
14395
14729
|
o,
|
|
14396
14730
|
c.schema.screens,
|
|
@@ -14404,17 +14738,17 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14404
14738
|
r,
|
|
14405
14739
|
t.fields,
|
|
14406
14740
|
a
|
|
14407
|
-
]),
|
|
14408
|
-
|
|
14409
|
-
let
|
|
14741
|
+
]), S = d(() => cs(t.actions), [t.actions]), [C, w] = p(null), [T, E] = p({}), D = f(T);
|
|
14742
|
+
D.current = T;
|
|
14743
|
+
let O = f({});
|
|
14410
14744
|
l(() => {
|
|
14411
|
-
let e =
|
|
14745
|
+
let e = O.current;
|
|
14412
14746
|
return () => {
|
|
14413
14747
|
for (let t of Object.values(e)) clearTimeout(t);
|
|
14414
14748
|
};
|
|
14415
14749
|
}, []);
|
|
14416
|
-
let [
|
|
14417
|
-
|
|
14750
|
+
let [k, A] = p(null), [j, M] = p([]), [F, I] = p(!1), [ee, L] = p(null), [R, te] = p(/* @__PURE__ */ new Set()), ne = s(async (t, n, r) => {
|
|
14751
|
+
E((e) => ({
|
|
14418
14752
|
...e,
|
|
14419
14753
|
[t]: {
|
|
14420
14754
|
...e[t],
|
|
@@ -14423,7 +14757,7 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14423
14757
|
}
|
|
14424
14758
|
}));
|
|
14425
14759
|
try {
|
|
14426
|
-
await Wn(e, t, n),
|
|
14760
|
+
await Wn(e, t, n), E((e) => {
|
|
14427
14761
|
let n = e[t];
|
|
14428
14762
|
if (!n) return e;
|
|
14429
14763
|
if (n.ver > r) return {
|
|
@@ -14438,7 +14772,7 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14438
14772
|
}), _();
|
|
14439
14773
|
} catch (e) {
|
|
14440
14774
|
let n = e instanceof Error ? e.message : "Save failed";
|
|
14441
|
-
|
|
14775
|
+
E((e) => ({
|
|
14442
14776
|
...e,
|
|
14443
14777
|
[t]: {
|
|
14444
14778
|
...e[t],
|
|
@@ -14447,8 +14781,8 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14447
14781
|
}
|
|
14448
14782
|
}));
|
|
14449
14783
|
}
|
|
14450
|
-
}, [e, _]),
|
|
14451
|
-
|
|
14784
|
+
}, [e, _]), re = s((e, t, n) => {
|
|
14785
|
+
E((r) => {
|
|
14452
14786
|
let i = r[e] ?? {
|
|
14453
14787
|
buffer: {},
|
|
14454
14788
|
ver: 0,
|
|
@@ -14465,57 +14799,57 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14465
14799
|
ver: a
|
|
14466
14800
|
}
|
|
14467
14801
|
};
|
|
14468
|
-
}),
|
|
14469
|
-
let t =
|
|
14470
|
-
t && Object.keys(t.buffer).length > 0 &&
|
|
14802
|
+
}), O.current[e] && clearTimeout(O.current[e]), O.current[e] = setTimeout(() => {
|
|
14803
|
+
let t = D.current[e];
|
|
14804
|
+
t && Object.keys(t.buffer).length > 0 && ne(e, { ...t.buffer }, t.ver);
|
|
14471
14805
|
}, 500);
|
|
14472
|
-
}, [
|
|
14806
|
+
}, [ne]), ie = s(() => {
|
|
14473
14807
|
let e = {};
|
|
14474
14808
|
e[r] = n;
|
|
14475
14809
|
for (let n of i) {
|
|
14476
14810
|
let r = t.fields.get(n);
|
|
14477
14811
|
r && (r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default);
|
|
14478
14812
|
}
|
|
14479
|
-
|
|
14813
|
+
A(e), M([]);
|
|
14480
14814
|
}, [
|
|
14481
14815
|
r,
|
|
14482
14816
|
n,
|
|
14483
14817
|
i,
|
|
14484
14818
|
t.fields
|
|
14485
|
-
]),
|
|
14486
|
-
if (!
|
|
14819
|
+
]), ae = s(async () => {
|
|
14820
|
+
if (!k) return;
|
|
14487
14821
|
let n = [];
|
|
14488
14822
|
for (let e of i) {
|
|
14489
14823
|
let i = t.fields.get(e);
|
|
14490
14824
|
if (!i || !i.required || i.auto || i.primary || e === r) continue;
|
|
14491
|
-
let a =
|
|
14825
|
+
let a = k[e];
|
|
14492
14826
|
(a == null || a === "") && n.push(e);
|
|
14493
14827
|
}
|
|
14494
14828
|
if (n.length > 0) {
|
|
14495
|
-
|
|
14829
|
+
M(n);
|
|
14496
14830
|
return;
|
|
14497
14831
|
}
|
|
14498
|
-
|
|
14832
|
+
I(!0);
|
|
14499
14833
|
try {
|
|
14500
|
-
await Un(e,
|
|
14834
|
+
await Un(e, k), A(null), M([]), _();
|
|
14501
14835
|
} catch (e) {
|
|
14502
|
-
|
|
14836
|
+
M([`_error:${e instanceof Error ? e.message : "Create failed"}`]);
|
|
14503
14837
|
} finally {
|
|
14504
|
-
|
|
14838
|
+
I(!1);
|
|
14505
14839
|
}
|
|
14506
14840
|
}, [
|
|
14507
|
-
|
|
14841
|
+
k,
|
|
14508
14842
|
i,
|
|
14509
14843
|
t.fields,
|
|
14510
14844
|
r,
|
|
14511
14845
|
e,
|
|
14512
14846
|
_
|
|
14513
|
-
]),
|
|
14514
|
-
L(null),
|
|
14847
|
+
]), oe = s(async (t) => {
|
|
14848
|
+
L(null), te((e) => new Set(e).add(t));
|
|
14515
14849
|
try {
|
|
14516
14850
|
await Gn(e, t), _();
|
|
14517
14851
|
} catch {} finally {
|
|
14518
|
-
|
|
14852
|
+
te((e) => {
|
|
14519
14853
|
let n = new Set(e);
|
|
14520
14854
|
return n.delete(t), n;
|
|
14521
14855
|
});
|
|
@@ -14546,9 +14880,9 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14546
14880
|
borderRadius: 6
|
|
14547
14881
|
} })]
|
|
14548
14882
|
});
|
|
14549
|
-
let
|
|
14883
|
+
let se = u.length === 0 && !k;
|
|
14550
14884
|
return /* @__PURE__ */ P("div", { children: [
|
|
14551
|
-
|
|
14885
|
+
se && !a && /* @__PURE__ */ N("div", {
|
|
14552
14886
|
style: {
|
|
14553
14887
|
fontSize: 12.5,
|
|
14554
14888
|
color: "var(--text-3)",
|
|
@@ -14556,7 +14890,7 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14556
14890
|
},
|
|
14557
14891
|
children: "No records yet."
|
|
14558
14892
|
}),
|
|
14559
|
-
(!
|
|
14893
|
+
(!se || a) && /* @__PURE__ */ N("div", {
|
|
14560
14894
|
style: { overflowX: "auto" },
|
|
14561
14895
|
children: /* @__PURE__ */ P("table", {
|
|
14562
14896
|
style: {
|
|
@@ -14565,28 +14899,35 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14565
14899
|
borderCollapse: "separate",
|
|
14566
14900
|
borderSpacing: 0
|
|
14567
14901
|
},
|
|
14568
|
-
children: [/* @__PURE__ */ N("thead", { children: /* @__PURE__ */ P("tr", { children: [
|
|
14569
|
-
|
|
14570
|
-
|
|
14571
|
-
|
|
14572
|
-
|
|
14573
|
-
|
|
14574
|
-
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
|
|
14578
|
-
|
|
14579
|
-
|
|
14580
|
-
|
|
14581
|
-
|
|
14582
|
-
|
|
14583
|
-
|
|
14584
|
-
|
|
14585
|
-
|
|
14586
|
-
|
|
14587
|
-
|
|
14588
|
-
|
|
14589
|
-
|
|
14902
|
+
children: [/* @__PURE__ */ N("thead", { children: /* @__PURE__ */ P("tr", { children: [
|
|
14903
|
+
i.map((e) => {
|
|
14904
|
+
let n = t.fields.get(e);
|
|
14905
|
+
return /* @__PURE__ */ N("th", {
|
|
14906
|
+
style: {
|
|
14907
|
+
height: 30,
|
|
14908
|
+
padding: "0 12px",
|
|
14909
|
+
textAlign: "left",
|
|
14910
|
+
fontWeight: 600,
|
|
14911
|
+
fontSize: 11,
|
|
14912
|
+
letterSpacing: "0.04em",
|
|
14913
|
+
color: "var(--text-3)",
|
|
14914
|
+
textTransform: "uppercase",
|
|
14915
|
+
borderBottom: "1px solid var(--divider)"
|
|
14916
|
+
},
|
|
14917
|
+
children: n ? ze(n, e, c.schema.entities) : e
|
|
14918
|
+
}, e);
|
|
14919
|
+
}),
|
|
14920
|
+
a && /* @__PURE__ */ N("th", { style: {
|
|
14921
|
+
height: 30,
|
|
14922
|
+
width: 40
|
|
14923
|
+
} }),
|
|
14924
|
+
!a && S.length > 0 && /* @__PURE__ */ N("th", { style: {
|
|
14925
|
+
height: 30,
|
|
14926
|
+
width: 40
|
|
14927
|
+
} })
|
|
14928
|
+
] }) }), /* @__PURE__ */ P("tbody", { children: [u.map((n) => {
|
|
14929
|
+
let r = String(n.id ?? ""), o = R.has(r), s = T[r], c = b && r ? b.route.replace(/:\w+/, r) : void 0, l = X(t.display?.name) || e, u = t.display?.icon;
|
|
14930
|
+
return /* @__PURE__ */ N(ms, {
|
|
14590
14931
|
rowId: r,
|
|
14591
14932
|
row: n,
|
|
14592
14933
|
entity: t,
|
|
@@ -14594,10 +14935,10 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14594
14935
|
editableColumns: x,
|
|
14595
14936
|
editable: a,
|
|
14596
14937
|
isDeleting: o,
|
|
14597
|
-
activeCell:
|
|
14598
|
-
setActiveCell:
|
|
14938
|
+
activeCell: C,
|
|
14939
|
+
setActiveCell: w,
|
|
14599
14940
|
rowState: s,
|
|
14600
|
-
onCellChange:
|
|
14941
|
+
onCellChange: re,
|
|
14601
14942
|
onDeleteClick: (e) => {
|
|
14602
14943
|
let r = t.display?.display_field;
|
|
14603
14944
|
L({
|
|
@@ -14612,23 +14953,26 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14612
14953
|
onNavigate: c ? () => v(c, {
|
|
14613
14954
|
title: l,
|
|
14614
14955
|
icon: u
|
|
14615
|
-
}) : void 0
|
|
14956
|
+
}) : void 0,
|
|
14957
|
+
rowActions: S,
|
|
14958
|
+
entityCode: e,
|
|
14959
|
+
onRowActionSuccess: _
|
|
14616
14960
|
}, r);
|
|
14617
|
-
}),
|
|
14618
|
-
draftRow:
|
|
14961
|
+
}), k && /* @__PURE__ */ N(hs, {
|
|
14962
|
+
draftRow: k,
|
|
14619
14963
|
entity: t,
|
|
14620
14964
|
columns: i,
|
|
14621
14965
|
editableColumns: x,
|
|
14622
14966
|
foreignKey: r,
|
|
14623
|
-
draftErrors:
|
|
14624
|
-
draftSaving:
|
|
14625
|
-
onChange: (e, t) =>
|
|
14967
|
+
draftErrors: j,
|
|
14968
|
+
draftSaving: F,
|
|
14969
|
+
onChange: (e, t) => A((n) => n && {
|
|
14626
14970
|
...n,
|
|
14627
14971
|
[e]: t
|
|
14628
14972
|
}),
|
|
14629
|
-
onConfirm:
|
|
14973
|
+
onConfirm: ae,
|
|
14630
14974
|
onCancel: () => {
|
|
14631
|
-
|
|
14975
|
+
A(null), M([]);
|
|
14632
14976
|
},
|
|
14633
14977
|
refs: m
|
|
14634
14978
|
})] })]
|
|
@@ -14640,118 +14984,134 @@ function ds({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
14640
14984
|
kind: "ghost",
|
|
14641
14985
|
size: "xs",
|
|
14642
14986
|
icon: /* @__PURE__ */ N(B.plus, { size: 12 }),
|
|
14643
|
-
onClick:
|
|
14644
|
-
disabled: !!
|
|
14987
|
+
onClick: ie,
|
|
14988
|
+
disabled: !!k,
|
|
14645
14989
|
children: "Add row"
|
|
14646
14990
|
})
|
|
14647
14991
|
}),
|
|
14648
|
-
|
|
14649
|
-
open:
|
|
14992
|
+
ee && /* @__PURE__ */ N(ra, {
|
|
14993
|
+
open: ee.show,
|
|
14650
14994
|
onOpenChange: (e) => !e && L(null),
|
|
14651
14995
|
title: "Delete record",
|
|
14652
|
-
description:
|
|
14996
|
+
description: ee.label ? `Are you sure you want to delete "${ee.label}"?` : "Are you sure you want to delete this record?",
|
|
14653
14997
|
confirmLabel: "Delete",
|
|
14654
|
-
onConfirm: () =>
|
|
14998
|
+
onConfirm: () => oe(ee.rowId),
|
|
14655
14999
|
destructive: !0
|
|
14656
15000
|
})
|
|
14657
15001
|
] });
|
|
14658
15002
|
}
|
|
14659
|
-
function
|
|
14660
|
-
let
|
|
15003
|
+
function ms({ rowId: e, row: t, entity: n, columns: r, editableColumns: i, editable: a, isDeleting: o, activeCell: s, setActiveCell: c, rowState: l, onCellChange: u, onDeleteClick: f, refs: p, identityCol: m, href: h, onNavigate: g, rowActions: _, onRowActionSuccess: v }) {
|
|
15004
|
+
let y = d(() => !l || Object.keys(l.buffer).length === 0 ? t : {
|
|
14661
15005
|
...t,
|
|
14662
15006
|
...l.buffer
|
|
14663
|
-
}, [t, l]),
|
|
15007
|
+
}, [t, l]), b = {
|
|
14664
15008
|
padding: "6px 12px",
|
|
14665
15009
|
borderBottom: "1px solid var(--divider)",
|
|
14666
15010
|
color: "var(--text-2)",
|
|
14667
15011
|
verticalAlign: "middle"
|
|
14668
|
-
},
|
|
15012
|
+
}, x = {
|
|
14669
15013
|
padding: "4px 4px",
|
|
14670
15014
|
borderBottom: "1px solid var(--divider)",
|
|
14671
15015
|
verticalAlign: "middle"
|
|
14672
15016
|
};
|
|
14673
15017
|
return /* @__PURE__ */ P("tr", {
|
|
14674
15018
|
style: { opacity: o ? .5 : 1 },
|
|
14675
|
-
children: [
|
|
14676
|
-
|
|
14677
|
-
|
|
14678
|
-
|
|
14679
|
-
|
|
15019
|
+
children: [
|
|
15020
|
+
r.map((t) => {
|
|
15021
|
+
let r = n.fields.get(t), a = i.has(t);
|
|
15022
|
+
if (s?.rowId === e && s?.col === t && a) return /* @__PURE__ */ N("td", {
|
|
15023
|
+
style: x,
|
|
15024
|
+
children: r ? $({
|
|
15025
|
+
field: r,
|
|
15026
|
+
fieldName: t,
|
|
15027
|
+
value: y[t],
|
|
15028
|
+
mode: "edit",
|
|
15029
|
+
onChange: (n) => u(e, t, n),
|
|
15030
|
+
record: y,
|
|
15031
|
+
refs: p
|
|
15032
|
+
}) : String(y[t] ?? "")
|
|
15033
|
+
}, t);
|
|
15034
|
+
let l = r ? $({
|
|
14680
15035
|
field: r,
|
|
14681
15036
|
fieldName: t,
|
|
14682
|
-
value:
|
|
14683
|
-
mode: "
|
|
14684
|
-
|
|
14685
|
-
record: _,
|
|
15037
|
+
value: y[t],
|
|
15038
|
+
mode: "display",
|
|
15039
|
+
record: y,
|
|
14686
15040
|
refs: p
|
|
14687
|
-
}) : String(
|
|
14688
|
-
|
|
14689
|
-
|
|
14690
|
-
|
|
14691
|
-
|
|
14692
|
-
|
|
14693
|
-
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
|
|
14697
|
-
|
|
15041
|
+
}) : String(y[t] ?? ""), d = h && t === m;
|
|
15042
|
+
return /* @__PURE__ */ N("td", {
|
|
15043
|
+
style: {
|
|
15044
|
+
...b,
|
|
15045
|
+
cursor: a ? "pointer" : "default"
|
|
15046
|
+
},
|
|
15047
|
+
onClick: a && !o ? () => c({
|
|
15048
|
+
rowId: e,
|
|
15049
|
+
col: t
|
|
15050
|
+
}) : void 0,
|
|
15051
|
+
children: d ? /* @__PURE__ */ N("a", {
|
|
15052
|
+
href: h,
|
|
15053
|
+
onClick: (e) => {
|
|
15054
|
+
e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1 || (e.preventDefault(), g?.());
|
|
15055
|
+
},
|
|
15056
|
+
style: {
|
|
15057
|
+
color: "var(--accent)",
|
|
15058
|
+
textDecoration: "none",
|
|
15059
|
+
fontWeight: 500
|
|
15060
|
+
},
|
|
15061
|
+
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
15062
|
+
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
15063
|
+
children: l
|
|
15064
|
+
}) : l
|
|
15065
|
+
}, t);
|
|
15066
|
+
}),
|
|
15067
|
+
a && /* @__PURE__ */ N("td", {
|
|
14698
15068
|
style: {
|
|
14699
|
-
|
|
14700
|
-
|
|
15069
|
+
padding: "4px 8px",
|
|
15070
|
+
borderBottom: "1px solid var(--divider)",
|
|
15071
|
+
verticalAlign: "middle"
|
|
14701
15072
|
},
|
|
14702
|
-
|
|
14703
|
-
rowId: e,
|
|
14704
|
-
col: t
|
|
14705
|
-
}) : void 0,
|
|
14706
|
-
children: d ? /* @__PURE__ */ N("a", {
|
|
14707
|
-
href: h,
|
|
14708
|
-
onClick: (e) => {
|
|
14709
|
-
e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1 || (e.preventDefault(), g?.());
|
|
14710
|
-
},
|
|
15073
|
+
children: /* @__PURE__ */ P("div", {
|
|
14711
15074
|
style: {
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
|
|
15075
|
+
display: "flex",
|
|
15076
|
+
alignItems: "center",
|
|
15077
|
+
gap: 4
|
|
14715
15078
|
},
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
|
|
15079
|
+
children: [
|
|
15080
|
+
l?.saving && /* @__PURE__ */ N(q, { size: 12 }),
|
|
15081
|
+
l?.error && /* @__PURE__ */ N("span", {
|
|
15082
|
+
style: {
|
|
15083
|
+
fontSize: 11,
|
|
15084
|
+
color: "var(--danger)"
|
|
15085
|
+
},
|
|
15086
|
+
title: l.error,
|
|
15087
|
+
children: "!"
|
|
15088
|
+
}),
|
|
15089
|
+
/* @__PURE__ */ N(H, {
|
|
15090
|
+
size: 24,
|
|
15091
|
+
icon: /* @__PURE__ */ N(B.trash, { size: 12 }),
|
|
15092
|
+
onClick: () => f(e),
|
|
15093
|
+
title: "Delete row"
|
|
15094
|
+
})
|
|
15095
|
+
]
|
|
15096
|
+
})
|
|
15097
|
+
}),
|
|
15098
|
+
!a && _ && _.length > 0 && /* @__PURE__ */ N("td", {
|
|
14728
15099
|
style: {
|
|
14729
|
-
|
|
14730
|
-
|
|
14731
|
-
|
|
15100
|
+
padding: "4px 8px",
|
|
15101
|
+
borderBottom: "1px solid var(--divider)",
|
|
15102
|
+
verticalAlign: "middle"
|
|
14732
15103
|
},
|
|
14733
|
-
children:
|
|
14734
|
-
|
|
14735
|
-
|
|
14736
|
-
|
|
14737
|
-
|
|
14738
|
-
|
|
14739
|
-
},
|
|
14740
|
-
title: l.error,
|
|
14741
|
-
children: "!"
|
|
14742
|
-
}),
|
|
14743
|
-
/* @__PURE__ */ N(H, {
|
|
14744
|
-
size: 24,
|
|
14745
|
-
icon: /* @__PURE__ */ N(B.trash, { size: 12 }),
|
|
14746
|
-
onClick: () => f(e),
|
|
14747
|
-
title: "Delete row"
|
|
14748
|
-
})
|
|
14749
|
-
]
|
|
15104
|
+
children: /* @__PURE__ */ N(as, {
|
|
15105
|
+
actions: _,
|
|
15106
|
+
objectIds: [e],
|
|
15107
|
+
row: y,
|
|
15108
|
+
onSuccess: v
|
|
15109
|
+
})
|
|
14750
15110
|
})
|
|
14751
|
-
|
|
15111
|
+
]
|
|
14752
15112
|
});
|
|
14753
15113
|
}
|
|
14754
|
-
function
|
|
15114
|
+
function hs({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
|
|
14755
15115
|
let d = a.find((e) => e.startsWith("_error:")), f = new Set(a.filter((e) => !e.startsWith("_error:")));
|
|
14756
15116
|
return /* @__PURE__ */ P("tr", {
|
|
14757
15117
|
style: { background: "var(--surface-2)" },
|
|
@@ -14808,7 +15168,7 @@ function ps({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
14808
15168
|
}),
|
|
14809
15169
|
/* @__PURE__ */ N(H, {
|
|
14810
15170
|
size: 24,
|
|
14811
|
-
icon: N(o ?
|
|
15171
|
+
icon: N(o ? q : B.check, { size: 12 }),
|
|
14812
15172
|
onClick: c,
|
|
14813
15173
|
title: "Confirm"
|
|
14814
15174
|
}),
|
|
@@ -14825,7 +15185,7 @@ function ps({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
14825
15185
|
}
|
|
14826
15186
|
//#endregion
|
|
14827
15187
|
//#region src/components/detail-layout/FieldsBlock.tsx
|
|
14828
|
-
function
|
|
15188
|
+
function gs({ fields: e, ctx: t }) {
|
|
14829
15189
|
let { entity: n, entityCode: r, record: i, mode: a, onFieldChange: o, schema: s } = t, c = t.columns ?? 2, l = c === 1 && e.length === 1;
|
|
14830
15190
|
return /* @__PURE__ */ N("div", {
|
|
14831
15191
|
className: oo("grid gap-x-6 gap-y-3", c === 1 ? "grid-cols-1" : "grid-cols-1 md:grid-cols-2"),
|
|
@@ -14872,7 +15232,7 @@ function ms({ fields: e, ctx: t }) {
|
|
|
14872
15232
|
}
|
|
14873
15233
|
//#endregion
|
|
14874
15234
|
//#region src/components/detail-layout/PropertiesBlock.tsx
|
|
14875
|
-
var
|
|
15235
|
+
var _s = new Set([
|
|
14876
15236
|
"string",
|
|
14877
15237
|
"text",
|
|
14878
15238
|
"int",
|
|
@@ -14880,8 +15240,8 @@ var hs = new Set([
|
|
|
14880
15240
|
"decimal",
|
|
14881
15241
|
"email",
|
|
14882
15242
|
"url"
|
|
14883
|
-
]),
|
|
14884
|
-
function
|
|
15243
|
+
]), vs = 500;
|
|
15244
|
+
function ys({ node: e, ctx: t }) {
|
|
14885
15245
|
let { entity: n, objectProperties: r, onSetProperty: i, isNew: a, mode: o, refs: s } = t, c = n.properties ?? {};
|
|
14886
15246
|
if (a) return null;
|
|
14887
15247
|
let l = e.properties === !0 ? !0 : e.properties, u = l === !0 ? Object.entries(c).sort(([e], [t]) => e.localeCompare(t)) : l.filter((e) => c[e] != null).map((e) => [e, c[e]]);
|
|
@@ -14889,7 +15249,7 @@ function _s({ node: e, ctx: t }) {
|
|
|
14889
15249
|
className: "grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-3",
|
|
14890
15250
|
children: u.map(([e, t]) => {
|
|
14891
15251
|
let n = r?.find((t) => t.property_code === e), a = Be(t), c = t.readonly || !i ? "display" : o;
|
|
14892
|
-
return /* @__PURE__ */ N(
|
|
15252
|
+
return /* @__PURE__ */ N(bs, {
|
|
14893
15253
|
propCode: e,
|
|
14894
15254
|
prop: t,
|
|
14895
15255
|
field: a,
|
|
@@ -14901,13 +15261,13 @@ function _s({ node: e, ctx: t }) {
|
|
|
14901
15261
|
})
|
|
14902
15262
|
});
|
|
14903
15263
|
}
|
|
14904
|
-
function
|
|
15264
|
+
function bs({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty: a, refs: o }) {
|
|
14905
15265
|
let c = f(null);
|
|
14906
15266
|
l(() => () => {
|
|
14907
15267
|
c.current && clearTimeout(c.current);
|
|
14908
15268
|
}, []);
|
|
14909
15269
|
let u = s((n) => {
|
|
14910
|
-
a && (
|
|
15270
|
+
a && (_s.has(t.type) ? (c.current && clearTimeout(c.current), c.current = setTimeout(() => a(e, n), vs)) : a(e, n));
|
|
14911
15271
|
}, [
|
|
14912
15272
|
e,
|
|
14913
15273
|
t.type,
|
|
@@ -14933,7 +15293,7 @@ function vs({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty:
|
|
|
14933
15293
|
}
|
|
14934
15294
|
//#endregion
|
|
14935
15295
|
//#region src/components/shared/StatusGroupsDisplay.tsx
|
|
14936
|
-
function
|
|
15296
|
+
function xs({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r, mode: i = "edit" }) {
|
|
14937
15297
|
return /* @__PURE__ */ N("div", {
|
|
14938
15298
|
style: {
|
|
14939
15299
|
display: "flex",
|
|
@@ -15002,7 +15362,7 @@ function ys({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
|
|
|
15002
15362
|
opacity: r ? .6 : 1,
|
|
15003
15363
|
pointerEvents: r ? "none" : "auto"
|
|
15004
15364
|
},
|
|
15005
|
-
children: /* @__PURE__ */ N(
|
|
15365
|
+
children: /* @__PURE__ */ N(De, {
|
|
15006
15366
|
value: o ?? "",
|
|
15007
15367
|
options: c,
|
|
15008
15368
|
onChange: (t) => n(e, t),
|
|
@@ -15015,28 +15375,28 @@ function ys({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
|
|
|
15015
15375
|
}
|
|
15016
15376
|
//#endregion
|
|
15017
15377
|
//#region src/components/detail-layout/StatusesBlock.tsx
|
|
15018
|
-
var
|
|
15019
|
-
function
|
|
15378
|
+
var Ss = () => {};
|
|
15379
|
+
function Cs({ node: e, ctx: t }) {
|
|
15020
15380
|
let { entity: n, objectStatuses: r, onSetStatus: i, isStatusPending: a, isNew: o } = t, s = n.status_groups ?? {};
|
|
15021
15381
|
if (o) return null;
|
|
15022
15382
|
let c = e.statuses === !0 ? !0 : e.statuses, l = Object.fromEntries(Object.entries(s).filter(([e]) => c === !0 || c.includes(e)));
|
|
15023
|
-
return Object.keys(l).length === 0 ? null : /* @__PURE__ */ N(
|
|
15383
|
+
return Object.keys(l).length === 0 ? null : /* @__PURE__ */ N(xs, {
|
|
15024
15384
|
statusGroups: l,
|
|
15025
15385
|
objectStatuses: r,
|
|
15026
|
-
onSetStatus: i ??
|
|
15386
|
+
onSetStatus: i ?? Ss,
|
|
15027
15387
|
isPending: a ?? !1,
|
|
15028
15388
|
mode: t.mode
|
|
15029
15389
|
});
|
|
15030
15390
|
}
|
|
15031
15391
|
//#endregion
|
|
15032
15392
|
//#region src/components/detail-layout/LayoutRenderer.tsx
|
|
15033
|
-
function
|
|
15034
|
-
return /* @__PURE__ */ N(M, { children: e.map((e, n) => /* @__PURE__ */ N(
|
|
15393
|
+
function ws({ nodes: e, ctx: t }) {
|
|
15394
|
+
return /* @__PURE__ */ N(M, { children: e.map((e, n) => /* @__PURE__ */ N(Ts, {
|
|
15035
15395
|
node: e,
|
|
15036
15396
|
ctx: t
|
|
15037
15397
|
}, n)) });
|
|
15038
15398
|
}
|
|
15039
|
-
function
|
|
15399
|
+
function Ts({ node: e, ctx: t }) {
|
|
15040
15400
|
return e.row ? /* @__PURE__ */ N(lo, {
|
|
15041
15401
|
config: e.row,
|
|
15042
15402
|
ctx: t
|
|
@@ -15053,23 +15413,23 @@ function Cs({ node: e, ctx: t }) {
|
|
|
15053
15413
|
}) : e.children ? /* @__PURE__ */ N($o, {
|
|
15054
15414
|
node: e,
|
|
15055
15415
|
ctx: t
|
|
15056
|
-
}) : e.associated ? /* @__PURE__ */ N(
|
|
15416
|
+
}) : e.associated ? /* @__PURE__ */ N(us, {
|
|
15057
15417
|
node: e,
|
|
15058
15418
|
ctx: t
|
|
15059
|
-
}) : e.fields ? /* @__PURE__ */ N(
|
|
15419
|
+
}) : e.fields ? /* @__PURE__ */ N(gs, {
|
|
15060
15420
|
fields: e.fields,
|
|
15061
15421
|
ctx: t
|
|
15062
|
-
}) : e.properties == null ? e.statuses == null ? null : /* @__PURE__ */ N(
|
|
15422
|
+
}) : e.properties == null ? e.statuses == null ? null : /* @__PURE__ */ N(Cs, {
|
|
15063
15423
|
node: e,
|
|
15064
15424
|
ctx: t
|
|
15065
|
-
}) : /* @__PURE__ */ N(
|
|
15425
|
+
}) : /* @__PURE__ */ N(ys, {
|
|
15066
15426
|
node: e,
|
|
15067
15427
|
ctx: t
|
|
15068
15428
|
});
|
|
15069
15429
|
}
|
|
15070
15430
|
//#endregion
|
|
15071
15431
|
//#region src/lib/children-validation.ts
|
|
15072
|
-
function
|
|
15432
|
+
function Es(e, t) {
|
|
15073
15433
|
let n = /* @__PURE__ */ new Set();
|
|
15074
15434
|
for (let r of Object.values(t.entities)) if (r.children) {
|
|
15075
15435
|
for (let t of r.children) if (t.entity === e && t.foreign_key) {
|
|
@@ -15079,13 +15439,13 @@ function ws(e, t) {
|
|
|
15079
15439
|
}
|
|
15080
15440
|
return n;
|
|
15081
15441
|
}
|
|
15082
|
-
function
|
|
15442
|
+
function Ds(e, t) {
|
|
15083
15443
|
if (!e || !t) return {};
|
|
15084
15444
|
let n = {};
|
|
15085
15445
|
for (let [r, i] of Object.entries(e)) {
|
|
15086
15446
|
let e = t.entities[r];
|
|
15087
15447
|
if (!e) continue;
|
|
15088
|
-
let a =
|
|
15448
|
+
let a = Es(r, t), o = [];
|
|
15089
15449
|
for (let [t, n] of e.fields) n.required && !n.auto && !n.primary && !a.has(t) && o.push(t);
|
|
15090
15450
|
if (o.length !== 0) for (let e of i) {
|
|
15091
15451
|
if (e._deleted) continue;
|
|
@@ -15101,53 +15461,59 @@ function Ts(e, t) {
|
|
|
15101
15461
|
}
|
|
15102
15462
|
//#endregion
|
|
15103
15463
|
//#region src/components/pages/SmartDetailPage.tsx
|
|
15104
|
-
var
|
|
15105
|
-
function
|
|
15464
|
+
var Os = () => {};
|
|
15465
|
+
function ks(e, t) {
|
|
15106
15466
|
return e.length === t.length ? JSON.stringify(e) === JSON.stringify(t) : !1;
|
|
15107
15467
|
}
|
|
15108
|
-
function
|
|
15109
|
-
let { id: t } = S(), n = x(), [r, i] = C(), { data: a } = st(), o = qt((e) => e.user), c = a?.screens[e], u = c?.entity ? a?.entities[c.entity] : void 0, m = c?.entity, h =
|
|
15110
|
-
if (!
|
|
15111
|
-
|
|
15468
|
+
function As({ screenCode: e }) {
|
|
15469
|
+
let { id: t } = S(), n = x(), [r, i] = C(), { data: a } = st(), o = qt((e) => e.user), c = a?.screens[e], u = c?.entity ? a?.entities[c.entity] : void 0, m = c?.entity, h = (() => {
|
|
15470
|
+
if (!u) return !1;
|
|
15471
|
+
let e = u;
|
|
15472
|
+
if (!e.singleton || !e.prefilter) return !1;
|
|
15473
|
+
let t = Ve(u);
|
|
15474
|
+
return t.length === 1 ? e.prefilter[t[0]] === "$caller.user_id" : !1;
|
|
15475
|
+
})(), g = c?.self === !0 || h, _ = g ? o?.id : t, v = !g && _ === "new", y = d(() => {
|
|
15476
|
+
if (!_ || v) return;
|
|
15477
|
+
if (!u) return _;
|
|
15112
15478
|
let e = Ve(u);
|
|
15113
|
-
if (e.length === 1) return { [e[0]]:
|
|
15114
|
-
let t =
|
|
15479
|
+
if (e.length === 1) return { [e[0]]: _ };
|
|
15480
|
+
let t = _.split("|"), n = {};
|
|
15115
15481
|
for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
|
|
15116
15482
|
return n;
|
|
15117
15483
|
}, [
|
|
15118
|
-
g,
|
|
15119
15484
|
_,
|
|
15485
|
+
v,
|
|
15120
15486
|
u
|
|
15121
|
-
]),
|
|
15122
|
-
if (
|
|
15123
|
-
}, [
|
|
15487
|
+
]), w = d(() => {
|
|
15488
|
+
if (y) return typeof y == "string" ? y : Ue(y);
|
|
15489
|
+
}, [y]), { data: T, isLoading: E } = ro(m, y), D = Ki(m ?? ""), O = qi(m ?? ""), k = Ji(m ?? ""), A = Yi(m ?? ""), j = Object.keys(u?.status_groups ?? {}).length > 0, F = T?.data, I = F?.$statuses, ee = F?.$properties, L = r.get("edit") === "true", [R, te] = p(v || L), [ne, re] = p({}), [ie, ae] = p({}), [oe, se] = p({}), [ce, le] = p(void 0), [ue, de] = p(void 0), [fe, pe] = p({ show: !1 }), [me, he] = p(() => {
|
|
15124
15490
|
let e = parseInt(c?.sidebar_width || "380", 10);
|
|
15125
15491
|
return isNaN(e) ? 380 : e;
|
|
15126
|
-
}),
|
|
15492
|
+
}), z = f(null), V = f(null), U = s((e) => {
|
|
15127
15493
|
e.preventDefault();
|
|
15128
|
-
let t =
|
|
15494
|
+
let t = z.current;
|
|
15129
15495
|
if (!t) return;
|
|
15130
15496
|
let n = t.offsetWidth;
|
|
15131
|
-
|
|
15497
|
+
V.current = {
|
|
15132
15498
|
startX: e.clientX,
|
|
15133
15499
|
startW: n
|
|
15134
15500
|
};
|
|
15135
15501
|
let r = (e) => {
|
|
15136
|
-
if (!
|
|
15137
|
-
let n =
|
|
15502
|
+
if (!V.current) return;
|
|
15503
|
+
let n = V.current.startX - e.clientX, r = Math.max(280, Math.min(800, V.current.startW + n));
|
|
15138
15504
|
t.style.width = `${r}px`;
|
|
15139
15505
|
}, i = () => {
|
|
15140
|
-
|
|
15506
|
+
V.current && t && he(parseInt(t.style.width, 10) || V.current.startW), V.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
15141
15507
|
};
|
|
15142
15508
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
15143
|
-
}, []),
|
|
15509
|
+
}, []), W = T?.data, ge = W?.$refs, _e = !!u?.soft_delete, ve = _e && W != null && W[u.soft_delete] != null, ye = b(), { openTab: be, updateTabTitle: xe, findTabByPathname: Se } = jt();
|
|
15144
15510
|
l(() => {
|
|
15145
|
-
if (!u ||
|
|
15511
|
+
if (!u || g) return;
|
|
15146
15512
|
let e = ye.pathname, t = X(c?.display?.name) || X(u.display.name), n = c?.display?.icon || u.display.icon;
|
|
15147
15513
|
Se(e) || be({
|
|
15148
15514
|
pathname: e,
|
|
15149
15515
|
search: "",
|
|
15150
|
-
title:
|
|
15516
|
+
title: v ? `New ${t}` : t,
|
|
15151
15517
|
icon: n,
|
|
15152
15518
|
closable: !0
|
|
15153
15519
|
});
|
|
@@ -15157,36 +15523,36 @@ function Os({ screenCode: e }) {
|
|
|
15157
15523
|
u?.display.name?.en,
|
|
15158
15524
|
c?.display?.icon,
|
|
15159
15525
|
u?.display.icon,
|
|
15160
|
-
|
|
15161
|
-
|
|
15526
|
+
v,
|
|
15527
|
+
g
|
|
15162
15528
|
]), l(() => {
|
|
15163
|
-
if (!
|
|
15529
|
+
if (!W || !u || g) return;
|
|
15164
15530
|
let e = Se(ye.pathname);
|
|
15165
15531
|
if (e) {
|
|
15166
|
-
let t = u.display?.display_field, n = t ?
|
|
15532
|
+
let t = u.display?.display_field, n = t ? W[t] : void 0, r = n && typeof n == "object" && !Array.isArray(n) ? X(n) : n, i = r ? String(r) : X(c?.display?.name) || X(u.display.name);
|
|
15167
15533
|
xe(e.id, i);
|
|
15168
15534
|
}
|
|
15169
15535
|
}, [
|
|
15170
|
-
|
|
15536
|
+
W,
|
|
15171
15537
|
u?.display.name?.en,
|
|
15172
15538
|
u?.display.display_field,
|
|
15173
15539
|
ye.pathname,
|
|
15174
|
-
|
|
15540
|
+
g
|
|
15175
15541
|
]);
|
|
15176
|
-
let
|
|
15542
|
+
let G = d(() => {
|
|
15177
15543
|
if (!u) return /* @__PURE__ */ new Set();
|
|
15178
15544
|
let e = /* @__PURE__ */ new Set();
|
|
15179
15545
|
for (let [t, n] of u.fields) !n.auto && !n.primary && e.add(t);
|
|
15180
15546
|
return e;
|
|
15181
15547
|
}, [u]);
|
|
15182
15548
|
l(() => {
|
|
15183
|
-
if (!(!L || !
|
|
15184
|
-
if (R ||
|
|
15185
|
-
let e =
|
|
15186
|
-
|
|
15549
|
+
if (!(!L || !W || G.size === 0)) {
|
|
15550
|
+
if (R || te(!0), Object.keys(ne).length === 0) {
|
|
15551
|
+
let e = _ ? ja(_) : null, t = {};
|
|
15552
|
+
G.forEach((n) => {
|
|
15187
15553
|
let r = e ? e[n] : void 0;
|
|
15188
|
-
t[n] = r === void 0 ?
|
|
15189
|
-
}),
|
|
15554
|
+
t[n] = r === void 0 ? W[n] ?? "" : r;
|
|
15555
|
+
}), re(t);
|
|
15190
15556
|
}
|
|
15191
15557
|
i((e) => {
|
|
15192
15558
|
let t = new URLSearchParams(e);
|
|
@@ -15195,124 +15561,124 @@ function Os({ screenCode: e }) {
|
|
|
15195
15561
|
}
|
|
15196
15562
|
}, [
|
|
15197
15563
|
L,
|
|
15198
|
-
|
|
15199
|
-
|
|
15564
|
+
W,
|
|
15565
|
+
G
|
|
15200
15566
|
]), l(() => {
|
|
15201
|
-
!
|
|
15202
|
-
}, [
|
|
15203
|
-
let
|
|
15204
|
-
if (
|
|
15567
|
+
!v || !u?.children || u.children.length === 0 || ce === void 0 && (le({}), de({}));
|
|
15568
|
+
}, [v, u?.children]);
|
|
15569
|
+
let Ce = s(() => {
|
|
15570
|
+
if (W) {
|
|
15205
15571
|
let e = {};
|
|
15206
|
-
|
|
15207
|
-
e[t] =
|
|
15208
|
-
}),
|
|
15572
|
+
G.forEach((t) => {
|
|
15573
|
+
e[t] = W[t] ?? "";
|
|
15574
|
+
}), re(e);
|
|
15209
15575
|
}
|
|
15210
|
-
let e =
|
|
15576
|
+
let e = W?.$children;
|
|
15211
15577
|
if (e && Object.keys(e).length > 0) {
|
|
15212
15578
|
let t = {};
|
|
15213
15579
|
for (let [n, r] of Object.entries(e)) t[n] = r.map((e) => ({
|
|
15214
15580
|
...e,
|
|
15215
15581
|
_key: String(e.id ?? crypto.randomUUID())
|
|
15216
15582
|
}));
|
|
15217
|
-
|
|
15218
|
-
} else u?.children && u.children.length > 0 && (
|
|
15219
|
-
|
|
15583
|
+
le(t), de(e);
|
|
15584
|
+
} else u?.children && u.children.length > 0 && (le({}), de({}));
|
|
15585
|
+
te(!0);
|
|
15220
15586
|
}, [
|
|
15221
|
-
U,
|
|
15222
15587
|
W,
|
|
15588
|
+
G,
|
|
15223
15589
|
u?.children
|
|
15224
|
-
]),
|
|
15225
|
-
|
|
15590
|
+
]), K = s(() => {
|
|
15591
|
+
v ? n(c?.route?.replace("/:id", "") ?? "/") : (te(!1), re({}), ae({}), se({}), le(void 0), de(void 0));
|
|
15226
15592
|
}, [
|
|
15227
|
-
|
|
15593
|
+
v,
|
|
15228
15594
|
c,
|
|
15229
15595
|
n
|
|
15230
|
-
]),
|
|
15231
|
-
|
|
15596
|
+
]), we = s((e, t) => {
|
|
15597
|
+
re((n) => ({
|
|
15232
15598
|
...n,
|
|
15233
15599
|
[e]: t
|
|
15234
15600
|
}));
|
|
15235
|
-
}, []),
|
|
15601
|
+
}, []), q = d(() => {
|
|
15236
15602
|
if (!c?.route) return "/";
|
|
15237
15603
|
let e = c.route.split("/");
|
|
15238
15604
|
return e.pop(), e.join("/") || "/";
|
|
15239
|
-
}, [c]),
|
|
15605
|
+
}, [c]), J = d(() => !a?.screens || !q || q === "/" ? !1 : Object.values(a.screens).some((e) => e.route === q), [a, q]), Te = s(() => {
|
|
15240
15606
|
if (!m) return;
|
|
15241
15607
|
let e = {};
|
|
15242
|
-
if (
|
|
15243
|
-
else for (let [t, n] of Object.entries(
|
|
15244
|
-
let r =
|
|
15608
|
+
if (v) for (let [t, n] of Object.entries(ne)) n !== "" && n != null && (e[t] = n);
|
|
15609
|
+
else for (let [t, n] of Object.entries(ne)) {
|
|
15610
|
+
let r = W?.[t];
|
|
15245
15611
|
(n === "" ? null : n) !== (r === "" || r === void 0 ? null : r) && (e[t] = n);
|
|
15246
15612
|
}
|
|
15247
|
-
if (Object.keys(
|
|
15613
|
+
if (Object.keys(ie).length > 0 && (e.$statuses = Object.entries(ie).map(([e, t]) => ({
|
|
15248
15614
|
status_group_code: e,
|
|
15249
15615
|
status_code: t
|
|
15250
|
-
}))), Object.keys(
|
|
15616
|
+
}))), Object.keys(oe).length > 0 && (e.$properties = Object.entries(oe).map(([e, t]) => ({
|
|
15251
15617
|
property_code: e,
|
|
15252
15618
|
value: t
|
|
15253
|
-
}))),
|
|
15619
|
+
}))), ce) {
|
|
15254
15620
|
let t = {};
|
|
15255
|
-
for (let [e, n] of Object.entries(
|
|
15621
|
+
for (let [e, n] of Object.entries(ce)) {
|
|
15256
15622
|
let r = n.filter((e) => !e._deleted).map((e) => {
|
|
15257
15623
|
let { _key: t, _deleted: n, _dirty: r, ...i } = e;
|
|
15258
15624
|
return i;
|
|
15259
|
-
}), i =
|
|
15260
|
-
(
|
|
15625
|
+
}), i = ue?.[e] ?? [];
|
|
15626
|
+
(v || !ks(r, i)) && (t[e] = r);
|
|
15261
15627
|
}
|
|
15262
15628
|
Object.keys(t).length > 0 && (e.$children = t);
|
|
15263
15629
|
}
|
|
15264
|
-
if (!
|
|
15265
|
-
|
|
15630
|
+
if (!v && Object.keys(e).length === 0) {
|
|
15631
|
+
te(!1), ae({}), se({}), le(void 0), de(void 0);
|
|
15266
15632
|
return;
|
|
15267
15633
|
}
|
|
15268
15634
|
let t = () => {
|
|
15269
|
-
|
|
15635
|
+
te(!1), ae({}), se({}), le(void 0), de(void 0);
|
|
15270
15636
|
};
|
|
15271
|
-
|
|
15637
|
+
v ? D.mutate(e, { onSuccess: (e) => {
|
|
15272
15638
|
let r = e.data, i = Ue(u ? He(u, r) : {});
|
|
15273
|
-
n(i ? `${
|
|
15274
|
-
} }) :
|
|
15275
|
-
pkValues:
|
|
15639
|
+
n(i ? `${q}/${encodeURIComponent(i)}` : q, { replace: !0 }), t();
|
|
15640
|
+
} }) : y && O.mutate({
|
|
15641
|
+
pkValues: y,
|
|
15276
15642
|
data: e
|
|
15277
15643
|
}, { onSuccess: t });
|
|
15278
15644
|
}, [
|
|
15645
|
+
v,
|
|
15279
15646
|
_,
|
|
15280
|
-
g,
|
|
15281
15647
|
m,
|
|
15282
|
-
|
|
15283
|
-
|
|
15284
|
-
|
|
15285
|
-
|
|
15286
|
-
|
|
15287
|
-
E,
|
|
15648
|
+
ne,
|
|
15649
|
+
ie,
|
|
15650
|
+
oe,
|
|
15651
|
+
ce,
|
|
15652
|
+
ue,
|
|
15288
15653
|
D,
|
|
15654
|
+
O,
|
|
15289
15655
|
u,
|
|
15290
15656
|
n,
|
|
15291
|
-
|
|
15292
|
-
|
|
15293
|
-
]),
|
|
15294
|
-
|
|
15657
|
+
q,
|
|
15658
|
+
W
|
|
15659
|
+
]), Y = s((e, t) => {
|
|
15660
|
+
le((n) => ({
|
|
15295
15661
|
...n ?? {},
|
|
15296
15662
|
[e]: t
|
|
15297
15663
|
}));
|
|
15298
|
-
}, []),
|
|
15299
|
-
!
|
|
15664
|
+
}, []), Ee = s(() => {
|
|
15665
|
+
!y || v || k.mutate(y, { onSuccess: () => n(q, { replace: !0 }) });
|
|
15300
15666
|
}, [
|
|
15667
|
+
y,
|
|
15301
15668
|
v,
|
|
15302
|
-
|
|
15303
|
-
O,
|
|
15669
|
+
k,
|
|
15304
15670
|
n,
|
|
15305
|
-
|
|
15671
|
+
q
|
|
15306
15672
|
]), De = s(() => {
|
|
15307
|
-
!
|
|
15673
|
+
!y || v || A.mutate(y);
|
|
15308
15674
|
}, [
|
|
15675
|
+
y,
|
|
15309
15676
|
v,
|
|
15310
|
-
|
|
15311
|
-
|
|
15312
|
-
]), Oe = d(() => Ts(se, a), [se, a]), ke = Object.keys(Oe).length > 0;
|
|
15677
|
+
A
|
|
15678
|
+
]), Oe = d(() => Ds(ce, a), [ce, a]), ke = Object.keys(Oe).length > 0;
|
|
15313
15679
|
if (!c || !u) return null;
|
|
15314
|
-
if (!
|
|
15315
|
-
if (!
|
|
15680
|
+
if (!v && E) return /* @__PURE__ */ N(na, {});
|
|
15681
|
+
if (!v && !W) return /* @__PURE__ */ P("div", {
|
|
15316
15682
|
style: { padding: 24 },
|
|
15317
15683
|
children: [/* @__PURE__ */ P("div", {
|
|
15318
15684
|
style: {
|
|
@@ -15321,9 +15687,9 @@ function Os({ screenCode: e }) {
|
|
|
15321
15687
|
gap: 8,
|
|
15322
15688
|
marginBottom: 8
|
|
15323
15689
|
},
|
|
15324
|
-
children: [
|
|
15690
|
+
children: [J && /* @__PURE__ */ N(H, {
|
|
15325
15691
|
icon: /* @__PURE__ */ N(B.back, { size: 14 }),
|
|
15326
|
-
onClick: () => n(
|
|
15692
|
+
onClick: () => n(q),
|
|
15327
15693
|
title: "Back"
|
|
15328
15694
|
}), /* @__PURE__ */ N("h1", {
|
|
15329
15695
|
style: {
|
|
@@ -15339,27 +15705,27 @@ function Os({ screenCode: e }) {
|
|
|
15339
15705
|
children: "Record not found."
|
|
15340
15706
|
})]
|
|
15341
15707
|
});
|
|
15342
|
-
let Ae = u.display, je = X(c.display?.name) || X(Ae.name), Me = u.display?.display_field,
|
|
15708
|
+
let Ae = u.display, je = X(c.display?.name) || X(Ae.name), Me = u.display?.display_field, Ne = Me ? W?.[Me] : void 0, Pe = Ne && typeof Ne == "object" && !Array.isArray(Ne) ? X(Ne) : Ne, Fe = v ? `New ${je}` : Pe ? String(Pe) : je, Ie = D.isPending || O.isPending, Le = c.actions !== void 0, Re = Le ? la(u.actions, c.actions, "detail", a?.actions) : ca(u.actions, "detail"), ze = {
|
|
15343
15709
|
schema: a,
|
|
15344
15710
|
entity: u,
|
|
15345
15711
|
entityCode: m,
|
|
15346
|
-
recordId:
|
|
15712
|
+
recordId: w ?? _ ?? "",
|
|
15347
15713
|
record: R ? {
|
|
15348
|
-
...
|
|
15349
|
-
...
|
|
15350
|
-
} :
|
|
15351
|
-
isNew:
|
|
15714
|
+
...W ?? {},
|
|
15715
|
+
...ne
|
|
15716
|
+
} : W ?? {},
|
|
15717
|
+
isNew: v,
|
|
15352
15718
|
mode: R ? "edit" : "display",
|
|
15353
|
-
onFieldChange: R ?
|
|
15719
|
+
onFieldChange: R ? we : void 0,
|
|
15354
15720
|
refs: ge,
|
|
15355
15721
|
objectProperties: (() => {
|
|
15356
|
-
let e =
|
|
15357
|
-
if (!R || Object.keys(
|
|
15358
|
-
let t = e.map((e) =>
|
|
15722
|
+
let e = ee ?? [];
|
|
15723
|
+
if (!R || Object.keys(oe).length === 0) return e.length > 0 ? e : void 0;
|
|
15724
|
+
let t = e.map((e) => oe[e.property_code] === void 0 ? e : {
|
|
15359
15725
|
...e,
|
|
15360
|
-
value:
|
|
15726
|
+
value: oe[e.property_code]
|
|
15361
15727
|
});
|
|
15362
|
-
for (let [n, r] of Object.entries(
|
|
15728
|
+
for (let [n, r] of Object.entries(oe)) e.some((e) => e.property_code === n) || t.push({
|
|
15363
15729
|
property_code: n,
|
|
15364
15730
|
name: {},
|
|
15365
15731
|
type: "string",
|
|
@@ -15367,19 +15733,19 @@ function Os({ screenCode: e }) {
|
|
|
15367
15733
|
});
|
|
15368
15734
|
return t;
|
|
15369
15735
|
})(),
|
|
15370
|
-
onSetProperty:
|
|
15736
|
+
onSetProperty: v || u?.readonly ? void 0 : R ? (e, t) => se((n) => ({
|
|
15371
15737
|
...n,
|
|
15372
15738
|
[e]: t
|
|
15373
15739
|
})) : void 0,
|
|
15374
15740
|
isPropertyPending: !1,
|
|
15375
15741
|
objectStatuses: (() => {
|
|
15376
|
-
let e =
|
|
15377
|
-
if (!R || Object.keys(
|
|
15378
|
-
let t = e.map((e) =>
|
|
15742
|
+
let e = I ?? [];
|
|
15743
|
+
if (!R || Object.keys(ie).length === 0) return e.length > 0 ? e : void 0;
|
|
15744
|
+
let t = e.map((e) => ie[e.group_code] === void 0 ? e : {
|
|
15379
15745
|
...e,
|
|
15380
|
-
status_code:
|
|
15746
|
+
status_code: ie[e.group_code]
|
|
15381
15747
|
});
|
|
15382
|
-
for (let [n, r] of Object.entries(
|
|
15748
|
+
for (let [n, r] of Object.entries(ie)) e.some((e) => e.group_code === n) || t.push({
|
|
15383
15749
|
group_code: n,
|
|
15384
15750
|
status_code: r,
|
|
15385
15751
|
status_name: {},
|
|
@@ -15387,44 +15753,44 @@ function Os({ screenCode: e }) {
|
|
|
15387
15753
|
});
|
|
15388
15754
|
return t;
|
|
15389
15755
|
})(),
|
|
15390
|
-
onSetStatus:
|
|
15756
|
+
onSetStatus: v || u?.readonly ? void 0 : R ? (e, t) => ae((n) => ({
|
|
15391
15757
|
...n,
|
|
15392
15758
|
[e]: t
|
|
15393
15759
|
})) : void 0,
|
|
15394
15760
|
isStatusPending: !1,
|
|
15395
|
-
pendingChildren: R ?
|
|
15396
|
-
onChildrenChange: R ?
|
|
15761
|
+
pendingChildren: R ? ce : void 0,
|
|
15762
|
+
onChildrenChange: R ? Y : void 0,
|
|
15397
15763
|
childValidationErrors: R ? Oe : void 0
|
|
15398
|
-
},
|
|
15399
|
-
title:
|
|
15400
|
-
recordId:
|
|
15764
|
+
}, Be = c.sidebar && c.sidebar.length > 0, We = /* @__PURE__ */ N(js, {
|
|
15765
|
+
title: Fe,
|
|
15766
|
+
recordId: _,
|
|
15401
15767
|
editing: R,
|
|
15402
|
-
isNew:
|
|
15403
|
-
isSelf: !!
|
|
15768
|
+
isNew: v,
|
|
15769
|
+
isSelf: !!g,
|
|
15404
15770
|
isRecordDeleted: ve,
|
|
15405
15771
|
dirty: R,
|
|
15406
|
-
isSaving:
|
|
15772
|
+
isSaving: Ie,
|
|
15407
15773
|
hasChildErrors: ke,
|
|
15408
15774
|
canEdit: !u?.readonly,
|
|
15409
|
-
canDelete: !
|
|
15410
|
-
hasExplicitActions:
|
|
15411
|
-
headerActions:
|
|
15775
|
+
canDelete: !v && !g && !u?.readonly,
|
|
15776
|
+
hasExplicitActions: Le,
|
|
15777
|
+
headerActions: Re,
|
|
15412
15778
|
entityCode: m,
|
|
15413
|
-
record:
|
|
15414
|
-
id:
|
|
15415
|
-
listRoute:
|
|
15416
|
-
listRouteExists: !!
|
|
15417
|
-
onBack: () => n(
|
|
15418
|
-
onCancelEdit:
|
|
15419
|
-
onSave:
|
|
15420
|
-
onStartEdit:
|
|
15421
|
-
onRequestDelete: (e) =>
|
|
15779
|
+
record: W,
|
|
15780
|
+
id: _,
|
|
15781
|
+
listRoute: q,
|
|
15782
|
+
listRouteExists: !!J,
|
|
15783
|
+
onBack: () => n(J ? q : "/"),
|
|
15784
|
+
onCancelEdit: K,
|
|
15785
|
+
onSave: Te,
|
|
15786
|
+
onStartEdit: Ce,
|
|
15787
|
+
onRequestDelete: (e) => pe({
|
|
15422
15788
|
show: !0,
|
|
15423
15789
|
confirmation: e
|
|
15424
15790
|
}),
|
|
15425
15791
|
onRestore: De,
|
|
15426
|
-
isRestoring:
|
|
15427
|
-
}),
|
|
15792
|
+
isRestoring: A.isPending
|
|
15793
|
+
}), Ge = ve && /* @__PURE__ */ P("div", {
|
|
15428
15794
|
style: {
|
|
15429
15795
|
display: "flex",
|
|
15430
15796
|
alignItems: "center",
|
|
@@ -15437,31 +15803,31 @@ function Os({ screenCode: e }) {
|
|
|
15437
15803
|
color: "var(--danger)",
|
|
15438
15804
|
fontSize: 12.5
|
|
15439
15805
|
},
|
|
15440
|
-
children: [/* @__PURE__ */ N(B.warning, { size: 14 }), /* @__PURE__ */ P("span", { children: ["This record was deleted on ", no(String(
|
|
15441
|
-
}),
|
|
15806
|
+
children: [/* @__PURE__ */ N(B.warning, { size: 14 }), /* @__PURE__ */ P("span", { children: ["This record was deleted on ", no(String(W[u.soft_delete]))] })]
|
|
15807
|
+
}), Ke = j && !v && !(c.items && c.items.length > 0) && /* @__PURE__ */ N("div", {
|
|
15442
15808
|
className: "mb-4",
|
|
15443
|
-
children: /* @__PURE__ */ N(
|
|
15809
|
+
children: /* @__PURE__ */ N(xs, {
|
|
15444
15810
|
statusGroups: u.status_groups ?? {},
|
|
15445
|
-
objectStatuses:
|
|
15446
|
-
onSetStatus: u?.readonly ?
|
|
15811
|
+
objectStatuses: ze.objectStatuses,
|
|
15812
|
+
onSetStatus: u?.readonly ? Os : R ? (e, t) => ae((n) => ({
|
|
15447
15813
|
...n,
|
|
15448
15814
|
[e]: t
|
|
15449
|
-
})) :
|
|
15815
|
+
})) : Os,
|
|
15450
15816
|
isPending: !1,
|
|
15451
15817
|
mode: R && !u?.readonly ? "edit" : "display"
|
|
15452
15818
|
})
|
|
15453
|
-
}),
|
|
15454
|
-
c.items && c.items.length > 0 && (
|
|
15819
|
+
}), qe = /* @__PURE__ */ P(M, { children: [
|
|
15820
|
+
c.items && c.items.length > 0 && (W || v) && a && /* @__PURE__ */ N(ws, {
|
|
15455
15821
|
nodes: c.items,
|
|
15456
|
-
ctx:
|
|
15822
|
+
ctx: ze
|
|
15457
15823
|
}),
|
|
15458
|
-
!
|
|
15824
|
+
!v && _ && m && u.associations && Object.keys(u.associations).length > 0 && a && /* @__PURE__ */ N(io, {
|
|
15459
15825
|
entityCode: m,
|
|
15460
|
-
recordId:
|
|
15826
|
+
recordId: w ?? _ ?? "",
|
|
15461
15827
|
associations: u.associations,
|
|
15462
15828
|
schema: a
|
|
15463
15829
|
}),
|
|
15464
|
-
!
|
|
15830
|
+
!v && W && /* @__PURE__ */ P("div", {
|
|
15465
15831
|
style: {
|
|
15466
15832
|
display: "flex",
|
|
15467
15833
|
gap: 24,
|
|
@@ -15469,18 +15835,18 @@ function Os({ screenCode: e }) {
|
|
|
15469
15835
|
fontSize: 11.5,
|
|
15470
15836
|
color: "var(--text-3)"
|
|
15471
15837
|
},
|
|
15472
|
-
children: [
|
|
15838
|
+
children: [W.created_at != null && /* @__PURE__ */ P("span", { children: ["Created: ", no(String(W.created_at))] }), W.updated_at != null && /* @__PURE__ */ P("span", { children: ["Updated: ", no(String(W.updated_at))] })]
|
|
15473
15839
|
})
|
|
15474
|
-
] }),
|
|
15475
|
-
open:
|
|
15476
|
-
onOpenChange: (e) => !e &&
|
|
15840
|
+
] }), Je = /* @__PURE__ */ N(ra, {
|
|
15841
|
+
open: fe.show,
|
|
15842
|
+
onOpenChange: (e) => !e && pe({ show: !1 }),
|
|
15477
15843
|
title: `Delete ${je}`,
|
|
15478
|
-
description:
|
|
15844
|
+
description: fe.confirmation ? fe.confirmation : _e ? `Are you sure you want to delete this ${je.toLowerCase()}? It can be restored later by an admin.` : `Are you sure you want to delete this ${je.toLowerCase()}? This action cannot be undone.`,
|
|
15479
15845
|
confirmLabel: "Delete",
|
|
15480
|
-
onConfirm:
|
|
15846
|
+
onConfirm: Ee,
|
|
15481
15847
|
destructive: !0
|
|
15482
15848
|
});
|
|
15483
|
-
return
|
|
15849
|
+
return Be ? /* @__PURE__ */ P("div", {
|
|
15484
15850
|
style: {
|
|
15485
15851
|
height: "100%",
|
|
15486
15852
|
display: "flex",
|
|
@@ -15502,9 +15868,9 @@ function Os({ screenCode: e }) {
|
|
|
15502
15868
|
padding: "14px 20px 8px"
|
|
15503
15869
|
},
|
|
15504
15870
|
children: [
|
|
15505
|
-
Be,
|
|
15506
15871
|
We,
|
|
15507
|
-
Ge
|
|
15872
|
+
Ge,
|
|
15873
|
+
Ke
|
|
15508
15874
|
]
|
|
15509
15875
|
}), /* @__PURE__ */ N("div", {
|
|
15510
15876
|
style: {
|
|
@@ -15516,7 +15882,7 @@ function Os({ screenCode: e }) {
|
|
|
15516
15882
|
flexDirection: "column",
|
|
15517
15883
|
gap: 16
|
|
15518
15884
|
},
|
|
15519
|
-
children:
|
|
15885
|
+
children: qe
|
|
15520
15886
|
})]
|
|
15521
15887
|
}),
|
|
15522
15888
|
/* @__PURE__ */ N("div", {
|
|
@@ -15527,7 +15893,7 @@ function Os({ screenCode: e }) {
|
|
|
15527
15893
|
background: "var(--border)",
|
|
15528
15894
|
transition: "background 120ms"
|
|
15529
15895
|
},
|
|
15530
|
-
onMouseDown:
|
|
15896
|
+
onMouseDown: U,
|
|
15531
15897
|
onMouseEnter: (e) => {
|
|
15532
15898
|
e.currentTarget.style.background = "var(--accent)";
|
|
15533
15899
|
},
|
|
@@ -15536,18 +15902,18 @@ function Os({ screenCode: e }) {
|
|
|
15536
15902
|
}
|
|
15537
15903
|
}),
|
|
15538
15904
|
/* @__PURE__ */ N("div", {
|
|
15539
|
-
ref:
|
|
15905
|
+
ref: z,
|
|
15540
15906
|
style: {
|
|
15541
15907
|
flexShrink: 0,
|
|
15542
15908
|
height: "100%",
|
|
15543
|
-
width: `${
|
|
15909
|
+
width: `${me}px`
|
|
15544
15910
|
},
|
|
15545
|
-
children: (
|
|
15911
|
+
children: (W || v) && a && /* @__PURE__ */ N(ws, {
|
|
15546
15912
|
nodes: c.sidebar,
|
|
15547
|
-
ctx:
|
|
15913
|
+
ctx: ze
|
|
15548
15914
|
})
|
|
15549
15915
|
}),
|
|
15550
|
-
|
|
15916
|
+
Je
|
|
15551
15917
|
]
|
|
15552
15918
|
}) : /* @__PURE__ */ P("div", {
|
|
15553
15919
|
style: {
|
|
@@ -15561,24 +15927,24 @@ function Os({ screenCode: e }) {
|
|
|
15561
15927
|
/* @__PURE__ */ P("div", {
|
|
15562
15928
|
className: "shrink-0 px-6 pt-6 pb-2",
|
|
15563
15929
|
children: [
|
|
15564
|
-
Be,
|
|
15565
15930
|
We,
|
|
15566
|
-
Ge
|
|
15931
|
+
Ge,
|
|
15932
|
+
Ke
|
|
15567
15933
|
]
|
|
15568
15934
|
}),
|
|
15569
15935
|
/* @__PURE__ */ N("div", {
|
|
15570
15936
|
className: "flex-1 min-h-0 overflow-y-auto px-6 pb-6 space-y-4",
|
|
15571
|
-
children:
|
|
15937
|
+
children: qe
|
|
15572
15938
|
}),
|
|
15573
|
-
|
|
15939
|
+
Je
|
|
15574
15940
|
]
|
|
15575
15941
|
});
|
|
15576
15942
|
}
|
|
15577
|
-
function
|
|
15578
|
-
let E = f(null), [D, O] = p(!1), { run: k } = Jr(), A = m.filter(({ action: e }) => e.type !== "edit" && e.type !== "delete"), j = A.filter(({ action: e }) => e.primary).slice(0, 2), F = A.filter((e) => !j.includes(e)), I = m.find(({ action: e }) => e.type === "edit"),
|
|
15943
|
+
function js({ title: e, recordId: t, editing: n, isNew: r, isSelf: i, isRecordDeleted: a, dirty: o, isSaving: s, hasChildErrors: c, canEdit: l, canDelete: u, hasExplicitActions: d, headerActions: m, entityCode: h, record: g, id: _, listRouteExists: v, onBack: y, onCancelEdit: b, onSave: x, onStartEdit: S, onRequestDelete: C, onRestore: w, isRestoring: T }) {
|
|
15944
|
+
let E = f(null), [D, O] = p(!1), { run: k } = Jr(), A = m.filter(({ action: e }) => e.type !== "edit" && e.type !== "delete"), j = A.filter(({ action: e }) => e.primary).slice(0, 2), F = A.filter((e) => !j.includes(e)), I = m.find(({ action: e }) => e.type === "edit"), ee = m.find(({ action: e }) => e.type === "delete"), L = (e) => {
|
|
15579
15945
|
let t = e.display?.icon, n = t && B[t] ? B[t] : void 0;
|
|
15580
15946
|
return n ? /* @__PURE__ */ N(n, { size: 13 }) : null;
|
|
15581
|
-
},
|
|
15947
|
+
}, R = (e, t) => {
|
|
15582
15948
|
let n = _ ? [_] : [], r = t.entity ? `${t.entity}.${e}` : e;
|
|
15583
15949
|
k({
|
|
15584
15950
|
action: t,
|
|
@@ -15627,7 +15993,7 @@ function ks({ title: e, recordId: t, editing: n, isNew: r, isSelf: i, isRecordDe
|
|
|
15627
15993
|
maxWidth: "100%"
|
|
15628
15994
|
},
|
|
15629
15995
|
children: e
|
|
15630
|
-
}), t && /* @__PURE__ */ N(
|
|
15996
|
+
}), t && /* @__PURE__ */ N(Se, { value: t })]
|
|
15631
15997
|
})
|
|
15632
15998
|
}),
|
|
15633
15999
|
/* @__PURE__ */ N("div", {
|
|
@@ -15640,7 +16006,7 @@ function ks({ title: e, recordId: t, editing: n, isNew: r, isSelf: i, isRecordDe
|
|
|
15640
16006
|
},
|
|
15641
16007
|
children: a ? /* @__PURE__ */ N(V, {
|
|
15642
16008
|
kind: "primary",
|
|
15643
|
-
icon: N(T ?
|
|
16009
|
+
icon: N(T ? q : B.refresh, { size: 13 }),
|
|
15644
16010
|
onClick: w,
|
|
15645
16011
|
disabled: T,
|
|
15646
16012
|
children: T ? "Restoring…" : "Restore"
|
|
@@ -15664,7 +16030,7 @@ function ks({ title: e, recordId: t, editing: n, isNew: r, isSelf: i, isRecordDe
|
|
|
15664
16030
|
}),
|
|
15665
16031
|
/* @__PURE__ */ N(V, {
|
|
15666
16032
|
kind: "primary",
|
|
15667
|
-
icon: N(s ?
|
|
16033
|
+
icon: N(s ? q : B.save, { size: 13 }),
|
|
15668
16034
|
onClick: x,
|
|
15669
16035
|
disabled: s || c,
|
|
15670
16036
|
title: c ? "Fix errors in child rows" : void 0,
|
|
@@ -15672,9 +16038,9 @@ function ks({ title: e, recordId: t, editing: n, isNew: r, isSelf: i, isRecordDe
|
|
|
15672
16038
|
})
|
|
15673
16039
|
] }) : /* @__PURE__ */ P(M, { children: [
|
|
15674
16040
|
!r && _ && j.map(({ code: e, action: t }) => !g || ia(t.conditions, g) ? /* @__PURE__ */ N(V, {
|
|
15675
|
-
icon:
|
|
16041
|
+
icon: L(t),
|
|
15676
16042
|
danger: t.destructive,
|
|
15677
|
-
onClick: () =>
|
|
16043
|
+
onClick: () => R(e, t),
|
|
15678
16044
|
children: X(t.display?.name) || e
|
|
15679
16045
|
}, e) : null),
|
|
15680
16046
|
F.length > 0 && /* @__PURE__ */ P("div", {
|
|
@@ -15689,7 +16055,7 @@ function ks({ title: e, recordId: t, editing: n, isNew: r, isSelf: i, isRecordDe
|
|
|
15689
16055
|
onClick: () => O(!D),
|
|
15690
16056
|
active: D,
|
|
15691
16057
|
children: "Actions"
|
|
15692
|
-
}), /* @__PURE__ */ N(
|
|
16058
|
+
}), /* @__PURE__ */ N(_e, {
|
|
15693
16059
|
open: D,
|
|
15694
16060
|
anchor: E.current,
|
|
15695
16061
|
onClose: () => O(!1),
|
|
@@ -15698,11 +16064,11 @@ function ks({ title: e, recordId: t, editing: n, isNew: r, isSelf: i, isRecordDe
|
|
|
15698
16064
|
children: F.map(({ code: e, action: t }) => {
|
|
15699
16065
|
let n = !(!g || ia(t.conditions, g));
|
|
15700
16066
|
return /* @__PURE__ */ N(K, {
|
|
15701
|
-
icon:
|
|
16067
|
+
icon: L(t),
|
|
15702
16068
|
danger: t.destructive,
|
|
15703
16069
|
active: n,
|
|
15704
16070
|
onClick: () => {
|
|
15705
|
-
n || (O(!1),
|
|
16071
|
+
n || (O(!1), R(e, t));
|
|
15706
16072
|
},
|
|
15707
16073
|
children: X(t.display?.name) || e
|
|
15708
16074
|
}, e);
|
|
@@ -15726,13 +16092,13 @@ function ks({ title: e, recordId: t, editing: n, isNew: r, isSelf: i, isRecordDe
|
|
|
15726
16092
|
onClick: S,
|
|
15727
16093
|
children: "Edit"
|
|
15728
16094
|
})] }),
|
|
15729
|
-
u && (
|
|
16095
|
+
u && (ee ? /* @__PURE__ */ N(V, {
|
|
15730
16096
|
kind: "ghost",
|
|
15731
16097
|
icon: /* @__PURE__ */ N(B.trash, { size: 13 }),
|
|
15732
16098
|
danger: !0,
|
|
15733
|
-
disabled: g ? !ia(
|
|
15734
|
-
onClick: () => C(X(
|
|
15735
|
-
children: X(
|
|
16099
|
+
disabled: g ? !ia(ee.action.conditions, g) : !1,
|
|
16100
|
+
onClick: () => C(X(ee.action.confirmation) || void 0),
|
|
16101
|
+
children: X(ee.action.display?.name) || "Delete"
|
|
15736
16102
|
}) : d ? null : /* @__PURE__ */ N(V, {
|
|
15737
16103
|
kind: "ghost",
|
|
15738
16104
|
icon: /* @__PURE__ */ N(B.trash, { size: 13 }),
|
|
@@ -15746,7 +16112,7 @@ function ks({ title: e, recordId: t, editing: n, isNew: r, isSelf: i, isRecordDe
|
|
|
15746
16112
|
}
|
|
15747
16113
|
//#endregion
|
|
15748
16114
|
//#region src/api/status.ts
|
|
15749
|
-
async function
|
|
16115
|
+
async function Ms(e, t, n, r, i) {
|
|
15750
16116
|
let a = {
|
|
15751
16117
|
status_group_code: n,
|
|
15752
16118
|
status_code: r
|
|
@@ -15763,10 +16129,10 @@ async function As(e, t, n, r, i) {
|
|
|
15763
16129
|
}
|
|
15764
16130
|
//#endregion
|
|
15765
16131
|
//#region src/hooks/useObjectStatus.ts
|
|
15766
|
-
function
|
|
16132
|
+
function Ns(e, t) {
|
|
15767
16133
|
let n = k();
|
|
15768
16134
|
return D({
|
|
15769
|
-
mutationFn: ({ groupCode: n, statusCode: r, note: i }) =>
|
|
16135
|
+
mutationFn: ({ groupCode: n, statusCode: r, note: i }) => Ms(e, t, n, r, i),
|
|
15770
16136
|
onSuccess: () => {
|
|
15771
16137
|
n.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
15772
16138
|
},
|
|
@@ -15777,7 +16143,7 @@ function js(e, t) {
|
|
|
15777
16143
|
}
|
|
15778
16144
|
//#endregion
|
|
15779
16145
|
//#region src/api/properties.ts
|
|
15780
|
-
async function
|
|
16146
|
+
async function Ps(e, t, n, r) {
|
|
15781
16147
|
let i = (await Z(`/api/data/${e}`, {
|
|
15782
16148
|
method: "PATCH",
|
|
15783
16149
|
body: JSON.stringify([{
|
|
@@ -15790,7 +16156,7 @@ async function Ms(e, t, n, r) {
|
|
|
15790
16156
|
}))[0]?.$properties ?? [];
|
|
15791
16157
|
return i.find((e) => e.property_code === n) ?? i[0];
|
|
15792
16158
|
}
|
|
15793
|
-
async function
|
|
16159
|
+
async function Fs(e, t, n) {
|
|
15794
16160
|
await Z(`/api/data/${e}`, {
|
|
15795
16161
|
method: "PATCH",
|
|
15796
16162
|
body: JSON.stringify([{
|
|
@@ -15804,10 +16170,10 @@ async function Ns(e, t, n) {
|
|
|
15804
16170
|
}
|
|
15805
16171
|
//#endregion
|
|
15806
16172
|
//#region src/hooks/useProperties.ts
|
|
15807
|
-
function
|
|
16173
|
+
function Is(e, t) {
|
|
15808
16174
|
let n = k();
|
|
15809
16175
|
return D({
|
|
15810
|
-
mutationFn: ({ propertyCode: n, value: r }) =>
|
|
16176
|
+
mutationFn: ({ propertyCode: n, value: r }) => Ps(e, t, n, r),
|
|
15811
16177
|
onSuccess: () => {
|
|
15812
16178
|
n.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
15813
16179
|
},
|
|
@@ -15816,10 +16182,10 @@ function Ps(e, t) {
|
|
|
15816
16182
|
}
|
|
15817
16183
|
});
|
|
15818
16184
|
}
|
|
15819
|
-
function
|
|
16185
|
+
function Ls(e, t) {
|
|
15820
16186
|
let n = k();
|
|
15821
16187
|
return D({
|
|
15822
|
-
mutationFn: (n) =>
|
|
16188
|
+
mutationFn: (n) => Fs(e, t, n),
|
|
15823
16189
|
onSuccess: () => {
|
|
15824
16190
|
n.invalidateQueries({ queryKey: ["entity-item", e] });
|
|
15825
16191
|
},
|
|
@@ -15830,7 +16196,7 @@ function Fs(e, t) {
|
|
|
15830
16196
|
}
|
|
15831
16197
|
//#endregion
|
|
15832
16198
|
//#region src/components/pages/SmartRecordListPage.tsx
|
|
15833
|
-
function
|
|
16199
|
+
function Rs({ screenCode: e }) {
|
|
15834
16200
|
let [t, n] = C(), { data: r } = st(), i = r?.screens[e], a = i?.entity ? r?.entities[i.entity] : void 0, o = i?.entity, { openTab: c } = jt();
|
|
15835
16201
|
l(() => {
|
|
15836
16202
|
if (i?.route && a) {
|
|
@@ -15907,7 +16273,7 @@ function Is({ screenCode: e }) {
|
|
|
15907
16273
|
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), F.current = i;
|
|
15908
16274
|
}, [k]);
|
|
15909
16275
|
if (!r || !i || !a) return null;
|
|
15910
|
-
let
|
|
16276
|
+
let ee = i.columns ?? a.fields.names().filter((e) => !a.fields.get(e)?.primary && !a.fields.get(e)?.auto && a.fields.get(e)?.display?.is_listable !== !1).slice(0, 4), L = _?.length ?? 0;
|
|
15911
16277
|
return /* @__PURE__ */ P("div", {
|
|
15912
16278
|
ref: O,
|
|
15913
16279
|
style: {
|
|
@@ -15934,7 +16300,7 @@ function Is({ screenCode: e }) {
|
|
|
15934
16300
|
borderBottom: "1px solid var(--divider)"
|
|
15935
16301
|
},
|
|
15936
16302
|
children: [
|
|
15937
|
-
/* @__PURE__ */ N(
|
|
16303
|
+
/* @__PURE__ */ N(Y, {
|
|
15938
16304
|
value: m,
|
|
15939
16305
|
onChange: T,
|
|
15940
16306
|
placeholder: `Search ${X(a.display.name_plural)}…`,
|
|
@@ -15952,7 +16318,7 @@ function Is({ screenCode: e }) {
|
|
|
15952
16318
|
let n = _?.find((t) => t.field === e && t.op === "eq")?.value ?? "__all__", i = ze(t, e, r.entities);
|
|
15953
16319
|
return /* @__PURE__ */ N("div", {
|
|
15954
16320
|
style: { minWidth: 120 },
|
|
15955
|
-
children: /* @__PURE__ */ N(
|
|
16321
|
+
children: /* @__PURE__ */ N(De, {
|
|
15956
16322
|
value: n,
|
|
15957
16323
|
options: [{
|
|
15958
16324
|
value: "__all__",
|
|
@@ -15975,7 +16341,7 @@ function Is({ screenCode: e }) {
|
|
|
15975
16341
|
fontSize: 11,
|
|
15976
16342
|
color: "var(--text-3)"
|
|
15977
16343
|
},
|
|
15978
|
-
children: [/* @__PURE__ */ N("span", { children: y ? "Loading…" : `${b.length} ${X(a.display.name_plural)}` }),
|
|
16344
|
+
children: [/* @__PURE__ */ N("span", { children: y ? "Loading…" : `${b.length} ${X(a.display.name_plural)}` }), L > 0 && /* @__PURE__ */ N("button", {
|
|
15979
16345
|
onClick: () => n((e) => {
|
|
15980
16346
|
let t = new URLSearchParams(e);
|
|
15981
16347
|
return t.delete("filters"), t;
|
|
@@ -16018,10 +16384,10 @@ function Is({ screenCode: e }) {
|
|
|
16018
16384
|
color: "var(--text-3)"
|
|
16019
16385
|
},
|
|
16020
16386
|
children: "No records found"
|
|
16021
|
-
}) : b.map((e) => /* @__PURE__ */ N(
|
|
16387
|
+
}) : b.map((e) => /* @__PURE__ */ N(zs, {
|
|
16022
16388
|
record: e,
|
|
16023
16389
|
entity: a,
|
|
16024
|
-
columns:
|
|
16390
|
+
columns: ee,
|
|
16025
16391
|
pkField: S,
|
|
16026
16392
|
refs: x,
|
|
16027
16393
|
isSelected: e[S] === u,
|
|
@@ -16047,7 +16413,7 @@ function Is({ screenCode: e }) {
|
|
|
16047
16413
|
minWidth: 0,
|
|
16048
16414
|
overflow: "hidden"
|
|
16049
16415
|
},
|
|
16050
|
-
children: u ? /* @__PURE__ */ N(
|
|
16416
|
+
children: u ? /* @__PURE__ */ N(Bs, {
|
|
16051
16417
|
entityCode: o,
|
|
16052
16418
|
recordId: u,
|
|
16053
16419
|
items: i.items,
|
|
@@ -16074,7 +16440,7 @@ function Is({ screenCode: e }) {
|
|
|
16074
16440
|
]
|
|
16075
16441
|
});
|
|
16076
16442
|
}
|
|
16077
|
-
function
|
|
16443
|
+
function zs({ record: e, entity: t, columns: n, refs: r, isSelected: i, onClick: a }) {
|
|
16078
16444
|
let o = n[0], s = n[1], c = n.slice(2, 4);
|
|
16079
16445
|
return /* @__PURE__ */ P("button", {
|
|
16080
16446
|
onClick: a,
|
|
@@ -16161,8 +16527,8 @@ function Ls({ record: e, entity: t, columns: n, refs: r, isSelected: i, onClick:
|
|
|
16161
16527
|
})]
|
|
16162
16528
|
});
|
|
16163
16529
|
}
|
|
16164
|
-
function
|
|
16165
|
-
let { data: a, isLoading: o } = ro(e, t), c = qi(e), [l, u] = p(!1), [f, m] = p({}), h = a?.data, g = h?.$statuses, _ = h?.$properties, v =
|
|
16530
|
+
function Bs({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
|
|
16531
|
+
let { data: a, isLoading: o } = ro(e, t), c = qi(e), [l, u] = p(!1), [f, m] = p({}), h = a?.data, g = h?.$statuses, _ = h?.$properties, v = Ns(e, t), y = Is(e, t), b = d(() => {
|
|
16166
16532
|
let e = /* @__PURE__ */ new Set();
|
|
16167
16533
|
for (let [t, n] of i.fields) !n.auto && !n.primary && e.add(t);
|
|
16168
16534
|
return e;
|
|
@@ -16267,7 +16633,7 @@ function Rs({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
|
|
|
16267
16633
|
}), /* @__PURE__ */ N(V, {
|
|
16268
16634
|
kind: "primary",
|
|
16269
16635
|
size: "xs",
|
|
16270
|
-
icon: c.isPending ? /* @__PURE__ */ N(
|
|
16636
|
+
icon: c.isPending ? /* @__PURE__ */ N(q, { size: 12 }) : /* @__PURE__ */ N(B.save, { size: 12 }),
|
|
16271
16637
|
onClick: C,
|
|
16272
16638
|
disabled: c.isPending,
|
|
16273
16639
|
children: c.isPending ? "Saving…" : "Save"
|
|
@@ -16287,7 +16653,7 @@ function Rs({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
|
|
|
16287
16653
|
flexDirection: "column",
|
|
16288
16654
|
gap: 12
|
|
16289
16655
|
},
|
|
16290
|
-
children: n && n.length > 0 ? /* @__PURE__ */ N(
|
|
16656
|
+
children: n && n.length > 0 ? /* @__PURE__ */ N(ws, {
|
|
16291
16657
|
nodes: n,
|
|
16292
16658
|
ctx: k
|
|
16293
16659
|
}) : /* @__PURE__ */ P("p", {
|
|
@@ -16306,7 +16672,7 @@ function Rs({ entityCode: e, recordId: t, items: n, schema: r, entity: i }) {
|
|
|
16306
16672
|
}
|
|
16307
16673
|
//#endregion
|
|
16308
16674
|
//#region src/components/shared/ErrorBoundary.tsx
|
|
16309
|
-
var
|
|
16675
|
+
var Vs = class extends e {
|
|
16310
16676
|
constructor(e) {
|
|
16311
16677
|
super(e), this.state = {
|
|
16312
16678
|
hasError: !1,
|
|
@@ -16371,20 +16737,20 @@ var zs = class extends e {
|
|
|
16371
16737
|
})
|
|
16372
16738
|
}) : this.props.children;
|
|
16373
16739
|
}
|
|
16374
|
-
},
|
|
16375
|
-
function
|
|
16376
|
-
|
|
16740
|
+
}, Hs = /* @__PURE__ */ new Map();
|
|
16741
|
+
function Us(e, t) {
|
|
16742
|
+
Hs.set(e, t);
|
|
16377
16743
|
}
|
|
16378
|
-
function
|
|
16379
|
-
return
|
|
16744
|
+
function Ws(e) {
|
|
16745
|
+
return Hs.get(e);
|
|
16380
16746
|
}
|
|
16381
16747
|
//#endregion
|
|
16382
16748
|
//#region src/app.tsx
|
|
16383
|
-
var
|
|
16749
|
+
var Gs = new w({ defaultOptions: { queries: {
|
|
16384
16750
|
staleTime: 300 * 1e3,
|
|
16385
16751
|
retry: 1
|
|
16386
16752
|
} } });
|
|
16387
|
-
function
|
|
16753
|
+
function Ks(e) {
|
|
16388
16754
|
if (typeof window > "u") return null;
|
|
16389
16755
|
try {
|
|
16390
16756
|
let t = new URL(e, window.location.origin);
|
|
@@ -16393,55 +16759,64 @@ function Ws(e) {
|
|
|
16393
16759
|
return null;
|
|
16394
16760
|
}
|
|
16395
16761
|
}
|
|
16396
|
-
function
|
|
16397
|
-
let { data: e } = st()
|
|
16398
|
-
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
if (
|
|
16404
|
-
|
|
16405
|
-
|
|
16406
|
-
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
}
|
|
16410
|
-
if (r.type === "detail") {
|
|
16411
|
-
t.push(/* @__PURE__ */ N(v, {
|
|
16412
|
-
path: r.route,
|
|
16413
|
-
element: /* @__PURE__ */ N(zs, { children: /* @__PURE__ */ N(Os, { screenCode: n }) })
|
|
16414
|
-
}, n));
|
|
16415
|
-
continue;
|
|
16416
|
-
}
|
|
16417
|
-
if (r.type === "record_list") {
|
|
16418
|
-
t.push(/* @__PURE__ */ N(v, {
|
|
16419
|
-
path: r.route,
|
|
16420
|
-
element: /* @__PURE__ */ N(zs, { children: /* @__PURE__ */ N(Is, { screenCode: n }) })
|
|
16421
|
-
}, n));
|
|
16422
|
-
continue;
|
|
16423
|
-
}
|
|
16424
|
-
if (r.type === "custom") {
|
|
16425
|
-
let e = r.component ? Hs(r.component) : void 0;
|
|
16426
|
-
e && t.push(/* @__PURE__ */ N(v, {
|
|
16427
|
-
path: r.route,
|
|
16428
|
-
element: /* @__PURE__ */ N(zs, { children: /* @__PURE__ */ N(e, {}) })
|
|
16429
|
-
}, n));
|
|
16430
|
-
}
|
|
16762
|
+
function qs() {
|
|
16763
|
+
let { data: e } = st(), t = d(() => {
|
|
16764
|
+
if (!e) return [];
|
|
16765
|
+
let t = [];
|
|
16766
|
+
for (let [n, r] of Object.entries(e.screens)) {
|
|
16767
|
+
if (r.type === "list") {
|
|
16768
|
+
let i = r.entity, a = i ? e.entities?.[i] : void 0;
|
|
16769
|
+
if (a && a.singleton) continue;
|
|
16770
|
+
t.push(/* @__PURE__ */ N(v, {
|
|
16771
|
+
path: r.route,
|
|
16772
|
+
element: /* @__PURE__ */ N(Vs, { children: /* @__PURE__ */ N(Xa, { screenCode: n }) })
|
|
16773
|
+
}, n));
|
|
16774
|
+
continue;
|
|
16431
16775
|
}
|
|
16432
|
-
|
|
16433
|
-
|
|
16776
|
+
if (r.type === "detail") {
|
|
16777
|
+
t.push(/* @__PURE__ */ N(v, {
|
|
16778
|
+
path: r.route,
|
|
16779
|
+
element: /* @__PURE__ */ N(Vs, { children: /* @__PURE__ */ N(As, { screenCode: n }) })
|
|
16780
|
+
}, n));
|
|
16781
|
+
continue;
|
|
16782
|
+
}
|
|
16783
|
+
if (r.type === "record_list") {
|
|
16784
|
+
t.push(/* @__PURE__ */ N(v, {
|
|
16785
|
+
path: r.route,
|
|
16786
|
+
element: /* @__PURE__ */ N(Vs, { children: /* @__PURE__ */ N(Rs, { screenCode: n }) })
|
|
16787
|
+
}, n));
|
|
16788
|
+
continue;
|
|
16789
|
+
}
|
|
16790
|
+
if (r.type === "custom") {
|
|
16791
|
+
let e = r.component ? Ws(r.component) : void 0;
|
|
16792
|
+
e && t.push(/* @__PURE__ */ N(v, {
|
|
16793
|
+
path: r.route,
|
|
16794
|
+
element: /* @__PURE__ */ N(Vs, { children: /* @__PURE__ */ N(e, {}) })
|
|
16795
|
+
}, n));
|
|
16796
|
+
}
|
|
16797
|
+
}
|
|
16798
|
+
return t;
|
|
16799
|
+
}, [e]), n = (t) => {
|
|
16800
|
+
if (!e) return !1;
|
|
16801
|
+
let n = e.screens[t];
|
|
16802
|
+
if (!n) return !1;
|
|
16803
|
+
if (n.type !== "list") return !0;
|
|
16804
|
+
let r = n.entity, i = r ? e.entities?.[r] : void 0;
|
|
16805
|
+
return !(i && i.singleton);
|
|
16806
|
+
};
|
|
16807
|
+
return {
|
|
16808
|
+
routes: t,
|
|
16434
16809
|
defaultRoute: d(() => {
|
|
16435
16810
|
if (!e?.navigation) return null;
|
|
16436
16811
|
for (let t of e.navigation) {
|
|
16437
16812
|
if (t.screen) {
|
|
16438
|
-
let
|
|
16439
|
-
if (n) return
|
|
16813
|
+
let r = e.screens[t.screen];
|
|
16814
|
+
if (r && n(t.screen)) return r.route;
|
|
16440
16815
|
}
|
|
16441
16816
|
if (t.items) {
|
|
16442
|
-
for (let
|
|
16443
|
-
let t = e.screens[
|
|
16444
|
-
if (t) return t.route;
|
|
16817
|
+
for (let r of t.items) if (r.screen) {
|
|
16818
|
+
let t = e.screens[r.screen];
|
|
16819
|
+
if (t && n(r.screen)) return t.route;
|
|
16445
16820
|
}
|
|
16446
16821
|
}
|
|
16447
16822
|
}
|
|
@@ -16449,8 +16824,8 @@ function Gs() {
|
|
|
16449
16824
|
}, [e])
|
|
16450
16825
|
};
|
|
16451
16826
|
}
|
|
16452
|
-
function
|
|
16453
|
-
let e = qt((e) => e.initialize), { data: t } = st(), { routes: n, defaultRoute: r } =
|
|
16827
|
+
function Js() {
|
|
16828
|
+
let e = qt((e) => e.initialize), { data: t } = st(), { routes: n, defaultRoute: r } = qs();
|
|
16454
16829
|
l(() => {
|
|
16455
16830
|
e();
|
|
16456
16831
|
}, [e]);
|
|
@@ -16462,7 +16837,7 @@ function Ks() {
|
|
|
16462
16837
|
t && t.remove();
|
|
16463
16838
|
return;
|
|
16464
16839
|
}
|
|
16465
|
-
let n =
|
|
16840
|
+
let n = Ks(i);
|
|
16466
16841
|
if (!n) {
|
|
16467
16842
|
t && t.remove(), console.error(`[declarion] branding.css_url rejected: ${i}. Only same-origin, relative URLs are allowed (e.g. /crm-brand.css).`);
|
|
16468
16843
|
return;
|
|
@@ -16523,10 +16898,10 @@ function Ks() {
|
|
|
16523
16898
|
})
|
|
16524
16899
|
] });
|
|
16525
16900
|
}
|
|
16526
|
-
function
|
|
16527
|
-
return /* @__PURE__ */ N(
|
|
16528
|
-
client:
|
|
16529
|
-
children: /* @__PURE__ */ P(m, { children: [/* @__PURE__ */ N(
|
|
16901
|
+
function Ys() {
|
|
16902
|
+
return /* @__PURE__ */ N(Vs, { children: /* @__PURE__ */ N(T, {
|
|
16903
|
+
client: Gs,
|
|
16904
|
+
children: /* @__PURE__ */ P(m, { children: [/* @__PURE__ */ N(Js, {}), /* @__PURE__ */ N(A, {
|
|
16530
16905
|
richColors: !0,
|
|
16531
16906
|
position: "top-right",
|
|
16532
16907
|
toastOptions: { className: "select-text" }
|
|
@@ -16535,17 +16910,17 @@ function qs() {
|
|
|
16535
16910
|
}
|
|
16536
16911
|
//#endregion
|
|
16537
16912
|
//#region src/api/entities.ts
|
|
16538
|
-
function
|
|
16913
|
+
function Xs(e, t) {
|
|
16539
16914
|
return e.$statuses?.find((e) => e.group_code === t);
|
|
16540
16915
|
}
|
|
16541
|
-
function
|
|
16916
|
+
function Zs(e, t) {
|
|
16542
16917
|
return e.$properties?.find((e) => e.property_code === t);
|
|
16543
16918
|
}
|
|
16544
|
-
function
|
|
16919
|
+
function Qs(e) {
|
|
16545
16920
|
let t = { ...e };
|
|
16546
|
-
return t.$status = (e) =>
|
|
16921
|
+
return t.$status = (e) => Xs(t, e), t.$property = (e) => Zs(t, e), t;
|
|
16547
16922
|
}
|
|
16548
|
-
var
|
|
16923
|
+
var $s = class {
|
|
16549
16924
|
cache = {};
|
|
16550
16925
|
merge(e) {
|
|
16551
16926
|
if (e) for (let t of Object.keys(e)) {
|
|
@@ -16567,23 +16942,23 @@ var Zs = class {
|
|
|
16567
16942
|
this.cache = {};
|
|
16568
16943
|
}
|
|
16569
16944
|
};
|
|
16570
|
-
function
|
|
16945
|
+
function ec(e, t) {
|
|
16571
16946
|
let n = new URL(`/api/data/${e}`, window.location.origin);
|
|
16572
16947
|
return t.select && t.select.length > 0 && n.searchParams.set("select", t.select.join(",")), t.expand && t.expand.length > 0 && n.searchParams.set("expand", t.expand.join(",")), t.sort && n.searchParams.set("sort", t.sort), t.search && n.searchParams.set("search", t.search), t.limit && n.searchParams.set("limit", String(t.limit)), t.after && n.searchParams.set("after", t.after), t.include_deleted && n.searchParams.set("include_deleted", "true"), t.filters && t.filters.length > 0 && n.searchParams.set("filters", JSON.stringify(t.filters)), n.pathname + n.search;
|
|
16573
16948
|
}
|
|
16574
|
-
var
|
|
16949
|
+
var tc = class {
|
|
16575
16950
|
entity;
|
|
16576
16951
|
refs;
|
|
16577
16952
|
constructor(e, t) {
|
|
16578
|
-
this.entity = e, this.refs = t ?? new
|
|
16953
|
+
this.entity = e, this.refs = t ?? new $s();
|
|
16579
16954
|
}
|
|
16580
16955
|
async get(e) {
|
|
16581
|
-
return
|
|
16956
|
+
return Qs((await Z(`/api/data/${this.entity}/${e}`)).data);
|
|
16582
16957
|
}
|
|
16583
16958
|
async list(e = {}) {
|
|
16584
|
-
let t = await Z(
|
|
16959
|
+
let t = await Z(ec(this.entity, e));
|
|
16585
16960
|
return this.refs.merge(t.$refs), {
|
|
16586
|
-
data: t.data.map((e) =>
|
|
16961
|
+
data: t.data.map((e) => Qs(e)),
|
|
16587
16962
|
meta: t.meta,
|
|
16588
16963
|
$refs: this.refs.all()
|
|
16589
16964
|
};
|
|
@@ -16595,7 +16970,7 @@ var $s = class {
|
|
|
16595
16970
|
return (await Z(`/api/data/${this.entity}`, {
|
|
16596
16971
|
method: "POST",
|
|
16597
16972
|
body: JSON.stringify(e)
|
|
16598
|
-
})).map((e) =>
|
|
16973
|
+
})).map((e) => Qs(e));
|
|
16599
16974
|
}
|
|
16600
16975
|
async update(e, t) {
|
|
16601
16976
|
return (await this.updateMany([{
|
|
@@ -16607,7 +16982,7 @@ var $s = class {
|
|
|
16607
16982
|
return (await Z(`/api/data/${this.entity}`, {
|
|
16608
16983
|
method: "PATCH",
|
|
16609
16984
|
body: JSON.stringify(e)
|
|
16610
|
-
})).map((e) =>
|
|
16985
|
+
})).map((e) => Qs(e));
|
|
16611
16986
|
}
|
|
16612
16987
|
async delete(e) {
|
|
16613
16988
|
await this.deleteMany([e]);
|
|
@@ -16635,15 +17010,15 @@ var $s = class {
|
|
|
16635
17010
|
return (await Z(`/api/data/${this.entity}?unique_fields=${n}`, {
|
|
16636
17011
|
method: "POST",
|
|
16637
17012
|
body: JSON.stringify(e)
|
|
16638
|
-
})).map((e) =>
|
|
17013
|
+
})).map((e) => Qs(e));
|
|
16639
17014
|
}
|
|
16640
17015
|
};
|
|
16641
|
-
function
|
|
16642
|
-
return new
|
|
17016
|
+
function nc(e, t) {
|
|
17017
|
+
return new tc(e, t);
|
|
16643
17018
|
}
|
|
16644
17019
|
//#endregion
|
|
16645
17020
|
//#region src/hooks/useColumns.ts
|
|
16646
|
-
function
|
|
17021
|
+
function rc(e, t) {
|
|
16647
17022
|
let [n, r] = C(), i = d(() => {
|
|
16648
17023
|
let r = n.get("columns");
|
|
16649
17024
|
return r ? r.split(",").filter(Boolean).filter((t) => e.includes(t)) : t.length > 0 ? t : e;
|
|
@@ -16653,7 +17028,7 @@ function tc(e, t) {
|
|
|
16653
17028
|
t
|
|
16654
17029
|
]), a = s((e) => {
|
|
16655
17030
|
let i = new URLSearchParams(n);
|
|
16656
|
-
e.length === 0 ||
|
|
17031
|
+
e.length === 0 || ic(e, t) ? i.delete("columns") : i.set("columns", e.join(",")), r(i);
|
|
16657
17032
|
}, [
|
|
16658
17033
|
n,
|
|
16659
17034
|
r,
|
|
@@ -16679,12 +17054,12 @@ function tc(e, t) {
|
|
|
16679
17054
|
}, [i, a])
|
|
16680
17055
|
};
|
|
16681
17056
|
}
|
|
16682
|
-
function
|
|
17057
|
+
function ic(e, t) {
|
|
16683
17058
|
return e.length === t.length ? e.every((e, n) => e === t[n]) : !1;
|
|
16684
17059
|
}
|
|
16685
17060
|
//#endregion
|
|
16686
17061
|
//#region src/components/shared/PageHeader.tsx
|
|
16687
|
-
function
|
|
17062
|
+
function ac({ title: e, backTo: t, actions: n }) {
|
|
16688
17063
|
let r = x(), { switchTab: i, findTabByPathname: a } = jt();
|
|
16689
17064
|
function o() {
|
|
16690
17065
|
if (!t) return;
|
|
@@ -16735,7 +17110,7 @@ function rc({ title: e, backTo: t, actions: n }) {
|
|
|
16735
17110
|
}
|
|
16736
17111
|
//#endregion
|
|
16737
17112
|
//#region src/components/list/RowMenu.tsx
|
|
16738
|
-
function
|
|
17113
|
+
function oc({ x: e, y: t, onClose: n, onPeek: r, onOpen: i, onEditInline: a, onDuplicate: o, onCopyLink: s, onDelete: c, actions: l }) {
|
|
16739
17114
|
let u = (e) => () => {
|
|
16740
17115
|
n(), e && e();
|
|
16741
17116
|
}, d = r || i || a || o || s, f = l && l.length > 0;
|
|
@@ -16813,8 +17188,8 @@ function ic({ x: e, y: t, onClose: n, onPeek: r, onOpen: i, onEditInline: a, onD
|
|
|
16813
17188
|
}
|
|
16814
17189
|
//#endregion
|
|
16815
17190
|
//#region src/components/list/resolveActions.ts
|
|
16816
|
-
var
|
|
16817
|
-
function
|
|
17191
|
+
var sc = "list_toolbar", cc = "list_bulk_bar";
|
|
17192
|
+
function lc(e) {
|
|
16818
17193
|
let { actions: t, screen: n, selectionCount: r } = e, i = e.hasPermission ?? (() => !0), a = e.maxPrimary ?? 2, o = [];
|
|
16819
17194
|
for (let [e, n] of Object.entries(t)) (n.visibility ?? []).includes("list_toolbar") && i(e) && o.push({
|
|
16820
17195
|
code: e,
|
|
@@ -16834,7 +17209,7 @@ function sc(e) {
|
|
|
16834
17209
|
selectionCount: r
|
|
16835
17210
|
};
|
|
16836
17211
|
}
|
|
16837
|
-
function
|
|
17212
|
+
function uc(e) {
|
|
16838
17213
|
let { actions: t, screen: n } = e, r = e.hasPermission ?? (() => !0), i = e.maxPrimary ?? 2, a = [];
|
|
16839
17214
|
for (let [e, n] of Object.entries(t)) (n.visibility ?? []).includes("list_bulk_bar") && r(e) && a.push({
|
|
16840
17215
|
code: e,
|
|
@@ -16848,7 +17223,7 @@ function cc(e) {
|
|
|
16848
17223
|
}
|
|
16849
17224
|
//#endregion
|
|
16850
17225
|
//#region src/components/list/ListPage.tsx
|
|
16851
|
-
function
|
|
17226
|
+
function dc(e, t = 12) {
|
|
16852
17227
|
let n = e.display?.icon;
|
|
16853
17228
|
if (!n) return null;
|
|
16854
17229
|
let r = B[n];
|
|
@@ -16857,8 +17232,8 @@ function lc(e, t = 12) {
|
|
|
16857
17232
|
size: t
|
|
16858
17233
|
});
|
|
16859
17234
|
}
|
|
16860
|
-
function
|
|
16861
|
-
let y = f(null), [b, x] = p(!1), { run: S } = Jr(), C = d(() =>
|
|
17235
|
+
function fc({ title: e, singular: t, total: n, shown: r, selectionCount: i, clearSelection: a, onNewRecord: o, screen: s, actions: c, hasPermission: l, executeAction: u, children: m, onBulkDelete: h, onBulkExport: g, onToolbarExport: _, onManageActions: v }) {
|
|
17236
|
+
let y = f(null), [b, x] = p(!1), { run: S } = Jr(), C = d(() => lc({
|
|
16862
17237
|
actions: c,
|
|
16863
17238
|
screen: s,
|
|
16864
17239
|
selectionCount: i,
|
|
@@ -16868,7 +17243,7 @@ function uc({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
|
|
|
16868
17243
|
s,
|
|
16869
17244
|
i,
|
|
16870
17245
|
l
|
|
16871
|
-
]), w = d(() =>
|
|
17246
|
+
]), w = d(() => uc({
|
|
16872
17247
|
actions: c,
|
|
16873
17248
|
screen: s,
|
|
16874
17249
|
selectionCount: i,
|
|
@@ -16889,7 +17264,7 @@ function uc({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
|
|
|
16889
17264
|
}, E = d(() => w.entries.map(({ code: e, action: t }) => ({
|
|
16890
17265
|
id: e,
|
|
16891
17266
|
label: X(t.display?.name) || e,
|
|
16892
|
-
icon:
|
|
17267
|
+
icon: dc(t),
|
|
16893
17268
|
primary: w.primaryCodes.has(e),
|
|
16894
17269
|
destructive: t.destructive,
|
|
16895
17270
|
onRun: () => T({
|
|
@@ -16946,7 +17321,7 @@ function uc({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
|
|
|
16946
17321
|
}),
|
|
16947
17322
|
C.primary.map((e) => /* @__PURE__ */ N(V, {
|
|
16948
17323
|
kind: "default",
|
|
16949
|
-
icon:
|
|
17324
|
+
icon: dc(e.action, 13),
|
|
16950
17325
|
onClick: () => T(e, !1),
|
|
16951
17326
|
children: X(e.action.display?.name) || e.code
|
|
16952
17327
|
}, e.code)),
|
|
@@ -16962,16 +17337,16 @@ function uc({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
|
|
|
16962
17337
|
}),
|
|
16963
17338
|
onClick: () => x(!b),
|
|
16964
17339
|
children: "Actions"
|
|
16965
|
-
}), /* @__PURE__ */ P(
|
|
17340
|
+
}), /* @__PURE__ */ P(_e, {
|
|
16966
17341
|
open: b,
|
|
16967
17342
|
anchor: y.current,
|
|
16968
17343
|
onClose: () => x(!1),
|
|
16969
17344
|
width: 240,
|
|
16970
17345
|
align: "end",
|
|
16971
17346
|
children: [
|
|
16972
|
-
C.global.length > 0 && /* @__PURE__ */ N(
|
|
17347
|
+
C.global.length > 0 && /* @__PURE__ */ N(pc, { children: "Global" }),
|
|
16973
17348
|
C.global.map((e) => /* @__PURE__ */ N(K, {
|
|
16974
|
-
icon:
|
|
17349
|
+
icon: dc(e.action),
|
|
16975
17350
|
danger: e.action.destructive,
|
|
16976
17351
|
onClick: () => {
|
|
16977
17352
|
x(!1), T(e, !1);
|
|
@@ -17011,7 +17386,7 @@ function uc({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
|
|
|
17011
17386
|
pointerEvents: i === 0 ? "none" : "auto"
|
|
17012
17387
|
},
|
|
17013
17388
|
children: /* @__PURE__ */ N(K, {
|
|
17014
|
-
icon:
|
|
17389
|
+
icon: dc(e.action),
|
|
17015
17390
|
danger: e.action.destructive,
|
|
17016
17391
|
onClick: () => {
|
|
17017
17392
|
x(!1), T(e, !0);
|
|
@@ -17065,7 +17440,7 @@ function uc({ title: e, singular: t, total: n, shown: r, selectionCount: i, clea
|
|
|
17065
17440
|
]
|
|
17066
17441
|
});
|
|
17067
17442
|
}
|
|
17068
|
-
function
|
|
17443
|
+
function pc({ children: e }) {
|
|
17069
17444
|
return /* @__PURE__ */ N("div", {
|
|
17070
17445
|
style: {
|
|
17071
17446
|
padding: "6px 8px 4px",
|
|
@@ -17080,7 +17455,7 @@ function dc({ children: e }) {
|
|
|
17080
17455
|
}
|
|
17081
17456
|
//#endregion
|
|
17082
17457
|
//#region src/components/list/InlineEditCell.tsx
|
|
17083
|
-
var
|
|
17458
|
+
var mc = {
|
|
17084
17459
|
padding: "4px 6px",
|
|
17085
17460
|
margin: "-4px -6px",
|
|
17086
17461
|
borderRadius: 4,
|
|
@@ -17091,7 +17466,7 @@ var fc = {
|
|
|
17091
17466
|
alignItems: "center",
|
|
17092
17467
|
gap: 4
|
|
17093
17468
|
};
|
|
17094
|
-
function
|
|
17469
|
+
function hc({ value: e, onSave: t, type: n = "text", options: r, trigger: i = "always", label: a, placeholder: o }) {
|
|
17095
17470
|
let [s, c] = p(e), [u, d] = p(e), [m, h] = p(!1), [g, _] = p(e), v = f(null);
|
|
17096
17471
|
l(() => {
|
|
17097
17472
|
c(e), d(e), _(e);
|
|
@@ -17121,7 +17496,7 @@ function pc({ value: e, onSave: t, type: n = "text", options: r, trigger: i = "a
|
|
|
17121
17496
|
onKeyDown: (e) => {
|
|
17122
17497
|
e.key === "Enter" && S(), e.key === "Escape" && x();
|
|
17123
17498
|
},
|
|
17124
|
-
children: [n === "select" ? /* @__PURE__ */ N(
|
|
17499
|
+
children: [n === "select" ? /* @__PURE__ */ N(De, {
|
|
17125
17500
|
value: g,
|
|
17126
17501
|
options: r || [],
|
|
17127
17502
|
onChange: (e) => {
|
|
@@ -17133,7 +17508,7 @@ function pc({ value: e, onSave: t, type: n = "text", options: r, trigger: i = "a
|
|
|
17133
17508
|
let t = String(e);
|
|
17134
17509
|
_(t), b(t);
|
|
17135
17510
|
}
|
|
17136
|
-
}) : /* @__PURE__ */ N(
|
|
17511
|
+
}) : /* @__PURE__ */ N(Y, {
|
|
17137
17512
|
value: g ?? "",
|
|
17138
17513
|
onChange: _,
|
|
17139
17514
|
autoFocus: !0,
|
|
@@ -17163,7 +17538,7 @@ function pc({ value: e, onSave: t, type: n = "text", options: r, trigger: i = "a
|
|
|
17163
17538
|
onMouseLeave: (e) => {
|
|
17164
17539
|
e.currentTarget.style.borderColor = "transparent";
|
|
17165
17540
|
},
|
|
17166
|
-
style:
|
|
17541
|
+
style: mc,
|
|
17167
17542
|
children: u ?? /* @__PURE__ */ N("span", {
|
|
17168
17543
|
style: { color: "var(--text-4)" },
|
|
17169
17544
|
children: "Click to edit"
|
|
@@ -17172,7 +17547,7 @@ function pc({ value: e, onSave: t, type: n = "text", options: r, trigger: i = "a
|
|
|
17172
17547
|
}
|
|
17173
17548
|
//#endregion
|
|
17174
17549
|
//#region src/components/detail/DetailPage.tsx
|
|
17175
|
-
function
|
|
17550
|
+
function gc(e, t = 13) {
|
|
17176
17551
|
let n = e.display?.icon;
|
|
17177
17552
|
if (!n) return null;
|
|
17178
17553
|
let r = B[n];
|
|
@@ -17181,7 +17556,7 @@ function mc(e, t = 13) {
|
|
|
17181
17556
|
size: t
|
|
17182
17557
|
});
|
|
17183
17558
|
}
|
|
17184
|
-
function
|
|
17559
|
+
function _c({ mode: e, onModeChange: t, onClose: n, onSave: r, onDelete: i, title: a, recordId: o, initialDirty: s, dirty: c, subHeader: u, leading: m, screen: h, actions: g, executeAction: _, sidebar: v, footerMeta: y, children: b }) {
|
|
17185
17560
|
let x = f(null), [S, C] = p(!1), { run: w } = Jr();
|
|
17186
17561
|
l(() => {
|
|
17187
17562
|
s && e === "view" && t("edit");
|
|
@@ -17309,7 +17684,7 @@ function hc({ mode: e, onModeChange: t, onClose: n, onSave: r, onDelete: i, titl
|
|
|
17309
17684
|
] }) : /* @__PURE__ */ P(M, { children: [
|
|
17310
17685
|
E.map(({ code: e, action: t }) => /* @__PURE__ */ N(V, {
|
|
17311
17686
|
kind: "default",
|
|
17312
|
-
icon:
|
|
17687
|
+
icon: gc(t),
|
|
17313
17688
|
onClick: () => D({
|
|
17314
17689
|
code: e,
|
|
17315
17690
|
action: t
|
|
@@ -17328,14 +17703,14 @@ function hc({ mode: e, onModeChange: t, onClose: n, onSave: r, onDelete: i, titl
|
|
|
17328
17703
|
}),
|
|
17329
17704
|
onClick: () => C(!S),
|
|
17330
17705
|
children: "Actions"
|
|
17331
|
-
}), /* @__PURE__ */ P(
|
|
17706
|
+
}), /* @__PURE__ */ P(_e, {
|
|
17332
17707
|
open: S,
|
|
17333
17708
|
anchor: x.current,
|
|
17334
17709
|
onClose: () => C(!1),
|
|
17335
17710
|
width: 220,
|
|
17336
17711
|
align: "end",
|
|
17337
17712
|
children: [T.length === 0 && /* @__PURE__ */ N(K, { children: "No actions" }), T.map(({ code: e, action: t }) => /* @__PURE__ */ N(K, {
|
|
17338
|
-
icon:
|
|
17713
|
+
icon: gc(t),
|
|
17339
17714
|
danger: t.destructive,
|
|
17340
17715
|
onClick: () => {
|
|
17341
17716
|
C(!1), D({
|
|
@@ -17405,7 +17780,7 @@ function hc({ mode: e, onModeChange: t, onClose: n, onSave: r, onDelete: i, titl
|
|
|
17405
17780
|
}
|
|
17406
17781
|
//#endregion
|
|
17407
17782
|
//#region src/components/pages/home/HomeStub.tsx
|
|
17408
|
-
var
|
|
17783
|
+
var vc = [
|
|
17409
17784
|
{
|
|
17410
17785
|
id: "a1",
|
|
17411
17786
|
title: "James Gallagher moved to Discovery",
|
|
@@ -17421,7 +17796,7 @@ var gc = [
|
|
|
17421
17796
|
title: "Refill enrichment job completed (32 leads)",
|
|
17422
17797
|
when: "10:00 AM"
|
|
17423
17798
|
}
|
|
17424
|
-
],
|
|
17799
|
+
], yc = [
|
|
17425
17800
|
{
|
|
17426
17801
|
label: "Open leads",
|
|
17427
17802
|
val: "127",
|
|
@@ -17446,7 +17821,7 @@ var gc = [
|
|
|
17446
17821
|
delta: "2 failed",
|
|
17447
17822
|
tone: "amber"
|
|
17448
17823
|
}
|
|
17449
|
-
],
|
|
17824
|
+
], bc = [
|
|
17450
17825
|
[
|
|
17451
17826
|
"leads",
|
|
17452
17827
|
"Leads",
|
|
@@ -17478,7 +17853,7 @@ var gc = [
|
|
|
17478
17853
|
"entity"
|
|
17479
17854
|
]
|
|
17480
17855
|
];
|
|
17481
|
-
function
|
|
17856
|
+
function xc({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLabel: n = "Acme · production" }) {
|
|
17482
17857
|
return /* @__PURE__ */ N("div", {
|
|
17483
17858
|
style: {
|
|
17484
17859
|
padding: "22px 24px",
|
|
@@ -17522,7 +17897,7 @@ function yc({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
17522
17897
|
gap: 10,
|
|
17523
17898
|
margin: "16px 0"
|
|
17524
17899
|
},
|
|
17525
|
-
children:
|
|
17900
|
+
children: yc.map((e) => /* @__PURE__ */ P("div", {
|
|
17526
17901
|
style: {
|
|
17527
17902
|
padding: 14,
|
|
17528
17903
|
background: "var(--surface)",
|
|
@@ -17561,7 +17936,7 @@ function yc({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
17561
17936
|
gridTemplateColumns: "2fr 1fr",
|
|
17562
17937
|
gap: 14
|
|
17563
17938
|
},
|
|
17564
|
-
children: [/* @__PURE__ */ N(
|
|
17939
|
+
children: [/* @__PURE__ */ N(ye, {
|
|
17565
17940
|
title: "Quick access",
|
|
17566
17941
|
icon: /* @__PURE__ */ N(B.bolt, { size: 14 }),
|
|
17567
17942
|
children: /* @__PURE__ */ N("div", {
|
|
@@ -17570,7 +17945,7 @@ function yc({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
17570
17945
|
gridTemplateColumns: "repeat(3,1fr)",
|
|
17571
17946
|
gap: 8
|
|
17572
17947
|
},
|
|
17573
|
-
children:
|
|
17948
|
+
children: bc.map(([t, n, r]) => {
|
|
17574
17949
|
let a = B[r];
|
|
17575
17950
|
return /* @__PURE__ */ P("button", {
|
|
17576
17951
|
onClick: () => e?.(t),
|
|
@@ -17606,7 +17981,7 @@ function yc({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
17606
17981
|
}, t);
|
|
17607
17982
|
})
|
|
17608
17983
|
})
|
|
17609
|
-
}), /* @__PURE__ */ N(
|
|
17984
|
+
}), /* @__PURE__ */ N(ye, {
|
|
17610
17985
|
title: "Recent activity",
|
|
17611
17986
|
icon: /* @__PURE__ */ N(B.activity, { size: 14 }),
|
|
17612
17987
|
children: /* @__PURE__ */ N("div", {
|
|
@@ -17615,7 +17990,7 @@ function yc({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
17615
17990
|
flexDirection: "column",
|
|
17616
17991
|
gap: 8
|
|
17617
17992
|
},
|
|
17618
|
-
children:
|
|
17993
|
+
children: vc.slice(0, 3).map((e) => /* @__PURE__ */ P("div", {
|
|
17619
17994
|
style: {
|
|
17620
17995
|
fontSize: 12,
|
|
17621
17996
|
color: "var(--text-2)"
|
|
@@ -17644,19 +18019,19 @@ function yc({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
17644
18019
|
}
|
|
17645
18020
|
//#endregion
|
|
17646
18021
|
//#region src/components/pages/pipeline/Pipeline.tsx
|
|
17647
|
-
var
|
|
18022
|
+
var Sc = {
|
|
17648
18023
|
"1-New": { color: "slate" },
|
|
17649
18024
|
"2-Contacted": { color: "sky" },
|
|
17650
18025
|
"3-Qualified": { color: "violet" },
|
|
17651
18026
|
"4-Proposal": { color: "amber" },
|
|
17652
18027
|
"5-Won": { color: "emerald" },
|
|
17653
18028
|
"6-Lost": { color: "rose" }
|
|
17654
|
-
},
|
|
18029
|
+
}, Cc = {
|
|
17655
18030
|
P0: "rose",
|
|
17656
18031
|
P1: "amber",
|
|
17657
18032
|
P2: "sky",
|
|
17658
18033
|
P3: "slate"
|
|
17659
|
-
},
|
|
18034
|
+
}, wc = [
|
|
17660
18035
|
{
|
|
17661
18036
|
id: "l1",
|
|
17662
18037
|
contact: "James Gallagher",
|
|
@@ -17722,11 +18097,11 @@ var bc = {
|
|
|
17722
18097
|
score: 58
|
|
17723
18098
|
}
|
|
17724
18099
|
];
|
|
17725
|
-
function
|
|
17726
|
-
let e = Object.entries(
|
|
18100
|
+
function Tc() {
|
|
18101
|
+
let e = Object.entries(Sc).map(([e, t]) => ({
|
|
17727
18102
|
key: e,
|
|
17728
18103
|
color: t.color,
|
|
17729
|
-
leads:
|
|
18104
|
+
leads: wc.filter((t) => t.pipeline === e)
|
|
17730
18105
|
}));
|
|
17731
18106
|
return /* @__PURE__ */ P("div", {
|
|
17732
18107
|
style: {
|
|
@@ -17757,7 +18132,7 @@ function Cc() {
|
|
|
17757
18132
|
fontSize: 12,
|
|
17758
18133
|
color: "var(--text-3)"
|
|
17759
18134
|
},
|
|
17760
|
-
children: [
|
|
18135
|
+
children: [wc.length, " leads · $2.4M pipeline"]
|
|
17761
18136
|
})]
|
|
17762
18137
|
}), /* @__PURE__ */ N("div", {
|
|
17763
18138
|
style: {
|
|
@@ -17843,7 +18218,7 @@ function Cc() {
|
|
|
17843
18218
|
flexWrap: "wrap"
|
|
17844
18219
|
},
|
|
17845
18220
|
children: [e.priority && e.priority !== "-" && /* @__PURE__ */ N(U, {
|
|
17846
|
-
tone:
|
|
18221
|
+
tone: Cc[e.priority] ?? "slate",
|
|
17847
18222
|
size: "xs",
|
|
17848
18223
|
dot: !0,
|
|
17849
18224
|
children: e.priority
|
|
@@ -17862,7 +18237,7 @@ function Cc() {
|
|
|
17862
18237
|
}
|
|
17863
18238
|
//#endregion
|
|
17864
18239
|
//#region src/components/pages/jobs/Jobs.tsx
|
|
17865
|
-
var
|
|
18240
|
+
var Ec = [
|
|
17866
18241
|
{
|
|
17867
18242
|
id: "job_91a4",
|
|
17868
18243
|
name: "reparse_leads_with_llm",
|
|
@@ -17906,12 +18281,12 @@ var wc = [
|
|
|
17906
18281
|
worker: "wk-us-01",
|
|
17907
18282
|
took: "2m 02s"
|
|
17908
18283
|
}
|
|
17909
|
-
],
|
|
18284
|
+
], Dc = {
|
|
17910
18285
|
running: "sky",
|
|
17911
18286
|
success: "emerald",
|
|
17912
18287
|
queued: "slate",
|
|
17913
18288
|
failed: "rose"
|
|
17914
|
-
},
|
|
18289
|
+
}, Oc = [
|
|
17915
18290
|
"ID",
|
|
17916
18291
|
"Name",
|
|
17917
18292
|
"Status",
|
|
@@ -17921,7 +18296,7 @@ var wc = [
|
|
|
17921
18296
|
"Worker",
|
|
17922
18297
|
""
|
|
17923
18298
|
];
|
|
17924
|
-
function
|
|
18299
|
+
function kc() {
|
|
17925
18300
|
return /* @__PURE__ */ P("div", {
|
|
17926
18301
|
style: {
|
|
17927
18302
|
padding: "14px 20px",
|
|
@@ -17970,7 +18345,7 @@ function Dc() {
|
|
|
17970
18345
|
background: "var(--surface-2)",
|
|
17971
18346
|
color: "var(--text-3)"
|
|
17972
18347
|
},
|
|
17973
|
-
children:
|
|
18348
|
+
children: Oc.map((e, t) => /* @__PURE__ */ N("th", {
|
|
17974
18349
|
style: {
|
|
17975
18350
|
padding: "0 10px",
|
|
17976
18351
|
textAlign: "left",
|
|
@@ -17982,7 +18357,7 @@ function Dc() {
|
|
|
17982
18357
|
},
|
|
17983
18358
|
children: e
|
|
17984
18359
|
}, e || `_h${t}`))
|
|
17985
|
-
}) }), /* @__PURE__ */ N("tbody", { children:
|
|
18360
|
+
}) }), /* @__PURE__ */ N("tbody", { children: Ec.map((e) => /* @__PURE__ */ P("tr", {
|
|
17986
18361
|
style: { height: 32 },
|
|
17987
18362
|
children: [
|
|
17988
18363
|
/* @__PURE__ */ N("td", {
|
|
@@ -18014,7 +18389,7 @@ function Dc() {
|
|
|
18014
18389
|
borderBottom: "1px solid var(--divider)"
|
|
18015
18390
|
},
|
|
18016
18391
|
children: /* @__PURE__ */ N(U, {
|
|
18017
|
-
tone:
|
|
18392
|
+
tone: Dc[e.status],
|
|
18018
18393
|
size: "xs",
|
|
18019
18394
|
dot: !0,
|
|
18020
18395
|
children: e.status
|
|
@@ -18044,7 +18419,7 @@ function Dc() {
|
|
|
18044
18419
|
display: "block",
|
|
18045
18420
|
height: "100%",
|
|
18046
18421
|
width: `${e.progress}%`,
|
|
18047
|
-
background: `var(--pill-${
|
|
18422
|
+
background: `var(--pill-${Dc[e.status]})`
|
|
18048
18423
|
} })
|
|
18049
18424
|
}), /* @__PURE__ */ P("span", {
|
|
18050
18425
|
className: "mono num",
|
|
@@ -18098,6 +18473,6 @@ function Dc() {
|
|
|
18098
18473
|
});
|
|
18099
18474
|
}
|
|
18100
18475
|
//#endregion
|
|
18101
|
-
export { fn as AIPanel, Xr as ActionRunnerProvider,
|
|
18476
|
+
export { fn as AIPanel, Xr as ActionRunnerProvider, Ys as App, Ys as Declarion, yi as AuthShell, ge as Avatar, Ce as BoolToggle, en as Breadcrumbs, V as Btn, Na as BulkBar, ki as ChangePasswordDialog, we as Check, ve as Chip, Ha as ColumnPicker, cn as CommandPalette, ra as ConfirmDialog, Oe as DateInput, _e as Dropdown, rn as DynamicIcon, Qi as EmptyState, tc as EntityClient, J as FieldLabel, Fa as FilterChips, Ra as FilterDrawer, Ti as Forgot, xc as HomeStub, B as Icon, H as IconBtn, hc as InlineEditCell, kc as JobsStub, Pe as JsonField, W as Kbd, K as MenuItem, pa as NO_VALUE_OPS, ma as OP_LABELS, ac as PageHeader, Me as PasswordInput, U as Pill, Tc as PipelineStub, Li as Preferences, Ai as Profile, Oa as QEField, Le as QuickEditCell, Da as QuickPeek, Ke as Rail, Se as RecordIdBadge, $s as RefCache, Fe as RefField, G as RowField, oc as RowMenu, ye as SectionCard, De as Select, _c as ShellDetailPage, fc as ShellListPage, Nt as Sidebar, Ci as SignIn, wi as SignUp, As as SmartDetailPage, Xa as SmartListPage, Rs as SmartRecordListPage, q as Spinner, an as TabStrip, Ne as TagsInput, Qt as TenantChip, Ee as TextArea, Y as TextInput, nn as TopBar, Ei as TwoFA, cc as VISIBILITY_LIST_BULK_BAR, sc as VISIBILITY_LIST_TOOLBAR, Ie as ViewField, Wa as ViewSwitcher, Pt as buildSections, ya as countActiveFilters, he as cx, nc as entityClient, Zt as envTone, ze as fieldDisplayName, _a as hasOrGroups, X as loc, ha as parseFiltersFromURL, Us as registerScreen, uc as resolveBulkBarActions, lc as resolveToolbarActions, ga as setFiltersInURL, Jr as useActionRunner, Jt as useAuth, rc as useColumns, Ki as useCreateEntity, Zi as useDebounce, Ji as useDeleteEntity, Ls as useDeleteProperty, $n as useEntity, Qn as useEntityData, ro as useEntityItem, Sa as useFilters, ui as usePublicParams, di as useResolvedParam, st as useSchema, Ga as useScreen, Is as useSetProperty, Ns as useSetStatus, Mt as useTabNavigate, jt as useTabStore, qi as useUpdateEntity, Ka as useViews };
|
|
18102
18477
|
|
|
18103
18478
|
//# sourceMappingURL=index.js.map
|