@abpjs/ui 0.2.0-next.13 → 0.2.0-next.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/guard.d.ts +1547 -0
- package/dist/guard.js +3566 -0
- package/dist/guard.js.map +1 -0
- package/dist/index.d.ts +108 -97
- package/dist/index.js +957 -915
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -1560,7 +1560,7 @@ function useTokenVar() {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
|
|
1562
1562
|
// src/version.ts
|
|
1563
|
-
var ABP_UI_VERSION = true ? "0.2.0-next.
|
|
1563
|
+
var ABP_UI_VERSION = true ? "0.2.0-next.15" : "0.0.0-dev";
|
|
1564
1564
|
|
|
1565
1565
|
// src/provider/time-zone.tsx
|
|
1566
1566
|
import { createContext, useContext } from "react";
|
|
@@ -3538,32 +3538,149 @@ function TranslatedInput({
|
|
|
3538
3538
|
] });
|
|
3539
3539
|
}
|
|
3540
3540
|
|
|
3541
|
+
// src/components/ListFooter.tsx
|
|
3542
|
+
import { Flex, Text as Text3 } from "@chakra-ui/react";
|
|
3543
|
+
|
|
3544
|
+
// src/components/Pagination.tsx
|
|
3545
|
+
import { chakra as chakra8, HStack as HStack3 } from "@chakra-ui/react";
|
|
3546
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
3547
|
+
|
|
3548
|
+
// src/components/DirectionalIcon.tsx
|
|
3549
|
+
import { chakra as chakra7 } from "@chakra-ui/react";
|
|
3550
|
+
var DirectionalIcon = chakra7("span", {
|
|
3551
|
+
base: {
|
|
3552
|
+
display: "inline-flex",
|
|
3553
|
+
alignItems: "center",
|
|
3554
|
+
justifyContent: "center",
|
|
3555
|
+
_rtl: { transform: "scaleX(-1)" }
|
|
3556
|
+
}
|
|
3557
|
+
});
|
|
3558
|
+
|
|
3559
|
+
// src/components/pageList.ts
|
|
3560
|
+
function pageList(page, pages) {
|
|
3561
|
+
const want = /* @__PURE__ */ new Set([1, pages, page - 1, page, page + 1]);
|
|
3562
|
+
if (page <= 3) [2, 3, 4].forEach((n) => want.add(n));
|
|
3563
|
+
if (page >= pages - 2) [pages - 1, pages - 2, pages - 3].forEach((n) => want.add(n));
|
|
3564
|
+
const list = [...want].filter((n) => n >= 1 && n <= pages).sort((a, b) => a - b);
|
|
3565
|
+
const out = [];
|
|
3566
|
+
list.forEach((n, i) => {
|
|
3567
|
+
if (i > 0 && n - list[i - 1] > 1) out.push("gap");
|
|
3568
|
+
out.push(n);
|
|
3569
|
+
});
|
|
3570
|
+
return out;
|
|
3571
|
+
}
|
|
3572
|
+
|
|
3573
|
+
// src/components/Pagination.tsx
|
|
3574
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3575
|
+
var button = {
|
|
3576
|
+
display: "inline-flex",
|
|
3577
|
+
alignItems: "center",
|
|
3578
|
+
justifyContent: "center",
|
|
3579
|
+
minW: "8",
|
|
3580
|
+
h: "8",
|
|
3581
|
+
px: "2",
|
|
3582
|
+
borderRadius: "l2",
|
|
3583
|
+
color: "fg",
|
|
3584
|
+
textStyle: "sm",
|
|
3585
|
+
fontVariantNumeric: "tabular-nums",
|
|
3586
|
+
cursor: "pointer",
|
|
3587
|
+
transitionProperty: "background, color",
|
|
3588
|
+
transitionDuration: "fast",
|
|
3589
|
+
focusVisibleRing: "outside",
|
|
3590
|
+
_hover: { bg: "bg.muted" },
|
|
3591
|
+
_disabled: { color: "fg.subtle", cursor: "not-allowed", bg: "transparent" },
|
|
3592
|
+
_icon: { boxSize: "3.5" },
|
|
3593
|
+
"&[aria-current=page], &[aria-current=page]:hover": { bg: "accent.solid", color: "accent.contrast", fontWeight: "bold" }
|
|
3594
|
+
};
|
|
3595
|
+
function Pagination({ page, pages, onPage, label, previous, next, pageLabel, disabled }) {
|
|
3596
|
+
if (pages <= 1) return null;
|
|
3597
|
+
const go = (n) => onPage(Math.min(pages, Math.max(1, n)));
|
|
3598
|
+
return /* @__PURE__ */ jsx19(chakra8.nav, { "aria-label": label, children: /* @__PURE__ */ jsxs10(HStack3, { gap: "1", justify: "center", wrap: "wrap", children: [
|
|
3599
|
+
/* @__PURE__ */ jsx19(chakra8.button, { type: "button", css: button, "aria-label": previous, title: previous, disabled: disabled || page <= 1, onClick: () => go(page - 1), children: /* @__PURE__ */ jsx19(DirectionalIcon, { children: /* @__PURE__ */ jsx19(ChevronLeft, {}) }) }),
|
|
3600
|
+
pageList(page, pages).map(
|
|
3601
|
+
(n, i) => n === "gap" ? /* @__PURE__ */ jsx19(chakra8.span, { minW: "5", textAlign: "center", color: "fg.muted", "aria-hidden": "true", children: "\u2026" }, `gap-${i}`) : (
|
|
3602
|
+
// Page buttons stay enabled while a page loads (a second click just asks again); the arrows wait.
|
|
3603
|
+
/* @__PURE__ */ jsx19(
|
|
3604
|
+
chakra8.button,
|
|
3605
|
+
{
|
|
3606
|
+
type: "button",
|
|
3607
|
+
css: button,
|
|
3608
|
+
"aria-label": pageLabel(n),
|
|
3609
|
+
"aria-current": n === page ? "page" : void 0,
|
|
3610
|
+
onClick: () => n !== page && go(n),
|
|
3611
|
+
children: n
|
|
3612
|
+
},
|
|
3613
|
+
n
|
|
3614
|
+
)
|
|
3615
|
+
)
|
|
3616
|
+
),
|
|
3617
|
+
/* @__PURE__ */ jsx19(chakra8.button, { type: "button", css: button, "aria-label": next, title: next, disabled: disabled || page >= pages, onClick: () => go(page + 1), children: /* @__PURE__ */ jsx19(DirectionalIcon, { children: /* @__PURE__ */ jsx19(ChevronRight, {}) }) })
|
|
3618
|
+
] }) });
|
|
3619
|
+
}
|
|
3620
|
+
|
|
3621
|
+
// src/components/ListFooter.tsx
|
|
3622
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3623
|
+
function ListFooter({ list }) {
|
|
3624
|
+
const labels = useAbpLabels().queryList;
|
|
3625
|
+
const { locale } = useAbpLocale();
|
|
3626
|
+
const fmt = useFormatters();
|
|
3627
|
+
const { page, pageSize } = list.query;
|
|
3628
|
+
if (list.rows === void 0 || list.total === 0) return null;
|
|
3629
|
+
const from = (page - 1) * pageSize + 1;
|
|
3630
|
+
const to = Math.min(page * pageSize, list.total);
|
|
3631
|
+
return /* @__PURE__ */ jsxs11(Flex, { gap: "3", align: "center", justify: "space-between", wrap: "wrap", "data-testid": "list-footer", children: [
|
|
3632
|
+
/* @__PURE__ */ jsx20(
|
|
3633
|
+
Pagination,
|
|
3634
|
+
{
|
|
3635
|
+
...list.pagination,
|
|
3636
|
+
disabled: list.refreshing,
|
|
3637
|
+
label: labels.pages,
|
|
3638
|
+
previous: labels.previous,
|
|
3639
|
+
next: labels.next,
|
|
3640
|
+
pageLabel: (n) => formatMessage(locale, labels.page, { page: fmt.number(n) })
|
|
3641
|
+
}
|
|
3642
|
+
),
|
|
3643
|
+
/* @__PURE__ */ jsx20(Text3, { textStyle: "caption", color: "fg.muted", fontVariantNumeric: "tabular-nums", "aria-live": "polite", children: formatMessage(locale, labels.range, { from: fmt.number(from), to: fmt.number(to), total: fmt.number(list.total) }) })
|
|
3644
|
+
] });
|
|
3645
|
+
}
|
|
3646
|
+
|
|
3647
|
+
// src/utils/settled.ts
|
|
3648
|
+
import { useEffect as useEffect6, useState as useState8 } from "react";
|
|
3649
|
+
function useSettledValue(value, ms = 250) {
|
|
3650
|
+
const [settled, setSettled] = useState8(value);
|
|
3651
|
+
useEffect6(() => {
|
|
3652
|
+
const timer = setTimeout(() => setSettled(value), ms);
|
|
3653
|
+
return () => clearTimeout(timer);
|
|
3654
|
+
}, [value, ms]);
|
|
3655
|
+
return settled;
|
|
3656
|
+
}
|
|
3657
|
+
|
|
3541
3658
|
// src/components/SearchPicker.tsx
|
|
3542
|
-
import { Fragment as Fragment3, useEffect as
|
|
3543
|
-
import { Box as Box2, chakra as
|
|
3659
|
+
import { Fragment as Fragment3, useEffect as useEffect7, useId as useId2, useMemo as useMemo5, useState as useState9 } from "react";
|
|
3660
|
+
import { Box as Box2, chakra as chakra9, Input as Input3, Spinner as Spinner2, Text as Text4 } from "@chakra-ui/react";
|
|
3544
3661
|
import { Plus } from "lucide-react";
|
|
3545
|
-
import { Fragment as Fragment4, jsx as
|
|
3662
|
+
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3546
3663
|
var CREATE = /* @__PURE__ */ Symbol("create");
|
|
3547
3664
|
var SHOWN2 = 8;
|
|
3548
3665
|
function Highlight({ text, query }) {
|
|
3549
3666
|
const q = query.trim();
|
|
3550
|
-
if (!q) return /* @__PURE__ */
|
|
3667
|
+
if (!q) return /* @__PURE__ */ jsx21(Fragment4, { children: text });
|
|
3551
3668
|
const lower = text.toLowerCase();
|
|
3552
3669
|
const needle = q.toLowerCase();
|
|
3553
3670
|
const parts = [];
|
|
3554
3671
|
let at = 0;
|
|
3555
3672
|
for (let i = lower.indexOf(needle); i >= 0; i = lower.indexOf(needle, at)) {
|
|
3556
3673
|
if (i > at) parts.push(text.slice(at, i));
|
|
3557
|
-
parts.push(/* @__PURE__ */
|
|
3674
|
+
parts.push(/* @__PURE__ */ jsx21(chakra9.strong, { fontWeight: "bold", children: text.slice(i, i + q.length) }, i));
|
|
3558
3675
|
at = i + q.length;
|
|
3559
3676
|
}
|
|
3560
|
-
if (parts.length === 0) return /* @__PURE__ */
|
|
3677
|
+
if (parts.length === 0) return /* @__PURE__ */ jsx21(Fragment4, { children: text });
|
|
3561
3678
|
parts.push(text.slice(at));
|
|
3562
|
-
return /* @__PURE__ */
|
|
3679
|
+
return /* @__PURE__ */ jsx21(Fragment4, { children: parts.map((p, i) => /* @__PURE__ */ jsx21(Fragment3, { children: p }, i)) });
|
|
3563
3680
|
}
|
|
3564
3681
|
function useSettled(value, ms) {
|
|
3565
|
-
const [settled, setSettled] =
|
|
3566
|
-
|
|
3682
|
+
const [settled, setSettled] = useState9(value);
|
|
3683
|
+
useEffect7(() => {
|
|
3567
3684
|
const timer = setTimeout(() => setSettled(value), ms);
|
|
3568
3685
|
return () => clearTimeout(timer);
|
|
3569
3686
|
}, [value, ms]);
|
|
@@ -3590,15 +3707,15 @@ function SearchPicker({
|
|
|
3590
3707
|
const labels = useAbpLabels().picker;
|
|
3591
3708
|
const { locale } = useAbpLocale();
|
|
3592
3709
|
const messages = { placeholder: labels.placeholder, searching: labels.searching, noMatches: labels.noMatches, noKnown: labels.noKnown, ...own };
|
|
3593
|
-
const [creating, setCreating] =
|
|
3594
|
-
const [open, setOpen] =
|
|
3595
|
-
const [query, setQuery] =
|
|
3596
|
-
const [active, setActive] =
|
|
3597
|
-
const [found, setFound] =
|
|
3598
|
-
const [failed, setFailed] =
|
|
3710
|
+
const [creating, setCreating] = useState9(false);
|
|
3711
|
+
const [open, setOpen] = useState9(false);
|
|
3712
|
+
const [query, setQuery] = useState9("");
|
|
3713
|
+
const [active, setActive] = useState9(0);
|
|
3714
|
+
const [found, setFound] = useState9(null);
|
|
3715
|
+
const [failed, setFailed] = useState9(false);
|
|
3599
3716
|
const settled = useSettled(query, 200);
|
|
3600
3717
|
const canSearch = search != null;
|
|
3601
|
-
|
|
3718
|
+
useEffect7(() => {
|
|
3602
3719
|
if (!open || !search) return;
|
|
3603
3720
|
let cancelled = false;
|
|
3604
3721
|
search(settled.trim()).then((list) => {
|
|
@@ -3658,8 +3775,8 @@ function SearchPicker({
|
|
|
3658
3775
|
setQuery("");
|
|
3659
3776
|
}
|
|
3660
3777
|
}
|
|
3661
|
-
return /* @__PURE__ */
|
|
3662
|
-
/* @__PURE__ */
|
|
3778
|
+
return /* @__PURE__ */ jsxs12(Box2, { position: "relative", width: "full", children: [
|
|
3779
|
+
/* @__PURE__ */ jsx21(
|
|
3663
3780
|
Input3,
|
|
3664
3781
|
{
|
|
3665
3782
|
id,
|
|
@@ -3689,8 +3806,8 @@ function SearchPicker({
|
|
|
3689
3806
|
onKeyDown
|
|
3690
3807
|
}
|
|
3691
3808
|
),
|
|
3692
|
-
open && /* @__PURE__ */
|
|
3693
|
-
|
|
3809
|
+
open && /* @__PURE__ */ jsxs12(
|
|
3810
|
+
chakra9.ul,
|
|
3694
3811
|
{
|
|
3695
3812
|
id: listId,
|
|
3696
3813
|
role: "listbox",
|
|
@@ -3709,10 +3826,10 @@ function SearchPicker({
|
|
|
3709
3826
|
py: "1",
|
|
3710
3827
|
listStyleType: "none",
|
|
3711
3828
|
children: [
|
|
3712
|
-
query.trim() && matches > 0 && /* @__PURE__ */
|
|
3713
|
-
options.length === 0 && /* @__PURE__ */
|
|
3714
|
-
options.map((item, i) => /* @__PURE__ */
|
|
3715
|
-
|
|
3829
|
+
query.trim() && matches > 0 && /* @__PURE__ */ jsx21(Text4, { as: "li", px: "3", pt: "1", pb: "1.5", textStyle: "caption", color: "fg.muted", "aria-live": "polite", "data-match-count": "", children: formatMessage(locale, canSearch && !failed && found != null && found.length >= SHOWN2 ? labels.firstMatches : labels.matches, { count: matches }) }),
|
|
3830
|
+
options.length === 0 && /* @__PURE__ */ jsx21(Text4, { as: "li", px: "3", py: "2", textStyle: "caption", color: "fg.muted", children: canSearch && !failed ? found == null ? messages.searching : messages.noMatches : messages.noKnown }),
|
|
3831
|
+
options.map((item, i) => /* @__PURE__ */ jsx21(
|
|
3832
|
+
chakra9.li,
|
|
3716
3833
|
{
|
|
3717
3834
|
role: "option",
|
|
3718
3835
|
"aria-selected": i === active,
|
|
@@ -3726,14 +3843,14 @@ function SearchPicker({
|
|
|
3726
3843
|
void choose(item);
|
|
3727
3844
|
},
|
|
3728
3845
|
"data-create": item === CREATE ? "" : void 0,
|
|
3729
|
-
children: item === CREATE ? /* @__PURE__ */
|
|
3730
|
-
creating ? /* @__PURE__ */
|
|
3846
|
+
children: item === CREATE ? /* @__PURE__ */ jsxs12(Text4, { as: "span", display: "inline-flex", alignItems: "center", gap: "1.5", textStyle: "body.sm", color: "fg.accent", _icon: { boxSize: "3.5" }, children: [
|
|
3847
|
+
creating ? /* @__PURE__ */ jsx21(Spinner2, { size: "xs" }) : /* @__PURE__ */ jsx21(Plus, {}),
|
|
3731
3848
|
create.label(query.trim())
|
|
3732
|
-
] }) : item ? renderOption ? renderOption(item, query) : /* @__PURE__ */
|
|
3849
|
+
] }) : item ? renderOption ? renderOption(item, query) : /* @__PURE__ */ jsx21(Text4, { as: "span", textStyle: "body.sm", children: /* @__PURE__ */ jsx21(Highlight, { text: label(item), query }) }) : /* @__PURE__ */ jsx21(Text4, { as: "span", textStyle: "body.sm", color: "fg.muted", children: clearLabel })
|
|
3733
3850
|
},
|
|
3734
3851
|
item === CREATE ? "create" : item ? getId(item) : "none"
|
|
3735
3852
|
)),
|
|
3736
|
-
!canSearch && messages.limitedHint && /* @__PURE__ */
|
|
3853
|
+
!canSearch && messages.limitedHint && /* @__PURE__ */ jsx21(Text4, { as: "li", px: "3", pt: "1.5", pb: "1", textStyle: "caption", color: "fg.subtle", borderTopWidth: "1px", borderColor: "border.muted", mt: "1", children: messages.limitedHint })
|
|
3737
3854
|
]
|
|
3738
3855
|
}
|
|
3739
3856
|
)
|
|
@@ -3746,18 +3863,18 @@ function PersonPicker({
|
|
|
3746
3863
|
...rest
|
|
3747
3864
|
}) {
|
|
3748
3865
|
const labels = useAbpLabels().picker;
|
|
3749
|
-
return /* @__PURE__ */
|
|
3866
|
+
return /* @__PURE__ */ jsx21(
|
|
3750
3867
|
SearchPicker,
|
|
3751
3868
|
{
|
|
3752
3869
|
...rest,
|
|
3753
3870
|
getId: (p) => p.id,
|
|
3754
3871
|
label: (p) => personLabel(p),
|
|
3755
|
-
renderOption: (p, typed) => /* @__PURE__ */
|
|
3756
|
-
/* @__PURE__ */
|
|
3872
|
+
renderOption: (p, typed) => /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
3873
|
+
/* @__PURE__ */ jsx21(Text4, { as: "span", textStyle: "body.sm", fontWeight: "medium", children: /* @__PURE__ */ jsx21(Highlight, { text: p.displayName || p.username, query: typed }) }),
|
|
3757
3874
|
" ",
|
|
3758
|
-
/* @__PURE__ */
|
|
3875
|
+
/* @__PURE__ */ jsxs12(Text4, { as: "span", textStyle: "caption", color: "fg.muted", dir: "ltr", children: [
|
|
3759
3876
|
"@",
|
|
3760
|
-
/* @__PURE__ */
|
|
3877
|
+
/* @__PURE__ */ jsx21(Highlight, { text: p.username, query: typed })
|
|
3761
3878
|
] }),
|
|
3762
3879
|
badge?.(p)
|
|
3763
3880
|
] }),
|
|
@@ -3772,7 +3889,7 @@ function PersonPicker({
|
|
|
3772
3889
|
}
|
|
3773
3890
|
function GroupPicker({ messages, ...rest }) {
|
|
3774
3891
|
const labels = useAbpLabels().picker;
|
|
3775
|
-
return /* @__PURE__ */
|
|
3892
|
+
return /* @__PURE__ */ jsx21(
|
|
3776
3893
|
SearchPicker,
|
|
3777
3894
|
{
|
|
3778
3895
|
known: rest.value ? [rest.value] : [],
|
|
@@ -3785,7 +3902,7 @@ function GroupPicker({ messages, ...rest }) {
|
|
|
3785
3902
|
}
|
|
3786
3903
|
|
|
3787
3904
|
// src/provider/title.tsx
|
|
3788
|
-
import { createContext as createContext10, useContext as useContext10, useEffect as
|
|
3905
|
+
import { createContext as createContext10, useContext as useContext10, useEffect as useEffect8, useRef as useRef7, useState as useState10, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
3789
3906
|
|
|
3790
3907
|
// src/provider/title-claims.ts
|
|
3791
3908
|
var TITLE_SEPARATOR = " \xB7 ";
|
|
@@ -3856,18 +3973,18 @@ var TitleStore = class {
|
|
|
3856
3973
|
};
|
|
3857
3974
|
|
|
3858
3975
|
// src/provider/title.tsx
|
|
3859
|
-
import { jsx as
|
|
3976
|
+
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3860
3977
|
var TitleContext = createContext10(null);
|
|
3861
3978
|
var EMPTY = { parts: [], site: void 0 };
|
|
3862
3979
|
var noSubscription = () => () => {
|
|
3863
3980
|
};
|
|
3864
3981
|
function PageTitleProvider({ site, children }) {
|
|
3865
|
-
const [store] =
|
|
3982
|
+
const [store] = useState10(() => new TitleStore());
|
|
3866
3983
|
const { parts, site: claimed } = useSyncExternalStore2(store.subscribe, store.current, store.current);
|
|
3867
3984
|
const { isRtl } = useAbpLocale();
|
|
3868
3985
|
const text = composeTitle(parts, claimed ?? site, isRtl);
|
|
3869
|
-
return /* @__PURE__ */
|
|
3870
|
-
text && /* @__PURE__ */
|
|
3986
|
+
return /* @__PURE__ */ jsxs13(TitleContext.Provider, { value: store, children: [
|
|
3987
|
+
text && /* @__PURE__ */ jsx22("title", { children: text }),
|
|
3871
3988
|
children
|
|
3872
3989
|
] });
|
|
3873
3990
|
}
|
|
@@ -3876,26 +3993,26 @@ function usePageTitle(title) {
|
|
|
3876
3993
|
const id = useRef7(0);
|
|
3877
3994
|
const parts = partsOf(title);
|
|
3878
3995
|
const key = parts.join("\0");
|
|
3879
|
-
|
|
3996
|
+
useEffect8(() => {
|
|
3880
3997
|
if (!store) return;
|
|
3881
3998
|
const mine = store.open();
|
|
3882
3999
|
id.current = mine;
|
|
3883
4000
|
return () => store.setParts(mine, null);
|
|
3884
4001
|
}, [store]);
|
|
3885
|
-
|
|
4002
|
+
useEffect8(() => {
|
|
3886
4003
|
if (store && id.current) store.setParts(id.current, key ? key.split("\0") : null);
|
|
3887
4004
|
}, [store, key]);
|
|
3888
4005
|
}
|
|
3889
4006
|
function usePageTitleSite(name) {
|
|
3890
4007
|
const store = useContext10(TitleContext);
|
|
3891
4008
|
const id = useRef7(0);
|
|
3892
|
-
|
|
4009
|
+
useEffect8(() => {
|
|
3893
4010
|
if (!store) return;
|
|
3894
4011
|
const mine = store.open();
|
|
3895
4012
|
id.current = mine;
|
|
3896
4013
|
return () => store.setSite(mine, null);
|
|
3897
4014
|
}, [store]);
|
|
3898
|
-
|
|
4015
|
+
useEffect8(() => {
|
|
3899
4016
|
if (store && id.current) store.setSite(id.current, name ?? null);
|
|
3900
4017
|
}, [store, name]);
|
|
3901
4018
|
}
|
|
@@ -3911,9 +4028,9 @@ function compareOrdinal(a, b) {
|
|
|
3911
4028
|
}
|
|
3912
4029
|
|
|
3913
4030
|
// src/motion/components.tsx
|
|
3914
|
-
import { Children, cloneElement, isValidElement, useEffect as
|
|
4031
|
+
import { Children, cloneElement, isValidElement, useEffect as useEffect9, useLayoutEffect as useLayoutEffect2, useRef as useRef9 } from "react";
|
|
3915
4032
|
import { AnimatePresence as AnimatePresence2, m as m2 } from "motion/react";
|
|
3916
|
-
import { chakra as
|
|
4033
|
+
import { chakra as chakra10 } from "@chakra-ui/react";
|
|
3917
4034
|
|
|
3918
4035
|
// src/motion/flip-math.ts
|
|
3919
4036
|
function flipTransform(prev, next, scale) {
|
|
@@ -4033,10 +4150,10 @@ function useSlideItems(container, token, options = {}) {
|
|
|
4033
4150
|
}
|
|
4034
4151
|
|
|
4035
4152
|
// src/motion/components.tsx
|
|
4036
|
-
import { Fragment as Fragment5, jsx as
|
|
4037
|
-
var MotionDiv =
|
|
4038
|
-
var MotionSpan2 =
|
|
4039
|
-
var MotionLi =
|
|
4153
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4154
|
+
var MotionDiv = chakra10(m2.div, {}, { forwardProps: ["transition"] });
|
|
4155
|
+
var MotionSpan2 = chakra10(m2.span, {}, { forwardProps: ["transition"] });
|
|
4156
|
+
var MotionLi = chakra10(m2.li, {}, { forwardProps: ["transition"] });
|
|
4040
4157
|
var OUT = `cubic-bezier(${curves.out.join(", ")})`;
|
|
4041
4158
|
var easeOut = cubicBezier(...curves.out);
|
|
4042
4159
|
var SETTLED = { ...SHOWN, transitionEnd: { transform: "none" } };
|
|
@@ -4047,19 +4164,19 @@ function useArrival(kind) {
|
|
|
4047
4164
|
}
|
|
4048
4165
|
function FadeIn({ from = "fade", delay = 0, children, ...rest }) {
|
|
4049
4166
|
const hidden = useArrival(from);
|
|
4050
|
-
return /* @__PURE__ */
|
|
4167
|
+
return /* @__PURE__ */ jsx23(MotionDiv, { initial: hidden, animate: SETTLED, transition: { duration: durations2.base, ease: curves.out, delay }, ...rest, children });
|
|
4051
4168
|
}
|
|
4052
4169
|
function Reveal({ from = "rise", itemAs = "div", children, ...rest }) {
|
|
4053
4170
|
let index = 0;
|
|
4054
|
-
return /* @__PURE__ */
|
|
4171
|
+
return /* @__PURE__ */ jsx23(chakra10.div, { ...rest, children: Children.map(
|
|
4055
4172
|
children,
|
|
4056
|
-
(child) => isValidElement(child) || child != null && child !== false ? /* @__PURE__ */
|
|
4173
|
+
(child) => isValidElement(child) || child != null && child !== false ? /* @__PURE__ */ jsx23(RevealItem, { as: itemAs, index: index++, from, children: child }) : null
|
|
4057
4174
|
) });
|
|
4058
4175
|
}
|
|
4059
4176
|
function RevealItem({ index, from = "rise", as = "div", children, ...rest }) {
|
|
4060
4177
|
const hidden = useArrival(from);
|
|
4061
4178
|
const Element2 = as === "span" ? MotionSpan2 : as === "li" ? MotionLi : MotionDiv;
|
|
4062
|
-
return /* @__PURE__ */
|
|
4179
|
+
return /* @__PURE__ */ jsx23(
|
|
4063
4180
|
Element2,
|
|
4064
4181
|
{
|
|
4065
4182
|
initial: hidden,
|
|
@@ -4072,7 +4189,7 @@ function RevealItem({ index, from = "rise", as = "div", children, ...rest }) {
|
|
|
4072
4189
|
}
|
|
4073
4190
|
function Presence({ show, from = "pop", appear = false, children, ...rest }) {
|
|
4074
4191
|
const hidden = useArrival(from);
|
|
4075
|
-
return /* @__PURE__ */
|
|
4192
|
+
return /* @__PURE__ */ jsx23(AnimatePresence2, { initial: appear, children: show && /* @__PURE__ */ jsx23(MotionDiv, { initial: hidden, animate: SHOWN, exit: hidden, transition: { duration: durations2.base, ease: curves.out }, ...rest, children }, "presence") });
|
|
4076
4193
|
}
|
|
4077
4194
|
function PresenceList({ children }) {
|
|
4078
4195
|
const marker = useRef9(null);
|
|
@@ -4082,9 +4199,9 @@ function PresenceList({ children }) {
|
|
|
4082
4199
|
parent.current = marker.current?.parentElement ?? null;
|
|
4083
4200
|
});
|
|
4084
4201
|
useSlideItems(parent, keys);
|
|
4085
|
-
return /* @__PURE__ */
|
|
4086
|
-
/* @__PURE__ */
|
|
4087
|
-
/* @__PURE__ */
|
|
4202
|
+
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
4203
|
+
/* @__PURE__ */ jsx23(chakra10.span, { ref: marker, display: "none", "aria-hidden": "true" }),
|
|
4204
|
+
/* @__PURE__ */ jsx23(AnimatePresence2, { initial: false, mode: "popLayout", children: Children.map(
|
|
4088
4205
|
children,
|
|
4089
4206
|
(child) => isValidElement(child) ? cloneElement(child, { "data-slide": String(child.key) }) : child
|
|
4090
4207
|
) })
|
|
@@ -4093,7 +4210,7 @@ function PresenceList({ children }) {
|
|
|
4093
4210
|
function PresenceItem({ from = "rise", as = "div", children, ...rest }) {
|
|
4094
4211
|
const hidden = useArrival(from);
|
|
4095
4212
|
const Element2 = as === "li" ? MotionLi : MotionDiv;
|
|
4096
|
-
return /* @__PURE__ */
|
|
4213
|
+
return /* @__PURE__ */ jsx23(
|
|
4097
4214
|
Element2,
|
|
4098
4215
|
{
|
|
4099
4216
|
initial: hidden,
|
|
@@ -4108,13 +4225,13 @@ function PresenceItem({ from = "rise", as = "div", children, ...rest }) {
|
|
|
4108
4225
|
function SlideList({ token, children, ...rest }) {
|
|
4109
4226
|
const ref = useRef9(null);
|
|
4110
4227
|
useSlideItems(ref, token);
|
|
4111
|
-
return /* @__PURE__ */
|
|
4228
|
+
return /* @__PURE__ */ jsx23(chakra10.div, { ref, ...rest, children });
|
|
4112
4229
|
}
|
|
4113
4230
|
function SlideItem({ slideId, children, ...rest }) {
|
|
4114
|
-
return /* @__PURE__ */
|
|
4231
|
+
return /* @__PURE__ */ jsx23(chakra10.div, { "data-slide": slideId, ...rest, children });
|
|
4115
4232
|
}
|
|
4116
4233
|
function Collapse({ open, children, ...rest }) {
|
|
4117
|
-
return /* @__PURE__ */
|
|
4234
|
+
return /* @__PURE__ */ jsx23(AnimatePresence2, { initial: false, children: open && /* @__PURE__ */ jsx23(
|
|
4118
4235
|
MotionDiv,
|
|
4119
4236
|
{
|
|
4120
4237
|
overflow: "hidden",
|
|
@@ -4130,7 +4247,7 @@ function Collapse({ open, children, ...rest }) {
|
|
|
4130
4247
|
}
|
|
4131
4248
|
function Swap({ swapKey, from = "rise", children, ...rest }) {
|
|
4132
4249
|
const hidden = useArrival(from);
|
|
4133
|
-
return /* @__PURE__ */
|
|
4250
|
+
return /* @__PURE__ */ jsx23(AnimatePresence2, { initial: false, mode: "popLayout", children: /* @__PURE__ */ jsx23(
|
|
4134
4251
|
MotionSpan2,
|
|
4135
4252
|
{
|
|
4136
4253
|
display: "inline-block",
|
|
@@ -4150,7 +4267,7 @@ function Counter({ value, format, fromZero = true, ...rest }) {
|
|
|
4150
4267
|
const ref = useRef9(null);
|
|
4151
4268
|
const shown = useRef9(fromZero ? 0 : value);
|
|
4152
4269
|
const write = format ?? ((n) => new Intl.NumberFormat(locale, { numberingSystem: "latn", maximumFractionDigits: Number.isInteger(value) ? 0 : 1 }).format(n));
|
|
4153
|
-
|
|
4270
|
+
useEffect9(() => {
|
|
4154
4271
|
const element = ref.current;
|
|
4155
4272
|
if (!element) return;
|
|
4156
4273
|
if (reduce) {
|
|
@@ -4172,7 +4289,7 @@ function Counter({ value, format, fromZero = true, ...rest }) {
|
|
|
4172
4289
|
frame = requestAnimationFrame(step);
|
|
4173
4290
|
return () => cancelAnimationFrame(frame);
|
|
4174
4291
|
}, [value, reduce, locale]);
|
|
4175
|
-
return /* @__PURE__ */
|
|
4292
|
+
return /* @__PURE__ */ jsx23(chakra10.span, { ref, fontVariantNumeric: "tabular-nums", ...rest, children: write(reduce || !fromZero ? value : shown.current) });
|
|
4176
4293
|
}
|
|
4177
4294
|
var lastMarks = /* @__PURE__ */ new Map();
|
|
4178
4295
|
function Indicator({ group, css }) {
|
|
@@ -4187,11 +4304,11 @@ function Indicator({ group, css }) {
|
|
|
4187
4304
|
if (before && !reduce) slide(element, before, now, { scale: true });
|
|
4188
4305
|
lastMarks.set(group, now);
|
|
4189
4306
|
});
|
|
4190
|
-
return /* @__PURE__ */
|
|
4307
|
+
return /* @__PURE__ */ jsx23(chakra10.span, { ref, "aria-hidden": "true", css });
|
|
4191
4308
|
}
|
|
4192
4309
|
function Pressable({ lift = false, css, ...rest }) {
|
|
4193
|
-
return /* @__PURE__ */
|
|
4194
|
-
|
|
4310
|
+
return /* @__PURE__ */ jsx23(
|
|
4311
|
+
chakra10.div,
|
|
4195
4312
|
{
|
|
4196
4313
|
css: {
|
|
4197
4314
|
transitionProperty: "transform, box-shadow",
|
|
@@ -4210,20 +4327,20 @@ function Pressable({ lift = false, css, ...rest }) {
|
|
|
4210
4327
|
function ArriveOnChange({ token, children, ...rest }) {
|
|
4211
4328
|
const ref = useRef9(null);
|
|
4212
4329
|
const first = useRef9(true);
|
|
4213
|
-
|
|
4330
|
+
useEffect9(() => {
|
|
4214
4331
|
if (first.current) {
|
|
4215
4332
|
first.current = false;
|
|
4216
4333
|
return;
|
|
4217
4334
|
}
|
|
4218
4335
|
ref.current?.animate?.([{ opacity: 0.55 }, { opacity: 1 }], { duration: durations2.quick * 1e3, easing: OUT });
|
|
4219
4336
|
}, [token]);
|
|
4220
|
-
return /* @__PURE__ */
|
|
4337
|
+
return /* @__PURE__ */ jsx23(chakra10.div, { ref, ...rest, children });
|
|
4221
4338
|
}
|
|
4222
4339
|
function Nudge({ on, children }) {
|
|
4223
4340
|
const { reduce } = useMotionSetting();
|
|
4224
4341
|
const ref = useRef9(null);
|
|
4225
4342
|
const last = useRef9(null);
|
|
4226
|
-
|
|
4343
|
+
useEffect9(() => {
|
|
4227
4344
|
const before = last.current;
|
|
4228
4345
|
last.current = on;
|
|
4229
4346
|
if (before == null || on <= before || reduce) return;
|
|
@@ -4232,39 +4349,28 @@ function Nudge({ on, children }) {
|
|
|
4232
4349
|
{ duration: durations2.burst * 1e3, easing: OUT }
|
|
4233
4350
|
);
|
|
4234
4351
|
}, [on, reduce]);
|
|
4235
|
-
return /* @__PURE__ */
|
|
4352
|
+
return /* @__PURE__ */ jsx23(chakra10.span, { ref, display: "inline-flex", transformOrigin: "top center", children });
|
|
4236
4353
|
}
|
|
4237
4354
|
|
|
4238
4355
|
// src/components/AppShell.tsx
|
|
4239
|
-
import { Fragment as Fragment6, useCallback as useCallback8, useState as
|
|
4240
|
-
import { chakra as
|
|
4356
|
+
import { Fragment as Fragment6, useCallback as useCallback8, useState as useState11 } from "react";
|
|
4357
|
+
import { chakra as chakra11, Drawer, Portal as Portal7, SkipNavContent, SkipNavLink, useSlotRecipe } from "@chakra-ui/react";
|
|
4241
4358
|
import { ChevronDown, Menu as MenuIcon, PanelLeftClose, PanelLeftOpen, X } from "lucide-react";
|
|
4242
4359
|
|
|
4243
|
-
// src/components/DirectionalIcon.tsx
|
|
4244
|
-
import { chakra as chakra9 } from "@chakra-ui/react";
|
|
4245
|
-
var DirectionalIcon = chakra9("span", {
|
|
4246
|
-
base: {
|
|
4247
|
-
display: "inline-flex",
|
|
4248
|
-
alignItems: "center",
|
|
4249
|
-
justifyContent: "center",
|
|
4250
|
-
_rtl: { transform: "scaleX(-1)" }
|
|
4251
|
-
}
|
|
4252
|
-
});
|
|
4253
|
-
|
|
4254
4360
|
// src/components/Tooltip.tsx
|
|
4255
4361
|
import { forwardRef as forwardRef4 } from "react";
|
|
4256
4362
|
import { Portal as Portal6, Tooltip as ChakraTooltip } from "@chakra-ui/react";
|
|
4257
|
-
import { jsx as
|
|
4363
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4258
4364
|
var Tooltip = forwardRef4(function Tooltip2({ content, children, disabled, inactive, openDelay = 400, closeDelay = 0, ...rest }, ref) {
|
|
4259
4365
|
if (disabled) return children;
|
|
4260
|
-
return /* @__PURE__ */
|
|
4261
|
-
/* @__PURE__ */
|
|
4262
|
-
/* @__PURE__ */
|
|
4366
|
+
return /* @__PURE__ */ jsxs15(ChakraTooltip.Root, { openDelay, closeDelay, disabled: inactive, ...rest, children: [
|
|
4367
|
+
/* @__PURE__ */ jsx24(ChakraTooltip.Trigger, { asChild: true, children }),
|
|
4368
|
+
/* @__PURE__ */ jsx24(Portal6, { children: /* @__PURE__ */ jsx24(ChakraTooltip.Positioner, { children: /* @__PURE__ */ jsx24(ChakraTooltip.Content, { ref, children: content }) }) })
|
|
4263
4369
|
] });
|
|
4264
4370
|
});
|
|
4265
4371
|
|
|
4266
4372
|
// src/components/AppShell.tsx
|
|
4267
|
-
import { Fragment as Fragment7, jsx as
|
|
4373
|
+
import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4268
4374
|
var MAIN_ID = "abp-main";
|
|
4269
4375
|
function AppShell({
|
|
4270
4376
|
brand,
|
|
@@ -4283,9 +4389,9 @@ function AppShell({
|
|
|
4283
4389
|
}) {
|
|
4284
4390
|
const labels = useAbpLabels();
|
|
4285
4391
|
const Link = useLinkComponent();
|
|
4286
|
-
const [collapsedState, setCollapsedState] =
|
|
4392
|
+
const [collapsedState, setCollapsedState] = useState11(defaultCollapsed);
|
|
4287
4393
|
const collapsed = collapsedProp ?? collapsedState;
|
|
4288
|
-
const [mobileOpen, setMobileOpen] =
|
|
4394
|
+
const [mobileOpen, setMobileOpen] = useState11(false);
|
|
4289
4395
|
const recipe = useSlotRecipe({ key: "abpAppShell" });
|
|
4290
4396
|
const styles = recipe({ collapsed });
|
|
4291
4397
|
const mobileStyles = recipe({ collapsed: false });
|
|
@@ -4296,39 +4402,39 @@ function AppShell({
|
|
|
4296
4402
|
onCollapsedChange?.(next);
|
|
4297
4403
|
}, [collapsed, onCollapsedChange]);
|
|
4298
4404
|
const mark2 = brand.mark ?? (typeof brand.name === "string" ? brand.name.slice(0, 1) : null);
|
|
4299
|
-
const brandInner = /* @__PURE__ */
|
|
4300
|
-
/* @__PURE__ */
|
|
4301
|
-
/* @__PURE__ */
|
|
4405
|
+
const brandInner = /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
4406
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.brandMark, "aria-hidden": "true", children: mark2 }),
|
|
4407
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.brandText, children: /* @__PURE__ */ jsx25(chakra11.span, { css: styles.brandName, children: brand.name }) })
|
|
4302
4408
|
] });
|
|
4303
|
-
return /* @__PURE__ */
|
|
4304
|
-
/* @__PURE__ */
|
|
4305
|
-
/* @__PURE__ */
|
|
4306
|
-
/* @__PURE__ */
|
|
4307
|
-
brand.href ? /* @__PURE__ */
|
|
4308
|
-
topbarStart != null && /* @__PURE__ */
|
|
4309
|
-
/* @__PURE__ */
|
|
4310
|
-
topNav.map((item) => /* @__PURE__ */
|
|
4409
|
+
return /* @__PURE__ */ jsxs16(chakra11.div, { css: styles.root, children: [
|
|
4410
|
+
/* @__PURE__ */ jsx25(SkipNavLink, { id: MAIN_ID, children: labels.skipToContent }),
|
|
4411
|
+
/* @__PURE__ */ jsxs16(chakra11.header, { css: styles.topbar, children: [
|
|
4412
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.mobileToggle, children: /* @__PURE__ */ jsx25(IconButton, { size: "sm", "aria-label": labels.openNavigation, onClick: () => setMobileOpen(true), children: /* @__PURE__ */ jsx25(MenuIcon, {}) }) }),
|
|
4413
|
+
brand.href ? /* @__PURE__ */ jsx25(chakra11.span, { asChild: true, css: styles.brand, children: /* @__PURE__ */ jsx25(Link, { href: brand.href, children: brandInner }) }) : /* @__PURE__ */ jsx25(chakra11.span, { css: styles.brand, children: brandInner }),
|
|
4414
|
+
topbarStart != null && /* @__PURE__ */ jsx25(chakra11.div, { css: styles.topbarStart, children: topbarStart }),
|
|
4415
|
+
/* @__PURE__ */ jsxs16(chakra11.nav, { css: styles.topNav, "aria-label": labels.navigation, children: [
|
|
4416
|
+
topNav.map((item) => /* @__PURE__ */ jsx25(TopNavItem, { item, styles }, item.id)),
|
|
4311
4417
|
topNavEnd
|
|
4312
4418
|
] }),
|
|
4313
|
-
/* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ jsx25(chakra11.div, { css: styles.topbarEnd, children: topbarEnd })
|
|
4314
4420
|
] }),
|
|
4315
|
-
/* @__PURE__ */
|
|
4316
|
-
hasSidebar && /* @__PURE__ */
|
|
4317
|
-
/* @__PURE__ */
|
|
4318
|
-
/* @__PURE__ */
|
|
4319
|
-
/* @__PURE__ */
|
|
4320
|
-
/* @__PURE__ */
|
|
4421
|
+
/* @__PURE__ */ jsxs16(chakra11.div, { css: styles.body, children: [
|
|
4422
|
+
hasSidebar && /* @__PURE__ */ jsxs16(chakra11.aside, { css: styles.sidebar, "aria-label": sidebar.place?.name ?? labels.navigation, "data-collapsed": collapsed || void 0, children: [
|
|
4423
|
+
/* @__PURE__ */ jsx25(FadeIn, { from: "start", display: "flex", flexDirection: "column", minH: "0", flex: "1", children: /* @__PURE__ */ jsx25(SidebarContents, { styles, sidebar, navFooter, collapsed }) }, sidebar.id),
|
|
4424
|
+
/* @__PURE__ */ jsxs16(chakra11.div, { css: styles.sidebarFooter, children: [
|
|
4425
|
+
/* @__PURE__ */ jsx25(IconButton, { size: "sm", "aria-label": collapsed ? labels.expandSidebar : labels.collapseSidebar, "aria-expanded": !collapsed, onClick: toggle, children: /* @__PURE__ */ jsx25(Swap, { swapKey: collapsed ? "open" : "close", from: "fade", children: /* @__PURE__ */ jsx25(DirectionalIcon, { children: collapsed ? /* @__PURE__ */ jsx25(PanelLeftOpen, {}) : /* @__PURE__ */ jsx25(PanelLeftClose, {}) }) }) }),
|
|
4426
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.sidebarFooterText, "aria-hidden": collapsed || void 0, children: sidebarFooter })
|
|
4321
4427
|
] })
|
|
4322
4428
|
] }),
|
|
4323
|
-
/* @__PURE__ */
|
|
4324
|
-
/* @__PURE__ */
|
|
4325
|
-
/* @__PURE__ */
|
|
4429
|
+
/* @__PURE__ */ jsxs16(chakra11.div, { css: styles.main, children: [
|
|
4430
|
+
/* @__PURE__ */ jsx25(SkipNavContent, { id: MAIN_ID }),
|
|
4431
|
+
/* @__PURE__ */ jsx25(chakra11.main, { css: styles.content, children: /* @__PURE__ */ jsx25(ArriveOnChange, { token: pageKey ?? "", css: styles.contentInner, children }) })
|
|
4326
4432
|
] })
|
|
4327
4433
|
] }),
|
|
4328
|
-
/* @__PURE__ */
|
|
4329
|
-
/* @__PURE__ */
|
|
4330
|
-
/* @__PURE__ */
|
|
4331
|
-
|
|
4434
|
+
/* @__PURE__ */ jsx25(Drawer.Root, { open: mobileOpen, onOpenChange: (e) => setMobileOpen(e.open), placement: "start", size: "xs", children: /* @__PURE__ */ jsxs16(Portal7, { children: [
|
|
4435
|
+
/* @__PURE__ */ jsx25(Drawer.Backdrop, {}),
|
|
4436
|
+
/* @__PURE__ */ jsx25(Drawer.Positioner, { children: /* @__PURE__ */ jsx25(Drawer.Content, { "aria-label": labels.navigation, children: /* @__PURE__ */ jsxs16(
|
|
4437
|
+
chakra11.div,
|
|
4332
4438
|
{
|
|
4333
4439
|
css: mobileStyles.sidebar,
|
|
4334
4440
|
"data-mobile": "",
|
|
@@ -4336,11 +4442,11 @@ function AppShell({
|
|
|
4336
4442
|
if (e.target.closest("a")) setMobileOpen(false);
|
|
4337
4443
|
},
|
|
4338
4444
|
children: [
|
|
4339
|
-
/* @__PURE__ */
|
|
4340
|
-
/* @__PURE__ */
|
|
4341
|
-
/* @__PURE__ */
|
|
4445
|
+
/* @__PURE__ */ jsxs16(chakra11.div, { css: mobileStyles.drawerHeader, children: [
|
|
4446
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: mobileStyles.brand, children: brandInner }),
|
|
4447
|
+
/* @__PURE__ */ jsx25(Drawer.CloseTrigger, { asChild: true, position: "static", children: /* @__PURE__ */ jsx25(IconButton, { size: "sm", "aria-label": labels.close, children: /* @__PURE__ */ jsx25(X, {}) }) })
|
|
4342
4448
|
] }),
|
|
4343
|
-
/* @__PURE__ */
|
|
4449
|
+
/* @__PURE__ */ jsx25(
|
|
4344
4450
|
SidebarContents,
|
|
4345
4451
|
{
|
|
4346
4452
|
styles: mobileStyles,
|
|
@@ -4365,9 +4471,9 @@ function AppShell({
|
|
|
4365
4471
|
}
|
|
4366
4472
|
function TopNavItem({ item, styles }) {
|
|
4367
4473
|
const Link = useLinkComponent();
|
|
4368
|
-
return /* @__PURE__ */
|
|
4369
|
-
item.current && /* @__PURE__ */
|
|
4370
|
-
/* @__PURE__ */
|
|
4474
|
+
return /* @__PURE__ */ jsx25(chakra11.a, { asChild: true, css: styles.topNavItem, children: /* @__PURE__ */ jsxs16(Link, { href: item.href, "aria-current": item.current ? "page" : void 0, children: [
|
|
4475
|
+
item.current && /* @__PURE__ */ jsx25(Indicator, { group: "abp-top-nav", css: styles.topNavIndicator }),
|
|
4476
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.topNavLabel, children: item.label })
|
|
4371
4477
|
] }) });
|
|
4372
4478
|
}
|
|
4373
4479
|
function SidebarContents({
|
|
@@ -4383,167 +4489,101 @@ function SidebarContents({
|
|
|
4383
4489
|
const loading = !!sidebar.loading;
|
|
4384
4490
|
const arrive = useArriving(loading) ? arriveCss : void 0;
|
|
4385
4491
|
const placeMark = place ? place.mark ?? place.name.slice(0, 1).toUpperCase() : null;
|
|
4386
|
-
const placeInner = place && /* @__PURE__ */
|
|
4387
|
-
/* @__PURE__ */
|
|
4388
|
-
/* @__PURE__ */
|
|
4389
|
-
/* @__PURE__ */
|
|
4390
|
-
place.detail != null && /* @__PURE__ */
|
|
4492
|
+
const placeInner = place && /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
4493
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.placeMark, "aria-hidden": "true", children: placeMark }),
|
|
4494
|
+
/* @__PURE__ */ jsxs16(chakra11.span, { css: styles.placeText, children: [
|
|
4495
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.placeName, children: place.name }),
|
|
4496
|
+
place.detail != null && /* @__PURE__ */ jsx25(chakra11.span, { css: styles.placeDetail, children: place.detail })
|
|
4391
4497
|
] })
|
|
4392
4498
|
] });
|
|
4393
4499
|
const headerCss = placeAfter === void 0 ? styles.placeHeader : { ...styles.placeHeader, px: "0" };
|
|
4394
|
-
const placeBlock = /* @__PURE__ */
|
|
4395
|
-
place ? /* @__PURE__ */
|
|
4396
|
-
/* @__PURE__ */
|
|
4397
|
-
/* @__PURE__ */
|
|
4398
|
-
/* @__PURE__ */
|
|
4399
|
-
/* @__PURE__ */
|
|
4400
|
-
/* @__PURE__ */
|
|
4500
|
+
const placeBlock = /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
4501
|
+
place ? /* @__PURE__ */ jsx25(chakra11.div, { css: [headerCss, arrive], children: place.href ? /* @__PURE__ */ jsx25(chakra11.span, { asChild: true, css: styles.place, children: /* @__PURE__ */ jsx25(Link, { href: place.href, children: placeInner }) }) : /* @__PURE__ */ jsx25(chakra11.span, { css: styles.place, children: placeInner }) }) : loading && // The place's card, its name and key coming: the same elements, so it's as tall as the real one.
|
|
4502
|
+
/* @__PURE__ */ jsx25(chakra11.div, { css: headerCss, "aria-hidden": "true", children: /* @__PURE__ */ jsxs16(chakra11.span, { css: styles.place, pointerEvents: "none", children: [
|
|
4503
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: [styles.placeMark, ghostCss], children: "\xA0" }),
|
|
4504
|
+
/* @__PURE__ */ jsxs16(chakra11.span, { css: styles.placeText, children: [
|
|
4505
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.placeName, children: /* @__PURE__ */ jsx25(TextBone, { width: 14 }) }),
|
|
4506
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.placeDetail, children: /* @__PURE__ */ jsx25(TextBone, { width: 4 }) })
|
|
4401
4507
|
] })
|
|
4402
4508
|
] }) }),
|
|
4403
4509
|
sidebar.top != null && // Folded away in the rail (and out of reach of the keyboard there).
|
|
4404
|
-
/* @__PURE__ */
|
|
4510
|
+
/* @__PURE__ */ jsx25(chakra11.div, { css: styles.fold, inert: collapsed || void 0, children: /* @__PURE__ */ jsx25(chakra11.div, { css: styles.foldInner, children: /* @__PURE__ */ jsx25(chakra11.div, { css: styles.sidebarTop, children: sidebar.top }) }) })
|
|
4405
4511
|
] });
|
|
4406
|
-
return /* @__PURE__ */
|
|
4512
|
+
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
4407
4513
|
placeAfter === void 0 && placeBlock,
|
|
4408
|
-
/* @__PURE__ */
|
|
4409
|
-
sidebar.sections.filter((section) => section.items.length > 0).map((section) => /* @__PURE__ */
|
|
4410
|
-
/* @__PURE__ */
|
|
4514
|
+
/* @__PURE__ */ jsxs16(chakra11.nav, { css: [styles.nav, arrive], "aria-label": place?.name ?? labels.navigation, children: [
|
|
4515
|
+
sidebar.sections.filter((section) => section.items.length > 0).map((section) => /* @__PURE__ */ jsxs16(Fragment6, { children: [
|
|
4516
|
+
/* @__PURE__ */ jsx25(NavSection, { section, styles, collapsed, group: sidebar.id }),
|
|
4411
4517
|
section.id === placeAfter && placeBlock
|
|
4412
4518
|
] }, section.id)),
|
|
4413
4519
|
loading && // The place's pages, coming: rows of the nav's own items, the same in the rail and out of it (ADR 0061).
|
|
4414
|
-
/* @__PURE__ */
|
|
4415
|
-
/* @__PURE__ */
|
|
4416
|
-
/* @__PURE__ */
|
|
4520
|
+
/* @__PURE__ */ jsx25(Loading, { when: true, children: /* @__PURE__ */ jsx25(chakra11.div, { css: styles.navSection, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(chakra11.div, { css: styles.navSectionItems, children: Array.from({ length: sidebar.skeletonItems ?? 5 }, (_, n) => /* @__PURE__ */ jsxs16(chakra11.span, { css: styles.navItem, pointerEvents: "none", children: [
|
|
4521
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.navItemIcon, children: /* @__PURE__ */ jsx25(Bone, { width: "4", height: "4" }) }),
|
|
4522
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.navItemLabel, children: /* @__PURE__ */ jsx25(TextBone, { width: boneWidth(n, 6, 12) }) })
|
|
4417
4523
|
] }, n)) }) }) }),
|
|
4418
|
-
navFooter != null && /* @__PURE__ */
|
|
4524
|
+
navFooter != null && /* @__PURE__ */ jsx25(chakra11.div, { css: styles.fold, inert: collapsed || void 0, children: /* @__PURE__ */ jsx25(chakra11.div, { css: styles.foldInner, children: navFooter }) })
|
|
4419
4525
|
] })
|
|
4420
4526
|
] });
|
|
4421
4527
|
}
|
|
4422
4528
|
function NavSection({ section, styles, collapsed, group }) {
|
|
4423
4529
|
const holdsCurrent = section.items.some((i) => i.current || i.children?.some((c2) => c2.current));
|
|
4424
|
-
const [open, setOpen] =
|
|
4530
|
+
const [open, setOpen] = useState11(holdsCurrent || !section.collapsible);
|
|
4425
4531
|
const shown = !section.collapsible || collapsed || open || holdsCurrent;
|
|
4426
|
-
const items = section.items.map((item) => /* @__PURE__ */
|
|
4427
|
-
return /* @__PURE__ */
|
|
4428
|
-
section.title && /* @__PURE__ */
|
|
4429
|
-
/* @__PURE__ */
|
|
4430
|
-
/* @__PURE__ */
|
|
4431
|
-
] }) : /* @__PURE__ */
|
|
4432
|
-
section.collapsible ? /* @__PURE__ */
|
|
4532
|
+
const items = section.items.map((item) => /* @__PURE__ */ jsx25(NavItem, { item, styles, collapsed, group }, item.id));
|
|
4533
|
+
return /* @__PURE__ */ jsxs16(chakra11.div, { css: styles.navSection, role: "group", "aria-label": section.title, children: [
|
|
4534
|
+
section.title && /* @__PURE__ */ jsx25(chakra11.div, { css: styles.fold, inert: collapsed || void 0, children: /* @__PURE__ */ jsx25(chakra11.div, { css: styles.foldInner, children: section.collapsible ? /* @__PURE__ */ jsxs16(chakra11.button, { type: "button", css: styles.navSectionToggle, "aria-expanded": shown, onClick: () => setOpen(!shown), children: [
|
|
4535
|
+
/* @__PURE__ */ jsx25(chakra11.span, { children: section.title }),
|
|
4536
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.navSectionChevron, "data-open": shown || void 0, "aria-hidden": "true", children: /* @__PURE__ */ jsx25(ChevronDown, {}) })
|
|
4537
|
+
] }) : /* @__PURE__ */ jsx25(chakra11.div, { css: styles.navSectionTitle, "aria-hidden": "true", children: section.title }) }) }),
|
|
4538
|
+
section.collapsible ? /* @__PURE__ */ jsx25(Collapse, { open: shown, children: /* @__PURE__ */ jsx25(chakra11.div, { css: styles.navSectionItems, children: items }) }) : /* @__PURE__ */ jsx25(chakra11.div, { css: styles.navSectionItems, children: items })
|
|
4433
4539
|
] });
|
|
4434
4540
|
}
|
|
4435
4541
|
function NavItem({ item, styles, collapsed, group, nested }) {
|
|
4436
4542
|
const Link = useLinkComponent();
|
|
4437
4543
|
const { isRtl } = useAbpLocale();
|
|
4438
|
-
const link = /* @__PURE__ */
|
|
4439
|
-
item.current && /* @__PURE__ */
|
|
4440
|
-
/* @__PURE__ */
|
|
4441
|
-
/* @__PURE__ */
|
|
4544
|
+
const link = /* @__PURE__ */ jsx25(chakra11.a, { asChild: true, css: styles.navItem, children: /* @__PURE__ */ jsxs16(Link, { href: item.href, "aria-current": item.current ? "page" : void 0, "data-nested": nested || void 0, children: [
|
|
4545
|
+
item.current && /* @__PURE__ */ jsx25(Indicator, { group: `abp-side-${group}`, css: styles.navItemIndicator }),
|
|
4546
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.navItemIcon, "aria-hidden": "true", children: item.icon ?? /* @__PURE__ */ jsx25(chakra11.span, { textStyle: "label", children: item.label.slice(0, 1) }) }),
|
|
4547
|
+
/* @__PURE__ */ jsx25(chakra11.span, { css: styles.navItemLabel, children: item.label })
|
|
4442
4548
|
] }) });
|
|
4443
|
-
const own = /* @__PURE__ */
|
|
4549
|
+
const own = /* @__PURE__ */ jsx25(Tooltip, { content: item.label, inactive: !collapsed, positioning: { placement: isRtl ? "left" : "right" }, children: link });
|
|
4444
4550
|
if (!item.children?.length) return own;
|
|
4445
|
-
return /* @__PURE__ */
|
|
4551
|
+
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
4446
4552
|
own,
|
|
4447
|
-
/* @__PURE__ */
|
|
4553
|
+
/* @__PURE__ */ jsx25(chakra11.div, { css: styles.fold, inert: collapsed || void 0, children: /* @__PURE__ */ jsx25(chakra11.div, { css: styles.foldInner, children: /* @__PURE__ */ jsx25(chakra11.div, { css: styles.navChildren, role: "group", "aria-label": item.label, children: item.children.map((child) => /* @__PURE__ */ jsx25(NavItem, { item: child, styles, collapsed, group, nested: true }, child.id)) }) }) })
|
|
4448
4554
|
] });
|
|
4449
4555
|
}
|
|
4450
4556
|
|
|
4451
|
-
// src/components/Pagination.tsx
|
|
4452
|
-
import { chakra as chakra11, HStack as HStack3 } from "@chakra-ui/react";
|
|
4453
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
4454
|
-
|
|
4455
|
-
// src/components/pageList.ts
|
|
4456
|
-
function pageList(page, pages) {
|
|
4457
|
-
const want = /* @__PURE__ */ new Set([1, pages, page - 1, page, page + 1]);
|
|
4458
|
-
if (page <= 3) [2, 3, 4].forEach((n) => want.add(n));
|
|
4459
|
-
if (page >= pages - 2) [pages - 1, pages - 2, pages - 3].forEach((n) => want.add(n));
|
|
4460
|
-
const list = [...want].filter((n) => n >= 1 && n <= pages).sort((a, b) => a - b);
|
|
4461
|
-
const out = [];
|
|
4462
|
-
list.forEach((n, i) => {
|
|
4463
|
-
if (i > 0 && n - list[i - 1] > 1) out.push("gap");
|
|
4464
|
-
out.push(n);
|
|
4465
|
-
});
|
|
4466
|
-
return out;
|
|
4467
|
-
}
|
|
4468
|
-
|
|
4469
|
-
// src/components/Pagination.tsx
|
|
4470
|
-
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4471
|
-
var button = {
|
|
4472
|
-
display: "inline-flex",
|
|
4473
|
-
alignItems: "center",
|
|
4474
|
-
justifyContent: "center",
|
|
4475
|
-
minW: "8",
|
|
4476
|
-
h: "8",
|
|
4477
|
-
px: "2",
|
|
4478
|
-
borderRadius: "l2",
|
|
4479
|
-
color: "fg",
|
|
4480
|
-
textStyle: "sm",
|
|
4481
|
-
fontVariantNumeric: "tabular-nums",
|
|
4482
|
-
cursor: "pointer",
|
|
4483
|
-
transitionProperty: "background, color",
|
|
4484
|
-
transitionDuration: "fast",
|
|
4485
|
-
focusVisibleRing: "outside",
|
|
4486
|
-
_hover: { bg: "bg.muted" },
|
|
4487
|
-
_disabled: { color: "fg.subtle", cursor: "not-allowed", bg: "transparent" },
|
|
4488
|
-
_icon: { boxSize: "3.5" },
|
|
4489
|
-
"&[aria-current=page], &[aria-current=page]:hover": { bg: "accent.solid", color: "accent.contrast", fontWeight: "bold" }
|
|
4490
|
-
};
|
|
4491
|
-
function Pagination({ page, pages, onPage, label, previous, next, pageLabel, disabled }) {
|
|
4492
|
-
if (pages <= 1) return null;
|
|
4493
|
-
const go = (n) => onPage(Math.min(pages, Math.max(1, n)));
|
|
4494
|
-
return /* @__PURE__ */ jsx24(chakra11.nav, { "aria-label": label, children: /* @__PURE__ */ jsxs15(HStack3, { gap: "1", justify: "center", wrap: "wrap", children: [
|
|
4495
|
-
/* @__PURE__ */ jsx24(chakra11.button, { type: "button", css: button, "aria-label": previous, title: previous, disabled: disabled || page <= 1, onClick: () => go(page - 1), children: /* @__PURE__ */ jsx24(DirectionalIcon, { children: /* @__PURE__ */ jsx24(ChevronLeft, {}) }) }),
|
|
4496
|
-
pageList(page, pages).map(
|
|
4497
|
-
(n, i) => n === "gap" ? /* @__PURE__ */ jsx24(chakra11.span, { minW: "5", textAlign: "center", color: "fg.muted", "aria-hidden": "true", children: "\u2026" }, `gap-${i}`) : (
|
|
4498
|
-
// Page buttons stay enabled while a page loads (a second click just asks again); the arrows wait.
|
|
4499
|
-
/* @__PURE__ */ jsx24(
|
|
4500
|
-
chakra11.button,
|
|
4501
|
-
{
|
|
4502
|
-
type: "button",
|
|
4503
|
-
css: button,
|
|
4504
|
-
"aria-label": pageLabel(n),
|
|
4505
|
-
"aria-current": n === page ? "page" : void 0,
|
|
4506
|
-
onClick: () => n !== page && go(n),
|
|
4507
|
-
children: n
|
|
4508
|
-
},
|
|
4509
|
-
n
|
|
4510
|
-
)
|
|
4511
|
-
)
|
|
4512
|
-
),
|
|
4513
|
-
/* @__PURE__ */ jsx24(chakra11.button, { type: "button", css: button, "aria-label": next, title: next, disabled: disabled || page >= pages, onClick: () => go(page + 1), children: /* @__PURE__ */ jsx24(DirectionalIcon, { children: /* @__PURE__ */ jsx24(ChevronRight, {}) }) })
|
|
4514
|
-
] }) });
|
|
4515
|
-
}
|
|
4516
|
-
|
|
4517
4557
|
// src/components/CommandPalette.tsx
|
|
4518
|
-
import { Fragment as Fragment8, useEffect as
|
|
4519
|
-
import { chakra as chakra12, Dialog as Dialog3, HStack as HStack4, Portal as Portal8, Spinner as Spinner3, Stack as Stack4, Text as
|
|
4558
|
+
import { Fragment as Fragment8, useEffect as useEffect10, useId as useId3, useMemo as useMemo6, useRef as useRef10, useState as useState12 } from "react";
|
|
4559
|
+
import { chakra as chakra12, Dialog as Dialog3, HStack as HStack4, Portal as Portal8, Spinner as Spinner3, Stack as Stack4, Text as Text5 } from "@chakra-ui/react";
|
|
4520
4560
|
import { CornerDownLeft, Search } from "lucide-react";
|
|
4521
|
-
import { Fragment as Fragment9, jsx as
|
|
4561
|
+
import { Fragment as Fragment9, jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4522
4562
|
function HighlightText({ text, query }) {
|
|
4523
4563
|
const q = query.trim().toLowerCase();
|
|
4524
|
-
if (!q) return /* @__PURE__ */
|
|
4564
|
+
if (!q) return /* @__PURE__ */ jsx26(Fragment9, { children: text });
|
|
4525
4565
|
const lower = text.toLowerCase();
|
|
4526
4566
|
const parts = [];
|
|
4527
4567
|
let at = 0;
|
|
4528
4568
|
for (let i = lower.indexOf(q); i >= 0; i = lower.indexOf(q, at)) {
|
|
4529
4569
|
if (i > at) parts.push(text.slice(at, i));
|
|
4530
|
-
parts.push(/* @__PURE__ */
|
|
4570
|
+
parts.push(/* @__PURE__ */ jsx26(chakra12.strong, { fontWeight: "bold", children: text.slice(i, i + q.length) }, i));
|
|
4531
4571
|
at = i + q.length;
|
|
4532
4572
|
}
|
|
4533
|
-
if (parts.length === 0) return /* @__PURE__ */
|
|
4573
|
+
if (parts.length === 0) return /* @__PURE__ */ jsx26(Fragment9, { children: text });
|
|
4534
4574
|
parts.push(text.slice(at));
|
|
4535
|
-
return /* @__PURE__ */
|
|
4575
|
+
return /* @__PURE__ */ jsx26(Fragment9, { children: parts.map((p, i) => /* @__PURE__ */ jsx26(Fragment8, { children: p }, i)) });
|
|
4536
4576
|
}
|
|
4537
4577
|
function CommandPalette({ open, onOpenChange, search, labels }) {
|
|
4538
4578
|
const listId = useId3();
|
|
4539
|
-
const [text, setText] =
|
|
4540
|
-
const [groups, setGroups] =
|
|
4541
|
-
const [active, setActive] =
|
|
4579
|
+
const [text, setText] = useState12("");
|
|
4580
|
+
const [groups, setGroups] = useState12(null);
|
|
4581
|
+
const [active, setActive] = useState12(0);
|
|
4542
4582
|
const latest = useRef10(search);
|
|
4543
|
-
|
|
4583
|
+
useEffect10(() => {
|
|
4544
4584
|
latest.current = search;
|
|
4545
4585
|
});
|
|
4546
|
-
|
|
4586
|
+
useEffect10(() => {
|
|
4547
4587
|
if (!open) return;
|
|
4548
4588
|
let gone = false;
|
|
4549
4589
|
const timer = setTimeout(() => {
|
|
@@ -4581,16 +4621,16 @@ function CommandPalette({ open, onOpenChange, search, labels }) {
|
|
|
4581
4621
|
choose(items[active]);
|
|
4582
4622
|
}
|
|
4583
4623
|
}
|
|
4584
|
-
|
|
4624
|
+
useEffect10(() => {
|
|
4585
4625
|
document.getElementById(`${listId}-${active}`)?.scrollIntoView({ block: "nearest" });
|
|
4586
4626
|
}, [active, listId]);
|
|
4587
4627
|
let n = -1;
|
|
4588
|
-
return /* @__PURE__ */
|
|
4589
|
-
/* @__PURE__ */
|
|
4590
|
-
/* @__PURE__ */
|
|
4591
|
-
/* @__PURE__ */
|
|
4592
|
-
/* @__PURE__ */
|
|
4593
|
-
/* @__PURE__ */
|
|
4628
|
+
return /* @__PURE__ */ jsx26(Dialog3.Root, { open, onOpenChange: (e) => !e.open && close(), placement: "top", size: "lg", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs17(Portal8, { children: [
|
|
4629
|
+
/* @__PURE__ */ jsx26(Dialog3.Backdrop, {}),
|
|
4630
|
+
/* @__PURE__ */ jsx26(Dialog3.Positioner, { children: /* @__PURE__ */ jsxs17(Dialog3.Content, { mt: "16", "data-command-palette": "", children: [
|
|
4631
|
+
/* @__PURE__ */ jsxs17(HStack4, { gap: "2.5", px: "4", borderBottomWidth: "1px", borderColor: "border.muted", color: "fg.muted", _icon: { boxSize: "4.5", flexShrink: 0 }, children: [
|
|
4632
|
+
/* @__PURE__ */ jsx26(Search, { "aria-hidden": true }),
|
|
4633
|
+
/* @__PURE__ */ jsx26(
|
|
4594
4634
|
chakra12.input,
|
|
4595
4635
|
{
|
|
4596
4636
|
autoFocus: true,
|
|
@@ -4611,17 +4651,17 @@ function CommandPalette({ open, onOpenChange, search, labels }) {
|
|
|
4611
4651
|
onKeyDown: keys
|
|
4612
4652
|
}
|
|
4613
4653
|
),
|
|
4614
|
-
groups == null && /* @__PURE__ */
|
|
4654
|
+
groups == null && /* @__PURE__ */ jsx26(Spinner3, { size: "sm" })
|
|
4615
4655
|
] }),
|
|
4616
|
-
/* @__PURE__ */
|
|
4617
|
-
groups != null && items.length === 0 && /* @__PURE__ */
|
|
4618
|
-
(groups ?? []).map((g) => /* @__PURE__ */
|
|
4619
|
-
/* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ jsx26(Dialog3.Body, { p: "2", maxH: "min(60vh, 32rem)", children: /* @__PURE__ */ jsxs17(Stack4, { gap: "2", role: "listbox", id: listId, "aria-label": labels.placeholder, children: [
|
|
4657
|
+
groups != null && items.length === 0 && /* @__PURE__ */ jsx26(Text5, { px: "3", py: "6", textAlign: "center", color: "fg.muted", textStyle: "sm", children: text ? labels.noResults : labels.searching }),
|
|
4658
|
+
(groups ?? []).map((g) => /* @__PURE__ */ jsxs17(Stack4, { gap: "0.5", role: "group", "aria-label": g.label, children: [
|
|
4659
|
+
/* @__PURE__ */ jsx26(Text5, { px: "3", pt: "1", pb: "0.5", textStyle: "xs", fontWeight: "bold", color: "fg.muted", children: g.label }),
|
|
4620
4660
|
g.items.map((item) => {
|
|
4621
4661
|
n += 1;
|
|
4622
4662
|
const i = n;
|
|
4623
4663
|
const on = i === active;
|
|
4624
|
-
return /* @__PURE__ */
|
|
4664
|
+
return /* @__PURE__ */ jsxs17(
|
|
4625
4665
|
HStack4,
|
|
4626
4666
|
{
|
|
4627
4667
|
id: `${listId}-${i}`,
|
|
@@ -4640,11 +4680,11 @@ function CommandPalette({ open, onOpenChange, search, labels }) {
|
|
|
4640
4680
|
onClick: () => choose(item),
|
|
4641
4681
|
children: [
|
|
4642
4682
|
item.icon,
|
|
4643
|
-
/* @__PURE__ */
|
|
4644
|
-
item.detail != null && /* @__PURE__ */
|
|
4645
|
-
on && /* @__PURE__ */
|
|
4683
|
+
/* @__PURE__ */ jsx26(Text5, { as: "span", textStyle: "sm", truncate: true, minW: "0", dir: "auto", children: /* @__PURE__ */ jsx26(HighlightText, { text: item.label, query: text }) }),
|
|
4684
|
+
item.detail != null && /* @__PURE__ */ jsx26(Text5, { as: "span", textStyle: "xs", color: "fg.muted", truncate: true, flexShrink: 1, minW: "0", children: item.detail }),
|
|
4685
|
+
on && /* @__PURE__ */ jsxs17(HStack4, { as: "span", gap: "1", ms: "auto", flexShrink: 0, textStyle: "xs", color: "fg.muted", _icon: { boxSize: "3.5" }, "aria-hidden": true, children: [
|
|
4646
4686
|
labels.open,
|
|
4647
|
-
/* @__PURE__ */
|
|
4687
|
+
/* @__PURE__ */ jsx26(CornerDownLeft, {})
|
|
4648
4688
|
] })
|
|
4649
4689
|
]
|
|
4650
4690
|
},
|
|
@@ -4653,15 +4693,15 @@ function CommandPalette({ open, onOpenChange, search, labels }) {
|
|
|
4653
4693
|
})
|
|
4654
4694
|
] }, g.id))
|
|
4655
4695
|
] }) }),
|
|
4656
|
-
/* @__PURE__ */
|
|
4696
|
+
/* @__PURE__ */ jsx26(Text5, { px: "4", py: "2", borderTopWidth: "1px", borderColor: "border.muted", textStyle: "xs", color: "fg.muted", children: labels.hint })
|
|
4657
4697
|
] }) })
|
|
4658
4698
|
] }) });
|
|
4659
4699
|
}
|
|
4660
4700
|
|
|
4661
4701
|
// src/components/AvatarStack.tsx
|
|
4662
|
-
import { Avatar, Box as Box3, HStack as HStack5, Popover as Popover2, Portal as Portal9, Stack as Stack5, Text as
|
|
4702
|
+
import { Avatar, Box as Box3, HStack as HStack5, Popover as Popover2, Portal as Portal9, Stack as Stack5, Text as Text6 } from "@chakra-ui/react";
|
|
4663
4703
|
import { Check } from "lucide-react";
|
|
4664
|
-
import { Fragment as Fragment10, jsx as
|
|
4704
|
+
import { Fragment as Fragment10, jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4665
4705
|
var PALETTES = ["blue", "teal", "purple", "orange", "pink", "cyan", "green", "red"];
|
|
4666
4706
|
function avatarPalette(id) {
|
|
4667
4707
|
let hash = 0;
|
|
@@ -4669,7 +4709,7 @@ function avatarPalette(id) {
|
|
|
4669
4709
|
return PALETTES[Math.abs(hash) % PALETTES.length];
|
|
4670
4710
|
}
|
|
4671
4711
|
function PersonAvatar({ person, selected, inButton }) {
|
|
4672
|
-
return /* @__PURE__ */
|
|
4712
|
+
return /* @__PURE__ */ jsxs18(
|
|
4673
4713
|
Avatar.Root,
|
|
4674
4714
|
{
|
|
4675
4715
|
colorPalette: avatarPalette(person.id),
|
|
@@ -4683,8 +4723,8 @@ function PersonAvatar({ person, selected, inButton }) {
|
|
|
4683
4723
|
outlineColor: "accent.solid",
|
|
4684
4724
|
...inButton ? { "aria-hidden": true } : { role: "img", "aria-label": person.name },
|
|
4685
4725
|
children: [
|
|
4686
|
-
/* @__PURE__ */
|
|
4687
|
-
person.picture && /* @__PURE__ */
|
|
4726
|
+
/* @__PURE__ */ jsx27(Avatar.Fallback, { name: person.name, "aria-hidden": true }),
|
|
4727
|
+
person.picture && /* @__PURE__ */ jsx27(Avatar.Image, { src: person.picture, alt: "" })
|
|
4688
4728
|
]
|
|
4689
4729
|
}
|
|
4690
4730
|
);
|
|
@@ -4692,21 +4732,21 @@ function PersonAvatar({ person, selected, inButton }) {
|
|
|
4692
4732
|
function AvatarStack({ "aria-label": ariaLabel, people, max = 3, moreLabel, moreTitle, loading: own, selected = [], onToggle }) {
|
|
4693
4733
|
const placeholders = useLoading(own) && people.length === 0;
|
|
4694
4734
|
if (placeholders) {
|
|
4695
|
-
return /* @__PURE__ */
|
|
4735
|
+
return /* @__PURE__ */ jsx27(HStack5, { gap: "1", "aria-hidden": true, children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx27(Bone, { circle: true, height: "8" }, i)) });
|
|
4696
4736
|
}
|
|
4697
4737
|
if (people.length === 0) return null;
|
|
4698
4738
|
const shown = people.slice(0, max);
|
|
4699
4739
|
const rest = people.slice(max);
|
|
4700
4740
|
const picked = (p) => selected.includes(p.id);
|
|
4701
4741
|
const restPicked = rest.some(picked);
|
|
4702
|
-
return /* @__PURE__ */
|
|
4703
|
-
shown.map((p) => /* @__PURE__ */
|
|
4742
|
+
return /* @__PURE__ */ jsxs18(HStack5, { gap: "1", role: "group", "aria-label": ariaLabel, children: [
|
|
4743
|
+
shown.map((p) => /* @__PURE__ */ jsx27(Tooltip, { content: p.detail ? /* @__PURE__ */ jsxs18(Fragment10, { children: [
|
|
4704
4744
|
p.name,
|
|
4705
4745
|
" \xB7 ",
|
|
4706
4746
|
p.detail
|
|
4707
4747
|
] }) : p.name, children: onToggle ? (
|
|
4708
4748
|
// Picked avatars sit above their neighbours so the whole ring shows.
|
|
4709
|
-
/* @__PURE__ */
|
|
4749
|
+
/* @__PURE__ */ jsx27(
|
|
4710
4750
|
Box3,
|
|
4711
4751
|
{
|
|
4712
4752
|
as: "button",
|
|
@@ -4720,12 +4760,12 @@ function AvatarStack({ "aria-label": ariaLabel, people, max = 3, moreLabel, more
|
|
|
4720
4760
|
"aria-pressed": picked(p),
|
|
4721
4761
|
"aria-label": p.name,
|
|
4722
4762
|
onClick: () => onToggle(p.id),
|
|
4723
|
-
children: /* @__PURE__ */
|
|
4763
|
+
children: /* @__PURE__ */ jsx27(PersonAvatar, { person: p, selected: picked(p), inButton: true })
|
|
4724
4764
|
}
|
|
4725
4765
|
)
|
|
4726
|
-
) : /* @__PURE__ */
|
|
4727
|
-
rest.length > 0 && /* @__PURE__ */
|
|
4728
|
-
/* @__PURE__ */
|
|
4766
|
+
) : /* @__PURE__ */ jsx27(Box3, { display: "inline-flex", children: /* @__PURE__ */ jsx27(PersonAvatar, { person: p }) }) }, p.id)),
|
|
4767
|
+
rest.length > 0 && /* @__PURE__ */ jsxs18(Popover2.Root, { positioning: { placement: "bottom-end" }, lazyMount: true, unmountOnExit: true, children: [
|
|
4768
|
+
/* @__PURE__ */ jsx27(Popover2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs18(
|
|
4729
4769
|
Box3,
|
|
4730
4770
|
{
|
|
4731
4771
|
as: "button",
|
|
@@ -4754,18 +4794,18 @@ function AvatarStack({ "aria-label": ariaLabel, people, max = 3, moreLabel, more
|
|
|
4754
4794
|
]
|
|
4755
4795
|
}
|
|
4756
4796
|
) }),
|
|
4757
|
-
/* @__PURE__ */
|
|
4758
|
-
/* @__PURE__ */
|
|
4759
|
-
/* @__PURE__ */
|
|
4760
|
-
const row = /* @__PURE__ */
|
|
4761
|
-
/* @__PURE__ */
|
|
4762
|
-
/* @__PURE__ */
|
|
4763
|
-
/* @__PURE__ */
|
|
4764
|
-
p.detail && /* @__PURE__ */
|
|
4797
|
+
/* @__PURE__ */ jsx27(Portal9, { children: /* @__PURE__ */ jsx27(Popover2.Positioner, { children: /* @__PURE__ */ jsx27(Popover2.Content, { w: "64", maxW: "calc(100vw - 32px)", children: /* @__PURE__ */ jsx27(Popover2.Body, { children: /* @__PURE__ */ jsxs18(Stack5, { gap: "3", children: [
|
|
4798
|
+
/* @__PURE__ */ jsx27(Popover2.Title, { textStyle: "label", children: moreTitle }),
|
|
4799
|
+
/* @__PURE__ */ jsx27(Stack5, { as: "ul", gap: onToggle ? "0.5" : "2", maxH: "64", overflowY: "auto", listStyleType: "none", mx: onToggle ? "-2" : void 0, children: rest.map((p) => {
|
|
4800
|
+
const row = /* @__PURE__ */ jsxs18(Fragment10, { children: [
|
|
4801
|
+
/* @__PURE__ */ jsx27(PersonAvatar, { person: p, selected: onToggle && picked(p), inButton: !!onToggle }),
|
|
4802
|
+
/* @__PURE__ */ jsxs18(Stack5, { gap: "0", minW: "0", flex: "1", textAlign: "start", children: [
|
|
4803
|
+
/* @__PURE__ */ jsx27(Text6, { textStyle: "body", truncate: true, children: p.name }),
|
|
4804
|
+
p.detail && /* @__PURE__ */ jsx27(Text6, { textStyle: "caption", color: "fg.muted", children: p.detail })
|
|
4765
4805
|
] }),
|
|
4766
|
-
onToggle && picked(p) && /* @__PURE__ */
|
|
4806
|
+
onToggle && picked(p) && /* @__PURE__ */ jsx27(Box3, { as: "span", color: "accent.fg", flexShrink: 0, "aria-hidden": true, children: /* @__PURE__ */ jsx27(Check, { size: 16 }) })
|
|
4767
4807
|
] });
|
|
4768
|
-
return /* @__PURE__ */
|
|
4808
|
+
return /* @__PURE__ */ jsx27("li", { children: onToggle ? /* @__PURE__ */ jsx27(
|
|
4769
4809
|
HStack5,
|
|
4770
4810
|
{
|
|
4771
4811
|
as: "button",
|
|
@@ -4782,7 +4822,7 @@ function AvatarStack({ "aria-label": ariaLabel, people, max = 3, moreLabel, more
|
|
|
4782
4822
|
onClick: () => onToggle(p.id),
|
|
4783
4823
|
children: row
|
|
4784
4824
|
}
|
|
4785
|
-
) : /* @__PURE__ */
|
|
4825
|
+
) : /* @__PURE__ */ jsx27(HStack5, { gap: "2", minW: "0", children: row }) }, p.id);
|
|
4786
4826
|
}) })
|
|
4787
4827
|
] }) }) }) }) })
|
|
4788
4828
|
] })
|
|
@@ -4790,15 +4830,15 @@ function AvatarStack({ "aria-label": ariaLabel, people, max = 3, moreLabel, more
|
|
|
4790
4830
|
}
|
|
4791
4831
|
|
|
4792
4832
|
// src/components/DataTable.tsx
|
|
4793
|
-
import { Fragment as Fragment11, useMemo as useMemo7, useRef as useRef11, useState as
|
|
4833
|
+
import { Fragment as Fragment11, useMemo as useMemo7, useRef as useRef11, useState as useState13 } from "react";
|
|
4794
4834
|
import { chakra as chakra16, Menu, Portal as Portal10, Table, useSlotRecipe as useSlotRecipe3 } from "@chakra-ui/react";
|
|
4795
4835
|
import { ArrowDown, ArrowUp, ChevronDown as ChevronDown2, ChevronRight as ChevronRight2, ChevronsUpDown, GripVertical } from "lucide-react";
|
|
4796
4836
|
|
|
4797
4837
|
// src/components/EmptyState.tsx
|
|
4798
|
-
import { chakra as chakra13, EmptyState as ChakraEmptyState, HStack as HStack6, Text as
|
|
4838
|
+
import { chakra as chakra13, EmptyState as ChakraEmptyState, HStack as HStack6, Text as Text7, VStack } from "@chakra-ui/react";
|
|
4799
4839
|
import { Inbox } from "lucide-react";
|
|
4800
4840
|
import { m as m3 } from "motion/react";
|
|
4801
|
-
import { jsx as
|
|
4841
|
+
import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4802
4842
|
var TONE = {
|
|
4803
4843
|
neutral: { border: "border.muted", bg: "bg.muted", fg: "fg.muted" },
|
|
4804
4844
|
accent: { border: "accent.muted", bg: "accent.subtle", fg: "accent.fg" },
|
|
@@ -4806,7 +4846,7 @@ var TONE = {
|
|
|
4806
4846
|
};
|
|
4807
4847
|
var MotionSpan3 = chakra13(m3.span, {}, { forwardProps: ["transition"] });
|
|
4808
4848
|
function Drawing({ children, size, tone }) {
|
|
4809
|
-
return /* @__PURE__ */
|
|
4849
|
+
return /* @__PURE__ */ jsx28(
|
|
4810
4850
|
MotionSpan3,
|
|
4811
4851
|
{
|
|
4812
4852
|
display: "inline-flex",
|
|
@@ -4828,25 +4868,25 @@ function Drawing({ children, size, tone }) {
|
|
|
4828
4868
|
}
|
|
4829
4869
|
function EmptyState({ title, description, icon, action, secondaryAction, kind, size = "sm", tone: own }) {
|
|
4830
4870
|
const tone = own ?? (kind === "first-use" ? "accent" : kind === "error" ? "danger" : "neutral");
|
|
4831
|
-
const actions = action != null && secondaryAction != null ? /* @__PURE__ */
|
|
4871
|
+
const actions = action != null && secondaryAction != null ? /* @__PURE__ */ jsxs19(HStack6, { gap: "2", justify: "center", wrap: "wrap", children: [
|
|
4832
4872
|
action,
|
|
4833
4873
|
secondaryAction
|
|
4834
4874
|
] }) : action ?? secondaryAction;
|
|
4835
4875
|
if (size === "xs") {
|
|
4836
|
-
return /* @__PURE__ */
|
|
4876
|
+
return /* @__PURE__ */ jsxs19(HStack6, { gap: "2", justify: "center", py: "4", px: "3", color: "fg.muted", textStyle: "sm", textAlign: "center", _icon: { boxSize: "4", flexShrink: 0 }, children: [
|
|
4837
4877
|
icon,
|
|
4838
|
-
/* @__PURE__ */
|
|
4839
|
-
/* @__PURE__ */
|
|
4840
|
-
description != null && /* @__PURE__ */
|
|
4878
|
+
/* @__PURE__ */ jsxs19(VStack, { gap: "0.5", children: [
|
|
4879
|
+
/* @__PURE__ */ jsx28(Text7, { as: "span", children: title }),
|
|
4880
|
+
description != null && /* @__PURE__ */ jsx28(Text7, { as: "span", textStyle: "caption", color: "fg.subtle", children: description }),
|
|
4841
4881
|
actions
|
|
4842
4882
|
] })
|
|
4843
4883
|
] });
|
|
4844
4884
|
}
|
|
4845
|
-
return /* @__PURE__ */
|
|
4846
|
-
/* @__PURE__ */
|
|
4847
|
-
/* @__PURE__ */
|
|
4848
|
-
/* @__PURE__ */
|
|
4849
|
-
description != null && /* @__PURE__ */
|
|
4885
|
+
return /* @__PURE__ */ jsx28(ChakraEmptyState.Root, { size, py: size === "md" ? "16" : "10", px: "6", children: /* @__PURE__ */ jsxs19(ChakraEmptyState.Content, { gap: "4", "data-empty-kind": kind, children: [
|
|
4886
|
+
/* @__PURE__ */ jsx28(ChakraEmptyState.Indicator, { children: /* @__PURE__ */ jsx28(Drawing, { size, tone, children: icon ?? /* @__PURE__ */ jsx28(Inbox, {}) }) }),
|
|
4887
|
+
/* @__PURE__ */ jsxs19(VStack, { gap: "1.5", textAlign: "center", maxW: "md", children: [
|
|
4888
|
+
/* @__PURE__ */ jsx28(ChakraEmptyState.Title, { textStyle: size === "md" ? "lg" : "md", fontWeight: "semibold", color: "fg", children: title }),
|
|
4889
|
+
description != null && /* @__PURE__ */ jsx28(ChakraEmptyState.Description, { textStyle: "sm", color: "fg.muted", children: description })
|
|
4850
4890
|
] }),
|
|
4851
4891
|
actions
|
|
4852
4892
|
] }) });
|
|
@@ -4855,7 +4895,7 @@ function EmptyState({ title, description, icon, action, secondaryAction, kind, s
|
|
|
4855
4895
|
// src/components/RecordKey.tsx
|
|
4856
4896
|
import { forwardRef as forwardRef5, ViewTransition } from "react";
|
|
4857
4897
|
import { chakra as chakra14, useRecipe } from "@chakra-ui/react";
|
|
4858
|
-
import { jsx as
|
|
4898
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4859
4899
|
var glideName = (key) => `abp-key-${key.toUpperCase().replace(/[^A-Z0-9_-]/g, "_")}`;
|
|
4860
4900
|
var RecordKey = forwardRef5(function RecordKey2({ value, children, href, variant = "plain", size = "sm", glide = false, loading: own, css, ...rest }, ref) {
|
|
4861
4901
|
const recipe = useRecipe({ key: "abpRecordKey" });
|
|
@@ -4863,26 +4903,26 @@ var RecordKey = forwardRef5(function RecordKey2({ value, children, href, variant
|
|
|
4863
4903
|
const Link = useLinkComponent();
|
|
4864
4904
|
const content = children ?? value;
|
|
4865
4905
|
if (useLoading(own)) {
|
|
4866
|
-
return /* @__PURE__ */
|
|
4906
|
+
return /* @__PURE__ */ jsx29(chakra14.span, { ref, dir: "ltr", "aria-hidden": "true", css: [styles, ghostCss, css], ...rest, children: content ?? "XXXX-000" });
|
|
4867
4907
|
}
|
|
4868
|
-
const key = href ? /* @__PURE__ */
|
|
4908
|
+
const key = href ? /* @__PURE__ */ jsx29(chakra14.span, { asChild: true, css: [styles, css], ...rest, children: /* @__PURE__ */ jsx29(Link, { href, dir: "ltr", ref, children: content }) }) : /* @__PURE__ */ jsx29(chakra14.span, { ref, dir: "ltr", css: [styles, css], ...rest, children: content });
|
|
4869
4909
|
if (!glide || !value || typeof ViewTransition === "undefined") return key;
|
|
4870
|
-
return /* @__PURE__ */
|
|
4910
|
+
return /* @__PURE__ */ jsx29(ViewTransition, { name: glideName(value), share: "morph", default: "none", children: key });
|
|
4871
4911
|
});
|
|
4872
4912
|
|
|
4873
4913
|
// src/components/StatusPill.tsx
|
|
4874
4914
|
import { forwardRef as forwardRef6 } from "react";
|
|
4875
4915
|
import { chakra as chakra15, useSlotRecipe as useSlotRecipe2 } from "@chakra-ui/react";
|
|
4876
|
-
import { jsx as
|
|
4916
|
+
import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4877
4917
|
var StatusPill = forwardRef6(function StatusPill2({ tone = "neutral", category, variant = "subtle", size = "sm", dot = true, loading: own, skeletonWidth = 8, children, css, ...rest }, ref) {
|
|
4878
4918
|
const recipe = useSlotRecipe2({ key: "abpStatusPill" });
|
|
4879
4919
|
const styles = recipe({ tone: category ?? tone, variant, size });
|
|
4880
4920
|
const loading = useLoading(own);
|
|
4881
4921
|
const arriving = useArriving(loading);
|
|
4882
4922
|
const unknown = children == null || children === "";
|
|
4883
|
-
return /* @__PURE__ */
|
|
4884
|
-
dot && /* @__PURE__ */
|
|
4885
|
-
loading && unknown ? /* @__PURE__ */
|
|
4923
|
+
return /* @__PURE__ */ jsxs20(chakra15.span, { ref, css: [styles.root, loading ? ghostCss : arriving ? arriveCss : void 0, css], "aria-hidden": loading || void 0, ...rest, children: [
|
|
4924
|
+
dot && /* @__PURE__ */ jsx30(chakra15.span, { css: styles.indicator, "aria-hidden": "true" }),
|
|
4925
|
+
loading && unknown ? /* @__PURE__ */ jsx30(chakra15.span, { display: "inline-block", width: `${skeletonWidth}ch`, children: "\xA0" }) : children
|
|
4886
4926
|
] });
|
|
4887
4927
|
});
|
|
4888
4928
|
|
|
@@ -5044,28 +5084,28 @@ function visibleInTree(tree, folded) {
|
|
|
5044
5084
|
}
|
|
5045
5085
|
|
|
5046
5086
|
// src/components/DataTable.tsx
|
|
5047
|
-
import { jsx as
|
|
5087
|
+
import { jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5048
5088
|
function parentFoldKey(parent) {
|
|
5049
5089
|
return `${parent}`;
|
|
5050
5090
|
}
|
|
5051
5091
|
function placeholder(column, row, at) {
|
|
5052
5092
|
const kind = column.skeleton ?? (column.numeric ? "number" : "text");
|
|
5053
|
-
if (typeof kind === "function") return /* @__PURE__ */
|
|
5093
|
+
if (typeof kind === "function") return /* @__PURE__ */ jsx31(Loading, { when: true, children: kind(row) });
|
|
5054
5094
|
switch (kind) {
|
|
5055
5095
|
case "none":
|
|
5056
5096
|
return null;
|
|
5057
5097
|
case "key":
|
|
5058
|
-
return /* @__PURE__ */
|
|
5098
|
+
return /* @__PURE__ */ jsx31(RecordKey, { loading: true });
|
|
5059
5099
|
case "pill":
|
|
5060
|
-
return /* @__PURE__ */
|
|
5100
|
+
return /* @__PURE__ */ jsx31(StatusPill, { loading: true, skeletonWidth: column.skeletonWidth ?? boneWidth(at, 6, 11) });
|
|
5061
5101
|
case "number":
|
|
5062
|
-
return /* @__PURE__ */
|
|
5102
|
+
return /* @__PURE__ */ jsx31(TextBone, { width: column.skeletonWidth ?? 4 });
|
|
5063
5103
|
case "date":
|
|
5064
|
-
return /* @__PURE__ */
|
|
5104
|
+
return /* @__PURE__ */ jsx31(TextBone, { width: column.skeletonWidth ?? 11 });
|
|
5065
5105
|
case "person":
|
|
5066
|
-
return /* @__PURE__ */
|
|
5106
|
+
return /* @__PURE__ */ jsx31(TextBone, { width: column.skeletonWidth ?? boneWidth(at, 9, 15) });
|
|
5067
5107
|
default:
|
|
5068
|
-
return /* @__PURE__ */
|
|
5108
|
+
return /* @__PURE__ */ jsx31(TextBone, { width: column.skeletonWidth ?? boneWidth(at, 8, 24) });
|
|
5069
5109
|
}
|
|
5070
5110
|
}
|
|
5071
5111
|
function typing(target) {
|
|
@@ -5109,12 +5149,12 @@ function DataTable({
|
|
|
5109
5149
|
const loading = useLoading(own);
|
|
5110
5150
|
const recipe = useSlotRecipe3({ key: "abpDataTable" });
|
|
5111
5151
|
const styles = recipe({});
|
|
5112
|
-
const [sortState, setSortState] =
|
|
5152
|
+
const [sortState, setSortState] = useState13(defaultSort);
|
|
5113
5153
|
const sort = sortProp !== void 0 ? sortProp : sortState;
|
|
5114
|
-
const [dragging, setDragging] =
|
|
5115
|
-
const [treeFolded, setTreeFolded] =
|
|
5116
|
-
const [over2, setOver] =
|
|
5117
|
-
const [dropAt, setDropAt] =
|
|
5154
|
+
const [dragging, setDragging] = useState13(null);
|
|
5155
|
+
const [treeFolded, setTreeFolded] = useState13(() => /* @__PURE__ */ new Set());
|
|
5156
|
+
const [over2, setOver] = useState13(null);
|
|
5157
|
+
const [dropAt, setDropAt] = useState13(null);
|
|
5118
5158
|
const rowRefs = useRef11(/* @__PURE__ */ new Map());
|
|
5119
5159
|
const collator = useMemo7(() => new Intl.Collator(locale, { numeric: true, sensitivity: "base" }), [locale]);
|
|
5120
5160
|
const sorted = useMemo7(() => {
|
|
@@ -5139,11 +5179,11 @@ function DataTable({
|
|
|
5139
5179
|
const align = (c2) => c2.numeric ? "end" : c2.align ?? "start";
|
|
5140
5180
|
let body;
|
|
5141
5181
|
if (error) {
|
|
5142
|
-
body = /* @__PURE__ */
|
|
5182
|
+
body = /* @__PURE__ */ jsx31(Table.Row, { children: /* @__PURE__ */ jsx31(Table.Cell, { colSpan: colCount, css: styles.state, children: /* @__PURE__ */ jsx31(InlineAlert, { tone: "danger", children: error }) }) });
|
|
5143
5183
|
} else if (!sorted || loading && sorted.length === 0) {
|
|
5144
|
-
body = Array.from({ length: skeletonRows }, (_, r) => /* @__PURE__ */
|
|
5184
|
+
body = Array.from({ length: skeletonRows }, (_, r) => /* @__PURE__ */ jsx31(Table.Row, { "aria-hidden": "true", children: columns.map((c2, i) => /* @__PURE__ */ jsx31(Table.Cell, { textAlign: align(c2), whiteSpace: c2.nowrap ? "nowrap" : void 0, textStyle: c2.numeric ? "numeric" : void 0, children: placeholder(c2, r, r * columns.length + i) }, c2.id)) }, `skeleton-${r}`));
|
|
5145
5185
|
} else if (sorted.length === 0) {
|
|
5146
|
-
body = /* @__PURE__ */
|
|
5186
|
+
body = /* @__PURE__ */ jsx31(Table.Row, { children: /* @__PURE__ */ jsx31(Table.Cell, { colSpan: colCount, p: "0", children: typeof empty === "string" || empty == null ? /* @__PURE__ */ jsx31(EmptyState, { title: empty ?? labels.noData }) : empty }) });
|
|
5147
5187
|
} else {
|
|
5148
5188
|
const treeRows = tree ? visibleInTree(inTree(sorted, tree.keyOf, tree.parentOf, tree.context ?? []), treeFolded) : null;
|
|
5149
5189
|
const hidden = (group) => grouping.folded.has(group) || grouping.parents != null && grouping.folded.has(parentFoldKey(grouping.parents.of(group)));
|
|
@@ -5200,8 +5240,8 @@ function DataTable({
|
|
|
5200
5240
|
const sub = renderSubRow?.(row);
|
|
5201
5241
|
const own2 = renderRow?.(row, index);
|
|
5202
5242
|
const selected = selection ? selection.selectedId === id : void 0;
|
|
5203
|
-
return /* @__PURE__ */
|
|
5204
|
-
/* @__PURE__ */
|
|
5243
|
+
return /* @__PURE__ */ jsxs21(Fragment11, { children: [
|
|
5244
|
+
/* @__PURE__ */ jsx31(
|
|
5205
5245
|
Table.Row,
|
|
5206
5246
|
{
|
|
5207
5247
|
ref: (el) => {
|
|
@@ -5238,13 +5278,13 @@ function DataTable({
|
|
|
5238
5278
|
if (moving) place.onPlace(moving, grouping.of(row), side === "before" ? { before: row } : { after: row });
|
|
5239
5279
|
}
|
|
5240
5280
|
} : {},
|
|
5241
|
-
children: own2 != null ? /* @__PURE__ */
|
|
5281
|
+
children: own2 != null ? /* @__PURE__ */ jsx31(Table.Cell, { colSpan: colCount, "data-own-row": "", children: own2 }) : columns.map((c2, ci) => /* @__PURE__ */ jsx31(
|
|
5242
5282
|
Table.Cell,
|
|
5243
5283
|
{
|
|
5244
5284
|
textAlign: align(c2),
|
|
5245
5285
|
whiteSpace: c2.nowrap ? "nowrap" : void 0,
|
|
5246
5286
|
textStyle: c2.numeric ? "numeric" : void 0,
|
|
5247
|
-
children: ci === 0 && treeRows ? /* @__PURE__ */
|
|
5287
|
+
children: ci === 0 && treeRows ? /* @__PURE__ */ jsx31(
|
|
5248
5288
|
TreeCell,
|
|
5249
5289
|
{
|
|
5250
5290
|
node: treeRows[index],
|
|
@@ -5260,8 +5300,8 @@ function DataTable({
|
|
|
5260
5300
|
}),
|
|
5261
5301
|
children: c2.cell(row, index)
|
|
5262
5302
|
}
|
|
5263
|
-
) : ci === 0 && grouping?.move ? /* @__PURE__ */
|
|
5264
|
-
/* @__PURE__ */
|
|
5303
|
+
) : ci === 0 && grouping?.move ? /* @__PURE__ */ jsxs21(chakra16.div, { display: "flex", alignItems: "center", gap: "1", children: [
|
|
5304
|
+
/* @__PURE__ */ jsx31(
|
|
5265
5305
|
RowGrip,
|
|
5266
5306
|
{
|
|
5267
5307
|
move: grouping.move,
|
|
@@ -5284,7 +5324,7 @@ function DataTable({
|
|
|
5284
5324
|
))
|
|
5285
5325
|
}
|
|
5286
5326
|
),
|
|
5287
|
-
sub != null && /* @__PURE__ */
|
|
5327
|
+
sub != null && /* @__PURE__ */ jsx31(Table.Row, { children: /* @__PURE__ */ jsx31(Table.Cell, { colSpan: colCount, bg: "bg.subtle", children: sub }) })
|
|
5288
5328
|
] }, id);
|
|
5289
5329
|
};
|
|
5290
5330
|
if (treeRows || !grouping) {
|
|
@@ -5296,8 +5336,8 @@ function DataTable({
|
|
|
5296
5336
|
body = groups.map((g, gi) => {
|
|
5297
5337
|
const parent = parents?.of(g.key);
|
|
5298
5338
|
const parentFolded = parent != null && grouping.folded.has(parentFoldKey(parent));
|
|
5299
|
-
const parentRow = parents && parent != null && (gi === 0 || parents.of(groups[gi - 1].key) !== parent) ? /* @__PURE__ */
|
|
5300
|
-
/* @__PURE__ */
|
|
5339
|
+
const parentRow = parents && parent != null && (gi === 0 || parents.of(groups[gi - 1].key) !== parent) ? /* @__PURE__ */ jsx31(Table.Row, { css: styles.groupRow, "data-group-parent": parent, "data-folded": parentFolded ? "" : void 0, children: /* @__PURE__ */ jsx31(Table.Cell, { colSpan: colCount, css: styles.groupCell, children: /* @__PURE__ */ jsxs21(chakra16.div, { css: styles.groupHeader, children: [
|
|
5340
|
+
/* @__PURE__ */ jsx31(
|
|
5301
5341
|
chakra16.button,
|
|
5302
5342
|
{
|
|
5303
5343
|
type: "button",
|
|
@@ -5305,19 +5345,19 @@ function DataTable({
|
|
|
5305
5345
|
"aria-expanded": !parentFolded,
|
|
5306
5346
|
"aria-label": parents.foldLabel(parent, parentFolded),
|
|
5307
5347
|
onClick: () => grouping.onFold(parentFoldKey(parent)),
|
|
5308
|
-
children: /* @__PURE__ */
|
|
5348
|
+
children: /* @__PURE__ */ jsx31(ChevronDown2, {})
|
|
5309
5349
|
}
|
|
5310
5350
|
),
|
|
5311
5351
|
parents.header(parent, groups.filter((x) => parents.of(x.key) === parent))
|
|
5312
5352
|
] }) }) }) : null;
|
|
5313
|
-
if (parentFolded) return /* @__PURE__ */
|
|
5353
|
+
if (parentFolded) return /* @__PURE__ */ jsx31(Fragment11, { children: parentRow }, `group-${g.key}`);
|
|
5314
5354
|
const folded = grouping.folded.has(g.key);
|
|
5315
5355
|
const footer = folded ? null : grouping.footer?.(g.key, g.rows);
|
|
5316
5356
|
const start = at;
|
|
5317
5357
|
if (!folded) at += g.rows.length;
|
|
5318
|
-
return /* @__PURE__ */
|
|
5358
|
+
return /* @__PURE__ */ jsxs21(Fragment11, { children: [
|
|
5319
5359
|
parentRow,
|
|
5320
|
-
/* @__PURE__ */
|
|
5360
|
+
/* @__PURE__ */ jsx31(
|
|
5321
5361
|
Table.Row,
|
|
5322
5362
|
{
|
|
5323
5363
|
css: styles.groupRow,
|
|
@@ -5342,8 +5382,8 @@ function DataTable({
|
|
|
5342
5382
|
if (row) grouping.move.onMove(row, g.key);
|
|
5343
5383
|
}
|
|
5344
5384
|
} : {},
|
|
5345
|
-
children: /* @__PURE__ */
|
|
5346
|
-
/* @__PURE__ */
|
|
5385
|
+
children: /* @__PURE__ */ jsx31(Table.Cell, { colSpan: colCount, css: styles.groupCell, children: /* @__PURE__ */ jsxs21(chakra16.div, { css: styles.groupHeader, ps: parents ? "6" : void 0, children: [
|
|
5386
|
+
/* @__PURE__ */ jsx31(
|
|
5347
5387
|
chakra16.button,
|
|
5348
5388
|
{
|
|
5349
5389
|
type: "button",
|
|
@@ -5351,7 +5391,7 @@ function DataTable({
|
|
|
5351
5391
|
"aria-expanded": !folded,
|
|
5352
5392
|
"aria-label": grouping.foldLabel(g.key, folded),
|
|
5353
5393
|
onClick: () => grouping.onFold(g.key),
|
|
5354
|
-
children: /* @__PURE__ */
|
|
5394
|
+
children: /* @__PURE__ */ jsx31(ChevronDown2, {})
|
|
5355
5395
|
}
|
|
5356
5396
|
),
|
|
5357
5397
|
grouping.header(g.key, g.rows)
|
|
@@ -5359,12 +5399,12 @@ function DataTable({
|
|
|
5359
5399
|
}
|
|
5360
5400
|
),
|
|
5361
5401
|
!folded && g.rows.map((row, i) => drawRow(row, start + i)),
|
|
5362
|
-
footer != null && /* @__PURE__ */
|
|
5402
|
+
footer != null && /* @__PURE__ */ jsx31(Table.Row, { css: styles.groupFooterRow, children: /* @__PURE__ */ jsx31(Table.Cell, { colSpan: colCount, css: styles.groupFooterCell, children: footer }) })
|
|
5363
5403
|
] }, `group-${g.key}`);
|
|
5364
5404
|
});
|
|
5365
5405
|
}
|
|
5366
5406
|
}
|
|
5367
|
-
return /* @__PURE__ */
|
|
5407
|
+
return /* @__PURE__ */ jsx31(chakra16.div, { css: styles.root, "aria-busy": loading || void 0, children: /* @__PURE__ */ jsx31(chakra16.div, { css: [styles.scrollArea, maxHeight ? { maxH: maxHeight } : void 0], children: /* @__PURE__ */ jsxs21(
|
|
5368
5408
|
Table.Root,
|
|
5369
5409
|
{
|
|
5370
5410
|
size,
|
|
@@ -5373,16 +5413,16 @@ function DataTable({
|
|
|
5373
5413
|
"aria-label": ariaLabel,
|
|
5374
5414
|
role: selection ? "grid" : void 0,
|
|
5375
5415
|
children: [
|
|
5376
|
-
/* @__PURE__ */
|
|
5416
|
+
/* @__PURE__ */ jsx31(Table.Header, { children: /* @__PURE__ */ jsx31(Table.Row, { children: columns.map((c2) => {
|
|
5377
5417
|
const sortable = Boolean(c2.sortValue);
|
|
5378
5418
|
const active = sort?.columnId === c2.id ? sort.direction : null;
|
|
5379
|
-
return /* @__PURE__ */
|
|
5419
|
+
return /* @__PURE__ */ jsx31(
|
|
5380
5420
|
Table.ColumnHeader,
|
|
5381
5421
|
{
|
|
5382
5422
|
textAlign: align(c2),
|
|
5383
5423
|
w: c2.width,
|
|
5384
5424
|
"aria-sort": sortable ? active === "asc" ? "ascending" : active === "desc" ? "descending" : "none" : void 0,
|
|
5385
|
-
children: sortable ? /* @__PURE__ */
|
|
5425
|
+
children: sortable ? /* @__PURE__ */ jsxs21(
|
|
5386
5426
|
chakra16.button,
|
|
5387
5427
|
{
|
|
5388
5428
|
type: "button",
|
|
@@ -5392,7 +5432,7 @@ function DataTable({
|
|
|
5392
5432
|
title: active === "asc" ? labels.sortDescending : labels.sortAscending,
|
|
5393
5433
|
children: [
|
|
5394
5434
|
c2.header,
|
|
5395
|
-
/* @__PURE__ */
|
|
5435
|
+
/* @__PURE__ */ jsx31(chakra16.span, { css: styles.sortIcon, "aria-hidden": "true", children: active === "asc" ? /* @__PURE__ */ jsx31(ArrowUp, {}) : active === "desc" ? /* @__PURE__ */ jsx31(ArrowDown, {}) : /* @__PURE__ */ jsx31(ChevronsUpDown, {}) })
|
|
5396
5436
|
]
|
|
5397
5437
|
}
|
|
5398
5438
|
) : c2.header
|
|
@@ -5400,7 +5440,7 @@ function DataTable({
|
|
|
5400
5440
|
c2.id
|
|
5401
5441
|
);
|
|
5402
5442
|
}) }) }),
|
|
5403
|
-
/* @__PURE__ */
|
|
5443
|
+
/* @__PURE__ */ jsx31(Table.Body, { children: body })
|
|
5404
5444
|
]
|
|
5405
5445
|
}
|
|
5406
5446
|
) }) });
|
|
@@ -5411,7 +5451,7 @@ function RowGrip({ move, row, dragging, group, prev, next, onDragStart, onDragEn
|
|
|
5411
5451
|
const targets = move.targets(row);
|
|
5412
5452
|
const place = move.place;
|
|
5413
5453
|
const steps = place ? [prev && { value: UP, label: place.up }, next && { value: DOWN, label: place.down }].filter((x) => Boolean(x)) : [];
|
|
5414
|
-
return /* @__PURE__ */
|
|
5454
|
+
return /* @__PURE__ */ jsxs21(
|
|
5415
5455
|
Menu.Root,
|
|
5416
5456
|
{
|
|
5417
5457
|
lazyMount: true,
|
|
@@ -5423,7 +5463,7 @@ function RowGrip({ move, row, dragging, group, prev, next, onDragStart, onDragEn
|
|
|
5423
5463
|
else move.onMove(row, e.value);
|
|
5424
5464
|
},
|
|
5425
5465
|
children: [
|
|
5426
|
-
/* @__PURE__ */
|
|
5466
|
+
/* @__PURE__ */ jsx31(Menu.Trigger, { asChild: true, children: /* @__PURE__ */ jsx31(
|
|
5427
5467
|
chakra16.button,
|
|
5428
5468
|
{
|
|
5429
5469
|
type: "button",
|
|
@@ -5456,18 +5496,18 @@ function RowGrip({ move, row, dragging, group, prev, next, onDragStart, onDragEn
|
|
|
5456
5496
|
onDragStart();
|
|
5457
5497
|
},
|
|
5458
5498
|
onDragEnd,
|
|
5459
|
-
children: /* @__PURE__ */
|
|
5499
|
+
children: /* @__PURE__ */ jsx31(GripVertical, {})
|
|
5460
5500
|
}
|
|
5461
5501
|
) }),
|
|
5462
|
-
/* @__PURE__ */
|
|
5463
|
-
steps.length > 0 && /* @__PURE__ */
|
|
5464
|
-
x.value === UP ? /* @__PURE__ */
|
|
5502
|
+
/* @__PURE__ */ jsx31(Portal10, { children: /* @__PURE__ */ jsx31(Menu.Positioner, { children: /* @__PURE__ */ jsxs21(Menu.Content, { minW: "44", onClick: (e) => e.stopPropagation(), children: [
|
|
5503
|
+
steps.length > 0 && /* @__PURE__ */ jsx31(Menu.ItemGroup, { children: steps.map((x) => /* @__PURE__ */ jsxs21(Menu.Item, { value: x.value, children: [
|
|
5504
|
+
x.value === UP ? /* @__PURE__ */ jsx31(ArrowUp, {}) : /* @__PURE__ */ jsx31(ArrowDown, {}),
|
|
5465
5505
|
x.label
|
|
5466
5506
|
] }, x.value)) }),
|
|
5467
|
-
steps.length > 0 && targets.length > 0 && /* @__PURE__ */
|
|
5468
|
-
targets.length > 0 && /* @__PURE__ */
|
|
5469
|
-
/* @__PURE__ */
|
|
5470
|
-
targets.map((x) => /* @__PURE__ */
|
|
5507
|
+
steps.length > 0 && targets.length > 0 && /* @__PURE__ */ jsx31(Menu.Separator, {}),
|
|
5508
|
+
targets.length > 0 && /* @__PURE__ */ jsxs21(Menu.ItemGroup, { children: [
|
|
5509
|
+
/* @__PURE__ */ jsx31(Menu.ItemGroupLabel, { children: move.menuTitle }),
|
|
5510
|
+
targets.map((x) => /* @__PURE__ */ jsx31(Menu.Item, { value: x.group, children: x.label }, x.group))
|
|
5471
5511
|
] })
|
|
5472
5512
|
] }) }) })
|
|
5473
5513
|
]
|
|
@@ -5475,7 +5515,7 @@ function RowGrip({ move, row, dragging, group, prev, next, onDragStart, onDragEn
|
|
|
5475
5515
|
);
|
|
5476
5516
|
}
|
|
5477
5517
|
function TreeCell({ node, folded, label, contextLabel, onFold, children }) {
|
|
5478
|
-
return /* @__PURE__ */
|
|
5518
|
+
return /* @__PURE__ */ jsxs21(
|
|
5479
5519
|
chakra16.div,
|
|
5480
5520
|
{
|
|
5481
5521
|
display: "flex",
|
|
@@ -5486,7 +5526,7 @@ function TreeCell({ node, folded, label, contextLabel, onFold, children }) {
|
|
|
5486
5526
|
"data-tree-depth": node.depth,
|
|
5487
5527
|
"data-context": node.context ? "" : void 0,
|
|
5488
5528
|
children: [
|
|
5489
|
-
node.hasChildren ? /* @__PURE__ */
|
|
5529
|
+
node.hasChildren ? /* @__PURE__ */ jsx31(
|
|
5490
5530
|
chakra16.button,
|
|
5491
5531
|
{
|
|
5492
5532
|
type: "button",
|
|
@@ -5507,10 +5547,10 @@ function TreeCell({ node, folded, label, contextLabel, onFold, children }) {
|
|
|
5507
5547
|
_hover: { bg: "bg.muted", color: "fg" },
|
|
5508
5548
|
_focusVisible: { outline: "2px solid", outlineColor: "colorPalette.focusRing" },
|
|
5509
5549
|
css: { "& svg": { width: "3.5", height: "3.5", transition: "transform 0.15s" } },
|
|
5510
|
-
children: folded ? /* @__PURE__ */
|
|
5550
|
+
children: folded ? /* @__PURE__ */ jsx31(DirectionalIcon, { children: /* @__PURE__ */ jsx31(ChevronRight2, {}) }) : /* @__PURE__ */ jsx31(ChevronDown2, {})
|
|
5511
5551
|
}
|
|
5512
|
-
) : /* @__PURE__ */
|
|
5513
|
-
node.context && /* @__PURE__ */
|
|
5552
|
+
) : /* @__PURE__ */ jsx31(chakra16.span, { boxSize: "6", flexShrink: "0", "aria-hidden": true }),
|
|
5553
|
+
node.context && /* @__PURE__ */ jsx31(chakra16.span, { srOnly: true, children: contextLabel }),
|
|
5514
5554
|
children
|
|
5515
5555
|
]
|
|
5516
5556
|
}
|
|
@@ -5518,10 +5558,10 @@ function TreeCell({ node, folded, label, contextLabel, onFold, children }) {
|
|
|
5518
5558
|
}
|
|
5519
5559
|
|
|
5520
5560
|
// src/components/CalendarGrid.tsx
|
|
5521
|
-
import { useEffect as
|
|
5522
|
-
import { Box as Box4, chakra as chakra17, Grid as Grid2, Stack as Stack6, Text as
|
|
5561
|
+
import { useEffect as useEffect11, useMemo as useMemo8, useRef as useRef12, useState as useState14 } from "react";
|
|
5562
|
+
import { Box as Box4, chakra as chakra17, Grid as Grid2, Stack as Stack6, Text as Text8 } from "@chakra-ui/react";
|
|
5523
5563
|
import { DndContext, DragOverlay, PointerSensor, useDraggable, useDroppable, useSensor, useSensors } from "@dnd-kit/core";
|
|
5524
|
-
import { jsx as
|
|
5564
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5525
5565
|
var addDays = (day, n) => {
|
|
5526
5566
|
const d = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
|
|
5527
5567
|
d.setUTCDate(d.getUTCDate() + n);
|
|
@@ -5546,10 +5586,10 @@ function CalendarGrid({
|
|
|
5546
5586
|
}) {
|
|
5547
5587
|
const loading = useLoading(own);
|
|
5548
5588
|
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 6 } }));
|
|
5549
|
-
const [active, setActive] =
|
|
5589
|
+
const [active, setActive] = useState14(null);
|
|
5550
5590
|
const root = useRef12(null);
|
|
5551
5591
|
const refocus = useRef12(null);
|
|
5552
|
-
|
|
5592
|
+
useEffect11(() => {
|
|
5553
5593
|
if (!refocus.current) return;
|
|
5554
5594
|
const chip = root.current?.querySelector(`[data-item="${CSS.escape(refocus.current)}"]`);
|
|
5555
5595
|
if (chip && document.activeElement !== chip) chip.focus();
|
|
@@ -5582,7 +5622,7 @@ function CalendarGrid({
|
|
|
5582
5622
|
const rtl = getComputedStyle(e.currentTarget).direction === "rtl";
|
|
5583
5623
|
onMove(item, addDays(item.start, rtl && Math.abs(step) === 1 ? -step : step));
|
|
5584
5624
|
}
|
|
5585
|
-
return /* @__PURE__ */
|
|
5625
|
+
return /* @__PURE__ */ jsxs22(
|
|
5586
5626
|
DndContext,
|
|
5587
5627
|
{
|
|
5588
5628
|
sensors,
|
|
@@ -5590,12 +5630,12 @@ function CalendarGrid({
|
|
|
5590
5630
|
onDragEnd: end,
|
|
5591
5631
|
onDragCancel: () => setActive(null),
|
|
5592
5632
|
children: [
|
|
5593
|
-
/* @__PURE__ */
|
|
5594
|
-
/* @__PURE__ */
|
|
5595
|
-
Array.from({ length: Math.ceil(days.length / 7) }, (_, week) => /* @__PURE__ */
|
|
5633
|
+
/* @__PURE__ */ jsxs22(Box4, { ref: root, role: "grid", "aria-label": ariaLabel, borderWidth: "1px", borderColor: "border", rounded: "l3", overflow: "hidden", children: [
|
|
5634
|
+
/* @__PURE__ */ jsx32(Grid2, { role: "row", templateColumns: "repeat(7, minmax(0, 1fr))", bg: "bg.muted", borderBottomWidth: "1px", borderColor: "border", children: weekdays.map((w, i) => /* @__PURE__ */ jsx32(Text8, { role: "columnheader", textStyle: "caption", fontWeight: "medium", color: "fg.muted", px: "2", py: "1.5", truncate: true, children: w }, i)) }),
|
|
5635
|
+
Array.from({ length: Math.ceil(days.length / 7) }, (_, week) => /* @__PURE__ */ jsx32(Grid2, { role: "row", templateColumns: "repeat(7, minmax(0, 1fr))", borderBottomWidth: week < days.length / 7 - 1 ? "1px" : 0, borderColor: "border", children: days.slice(week * 7, week * 7 + 7).map((day, i) => {
|
|
5596
5636
|
const list = byDay.get(day) ?? [];
|
|
5597
5637
|
const shown = tall ? list : list.slice(0, maxPerDay);
|
|
5598
|
-
return /* @__PURE__ */
|
|
5638
|
+
return /* @__PURE__ */ jsxs22(
|
|
5599
5639
|
DayCell,
|
|
5600
5640
|
{
|
|
5601
5641
|
day,
|
|
@@ -5607,9 +5647,9 @@ function CalendarGrid({
|
|
|
5607
5647
|
label: dayLabel(day),
|
|
5608
5648
|
dragging: !!active,
|
|
5609
5649
|
children: [
|
|
5610
|
-
loading && Array.from({ length: (week * 7 + i) % 4 === 1 ? 2 : (week * 7 + i) % 3 === 0 ? 1 : 0 }, (_2, n) => /* @__PURE__ */
|
|
5611
|
-
!loading && shown.map(({ item, continued }) => /* @__PURE__ */
|
|
5612
|
-
list.length > shown.length && more && (onMore ? /* @__PURE__ */
|
|
5650
|
+
loading && Array.from({ length: (week * 7 + i) % 4 === 1 ? 2 : (week * 7 + i) % 3 === 0 ? 1 : 0 }, (_2, n) => /* @__PURE__ */ jsx32(Bone, { height: "5", width: n === 0 ? "full" : "3/4", "aria-hidden": "true" }, n)),
|
|
5651
|
+
!loading && shown.map(({ item, continued }) => /* @__PURE__ */ jsx32(Chip, { item, continued, onKeyDown: (e) => key(item, e), children: (dragging) => renderItem(item, { dragging, continued }) }, `${item.id}:${day}`)),
|
|
5652
|
+
list.length > shown.length && more && (onMore ? /* @__PURE__ */ jsx32(
|
|
5613
5653
|
chakra17.button,
|
|
5614
5654
|
{
|
|
5615
5655
|
type: "button",
|
|
@@ -5626,21 +5666,21 @@ function CalendarGrid({
|
|
|
5626
5666
|
"data-more": "",
|
|
5627
5667
|
children: more(list.length - shown.length)
|
|
5628
5668
|
}
|
|
5629
|
-
) : /* @__PURE__ */
|
|
5669
|
+
) : /* @__PURE__ */ jsx32(Text8, { textStyle: "caption", color: "fg.muted", px: "1", children: more(list.length - shown.length) }))
|
|
5630
5670
|
]
|
|
5631
5671
|
},
|
|
5632
5672
|
day
|
|
5633
5673
|
);
|
|
5634
5674
|
}) }, week))
|
|
5635
5675
|
] }),
|
|
5636
|
-
/* @__PURE__ */
|
|
5676
|
+
/* @__PURE__ */ jsx32(DragOverlay, { children: active ? /* @__PURE__ */ jsx32(Box4, { shadow: "lg", rounded: "l2", bg: "bg.panel", children: renderItem(active, { dragging: true, continued: false }) }) : null })
|
|
5637
5677
|
]
|
|
5638
5678
|
}
|
|
5639
5679
|
);
|
|
5640
5680
|
}
|
|
5641
5681
|
function DayCell({ day, name, dim, today, tall, last, label, dragging, children }) {
|
|
5642
5682
|
const { setNodeRef, isOver } = useDroppable({ id: `day:${day}` });
|
|
5643
|
-
return /* @__PURE__ */
|
|
5683
|
+
return /* @__PURE__ */ jsxs22(
|
|
5644
5684
|
Stack6,
|
|
5645
5685
|
{
|
|
5646
5686
|
ref: setNodeRef,
|
|
@@ -5658,8 +5698,8 @@ function DayCell({ day, name, dim, today, tall, last, label, dragging, children
|
|
|
5658
5698
|
outlineOffset: "-3px",
|
|
5659
5699
|
"data-day": day,
|
|
5660
5700
|
children: [
|
|
5661
|
-
/* @__PURE__ */
|
|
5662
|
-
|
|
5701
|
+
/* @__PURE__ */ jsx32(
|
|
5702
|
+
Text8,
|
|
5663
5703
|
{
|
|
5664
5704
|
textStyle: "caption",
|
|
5665
5705
|
fontWeight: "semibold",
|
|
@@ -5684,7 +5724,7 @@ function DayCell({ day, name, dim, today, tall, last, label, dragging, children
|
|
|
5684
5724
|
}
|
|
5685
5725
|
function Chip({ item, continued, onKeyDown, children }) {
|
|
5686
5726
|
const { attributes, listeners: listeners2, setNodeRef, isDragging } = useDraggable({ id: continued ? `${item.id}:cont` : item.id, disabled: item.movable === false || continued });
|
|
5687
|
-
return /* @__PURE__ */
|
|
5727
|
+
return /* @__PURE__ */ jsx32(
|
|
5688
5728
|
Box4,
|
|
5689
5729
|
{
|
|
5690
5730
|
ref: setNodeRef,
|
|
@@ -5705,10 +5745,10 @@ function Chip({ item, continued, onKeyDown, children }) {
|
|
|
5705
5745
|
}
|
|
5706
5746
|
|
|
5707
5747
|
// src/components/Chart.tsx
|
|
5708
|
-
import { Box as Box5, Flex, Text as
|
|
5748
|
+
import { Box as Box5, Flex as Flex2, Text as Text9 } from "@chakra-ui/react";
|
|
5709
5749
|
import { Chart as ChakraChart, useChart } from "@chakra-ui/charts";
|
|
5710
5750
|
import { Area, AreaChart, Bar, BarChart, CartesianGrid, Legend, Line, LineChart, ResponsiveContainer, Tooltip as Tooltip3, XAxis, YAxis } from "recharts";
|
|
5711
|
-
import { jsx as
|
|
5751
|
+
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5712
5752
|
var PALETTE = ["teal.solid", "blue.solid", "orange.solid", "purple.solid", "green.solid", "pink.solid", "cyan.solid", "yellow.solid", "red.solid"];
|
|
5713
5753
|
function Chart({ kind, stacked, data, x, series, "aria-label": ariaLabel, height = 280, formatX, formatValue, loading: own }) {
|
|
5714
5754
|
const { isRtl: rtl } = useAbpLocale();
|
|
@@ -5719,29 +5759,29 @@ function Chart({ kind, stacked, data, x, series, "aria-label": ariaLabel, height
|
|
|
5719
5759
|
});
|
|
5720
5760
|
const xs = new Set(data.map((row) => String(row[x])));
|
|
5721
5761
|
const label = (value) => value == null ? "" : formatX && xs.has(String(value)) ? formatX(String(value)) : String(value);
|
|
5722
|
-
const xAxis = /* @__PURE__ */
|
|
5723
|
-
const yAxis = /* @__PURE__ */
|
|
5724
|
-
const grid = /* @__PURE__ */
|
|
5725
|
-
const tooltip = /* @__PURE__ */
|
|
5726
|
-
const legend = series.length > 1 ? /* @__PURE__ */
|
|
5762
|
+
const xAxis = /* @__PURE__ */ jsx33(XAxis, { dataKey: chart.key(x), reversed: rtl, tickLine: false, axisLine: false, tickFormatter: label, minTickGap: 12 });
|
|
5763
|
+
const yAxis = /* @__PURE__ */ jsx33(YAxis, { orientation: rtl ? "right" : "left", tickLine: false, axisLine: false, width: 44, tickFormatter: formatValue, allowDecimals: false });
|
|
5764
|
+
const grid = /* @__PURE__ */ jsx33(CartesianGrid, { stroke: chart.color("border.muted"), vertical: false });
|
|
5765
|
+
const tooltip = /* @__PURE__ */ jsx33(Tooltip3, { cursor: { fill: chart.color("bg.muted") }, animationDuration: 100, content: /* @__PURE__ */ jsx33(ChakraChart.Tooltip, {}), labelFormatter: label });
|
|
5766
|
+
const legend = series.length > 1 ? /* @__PURE__ */ jsx33(Legend, { content: /* @__PURE__ */ jsx33(ChakraChart.Legend, {}) }) : null;
|
|
5727
5767
|
if (loading) {
|
|
5728
|
-
return /* @__PURE__ */
|
|
5768
|
+
return /* @__PURE__ */ jsx33(Box5, { "aria-hidden": "true", children: /* @__PURE__ */ jsx33(Flex2, { h: typeof height === "number" ? `${height}px` : height, align: "flex-end", gap: kind === "bar" ? "2" : "0.5", ps: "12", pe: "2", pb: "8", pt: "2", children: Array.from({ length: 12 }, (_, i) => /* @__PURE__ */ jsx33(Bone, { flex: "1", width: "auto", height: `${28 + i * 37 % 60}%`, borderRadius: kind === "bar" ? "l1" : "0" }, i)) }) });
|
|
5729
5769
|
}
|
|
5730
|
-
return /* @__PURE__ */
|
|
5731
|
-
/* @__PURE__ */
|
|
5770
|
+
return /* @__PURE__ */ jsxs23(Box5, { children: [
|
|
5771
|
+
/* @__PURE__ */ jsx33(ChakraChart.Root, { h: typeof height === "number" ? `${height}px` : height, aspectRatio: "auto", chart, "aria-hidden": true, children: /* @__PURE__ */ jsx33(ResponsiveContainer, { width: "100%", height: "100%", children: kind === "bar" ? /* @__PURE__ */ jsxs23(BarChart, { data: chart.data, children: [
|
|
5732
5772
|
grid,
|
|
5733
5773
|
xAxis,
|
|
5734
5774
|
yAxis,
|
|
5735
5775
|
tooltip,
|
|
5736
5776
|
legend,
|
|
5737
|
-
chart.series.map((s) => /* @__PURE__ */
|
|
5738
|
-
] }) : kind === "area" ? /* @__PURE__ */
|
|
5777
|
+
chart.series.map((s) => /* @__PURE__ */ jsx33(Bar, { isAnimationActive: false, dataKey: chart.key(s.name), fill: chart.color(s.color), stackId: s.stackId, radius: stacked ? 0 : 3 }, s.name))
|
|
5778
|
+
] }) : kind === "area" ? /* @__PURE__ */ jsxs23(AreaChart, { data: chart.data, children: [
|
|
5739
5779
|
grid,
|
|
5740
5780
|
xAxis,
|
|
5741
5781
|
yAxis,
|
|
5742
5782
|
tooltip,
|
|
5743
5783
|
legend,
|
|
5744
|
-
chart.series.map((s) => /* @__PURE__ */
|
|
5784
|
+
chart.series.map((s) => /* @__PURE__ */ jsx33(
|
|
5745
5785
|
Area,
|
|
5746
5786
|
{
|
|
5747
5787
|
isAnimationActive: false,
|
|
@@ -5755,13 +5795,13 @@ function Chart({ kind, stacked, data, x, series, "aria-label": ariaLabel, height
|
|
|
5755
5795
|
},
|
|
5756
5796
|
s.name
|
|
5757
5797
|
))
|
|
5758
|
-
] }) : /* @__PURE__ */
|
|
5798
|
+
] }) : /* @__PURE__ */ jsxs23(LineChart, { data: chart.data, children: [
|
|
5759
5799
|
grid,
|
|
5760
5800
|
xAxis,
|
|
5761
5801
|
yAxis,
|
|
5762
5802
|
tooltip,
|
|
5763
5803
|
legend,
|
|
5764
|
-
chart.series.map((s) => /* @__PURE__ */
|
|
5804
|
+
chart.series.map((s) => /* @__PURE__ */ jsx33(
|
|
5765
5805
|
Line,
|
|
5766
5806
|
{
|
|
5767
5807
|
isAnimationActive: false,
|
|
@@ -5776,26 +5816,26 @@ function Chart({ kind, stacked, data, x, series, "aria-label": ariaLabel, height
|
|
|
5776
5816
|
s.name
|
|
5777
5817
|
))
|
|
5778
5818
|
] }) }) }),
|
|
5779
|
-
/* @__PURE__ */
|
|
5780
|
-
/* @__PURE__ */
|
|
5781
|
-
/* @__PURE__ */
|
|
5782
|
-
/* @__PURE__ */
|
|
5783
|
-
series.map((s) => /* @__PURE__ */
|
|
5819
|
+
/* @__PURE__ */ jsxs23(Box5, { as: "table", srOnly: true, children: [
|
|
5820
|
+
/* @__PURE__ */ jsx33("caption", { children: ariaLabel }),
|
|
5821
|
+
/* @__PURE__ */ jsx33("thead", { children: /* @__PURE__ */ jsxs23("tr", { children: [
|
|
5822
|
+
/* @__PURE__ */ jsx33("th", { scope: "col", children: "" }),
|
|
5823
|
+
series.map((s) => /* @__PURE__ */ jsx33("th", { scope: "col", children: s.label }, s.key))
|
|
5784
5824
|
] }) }),
|
|
5785
|
-
/* @__PURE__ */
|
|
5786
|
-
/* @__PURE__ */
|
|
5787
|
-
series.map((s) => /* @__PURE__ */
|
|
5825
|
+
/* @__PURE__ */ jsx33("tbody", { children: data.map((row, i) => /* @__PURE__ */ jsxs23("tr", { children: [
|
|
5826
|
+
/* @__PURE__ */ jsx33("th", { scope: "row", children: formatX ? formatX(String(row[x])) : String(row[x]) }),
|
|
5827
|
+
series.map((s) => /* @__PURE__ */ jsx33("td", { children: row[s.key] == null ? "" : formatValue ? formatValue(Number(row[s.key])) : String(row[s.key]) }, s.key))
|
|
5788
5828
|
] }, i)) })
|
|
5789
5829
|
] }),
|
|
5790
|
-
data.length === 0 && /* @__PURE__ */
|
|
5830
|
+
data.length === 0 && /* @__PURE__ */ jsx33(Text9, { textStyle: "caption", color: "fg.muted", children: "\u2014" })
|
|
5791
5831
|
] });
|
|
5792
5832
|
}
|
|
5793
5833
|
|
|
5794
5834
|
// src/components/DashboardGrid.tsx
|
|
5795
|
-
import { useRef as useRef13, useState as
|
|
5835
|
+
import { useRef as useRef13, useState as useState15 } from "react";
|
|
5796
5836
|
import { Box as Box6, chakra as chakra18 } from "@chakra-ui/react";
|
|
5797
5837
|
import { GripVertical as GripVertical2, MoveDiagonal2 } from "lucide-react";
|
|
5798
|
-
import { Fragment as Fragment12, jsx as
|
|
5838
|
+
import { Fragment as Fragment12, jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5799
5839
|
var GAP = 16;
|
|
5800
5840
|
var PLACEHOLDER_TILES = [
|
|
5801
5841
|
{ id: "skeleton-1", x: 0, y: 0, w: 6, h: 3 },
|
|
@@ -5843,8 +5883,8 @@ function DashboardGrid({
|
|
|
5843
5883
|
const placeholders = useLoading(own) && items.length === 0;
|
|
5844
5884
|
const ref = useRef13(null);
|
|
5845
5885
|
const gesture = useRef13(null);
|
|
5846
|
-
const [preview, setPreview] =
|
|
5847
|
-
const [active, setActive] =
|
|
5886
|
+
const [preview, setPreview] = useState15(null);
|
|
5887
|
+
const [active, setActive] = useState15(null);
|
|
5848
5888
|
const layout = preview ?? items;
|
|
5849
5889
|
const byId = new Map(items.map((i) => [i.id, i]));
|
|
5850
5890
|
const instructionsId = `${ariaLabel.replace(/\W+/g, "-")}-grid-help`;
|
|
@@ -5916,9 +5956,9 @@ function DashboardGrid({
|
|
|
5916
5956
|
_hover: { color: "fg", bg: "bg.muted" },
|
|
5917
5957
|
_focusVisible: { outline: "2px solid", outlineColor: "colorPalette.focusRing", outlineOffset: "1px" }
|
|
5918
5958
|
};
|
|
5919
|
-
return /* @__PURE__ */
|
|
5920
|
-
editing && /* @__PURE__ */
|
|
5921
|
-
/* @__PURE__ */
|
|
5959
|
+
return /* @__PURE__ */ jsxs24(Box6, { children: [
|
|
5960
|
+
editing && /* @__PURE__ */ jsx34(chakra18.p, { id: instructionsId, srOnly: true, children: labels.instructions }),
|
|
5961
|
+
/* @__PURE__ */ jsxs24(
|
|
5922
5962
|
Box6,
|
|
5923
5963
|
{
|
|
5924
5964
|
ref,
|
|
@@ -5932,7 +5972,7 @@ function DashboardGrid({
|
|
|
5932
5972
|
onPointerUp: end,
|
|
5933
5973
|
onPointerCancel: end,
|
|
5934
5974
|
children: [
|
|
5935
|
-
placeholders && PLACEHOLDER_TILES.map((tile) => /* @__PURE__ */
|
|
5975
|
+
placeholders && PLACEHOLDER_TILES.map((tile) => /* @__PURE__ */ jsx34(
|
|
5936
5976
|
Box6,
|
|
5937
5977
|
{
|
|
5938
5978
|
role: "listitem",
|
|
@@ -5950,7 +5990,7 @@ function DashboardGrid({
|
|
|
5950
5990
|
if (!item) return null;
|
|
5951
5991
|
const shown = { ...item, ...place };
|
|
5952
5992
|
const moving = active === item.id;
|
|
5953
|
-
return /* @__PURE__ */
|
|
5993
|
+
return /* @__PURE__ */ jsxs24(
|
|
5954
5994
|
Box6,
|
|
5955
5995
|
{
|
|
5956
5996
|
role: "listitem",
|
|
@@ -5963,8 +6003,8 @@ function DashboardGrid({
|
|
|
5963
6003
|
transition: moving ? void 0 : "all 120ms ease",
|
|
5964
6004
|
children: [
|
|
5965
6005
|
renderItem(shown),
|
|
5966
|
-
editing && /* @__PURE__ */
|
|
5967
|
-
/* @__PURE__ */
|
|
6006
|
+
editing && /* @__PURE__ */ jsxs24(Fragment12, { children: [
|
|
6007
|
+
/* @__PURE__ */ jsx34(
|
|
5968
6008
|
chakra18.button,
|
|
5969
6009
|
{
|
|
5970
6010
|
type: "button",
|
|
@@ -5978,10 +6018,10 @@ function DashboardGrid({
|
|
|
5978
6018
|
"aria-describedby": instructionsId,
|
|
5979
6019
|
onPointerDown: (e) => start(e, item, "move"),
|
|
5980
6020
|
onKeyDown: (e) => key(e, item, "move"),
|
|
5981
|
-
children: /* @__PURE__ */
|
|
6021
|
+
children: /* @__PURE__ */ jsx34(GripVertical2, { size: 14, "aria-hidden": true })
|
|
5982
6022
|
}
|
|
5983
6023
|
),
|
|
5984
|
-
/* @__PURE__ */
|
|
6024
|
+
/* @__PURE__ */ jsx34(
|
|
5985
6025
|
chakra18.button,
|
|
5986
6026
|
{
|
|
5987
6027
|
type: "button",
|
|
@@ -5995,7 +6035,7 @@ function DashboardGrid({
|
|
|
5995
6035
|
"aria-describedby": instructionsId,
|
|
5996
6036
|
onPointerDown: (e) => start(e, item, "resize"),
|
|
5997
6037
|
onKeyDown: (e) => key(e, item, "resize"),
|
|
5998
|
-
children: /* @__PURE__ */
|
|
6038
|
+
children: /* @__PURE__ */ jsx34(MoveDiagonal2, { size: 14, "aria-hidden": true, style: isRtl ? { transform: "scaleX(-1)" } : void 0 })
|
|
5999
6039
|
}
|
|
6000
6040
|
)
|
|
6001
6041
|
] })
|
|
@@ -6012,7 +6052,7 @@ function DashboardGrid({
|
|
|
6012
6052
|
|
|
6013
6053
|
// src/components/CategoryProgress.tsx
|
|
6014
6054
|
import { Box as Box7, HStack as HStack7 } from "@chakra-ui/react";
|
|
6015
|
-
import { jsx as
|
|
6055
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
6016
6056
|
function CategoryProgress({ todo, inProgress, done, size = "md", loading: own, "aria-label": ariaLabel }) {
|
|
6017
6057
|
const loading = useLoading(own);
|
|
6018
6058
|
const total = loading ? 0 : todo + inProgress + done;
|
|
@@ -6021,7 +6061,7 @@ function CategoryProgress({ todo, inProgress, done, size = "md", loading: own, "
|
|
|
6021
6061
|
{ key: "inProgress", value: inProgress },
|
|
6022
6062
|
{ key: "todo", value: todo }
|
|
6023
6063
|
];
|
|
6024
|
-
return /* @__PURE__ */
|
|
6064
|
+
return /* @__PURE__ */ jsx35(HStack7, { role: "img", "aria-label": ariaLabel, gap: "0", h: size === "sm" ? "1.5" : "2", w: "full", minW: "16", rounded: "full", overflow: "hidden", bg: "bg.muted", css: loading ? shineCss : void 0, children: total > 0 && parts.filter((p) => p.value > 0).map((p) => /* @__PURE__ */ jsx35(Box7, { h: "full", flexBasis: `${p.value / total * 100}%`, flexShrink: 0, bg: `statusCategory.${p.key}.solid` }, p.key)) });
|
|
6025
6065
|
}
|
|
6026
6066
|
|
|
6027
6067
|
// src/components/AttentionChip.tsx
|
|
@@ -6029,7 +6069,7 @@ import { chakra as chakra20 } from "@chakra-ui/react";
|
|
|
6029
6069
|
|
|
6030
6070
|
// src/components/CountBadge.tsx
|
|
6031
6071
|
import { chakra as chakra19 } from "@chakra-ui/react";
|
|
6032
|
-
import { jsx as
|
|
6072
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
6033
6073
|
var TONES2 = {
|
|
6034
6074
|
neutral: { bg: "bg.emphasized", color: "fg" },
|
|
6035
6075
|
accent: { bg: "accent.subtle", color: "accent.fg" },
|
|
@@ -6039,7 +6079,7 @@ var TONES2 = {
|
|
|
6039
6079
|
function CountBadge({ value, tone = "neutral", size = "sm", loading: own, ...rest }) {
|
|
6040
6080
|
const fmt = useFormatters();
|
|
6041
6081
|
const loading = useLoading(own);
|
|
6042
|
-
return /* @__PURE__ */
|
|
6082
|
+
return /* @__PURE__ */ jsx36(
|
|
6043
6083
|
chakra19.span,
|
|
6044
6084
|
{
|
|
6045
6085
|
display: "inline-flex",
|
|
@@ -6064,10 +6104,10 @@ function CountBadge({ value, tone = "neutral", size = "sm", loading: own, ...res
|
|
|
6064
6104
|
}
|
|
6065
6105
|
|
|
6066
6106
|
// src/components/AttentionChip.tsx
|
|
6067
|
-
import { jsx as
|
|
6107
|
+
import { jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6068
6108
|
function AttentionChip({ count, children, tone = "neutral", pressed, onClick, disabled, loading: own }) {
|
|
6069
6109
|
const loading = useLoading(own);
|
|
6070
|
-
return /* @__PURE__ */
|
|
6110
|
+
return /* @__PURE__ */ jsxs25(
|
|
6071
6111
|
chakra20.button,
|
|
6072
6112
|
{
|
|
6073
6113
|
type: "button",
|
|
@@ -6093,7 +6133,7 @@ function AttentionChip({ count, children, tone = "neutral", pressed, onClick, di
|
|
|
6093
6133
|
disabled: disabled || loading,
|
|
6094
6134
|
onClick,
|
|
6095
6135
|
children: [
|
|
6096
|
-
/* @__PURE__ */
|
|
6136
|
+
/* @__PURE__ */ jsx37(CountBadge, { loading, value: count, tone: count === 0 ? "neutral" : tone === "neutral" ? "neutral" : tone }),
|
|
6097
6137
|
children
|
|
6098
6138
|
]
|
|
6099
6139
|
}
|
|
@@ -6102,11 +6142,11 @@ function AttentionChip({ count, children, tone = "neutral", pressed, onClick, di
|
|
|
6102
6142
|
|
|
6103
6143
|
// src/components/IconTile.tsx
|
|
6104
6144
|
import { chakra as chakra21 } from "@chakra-ui/react";
|
|
6105
|
-
import { jsx as
|
|
6145
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
6106
6146
|
var SIZES = { sm: { box: "6", icon: "3.5" }, md: { box: "8", icon: "4" }, lg: { box: "10", icon: "5" } };
|
|
6107
6147
|
function IconTile({ children, size = "md", active = false, palette: palette3 }) {
|
|
6108
6148
|
const s = SIZES[size];
|
|
6109
|
-
return /* @__PURE__ */
|
|
6149
|
+
return /* @__PURE__ */ jsx38(
|
|
6110
6150
|
chakra21.span,
|
|
6111
6151
|
{
|
|
6112
6152
|
display: "inline-flex",
|
|
@@ -6130,16 +6170,16 @@ function IconTile({ children, size = "md", active = false, palette: palette3 })
|
|
|
6130
6170
|
|
|
6131
6171
|
// src/components/PersonChip.tsx
|
|
6132
6172
|
import { Avatar as Avatar2, chakra as chakra22 } from "@chakra-ui/react";
|
|
6133
|
-
import { jsx as
|
|
6173
|
+
import { jsx as jsx39, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6134
6174
|
var SIZES2 = { xs: "5", sm: "6", md: "8" };
|
|
6135
6175
|
function PersonChip({ id, name, picture, compact = false, size = "sm", loading: own }) {
|
|
6136
6176
|
if (useLoading(own)) {
|
|
6137
|
-
return /* @__PURE__ */
|
|
6138
|
-
/* @__PURE__ */
|
|
6139
|
-
!compact && /* @__PURE__ */
|
|
6177
|
+
return /* @__PURE__ */ jsxs26(chakra22.span, { display: "inline-flex", alignItems: "center", gap: "2", "aria-hidden": true, children: [
|
|
6178
|
+
/* @__PURE__ */ jsx39(Bone, { circle: true, height: SIZES2[size] }),
|
|
6179
|
+
!compact && /* @__PURE__ */ jsx39(TextBone, { width: 12 })
|
|
6140
6180
|
] });
|
|
6141
6181
|
}
|
|
6142
|
-
const avatar = /* @__PURE__ */
|
|
6182
|
+
const avatar = /* @__PURE__ */ jsxs26(
|
|
6143
6183
|
Avatar2.Root,
|
|
6144
6184
|
{
|
|
6145
6185
|
colorPalette: avatarPalette(id),
|
|
@@ -6152,15 +6192,15 @@ function PersonChip({ id, name, picture, compact = false, size = "sm", loading:
|
|
|
6152
6192
|
flexShrink: 0,
|
|
6153
6193
|
...compact ? { role: "img", "aria-label": name, title: name } : { "aria-hidden": true },
|
|
6154
6194
|
children: [
|
|
6155
|
-
/* @__PURE__ */
|
|
6156
|
-
picture && /* @__PURE__ */
|
|
6195
|
+
/* @__PURE__ */ jsx39(Avatar2.Fallback, { name }),
|
|
6196
|
+
picture && /* @__PURE__ */ jsx39(Avatar2.Image, { src: picture, alt: "" })
|
|
6157
6197
|
]
|
|
6158
6198
|
}
|
|
6159
6199
|
);
|
|
6160
6200
|
if (compact) return avatar;
|
|
6161
|
-
return /* @__PURE__ */
|
|
6201
|
+
return /* @__PURE__ */ jsxs26(chakra22.span, { display: "inline-flex", alignItems: "center", gap: "2", minW: "0", maxW: "full", children: [
|
|
6162
6202
|
avatar,
|
|
6163
|
-
/* @__PURE__ */
|
|
6203
|
+
/* @__PURE__ */ jsx39(chakra22.span, { truncate: true, children: name })
|
|
6164
6204
|
] });
|
|
6165
6205
|
}
|
|
6166
6206
|
|
|
@@ -6177,11 +6217,11 @@ function priorityLevel(rank, of) {
|
|
|
6177
6217
|
}
|
|
6178
6218
|
|
|
6179
6219
|
// src/components/PriorityMark.tsx
|
|
6180
|
-
import { jsx as
|
|
6220
|
+
import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6181
6221
|
function PriorityMark({ rank, of, children, title, loading }) {
|
|
6182
|
-
if (useLoading(loading)) return /* @__PURE__ */
|
|
6222
|
+
if (useLoading(loading)) return /* @__PURE__ */ jsx40(TextBone, { width: 7 });
|
|
6183
6223
|
const { bars, palette: palette3 } = priorityLevel(rank, of);
|
|
6184
|
-
return /* @__PURE__ */
|
|
6224
|
+
return /* @__PURE__ */ jsxs27(
|
|
6185
6225
|
chakra23.span,
|
|
6186
6226
|
{
|
|
6187
6227
|
display: "inline-flex",
|
|
@@ -6193,7 +6233,7 @@ function PriorityMark({ rank, of, children, title, loading }) {
|
|
|
6193
6233
|
"aria-label": children == null ? title : void 0,
|
|
6194
6234
|
whiteSpace: "nowrap",
|
|
6195
6235
|
children: [
|
|
6196
|
-
/* @__PURE__ */
|
|
6236
|
+
/* @__PURE__ */ jsx40(chakra23.svg, { viewBox: "0 0 12 12", w: "3", h: "3", flexShrink: 0, "aria-hidden": "true", children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx40(
|
|
6197
6237
|
chakra23.rect,
|
|
6198
6238
|
{
|
|
6199
6239
|
x: i * 3 + 0.5,
|
|
@@ -6205,7 +6245,7 @@ function PriorityMark({ rank, of, children, title, loading }) {
|
|
|
6205
6245
|
},
|
|
6206
6246
|
i
|
|
6207
6247
|
)) }),
|
|
6208
|
-
children != null && /* @__PURE__ */
|
|
6248
|
+
children != null && /* @__PURE__ */ jsx40(chakra23.span, { color: palette3 === "blue" || palette3 === "gray" ? "fg.muted" : "colorPalette.fg", fontWeight: "medium", children })
|
|
6209
6249
|
]
|
|
6210
6250
|
}
|
|
6211
6251
|
);
|
|
@@ -6351,27 +6391,27 @@ function abpListSource(request, path, options = {}) {
|
|
|
6351
6391
|
var pageCount = (total, pageSize) => Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
|
|
6352
6392
|
|
|
6353
6393
|
// src/lists/useListState.ts
|
|
6354
|
-
import { useCallback as useCallback10, useEffect as
|
|
6394
|
+
import { useCallback as useCallback10, useEffect as useEffect12, useMemo as useMemo9, useRef as useRef15, useState as useState16 } from "react";
|
|
6355
6395
|
function useListState(source, options = {}) {
|
|
6356
6396
|
const { searchDelay = 250 } = options;
|
|
6357
|
-
const [query, setQuery] =
|
|
6358
|
-
const [typed, setTyped] =
|
|
6359
|
-
const [rows, setRows] =
|
|
6360
|
-
const [total, setTotal] =
|
|
6361
|
-
const [busy, setBusy] =
|
|
6362
|
-
const [error, setError] =
|
|
6363
|
-
const [round, setRound] =
|
|
6397
|
+
const [query, setQuery] = useState16(() => emptyQuery(options.initial));
|
|
6398
|
+
const [typed, setTyped] = useState16(query.search);
|
|
6399
|
+
const [rows, setRows] = useState16(void 0);
|
|
6400
|
+
const [total, setTotal] = useState16(0);
|
|
6401
|
+
const [busy, setBusy] = useState16(true);
|
|
6402
|
+
const [error, setError] = useState16(null);
|
|
6403
|
+
const [round, setRound] = useState16(0);
|
|
6364
6404
|
const told = useRef15(options.onQueryChange);
|
|
6365
|
-
|
|
6405
|
+
useEffect12(() => {
|
|
6366
6406
|
told.current = options.onQueryChange;
|
|
6367
6407
|
});
|
|
6368
|
-
const [shownKey, setShownKey] =
|
|
6408
|
+
const [shownKey, setShownKey] = useState16(source.key);
|
|
6369
6409
|
if (shownKey !== source.key) {
|
|
6370
6410
|
setShownKey(source.key);
|
|
6371
6411
|
setRows(void 0);
|
|
6372
6412
|
setTotal(0);
|
|
6373
6413
|
}
|
|
6374
|
-
|
|
6414
|
+
useEffect12(() => {
|
|
6375
6415
|
const abort = new AbortController();
|
|
6376
6416
|
setBusy(true);
|
|
6377
6417
|
source.load(query, abort.signal).then(
|
|
@@ -6397,7 +6437,7 @@ function useListState(source, options = {}) {
|
|
|
6397
6437
|
return n;
|
|
6398
6438
|
});
|
|
6399
6439
|
}, []);
|
|
6400
|
-
|
|
6440
|
+
useEffect12(() => {
|
|
6401
6441
|
if (typed === query.search) return;
|
|
6402
6442
|
const timer = setTimeout(() => change((q) => ({ ...q, search: typed, page: 1 })), searchDelay);
|
|
6403
6443
|
return () => clearTimeout(timer);
|
|
@@ -6445,9 +6485,9 @@ function useAreaListSource(area, path, options = {}) {
|
|
|
6445
6485
|
}
|
|
6446
6486
|
|
|
6447
6487
|
// src/components/FormDialog.tsx
|
|
6448
|
-
import { useRef as useRef16, useState as
|
|
6488
|
+
import { useRef as useRef16, useState as useState17 } from "react";
|
|
6449
6489
|
import { chakra as chakra24, CloseButton as CloseButton2, Dialog as Dialog4, Portal as Portal11, Stack as Stack7 } from "@chakra-ui/react";
|
|
6450
|
-
import { jsx as
|
|
6490
|
+
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6451
6491
|
var isControl = (el) => el instanceof HTMLInputElement || el instanceof HTMLSelectElement || el instanceof HTMLTextAreaElement;
|
|
6452
6492
|
function invalidControls(form) {
|
|
6453
6493
|
return [...form.elements].filter((el) => isControl(el) && !el.disabled && el.willValidate && !el.checkValidity());
|
|
@@ -6470,7 +6510,7 @@ function FormDialog({ open, onOpenChange, title, description, submitLabel, onSub
|
|
|
6470
6510
|
const labels = useAbpLabels();
|
|
6471
6511
|
const { locale } = useAbpLocale();
|
|
6472
6512
|
const summary = useRef16(null);
|
|
6473
|
-
const [problems, setProblems] =
|
|
6513
|
+
const [problems, setProblems] = useState17([]);
|
|
6474
6514
|
const typed = useRef16(/* @__PURE__ */ new WeakSet());
|
|
6475
6515
|
const tried = useRef16(false);
|
|
6476
6516
|
const describe2 = (el) => ({ el, label: labelOf(el), message: el.validity.valueMissing ? labels.formRequired : el.validationMessage });
|
|
@@ -6495,9 +6535,9 @@ function FormDialog({ open, onOpenChange, title, description, submitLabel, onSub
|
|
|
6495
6535
|
mark(e.target, wrong);
|
|
6496
6536
|
if (problems.length > 0) setProblems(invalidControls(e.currentTarget).map(describe2));
|
|
6497
6537
|
}
|
|
6498
|
-
return /* @__PURE__ */
|
|
6499
|
-
/* @__PURE__ */
|
|
6500
|
-
/* @__PURE__ */
|
|
6538
|
+
return /* @__PURE__ */ jsx41(Dialog4.Root, { open, onOpenChange: (e) => onOpenChange(e.open), size, placement: "center", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs28(Portal11, { children: [
|
|
6539
|
+
/* @__PURE__ */ jsx41(Dialog4.Backdrop, {}),
|
|
6540
|
+
/* @__PURE__ */ jsx41(Dialog4.Positioner, { children: /* @__PURE__ */ jsx41(Dialog4.Content, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
6501
6541
|
"form",
|
|
6502
6542
|
{
|
|
6503
6543
|
onSubmit: hideSubmit ? (e) => e.preventDefault() : submit,
|
|
@@ -6505,10 +6545,10 @@ function FormDialog({ open, onOpenChange, title, description, submitLabel, onSub
|
|
|
6505
6545
|
onInput: (e) => typed.current.add(e.target),
|
|
6506
6546
|
noValidate: true,
|
|
6507
6547
|
children: [
|
|
6508
|
-
/* @__PURE__ */
|
|
6509
|
-
/* @__PURE__ */
|
|
6510
|
-
description != null && /* @__PURE__ */
|
|
6511
|
-
problems.length > 0 && /* @__PURE__ */
|
|
6548
|
+
/* @__PURE__ */ jsx41(Dialog4.Header, { children: /* @__PURE__ */ jsx41(Dialog4.Title, { children: title }) }),
|
|
6549
|
+
/* @__PURE__ */ jsx41(Dialog4.Body, { children: /* @__PURE__ */ jsxs28(Stack7, { gap: "field", children: [
|
|
6550
|
+
description != null && /* @__PURE__ */ jsx41(Dialog4.Description, { children: description }),
|
|
6551
|
+
problems.length > 0 && /* @__PURE__ */ jsx41(chakra24.div, { ref: summary, tabIndex: -1, outline: "none", "data-form-problems": "", children: /* @__PURE__ */ jsx41(InlineAlert, { tone: "danger", title: formatMessage(locale, labels.formFix, { count: problems.length }), children: /* @__PURE__ */ jsx41(chakra24.ul, { ps: "4", listStyleType: "disc", children: problems.map((p, i) => /* @__PURE__ */ jsx41("li", { children: /* @__PURE__ */ jsx41(
|
|
6512
6552
|
chakra24.button,
|
|
6513
6553
|
{
|
|
6514
6554
|
type: "button",
|
|
@@ -6523,13 +6563,13 @@ function FormDialog({ open, onOpenChange, title, description, submitLabel, onSub
|
|
|
6523
6563
|
}
|
|
6524
6564
|
) }, i)) }) }) }),
|
|
6525
6565
|
children,
|
|
6526
|
-
/* @__PURE__ */
|
|
6566
|
+
/* @__PURE__ */ jsx41(InlineAlert, { tone: "danger", children: error })
|
|
6527
6567
|
] }) }),
|
|
6528
|
-
/* @__PURE__ */
|
|
6529
|
-
/* @__PURE__ */
|
|
6530
|
-
!hideSubmit && /* @__PURE__ */
|
|
6568
|
+
/* @__PURE__ */ jsxs28(Dialog4.Footer, { children: [
|
|
6569
|
+
/* @__PURE__ */ jsx41(Dialog4.ActionTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(Button, { variant: "secondary", children: labels.cancel }) }),
|
|
6570
|
+
!hideSubmit && /* @__PURE__ */ jsx41(Button, { type: "submit", variant: "primary", loading: busy, disabled: submitDisabled, children: submitLabel })
|
|
6531
6571
|
] }),
|
|
6532
|
-
/* @__PURE__ */
|
|
6572
|
+
/* @__PURE__ */ jsx41(Dialog4.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(CloseButton2, { size: "sm", "aria-label": labels.close }) })
|
|
6533
6573
|
]
|
|
6534
6574
|
}
|
|
6535
6575
|
) }) })
|
|
@@ -6537,36 +6577,36 @@ function FormDialog({ open, onOpenChange, title, description, submitLabel, onSub
|
|
|
6537
6577
|
}
|
|
6538
6578
|
|
|
6539
6579
|
// src/settings/SettingsLayout.tsx
|
|
6540
|
-
import { useState as
|
|
6541
|
-
import { Text as
|
|
6580
|
+
import { useState as useState18 } from "react";
|
|
6581
|
+
import { Text as Text10 } from "@chakra-ui/react";
|
|
6542
6582
|
|
|
6543
6583
|
// src/components/SearchInput.tsx
|
|
6544
6584
|
import { forwardRef as forwardRef7 } from "react";
|
|
6545
6585
|
import { Input as Input4, InputGroup } from "@chakra-ui/react";
|
|
6546
6586
|
import { Search as Search2 } from "lucide-react";
|
|
6547
|
-
import { jsx as
|
|
6587
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
6548
6588
|
var SearchInput = forwardRef7(function SearchInput2({ size = "md", maxW, ...rest }, ref) {
|
|
6549
6589
|
const skeleton = useLoading();
|
|
6550
|
-
return /* @__PURE__ */
|
|
6590
|
+
return /* @__PURE__ */ jsx42(
|
|
6551
6591
|
InputGroup,
|
|
6552
6592
|
{
|
|
6553
|
-
startElement: /* @__PURE__ */
|
|
6593
|
+
startElement: /* @__PURE__ */ jsx42(Search2, {}),
|
|
6554
6594
|
startOffset: "-0.25rem",
|
|
6555
6595
|
startElementProps: { color: "fg.subtle", _icon: { boxSize: "4" } },
|
|
6556
6596
|
maxW,
|
|
6557
6597
|
borderRadius: "l2",
|
|
6558
6598
|
"aria-hidden": skeleton || void 0,
|
|
6559
6599
|
css: skeleton ? ghostCss : void 0,
|
|
6560
|
-
children: /* @__PURE__ */
|
|
6600
|
+
children: /* @__PURE__ */ jsx42(Input4, { ref, type: "search", size, ...rest })
|
|
6561
6601
|
}
|
|
6562
6602
|
);
|
|
6563
6603
|
});
|
|
6564
6604
|
|
|
6565
6605
|
// src/settings/SettingsLayout.tsx
|
|
6566
|
-
import { jsx as
|
|
6606
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
6567
6607
|
var isCurrent = (pathname, href) => pathname === href || pathname.startsWith(`${href}/`);
|
|
6568
6608
|
function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav = [], children, ...shell }) {
|
|
6569
|
-
const [find, setFind] =
|
|
6609
|
+
const [find, setFind] = useState18("");
|
|
6570
6610
|
const q = find.trim().toLocaleLowerCase();
|
|
6571
6611
|
const sections = area.map(({ section, pages }) => ({
|
|
6572
6612
|
id: section.key,
|
|
@@ -6574,17 +6614,17 @@ function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav
|
|
|
6574
6614
|
items: pages.map((p) => ({ id: p.id, href: p.href, icon: p.icon, label: p.title, current: isCurrent(pathname, p.href) })).filter((i) => !q || i.label.toLocaleLowerCase().includes(q) || section.title.toLocaleLowerCase().includes(q))
|
|
6575
6615
|
}));
|
|
6576
6616
|
const found = !q || sections.some((s) => s.items.length > 0);
|
|
6577
|
-
return /* @__PURE__ */
|
|
6617
|
+
return /* @__PURE__ */ jsx43(
|
|
6578
6618
|
AppShell,
|
|
6579
6619
|
{
|
|
6580
6620
|
...shell,
|
|
6581
6621
|
topNav,
|
|
6582
6622
|
sidebar: {
|
|
6583
6623
|
id: sidebarId,
|
|
6584
|
-
top: /* @__PURE__ */
|
|
6624
|
+
top: /* @__PURE__ */ jsx43(SearchInput, { size: "sm", value: find, onChange: (e) => setFind(e.target.value), placeholder: labels.find, "aria-label": labels.find }),
|
|
6585
6625
|
sections
|
|
6586
6626
|
},
|
|
6587
|
-
navFooter: !found ? /* @__PURE__ */
|
|
6627
|
+
navFooter: !found ? /* @__PURE__ */ jsx43(Text10, { textStyle: "caption", color: "fg.muted", px: "2", children: labels.noSetting }) : void 0,
|
|
6588
6628
|
children
|
|
6589
6629
|
}
|
|
6590
6630
|
);
|
|
@@ -6592,7 +6632,7 @@ function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav
|
|
|
6592
6632
|
|
|
6593
6633
|
// src/components/SegmentedControl.tsx
|
|
6594
6634
|
import { SegmentGroup } from "@chakra-ui/react";
|
|
6595
|
-
import { jsx as
|
|
6635
|
+
import { jsx as jsx44, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6596
6636
|
function SegmentedControl({
|
|
6597
6637
|
"aria-label": ariaLabel,
|
|
6598
6638
|
items,
|
|
@@ -6604,7 +6644,7 @@ function SegmentedControl({
|
|
|
6604
6644
|
}) {
|
|
6605
6645
|
const loading = useLoading(own);
|
|
6606
6646
|
const h = size === "sm" ? "7" : "8";
|
|
6607
|
-
return /* @__PURE__ */
|
|
6647
|
+
return /* @__PURE__ */ jsxs29(
|
|
6608
6648
|
SegmentGroup.Root,
|
|
6609
6649
|
{
|
|
6610
6650
|
size: size === "sm" ? "sm" : "md",
|
|
@@ -6621,8 +6661,8 @@ function SegmentedControl({
|
|
|
6621
6661
|
w: fitted ? "full" : void 0,
|
|
6622
6662
|
"data-segmented": "",
|
|
6623
6663
|
children: [
|
|
6624
|
-
/* @__PURE__ */
|
|
6625
|
-
items.map((item) => /* @__PURE__ */
|
|
6664
|
+
/* @__PURE__ */ jsx44(SegmentGroup.Indicator, {}),
|
|
6665
|
+
items.map((item) => /* @__PURE__ */ jsxs29(
|
|
6626
6666
|
SegmentGroup.Item,
|
|
6627
6667
|
{
|
|
6628
6668
|
value: item.value,
|
|
@@ -6643,9 +6683,9 @@ function SegmentedControl({
|
|
|
6643
6683
|
_icon: { boxSize: "4", flexShrink: 0 },
|
|
6644
6684
|
children: [
|
|
6645
6685
|
item.icon,
|
|
6646
|
-
/* @__PURE__ */
|
|
6647
|
-
item.count != null && /* @__PURE__ */
|
|
6648
|
-
/* @__PURE__ */
|
|
6686
|
+
/* @__PURE__ */ jsx44(SegmentGroup.ItemText, { children: item.label }),
|
|
6687
|
+
item.count != null && /* @__PURE__ */ jsx44(CountBadge, { value: item.count, tone: item.value === value ? "accent" : "neutral" }),
|
|
6688
|
+
/* @__PURE__ */ jsx44(SegmentGroup.ItemHiddenInput, {})
|
|
6649
6689
|
]
|
|
6650
6690
|
},
|
|
6651
6691
|
item.value
|
|
@@ -6656,8 +6696,8 @@ function SegmentedControl({
|
|
|
6656
6696
|
}
|
|
6657
6697
|
|
|
6658
6698
|
// src/components/KanbanBoard.tsx
|
|
6659
|
-
import { useEffect as
|
|
6660
|
-
import { Box as Box8, chakra as chakra25, HStack as HStack8, Stack as Stack8, Text as
|
|
6699
|
+
import { useEffect as useEffect13, useLayoutEffect as useLayoutEffect3, useMemo as useMemo10, useRef as useRef17, useState as useState19 } from "react";
|
|
6700
|
+
import { Box as Box8, chakra as chakra25, HStack as HStack8, Stack as Stack8, Text as Text11 } from "@chakra-ui/react";
|
|
6661
6701
|
import { Check as Check2, ChevronsLeft, ChevronsRight, GripVertical as GripVertical3 } from "lucide-react";
|
|
6662
6702
|
import {
|
|
6663
6703
|
DndContext as DndContext2,
|
|
@@ -6693,13 +6733,13 @@ function between(cell, from, to) {
|
|
|
6693
6733
|
}
|
|
6694
6734
|
|
|
6695
6735
|
// src/components/KanbanBoard.tsx
|
|
6696
|
-
import { Fragment as Fragment13, jsx as
|
|
6736
|
+
import { Fragment as Fragment13, jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6697
6737
|
var SKELETON_CARDS = [3, 2, 4, 1, 2];
|
|
6698
6738
|
function PlaceholderCard({ index }) {
|
|
6699
|
-
return /* @__PURE__ */
|
|
6700
|
-
/* @__PURE__ */
|
|
6701
|
-
/* @__PURE__ */
|
|
6702
|
-
/* @__PURE__ */
|
|
6739
|
+
return /* @__PURE__ */ jsxs30(Box8, { bg: "bg.panel", borderWidth: "1px", borderColor: "border", rounded: "l2", p: "2.5", children: [
|
|
6740
|
+
/* @__PURE__ */ jsx45(Box8, { mb: "1", children: /* @__PURE__ */ jsx45(RecordKey, { loading: true }) }),
|
|
6741
|
+
/* @__PURE__ */ jsx45(Text11, { textStyle: "body.sm", children: /* @__PURE__ */ jsx45(TextBone, { width: boneWidth(index, 14, 34) }) }),
|
|
6742
|
+
/* @__PURE__ */ jsx45(HStack8, { mt: "2", children: /* @__PURE__ */ jsx45(StatusPill, { loading: true, skeletonWidth: boneWidth(index, 5, 9) }) })
|
|
6703
6743
|
] });
|
|
6704
6744
|
}
|
|
6705
6745
|
var cellId = (lane, column) => `cell:${lane}::${column}`;
|
|
@@ -6732,8 +6772,8 @@ function KanbanBoard({
|
|
|
6732
6772
|
}) {
|
|
6733
6773
|
const loading = useLoading(own);
|
|
6734
6774
|
const [folded, fold] = useFolded(foldKey);
|
|
6735
|
-
const [movingColumn, setMovingColumn] =
|
|
6736
|
-
const [overColumn, setOverColumn] =
|
|
6775
|
+
const [movingColumn, setMovingColumn] = useState19(null);
|
|
6776
|
+
const [overColumn, setOverColumn] = useState19(null);
|
|
6737
6777
|
const movingCol = columns.find((c2) => c2.id === movingColumn);
|
|
6738
6778
|
const movingName = movingCol?.name ?? (typeof movingCol?.title === "string" ? movingCol.title : movingColumn ?? "");
|
|
6739
6779
|
const reorder = (id, to) => {
|
|
@@ -6745,16 +6785,16 @@ function KanbanBoard({
|
|
|
6745
6785
|
ids.splice(to, 0, id);
|
|
6746
6786
|
onReorderColumns(ids);
|
|
6747
6787
|
};
|
|
6748
|
-
const shownColumns = loading && columns.length === 0 ? Array.from({ length: skeletonColumns }, (_, n) => ({ id: `skeleton-${n}`, title: /* @__PURE__ */
|
|
6788
|
+
const shownColumns = loading && columns.length === 0 ? Array.from({ length: skeletonColumns }, (_, n) => ({ id: `skeleton-${n}`, title: /* @__PURE__ */ jsx45(TextBone, { width: boneWidth(n, 6, 12) }) })) : columns;
|
|
6749
6789
|
const rows = lanes && lanes.length > 0 ? lanes : [{ id: "", title: null }];
|
|
6750
6790
|
const sensors = useSensors2(
|
|
6751
6791
|
useSensor2(PointerSensor2, { activationConstraint: { distance: 6 } }),
|
|
6752
6792
|
useSensor2(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
|
|
6753
6793
|
);
|
|
6754
6794
|
const laned = !!lanes && lanes.length > 0;
|
|
6755
|
-
const [active, setActive] =
|
|
6756
|
-
const [carried, setCarried] =
|
|
6757
|
-
const [pending2, setPending] =
|
|
6795
|
+
const [active, setActive] = useState19(null);
|
|
6796
|
+
const [carried, setCarried] = useState19([]);
|
|
6797
|
+
const [pending2, setPending] = useState19(null);
|
|
6758
6798
|
const shown = useMemo10(() => pending2 && pending2.on === items ? withMoves(items, pending2.ids, pending2.move, !laned) : items, [items, pending2, laned]);
|
|
6759
6799
|
const riding = useMemo10(() => new Set(carried.map((i) => i.id)), [carried]);
|
|
6760
6800
|
const anchor = useRef17(null);
|
|
@@ -6847,7 +6887,7 @@ function KanbanBoard({
|
|
|
6847
6887
|
const clear = () => {
|
|
6848
6888
|
if (onSelect && selected && selected.size > 0) onSelect(/* @__PURE__ */ new Set());
|
|
6849
6889
|
};
|
|
6850
|
-
|
|
6890
|
+
useEffect13(() => {
|
|
6851
6891
|
if (!onSelect || !selected || selected.size === 0 || active) return;
|
|
6852
6892
|
const key = (e) => {
|
|
6853
6893
|
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
@@ -6857,7 +6897,7 @@ function KanbanBoard({
|
|
|
6857
6897
|
document.addEventListener("keydown", key);
|
|
6858
6898
|
return () => document.removeEventListener("keydown", key);
|
|
6859
6899
|
}, [onSelect, selected, active]);
|
|
6860
|
-
return /* @__PURE__ */
|
|
6900
|
+
return /* @__PURE__ */ jsxs30(
|
|
6861
6901
|
DndContext2,
|
|
6862
6902
|
{
|
|
6863
6903
|
sensors,
|
|
@@ -6870,7 +6910,7 @@ function KanbanBoard({
|
|
|
6870
6910
|
},
|
|
6871
6911
|
accessibility: { announcements, screenReaderInstructions: screenReaderInstructions ? { draggable: screenReaderInstructions } : void 0 },
|
|
6872
6912
|
children: [
|
|
6873
|
-
/* @__PURE__ */
|
|
6913
|
+
/* @__PURE__ */ jsx45(
|
|
6874
6914
|
Box8,
|
|
6875
6915
|
{
|
|
6876
6916
|
ref: region,
|
|
@@ -6883,7 +6923,7 @@ function KanbanBoard({
|
|
|
6883
6923
|
if (Date.now() - draggedAt.current < 300) return;
|
|
6884
6924
|
if (e.target instanceof Element && !e.target.closest("[data-card], a, button, input, select, textarea")) clear();
|
|
6885
6925
|
},
|
|
6886
|
-
children: /* @__PURE__ */
|
|
6926
|
+
children: /* @__PURE__ */ jsx45(Loading, { when: loading, children: /* @__PURE__ */ jsxs30(
|
|
6887
6927
|
Box8,
|
|
6888
6928
|
{
|
|
6889
6929
|
display: "grid",
|
|
@@ -6894,7 +6934,7 @@ function KanbanBoard({
|
|
|
6894
6934
|
shownColumns.map((c2) => {
|
|
6895
6935
|
const isFolded = folded.has(c2.id);
|
|
6896
6936
|
const name = c2.name ?? (typeof c2.title === "string" ? c2.title : c2.id);
|
|
6897
|
-
return /* @__PURE__ */
|
|
6937
|
+
return /* @__PURE__ */ jsxs30(
|
|
6898
6938
|
Box8,
|
|
6899
6939
|
{
|
|
6900
6940
|
position: "sticky",
|
|
@@ -6919,7 +6959,7 @@ function KanbanBoard({
|
|
|
6919
6959
|
}
|
|
6920
6960
|
} : {},
|
|
6921
6961
|
children: [
|
|
6922
|
-
overColumn === c2.id && movingColumn && movingColumn !== c2.id && /* @__PURE__ */
|
|
6962
|
+
overColumn === c2.id && movingColumn && movingColumn !== c2.id && /* @__PURE__ */ jsx45(
|
|
6923
6963
|
Box8,
|
|
6924
6964
|
{
|
|
6925
6965
|
position: "absolute",
|
|
@@ -6936,10 +6976,10 @@ function KanbanBoard({
|
|
|
6936
6976
|
roundedTop: "l3",
|
|
6937
6977
|
bg: "bg.panel",
|
|
6938
6978
|
"data-drop-column": "",
|
|
6939
|
-
children: /* @__PURE__ */
|
|
6979
|
+
children: /* @__PURE__ */ jsx45(Text11, { textStyle: "caption", fontWeight: "bold", color: "fg.accent", truncate: true, children: dropColumnLabel(movingName) })
|
|
6940
6980
|
}
|
|
6941
6981
|
),
|
|
6942
|
-
isFolded ? /* @__PURE__ */
|
|
6982
|
+
isFolded ? /* @__PURE__ */ jsx45(
|
|
6943
6983
|
Stack8,
|
|
6944
6984
|
{
|
|
6945
6985
|
align: "center",
|
|
@@ -6952,9 +6992,9 @@ function KanbanBoard({
|
|
|
6952
6992
|
roundedTop: "l3",
|
|
6953
6993
|
bg: c2.over ? "red.subtle" : "bg.subtle",
|
|
6954
6994
|
h: "full",
|
|
6955
|
-
children: /* @__PURE__ */
|
|
6995
|
+
children: /* @__PURE__ */ jsx45(FoldButton, { folded: true, label: foldLabel(name, true), onClick: () => fold(c2.id) })
|
|
6956
6996
|
}
|
|
6957
|
-
) : /* @__PURE__ */
|
|
6997
|
+
) : /* @__PURE__ */ jsxs30(
|
|
6958
6998
|
HStack8,
|
|
6959
6999
|
{
|
|
6960
7000
|
justify: "space-between",
|
|
@@ -6971,8 +7011,8 @@ function KanbanBoard({
|
|
|
6971
7011
|
h: "full",
|
|
6972
7012
|
align: "start",
|
|
6973
7013
|
children: [
|
|
6974
|
-
/* @__PURE__ */
|
|
6975
|
-
onReorderColumns && !loading && /* @__PURE__ */
|
|
7014
|
+
/* @__PURE__ */ jsxs30(HStack8, { gap: "2", minW: "0", children: [
|
|
7015
|
+
onReorderColumns && !loading && /* @__PURE__ */ jsx45(
|
|
6976
7016
|
ColumnGrip,
|
|
6977
7017
|
{
|
|
6978
7018
|
label: reorderLabel(name, columns.findIndex((x) => x.id === c2.id) + 1, columns.length),
|
|
@@ -6985,11 +7025,11 @@ function KanbanBoard({
|
|
|
6985
7025
|
onStep: (by) => reorder(c2.id, columns.findIndex((x) => x.id === c2.id) + by)
|
|
6986
7026
|
}
|
|
6987
7027
|
),
|
|
6988
|
-
/* @__PURE__ */
|
|
6989
|
-
c2.count != null && /* @__PURE__ */
|
|
6990
|
-
c2.meta && /* @__PURE__ */
|
|
7028
|
+
/* @__PURE__ */ jsx45(Text11, { as: "span", textStyle: "label", truncate: true, display: "inline-flex", minW: "0", children: c2.title }),
|
|
7029
|
+
c2.count != null && /* @__PURE__ */ jsx45(CountBadge, { value: c2.count }),
|
|
7030
|
+
c2.meta && /* @__PURE__ */ jsx45(Text11, { textStyle: "caption", color: c2.over ? "fg.error" : "fg.muted", flexShrink: 0, children: c2.meta })
|
|
6991
7031
|
] }),
|
|
6992
|
-
!loading && /* @__PURE__ */
|
|
7032
|
+
!loading && /* @__PURE__ */ jsx45(FoldButton, { folded: false, label: foldLabel(name, false), onClick: () => fold(c2.id) })
|
|
6993
7033
|
]
|
|
6994
7034
|
}
|
|
6995
7035
|
)
|
|
@@ -6998,20 +7038,20 @@ function KanbanBoard({
|
|
|
6998
7038
|
c2.id
|
|
6999
7039
|
);
|
|
7000
7040
|
}),
|
|
7001
|
-
rows.map((lane) => /* @__PURE__ */
|
|
7041
|
+
rows.map((lane) => /* @__PURE__ */ jsx45(LaneRow, { lane, showTitle: !!lanes && lanes.length > 0, columns: shownColumns, span: shownColumns.length, children: shownColumns.map((c2, ci) => {
|
|
7002
7042
|
const id = cellId(lane.id, c2.id);
|
|
7003
7043
|
const list = byCell.get(id) ?? [];
|
|
7004
7044
|
const allowed = active ? canDrop?.(active, c2.id, lane.id) !== false : true;
|
|
7005
7045
|
const last = lane.id === rows[rows.length - 1].id;
|
|
7006
7046
|
if (folded.has(c2.id)) {
|
|
7007
|
-
return /* @__PURE__ */
|
|
7008
|
-
lane.id === rows[0].id && c2.count != null && /* @__PURE__ */
|
|
7009
|
-
lane.id === rows[0].id && /* @__PURE__ */
|
|
7047
|
+
return /* @__PURE__ */ jsxs30(Cell, { id, allowed, dragging: !!active, items: [], column: c2.id, lane: lane.id, folded: true, last, children: [
|
|
7048
|
+
lane.id === rows[0].id && c2.count != null && /* @__PURE__ */ jsx45(Box8, { alignSelf: "center", children: /* @__PURE__ */ jsx45(CountBadge, { value: c2.count }) }),
|
|
7049
|
+
lane.id === rows[0].id && /* @__PURE__ */ jsx45(Box8, { css: { writingMode: "vertical-rl" }, alignSelf: "center", maxH: "56", overflow: "hidden", textStyle: "sm", title: c2.name, children: c2.title })
|
|
7010
7050
|
] }, id);
|
|
7011
7051
|
}
|
|
7012
7052
|
const footer = last && !loading ? columnFooter?.(c2.id) : null;
|
|
7013
|
-
return /* @__PURE__ */
|
|
7014
|
-
list.map((item) => /* @__PURE__ */
|
|
7053
|
+
return /* @__PURE__ */ jsxs30(Cell, { id, allowed, dragging: !!active, items: list.map((i) => i.id), column: c2.id, lane: lane.id, last, children: [
|
|
7054
|
+
list.map((item) => /* @__PURE__ */ jsx45(
|
|
7015
7055
|
SortableCard,
|
|
7016
7056
|
{
|
|
7017
7057
|
id: item.id,
|
|
@@ -7023,8 +7063,8 @@ function KanbanBoard({
|
|
|
7023
7063
|
item.id
|
|
7024
7064
|
)),
|
|
7025
7065
|
loading && list.length === 0 && // Not the board's cards: no data-slide, and not in its placement (ADR 0058's slides skip them).
|
|
7026
|
-
Array.from({ length: SKELETON_CARDS[ci % SKELETON_CARDS.length] }, (_, n) => /* @__PURE__ */
|
|
7027
|
-
!loading && list.length === 0 && empty && (typeof empty === "function" ? /* @__PURE__ */
|
|
7066
|
+
Array.from({ length: SKELETON_CARDS[ci % SKELETON_CARDS.length] }, (_, n) => /* @__PURE__ */ jsx45(Box8, { "aria-hidden": "true", children: skeletonCard ? skeletonCard(ci * 5 + n) : /* @__PURE__ */ jsx45(PlaceholderCard, { index: ci * 5 + n }) }, `skeleton-${n}`)),
|
|
7067
|
+
!loading && list.length === 0 && empty && (typeof empty === "function" ? /* @__PURE__ */ jsx45(EmptyState, { size: "xs", ...empty(c2.id) }) : /* @__PURE__ */ jsx45(EmptyState, { size: "xs", title: empty })),
|
|
7028
7068
|
footer
|
|
7029
7069
|
] }, id);
|
|
7030
7070
|
}) }, lane.id))
|
|
@@ -7033,23 +7073,23 @@ function KanbanBoard({
|
|
|
7033
7073
|
) })
|
|
7034
7074
|
}
|
|
7035
7075
|
),
|
|
7036
|
-
/* @__PURE__ */
|
|
7076
|
+
/* @__PURE__ */ jsx45(DragOverlay2, { dropAnimation: reduce ? null : landing, children: active ? /* @__PURE__ */ jsx45(Lifted, { carried: carried.length, reduce, count: carried.length > 1 ? carrying ? carrying(carried.length) : String(carried.length) : void 0, children: renderCard(active, { dragging: true }) }) : null })
|
|
7037
7077
|
]
|
|
7038
7078
|
}
|
|
7039
7079
|
);
|
|
7040
7080
|
}
|
|
7041
7081
|
function LaneRow({ lane, showTitle, span, children }) {
|
|
7042
|
-
return /* @__PURE__ */
|
|
7043
|
-
showTitle && /* @__PURE__ */
|
|
7044
|
-
/* @__PURE__ */
|
|
7045
|
-
lane.meta && /* @__PURE__ */
|
|
7082
|
+
return /* @__PURE__ */ jsxs30(Fragment13, { children: [
|
|
7083
|
+
showTitle && /* @__PURE__ */ jsxs30(HStack8, { gridColumn: `1 / span ${span}`, gap: "2", pt: "2", borderTopWidth: "1px", borderColor: "border.muted", "data-lane": lane.id, children: [
|
|
7084
|
+
/* @__PURE__ */ jsx45(Text11, { textStyle: "label", children: lane.title }),
|
|
7085
|
+
lane.meta && /* @__PURE__ */ jsx45(Text11, { textStyle: "caption", color: "fg.muted", children: lane.meta })
|
|
7046
7086
|
] }),
|
|
7047
7087
|
children
|
|
7048
7088
|
] });
|
|
7049
7089
|
}
|
|
7050
7090
|
function Cell({ id, items, allowed, dragging, column, lane, folded = false, last = true, children }) {
|
|
7051
7091
|
const { setNodeRef, isOver } = useDroppable2({ id, disabled: !allowed });
|
|
7052
|
-
return /* @__PURE__ */
|
|
7092
|
+
return /* @__PURE__ */ jsx45(SortableContext, { id, items, strategy: verticalListSortingStrategy, children: /* @__PURE__ */ jsx45(
|
|
7053
7093
|
Stack8,
|
|
7054
7094
|
{
|
|
7055
7095
|
ref: setNodeRef,
|
|
@@ -7078,7 +7118,7 @@ function SortableCard({
|
|
|
7078
7118
|
children
|
|
7079
7119
|
}) {
|
|
7080
7120
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = useSortable({ id, animateLayoutChanges: () => false });
|
|
7081
|
-
return /* @__PURE__ */
|
|
7121
|
+
return /* @__PURE__ */ jsxs30(
|
|
7082
7122
|
Box8,
|
|
7083
7123
|
{
|
|
7084
7124
|
ref: setNodeRef,
|
|
@@ -7097,8 +7137,8 @@ function SortableCard({
|
|
|
7097
7137
|
cursor: "grab",
|
|
7098
7138
|
_focusVisible: { outline: "2px solid", outlineColor: "colorPalette.focusRing", rounded: "l2" },
|
|
7099
7139
|
children: [
|
|
7100
|
-
/* @__PURE__ */
|
|
7101
|
-
selected && !isDragging && !riding && /* @__PURE__ */
|
|
7140
|
+
/* @__PURE__ */ jsx45(Box8, { "data-slide": id, children: children(isDragging) }),
|
|
7141
|
+
selected && !isDragging && !riding && /* @__PURE__ */ jsx45(Mark, {})
|
|
7102
7142
|
]
|
|
7103
7143
|
}
|
|
7104
7144
|
);
|
|
@@ -7126,8 +7166,8 @@ function Lifted({ carried, count, reduce, children }) {
|
|
|
7126
7166
|
held.current?.animate?.([{ transform: "none", boxShadow: tv("shadows.sm") }, { transform: HELD, boxShadow: tv("shadows.xl") }], { duration: 160, easing: OUT2 });
|
|
7127
7167
|
}, []);
|
|
7128
7168
|
const layers = Math.min(2, Math.max(0, carried - 1));
|
|
7129
|
-
return /* @__PURE__ */
|
|
7130
|
-
Array.from({ length: layers }, (_, i) => /* @__PURE__ */
|
|
7169
|
+
return /* @__PURE__ */ jsxs30(Box8, { position: "relative", cursor: "grabbing", "data-testid": "drag-preview", children: [
|
|
7170
|
+
Array.from({ length: layers }, (_, i) => /* @__PURE__ */ jsx45(
|
|
7131
7171
|
Box8,
|
|
7132
7172
|
{
|
|
7133
7173
|
"data-layer": true,
|
|
@@ -7142,8 +7182,8 @@ function Lifted({ carried, count, reduce, children }) {
|
|
|
7142
7182
|
},
|
|
7143
7183
|
i
|
|
7144
7184
|
)),
|
|
7145
|
-
/* @__PURE__ */
|
|
7146
|
-
count != null && /* @__PURE__ */
|
|
7185
|
+
/* @__PURE__ */ jsx45(Box8, { ref: held, "data-held": true, rounded: "l2", shadow: reduce ? "lg" : "xl", style: { transform: reduce ? void 0 : HELD, transformOrigin: "50% 40%" }, children }),
|
|
7186
|
+
count != null && /* @__PURE__ */ jsx45(Count, { children: count })
|
|
7147
7187
|
] });
|
|
7148
7188
|
}
|
|
7149
7189
|
function Mark() {
|
|
@@ -7156,7 +7196,7 @@ function Mark() {
|
|
|
7156
7196
|
easing: OUT2
|
|
7157
7197
|
});
|
|
7158
7198
|
}, []);
|
|
7159
|
-
return /* @__PURE__ */
|
|
7199
|
+
return /* @__PURE__ */ jsx45(
|
|
7160
7200
|
chakra25.span,
|
|
7161
7201
|
{
|
|
7162
7202
|
ref,
|
|
@@ -7173,12 +7213,12 @@ function Mark() {
|
|
|
7173
7213
|
pointerEvents: "none",
|
|
7174
7214
|
"aria-hidden": "true",
|
|
7175
7215
|
_icon: { boxSize: "3" },
|
|
7176
|
-
children: /* @__PURE__ */
|
|
7216
|
+
children: /* @__PURE__ */ jsx45(Check2, { strokeWidth: 3 })
|
|
7177
7217
|
}
|
|
7178
7218
|
);
|
|
7179
7219
|
}
|
|
7180
7220
|
function Count({ children }) {
|
|
7181
|
-
return /* @__PURE__ */
|
|
7221
|
+
return /* @__PURE__ */ jsx45(
|
|
7182
7222
|
chakra25.span,
|
|
7183
7223
|
{
|
|
7184
7224
|
position: "absolute",
|
|
@@ -7201,7 +7241,7 @@ function Count({ children }) {
|
|
|
7201
7241
|
);
|
|
7202
7242
|
}
|
|
7203
7243
|
function FoldButton({ folded, label, onClick }) {
|
|
7204
|
-
return /* @__PURE__ */
|
|
7244
|
+
return /* @__PURE__ */ jsx45(
|
|
7205
7245
|
chakra25.button,
|
|
7206
7246
|
{
|
|
7207
7247
|
type: "button",
|
|
@@ -7222,14 +7262,14 @@ function FoldButton({ folded, label, onClick }) {
|
|
|
7222
7262
|
title: label,
|
|
7223
7263
|
"aria-expanded": !folded,
|
|
7224
7264
|
onClick,
|
|
7225
|
-
children: /* @__PURE__ */
|
|
7265
|
+
children: /* @__PURE__ */ jsx45(DirectionalIcon, { children: folded ? /* @__PURE__ */ jsx45(ChevronsRight, { size: 16 }) : /* @__PURE__ */ jsx45(ChevronsLeft, { size: 16 }) })
|
|
7226
7266
|
}
|
|
7227
7267
|
);
|
|
7228
7268
|
}
|
|
7229
7269
|
function useFolded(key) {
|
|
7230
7270
|
const storage = key ? `board.folded.${key}` : null;
|
|
7231
|
-
const [folded, setFolded] =
|
|
7232
|
-
|
|
7271
|
+
const [folded, setFolded] = useState19(() => /* @__PURE__ */ new Set());
|
|
7272
|
+
useEffect13(() => {
|
|
7233
7273
|
if (!storage) return;
|
|
7234
7274
|
try {
|
|
7235
7275
|
const saved = JSON.parse(window.localStorage.getItem(storage) ?? "[]");
|
|
@@ -7252,7 +7292,7 @@ function useFolded(key) {
|
|
|
7252
7292
|
return [folded, fold];
|
|
7253
7293
|
}
|
|
7254
7294
|
function ColumnGrip({ label, moving, onDragStart, onDragEnd, onStep }) {
|
|
7255
|
-
return /* @__PURE__ */
|
|
7295
|
+
return /* @__PURE__ */ jsx45(
|
|
7256
7296
|
chakra25.button,
|
|
7257
7297
|
{
|
|
7258
7298
|
type: "button",
|
|
@@ -7286,19 +7326,19 @@ function ColumnGrip({ label, moving, onDragStart, onDragEnd, onStep }) {
|
|
|
7286
7326
|
onDragStart();
|
|
7287
7327
|
},
|
|
7288
7328
|
onDragEnd,
|
|
7289
|
-
children: /* @__PURE__ */
|
|
7329
|
+
children: /* @__PURE__ */ jsx45(GripVertical3, {})
|
|
7290
7330
|
}
|
|
7291
7331
|
);
|
|
7292
7332
|
}
|
|
7293
7333
|
|
|
7294
7334
|
// src/components/LoadingState.tsx
|
|
7295
7335
|
import { Box as Box9, VisuallyHidden as VisuallyHidden2 } from "@chakra-ui/react";
|
|
7296
|
-
import { jsx as
|
|
7336
|
+
import { jsx as jsx46, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
7297
7337
|
function LoadingState({ lines = 3, label }) {
|
|
7298
7338
|
const labels = useAbpLabels();
|
|
7299
|
-
return /* @__PURE__ */
|
|
7300
|
-
/* @__PURE__ */
|
|
7301
|
-
/* @__PURE__ */
|
|
7339
|
+
return /* @__PURE__ */ jsxs31(Box9, { "aria-busy": "true", role: "status", children: [
|
|
7340
|
+
/* @__PURE__ */ jsx46(VisuallyHidden2, { children: label ?? labels.loading }),
|
|
7341
|
+
/* @__PURE__ */ jsx46(TextBone, { lines, width: "full" })
|
|
7302
7342
|
] });
|
|
7303
7343
|
}
|
|
7304
7344
|
|
|
@@ -7306,7 +7346,7 @@ function LoadingState({ lines = 3, label }) {
|
|
|
7306
7346
|
import { Fragment as Fragment14 } from "react";
|
|
7307
7347
|
import { Breadcrumb, chakra as chakra26, Menu as Menu2, Portal as Portal12, useSlotRecipe as useSlotRecipe4 } from "@chakra-ui/react";
|
|
7308
7348
|
import { ChevronRight as ChevronRight3 } from "lucide-react";
|
|
7309
|
-
import { jsx as
|
|
7349
|
+
import { jsx as jsx47, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
7310
7350
|
var textOf = (label) => typeof label === "string" || typeof label === "number" ? String(label) : void 0;
|
|
7311
7351
|
function PageHeader({ title, description, breadcrumbs, meta, count, adornments, actions, loading: own, titleWidth = 24, documentTitle }) {
|
|
7312
7352
|
const recipe = useSlotRecipe4({ key: "abpPageHeader" });
|
|
@@ -7315,32 +7355,32 @@ function PageHeader({ title, description, breadcrumbs, meta, count, adornments,
|
|
|
7315
7355
|
usePageTitle(documentTitle !== void 0 ? documentTitle : text ? [text, where] : null);
|
|
7316
7356
|
const styles = recipe({});
|
|
7317
7357
|
const loading = useLoading(own);
|
|
7318
|
-
return /* @__PURE__ */
|
|
7319
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */
|
|
7320
|
-
/* @__PURE__ */
|
|
7321
|
-
/* @__PURE__ */
|
|
7322
|
-
count != null || adornments != null ? /* @__PURE__ */
|
|
7323
|
-
/* @__PURE__ */
|
|
7324
|
-
count != null && /* @__PURE__ */
|
|
7358
|
+
return /* @__PURE__ */ jsxs32(chakra26.div, { css: styles.root, children: [
|
|
7359
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx47(Breadcrumbs, { items: breadcrumbs }),
|
|
7360
|
+
/* @__PURE__ */ jsxs32(chakra26.div, { css: styles.row, children: [
|
|
7361
|
+
/* @__PURE__ */ jsxs32(chakra26.div, { css: styles.titleGroup, children: [
|
|
7362
|
+
count != null || adornments != null ? /* @__PURE__ */ jsxs32(chakra26.div, { display: "flex", alignItems: "center", gap: "2.5", flexWrap: "wrap", minW: "0", children: [
|
|
7363
|
+
/* @__PURE__ */ jsx47(chakra26.h1, { css: styles.title, children: loading && title == null ? /* @__PURE__ */ jsx47(TextBone, { width: titleWidth }) : title }),
|
|
7364
|
+
count != null && /* @__PURE__ */ jsx47(CountBadge, { value: count, size: "md" }),
|
|
7325
7365
|
adornments
|
|
7326
|
-
] }) : /* @__PURE__ */
|
|
7327
|
-
meta != null && /* @__PURE__ */
|
|
7328
|
-
description != null && /* @__PURE__ */
|
|
7366
|
+
] }) : /* @__PURE__ */ jsx47(chakra26.h1, { css: styles.title, children: loading && title == null ? /* @__PURE__ */ jsx47(TextBone, { width: titleWidth }) : title }),
|
|
7367
|
+
meta != null && /* @__PURE__ */ jsx47(chakra26.div, { css: styles.meta, children: meta }),
|
|
7368
|
+
description != null && /* @__PURE__ */ jsx47(chakra26.p, { css: styles.description, children: description })
|
|
7329
7369
|
] }),
|
|
7330
|
-
actions != null && /* @__PURE__ */
|
|
7370
|
+
actions != null && /* @__PURE__ */ jsx47(chakra26.div, { css: styles.actions, children: actions })
|
|
7331
7371
|
] })
|
|
7332
7372
|
] });
|
|
7333
7373
|
}
|
|
7334
7374
|
function Breadcrumbs({ items, loading: own }) {
|
|
7335
7375
|
const labels = useAbpLabels();
|
|
7336
7376
|
const loading = useLoading(own);
|
|
7337
|
-
const label = (item, i) => loading && item.label == null ? /* @__PURE__ */
|
|
7377
|
+
const label = (item, i) => loading && item.label == null ? /* @__PURE__ */ jsx47(TextBone, { width: 8 + i % 3 * 3 }) : item.label;
|
|
7338
7378
|
const Link = useLinkComponent();
|
|
7339
7379
|
const { shown, hidden } = foldBreadcrumbs(items);
|
|
7340
|
-
return /* @__PURE__ */
|
|
7341
|
-
n > 0 && /* @__PURE__ */
|
|
7342
|
-
entry == null ? /* @__PURE__ */
|
|
7343
|
-
/* @__PURE__ */
|
|
7380
|
+
return /* @__PURE__ */ jsx47(Breadcrumb.Root, { "aria-label": labels.breadcrumb, children: /* @__PURE__ */ jsx47(Breadcrumb.List, { children: shown.map((entry, n) => /* @__PURE__ */ jsxs32(Fragment14, { children: [
|
|
7381
|
+
n > 0 && /* @__PURE__ */ jsx47(Breadcrumb.Separator, { children: /* @__PURE__ */ jsx47(ChevronRight3, {}) }),
|
|
7382
|
+
entry == null ? /* @__PURE__ */ jsx47(Breadcrumb.Item, { children: /* @__PURE__ */ jsxs32(Menu2.Root, { positioning: { placement: "bottom-start" }, children: [
|
|
7383
|
+
/* @__PURE__ */ jsx47(Menu2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx47(
|
|
7344
7384
|
chakra26.button,
|
|
7345
7385
|
{
|
|
7346
7386
|
type: "button",
|
|
@@ -7355,74 +7395,74 @@ function Breadcrumbs({ items, loading: own }) {
|
|
|
7355
7395
|
children: "\u2026"
|
|
7356
7396
|
}
|
|
7357
7397
|
) }),
|
|
7358
|
-
/* @__PURE__ */
|
|
7359
|
-
] }) }) : /* @__PURE__ */
|
|
7398
|
+
/* @__PURE__ */ jsx47(Portal12, { children: /* @__PURE__ */ jsx47(Menu2.Positioner, { children: /* @__PURE__ */ jsx47(Menu2.Content, { minW: "40", children: hidden.map((h, k) => /* @__PURE__ */ jsx47(Menu2.Item, { value: String(k), asChild: Boolean(h.href), children: h.href ? /* @__PURE__ */ jsx47(Link, { href: h.href, children: h.label }) : /* @__PURE__ */ jsx47("span", { children: h.label }) }, k)) }) }) })
|
|
7399
|
+
] }) }) : /* @__PURE__ */ jsx47(Breadcrumb.Item, { children: entry.item.href && entry.index < items.length - 1 ? /* @__PURE__ */ jsx47(Breadcrumb.Link, { asChild: true, children: /* @__PURE__ */ jsx47(Link, { href: entry.item.href, children: label(entry.item, entry.index) }) }) : /* @__PURE__ */ jsx47(Breadcrumb.CurrentLink, { children: label(entry.item, entry.index) }) })
|
|
7360
7400
|
] }, entry ? entry.index : "more")) }) });
|
|
7361
7401
|
}
|
|
7362
7402
|
|
|
7363
7403
|
// src/components/Panel.tsx
|
|
7364
7404
|
import { createContext as createContext11, forwardRef as forwardRef8, useContext as useContext11 } from "react";
|
|
7365
7405
|
import { chakra as chakra27, useSlotRecipe as useSlotRecipe5 } from "@chakra-ui/react";
|
|
7366
|
-
import { jsx as
|
|
7406
|
+
import { jsx as jsx48, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
7367
7407
|
var ToneContext = createContext11("card");
|
|
7368
7408
|
function PanelTone({ tone, children }) {
|
|
7369
|
-
return /* @__PURE__ */
|
|
7409
|
+
return /* @__PURE__ */ jsx48(ToneContext.Provider, { value: tone, children });
|
|
7370
7410
|
}
|
|
7371
7411
|
var Panel = forwardRef8(function Panel2({ title, description, actions, footer, flush = false, headingAs = "h2", loading, tone, children, css, ...rest }, ref) {
|
|
7372
7412
|
const recipe = useSlotRecipe5({ key: "abpPanel" });
|
|
7373
7413
|
const inherited = useContext11(ToneContext);
|
|
7374
7414
|
const styles = recipe({ flush, tone: tone ?? inherited });
|
|
7375
7415
|
const hasHeader = title != null || actions != null || description != null;
|
|
7376
|
-
return /* @__PURE__ */
|
|
7377
|
-
hasHeader && /* @__PURE__ */
|
|
7378
|
-
/* @__PURE__ */
|
|
7379
|
-
title != null && /* @__PURE__ */
|
|
7380
|
-
description != null && /* @__PURE__ */
|
|
7416
|
+
return /* @__PURE__ */ jsxs33(chakra27.section, { ref, css: [styles.root, css], ...rest, children: [
|
|
7417
|
+
hasHeader && /* @__PURE__ */ jsxs33(chakra27.header, { css: styles.header, children: [
|
|
7418
|
+
/* @__PURE__ */ jsxs33(chakra27.div, { css: styles.titleGroup, children: [
|
|
7419
|
+
title != null && /* @__PURE__ */ jsx48(chakra27.h2, { as: headingAs, css: styles.title, children: title }),
|
|
7420
|
+
description != null && /* @__PURE__ */ jsx48(chakra27.p, { css: styles.description, children: description })
|
|
7381
7421
|
] }),
|
|
7382
|
-
actions != null && /* @__PURE__ */
|
|
7422
|
+
actions != null && /* @__PURE__ */ jsx48(chakra27.div, { css: styles.actions, children: actions })
|
|
7383
7423
|
] }),
|
|
7384
|
-
/* @__PURE__ */
|
|
7385
|
-
footer != null && /* @__PURE__ */
|
|
7424
|
+
/* @__PURE__ */ jsx48(chakra27.div, { css: styles.body, children: loading === void 0 ? children : /* @__PURE__ */ jsx48(Loading, { when: loading, children }) }),
|
|
7425
|
+
footer != null && /* @__PURE__ */ jsx48(chakra27.footer, { css: styles.footer, children: footer })
|
|
7386
7426
|
] });
|
|
7387
7427
|
});
|
|
7388
7428
|
|
|
7389
7429
|
// src/components/PathChips.tsx
|
|
7390
7430
|
import { chakra as chakra28, useSlotRecipe as useSlotRecipe6 } from "@chakra-ui/react";
|
|
7391
7431
|
import { ChevronRight as ChevronRight4 } from "lucide-react";
|
|
7392
|
-
import { jsx as
|
|
7432
|
+
import { jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
7393
7433
|
function PathChips({ path, highlightLast = true, loading: own, skeletonCount = 3, css, ...rest }) {
|
|
7394
7434
|
const labels = useAbpLabels();
|
|
7395
7435
|
const recipe = useSlotRecipe6({ key: "abpPathChips" });
|
|
7396
7436
|
const styles = recipe({});
|
|
7397
7437
|
const loading = useLoading(own) && path.length === 0;
|
|
7398
7438
|
const segments = loading ? Array.from({ length: skeletonCount }, (_, i) => "\xA0".repeat(boneWidth(i, 6, 12))) : path;
|
|
7399
|
-
return /* @__PURE__ */
|
|
7400
|
-
i > 0 && /* @__PURE__ */
|
|
7401
|
-
/* @__PURE__ */
|
|
7439
|
+
return /* @__PURE__ */ jsx49(chakra28.ol, { "aria-label": rest["aria-label"] ?? labels.path, "aria-hidden": loading || void 0, css: [styles.root, css], ...rest, children: segments.map((segment, i) => /* @__PURE__ */ jsxs34(chakra28.li, { css: styles.item, children: [
|
|
7440
|
+
i > 0 && /* @__PURE__ */ jsx49(chakra28.span, { css: styles.separator, "aria-hidden": "true", children: /* @__PURE__ */ jsx49(ChevronRight4, {}) }),
|
|
7441
|
+
/* @__PURE__ */ jsx49(chakra28.span, { css: loading ? [styles.chip, ghostCss] : styles.chip, "aria-current": !loading && highlightLast && i === path.length - 1 ? true : void 0, children: segment })
|
|
7402
7442
|
] }, `${i}:${segment}`)) });
|
|
7403
7443
|
}
|
|
7404
7444
|
|
|
7405
7445
|
// src/components/PropertyList.tsx
|
|
7406
7446
|
import { chakra as chakra29, DataList } from "@chakra-ui/react";
|
|
7407
|
-
import { jsx as
|
|
7447
|
+
import { jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
7408
7448
|
function PropertyList({ items, size = "md", loading: own }) {
|
|
7409
7449
|
const loading = useLoading(own);
|
|
7410
7450
|
const arriving = useArriving(loading);
|
|
7411
|
-
return /* @__PURE__ */
|
|
7412
|
-
/* @__PURE__ */
|
|
7413
|
-
/* @__PURE__ */
|
|
7451
|
+
return /* @__PURE__ */ jsx50(DataList.Root, { orientation: "horizontal", size, children: items.map((item, i) => /* @__PURE__ */ jsxs35(DataList.Item, { children: [
|
|
7452
|
+
/* @__PURE__ */ jsx50(DataList.ItemLabel, { children: item.label }),
|
|
7453
|
+
/* @__PURE__ */ jsx50(DataList.ItemValue, { children: loading && item.value == null ? /* @__PURE__ */ jsx50(TextBone, { width: item.skeletonWidth ?? boneWidth(i, 8, 16) }) : arriving ? /* @__PURE__ */ jsx50(chakra29.span, { css: arriveCss, children: item.value }) : item.value })
|
|
7414
7454
|
] }, item.id ?? i)) });
|
|
7415
7455
|
}
|
|
7416
7456
|
|
|
7417
7457
|
// src/components/QueryableList.tsx
|
|
7418
|
-
import { useEffect as
|
|
7458
|
+
import { useEffect as useEffect15, useId as useId5, useMemo as useMemo12, useRef as useRef19, useState as useState21 } from "react";
|
|
7419
7459
|
import { createPortal } from "react-dom";
|
|
7420
|
-
import { Box as Box10, chakra as chakra31, HStack as HStack11, Input as Input6, Menu as Menu3, Portal as Portal15, Stack as Stack11, Text as
|
|
7460
|
+
import { Box as Box10, chakra as chakra31, HStack as HStack11, Input as Input6, Menu as Menu3, Portal as Portal15, Stack as Stack11, Text as Text14 } from "@chakra-ui/react";
|
|
7421
7461
|
import { ArrowDownWideNarrow, ArrowUpNarrowWide, ChevronDown as ChevronDown3, Download, Filter, Plus as Plus3, Rows3, Save, Trash2 as Trash22, X as X2 } from "lucide-react";
|
|
7422
7462
|
|
|
7423
7463
|
// src/components/query/ColumnsPopover.tsx
|
|
7424
7464
|
import { useMemo as useMemo11 } from "react";
|
|
7425
|
-
import { chakra as chakra30, HStack as HStack9, Popover as Popover3, Portal as Portal13, Stack as Stack9, Switch as Switch2, Text as
|
|
7465
|
+
import { chakra as chakra30, HStack as HStack9, Popover as Popover3, Portal as Portal13, Stack as Stack9, Switch as Switch2, Text as Text12 } from "@chakra-ui/react";
|
|
7426
7466
|
import {
|
|
7427
7467
|
closestCenter,
|
|
7428
7468
|
DndContext as DndContext3,
|
|
@@ -7434,7 +7474,7 @@ import {
|
|
|
7434
7474
|
import { arrayMove, SortableContext as SortableContext2, sortableKeyboardCoordinates as sortableKeyboardCoordinates2, useSortable as useSortable2, verticalListSortingStrategy as verticalListSortingStrategy2 } from "@dnd-kit/sortable";
|
|
7435
7475
|
import { CSS as CSS3 } from "@dnd-kit/utilities";
|
|
7436
7476
|
import { Columns3, GripVertical as GripVertical4 } from "lucide-react";
|
|
7437
|
-
import { jsx as
|
|
7477
|
+
import { jsx as jsx51, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7438
7478
|
function fill(template, values) {
|
|
7439
7479
|
return template.replace(/\{(\w+)\}/g, (_, k) => values[k] ?? `{${k}}`);
|
|
7440
7480
|
}
|
|
@@ -7451,19 +7491,19 @@ function ColumnsPopover({ fields, columns, onChange }) {
|
|
|
7451
7491
|
if (from < 0 || to < 0) return;
|
|
7452
7492
|
onChange(arrayMove(columns, from, to));
|
|
7453
7493
|
}
|
|
7454
|
-
return /* @__PURE__ */
|
|
7455
|
-
/* @__PURE__ */
|
|
7456
|
-
/* @__PURE__ */
|
|
7494
|
+
return /* @__PURE__ */ jsxs36(Popover3.Root, { positioning: { placement: "bottom-end" }, lazyMount: true, unmountOnExit: true, children: [
|
|
7495
|
+
/* @__PURE__ */ jsx51(Popover3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs36(Button, { size: "sm", variant: "secondary", disabled: fields.length === 0, children: [
|
|
7496
|
+
/* @__PURE__ */ jsx51(Columns3, {}),
|
|
7457
7497
|
labels.columns
|
|
7458
7498
|
] }) }),
|
|
7459
|
-
/* @__PURE__ */
|
|
7460
|
-
/* @__PURE__ */
|
|
7461
|
-
/* @__PURE__ */
|
|
7462
|
-
/* @__PURE__ */
|
|
7499
|
+
/* @__PURE__ */ jsx51(Portal13, { children: /* @__PURE__ */ jsx51(Popover3.Positioner, { children: /* @__PURE__ */ jsx51(Popover3.Content, { w: "80", maxW: "calc(100vw - 2rem)", children: /* @__PURE__ */ jsxs36(Popover3.Body, { p: "0", children: [
|
|
7500
|
+
/* @__PURE__ */ jsxs36(HStack9, { justify: "space-between", px: "3.5", pt: "3", pb: "1", children: [
|
|
7501
|
+
/* @__PURE__ */ jsx51(Text12, { textStyle: "sm", fontWeight: "semibold", children: labels.visibleColumns }),
|
|
7502
|
+
/* @__PURE__ */ jsx51(Button, { size: "xs", variant: "ghost", disabled: hidden.length === 0, onClick: () => onChange([...columns, ...hidden.map((f) => f.id)]), children: labels.showAllColumns })
|
|
7463
7503
|
] }),
|
|
7464
|
-
/* @__PURE__ */
|
|
7465
|
-
/* @__PURE__ */
|
|
7466
|
-
/* @__PURE__ */
|
|
7504
|
+
/* @__PURE__ */ jsx51(Text12, { textStyle: "caption", color: "fg.muted", px: "3.5", pb: "2", children: labels.columnsHint }),
|
|
7505
|
+
/* @__PURE__ */ jsxs36(chakra30.div, { maxH: "80", overflowY: "auto", pb: "2", children: [
|
|
7506
|
+
/* @__PURE__ */ jsx51(DndContext3, { sensors, collisionDetection: closestCenter, onDragEnd, children: /* @__PURE__ */ jsx51(SortableContext2, { items: shown, strategy: verticalListSortingStrategy2, children: /* @__PURE__ */ jsx51(Stack9, { gap: "0", role: "list", "aria-label": labels.visibleColumns, children: shown.map((id) => /* @__PURE__ */ jsx51(
|
|
7467
7507
|
ColumnRow,
|
|
7468
7508
|
{
|
|
7469
7509
|
id,
|
|
@@ -7474,7 +7514,7 @@ function ColumnsPopover({ fields, columns, onChange }) {
|
|
|
7474
7514
|
},
|
|
7475
7515
|
id
|
|
7476
7516
|
)) }) }) }),
|
|
7477
|
-
hidden.length > 0 && /* @__PURE__ */
|
|
7517
|
+
hidden.length > 0 && /* @__PURE__ */ jsx51(Stack9, { gap: "0", borderTopWidth: "1px", borderColor: "border.muted", mt: "1", pt: "1", role: "list", "aria-label": labels.hiddenColumns, children: hidden.map((f) => /* @__PURE__ */ jsx51(ColumnRow, { id: f.id, label: f.label, checked: false, onCheckedChange: () => onChange([...columns, f.id]) }, f.id)) })
|
|
7478
7518
|
] })
|
|
7479
7519
|
] }) }) }) })
|
|
7480
7520
|
] });
|
|
@@ -7483,7 +7523,7 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
7483
7523
|
const labels = useAbpLabels().queryList;
|
|
7484
7524
|
const sortable = useSortable2({ id, disabled: !checked });
|
|
7485
7525
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = sortable;
|
|
7486
|
-
return /* @__PURE__ */
|
|
7526
|
+
return /* @__PURE__ */ jsxs36(
|
|
7487
7527
|
HStack9,
|
|
7488
7528
|
{
|
|
7489
7529
|
ref: setNodeRef,
|
|
@@ -7500,7 +7540,7 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
7500
7540
|
style: { transform: CSS3.Transform.toString(transform), transition },
|
|
7501
7541
|
_hover: { bg: "bg.subtle" },
|
|
7502
7542
|
children: [
|
|
7503
|
-
checked ? /* @__PURE__ */
|
|
7543
|
+
checked ? /* @__PURE__ */ jsx51(
|
|
7504
7544
|
chakra30.button,
|
|
7505
7545
|
{
|
|
7506
7546
|
type: "button",
|
|
@@ -7513,13 +7553,13 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
7513
7553
|
"aria-label": fill(labels.dragColumn, { field: label }),
|
|
7514
7554
|
...attributes,
|
|
7515
7555
|
...listeners2,
|
|
7516
|
-
children: /* @__PURE__ */
|
|
7556
|
+
children: /* @__PURE__ */ jsx51(GripVertical4, { size: 16 })
|
|
7517
7557
|
}
|
|
7518
|
-
) : /* @__PURE__ */
|
|
7519
|
-
/* @__PURE__ */
|
|
7520
|
-
/* @__PURE__ */
|
|
7521
|
-
/* @__PURE__ */
|
|
7522
|
-
/* @__PURE__ */
|
|
7558
|
+
) : /* @__PURE__ */ jsx51(chakra30.span, { w: "4", flexShrink: 0 }),
|
|
7559
|
+
/* @__PURE__ */ jsx51(Text12, { as: "span", flex: "1", textStyle: "sm", truncate: true, color: checked ? "fg" : "fg.muted", children: label }),
|
|
7560
|
+
/* @__PURE__ */ jsxs36(Switch2.Root, { size: "sm", colorPalette: "accent", checked, disabled, onCheckedChange, "aria-label": label, children: [
|
|
7561
|
+
/* @__PURE__ */ jsx51(Switch2.HiddenInput, {}),
|
|
7562
|
+
/* @__PURE__ */ jsx51(Switch2.Control, { children: /* @__PURE__ */ jsx51(Switch2.Thumb, {}) })
|
|
7523
7563
|
] })
|
|
7524
7564
|
]
|
|
7525
7565
|
}
|
|
@@ -7527,10 +7567,10 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
7527
7567
|
}
|
|
7528
7568
|
|
|
7529
7569
|
// src/components/query/FilterBuilder.tsx
|
|
7530
|
-
import { useEffect as
|
|
7531
|
-
import { CloseButton as CloseButton3, Dialog as Dialog5, HStack as HStack10, Input as Input5, Portal as Portal14, Stack as Stack10, Text as
|
|
7570
|
+
import { useEffect as useEffect14, useId as useId4, useRef as useRef18, useState as useState20 } from "react";
|
|
7571
|
+
import { CloseButton as CloseButton3, Dialog as Dialog5, HStack as HStack10, Input as Input5, Portal as Portal14, Stack as Stack10, Text as Text13 } from "@chakra-ui/react";
|
|
7532
7572
|
import { Plus as Plus2, Trash2 } from "lucide-react";
|
|
7533
|
-
import { Fragment as Fragment15, jsx as
|
|
7573
|
+
import { Fragment as Fragment15, jsx as jsx52, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
7534
7574
|
function fill2(template, values) {
|
|
7535
7575
|
return template.replace(/\{(\w+)\}/g, (_, k) => String(values[k] ?? `{${k}}`));
|
|
7536
7576
|
}
|
|
@@ -7543,9 +7583,9 @@ function conditionOf(d, field, own) {
|
|
|
7543
7583
|
}
|
|
7544
7584
|
function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, countMatches, onApply, onClose }) {
|
|
7545
7585
|
const labels = useAbpLabels().queryList;
|
|
7546
|
-
const [seq, setSeq] =
|
|
7547
|
-
const [rows, setRows] =
|
|
7548
|
-
const [touched, setTouched] =
|
|
7586
|
+
const [seq, setSeq] = useState20(initial.length + 1);
|
|
7587
|
+
const [rows, setRows] = useState20(() => initial.flatMap((c2, i) => c2.op === "in" && Array.isArray(c2.value) && fields.find((f) => f.id === c2.field)?.operators.includes("eq") ? c2.value.map((v, j) => ({ id: i * 100 + j + 1, field: c2.field, op: "eq", text: valueText(v), chosen: v })) : [{ id: i * 100 + 1, field: c2.field, op: c2.op, text: valueText(c2.value), chosen: c2.value }]));
|
|
7588
|
+
const [touched, setTouched] = useState20(false);
|
|
7549
7589
|
const own = (d) => {
|
|
7550
7590
|
const f = fields.find((x) => x.id === d.field);
|
|
7551
7591
|
return Boolean(f && renderValueEditor && !NO_VALUE_OPS.has(d.op) && renderValueEditor({ field: f, op: d.op, value: d.chosen, onChange: () => void 0 }) != null);
|
|
@@ -7555,13 +7595,13 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
7555
7595
|
const repeats = new Set(rows.map((r) => r.field)).size < rows.length;
|
|
7556
7596
|
const key = JSON.stringify(complete);
|
|
7557
7597
|
const counter = useRef18(countMatches);
|
|
7558
|
-
|
|
7598
|
+
useEffect14(() => {
|
|
7559
7599
|
counter.current = countMatches;
|
|
7560
7600
|
});
|
|
7561
7601
|
const counts = Boolean(countMatches);
|
|
7562
|
-
const [count, setCount] =
|
|
7563
|
-
const [total, setTotal] =
|
|
7564
|
-
|
|
7602
|
+
const [count, setCount] = useState20(null);
|
|
7603
|
+
const [total, setTotal] = useState20(null);
|
|
7604
|
+
useEffect14(() => {
|
|
7565
7605
|
if (!counts) return;
|
|
7566
7606
|
let gone = false;
|
|
7567
7607
|
counter.current?.([]).then((n) => !gone && setTotal(n), () => void 0);
|
|
@@ -7569,7 +7609,7 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
7569
7609
|
gone = true;
|
|
7570
7610
|
};
|
|
7571
7611
|
}, [counts]);
|
|
7572
|
-
|
|
7612
|
+
useEffect14(() => {
|
|
7573
7613
|
if (!counts) return;
|
|
7574
7614
|
let gone = false;
|
|
7575
7615
|
const timer = setTimeout(() => {
|
|
@@ -7586,23 +7626,23 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
7586
7626
|
setSeq((n) => n + 1);
|
|
7587
7627
|
};
|
|
7588
7628
|
const change = (id, patch) => setRows((r) => r.map((d) => d.id === id ? { ...d, ...patch, dirty: true } : d));
|
|
7589
|
-
return /* @__PURE__ */
|
|
7590
|
-
/* @__PURE__ */
|
|
7591
|
-
/* @__PURE__ */
|
|
7592
|
-
/* @__PURE__ */
|
|
7593
|
-
/* @__PURE__ */
|
|
7594
|
-
/* @__PURE__ */
|
|
7629
|
+
return /* @__PURE__ */ jsx52(Dialog5.Root, { open: true, onOpenChange: (e) => !e.open && onClose(), size: "lg", placement: "center", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs37(Portal14, { children: [
|
|
7630
|
+
/* @__PURE__ */ jsx52(Dialog5.Backdrop, {}),
|
|
7631
|
+
/* @__PURE__ */ jsx52(Dialog5.Positioner, { children: /* @__PURE__ */ jsxs37(Dialog5.Content, { "data-filter-builder": "", children: [
|
|
7632
|
+
/* @__PURE__ */ jsx52(Dialog5.Header, { children: /* @__PURE__ */ jsxs37(HStack10, { justify: "space-between", w: "full", gap: "3", children: [
|
|
7633
|
+
/* @__PURE__ */ jsx52(Dialog5.Title, { children: labels.buildFilters }),
|
|
7634
|
+
/* @__PURE__ */ jsx52(Button, { size: "xs", variant: "ghost", onClick: () => setRows([]), disabled: rows.length === 0, children: labels.clearAll })
|
|
7595
7635
|
] }) }),
|
|
7596
|
-
/* @__PURE__ */
|
|
7597
|
-
/* @__PURE__ */
|
|
7636
|
+
/* @__PURE__ */ jsx52(Dialog5.Body, { children: /* @__PURE__ */ jsxs37(Stack10, { gap: "3", children: [
|
|
7637
|
+
/* @__PURE__ */ jsxs37(Text13, { textStyle: "sm", color: "fg.muted", children: [
|
|
7598
7638
|
labels.matchAll,
|
|
7599
|
-
repeats && /* @__PURE__ */
|
|
7639
|
+
repeats && /* @__PURE__ */ jsxs37(Fragment15, { children: [
|
|
7600
7640
|
" ",
|
|
7601
7641
|
labels.sameFieldAny
|
|
7602
7642
|
] })
|
|
7603
7643
|
] }),
|
|
7604
|
-
rows.length === 0 && /* @__PURE__ */
|
|
7605
|
-
rows.map((d) => /* @__PURE__ */
|
|
7644
|
+
rows.length === 0 && /* @__PURE__ */ jsx52(Text13, { textStyle: "sm", color: "fg.muted", py: "2", children: labels.noConditions }),
|
|
7645
|
+
rows.map((d) => /* @__PURE__ */ jsx52(
|
|
7606
7646
|
ConditionRow,
|
|
7607
7647
|
{
|
|
7608
7648
|
draft: d,
|
|
@@ -7615,32 +7655,32 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
7615
7655
|
},
|
|
7616
7656
|
d.id
|
|
7617
7657
|
)),
|
|
7618
|
-
/* @__PURE__ */
|
|
7619
|
-
/* @__PURE__ */
|
|
7658
|
+
/* @__PURE__ */ jsx52(HStack10, { children: /* @__PURE__ */ jsxs37(Button, { size: "sm", variant: "secondary", onClick: add, disabled: fields.length === 0, children: [
|
|
7659
|
+
/* @__PURE__ */ jsx52(Plus2, {}),
|
|
7620
7660
|
labels.addCondition
|
|
7621
7661
|
] }) }),
|
|
7622
|
-
/* @__PURE__ */
|
|
7623
|
-
/* @__PURE__ */
|
|
7624
|
-
/* @__PURE__ */
|
|
7662
|
+
/* @__PURE__ */ jsxs37(Stack10, { gap: "1", borderTopWidth: "1px", borderColor: "border.muted", pt: "3", children: [
|
|
7663
|
+
/* @__PURE__ */ jsx52(Text13, { textStyle: "xs", fontWeight: "bold", color: "fg.muted", children: labels.activeFilters }),
|
|
7664
|
+
/* @__PURE__ */ jsx52(Text13, { textStyle: "sm", "data-active-filters": "", children: complete.length === 0 ? labels.noneActive : complete.map((c2) => describe(c2, fields, labels)).join(" \xB7 ") })
|
|
7625
7665
|
] })
|
|
7626
7666
|
] }) }),
|
|
7627
|
-
/* @__PURE__ */
|
|
7628
|
-
/* @__PURE__ */
|
|
7667
|
+
/* @__PURE__ */ jsx52(Dialog5.Footer, { children: /* @__PURE__ */ jsxs37(HStack10, { justify: "space-between", w: "full", wrap: "wrap", gap: "2", children: [
|
|
7668
|
+
/* @__PURE__ */ jsxs37(Text13, { textStyle: "sm", color: "fg.muted", "aria-live": "polite", "data-filter-count": "", children: [
|
|
7629
7669
|
count != null && fill2(total != null ? labels.matchCount : labels.matchCountOnly, { count, total: total ?? "" }),
|
|
7630
|
-
incomplete > 0 && /* @__PURE__ */
|
|
7670
|
+
incomplete > 0 && /* @__PURE__ */ jsxs37(Fragment15, { children: [
|
|
7631
7671
|
" \xB7 ",
|
|
7632
7672
|
labels.incompleteSkipped
|
|
7633
7673
|
] })
|
|
7634
7674
|
] }),
|
|
7635
|
-
/* @__PURE__ */
|
|
7636
|
-
/* @__PURE__ */
|
|
7637
|
-
/* @__PURE__ */
|
|
7675
|
+
/* @__PURE__ */ jsxs37(HStack10, { gap: "2", children: [
|
|
7676
|
+
/* @__PURE__ */ jsx52(Button, { size: "sm", variant: "ghost", onClick: onClose, children: labels.cancel }),
|
|
7677
|
+
/* @__PURE__ */ jsx52(Button, { size: "sm", variant: "primary", onClick: () => {
|
|
7638
7678
|
setTouched(true);
|
|
7639
7679
|
onApply(mergeSameField(complete, fields));
|
|
7640
7680
|
}, children: labels.applyFilters })
|
|
7641
7681
|
] })
|
|
7642
7682
|
] }) }),
|
|
7643
|
-
/* @__PURE__ */
|
|
7683
|
+
/* @__PURE__ */ jsx52(Dialog5.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx52(CloseButton3, { size: "sm" }) })
|
|
7644
7684
|
] }) })
|
|
7645
7685
|
] }) });
|
|
7646
7686
|
}
|
|
@@ -7654,9 +7694,9 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
7654
7694
|
const listId = useId4();
|
|
7655
7695
|
const field = fields.find((f) => f.id === draft.field);
|
|
7656
7696
|
const { op, text } = draft;
|
|
7657
|
-
const [options, setOptions] =
|
|
7697
|
+
const [options, setOptions] = useState20([]);
|
|
7658
7698
|
const own = field && renderValueEditor && !NO_VALUE_OPS.has(op) ? renderValueEditor({ field, op, value: draft.chosen, onChange: (v) => onChange({ chosen: v }) }) : null;
|
|
7659
|
-
|
|
7699
|
+
useEffect14(() => {
|
|
7660
7700
|
if (!suggest || !field || NO_VALUE_OPS.has(op) || own != null) return;
|
|
7661
7701
|
const typed = LIST_OPS.has(op) ? (text.split(",").pop() ?? "").trim() : text;
|
|
7662
7702
|
const prefix = `"${field.id}" = `;
|
|
@@ -7669,9 +7709,9 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
7669
7709
|
clearTimeout(timer);
|
|
7670
7710
|
};
|
|
7671
7711
|
}, [suggest, field, op, text, own]);
|
|
7672
|
-
return /* @__PURE__ */
|
|
7673
|
-
/* @__PURE__ */
|
|
7674
|
-
/* @__PURE__ */
|
|
7712
|
+
return /* @__PURE__ */ jsxs37(Stack10, { gap: "1", "data-condition": "", children: [
|
|
7713
|
+
/* @__PURE__ */ jsxs37(HStack10, { gap: "1.5", wrap: "wrap", align: "start", children: [
|
|
7714
|
+
/* @__PURE__ */ jsx52(
|
|
7675
7715
|
SelectField,
|
|
7676
7716
|
{
|
|
7677
7717
|
width: "auto",
|
|
@@ -7685,7 +7725,7 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
7685
7725
|
options: fields.map((f) => ({ value: f.id, label: f.label }))
|
|
7686
7726
|
}
|
|
7687
7727
|
),
|
|
7688
|
-
/* @__PURE__ */
|
|
7728
|
+
/* @__PURE__ */ jsx52(
|
|
7689
7729
|
SelectField,
|
|
7690
7730
|
{
|
|
7691
7731
|
width: "auto",
|
|
@@ -7697,8 +7737,8 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
7697
7737
|
}
|
|
7698
7738
|
),
|
|
7699
7739
|
own,
|
|
7700
|
-
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */
|
|
7701
|
-
/* @__PURE__ */
|
|
7740
|
+
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */ jsxs37(Fragment15, { children: [
|
|
7741
|
+
/* @__PURE__ */ jsx52(
|
|
7702
7742
|
Input5,
|
|
7703
7743
|
{
|
|
7704
7744
|
size: "sm",
|
|
@@ -7712,16 +7752,16 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
7712
7752
|
onChange: (e) => onChange({ text: e.target.value })
|
|
7713
7753
|
}
|
|
7714
7754
|
),
|
|
7715
|
-
/* @__PURE__ */
|
|
7755
|
+
/* @__PURE__ */ jsx52("datalist", { id: listId, children: options.filter((o) => o.kind !== "keyword").map((o) => /* @__PURE__ */ jsx52("option", { value: o.text.replace(/^"|"$/g, ""), children: o.label }, o.text)) })
|
|
7716
7756
|
] }),
|
|
7717
|
-
/* @__PURE__ */
|
|
7757
|
+
/* @__PURE__ */ jsx52(IconButton, { size: "sm", variant: "ghost", "aria-label": fill2(labels.removeFilter, { field: field?.label ?? draft.field }), onClick: onRemove, children: /* @__PURE__ */ jsx52(Trash2, {}) })
|
|
7718
7758
|
] }),
|
|
7719
|
-
warn && /* @__PURE__ */
|
|
7759
|
+
warn && /* @__PURE__ */ jsx52(Text13, { textStyle: "xs", color: "fg.error", children: labels.incomplete })
|
|
7720
7760
|
] });
|
|
7721
7761
|
}
|
|
7722
7762
|
|
|
7723
7763
|
// src/components/QueryableList.tsx
|
|
7724
|
-
import { Fragment as Fragment16, jsx as
|
|
7764
|
+
import { Fragment as Fragment16, jsx as jsx53, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
7725
7765
|
var PAIR = "";
|
|
7726
7766
|
var pairKey = (first, second) => `${first}${PAIR}${second}`;
|
|
7727
7767
|
var condition = (field, value) => value == null ? { field, op: "isEmpty" } : { field, op: "eq", value };
|
|
@@ -7781,14 +7821,14 @@ function QueryableList({
|
|
|
7781
7821
|
const byId = useMemo12(() => new Map((fields ?? []).map((f) => [f.id, f])), [fields]);
|
|
7782
7822
|
const query = result?.query ?? state.query ?? {};
|
|
7783
7823
|
const conditions = basicConditions(query.where ?? null);
|
|
7784
|
-
const [mode, setMode] =
|
|
7785
|
-
const [adding, setAdding] =
|
|
7786
|
-
const [naming, setNaming] =
|
|
7787
|
-
const [exporting, setExporting] =
|
|
7788
|
-
const [exported, setExported] =
|
|
7824
|
+
const [mode, setMode] = useState21(conditions === null ? "rql" : "basic");
|
|
7825
|
+
const [adding, setAdding] = useState21(false);
|
|
7826
|
+
const [naming, setNaming] = useState21(null);
|
|
7827
|
+
const [exporting, setExporting] = useState21(false);
|
|
7828
|
+
const [exported, setExported] = useState21(null);
|
|
7789
7829
|
const complex = conditions === null;
|
|
7790
7830
|
const failed = Boolean(error && state.rql);
|
|
7791
|
-
|
|
7831
|
+
useEffect15(() => {
|
|
7792
7832
|
if (complex || failed) setMode("rql");
|
|
7793
7833
|
}, [complex, failed]);
|
|
7794
7834
|
const label = (id) => byId.get(id)?.label ?? id;
|
|
@@ -7834,8 +7874,8 @@ function QueryableList({
|
|
|
7834
7874
|
}
|
|
7835
7875
|
const groupField = query.groupBy?.field ?? null;
|
|
7836
7876
|
const thenField = groupField ? query.groupBy?.then?.field ?? null : null;
|
|
7837
|
-
const [folded, setFolded] =
|
|
7838
|
-
|
|
7877
|
+
const [folded, setFolded] = useState21(() => /* @__PURE__ */ new Set());
|
|
7878
|
+
useEffect15(() => setFolded(/* @__PURE__ */ new Set()), [groupField, thenField]);
|
|
7839
7879
|
const grouped = Boolean(groupField && result?.groups && result.groups.length > 0);
|
|
7840
7880
|
const asTree = Boolean(tree && groupField === tree.field);
|
|
7841
7881
|
const groupOf = (row) => {
|
|
@@ -7864,15 +7904,15 @@ function QueryableList({
|
|
|
7864
7904
|
}
|
|
7865
7905
|
const sortable = (fields ?? []).filter((f) => f.sortable);
|
|
7866
7906
|
const groupLabel = groupField ? thenField ? `${label(groupField)} \xB7 ${label(thenField)}` : label(groupField) : null;
|
|
7867
|
-
return /* @__PURE__ */
|
|
7868
|
-
/* @__PURE__ */
|
|
7869
|
-
/* @__PURE__ */
|
|
7870
|
-
/* @__PURE__ */
|
|
7907
|
+
return /* @__PURE__ */ jsxs38(Stack11, { gap: "3", children: [
|
|
7908
|
+
/* @__PURE__ */ jsxs38(chakra31.div, { layerStyle: "panel", borderRadius: "l3", "data-query-toolbar": "", children: [
|
|
7909
|
+
/* @__PURE__ */ jsxs38(HStack11, { gap: "2", wrap: "wrap", justify: "space-between", px: "2.5", py: "2", borderBottomWidth: "1px", borderColor: "border.muted", children: [
|
|
7910
|
+
/* @__PURE__ */ jsxs38(HStack11, { gap: "2", wrap: "wrap", minW: "0", children: [
|
|
7871
7911
|
leading,
|
|
7872
|
-
leading != null && views && onSelectView && /* @__PURE__ */
|
|
7873
|
-
views && onSelectView && /* @__PURE__ */
|
|
7874
|
-
/* @__PURE__ */
|
|
7875
|
-
/* @__PURE__ */
|
|
7912
|
+
leading != null && views && onSelectView && /* @__PURE__ */ jsx53(chakra31.span, { w: "1px", h: "6", bg: "border", mx: "1", "aria-hidden": true }),
|
|
7913
|
+
views && onSelectView && /* @__PURE__ */ jsxs38(HStack11, { gap: "2", children: [
|
|
7914
|
+
/* @__PURE__ */ jsx53(Text14, { as: "span", textStyle: "xs", fontWeight: "semibold", color: "fg.muted", whiteSpace: "nowrap", hideBelow: "2xl", children: labels.savedView }),
|
|
7915
|
+
/* @__PURE__ */ jsx53(
|
|
7876
7916
|
SelectField,
|
|
7877
7917
|
{
|
|
7878
7918
|
width: "auto",
|
|
@@ -7884,62 +7924,62 @@ function QueryableList({
|
|
|
7884
7924
|
}
|
|
7885
7925
|
)
|
|
7886
7926
|
] }),
|
|
7887
|
-
onSaveView && (naming === null ? /* @__PURE__ */
|
|
7888
|
-
/* @__PURE__ */
|
|
7927
|
+
onSaveView && (naming === null ? /* @__PURE__ */ jsxs38(Button, { size: "sm", variant: "ghost", color: "fg.accent", onClick: () => setNaming(activeView?.isOwner ? activeView.name : ""), children: [
|
|
7928
|
+
/* @__PURE__ */ jsx53(Save, {}),
|
|
7889
7929
|
labels.saveView
|
|
7890
|
-
] }) : /* @__PURE__ */
|
|
7930
|
+
] }) : /* @__PURE__ */ jsxs38(HStack11, { gap: "1", as: "form", onSubmit: (e) => {
|
|
7891
7931
|
e.preventDefault();
|
|
7892
7932
|
if (naming.trim()) onSaveView(naming.trim(), activeView?.isOwner && naming.trim() === activeView.name ? activeView.id : null);
|
|
7893
7933
|
setNaming(null);
|
|
7894
7934
|
}, children: [
|
|
7895
|
-
/* @__PURE__ */
|
|
7896
|
-
/* @__PURE__ */
|
|
7897
|
-
/* @__PURE__ */
|
|
7935
|
+
/* @__PURE__ */ jsx53(Input6, { size: "sm", autoFocus: true, "aria-label": labels.viewName, placeholder: labels.viewName, value: naming, onChange: (e) => setNaming(e.target.value), maxW: "56" }),
|
|
7936
|
+
/* @__PURE__ */ jsx53(Button, { size: "sm", type: "submit", variant: "primary", disabled: !naming.trim(), children: labels.save }),
|
|
7937
|
+
/* @__PURE__ */ jsx53(IconButton, { size: "sm", variant: "ghost", "aria-label": labels.cancel, onClick: () => setNaming(null), children: /* @__PURE__ */ jsx53(X2, {}) })
|
|
7898
7938
|
] })),
|
|
7899
|
-
activeView?.isOwner && onDeleteView && naming === null && /* @__PURE__ */
|
|
7939
|
+
activeView?.isOwner && onDeleteView && naming === null && /* @__PURE__ */ jsx53(IconButton, { size: "sm", variant: "ghost", "aria-label": labels.deleteView, onClick: () => onDeleteView(activeView.id), children: /* @__PURE__ */ jsx53(Trash22, {}) })
|
|
7900
7940
|
] }),
|
|
7901
|
-
/* @__PURE__ */
|
|
7902
|
-
/* @__PURE__ */
|
|
7903
|
-
/* @__PURE__ */
|
|
7904
|
-
/* @__PURE__ */
|
|
7905
|
-
/* @__PURE__ */
|
|
7941
|
+
/* @__PURE__ */ jsxs38(HStack11, { gap: "2", wrap: "wrap", children: [
|
|
7942
|
+
/* @__PURE__ */ jsxs38(Menu3.Root, { positioning: { placement: "bottom-end" }, children: [
|
|
7943
|
+
/* @__PURE__ */ jsx53(Menu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs38(Button, { size: "sm", variant: "secondary", "aria-label": labels.groupBy, disabled: groupable.length === 0, children: [
|
|
7944
|
+
/* @__PURE__ */ jsx53(Rows3, {}),
|
|
7945
|
+
/* @__PURE__ */ jsx53(Text14, { as: "span", color: "fg.muted", fontWeight: "normal", children: labels.group }),
|
|
7906
7946
|
groupLabel ?? labels.noGrouping,
|
|
7907
|
-
/* @__PURE__ */
|
|
7947
|
+
/* @__PURE__ */ jsx53(ChevronDown3, {})
|
|
7908
7948
|
] }) }),
|
|
7909
|
-
/* @__PURE__ */
|
|
7910
|
-
/* @__PURE__ */
|
|
7949
|
+
/* @__PURE__ */ jsx53(Portal15, { children: /* @__PURE__ */ jsx53(Menu3.Positioner, { children: /* @__PURE__ */ jsxs38(Menu3.Content, { minW: "48", children: [
|
|
7950
|
+
/* @__PURE__ */ jsxs38(
|
|
7911
7951
|
Menu3.RadioItemGroup,
|
|
7912
7952
|
{
|
|
7913
7953
|
value: groupField ?? "",
|
|
7914
7954
|
onValueChange: (d) => change({ ...query, groupBy: d.value ? { field: d.value, aggregates: [] } : null }),
|
|
7915
7955
|
children: [
|
|
7916
|
-
/* @__PURE__ */
|
|
7956
|
+
/* @__PURE__ */ jsxs38(Menu3.RadioItem, { value: "", children: [
|
|
7917
7957
|
labels.noGrouping,
|
|
7918
|
-
/* @__PURE__ */
|
|
7958
|
+
/* @__PURE__ */ jsx53(Menu3.ItemIndicator, {})
|
|
7919
7959
|
] }),
|
|
7920
|
-
groupable.map((f) => /* @__PURE__ */
|
|
7960
|
+
groupable.map((f) => /* @__PURE__ */ jsxs38(Menu3.RadioItem, { value: f.id, children: [
|
|
7921
7961
|
f.label,
|
|
7922
|
-
/* @__PURE__ */
|
|
7962
|
+
/* @__PURE__ */ jsx53(Menu3.ItemIndicator, {})
|
|
7923
7963
|
] }, f.id))
|
|
7924
7964
|
]
|
|
7925
7965
|
}
|
|
7926
7966
|
),
|
|
7927
|
-
groupField && groupable.length > 1 && /* @__PURE__ */
|
|
7928
|
-
/* @__PURE__ */
|
|
7929
|
-
/* @__PURE__ */
|
|
7967
|
+
groupField && groupable.length > 1 && /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
7968
|
+
/* @__PURE__ */ jsx53(Menu3.Separator, {}),
|
|
7969
|
+
/* @__PURE__ */ jsxs38(
|
|
7930
7970
|
Menu3.RadioItemGroup,
|
|
7931
7971
|
{
|
|
7932
7972
|
value: thenField ?? "",
|
|
7933
7973
|
onValueChange: (d) => change({ ...query, groupBy: { ...query.groupBy, then: d.value ? { field: d.value } : null } }),
|
|
7934
7974
|
children: [
|
|
7935
|
-
/* @__PURE__ */
|
|
7936
|
-
/* @__PURE__ */
|
|
7975
|
+
/* @__PURE__ */ jsx53(Menu3.ItemGroupLabel, { children: labels.thenBy }),
|
|
7976
|
+
/* @__PURE__ */ jsxs38(Menu3.RadioItem, { value: "", children: [
|
|
7937
7977
|
labels.noSecondGrouping,
|
|
7938
|
-
/* @__PURE__ */
|
|
7978
|
+
/* @__PURE__ */ jsx53(Menu3.ItemIndicator, {})
|
|
7939
7979
|
] }),
|
|
7940
|
-
groupable.filter((f) => f.id !== groupField).map((f) => /* @__PURE__ */
|
|
7980
|
+
groupable.filter((f) => f.id !== groupField).map((f) => /* @__PURE__ */ jsxs38(Menu3.RadioItem, { value: f.id, children: [
|
|
7941
7981
|
f.label,
|
|
7942
|
-
/* @__PURE__ */
|
|
7982
|
+
/* @__PURE__ */ jsx53(Menu3.ItemIndicator, {})
|
|
7943
7983
|
] }, f.id))
|
|
7944
7984
|
]
|
|
7945
7985
|
}
|
|
@@ -7947,15 +7987,15 @@ function QueryableList({
|
|
|
7947
7987
|
] })
|
|
7948
7988
|
] }) }) })
|
|
7949
7989
|
] }),
|
|
7950
|
-
/* @__PURE__ */
|
|
7951
|
-
onExport && !exportTarget && /* @__PURE__ */
|
|
7952
|
-
onExport && exportTarget && createPortal(/* @__PURE__ */
|
|
7990
|
+
/* @__PURE__ */ jsx53(ColumnsPopover, { fields: fields ?? [], columns: state.columns, onChange: (next) => onStateChange({ ...state, rql: result?.rql ?? state.rql, query: void 0, columns: next }) }),
|
|
7991
|
+
onExport && !exportTarget && /* @__PURE__ */ jsx53(ExportMenu, { busy: exporting, disabled: !result || Boolean(loading), onExport: runExport }),
|
|
7992
|
+
onExport && exportTarget && createPortal(/* @__PURE__ */ jsx53(ExportMenu, { busy: exporting, disabled: !result || Boolean(loading), onExport: runExport }), exportTarget),
|
|
7953
7993
|
actions
|
|
7954
7994
|
] })
|
|
7955
7995
|
] }),
|
|
7956
|
-
/* @__PURE__ */
|
|
7957
|
-
/* @__PURE__ */
|
|
7958
|
-
/* @__PURE__ */
|
|
7996
|
+
/* @__PURE__ */ jsxs38(HStack11, { gap: "2", align: "start", wrap: "wrap", justify: "space-between", px: "2.5", py: "2", children: [
|
|
7997
|
+
/* @__PURE__ */ jsxs38(HStack11, { gap: "2", align: "start", wrap: "wrap", flex: "1", minW: { base: "full", md: "0" }, children: [
|
|
7998
|
+
/* @__PURE__ */ jsx53(
|
|
7959
7999
|
SegmentedControl,
|
|
7960
8000
|
{
|
|
7961
8001
|
size: "sm",
|
|
@@ -7968,15 +8008,15 @@ function QueryableList({
|
|
|
7968
8008
|
]
|
|
7969
8009
|
}
|
|
7970
8010
|
),
|
|
7971
|
-
mode === "basic" && conditions !== null ? /* @__PURE__ */
|
|
7972
|
-
search && /* @__PURE__ */
|
|
7973
|
-
/* @__PURE__ */
|
|
7974
|
-
/* @__PURE__ */
|
|
8011
|
+
mode === "basic" && conditions !== null ? /* @__PURE__ */ jsxs38(HStack11, { gap: "2", wrap: "wrap", flex: "1", minW: "0", children: [
|
|
8012
|
+
search && /* @__PURE__ */ jsx53(QuickSearch, { initial: searchText, placeholder: search.placeholder ?? labels.searchPlaceholder, onRun: runSearch }, searchText),
|
|
8013
|
+
/* @__PURE__ */ jsxs38(Button, { size: "sm", variant: "secondary", onClick: () => setAdding(true), disabled: !fields, "data-add-filter": "", children: [
|
|
8014
|
+
/* @__PURE__ */ jsx53(Plus3, {}),
|
|
7975
8015
|
labels.addFilter,
|
|
7976
|
-
chips.length > 0 && /* @__PURE__ */
|
|
8016
|
+
chips.length > 0 && /* @__PURE__ */ jsx53(CountBadge, { value: chips.length, tone: "accent" })
|
|
7977
8017
|
] }),
|
|
7978
|
-
sortable.length > 0 && /* @__PURE__ */
|
|
7979
|
-
/* @__PURE__ */
|
|
8018
|
+
sortable.length > 0 && /* @__PURE__ */ jsxs38(HStack11, { gap: "1", flexShrink: 0, children: [
|
|
8019
|
+
/* @__PURE__ */ jsx53(
|
|
7980
8020
|
SelectField,
|
|
7981
8021
|
{
|
|
7982
8022
|
width: "auto",
|
|
@@ -7991,7 +8031,7 @@ function QueryableList({
|
|
|
7991
8031
|
]
|
|
7992
8032
|
}
|
|
7993
8033
|
),
|
|
7994
|
-
sort && /* @__PURE__ */
|
|
8034
|
+
sort && /* @__PURE__ */ jsx53(
|
|
7995
8035
|
IconButton,
|
|
7996
8036
|
{
|
|
7997
8037
|
size: "sm",
|
|
@@ -7999,11 +8039,11 @@ function QueryableList({
|
|
|
7999
8039
|
"aria-label": sort.direction === "desc" ? labels.sortDescending : labels.sortAscending,
|
|
8000
8040
|
title: sort.direction === "desc" ? labels.sortDescending : labels.sortAscending,
|
|
8001
8041
|
onClick: () => change({ ...query, orderBy: [{ field: sort.columnId, desc: sort.direction !== "desc" }] }),
|
|
8002
|
-
children: sort.direction === "desc" ? /* @__PURE__ */
|
|
8042
|
+
children: sort.direction === "desc" ? /* @__PURE__ */ jsx53(ArrowDownWideNarrow, {}) : /* @__PURE__ */ jsx53(ArrowUpNarrowWide, {})
|
|
8003
8043
|
}
|
|
8004
8044
|
)
|
|
8005
8045
|
] })
|
|
8006
|
-
] }) : /* @__PURE__ */
|
|
8046
|
+
] }) : /* @__PURE__ */ jsx53(
|
|
8007
8047
|
RqlBox,
|
|
8008
8048
|
{
|
|
8009
8049
|
initial: state.rql ?? result?.rql ?? "",
|
|
@@ -8014,10 +8054,10 @@ function QueryableList({
|
|
|
8014
8054
|
state.rql ?? result?.rql ?? ""
|
|
8015
8055
|
)
|
|
8016
8056
|
] }),
|
|
8017
|
-
attention != null && /* @__PURE__ */
|
|
8057
|
+
attention != null && /* @__PURE__ */ jsx53(HStack11, { gap: "2", wrap: "wrap", flexShrink: 0, children: attention })
|
|
8018
8058
|
] }),
|
|
8019
|
-
mode === "basic" && conditions !== null && chips.length > 0 && /* @__PURE__ */
|
|
8020
|
-
chips.map(({ c: c2, i }) => /* @__PURE__ */
|
|
8059
|
+
mode === "basic" && conditions !== null && chips.length > 0 && /* @__PURE__ */ jsxs38(HStack11, { gap: "2", wrap: "wrap", px: "2.5", py: "2", borderTopWidth: "1px", borderColor: "border.muted", "data-filter-chips": "", children: [
|
|
8060
|
+
chips.map(({ c: c2, i }) => /* @__PURE__ */ jsxs38(
|
|
8021
8061
|
chakra31.span,
|
|
8022
8062
|
{
|
|
8023
8063
|
display: "inline-flex",
|
|
@@ -8032,17 +8072,17 @@ function QueryableList({
|
|
|
8032
8072
|
bg: "bg.selected",
|
|
8033
8073
|
textStyle: "sm",
|
|
8034
8074
|
children: [
|
|
8035
|
-
/* @__PURE__ */
|
|
8036
|
-
/* @__PURE__ */
|
|
8037
|
-
!NO_VALUE_OPS.has(c2.op) && /* @__PURE__ */
|
|
8038
|
-
/* @__PURE__ */
|
|
8075
|
+
/* @__PURE__ */ jsx53(Text14, { as: "span", fontWeight: "medium", children: label(c2.field) }),
|
|
8076
|
+
/* @__PURE__ */ jsx53(Text14, { as: "span", color: "fg.muted", children: opLabel(c2.op, c2.field) }),
|
|
8077
|
+
!NO_VALUE_OPS.has(c2.op) && /* @__PURE__ */ jsx53(Text14, { as: "span", children: valueText(c2.value) }),
|
|
8078
|
+
/* @__PURE__ */ jsx53(IconButton, { size: "xs", variant: "ghost", "aria-label": fill3(labels.removeFilter, { field: label(c2.field) }), onClick: () => setConditions(conditions.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx53(X2, {}) })
|
|
8039
8079
|
]
|
|
8040
8080
|
},
|
|
8041
8081
|
`${c2.field}-${i}`
|
|
8042
8082
|
)),
|
|
8043
|
-
/* @__PURE__ */
|
|
8083
|
+
/* @__PURE__ */ jsx53(Button, { size: "xs", variant: "ghost", onClick: () => setConditions(searching >= 0 ? [conditions[searching]] : []), children: labels.clearAll })
|
|
8044
8084
|
] }),
|
|
8045
|
-
adding && fields && conditions !== null && /* @__PURE__ */
|
|
8085
|
+
adding && fields && conditions !== null && /* @__PURE__ */ jsx53(
|
|
8046
8086
|
FilterBuilderDialog,
|
|
8047
8087
|
{
|
|
8048
8088
|
fields,
|
|
@@ -8057,25 +8097,25 @@ function QueryableList({
|
|
|
8057
8097
|
}
|
|
8058
8098
|
}
|
|
8059
8099
|
),
|
|
8060
|
-
toolbarFooter != null && /* @__PURE__ */
|
|
8100
|
+
toolbarFooter != null && /* @__PURE__ */ jsx53(chakra31.div, { borderTopWidth: "1px", borderColor: "border.muted", "data-toolbar-footer": "", children: toolbarFooter })
|
|
8061
8101
|
] }),
|
|
8062
|
-
mode === "basic" && error && !(loadFailed != null && error.failed && !result) && /* @__PURE__ */
|
|
8063
|
-
exported && /* @__PURE__ */
|
|
8064
|
-
/* @__PURE__ */
|
|
8065
|
-
/* @__PURE__ */
|
|
8102
|
+
mode === "basic" && error && !(loadFailed != null && error.failed && !result) && /* @__PURE__ */ jsx53(InlineAlert, { tone: "danger", children: error.message }),
|
|
8103
|
+
exported && /* @__PURE__ */ jsx53(InlineAlert, { tone: exported.tone, title: exported.tone === "danger" ? labels.exportFailed : void 0, children: /* @__PURE__ */ jsxs38(HStack11, { justify: "space-between", gap: "2", align: "start", children: [
|
|
8104
|
+
/* @__PURE__ */ jsx53(Text14, { as: "span", children: exported.message }),
|
|
8105
|
+
/* @__PURE__ */ jsx53(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.dismiss, onClick: () => setExported(null), children: /* @__PURE__ */ jsx53(X2, {}) })
|
|
8066
8106
|
] }) }),
|
|
8067
|
-
/* @__PURE__ */
|
|
8107
|
+
/* @__PURE__ */ jsx53(
|
|
8068
8108
|
Panel,
|
|
8069
8109
|
{
|
|
8070
8110
|
flush: true,
|
|
8071
8111
|
footer: (
|
|
8072
8112
|
// Expand and collapse at the start, the pages in the middle (the canvas's v12, UI round 9 step 67), the range at the end.
|
|
8073
|
-
/* @__PURE__ */
|
|
8074
|
-
/* @__PURE__ */
|
|
8075
|
-
/* @__PURE__ */
|
|
8076
|
-
/* @__PURE__ */
|
|
8113
|
+
/* @__PURE__ */ jsxs38(chakra31.div, { display: "grid", w: "full", gridTemplateColumns: { base: "1fr", md: "1fr auto 1fr" }, alignItems: "center", gap: "3", children: [
|
|
8114
|
+
/* @__PURE__ */ jsx53(HStack11, { gap: "3", children: grouped && /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
8115
|
+
/* @__PURE__ */ jsx53(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: folded.size === 0, onClick: () => setFolded(/* @__PURE__ */ new Set()), children: labels.expandAll }),
|
|
8116
|
+
/* @__PURE__ */ jsx53(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: groupKeys.every((k) => folded.has(k)), onClick: () => setFolded(new Set(groupKeys)), children: labels.collapseAll })
|
|
8077
8117
|
] }) }),
|
|
8078
|
-
/* @__PURE__ */
|
|
8118
|
+
/* @__PURE__ */ jsx53(
|
|
8079
8119
|
Pagination,
|
|
8080
8120
|
{
|
|
8081
8121
|
page: Math.floor(skip / take) + 1,
|
|
@@ -8088,10 +8128,10 @@ function QueryableList({
|
|
|
8088
8128
|
pageLabel: (n) => fill3(labels.page, { page: fmt.number(n) })
|
|
8089
8129
|
}
|
|
8090
8130
|
),
|
|
8091
|
-
/* @__PURE__ */
|
|
8131
|
+
/* @__PURE__ */ jsx53(Text14, { textStyle: "caption", color: "fg.muted", textAlign: { md: "end" }, fontVariantNumeric: "tabular-nums", "aria-live": "polite", children: result ? fill3(labels.range, { from: fmt.number(from), to: fmt.number(to), total: fmt.number(total) }) : " " })
|
|
8092
8132
|
] })
|
|
8093
8133
|
),
|
|
8094
|
-
children: /* @__PURE__ */
|
|
8134
|
+
children: /* @__PURE__ */ jsx53(
|
|
8095
8135
|
DataTable,
|
|
8096
8136
|
{
|
|
8097
8137
|
"aria-label": ariaLabel,
|
|
@@ -8137,11 +8177,11 @@ function QueryableList({
|
|
|
8137
8177
|
const label2 = thenField ? info?.then?.label : info?.label;
|
|
8138
8178
|
const value = thenField ? info?.then?.value ?? null : info?.value ?? null;
|
|
8139
8179
|
const period = thenField ? query.groupBy?.then?.period : query.groupBy?.period;
|
|
8140
|
-
return /* @__PURE__ */
|
|
8141
|
-
/* @__PURE__ */
|
|
8142
|
-
/* @__PURE__ */
|
|
8180
|
+
return /* @__PURE__ */ jsxs38(HStack11, { gap: "2.5", flex: "1", minW: "0", children: [
|
|
8181
|
+
/* @__PURE__ */ jsx53(chakra31.span, { display: "inline-flex", alignItems: "center", fontWeight: "medium", textStyle: "sm", minW: "0", children: raw == null || period || value == null ? groupName(value, label2, period) : renderCell(field, raw, first) }),
|
|
8182
|
+
/* @__PURE__ */ jsx53(CountBadge, { value: info?.count ?? rows.length }),
|
|
8143
8183
|
!thenField && renderGroupAside?.({ field: groupField, value: info?.value ?? null, label: info?.label ?? "" }),
|
|
8144
|
-
conditions !== null && !period && /* @__PURE__ */
|
|
8184
|
+
conditions !== null && !period && /* @__PURE__ */ jsxs38(
|
|
8145
8185
|
Button,
|
|
8146
8186
|
{
|
|
8147
8187
|
size: "xs",
|
|
@@ -8159,8 +8199,8 @@ function QueryableList({
|
|
|
8159
8199
|
condition(field, value)
|
|
8160
8200
|
]),
|
|
8161
8201
|
children: [
|
|
8162
|
-
/* @__PURE__ */
|
|
8163
|
-
/* @__PURE__ */
|
|
8202
|
+
/* @__PURE__ */ jsx53(Filter, {}),
|
|
8203
|
+
/* @__PURE__ */ jsx53(chakra31.span, { hideBelow: "md", children: labels.filterToGroup })
|
|
8164
8204
|
]
|
|
8165
8205
|
}
|
|
8166
8206
|
)
|
|
@@ -8179,9 +8219,9 @@ function QueryableList({
|
|
|
8179
8219
|
const first = groups[0]?.rows[0];
|
|
8180
8220
|
const raw = first?.values[groupField];
|
|
8181
8221
|
const count = (result?.groups ?? []).filter((g) => groupKey(g.value) === parent).reduce((n, g) => n + g.count, 0);
|
|
8182
|
-
return /* @__PURE__ */
|
|
8183
|
-
/* @__PURE__ */
|
|
8184
|
-
/* @__PURE__ */
|
|
8222
|
+
return /* @__PURE__ */ jsxs38(HStack11, { gap: "2.5", flex: "1", minW: "0", children: [
|
|
8223
|
+
/* @__PURE__ */ jsx53(chakra31.span, { display: "inline-flex", alignItems: "center", fontWeight: "bold", textStyle: "sm", minW: "0", children: raw == null || query.groupBy?.period || info?.value == null ? groupName(info?.value, info?.label, query.groupBy?.period) : renderCell(groupField, raw, first) }),
|
|
8224
|
+
/* @__PURE__ */ jsx53(CountBadge, { value: count }),
|
|
8185
8225
|
renderGroupAside?.({ field: groupField, value: info?.value ?? null, label: info?.label ?? "" })
|
|
8186
8226
|
] });
|
|
8187
8227
|
}
|
|
@@ -8217,14 +8257,14 @@ function QueryableList({
|
|
|
8217
8257
|
}
|
|
8218
8258
|
function QuickSearch({ initial, placeholder: placeholder2, onRun }) {
|
|
8219
8259
|
const labels = useAbpLabels().queryList;
|
|
8220
|
-
const [text, setText] =
|
|
8260
|
+
const [text, setText] = useState21(initial);
|
|
8221
8261
|
const timer = useRef19(void 0);
|
|
8222
|
-
|
|
8262
|
+
useEffect15(() => () => clearTimeout(timer.current), []);
|
|
8223
8263
|
function later(next) {
|
|
8224
8264
|
clearTimeout(timer.current);
|
|
8225
8265
|
timer.current = setTimeout(() => next.trim() !== initial.trim() && onRun(next), 400);
|
|
8226
8266
|
}
|
|
8227
|
-
return /* @__PURE__ */
|
|
8267
|
+
return /* @__PURE__ */ jsx53(
|
|
8228
8268
|
chakra31.form,
|
|
8229
8269
|
{
|
|
8230
8270
|
role: "search",
|
|
@@ -8236,7 +8276,7 @@ function QuickSearch({ initial, placeholder: placeholder2, onRun }) {
|
|
|
8236
8276
|
clearTimeout(timer.current);
|
|
8237
8277
|
if (text.trim() !== initial.trim()) onRun(text);
|
|
8238
8278
|
},
|
|
8239
|
-
children: /* @__PURE__ */
|
|
8279
|
+
children: /* @__PURE__ */ jsx53(
|
|
8240
8280
|
SearchInput,
|
|
8241
8281
|
{
|
|
8242
8282
|
size: "sm",
|
|
@@ -8278,14 +8318,14 @@ function placeholderOf(id, kind) {
|
|
|
8278
8318
|
}
|
|
8279
8319
|
function ExportMenu({ busy, disabled, onExport }) {
|
|
8280
8320
|
const labels = useAbpLabels().queryList;
|
|
8281
|
-
return /* @__PURE__ */
|
|
8282
|
-
/* @__PURE__ */
|
|
8283
|
-
/* @__PURE__ */
|
|
8321
|
+
return /* @__PURE__ */ jsxs38(Menu3.Root, { positioning: { placement: "bottom-end" }, onSelect: (d) => onExport(d.value), children: [
|
|
8322
|
+
/* @__PURE__ */ jsx53(Menu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs38(Button, { size: "sm", variant: "secondary", disabled: disabled || busy, loading: busy, loadingText: labels.exporting, children: [
|
|
8323
|
+
/* @__PURE__ */ jsx53(Download, {}),
|
|
8284
8324
|
labels.export
|
|
8285
8325
|
] }) }),
|
|
8286
|
-
/* @__PURE__ */
|
|
8287
|
-
/* @__PURE__ */
|
|
8288
|
-
/* @__PURE__ */
|
|
8326
|
+
/* @__PURE__ */ jsx53(Portal15, { children: /* @__PURE__ */ jsx53(Menu3.Positioner, { children: /* @__PURE__ */ jsxs38(Menu3.Content, { minW: "48", children: [
|
|
8327
|
+
/* @__PURE__ */ jsx53(Menu3.Item, { value: "csv", children: labels.exportCsv }),
|
|
8328
|
+
/* @__PURE__ */ jsx53(Menu3.Item, { value: "xlsx", children: labels.exportExcel })
|
|
8289
8329
|
] }) }) })
|
|
8290
8330
|
] });
|
|
8291
8331
|
}
|
|
@@ -8296,10 +8336,10 @@ function RqlBox({
|
|
|
8296
8336
|
onRun
|
|
8297
8337
|
}) {
|
|
8298
8338
|
const labels = useAbpLabels().queryList;
|
|
8299
|
-
const [text, setText] =
|
|
8300
|
-
const [found, setFound] =
|
|
8301
|
-
const [active, setActive] =
|
|
8302
|
-
const [open, setOpen] =
|
|
8339
|
+
const [text, setText] = useState21(initial);
|
|
8340
|
+
const [found, setFound] = useState21(null);
|
|
8341
|
+
const [active, setActive] = useState21(0);
|
|
8342
|
+
const [open, setOpen] = useState21(false);
|
|
8303
8343
|
const input = useRef19(null);
|
|
8304
8344
|
const timer = useRef19(void 0);
|
|
8305
8345
|
const seq = useRef19(0);
|
|
@@ -8317,7 +8357,7 @@ function RqlBox({
|
|
|
8317
8357
|
}).catch(() => setOpen(false));
|
|
8318
8358
|
}, 120);
|
|
8319
8359
|
}
|
|
8320
|
-
|
|
8360
|
+
useEffect15(() => () => clearTimeout(timer.current), []);
|
|
8321
8361
|
function accept(item) {
|
|
8322
8362
|
if (!found) return;
|
|
8323
8363
|
const before = text.slice(0, found.replaceStart);
|
|
@@ -8365,9 +8405,9 @@ function RqlBox({
|
|
|
8365
8405
|
}
|
|
8366
8406
|
}
|
|
8367
8407
|
const hasSpan = error?.start != null && error.end != null && error.end >= error.start && error.end <= text.length;
|
|
8368
|
-
return /* @__PURE__ */
|
|
8369
|
-
/* @__PURE__ */
|
|
8370
|
-
/* @__PURE__ */
|
|
8408
|
+
return /* @__PURE__ */ jsxs38(Stack11, { gap: "1.5", flex: "1", minW: "0", position: "relative", children: [
|
|
8409
|
+
/* @__PURE__ */ jsxs38(HStack11, { gap: "2", children: [
|
|
8410
|
+
/* @__PURE__ */ jsx53(
|
|
8371
8411
|
Input6,
|
|
8372
8412
|
{
|
|
8373
8413
|
ref: input,
|
|
@@ -8393,9 +8433,9 @@ function RqlBox({
|
|
|
8393
8433
|
onKeyDown
|
|
8394
8434
|
}
|
|
8395
8435
|
),
|
|
8396
|
-
/* @__PURE__ */
|
|
8436
|
+
/* @__PURE__ */ jsx53(Button, { size: "sm", variant: "primary", onClick: () => onRun(text.trim()), children: labels.run })
|
|
8397
8437
|
] }),
|
|
8398
|
-
open && found && /* @__PURE__ */
|
|
8438
|
+
open && found && /* @__PURE__ */ jsx53(
|
|
8399
8439
|
Box10,
|
|
8400
8440
|
{
|
|
8401
8441
|
id: listId,
|
|
@@ -8414,7 +8454,7 @@ function RqlBox({
|
|
|
8414
8454
|
borderRadius: "md",
|
|
8415
8455
|
boxShadow: "md",
|
|
8416
8456
|
py: "1",
|
|
8417
|
-
children: found.items.map((item, i) => /* @__PURE__ */
|
|
8457
|
+
children: found.items.map((item, i) => /* @__PURE__ */ jsxs38(
|
|
8418
8458
|
HStack11,
|
|
8419
8459
|
{
|
|
8420
8460
|
id: `${listId}-${i}`,
|
|
@@ -8432,19 +8472,19 @@ function RqlBox({
|
|
|
8432
8472
|
},
|
|
8433
8473
|
onMouseEnter: () => setActive(i),
|
|
8434
8474
|
children: [
|
|
8435
|
-
/* @__PURE__ */
|
|
8436
|
-
/* @__PURE__ */
|
|
8475
|
+
/* @__PURE__ */ jsx53(Text14, { as: "span", textStyle: "sm", fontFamily: item.kind === "person" || item.kind === "value" ? void 0 : "mono", truncate: true, children: item.kind === "field" || item.kind === "person" ? item.label : item.text }),
|
|
8476
|
+
/* @__PURE__ */ jsx53(Text14, { as: "span", textStyle: "xs", color: "fg.muted", truncate: true, children: item.kind === "field" || item.kind === "person" ? item.text : item.label !== item.text ? item.label : labels.kinds[item.kind] ?? item.kind })
|
|
8437
8477
|
]
|
|
8438
8478
|
},
|
|
8439
8479
|
`${item.kind}-${item.text}`
|
|
8440
8480
|
))
|
|
8441
8481
|
}
|
|
8442
8482
|
),
|
|
8443
|
-
error && /* @__PURE__ */
|
|
8483
|
+
error && /* @__PURE__ */ jsxs38(InlineAlert, { tone: "danger", size: "sm", children: [
|
|
8444
8484
|
error.message,
|
|
8445
|
-
hasSpan && /* @__PURE__ */
|
|
8485
|
+
hasSpan && /* @__PURE__ */ jsxs38(chakra31.code, { display: "block", mt: "1", fontFamily: "mono", whiteSpace: "pre-wrap", children: [
|
|
8446
8486
|
text.slice(0, error.start),
|
|
8447
|
-
/* @__PURE__ */
|
|
8487
|
+
/* @__PURE__ */ jsx53(chakra31.mark, { bg: "red.subtle", color: "fg", textDecoration: "underline wavy", textDecorationColor: "fg.error", children: text.slice(error.start, error.end) || " " }),
|
|
8448
8488
|
text.slice(error.end)
|
|
8449
8489
|
] })
|
|
8450
8490
|
] })
|
|
@@ -8453,14 +8493,14 @@ function RqlBox({
|
|
|
8453
8493
|
|
|
8454
8494
|
// src/components/FileDrop.tsx
|
|
8455
8495
|
import { forwardRef as forwardRef9, useLayoutEffect as useLayoutEffect4, useRef as useRef20 } from "react";
|
|
8456
|
-
import { Box as Box11, HStack as HStack12, Portal as Portal16, Text as
|
|
8496
|
+
import { Box as Box11, HStack as HStack12, Portal as Portal16, Text as Text15 } from "@chakra-ui/react";
|
|
8457
8497
|
import { ArrowDownToLine } from "lucide-react";
|
|
8458
|
-
import { jsx as
|
|
8498
|
+
import { jsx as jsx54, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
8459
8499
|
var OUT3 = `cubic-bezier(${curves.out.join(", ")})`;
|
|
8460
8500
|
var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: over2 = false, hint, children, ...rest }, ref) {
|
|
8461
8501
|
const { reduce } = useMotionSetting();
|
|
8462
8502
|
const lit = awake || over2;
|
|
8463
|
-
return /* @__PURE__ */
|
|
8503
|
+
return /* @__PURE__ */ jsxs39(
|
|
8464
8504
|
Box11,
|
|
8465
8505
|
{
|
|
8466
8506
|
ref,
|
|
@@ -8479,7 +8519,7 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
8479
8519
|
...rest,
|
|
8480
8520
|
children: [
|
|
8481
8521
|
children,
|
|
8482
|
-
/* @__PURE__ */
|
|
8522
|
+
/* @__PURE__ */ jsx54(Presence, { show: lit, from: "fade", position: "absolute", inset: "0", rounded: "l2", zIndex: "1", pointerEvents: "none", children: /* @__PURE__ */ jsxs39(
|
|
8483
8523
|
HStack12,
|
|
8484
8524
|
{
|
|
8485
8525
|
h: "full",
|
|
@@ -8493,8 +8533,8 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
8493
8533
|
textAlign: "center",
|
|
8494
8534
|
style: { transition: "background-color 160ms ease" },
|
|
8495
8535
|
children: [
|
|
8496
|
-
/* @__PURE__ */
|
|
8497
|
-
/* @__PURE__ */
|
|
8536
|
+
/* @__PURE__ */ jsx54(Bob, { active: over2 && !reduce }),
|
|
8537
|
+
/* @__PURE__ */ jsx54(Text15, { as: "span", truncate: true, children: hint })
|
|
8498
8538
|
]
|
|
8499
8539
|
}
|
|
8500
8540
|
) })
|
|
@@ -8513,59 +8553,59 @@ function Bob({ active }) {
|
|
|
8513
8553
|
});
|
|
8514
8554
|
return () => animation?.cancel();
|
|
8515
8555
|
}, [active]);
|
|
8516
|
-
return /* @__PURE__ */
|
|
8556
|
+
return /* @__PURE__ */ jsx54(Box11, { as: "span", ref, display: "inline-flex", flexShrink: 0, _icon: { boxSize: "4" }, children: /* @__PURE__ */ jsx54(ArrowDownToLine, {}) });
|
|
8517
8557
|
}
|
|
8518
8558
|
function DropHint({ show, children }) {
|
|
8519
|
-
return /* @__PURE__ */
|
|
8520
|
-
/* @__PURE__ */
|
|
8521
|
-
/* @__PURE__ */
|
|
8559
|
+
return /* @__PURE__ */ jsx54(Portal16, { children: /* @__PURE__ */ jsx54(Box11, { position: "fixed", insetInline: "0", bottom: "6", display: "flex", justifyContent: "center", pointerEvents: "none", zIndex: "toast", px: "4", children: /* @__PURE__ */ jsx54(Presence, { show, from: "rise", children: /* @__PURE__ */ jsxs39(HStack12, { gap: "2", px: "4", py: "2", rounded: "full", bg: "bg.inverted", color: "fg.inverted", shadow: "lg", textStyle: "body.sm", fontWeight: "medium", maxW: "lg", "data-testid": "drop-hint", _icon: { boxSize: "4" }, children: [
|
|
8560
|
+
/* @__PURE__ */ jsx54(ArrowDownToLine, {}),
|
|
8561
|
+
/* @__PURE__ */ jsx54(Text15, { as: "span", truncate: true, children })
|
|
8522
8562
|
] }) }) }) });
|
|
8523
8563
|
}
|
|
8524
8564
|
|
|
8525
8565
|
// src/components/UploadList.tsx
|
|
8526
8566
|
import { useLayoutEffect as useLayoutEffect5, useRef as useRef21 } from "react";
|
|
8527
|
-
import { Box as Box12, chakra as chakra32, HStack as HStack13, Stack as Stack12, Text as
|
|
8567
|
+
import { Box as Box12, chakra as chakra32, HStack as HStack13, Stack as Stack12, Text as Text16 } from "@chakra-ui/react";
|
|
8528
8568
|
import { Check as Check3, File as FileIcon, RotateCcw, TriangleAlert, X as X3 } from "lucide-react";
|
|
8529
|
-
import { jsx as
|
|
8569
|
+
import { jsx as jsx55, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
8530
8570
|
var OUT4 = `cubic-bezier(${curves.out.join(", ")})`;
|
|
8531
8571
|
function UploadList({ rows, summary, fraction, announce, labels, onCancel, onRetry, onDismiss }) {
|
|
8532
|
-
return /* @__PURE__ */
|
|
8533
|
-
/* @__PURE__ */
|
|
8534
|
-
rows.length > 0 && summary != null && /* @__PURE__ */
|
|
8535
|
-
/* @__PURE__ */
|
|
8536
|
-
fraction != null && /* @__PURE__ */
|
|
8572
|
+
return /* @__PURE__ */ jsxs40(Stack12, { gap: "2", "data-testid": "upload-list", children: [
|
|
8573
|
+
/* @__PURE__ */ jsx55(chakra32.span, { srOnly: true, "aria-live": "polite", children: announce }),
|
|
8574
|
+
rows.length > 0 && summary != null && /* @__PURE__ */ jsxs40(Stack12, { gap: "1", children: [
|
|
8575
|
+
/* @__PURE__ */ jsx55(Text16, { textStyle: "caption", color: "fg.muted", children: summary }),
|
|
8576
|
+
fraction != null && /* @__PURE__ */ jsx55(Bar2, { fraction, tone: "accent", label: typeof summary === "string" ? summary : void 0 })
|
|
8537
8577
|
] }),
|
|
8538
|
-
/* @__PURE__ */
|
|
8578
|
+
/* @__PURE__ */ jsx55(Stack12, { gap: "1.5", position: "relative", children: /* @__PURE__ */ jsx55(PresenceList, { children: rows.map((row) => /* @__PURE__ */ jsx55(PresenceItem, { children: /* @__PURE__ */ jsx55(Row, { row, labels, onCancel, onRetry, onDismiss }) }, row.id)) }) })
|
|
8539
8579
|
] });
|
|
8540
8580
|
}
|
|
8541
8581
|
function Row({ row, labels, onCancel, onRetry, onDismiss }) {
|
|
8542
8582
|
const going = row.state === "waiting" || row.state === "sending";
|
|
8543
8583
|
const trouble = row.state === "failed" || row.state === "refused";
|
|
8544
|
-
return /* @__PURE__ */
|
|
8545
|
-
/* @__PURE__ */
|
|
8546
|
-
/* @__PURE__ */
|
|
8547
|
-
/* @__PURE__ */
|
|
8548
|
-
/* @__PURE__ */
|
|
8549
|
-
/* @__PURE__ */
|
|
8584
|
+
return /* @__PURE__ */ jsxs40(HStack13, { gap: "3", px: "3", py: "2", rounded: "l2", bg: "bg.subtle", borderWidth: "1px", borderColor: trouble ? "border.error" : "border.muted", "data-upload": row.name, "data-state": row.state, children: [
|
|
8585
|
+
/* @__PURE__ */ jsx55(Preview, { src: row.preview }),
|
|
8586
|
+
/* @__PURE__ */ jsxs40(Stack12, { gap: "1", flex: "1", minW: "0", children: [
|
|
8587
|
+
/* @__PURE__ */ jsxs40(HStack13, { gap: "2", justify: "space-between", children: [
|
|
8588
|
+
/* @__PURE__ */ jsx55(Text16, { as: "span", fontWeight: "medium", truncate: true, children: /* @__PURE__ */ jsx55("bdi", { children: row.name }) }),
|
|
8589
|
+
/* @__PURE__ */ jsx55(Text16, { as: "span", textStyle: "caption", color: trouble ? "fg.error" : "fg.muted", flexShrink: 0, fontVariantNumeric: "tabular-nums", children: row.state === "done" ? /* @__PURE__ */ jsx55(Done, {}) : row.status })
|
|
8550
8590
|
] }),
|
|
8551
|
-
(going || row.state === "done") && /* @__PURE__ */
|
|
8552
|
-
row.detail != null && /* @__PURE__ */
|
|
8553
|
-
trouble && /* @__PURE__ */
|
|
8591
|
+
(going || row.state === "done") && /* @__PURE__ */ jsx55(Bar2, { fraction: row.state === "done" ? 1 : row.fraction, tone: row.state === "done" ? "success" : "accent", label: row.name, quiet: row.state === "waiting" }),
|
|
8592
|
+
row.detail != null && /* @__PURE__ */ jsxs40(Text16, { as: "span", textStyle: "caption", color: trouble ? "fg.error" : "fg.muted", truncate: true, children: [
|
|
8593
|
+
trouble && /* @__PURE__ */ jsx55(Box12, { as: "span", display: "inline-flex", verticalAlign: "-0.15em", me: "1", _icon: { boxSize: "3.5" }, children: /* @__PURE__ */ jsx55(TriangleAlert, {}) }),
|
|
8554
8594
|
row.detail
|
|
8555
8595
|
] })
|
|
8556
8596
|
] }),
|
|
8557
|
-
going && /* @__PURE__ */
|
|
8558
|
-
row.state === "failed" && /* @__PURE__ */
|
|
8559
|
-
trouble && /* @__PURE__ */
|
|
8597
|
+
going && /* @__PURE__ */ jsx55(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.cancel(row.name), onClick: () => onCancel(row.id), children: /* @__PURE__ */ jsx55(X3, {}) }),
|
|
8598
|
+
row.state === "failed" && /* @__PURE__ */ jsx55(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.retry(row.name), onClick: () => onRetry(row.id), children: /* @__PURE__ */ jsx55(RotateCcw, {}) }),
|
|
8599
|
+
trouble && /* @__PURE__ */ jsx55(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.dismiss(row.name), onClick: () => onDismiss(row.id), children: /* @__PURE__ */ jsx55(X3, {}) })
|
|
8560
8600
|
] });
|
|
8561
8601
|
}
|
|
8562
8602
|
function Preview({ src }) {
|
|
8563
|
-
return /* @__PURE__ */
|
|
8603
|
+
return /* @__PURE__ */ jsx55(Box12, { boxSize: "8", flexShrink: 0, rounded: "l1", overflow: "hidden", bg: "bg.muted", color: "fg.subtle", display: "grid", placeItems: "center", _icon: { boxSize: "4" }, children: src ? /* @__PURE__ */ jsx55(chakra32.img, { src, alt: "", boxSize: "full", objectFit: "cover" }) : /* @__PURE__ */ jsx55(FileIcon, {}) });
|
|
8564
8604
|
}
|
|
8565
8605
|
function Bar2({ fraction, tone, label, quiet: quiet2 }) {
|
|
8566
8606
|
const { reduce } = useMotionSetting();
|
|
8567
8607
|
const percent = Math.round(Math.max(0, Math.min(1, fraction)) * 100);
|
|
8568
|
-
return /* @__PURE__ */
|
|
8608
|
+
return /* @__PURE__ */ jsx55(Box12, { h: "1", rounded: "full", bg: "bg.emphasized", overflow: "hidden", opacity: quiet2 ? 0.6 : 1, role: "progressbar", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": percent, children: /* @__PURE__ */ jsx55(
|
|
8569
8609
|
Box12,
|
|
8570
8610
|
{
|
|
8571
8611
|
h: "full",
|
|
@@ -8592,11 +8632,11 @@ function Done() {
|
|
|
8592
8632
|
{ duration: 260, easing: OUT4 }
|
|
8593
8633
|
);
|
|
8594
8634
|
}, []);
|
|
8595
|
-
return /* @__PURE__ */
|
|
8635
|
+
return /* @__PURE__ */ jsx55(chakra32.span, { ref, display: "inline-grid", placeItems: "center", boxSize: "4", rounded: "full", bg: "fg.success", color: "bg", _icon: { boxSize: "3" }, children: /* @__PURE__ */ jsx55(Check3, { strokeWidth: 3 }) });
|
|
8596
8636
|
}
|
|
8597
8637
|
|
|
8598
8638
|
// src/files/drop.ts
|
|
8599
|
-
import { useEffect as
|
|
8639
|
+
import { useEffect as useEffect16, useRef as useRef22, useState as useState22, useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
8600
8640
|
|
|
8601
8641
|
// src/files/upload-plan.ts
|
|
8602
8642
|
var UPLOADS_AT_ONCE = 3;
|
|
@@ -8755,12 +8795,12 @@ function droppedFiles(data) {
|
|
|
8755
8795
|
return Promise.resolve(Array.from(data.files).filter((f) => !JUNK.test(f.name)).map((file) => ({ file, path: file.name })));
|
|
8756
8796
|
}
|
|
8757
8797
|
function useDropZone(ref, { enabled = true, onFiles }) {
|
|
8758
|
-
const [state, setState] =
|
|
8798
|
+
const [state, setState] = useState22({ over: false, part: null });
|
|
8759
8799
|
const take = useRef22(onFiles);
|
|
8760
|
-
|
|
8800
|
+
useEffect16(() => {
|
|
8761
8801
|
take.current = onFiles;
|
|
8762
8802
|
}, [onFiles]);
|
|
8763
|
-
|
|
8803
|
+
useEffect16(() => {
|
|
8764
8804
|
const zone = ref.current;
|
|
8765
8805
|
if (!zone || !enabled) return;
|
|
8766
8806
|
let depth = 0;
|
|
@@ -8808,10 +8848,10 @@ function useDropZone(ref, { enabled = true, onFiles }) {
|
|
|
8808
8848
|
}
|
|
8809
8849
|
function usePageDrop({ enabled = true, onFiles }) {
|
|
8810
8850
|
const take = useRef22(onFiles);
|
|
8811
|
-
|
|
8851
|
+
useEffect16(() => {
|
|
8812
8852
|
take.current = onFiles;
|
|
8813
8853
|
}, [onFiles]);
|
|
8814
|
-
|
|
8854
|
+
useEffect16(() => {
|
|
8815
8855
|
if (!enabled) return;
|
|
8816
8856
|
const move = (e) => {
|
|
8817
8857
|
if (!isFiles(e)) return;
|
|
@@ -8834,10 +8874,10 @@ function usePageDrop({ enabled = true, onFiles }) {
|
|
|
8834
8874
|
var editable = (target) => target instanceof HTMLElement && (target.isContentEditable || target.closest('input, textarea, select, [contenteditable=""], [contenteditable=true]') != null);
|
|
8835
8875
|
function usePastedFiles({ enabled = true, onFiles }) {
|
|
8836
8876
|
const take = useRef22(onFiles);
|
|
8837
|
-
|
|
8877
|
+
useEffect16(() => {
|
|
8838
8878
|
take.current = onFiles;
|
|
8839
8879
|
}, [onFiles]);
|
|
8840
|
-
|
|
8880
|
+
useEffect16(() => {
|
|
8841
8881
|
if (!enabled) return;
|
|
8842
8882
|
const paste = (e) => {
|
|
8843
8883
|
const data = e.clipboardData;
|
|
@@ -8862,8 +8902,8 @@ function usePastedFiles({ enabled = true, onFiles }) {
|
|
|
8862
8902
|
}
|
|
8863
8903
|
|
|
8864
8904
|
// src/components/SortableSections.tsx
|
|
8865
|
-
import { useMemo as useMemo13, useState as
|
|
8866
|
-
import { Box as Box13, Stack as Stack13, Text as
|
|
8905
|
+
import { useMemo as useMemo13, useState as useState23 } from "react";
|
|
8906
|
+
import { Box as Box13, Stack as Stack13, Text as Text17 } from "@chakra-ui/react";
|
|
8867
8907
|
import {
|
|
8868
8908
|
DndContext as DndContext4,
|
|
8869
8909
|
DragOverlay as DragOverlay3,
|
|
@@ -8876,7 +8916,7 @@ import {
|
|
|
8876
8916
|
} from "@dnd-kit/core";
|
|
8877
8917
|
import { SortableContext as SortableContext3, sortableKeyboardCoordinates as sortableKeyboardCoordinates3, useSortable as useSortable3, verticalListSortingStrategy as verticalListSortingStrategy3 } from "@dnd-kit/sortable";
|
|
8878
8918
|
import { CSS as CSS4 } from "@dnd-kit/utilities";
|
|
8879
|
-
import { jsx as
|
|
8919
|
+
import { jsx as jsx56, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
8880
8920
|
var sectionId = (id) => `section:${id}`;
|
|
8881
8921
|
function SortableSections({
|
|
8882
8922
|
"aria-label": ariaLabel,
|
|
@@ -8890,12 +8930,12 @@ function SortableSections({
|
|
|
8890
8930
|
skeletonItemHeight = "9"
|
|
8891
8931
|
}) {
|
|
8892
8932
|
const loading = useLoading(own);
|
|
8893
|
-
const shown = loading && sections.length === 0 ? [0, 1].map((n) => ({ id: `skeleton-${n}`, header: /* @__PURE__ */
|
|
8933
|
+
const shown = loading && sections.length === 0 ? [0, 1].map((n) => ({ id: `skeleton-${n}`, header: /* @__PURE__ */ jsx56(TextBone, { width: boneWidth(n, 14, 22) }), items: [] })) : sections;
|
|
8894
8934
|
const sensors = useSensors4(
|
|
8895
8935
|
useSensor4(PointerSensor4, { activationConstraint: { distance: 6 } }),
|
|
8896
8936
|
useSensor4(KeyboardSensor3, { coordinateGetter: sortableKeyboardCoordinates3 })
|
|
8897
8937
|
);
|
|
8898
|
-
const [active, setActive] =
|
|
8938
|
+
const [active, setActive] = useState23(null);
|
|
8899
8939
|
const sectionOf = useMemo13(() => {
|
|
8900
8940
|
const map = /* @__PURE__ */ new Map();
|
|
8901
8941
|
for (const s of sections) for (const item of s.items) map.set(item.id, s.id);
|
|
@@ -8926,7 +8966,7 @@ function SortableSections({
|
|
|
8926
8966
|
if (from === target && !move.before && !move.after) return;
|
|
8927
8967
|
onMove(item, move);
|
|
8928
8968
|
}
|
|
8929
|
-
return /* @__PURE__ */
|
|
8969
|
+
return /* @__PURE__ */ jsxs41(
|
|
8930
8970
|
DndContext4,
|
|
8931
8971
|
{
|
|
8932
8972
|
sensors,
|
|
@@ -8936,16 +8976,16 @@ function SortableSections({
|
|
|
8936
8976
|
onDragCancel: () => setActive(null),
|
|
8937
8977
|
accessibility: { announcements, screenReaderInstructions: screenReaderInstructions ? { draggable: screenReaderInstructions } : void 0 },
|
|
8938
8978
|
children: [
|
|
8939
|
-
/* @__PURE__ */
|
|
8940
|
-
loading && s.items.length === 0 && Array.from({ length: skeletonItems }, (_, n) => /* @__PURE__ */
|
|
8941
|
-
/* @__PURE__ */
|
|
8942
|
-
/* @__PURE__ */
|
|
8979
|
+
/* @__PURE__ */ jsx56(Stack13, { role: "region", "aria-label": ariaLabel, gap: "4", children: shown.map((s) => /* @__PURE__ */ jsxs41(Section, { section: s, dragging: !!active, children: [
|
|
8980
|
+
loading && s.items.length === 0 && Array.from({ length: skeletonItems }, (_, n) => /* @__PURE__ */ jsxs41(Box13, { h: skeletonItemHeight, px: "2", display: "flex", alignItems: "center", gap: "3", "aria-hidden": "true", children: [
|
|
8981
|
+
/* @__PURE__ */ jsx56(Bone, { width: "14", height: "4" }),
|
|
8982
|
+
/* @__PURE__ */ jsx56(TextBone, { width: boneWidth(n, 16, 36) })
|
|
8943
8983
|
] }, n)),
|
|
8944
|
-
s.items.map((item) => /* @__PURE__ */
|
|
8945
|
-
!loading && s.items.length === 0 && s.empty && /* @__PURE__ */
|
|
8984
|
+
s.items.map((item) => /* @__PURE__ */ jsx56(SortableItem, { id: item.id, children: (dragging) => renderItem(item, { dragging }) }, item.id)),
|
|
8985
|
+
!loading && s.items.length === 0 && s.empty && /* @__PURE__ */ jsx56(Text17, { textStyle: "caption", color: "fg.subtle", textAlign: "center", py: "4", children: s.empty }),
|
|
8946
8986
|
!loading && s.footer
|
|
8947
8987
|
] }, s.id)) }),
|
|
8948
|
-
/* @__PURE__ */
|
|
8988
|
+
/* @__PURE__ */ jsx56(DragOverlay3, { children: active ? /* @__PURE__ */ jsx56(Box13, { shadow: "lg", rounded: "l2", bg: "bg.panel", children: renderItem(active, { dragging: true }) }) : null })
|
|
8949
8989
|
]
|
|
8950
8990
|
}
|
|
8951
8991
|
);
|
|
@@ -8953,9 +8993,9 @@ function SortableSections({
|
|
|
8953
8993
|
function Section({ section, dragging, children }) {
|
|
8954
8994
|
const id = sectionId(section.id);
|
|
8955
8995
|
const { setNodeRef, isOver } = useDroppable3({ id });
|
|
8956
|
-
return /* @__PURE__ */
|
|
8957
|
-
/* @__PURE__ */
|
|
8958
|
-
/* @__PURE__ */
|
|
8996
|
+
return /* @__PURE__ */ jsxs41(Box13, { as: "section", borderWidth: "1px", borderColor: "border", rounded: "l3", bg: "bg.panel", "data-section": section.id, children: [
|
|
8997
|
+
/* @__PURE__ */ jsx56(Box13, { px: "3", py: "2", borderBottomWidth: "1px", borderColor: "border.muted", children: section.header }),
|
|
8998
|
+
/* @__PURE__ */ jsx56(SortableContext3, { id, items: section.items.map((i) => i.id), strategy: verticalListSortingStrategy3, children: /* @__PURE__ */ jsx56(
|
|
8959
8999
|
Stack13,
|
|
8960
9000
|
{
|
|
8961
9001
|
ref: setNodeRef,
|
|
@@ -8972,7 +9012,7 @@ function Section({ section, dragging, children }) {
|
|
|
8972
9012
|
}
|
|
8973
9013
|
function SortableItem({ id, children }) {
|
|
8974
9014
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = useSortable3({ id });
|
|
8975
|
-
return /* @__PURE__ */
|
|
9015
|
+
return /* @__PURE__ */ jsx56(
|
|
8976
9016
|
Box13,
|
|
8977
9017
|
{
|
|
8978
9018
|
ref: setNodeRef,
|
|
@@ -8989,10 +9029,10 @@ function SortableItem({ id, children }) {
|
|
|
8989
9029
|
}
|
|
8990
9030
|
|
|
8991
9031
|
// src/components/TimelineChart.tsx
|
|
8992
|
-
import { Fragment as Fragment17, useEffect as
|
|
8993
|
-
import { Box as Box14, HStack as HStack14, Popover as Popover4, Portal as Portal17, Stack as Stack14, Text as
|
|
9032
|
+
import { Fragment as Fragment17, useEffect as useEffect17, useLayoutEffect as useLayoutEffect6, useRef as useRef23, useState as useState24 } from "react";
|
|
9033
|
+
import { Box as Box14, HStack as HStack14, Popover as Popover4, Portal as Portal17, Stack as Stack14, Text as Text18 } from "@chakra-ui/react";
|
|
8994
9034
|
import { Flag, Trash2 as Trash23 } from "lucide-react";
|
|
8995
|
-
import { jsx as
|
|
9035
|
+
import { jsx as jsx57, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
8996
9036
|
var DAY2 = 864e5;
|
|
8997
9037
|
var toDay = (day) => Math.round(Date.parse(`${day}T00:00:00Z`) / DAY2);
|
|
8998
9038
|
var fromDay = (n) => new Date(n * DAY2).toISOString().slice(0, 10);
|
|
@@ -9031,8 +9071,8 @@ function TimelineChart({
|
|
|
9031
9071
|
const placeholders = useLoading(own) && rows.length === 0;
|
|
9032
9072
|
const shown = placeholders ? Array.from({ length: skeletonRows }, (_, i) => ({ id: `skeleton-${i}` })) : rows;
|
|
9033
9073
|
const root = useRef23(null);
|
|
9034
|
-
const [room, setRoom] =
|
|
9035
|
-
|
|
9074
|
+
const [room, setRoom] = useState24(0);
|
|
9075
|
+
useEffect17(() => {
|
|
9036
9076
|
const el = root.current;
|
|
9037
9077
|
if (!fill4 || !el) return;
|
|
9038
9078
|
const observer = new ResizeObserver(() => setRoom(Math.max(0, el.clientWidth - labelWidth)));
|
|
@@ -9042,7 +9082,7 @@ function TimelineChart({
|
|
|
9042
9082
|
const origin = toDay(from);
|
|
9043
9083
|
const days = Math.max(toDay(to) - origin + 1, fill4 ? Math.floor(room / dayWidth) : 0);
|
|
9044
9084
|
const width = days * dayWidth;
|
|
9045
|
-
const [drag, setDrag] =
|
|
9085
|
+
const [drag, setDrag] = useState24(null);
|
|
9046
9086
|
const moved = useRef23(false);
|
|
9047
9087
|
const scrolled = useRef23(0);
|
|
9048
9088
|
const lastWidth = useRef23(dayWidth);
|
|
@@ -9062,7 +9102,7 @@ function TimelineChart({
|
|
|
9062
9102
|
}, [dayWidth, labelWidth]);
|
|
9063
9103
|
const zoomRef = useRef23({ onZoom, dayWidth });
|
|
9064
9104
|
zoomRef.current = { onZoom, dayWidth };
|
|
9065
|
-
|
|
9105
|
+
useEffect17(() => {
|
|
9066
9106
|
const el = root.current;
|
|
9067
9107
|
if (!el) return;
|
|
9068
9108
|
let sum = 0;
|
|
@@ -9090,28 +9130,28 @@ function TimelineChart({
|
|
|
9090
9130
|
}
|
|
9091
9131
|
const { reduce } = useMotionSetting();
|
|
9092
9132
|
const layer = useRef23(null);
|
|
9093
|
-
const [linking, setLinking] =
|
|
9094
|
-
const [hot, setHot] =
|
|
9095
|
-
const [menu, setMenu] =
|
|
9096
|
-
|
|
9133
|
+
const [linking, setLinking] = useState24(null);
|
|
9134
|
+
const [hot, setHot] = useState24(null);
|
|
9135
|
+
const [menu, setMenu] = useState24(null);
|
|
9136
|
+
useEffect17(() => {
|
|
9097
9137
|
if (!linking) return;
|
|
9098
9138
|
const cancel = (e) => e.key === "Escape" && setLinking(null);
|
|
9099
9139
|
window.addEventListener("keydown", cancel);
|
|
9100
9140
|
return () => window.removeEventListener("keydown", cancel);
|
|
9101
9141
|
}, [linking]);
|
|
9102
|
-
const [card, setCard] =
|
|
9142
|
+
const [card, setCard] = useState24(null);
|
|
9103
9143
|
const cardTimer = useRef23(void 0);
|
|
9104
9144
|
const cardOff = () => {
|
|
9105
9145
|
clearTimeout(cardTimer.current);
|
|
9106
9146
|
setCard(null);
|
|
9107
9147
|
};
|
|
9108
|
-
|
|
9109
|
-
|
|
9148
|
+
useEffect17(() => () => clearTimeout(cardTimer.current), []);
|
|
9149
|
+
useEffect17(() => {
|
|
9110
9150
|
if (!card) return;
|
|
9111
9151
|
window.addEventListener("scroll", cardOff, true);
|
|
9112
9152
|
return () => window.removeEventListener("scroll", cardOff, true);
|
|
9113
9153
|
}, [card]);
|
|
9114
|
-
|
|
9154
|
+
useEffect17(() => {
|
|
9115
9155
|
const el = root.current;
|
|
9116
9156
|
if (!reveal || !el) return;
|
|
9117
9157
|
const at = toDay(reveal.day) - origin;
|
|
@@ -9120,7 +9160,7 @@ function TimelineChart({
|
|
|
9120
9160
|
el.scrollTo({ left: getComputedStyle(el).direction === "rtl" ? -x : x, behavior: reduce ? "auto" : "smooth" });
|
|
9121
9161
|
}, [reveal]);
|
|
9122
9162
|
const refocus = useRef23(null);
|
|
9123
|
-
|
|
9163
|
+
useEffect17(() => {
|
|
9124
9164
|
if (!refocus.current) return;
|
|
9125
9165
|
const bar = root.current?.querySelector(`[data-bar="${CSS.escape(refocus.current)}"]`);
|
|
9126
9166
|
if (bar && document.activeElement !== bar) bar.focus();
|
|
@@ -9261,7 +9301,7 @@ function TimelineChart({
|
|
|
9261
9301
|
const bandsTop = tickHeight, markersTop = tickHeight + (shownBands.length ? STRIP : 0);
|
|
9262
9302
|
const headerHeight = markersTop + (shownMarkers.length ? STRIP : 0);
|
|
9263
9303
|
const todayAt = today ? toDay(today) - origin : -1;
|
|
9264
|
-
return /* @__PURE__ */
|
|
9304
|
+
return /* @__PURE__ */ jsxs42(
|
|
9265
9305
|
Box14,
|
|
9266
9306
|
{
|
|
9267
9307
|
ref: root,
|
|
@@ -9279,9 +9319,9 @@ function TimelineChart({
|
|
|
9279
9319
|
},
|
|
9280
9320
|
onKeyDown: zoomKey,
|
|
9281
9321
|
children: [
|
|
9282
|
-
instructions && /* @__PURE__ */
|
|
9283
|
-
/* @__PURE__ */
|
|
9284
|
-
/* @__PURE__ */
|
|
9322
|
+
instructions && /* @__PURE__ */ jsx57(Text18, { srOnly: true, children: instructions }),
|
|
9323
|
+
/* @__PURE__ */ jsxs42(Box14, { display: "grid", gridTemplateColumns: fill4 ? `${labelWidth}px minmax(${width}px, 1fr)` : `${labelWidth}px ${width}px`, minW: "fit-content", children: [
|
|
9324
|
+
/* @__PURE__ */ jsx57(
|
|
9285
9325
|
Box14,
|
|
9286
9326
|
{
|
|
9287
9327
|
position: "sticky",
|
|
@@ -9300,8 +9340,8 @@ function TimelineChart({
|
|
|
9300
9340
|
children: corner
|
|
9301
9341
|
}
|
|
9302
9342
|
),
|
|
9303
|
-
/* @__PURE__ */
|
|
9304
|
-
ticks.map((t, i) => /* @__PURE__ */
|
|
9343
|
+
/* @__PURE__ */ jsxs42(Box14, { position: "sticky", top: "0", zIndex: "2", bg: "bg.muted", borderBottomWidth: "1px", borderColor: "border", h: `${headerHeight}px`, overflow: "clip", children: [
|
|
9344
|
+
ticks.map((t, i) => /* @__PURE__ */ jsx57(
|
|
9305
9345
|
Box14,
|
|
9306
9346
|
{
|
|
9307
9347
|
position: "absolute",
|
|
@@ -9312,8 +9352,8 @@ function TimelineChart({
|
|
|
9312
9352
|
borderInlineStartWidth: "1px",
|
|
9313
9353
|
borderColor: "border",
|
|
9314
9354
|
"aria-hidden": true,
|
|
9315
|
-
children: /* @__PURE__ */
|
|
9316
|
-
|
|
9355
|
+
children: /* @__PURE__ */ jsx57(
|
|
9356
|
+
Text18,
|
|
9317
9357
|
{
|
|
9318
9358
|
position: "sticky",
|
|
9319
9359
|
insetStart: `${labelWidth}px`,
|
|
@@ -9331,8 +9371,8 @@ function TimelineChart({
|
|
|
9331
9371
|
},
|
|
9332
9372
|
t.day
|
|
9333
9373
|
)),
|
|
9334
|
-
subTicks.map((t) => /* @__PURE__ */
|
|
9335
|
-
|
|
9374
|
+
subTicks.map((t) => /* @__PURE__ */ jsx57(
|
|
9375
|
+
Text18,
|
|
9336
9376
|
{
|
|
9337
9377
|
position: "absolute",
|
|
9338
9378
|
insetStart: `${t.day * dayWidth}px`,
|
|
@@ -9351,7 +9391,7 @@ function TimelineChart({
|
|
|
9351
9391
|
},
|
|
9352
9392
|
t.day
|
|
9353
9393
|
)),
|
|
9354
|
-
offRuns.filter((o) => o.kind === "holiday").map((o) => /* @__PURE__ */
|
|
9394
|
+
offRuns.filter((o) => o.kind === "holiday").map((o) => /* @__PURE__ */ jsx57(Tooltip, { content: o.label, children: /* @__PURE__ */ jsx57(
|
|
9355
9395
|
Box14,
|
|
9356
9396
|
{
|
|
9357
9397
|
position: "absolute",
|
|
@@ -9366,7 +9406,7 @@ function TimelineChart({
|
|
|
9366
9406
|
"aria-label": o.label
|
|
9367
9407
|
}
|
|
9368
9408
|
) }, `h${o.a}`)),
|
|
9369
|
-
shownBands.map((b) => /* @__PURE__ */
|
|
9409
|
+
shownBands.map((b) => /* @__PURE__ */ jsx57(Tooltip, { content: b.detail ?? b.label, children: /* @__PURE__ */ jsx57(
|
|
9370
9410
|
Box14,
|
|
9371
9411
|
{
|
|
9372
9412
|
position: "absolute",
|
|
@@ -9383,8 +9423,8 @@ function TimelineChart({
|
|
|
9383
9423
|
focusVisibleRing: "inside",
|
|
9384
9424
|
overflow: "clip",
|
|
9385
9425
|
"aria-label": b.label,
|
|
9386
|
-
children: /* @__PURE__ */
|
|
9387
|
-
|
|
9426
|
+
children: /* @__PURE__ */ jsx57(
|
|
9427
|
+
Text18,
|
|
9388
9428
|
{
|
|
9389
9429
|
position: "sticky",
|
|
9390
9430
|
insetStart: `${labelWidth}px`,
|
|
@@ -9396,12 +9436,12 @@ function TimelineChart({
|
|
|
9396
9436
|
color: b.current ? "colorPalette.fg" : "fg.muted",
|
|
9397
9437
|
fontWeight: b.current ? "medium" : void 0,
|
|
9398
9438
|
truncate: true,
|
|
9399
|
-
children: /* @__PURE__ */
|
|
9439
|
+
children: /* @__PURE__ */ jsx57("bdi", { children: b.label })
|
|
9400
9440
|
}
|
|
9401
9441
|
)
|
|
9402
9442
|
}
|
|
9403
9443
|
) }, b.id)),
|
|
9404
|
-
shownMarkers.map((m4) => /* @__PURE__ */
|
|
9444
|
+
shownMarkers.map((m4) => /* @__PURE__ */ jsx57(Tooltip, { content: m4.detail ?? m4.label, children: /* @__PURE__ */ jsxs42(
|
|
9405
9445
|
Box14,
|
|
9406
9446
|
{
|
|
9407
9447
|
position: "absolute",
|
|
@@ -9426,15 +9466,15 @@ function TimelineChart({
|
|
|
9426
9466
|
focusVisibleRing: "outside",
|
|
9427
9467
|
"aria-label": m4.label,
|
|
9428
9468
|
children: [
|
|
9429
|
-
/* @__PURE__ */
|
|
9430
|
-
/* @__PURE__ */
|
|
9469
|
+
/* @__PURE__ */ jsx57(Flag, { size: 11, "aria-hidden": true }),
|
|
9470
|
+
/* @__PURE__ */ jsx57("bdi", { children: m4.label })
|
|
9431
9471
|
]
|
|
9432
9472
|
}
|
|
9433
9473
|
) }, m4.id))
|
|
9434
9474
|
] }),
|
|
9435
|
-
/* @__PURE__ */
|
|
9436
|
-
/* @__PURE__ */
|
|
9437
|
-
offRuns.map((o) => /* @__PURE__ */
|
|
9475
|
+
/* @__PURE__ */ jsx57(Box14, { position: "sticky", insetStart: "0", zIndex: "1", bg: "bg.panel", borderInlineEndWidth: "1px", borderColor: "border", children: shown.map((r, i) => /* @__PURE__ */ jsx57(HStack14, { h: `${rowHeight}px`, px: "3", gap: "2", borderBottomWidth: "1px", borderColor: "border.muted", bg: r.heading && !r.lane ? "bg.subtle" : void 0, minW: "0", children: placeholders ? /* @__PURE__ */ jsx57(TextBone, { width: boneWidth(i, 12, 26) }) : r.heading ?? (r.item && renderLabel(r.item)) }, r.id)) }),
|
|
9476
|
+
/* @__PURE__ */ jsxs42(Box14, { ref: layer, position: "relative", zIndex: "0", h: `${shown.length * rowHeight}px`, children: [
|
|
9477
|
+
offRuns.map((o) => /* @__PURE__ */ jsx57(
|
|
9438
9478
|
Box14,
|
|
9439
9479
|
{
|
|
9440
9480
|
position: "absolute",
|
|
@@ -9449,8 +9489,8 @@ function TimelineChart({
|
|
|
9449
9489
|
},
|
|
9450
9490
|
`o${o.a}`
|
|
9451
9491
|
)),
|
|
9452
|
-
ticks.map((t) => /* @__PURE__ */
|
|
9453
|
-
shownBands.filter((b) => b.current).map((b) => /* @__PURE__ */
|
|
9492
|
+
ticks.map((t) => /* @__PURE__ */ jsx57(Box14, { position: "absolute", insetStart: `${t.day * dayWidth}px`, top: "0", bottom: "0", borderInlineStartWidth: "1px", borderColor: "border.muted", "aria-hidden": true }, t.day)),
|
|
9493
|
+
shownBands.filter((b) => b.current).map((b) => /* @__PURE__ */ jsx57(
|
|
9454
9494
|
Box14,
|
|
9455
9495
|
{
|
|
9456
9496
|
position: "absolute",
|
|
@@ -9465,7 +9505,7 @@ function TimelineChart({
|
|
|
9465
9505
|
},
|
|
9466
9506
|
b.id
|
|
9467
9507
|
)),
|
|
9468
|
-
shownMarkers.map((m4) => /* @__PURE__ */
|
|
9508
|
+
shownMarkers.map((m4) => /* @__PURE__ */ jsx57(
|
|
9469
9509
|
Box14,
|
|
9470
9510
|
{
|
|
9471
9511
|
position: "absolute",
|
|
@@ -9482,7 +9522,7 @@ function TimelineChart({
|
|
|
9482
9522
|
},
|
|
9483
9523
|
m4.id
|
|
9484
9524
|
)),
|
|
9485
|
-
todayAt >= 0 && todayAt < days && /* @__PURE__ */
|
|
9525
|
+
todayAt >= 0 && todayAt < days && /* @__PURE__ */ jsx57(
|
|
9486
9526
|
Box14,
|
|
9487
9527
|
{
|
|
9488
9528
|
position: "absolute",
|
|
@@ -9495,7 +9535,7 @@ function TimelineChart({
|
|
|
9495
9535
|
"aria-hidden": true
|
|
9496
9536
|
}
|
|
9497
9537
|
),
|
|
9498
|
-
shown.map((r, i) => /* @__PURE__ */
|
|
9538
|
+
shown.map((r, i) => /* @__PURE__ */ jsx57(
|
|
9499
9539
|
Box14,
|
|
9500
9540
|
{
|
|
9501
9541
|
position: "absolute",
|
|
@@ -9510,7 +9550,7 @@ function TimelineChart({
|
|
|
9510
9550
|
},
|
|
9511
9551
|
r.id
|
|
9512
9552
|
)),
|
|
9513
|
-
placeholders && shown.map((r, i) => /* @__PURE__ */
|
|
9553
|
+
placeholders && shown.map((r, i) => /* @__PURE__ */ jsx57(
|
|
9514
9554
|
Bone,
|
|
9515
9555
|
{
|
|
9516
9556
|
position: "absolute",
|
|
@@ -9527,7 +9567,7 @@ function TimelineChart({
|
|
|
9527
9567
|
if (!bl || !bl.start && !bl.end) return null;
|
|
9528
9568
|
const a = Math.max(toDay(bl.start ?? bl.end) - origin, 0), z = Math.min(toDay(bl.end ?? bl.start) - origin, days - 1);
|
|
9529
9569
|
if (z < a) return null;
|
|
9530
|
-
return /* @__PURE__ */
|
|
9570
|
+
return /* @__PURE__ */ jsx57(
|
|
9531
9571
|
Box14,
|
|
9532
9572
|
{
|
|
9533
9573
|
position: "absolute",
|
|
@@ -9549,7 +9589,7 @@ function TimelineChart({
|
|
|
9549
9589
|
if (z < a) return null;
|
|
9550
9590
|
const w = (z - a + 1) * dayWidth - 2;
|
|
9551
9591
|
const palette3 = c2.tone === "over" ? "danger" : c2.tone === "full" ? "warning" : "accent";
|
|
9552
|
-
return /* @__PURE__ */
|
|
9592
|
+
return /* @__PURE__ */ jsx57(
|
|
9553
9593
|
Box14,
|
|
9554
9594
|
{
|
|
9555
9595
|
position: "absolute",
|
|
@@ -9590,8 +9630,8 @@ function TimelineChart({
|
|
|
9590
9630
|
const thin = tone === "rollup" && !single;
|
|
9591
9631
|
const diamond = single ? { w: `${DIAMOND}px`, h: `${DIAMOND}px`, top: `${i * rowHeight + rowHeight / 2 - DIAMOND / 2}px`, transform: "rotate(45deg)", rounded: "l1" } : null;
|
|
9592
9632
|
const canLink = !!onLink && item.linkable !== false && !drag;
|
|
9593
|
-
return /* @__PURE__ */
|
|
9594
|
-
/* @__PURE__ */
|
|
9633
|
+
return /* @__PURE__ */ jsxs42(Fragment17, { children: [
|
|
9634
|
+
/* @__PURE__ */ jsxs42(
|
|
9595
9635
|
Box14,
|
|
9596
9636
|
{
|
|
9597
9637
|
role: "button",
|
|
@@ -9647,7 +9687,7 @@ function TimelineChart({
|
|
|
9647
9687
|
"data-bar": item.id,
|
|
9648
9688
|
children: [
|
|
9649
9689
|
!single && !thin && renderBar?.(item),
|
|
9650
|
-
item.progress != null && !single && /* @__PURE__ */
|
|
9690
|
+
item.progress != null && !single && /* @__PURE__ */ jsx57(
|
|
9651
9691
|
Box14,
|
|
9652
9692
|
{
|
|
9653
9693
|
position: "absolute",
|
|
@@ -9663,7 +9703,7 @@ function TimelineChart({
|
|
|
9663
9703
|
),
|
|
9664
9704
|
item.movable !== false && !single && // The edge sits inside the bar: its moves and release stop here, or the bar would handle them too and the
|
|
9665
9705
|
// change would be saved twice (the second refused as a conflict).
|
|
9666
|
-
/* @__PURE__ */
|
|
9706
|
+
/* @__PURE__ */ jsx57(
|
|
9667
9707
|
Box14,
|
|
9668
9708
|
{
|
|
9669
9709
|
position: "absolute",
|
|
@@ -9687,7 +9727,7 @@ function TimelineChart({
|
|
|
9687
9727
|
]
|
|
9688
9728
|
}
|
|
9689
9729
|
),
|
|
9690
|
-
canLink && (hot === item.id || linking?.from.id === item.id) && /* @__PURE__ */
|
|
9730
|
+
canLink && (hot === item.id || linking?.from.id === item.id) && /* @__PURE__ */ jsx57(
|
|
9691
9731
|
Box14,
|
|
9692
9732
|
{
|
|
9693
9733
|
position: "absolute",
|
|
@@ -9709,12 +9749,12 @@ function TimelineChart({
|
|
|
9709
9749
|
onPointerUp: linkUp,
|
|
9710
9750
|
onPointerCancel: () => setLinking(null),
|
|
9711
9751
|
"aria-hidden": true,
|
|
9712
|
-
children: /* @__PURE__ */
|
|
9752
|
+
children: /* @__PURE__ */ jsx57(Box14, { w: "2.5", h: "2.5", rounded: "full", bg: "bg.panel", borderWidth: "2px", borderColor: "accent.solid" })
|
|
9713
9753
|
}
|
|
9714
9754
|
)
|
|
9715
9755
|
] }, item.id);
|
|
9716
9756
|
}),
|
|
9717
|
-
/* @__PURE__ */
|
|
9757
|
+
/* @__PURE__ */ jsx57(
|
|
9718
9758
|
Box14,
|
|
9719
9759
|
{
|
|
9720
9760
|
position: "absolute",
|
|
@@ -9726,8 +9766,8 @@ function TimelineChart({
|
|
|
9726
9766
|
zIndex: "1",
|
|
9727
9767
|
_rtl: { transform: "scaleX(-1)" },
|
|
9728
9768
|
"aria-hidden": !onUnlink,
|
|
9729
|
-
children: /* @__PURE__ */
|
|
9730
|
-
/* @__PURE__ */
|
|
9769
|
+
children: /* @__PURE__ */ jsxs42("svg", { width, height: rows.length * rowHeight, style: { position: "absolute", left: 0, top: 0 }, children: [
|
|
9770
|
+
/* @__PURE__ */ jsx57("defs", { children: /* @__PURE__ */ jsx57("marker", { id: "abp-arrow", viewBox: "0 0 8 8", refX: "7", refY: "4", markerWidth: "7", markerHeight: "7", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx57("path", { d: "M 0 0 L 8 4 L 0 8 z", fill: "context-stroke" }) }) }),
|
|
9731
9771
|
links.map((l) => {
|
|
9732
9772
|
const f = ys.get(l.from), t = ys.get(l.to);
|
|
9733
9773
|
if (!f || !t) return null;
|
|
@@ -9738,8 +9778,8 @@ function TimelineChart({
|
|
|
9738
9778
|
const picked = menu?.from === l.from && menu.to === l.to;
|
|
9739
9779
|
const faint = !l.strong && links.some((x) => x.strong);
|
|
9740
9780
|
const open = (x, y) => setMenu({ from: l.from, to: l.to, x, y });
|
|
9741
|
-
return /* @__PURE__ */
|
|
9742
|
-
/* @__PURE__ */
|
|
9781
|
+
return /* @__PURE__ */ jsxs42("g", { children: [
|
|
9782
|
+
/* @__PURE__ */ jsx57(
|
|
9743
9783
|
"path",
|
|
9744
9784
|
{
|
|
9745
9785
|
d,
|
|
@@ -9751,7 +9791,7 @@ function TimelineChart({
|
|
|
9751
9791
|
markerEnd: "url(#abp-arrow)"
|
|
9752
9792
|
}
|
|
9753
9793
|
),
|
|
9754
|
-
onUnlink && /* @__PURE__ */
|
|
9794
|
+
onUnlink && /* @__PURE__ */ jsx57(
|
|
9755
9795
|
"path",
|
|
9756
9796
|
{
|
|
9757
9797
|
d,
|
|
@@ -9776,13 +9816,13 @@ function TimelineChart({
|
|
|
9776
9816
|
] })
|
|
9777
9817
|
}
|
|
9778
9818
|
),
|
|
9779
|
-
linking && /* @__PURE__ */
|
|
9780
|
-
/* @__PURE__ */
|
|
9781
|
-
/* @__PURE__ */
|
|
9819
|
+
linking && /* @__PURE__ */ jsxs42("svg", { width: "100%", height: shown.length * rowHeight, style: { position: "absolute", left: 0, top: 0, pointerEvents: "none", zIndex: 3 }, "aria-hidden": true, children: [
|
|
9820
|
+
/* @__PURE__ */ jsx57("line", { x1: linking.x0, y1: linking.y0, x2: linking.x, y2: linking.y, stroke: tv("colors.accent.solid"), strokeWidth: 2, strokeDasharray: "5 4" }),
|
|
9821
|
+
/* @__PURE__ */ jsx57("circle", { cx: linking.x, cy: linking.y, r: 4, fill: tv("colors.accent.solid") })
|
|
9782
9822
|
] })
|
|
9783
9823
|
] })
|
|
9784
9824
|
] }),
|
|
9785
|
-
card && renderCard && items.has(card.id) && /* @__PURE__ */
|
|
9825
|
+
card && renderCard && items.has(card.id) && /* @__PURE__ */ jsx57(Portal17, { children: /* @__PURE__ */ jsx57(
|
|
9786
9826
|
Box14,
|
|
9787
9827
|
{
|
|
9788
9828
|
id: "abp-timeline-card",
|
|
@@ -9806,7 +9846,7 @@ function TimelineChart({
|
|
|
9806
9846
|
children: renderCard(items.get(card.id))
|
|
9807
9847
|
}
|
|
9808
9848
|
) }),
|
|
9809
|
-
onUnlink && /* @__PURE__ */
|
|
9849
|
+
onUnlink && /* @__PURE__ */ jsx57(
|
|
9810
9850
|
Popover4.Root,
|
|
9811
9851
|
{
|
|
9812
9852
|
open: !!menu,
|
|
@@ -9815,13 +9855,13 @@ function TimelineChart({
|
|
|
9815
9855
|
unmountOnExit: true,
|
|
9816
9856
|
autoFocus: true,
|
|
9817
9857
|
positioning: { placement: "bottom", getAnchorRect: () => menu ? { x: menu.x, y: menu.y, width: 1, height: 1 } : null },
|
|
9818
|
-
children: /* @__PURE__ */
|
|
9819
|
-
/* @__PURE__ */
|
|
9820
|
-
/* @__PURE__ */
|
|
9858
|
+
children: /* @__PURE__ */ jsx57(Portal17, { children: /* @__PURE__ */ jsx57(Popover4.Positioner, { children: /* @__PURE__ */ jsx57(Popover4.Content, { w: "auto", maxW: "calc(100vw - 32px)", children: /* @__PURE__ */ jsx57(Popover4.Body, { children: menu && /* @__PURE__ */ jsxs42(Stack14, { gap: "2", children: [
|
|
9859
|
+
/* @__PURE__ */ jsx57(Text18, { textStyle: "label", children: linkTexts?.arrow(menu.from, menu.to) }),
|
|
9860
|
+
/* @__PURE__ */ jsxs42(Button, { size: "sm", variant: "secondary", onClick: () => {
|
|
9821
9861
|
onUnlink(menu);
|
|
9822
9862
|
setMenu(null);
|
|
9823
9863
|
}, children: [
|
|
9824
|
-
/* @__PURE__ */
|
|
9864
|
+
/* @__PURE__ */ jsx57(Trash23, {}),
|
|
9825
9865
|
linkTexts?.remove
|
|
9826
9866
|
] })
|
|
9827
9867
|
] }) }) }) }) })
|
|
@@ -9833,8 +9873,8 @@ function TimelineChart({
|
|
|
9833
9873
|
}
|
|
9834
9874
|
|
|
9835
9875
|
// src/components/TimelineCards.tsx
|
|
9836
|
-
import { useEffect as
|
|
9837
|
-
import { Box as Box15, chakra as chakra33, Grid as Grid3, Stack as Stack15, Text as
|
|
9876
|
+
import { useEffect as useEffect18, useMemo as useMemo14, useRef as useRef24, useState as useState25 } from "react";
|
|
9877
|
+
import { Box as Box15, chakra as chakra33, Grid as Grid3, Stack as Stack15, Text as Text19 } from "@chakra-ui/react";
|
|
9838
9878
|
|
|
9839
9879
|
// src/components/timeline-cards-math.ts
|
|
9840
9880
|
var DAY3 = 864e5;
|
|
@@ -9886,7 +9926,7 @@ function placeCards(items, first, days, scale, colW = columnWidth(scale)) {
|
|
|
9886
9926
|
}
|
|
9887
9927
|
|
|
9888
9928
|
// src/components/TimelineCards.tsx
|
|
9889
|
-
import { jsx as
|
|
9929
|
+
import { jsx as jsx58, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
9890
9930
|
var LANE = 60;
|
|
9891
9931
|
var KEYS = { d: "day", w: "week", m: "month" };
|
|
9892
9932
|
function TimelineCards(props) {
|
|
@@ -9900,7 +9940,7 @@ function TimelineCards(props) {
|
|
|
9900
9940
|
onScale(next);
|
|
9901
9941
|
}
|
|
9902
9942
|
};
|
|
9903
|
-
return /* @__PURE__ */
|
|
9943
|
+
return /* @__PURE__ */ jsxs43(
|
|
9904
9944
|
chakra33.div,
|
|
9905
9945
|
{
|
|
9906
9946
|
role: "region",
|
|
@@ -9911,14 +9951,14 @@ function TimelineCards(props) {
|
|
|
9911
9951
|
overflow: "hidden",
|
|
9912
9952
|
"data-timeline-cards": scale,
|
|
9913
9953
|
children: [
|
|
9914
|
-
scale === "day" ? /* @__PURE__ */
|
|
9954
|
+
scale === "day" ? /* @__PURE__ */ jsx58(DayGrid, { ...props }) : /* @__PURE__ */ jsx58(Lanes, { ...props, scale }),
|
|
9915
9955
|
props.footer
|
|
9916
9956
|
]
|
|
9917
9957
|
}
|
|
9918
9958
|
);
|
|
9919
9959
|
}
|
|
9920
9960
|
function Card({ item, p, range, cutStart, cutEnd, style }) {
|
|
9921
|
-
const card = /* @__PURE__ */
|
|
9961
|
+
const card = /* @__PURE__ */ jsxs43(
|
|
9922
9962
|
chakra33.button,
|
|
9923
9963
|
{
|
|
9924
9964
|
type: "button",
|
|
@@ -9943,18 +9983,18 @@ function Card({ item, p, range, cutStart, cutEnd, style }) {
|
|
|
9943
9983
|
transition: "background 120ms, border-color 120ms",
|
|
9944
9984
|
...style,
|
|
9945
9985
|
children: [
|
|
9946
|
-
/* @__PURE__ */
|
|
9947
|
-
/* @__PURE__ */
|
|
9986
|
+
/* @__PURE__ */ jsx58(Box15, { as: "span", w: "3px", flexShrink: 0, bg: p.accent?.(item) ?? "border.emphasized", "aria-hidden": true }),
|
|
9987
|
+
/* @__PURE__ */ jsx58(Stack15, { as: "span", gap: "0.5", px: "2.5", py: "1.5", minW: "0", flex: "1", justify: "center", children: p.renderCard(item, { range }) })
|
|
9948
9988
|
]
|
|
9949
9989
|
}
|
|
9950
9990
|
);
|
|
9951
|
-
return p.details ? /* @__PURE__ */
|
|
9991
|
+
return p.details ? /* @__PURE__ */ jsx58(Tooltip, { content: p.details(item), positioning: { placement: "bottom-start" }, openDelay: 250, children: card }) : card;
|
|
9952
9992
|
}
|
|
9953
9993
|
function Lanes(p) {
|
|
9954
9994
|
const { days, today, items, scale } = p;
|
|
9955
9995
|
const box = useRef24(null);
|
|
9956
|
-
const [available, setAvailable] =
|
|
9957
|
-
|
|
9996
|
+
const [available, setAvailable] = useState25(0);
|
|
9997
|
+
useEffect18(() => {
|
|
9958
9998
|
const el = box.current;
|
|
9959
9999
|
if (!el) return;
|
|
9960
10000
|
const measure = () => setAvailable(el.clientWidth);
|
|
@@ -9970,11 +10010,11 @@ function Lanes(p) {
|
|
|
9970
10010
|
const gridW = days.length * colW;
|
|
9971
10011
|
const placeholders = useLoading(p.loading) && items.length === 0;
|
|
9972
10012
|
const height = (placeholders ? 4 : Math.max(lanes, 1)) * LANE + 16;
|
|
9973
|
-
return /* @__PURE__ */
|
|
9974
|
-
/* @__PURE__ */
|
|
10013
|
+
return /* @__PURE__ */ jsx58(chakra33.div, { overflowX: "auto", ref: box, children: /* @__PURE__ */ jsxs43(chakra33.div, { position: "relative", minW: "full", w: `${gridW}px`, children: [
|
|
10014
|
+
/* @__PURE__ */ jsx58(chakra33.div, { display: "flex", borderBottomWidth: "1px", borderColor: "border", bg: "bg.subtle", position: "sticky", top: "0", zIndex: "1", children: days.map((d) => {
|
|
9975
10015
|
const isToday = d === today;
|
|
9976
10016
|
const weekStart = new Date(dayNumber(d) * 864e5).getUTCDay() === 0;
|
|
9977
|
-
return /* @__PURE__ */
|
|
10017
|
+
return /* @__PURE__ */ jsxs43(
|
|
9978
10018
|
chakra33.div,
|
|
9979
10019
|
{
|
|
9980
10020
|
w: `${colW}px`,
|
|
@@ -9991,9 +10031,9 @@ function Lanes(p) {
|
|
|
9991
10031
|
borderInlineStartWidth: weekStart && scale === "month" ? "1px" : "0",
|
|
9992
10032
|
borderColor: "border",
|
|
9993
10033
|
children: [
|
|
9994
|
-
/* @__PURE__ */
|
|
9995
|
-
/* @__PURE__ */
|
|
9996
|
-
|
|
10034
|
+
/* @__PURE__ */ jsx58(Text19, { as: "span", children: p.weekday(d) }),
|
|
10035
|
+
/* @__PURE__ */ jsx58(
|
|
10036
|
+
Text19,
|
|
9997
10037
|
{
|
|
9998
10038
|
as: "span",
|
|
9999
10039
|
fontVariantNumeric: "tabular-nums",
|
|
@@ -10011,8 +10051,8 @@ function Lanes(p) {
|
|
|
10011
10051
|
d
|
|
10012
10052
|
);
|
|
10013
10053
|
}) }),
|
|
10014
|
-
/* @__PURE__ */
|
|
10015
|
-
todayIdx >= 0 && /* @__PURE__ */
|
|
10054
|
+
/* @__PURE__ */ jsx58(chakra33.div, { position: "absolute", insetInlineStart: "0", top: "0", bottom: "0", display: "flex", pointerEvents: "none", "aria-hidden": true, children: days.map((d) => /* @__PURE__ */ jsx58(chakra33.div, { w: `${colW}px`, flexShrink: 0, borderInlineEndWidth: "1px", borderStyle: "dashed", borderColor: "border.muted" }, d)) }),
|
|
10055
|
+
todayIdx >= 0 && /* @__PURE__ */ jsx58(
|
|
10016
10056
|
chakra33.div,
|
|
10017
10057
|
{
|
|
10018
10058
|
position: "absolute",
|
|
@@ -10027,7 +10067,7 @@ function Lanes(p) {
|
|
|
10027
10067
|
zIndex: "1"
|
|
10028
10068
|
}
|
|
10029
10069
|
),
|
|
10030
|
-
placeholders ? /* @__PURE__ */
|
|
10070
|
+
placeholders ? /* @__PURE__ */ jsx58(chakra33.div, { position: "relative", h: `${height}px`, "aria-hidden": true, children: [0, 1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ jsx58(
|
|
10031
10071
|
Bone,
|
|
10032
10072
|
{
|
|
10033
10073
|
position: "absolute",
|
|
@@ -10038,9 +10078,9 @@ function Lanes(p) {
|
|
|
10038
10078
|
borderRadius: "l2"
|
|
10039
10079
|
},
|
|
10040
10080
|
i
|
|
10041
|
-
)) }) : cards.length === 0 && p.empty ? /* @__PURE__ */
|
|
10081
|
+
)) }) : cards.length === 0 && p.empty ? /* @__PURE__ */ jsx58(chakra33.div, { position: "relative", py: "6", children: p.empty }) : /* @__PURE__ */ jsx58(chakra33.div, { position: "relative", h: `${height}px`, role: "list", children: cards.map((c2) => {
|
|
10042
10082
|
const item = byId.get(c2.id);
|
|
10043
|
-
return /* @__PURE__ */
|
|
10083
|
+
return /* @__PURE__ */ jsx58(
|
|
10044
10084
|
chakra33.div,
|
|
10045
10085
|
{
|
|
10046
10086
|
role: "listitem",
|
|
@@ -10050,7 +10090,7 @@ function Lanes(p) {
|
|
|
10050
10090
|
w: `${c2.width}px`,
|
|
10051
10091
|
display: "flex",
|
|
10052
10092
|
zIndex: "2",
|
|
10053
|
-
children: /* @__PURE__ */
|
|
10093
|
+
children: /* @__PURE__ */ jsx58(Card, { item, p, range: c2.range, cutStart: c2.cutStart, cutEnd: c2.cutEnd, style: { w: "full" } })
|
|
10054
10094
|
},
|
|
10055
10095
|
c2.id
|
|
10056
10096
|
);
|
|
@@ -10065,8 +10105,8 @@ function DayGrid(p) {
|
|
|
10065
10105
|
const x = dayNumber(day);
|
|
10066
10106
|
return s <= x && x <= d;
|
|
10067
10107
|
});
|
|
10068
|
-
if (due.length === 0 && p.empty) return /* @__PURE__ */
|
|
10069
|
-
return /* @__PURE__ */
|
|
10108
|
+
if (due.length === 0 && p.empty) return /* @__PURE__ */ jsx58(chakra33.div, { py: "6", children: p.empty });
|
|
10109
|
+
return /* @__PURE__ */ jsx58(Grid3, { role: "list", templateColumns: "repeat(auto-fill, minmax(16rem, 1fr))", gap: "2", p: "3", children: due.map((i) => /* @__PURE__ */ jsx58(chakra33.div, { role: "listitem", display: "flex", children: /* @__PURE__ */ jsx58(Card, { item: i, p, range: Boolean(i.start && i.start < i.due), style: { w: "full" } }) }, i.id)) });
|
|
10070
10110
|
}
|
|
10071
10111
|
export {
|
|
10072
10112
|
ABP_UI_VERSION,
|
|
@@ -10114,6 +10154,7 @@ export {
|
|
|
10114
10154
|
Indicator,
|
|
10115
10155
|
InlineAlert,
|
|
10116
10156
|
KanbanBoard,
|
|
10157
|
+
ListFooter,
|
|
10117
10158
|
Loading,
|
|
10118
10159
|
LoadingState,
|
|
10119
10160
|
MotionProvider,
|
|
@@ -10265,6 +10306,7 @@ export {
|
|
|
10265
10306
|
usePastedFiles,
|
|
10266
10307
|
usePluginTexts,
|
|
10267
10308
|
useProductName,
|
|
10309
|
+
useSettledValue,
|
|
10268
10310
|
useSlotSaves,
|
|
10269
10311
|
useTokenVar
|
|
10270
10312
|
};
|