@abpjs/ui 0.2.0-next.31 → 0.2.0-next.32
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 +20 -0
- package/dist/index.d.ts +56 -5
- package/dist/index.js +596 -341
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -316,7 +316,7 @@ var pageHeaderSlotRecipe = defineSlotRecipe({
|
|
|
316
316
|
});
|
|
317
317
|
var panelSlotRecipe = defineSlotRecipe({
|
|
318
318
|
className: "abp-panel",
|
|
319
|
-
slots: ["root", "header", "titleGroup", "title", "description", "actions", "body", "footer"],
|
|
319
|
+
slots: ["root", "header", "titleGroup", "title", "description", "actions", "body", "footer", "toggle", "chevron", "summary"],
|
|
320
320
|
base: {
|
|
321
321
|
root: {
|
|
322
322
|
layerStyle: "panel",
|
|
@@ -341,6 +341,44 @@ var panelSlotRecipe = defineSlotRecipe({
|
|
|
341
341
|
title: { textStyle: "heading.section", color: "fg", display: "flex", alignItems: "center", gap: "2" },
|
|
342
342
|
description: { textStyle: "caption", color: "fg.muted" },
|
|
343
343
|
actions: { display: "flex", alignItems: "center", gap: "2", flexWrap: "wrap" },
|
|
344
|
+
// A collapsible panel's header: the whole title line folds it, the chevron first (the design canvas's settings card).
|
|
345
|
+
toggle: {
|
|
346
|
+
display: "flex",
|
|
347
|
+
alignItems: "center",
|
|
348
|
+
gap: "2",
|
|
349
|
+
flex: "1",
|
|
350
|
+
minW: "0",
|
|
351
|
+
mx: "-1.5",
|
|
352
|
+
px: "1.5",
|
|
353
|
+
py: "1",
|
|
354
|
+
borderRadius: "l2",
|
|
355
|
+
bg: "transparent",
|
|
356
|
+
color: "inherit",
|
|
357
|
+
textAlign: "start",
|
|
358
|
+
cursor: "pointer",
|
|
359
|
+
_hover: { bg: "bg.muted" },
|
|
360
|
+
focusVisibleRing: "inside"
|
|
361
|
+
},
|
|
362
|
+
chevron: {
|
|
363
|
+
flex: "none",
|
|
364
|
+
display: "inline-flex",
|
|
365
|
+
color: "fg.muted",
|
|
366
|
+
transition: "transform 150ms ease",
|
|
367
|
+
_rtl: { transform: "scaleX(-1)" },
|
|
368
|
+
"&[data-open]": { transform: "rotate(90deg)" },
|
|
369
|
+
_motionReduce: { transition: "none" }
|
|
370
|
+
},
|
|
371
|
+
summary: {
|
|
372
|
+
flex: "none",
|
|
373
|
+
maxW: "40%",
|
|
374
|
+
ms: "auto",
|
|
375
|
+
textStyle: "sm",
|
|
376
|
+
color: "fg.muted",
|
|
377
|
+
overflow: "hidden",
|
|
378
|
+
textOverflow: "ellipsis",
|
|
379
|
+
whiteSpace: "nowrap",
|
|
380
|
+
hideBelow: "md"
|
|
381
|
+
},
|
|
344
382
|
body: { p: "panel", flex: "1", minW: "0" },
|
|
345
383
|
footer: {
|
|
346
384
|
display: "flex",
|
|
@@ -359,6 +397,11 @@ var panelSlotRecipe = defineSlotRecipe({
|
|
|
359
397
|
true: { body: { p: "0", overflow: "hidden", borderBottomRadius: "l3" } },
|
|
360
398
|
false: {}
|
|
361
399
|
},
|
|
400
|
+
/** Folded (`collapsible`): only the header, without its rule. */
|
|
401
|
+
collapsed: {
|
|
402
|
+
true: { header: { borderBottomWidth: "0" } },
|
|
403
|
+
false: {}
|
|
404
|
+
},
|
|
362
405
|
/**
|
|
363
406
|
* `card`: the bordered surface. `section`: no box, a heading over a rule and its content under it, for pages where
|
|
364
407
|
* blocks follow one another in one column (the record's page, UI round 8) and a stack of boxes reads heavy.
|
|
@@ -374,7 +417,7 @@ var panelSlotRecipe = defineSlotRecipe({
|
|
|
374
417
|
}
|
|
375
418
|
},
|
|
376
419
|
compoundVariants: [{ flush: true, tone: "section", css: { body: { borderBottomRadius: "0", pt: "1" } } }],
|
|
377
|
-
defaultVariants: { flush: false, tone: "card" }
|
|
420
|
+
defaultVariants: { flush: false, tone: "card", collapsed: false }
|
|
378
421
|
});
|
|
379
422
|
var statusPillSlotRecipe = defineSlotRecipe({
|
|
380
423
|
className: "abp-status-pill",
|
|
@@ -1560,7 +1603,7 @@ function useTokenVar() {
|
|
|
1560
1603
|
}
|
|
1561
1604
|
|
|
1562
1605
|
// src/version.ts
|
|
1563
|
-
var ABP_UI_VERSION = true ? "0.2.0-next.
|
|
1606
|
+
var ABP_UI_VERSION = true ? "0.2.0-next.32" : "0.0.0-dev";
|
|
1564
1607
|
|
|
1565
1608
|
// src/provider/time-zone.tsx
|
|
1566
1609
|
import { createContext, useContext } from "react";
|
|
@@ -1683,6 +1726,21 @@ var defaultQueryListLabels = {
|
|
|
1683
1726
|
exportExcel: "Excel (.xlsx)",
|
|
1684
1727
|
exporting: "Exporting\u2026",
|
|
1685
1728
|
exportCut: "The file holds {rows} of {total} rows: an export stops at {limit}. Narrow the query to get the rest.",
|
|
1729
|
+
exportTitleCsv: "Export to CSV",
|
|
1730
|
+
exportTitleExcel: "Export to Excel",
|
|
1731
|
+
exportRows: "Rows",
|
|
1732
|
+
exportFound: "Filtered ({count})",
|
|
1733
|
+
exportAll: "All",
|
|
1734
|
+
exportColumns: "Columns",
|
|
1735
|
+
exportSeparator: "Separator",
|
|
1736
|
+
exportComma: "Comma ( , )",
|
|
1737
|
+
exportSemicolon: "Semicolon ( ; )",
|
|
1738
|
+
exportTab: "Tab",
|
|
1739
|
+
exportPreview: "Preview",
|
|
1740
|
+
exportRun: "Export",
|
|
1741
|
+
exportCancel: "Cancel",
|
|
1742
|
+
exportPreparing: "Preparing the file\u2026 You can keep working.",
|
|
1743
|
+
exportReady: "Your file is ready",
|
|
1686
1744
|
exportFailed: "The export failed",
|
|
1687
1745
|
dismiss: "Dismiss",
|
|
1688
1746
|
operators: {
|
|
@@ -4486,7 +4544,7 @@ function Nudge({ on, children }) {
|
|
|
4486
4544
|
|
|
4487
4545
|
// src/components/AppShell.tsx
|
|
4488
4546
|
import { Fragment as Fragment7, useCallback as useCallback8, useState as useState12 } from "react";
|
|
4489
|
-
import { chakra as chakra12, Drawer, Portal as Portal7, SkipNavContent, SkipNavLink, useSlotRecipe } from "@chakra-ui/react";
|
|
4547
|
+
import { chakra as chakra12, Drawer, Menu, Portal as Portal7, SkipNavContent, SkipNavLink, useSlotRecipe } from "@chakra-ui/react";
|
|
4490
4548
|
import { ChevronDown, Menu as MenuIcon, PanelLeftClose, PanelLeftOpen, X } from "lucide-react";
|
|
4491
4549
|
|
|
4492
4550
|
// src/components/Tooltip.tsx
|
|
@@ -4603,10 +4661,24 @@ function AppShell({
|
|
|
4603
4661
|
}
|
|
4604
4662
|
function TopNavItem({ item, styles }) {
|
|
4605
4663
|
const Link = useLinkComponent();
|
|
4606
|
-
|
|
4664
|
+
const link = /* @__PURE__ */ jsx26(chakra12.a, { asChild: true, css: styles.topNavItem, children: /* @__PURE__ */ jsxs18(Link, { href: item.href, "aria-current": item.current ? "page" : void 0, children: [
|
|
4607
4665
|
item.current && /* @__PURE__ */ jsx26(Indicator, { group: "abp-top-nav", css: styles.topNavIndicator }),
|
|
4608
4666
|
/* @__PURE__ */ jsx26(chakra12.span, { css: styles.topNavLabel, children: item.label })
|
|
4609
4667
|
] }) });
|
|
4668
|
+
if (!item.children?.length) return link;
|
|
4669
|
+
return /* @__PURE__ */ jsxs18(chakra12.span, { display: "inline-flex", alignItems: "center", "data-top-nav-menu": "", children: [
|
|
4670
|
+
link,
|
|
4671
|
+
/* @__PURE__ */ jsxs18(Menu.Root, { positioning: { placement: "bottom-start" }, lazyMount: true, unmountOnExit: true, children: [
|
|
4672
|
+
/* @__PURE__ */ jsx26(Menu.Trigger, { asChild: true, children: /* @__PURE__ */ jsx26(IconButton, { size: "xs", variant: "ghost", color: "fg.muted", ms: "-1", "aria-label": item.childrenLabel ?? item.label, children: /* @__PURE__ */ jsx26(ChevronDown, {}) }) }),
|
|
4673
|
+
/* @__PURE__ */ jsx26(Portal7, { children: /* @__PURE__ */ jsx26(Menu.Positioner, { children: /* @__PURE__ */ jsx26(Menu.Content, { minW: "56", maxW: "80", children: /* @__PURE__ */ jsxs18(Menu.ItemGroup, { children: [
|
|
4674
|
+
item.childrenTitle != null && /* @__PURE__ */ jsx26(Menu.ItemGroupLabel, { children: item.childrenTitle }),
|
|
4675
|
+
item.children.map((child) => /* @__PURE__ */ jsx26(Menu.Item, { value: child.id, asChild: true, children: /* @__PURE__ */ jsxs18(Link, { href: child.href, "aria-current": child.current ? "page" : void 0, children: [
|
|
4676
|
+
child.icon,
|
|
4677
|
+
/* @__PURE__ */ jsx26(chakra12.span, { truncate: true, children: child.label })
|
|
4678
|
+
] }) }, child.id))
|
|
4679
|
+
] }) }) }) })
|
|
4680
|
+
] })
|
|
4681
|
+
] });
|
|
4610
4682
|
}
|
|
4611
4683
|
function SidebarContents({
|
|
4612
4684
|
styles,
|
|
@@ -4963,20 +5035,20 @@ function AvatarStack({ "aria-label": ariaLabel, people, max = 3, moreLabel, more
|
|
|
4963
5035
|
|
|
4964
5036
|
// src/components/RowMenu.tsx
|
|
4965
5037
|
import { Fragment as Fragment12 } from "react";
|
|
4966
|
-
import { Menu, Portal as Portal10, Text as Text8 } from "@chakra-ui/react";
|
|
5038
|
+
import { Menu as Menu2, Portal as Portal10, Text as Text8 } from "@chakra-ui/react";
|
|
4967
5039
|
import { MoreHorizontal } from "lucide-react";
|
|
4968
5040
|
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4969
5041
|
var isSeparator = (e) => "separator" in e;
|
|
4970
5042
|
var isNote = (e) => "note" in e;
|
|
4971
5043
|
function RowMenu({ label, items, size = "sm" }) {
|
|
4972
|
-
return /* @__PURE__ */ jsxs21(
|
|
4973
|
-
/* @__PURE__ */ jsx29(
|
|
4974
|
-
/* @__PURE__ */ jsx29(Portal10, { children: /* @__PURE__ */ jsx29(
|
|
4975
|
-
(e, i) => isSeparator(e) ? /* @__PURE__ */ jsx29(
|
|
4976
|
-
/* @__PURE__ */ jsx29(
|
|
5044
|
+
return /* @__PURE__ */ jsxs21(Menu2.Root, { positioning: { placement: "bottom-end" }, lazyMount: true, unmountOnExit: true, children: [
|
|
5045
|
+
/* @__PURE__ */ jsx29(Menu2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx29(IconButton, { "aria-label": label, size, variant: "ghost", color: "fg.muted", "data-row-menu": "", children: /* @__PURE__ */ jsx29(MoreHorizontal, {}) }) }),
|
|
5046
|
+
/* @__PURE__ */ jsx29(Portal10, { children: /* @__PURE__ */ jsx29(Menu2.Positioner, { children: /* @__PURE__ */ jsx29(Menu2.Content, { minW: "48", maxW: "18rem", css: { "& [role=menuitem] svg": { width: "4", height: "4", flexShrink: 0 } }, children: items.map(
|
|
5047
|
+
(e, i) => isSeparator(e) ? /* @__PURE__ */ jsx29(Menu2.Separator, {}, `sep-${i}`) : isNote(e) ? /* @__PURE__ */ jsxs21(Fragment12, { children: [
|
|
5048
|
+
/* @__PURE__ */ jsx29(Menu2.Separator, {}),
|
|
4977
5049
|
/* @__PURE__ */ jsx29(Text8, { px: "2", py: "1.5", textStyle: "caption", color: "fg.muted", children: e.note })
|
|
4978
5050
|
] }, `note-${i}`) : /* @__PURE__ */ jsxs21(
|
|
4979
|
-
|
|
5051
|
+
Menu2.Item,
|
|
4980
5052
|
{
|
|
4981
5053
|
value: e.id,
|
|
4982
5054
|
disabled: e.disabled,
|
|
@@ -4996,7 +5068,7 @@ function RowMenu({ label, items, size = "sm" }) {
|
|
|
4996
5068
|
|
|
4997
5069
|
// src/components/DataTable.tsx
|
|
4998
5070
|
import { Fragment as Fragment13, useMemo as useMemo7, useRef as useRef11, useState as useState14 } from "react";
|
|
4999
|
-
import { chakra as chakra18, Menu as
|
|
5071
|
+
import { chakra as chakra18, Menu as Menu3, Portal as Portal11, Table, useSlotRecipe as useSlotRecipe3 } from "@chakra-ui/react";
|
|
5000
5072
|
import { ArrowDown, ArrowUp, ChevronDown as ChevronDown2, ChevronRight as ChevronRight2, ChevronsUpDown, GripVertical } from "lucide-react";
|
|
5001
5073
|
|
|
5002
5074
|
// src/components/EmptyState.tsx
|
|
@@ -5866,7 +5938,7 @@ function RowGrip({ move, row, dragging, group, prev, next, onDragStart, onDragEn
|
|
|
5866
5938
|
const place = move.place;
|
|
5867
5939
|
const steps = place ? [prev && { value: UP, label: place.up }, next && { value: DOWN, label: place.down }].filter((x) => Boolean(x)) : [];
|
|
5868
5940
|
return /* @__PURE__ */ jsxs25(
|
|
5869
|
-
|
|
5941
|
+
Menu3.Root,
|
|
5870
5942
|
{
|
|
5871
5943
|
lazyMount: true,
|
|
5872
5944
|
unmountOnExit: true,
|
|
@@ -5877,7 +5949,7 @@ function RowGrip({ move, row, dragging, group, prev, next, onDragStart, onDragEn
|
|
|
5877
5949
|
else move.onMove(row, e.value);
|
|
5878
5950
|
},
|
|
5879
5951
|
children: [
|
|
5880
|
-
/* @__PURE__ */ jsx34(
|
|
5952
|
+
/* @__PURE__ */ jsx34(Menu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
5881
5953
|
chakra18.button,
|
|
5882
5954
|
{
|
|
5883
5955
|
type: "button",
|
|
@@ -5913,15 +5985,15 @@ function RowGrip({ move, row, dragging, group, prev, next, onDragStart, onDragEn
|
|
|
5913
5985
|
children: /* @__PURE__ */ jsx34(GripVertical, {})
|
|
5914
5986
|
}
|
|
5915
5987
|
) }),
|
|
5916
|
-
/* @__PURE__ */ jsx34(Portal11, { children: /* @__PURE__ */ jsx34(
|
|
5917
|
-
steps.length > 0 && /* @__PURE__ */ jsx34(
|
|
5988
|
+
/* @__PURE__ */ jsx34(Portal11, { children: /* @__PURE__ */ jsx34(Menu3.Positioner, { children: /* @__PURE__ */ jsxs25(Menu3.Content, { minW: "44", onClick: (e) => e.stopPropagation(), children: [
|
|
5989
|
+
steps.length > 0 && /* @__PURE__ */ jsx34(Menu3.ItemGroup, { children: steps.map((x) => /* @__PURE__ */ jsxs25(Menu3.Item, { value: x.value, children: [
|
|
5918
5990
|
x.value === UP ? /* @__PURE__ */ jsx34(ArrowUp, {}) : /* @__PURE__ */ jsx34(ArrowDown, {}),
|
|
5919
5991
|
x.label
|
|
5920
5992
|
] }, x.value)) }),
|
|
5921
|
-
steps.length > 0 && targets.length > 0 && /* @__PURE__ */ jsx34(
|
|
5922
|
-
targets.length > 0 && /* @__PURE__ */ jsxs25(
|
|
5923
|
-
/* @__PURE__ */ jsx34(
|
|
5924
|
-
targets.map((x) => /* @__PURE__ */ jsx34(
|
|
5993
|
+
steps.length > 0 && targets.length > 0 && /* @__PURE__ */ jsx34(Menu3.Separator, {}),
|
|
5994
|
+
targets.length > 0 && /* @__PURE__ */ jsxs25(Menu3.ItemGroup, { children: [
|
|
5995
|
+
/* @__PURE__ */ jsx34(Menu3.ItemGroupLabel, { children: move.menuTitle }),
|
|
5996
|
+
targets.map((x) => /* @__PURE__ */ jsx34(Menu3.Item, { value: x.group, children: x.label }, x.group))
|
|
5925
5997
|
] })
|
|
5926
5998
|
] }) }) })
|
|
5927
5999
|
]
|
|
@@ -7861,7 +7933,7 @@ function LoadingState({ lines = 3, label }) {
|
|
|
7861
7933
|
|
|
7862
7934
|
// src/components/PageHeader.tsx
|
|
7863
7935
|
import { Fragment as Fragment18 } from "react";
|
|
7864
|
-
import { Breadcrumb, chakra as chakra29, Menu as
|
|
7936
|
+
import { Breadcrumb, chakra as chakra29, Menu as Menu4, Portal as Portal13, useSlotRecipe as useSlotRecipe4 } from "@chakra-ui/react";
|
|
7865
7937
|
import { ChevronRight as ChevronRight3 } from "lucide-react";
|
|
7866
7938
|
import { jsx as jsx51, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
7867
7939
|
var textOf = (label) => typeof label === "string" || typeof label === "number" ? String(label) : void 0;
|
|
@@ -7896,8 +7968,8 @@ function Breadcrumbs({ items, loading: own }) {
|
|
|
7896
7968
|
const { shown, hidden } = foldBreadcrumbs(items);
|
|
7897
7969
|
return /* @__PURE__ */ jsx51(Breadcrumb.Root, { "aria-label": labels.breadcrumb, children: /* @__PURE__ */ jsx51(Breadcrumb.List, { children: shown.map((entry, n) => /* @__PURE__ */ jsxs37(Fragment18, { children: [
|
|
7898
7970
|
n > 0 && /* @__PURE__ */ jsx51(Breadcrumb.Separator, { children: /* @__PURE__ */ jsx51(ChevronRight3, {}) }),
|
|
7899
|
-
entry == null ? /* @__PURE__ */ jsx51(Breadcrumb.Item, { children: /* @__PURE__ */ jsxs37(
|
|
7900
|
-
/* @__PURE__ */ jsx51(
|
|
7971
|
+
entry == null ? /* @__PURE__ */ jsx51(Breadcrumb.Item, { children: /* @__PURE__ */ jsxs37(Menu4.Root, { positioning: { placement: "bottom-start" }, children: [
|
|
7972
|
+
/* @__PURE__ */ jsx51(Menu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsx51(
|
|
7901
7973
|
chakra29.button,
|
|
7902
7974
|
{
|
|
7903
7975
|
type: "button",
|
|
@@ -7912,40 +7984,74 @@ function Breadcrumbs({ items, loading: own }) {
|
|
|
7912
7984
|
children: "\u2026"
|
|
7913
7985
|
}
|
|
7914
7986
|
) }),
|
|
7915
|
-
/* @__PURE__ */ jsx51(Portal13, { children: /* @__PURE__ */ jsx51(
|
|
7987
|
+
/* @__PURE__ */ jsx51(Portal13, { children: /* @__PURE__ */ jsx51(Menu4.Positioner, { children: /* @__PURE__ */ jsx51(Menu4.Content, { minW: "40", children: hidden.map((h, k) => /* @__PURE__ */ jsx51(Menu4.Item, { value: String(k), asChild: Boolean(h.href), children: h.href ? /* @__PURE__ */ jsx51(Link, { href: h.href, children: h.label }) : /* @__PURE__ */ jsx51("span", { children: h.label }) }, k)) }) }) })
|
|
7916
7988
|
] }) }) : /* @__PURE__ */ jsx51(Breadcrumb.Item, { children: entry.item.href && entry.index < items.length - 1 ? /* @__PURE__ */ jsx51(Breadcrumb.Link, { asChild: true, children: /* @__PURE__ */ jsx51(Link, { href: entry.item.href, children: label(entry.item, entry.index) }) }) : /* @__PURE__ */ jsx51(Breadcrumb.CurrentLink, { children: label(entry.item, entry.index) }) })
|
|
7917
7989
|
] }, entry ? entry.index : "more")) }) });
|
|
7918
7990
|
}
|
|
7919
7991
|
|
|
7920
7992
|
// src/components/Panel.tsx
|
|
7921
|
-
import { createContext as createContext11, forwardRef as forwardRef8, useContext as useContext11 } from "react";
|
|
7993
|
+
import { createContext as createContext11, forwardRef as forwardRef8, useContext as useContext11, useId as useId7, useState as useState21 } from "react";
|
|
7922
7994
|
import { chakra as chakra30, useSlotRecipe as useSlotRecipe5 } from "@chakra-ui/react";
|
|
7923
|
-
import {
|
|
7995
|
+
import { ChevronRight as ChevronRight4 } from "lucide-react";
|
|
7996
|
+
import { Fragment as Fragment19, jsx as jsx52, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
7924
7997
|
var ToneContext = createContext11("card");
|
|
7925
7998
|
function PanelTone({ tone, children }) {
|
|
7926
7999
|
return /* @__PURE__ */ jsx52(ToneContext.Provider, { value: tone, children });
|
|
7927
8000
|
}
|
|
7928
|
-
var Panel = forwardRef8(function Panel2({
|
|
8001
|
+
var Panel = forwardRef8(function Panel2({
|
|
8002
|
+
title,
|
|
8003
|
+
description,
|
|
8004
|
+
actions,
|
|
8005
|
+
footer,
|
|
8006
|
+
flush = false,
|
|
8007
|
+
headingAs = "h2",
|
|
8008
|
+
loading,
|
|
8009
|
+
tone,
|
|
8010
|
+
collapsible = false,
|
|
8011
|
+
defaultCollapsed = false,
|
|
8012
|
+
collapsed: collapsedProp,
|
|
8013
|
+
onCollapsedChange,
|
|
8014
|
+
summary,
|
|
8015
|
+
children,
|
|
8016
|
+
css,
|
|
8017
|
+
...rest
|
|
8018
|
+
}, ref) {
|
|
7929
8019
|
const recipe = useSlotRecipe5({ key: "abpPanel" });
|
|
7930
8020
|
const inherited = useContext11(ToneContext);
|
|
7931
|
-
const
|
|
8021
|
+
const [ownCollapsed, setOwnCollapsed] = useState21(defaultCollapsed);
|
|
8022
|
+
const folded = collapsible && (collapsedProp ?? ownCollapsed);
|
|
8023
|
+
const styles = recipe({ flush, tone: tone ?? inherited, collapsed: folded });
|
|
8024
|
+
const bodyId = useId7();
|
|
7932
8025
|
const hasHeader = title != null || actions != null || description != null;
|
|
7933
|
-
|
|
8026
|
+
const toggle = () => {
|
|
8027
|
+
const next = !folded;
|
|
8028
|
+
if (collapsedProp === void 0) setOwnCollapsed(next);
|
|
8029
|
+
onCollapsedChange?.(next);
|
|
8030
|
+
};
|
|
8031
|
+
const heading = /* @__PURE__ */ jsxs38(chakra30.div, { css: styles.titleGroup, children: [
|
|
8032
|
+
title != null && /* @__PURE__ */ jsx52(chakra30.h2, { as: headingAs, css: styles.title, children: title }),
|
|
8033
|
+
description != null && !folded && /* @__PURE__ */ jsx52(chakra30.p, { css: styles.description, children: description })
|
|
8034
|
+
] });
|
|
8035
|
+
const content = /* @__PURE__ */ jsxs38(Fragment19, { children: [
|
|
8036
|
+
/* @__PURE__ */ jsx52(chakra30.div, { css: styles.body, children: loading === void 0 ? children : /* @__PURE__ */ jsx52(Loading, { when: loading, children }) }),
|
|
8037
|
+
footer != null && /* @__PURE__ */ jsx52(chakra30.footer, { css: styles.footer, children: footer })
|
|
8038
|
+
] });
|
|
8039
|
+
return /* @__PURE__ */ jsxs38(chakra30.section, { ref, css: [styles.root, css], "data-collapsed": folded ? "" : void 0, ...rest, children: [
|
|
7934
8040
|
hasHeader && /* @__PURE__ */ jsxs38(chakra30.header, { css: styles.header, children: [
|
|
7935
|
-
/* @__PURE__ */ jsxs38(chakra30.
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
8041
|
+
collapsible ? /* @__PURE__ */ jsxs38(chakra30.button, { type: "button", css: styles.toggle, "aria-expanded": !folded, "aria-controls": bodyId, onClick: toggle, children: [
|
|
8042
|
+
/* @__PURE__ */ jsx52(chakra30.span, { css: styles.chevron, "data-open": folded ? void 0 : "", "aria-hidden": true, children: /* @__PURE__ */ jsx52(ChevronRight4, { size: 16 }) }),
|
|
8043
|
+
heading,
|
|
8044
|
+
folded && summary != null && /* @__PURE__ */ jsx52(chakra30.span, { css: styles.summary, children: summary })
|
|
8045
|
+
] }) : heading,
|
|
7939
8046
|
actions != null && /* @__PURE__ */ jsx52(chakra30.div, { css: styles.actions, children: actions })
|
|
7940
8047
|
] }),
|
|
7941
|
-
/* @__PURE__ */ jsx52(
|
|
7942
|
-
footer != null && /* @__PURE__ */ jsx52(chakra30.footer, { css: styles.footer, children: footer })
|
|
8048
|
+
collapsible ? /* @__PURE__ */ jsx52(Collapse, { open: !folded, id: bodyId, display: "flex", flexDirection: "column", flex: "1", minW: "0", children: content }) : content
|
|
7943
8049
|
] });
|
|
7944
8050
|
});
|
|
7945
8051
|
|
|
7946
8052
|
// src/components/PathChips.tsx
|
|
7947
8053
|
import { chakra as chakra31, useSlotRecipe as useSlotRecipe6 } from "@chakra-ui/react";
|
|
7948
|
-
import { ChevronRight as
|
|
8054
|
+
import { ChevronRight as ChevronRight5 } from "lucide-react";
|
|
7949
8055
|
import { jsx as jsx53, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
7950
8056
|
function PathChips({ path, highlightLast = true, loading: own, skeletonCount = 3, css, ...rest }) {
|
|
7951
8057
|
const labels = useAbpLabels();
|
|
@@ -7954,7 +8060,7 @@ function PathChips({ path, highlightLast = true, loading: own, skeletonCount = 3
|
|
|
7954
8060
|
const loading = useLoading(own) && path.length === 0;
|
|
7955
8061
|
const segments = loading ? Array.from({ length: skeletonCount }, (_, i) => "\xA0".repeat(boneWidth(i, 6, 12))) : path;
|
|
7956
8062
|
return /* @__PURE__ */ jsx53(chakra31.ol, { "aria-label": rest["aria-label"] ?? labels.path, "aria-hidden": loading || void 0, css: [styles.root, css], ...rest, children: segments.map((segment, i) => /* @__PURE__ */ jsxs39(chakra31.li, { css: styles.item, children: [
|
|
7957
|
-
i > 0 && /* @__PURE__ */ jsx53(chakra31.span, { css: styles.separator, "aria-hidden": "true", children: /* @__PURE__ */ jsx53(
|
|
8063
|
+
i > 0 && /* @__PURE__ */ jsx53(chakra31.span, { css: styles.separator, "aria-hidden": "true", children: /* @__PURE__ */ jsx53(ChevronRight5, {}) }),
|
|
7958
8064
|
/* @__PURE__ */ jsx53(chakra31.span, { css: loading ? [styles.chip, ghostCss] : styles.chip, "aria-current": !loading && highlightLast && i === path.length - 1 ? true : void 0, children: segment })
|
|
7959
8065
|
] }, `${i}:${segment}`)) });
|
|
7960
8066
|
}
|
|
@@ -7972,9 +8078,9 @@ function PropertyList({ items, size = "md", loading: own }) {
|
|
|
7972
8078
|
}
|
|
7973
8079
|
|
|
7974
8080
|
// src/components/QueryableList.tsx
|
|
7975
|
-
import { useEffect as
|
|
8081
|
+
import { useEffect as useEffect17, useId as useId9, useMemo as useMemo13, useRef as useRef19, useState as useState24 } from "react";
|
|
7976
8082
|
import { createPortal } from "react-dom";
|
|
7977
|
-
import { Box as Box12, chakra as
|
|
8083
|
+
import { Box as Box12, chakra as chakra35, HStack as HStack12, Input as Input7, Menu as Menu5, Portal as Portal17, Stack as Stack14, Text as Text19 } from "@chakra-ui/react";
|
|
7978
8084
|
import { ArrowDownWideNarrow, ArrowUpNarrowWide, ChevronDown as ChevronDown3, Download, Filter, Rows3, Save, Trash2 as Trash22, X as X2 } from "lucide-react";
|
|
7979
8085
|
|
|
7980
8086
|
// src/components/query/ColumnsPopover.tsx
|
|
@@ -8084,10 +8190,10 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
8084
8190
|
}
|
|
8085
8191
|
|
|
8086
8192
|
// src/components/query/FilterBuilder.tsx
|
|
8087
|
-
import { useEffect as useEffect15, useId as
|
|
8193
|
+
import { useEffect as useEffect15, useId as useId8, useRef as useRef18, useState as useState22 } from "react";
|
|
8088
8194
|
import { CloseButton as CloseButton3, Dialog as Dialog5, HStack as HStack11, Input as Input6, Portal as Portal15, Stack as Stack12, Text as Text17 } from "@chakra-ui/react";
|
|
8089
8195
|
import { Trash2 } from "lucide-react";
|
|
8090
|
-
import { Fragment as
|
|
8196
|
+
import { Fragment as Fragment20, jsx as jsx56, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
8091
8197
|
function fill3(template, values) {
|
|
8092
8198
|
return template.replace(/\{(\w+)\}/g, (_, k) => String(values[k] ?? `{${k}}`));
|
|
8093
8199
|
}
|
|
@@ -8100,9 +8206,9 @@ function conditionOf(d, field, own) {
|
|
|
8100
8206
|
}
|
|
8101
8207
|
function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, countMatches, onApply, onClose }) {
|
|
8102
8208
|
const labels = useAbpLabels().queryList;
|
|
8103
|
-
const [seq, setSeq] =
|
|
8104
|
-
const [rows2, setRows] =
|
|
8105
|
-
const [touched, setTouched] =
|
|
8209
|
+
const [seq, setSeq] = useState22(initial.length + 1);
|
|
8210
|
+
const [rows2, setRows] = useState22(() => 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 }]));
|
|
8211
|
+
const [touched, setTouched] = useState22(false);
|
|
8106
8212
|
const own = (d) => {
|
|
8107
8213
|
const f = fields.find((x) => x.id === d.field);
|
|
8108
8214
|
return Boolean(f && renderValueEditor && !NO_VALUE_OPS.has(d.op) && renderValueEditor({ field: f, op: d.op, value: d.chosen, onChange: () => void 0 }) != null);
|
|
@@ -8116,8 +8222,8 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8116
8222
|
counter.current = countMatches;
|
|
8117
8223
|
});
|
|
8118
8224
|
const counts = Boolean(countMatches);
|
|
8119
|
-
const [count, setCount] =
|
|
8120
|
-
const [total, setTotal] =
|
|
8225
|
+
const [count, setCount] = useState22(null);
|
|
8226
|
+
const [total, setTotal] = useState22(null);
|
|
8121
8227
|
useEffect15(() => {
|
|
8122
8228
|
if (!counts) return;
|
|
8123
8229
|
let gone = false;
|
|
@@ -8153,7 +8259,7 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8153
8259
|
/* @__PURE__ */ jsx56(Dialog5.Body, { children: /* @__PURE__ */ jsxs42(Stack12, { gap: "3", children: [
|
|
8154
8260
|
/* @__PURE__ */ jsxs42(Text17, { textStyle: "sm", color: "fg.muted", children: [
|
|
8155
8261
|
labels.matchAll,
|
|
8156
|
-
repeats && /* @__PURE__ */ jsxs42(
|
|
8262
|
+
repeats && /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
8157
8263
|
" ",
|
|
8158
8264
|
labels.sameFieldAny
|
|
8159
8265
|
] })
|
|
@@ -8181,7 +8287,7 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8181
8287
|
/* @__PURE__ */ jsx56(Dialog5.Footer, { children: /* @__PURE__ */ jsxs42(HStack11, { justify: "space-between", w: "full", wrap: "wrap", gap: "2", children: [
|
|
8182
8288
|
/* @__PURE__ */ jsxs42(Text17, { textStyle: "sm", color: "fg.muted", "aria-live": "polite", "data-filter-count": "", children: [
|
|
8183
8289
|
count != null && fill3(total != null ? labels.matchCount : labels.matchCountOnly, { count, total: total ?? "" }),
|
|
8184
|
-
incomplete > 0 && /* @__PURE__ */ jsxs42(
|
|
8290
|
+
incomplete > 0 && /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
8185
8291
|
" \xB7 ",
|
|
8186
8292
|
labels.incompleteSkipped
|
|
8187
8293
|
] })
|
|
@@ -8205,10 +8311,10 @@ function describe(c2, fields, labels) {
|
|
|
8205
8311
|
}
|
|
8206
8312
|
function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChange, onRemove }) {
|
|
8207
8313
|
const labels = useAbpLabels().queryList;
|
|
8208
|
-
const listId =
|
|
8314
|
+
const listId = useId8();
|
|
8209
8315
|
const field = fields.find((f) => f.id === draft.field);
|
|
8210
8316
|
const { op, text } = draft;
|
|
8211
|
-
const [options, setOptions] =
|
|
8317
|
+
const [options, setOptions] = useState22([]);
|
|
8212
8318
|
const own = field && renderValueEditor && !NO_VALUE_OPS.has(op) ? renderValueEditor({ field, op, value: draft.chosen, onChange: (v) => onChange({ chosen: v }) }) : null;
|
|
8213
8319
|
useEffect15(() => {
|
|
8214
8320
|
if (!suggest || !field || NO_VALUE_OPS.has(op) || own != null) return;
|
|
@@ -8251,7 +8357,7 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8251
8357
|
}
|
|
8252
8358
|
),
|
|
8253
8359
|
own,
|
|
8254
|
-
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */ jsxs42(
|
|
8360
|
+
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
8255
8361
|
/* @__PURE__ */ jsx56(
|
|
8256
8362
|
Input6,
|
|
8257
8363
|
{
|
|
@@ -8274,8 +8380,129 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8274
8380
|
] });
|
|
8275
8381
|
}
|
|
8276
8382
|
|
|
8383
|
+
// src/components/query/ExportDialog.tsx
|
|
8384
|
+
import { useEffect as useEffect16, useMemo as useMemo12, useState as useState23 } from "react";
|
|
8385
|
+
import { chakra as chakra34, CloseButton as CloseButton4, Dialog as Dialog6, Portal as Portal16, Stack as Stack13, Text as Text18 } from "@chakra-ui/react";
|
|
8386
|
+
|
|
8387
|
+
// src/components/query/exportText.ts
|
|
8388
|
+
function exportText(value) {
|
|
8389
|
+
if (value == null) return "";
|
|
8390
|
+
if (Array.isArray(value)) return value.map(exportText).filter(Boolean).join("; ");
|
|
8391
|
+
if (typeof value === "object") {
|
|
8392
|
+
const v = value;
|
|
8393
|
+
for (const k of ["displayName", "name", "title", "label", "key"]) if (typeof v[k] === "string") return v[k];
|
|
8394
|
+
return "";
|
|
8395
|
+
}
|
|
8396
|
+
return String(value);
|
|
8397
|
+
}
|
|
8398
|
+
function csvField(text, separator) {
|
|
8399
|
+
return text.includes(separator) || /["\r\n]/.test(text) ? `"${text.replace(/"/g, '""')}"` : text;
|
|
8400
|
+
}
|
|
8401
|
+
|
|
8402
|
+
// src/components/query/ExportDialog.tsx
|
|
8403
|
+
import { jsx as jsx57, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
8404
|
+
var SEPARATORS = { comma: ",", semicolon: ";", tab: " " };
|
|
8405
|
+
function ExportDialog({ format, onClose, fields, shown, columnLabels, found, filtered, sample, onExport }) {
|
|
8406
|
+
const labels = useAbpLabels();
|
|
8407
|
+
const q = labels.queryList;
|
|
8408
|
+
const { locale } = useAbpLocale();
|
|
8409
|
+
const fmt = useFormatters();
|
|
8410
|
+
const ordered = useMemo12(() => {
|
|
8411
|
+
const byId = new Map(fields.map((f) => [f.id, f]));
|
|
8412
|
+
const first = shown.filter((id) => byId.has(id));
|
|
8413
|
+
return [...first, ...fields.map((f) => f.id).filter((id) => !first.includes(id))];
|
|
8414
|
+
}, [fields, shown]);
|
|
8415
|
+
const [picked, setPicked] = useState23(new Set(shown));
|
|
8416
|
+
const [all, setAll] = useState23(false);
|
|
8417
|
+
const [separator, setSeparator] = useState23("comma");
|
|
8418
|
+
useEffect16(() => {
|
|
8419
|
+
if (format) {
|
|
8420
|
+
setPicked(new Set(shown));
|
|
8421
|
+
setAll(false);
|
|
8422
|
+
}
|
|
8423
|
+
}, [format, shown]);
|
|
8424
|
+
const name = (id) => {
|
|
8425
|
+
const own = columnLabels?.[id];
|
|
8426
|
+
return typeof own === "string" ? own : fields.find((f) => f.id === id)?.label ?? id;
|
|
8427
|
+
};
|
|
8428
|
+
const columns = ordered.filter((id) => picked.has(id));
|
|
8429
|
+
const rows2 = sample.slice(0, 3);
|
|
8430
|
+
const sep = SEPARATORS[separator];
|
|
8431
|
+
const csv = [columns.map((id) => csvField(name(id), sep)), ...rows2.map((r) => columns.map((id) => csvField(exportText(r.values[id]), sep)))].map((cells) => cells.join(sep === " " ? " " : sep)).join("\n");
|
|
8432
|
+
return /* @__PURE__ */ jsx57(Dialog6.Root, { open: format != null, onOpenChange: (e) => !e.open && onClose(), size: "lg", placement: "center", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs43(Portal16, { children: [
|
|
8433
|
+
/* @__PURE__ */ jsx57(Dialog6.Backdrop, {}),
|
|
8434
|
+
/* @__PURE__ */ jsx57(Dialog6.Positioner, { children: /* @__PURE__ */ jsxs43(Dialog6.Content, { "data-export-dialog": "", children: [
|
|
8435
|
+
/* @__PURE__ */ jsx57(Dialog6.Header, { children: /* @__PURE__ */ jsx57(Dialog6.Title, { children: format === "xlsx" ? q.exportTitleExcel ?? "Export to Excel" : q.exportTitleCsv ?? "Export to CSV" }) }),
|
|
8436
|
+
/* @__PURE__ */ jsx57(Dialog6.Body, { children: /* @__PURE__ */ jsxs43(Stack13, { gap: "5", children: [
|
|
8437
|
+
filtered && /* @__PURE__ */ jsxs43(Stack13, { gap: "1.5", children: [
|
|
8438
|
+
/* @__PURE__ */ jsx57(Text18, { textStyle: "label", children: q.exportRows ?? "Rows" }),
|
|
8439
|
+
/* @__PURE__ */ jsx57(
|
|
8440
|
+
SegmentedControl,
|
|
8441
|
+
{
|
|
8442
|
+
size: "sm",
|
|
8443
|
+
"aria-label": q.exportRows ?? "Rows",
|
|
8444
|
+
value: all ? "all" : "found",
|
|
8445
|
+
onValueChange: (v) => setAll(v === "all"),
|
|
8446
|
+
items: [
|
|
8447
|
+
{ value: "found", label: formatMessage(locale, q.exportFound ?? "Filtered ({count})", { count: fmt.number(found) }) },
|
|
8448
|
+
{ value: "all", label: q.exportAll ?? "All" }
|
|
8449
|
+
]
|
|
8450
|
+
}
|
|
8451
|
+
)
|
|
8452
|
+
] }),
|
|
8453
|
+
/* @__PURE__ */ jsxs43(Stack13, { gap: "1.5", role: "group", "aria-labelledby": "export-columns", children: [
|
|
8454
|
+
/* @__PURE__ */ jsx57(Text18, { id: "export-columns", textStyle: "label", children: q.exportColumns ?? "Columns" }),
|
|
8455
|
+
/* @__PURE__ */ jsx57(chakra34.div, { display: "grid", gridTemplateColumns: { base: "1fr", sm: "repeat(2, minmax(0, 1fr))" }, gap: "2", children: ordered.map((id) => /* @__PURE__ */ jsx57(
|
|
8456
|
+
CheckboxField,
|
|
8457
|
+
{
|
|
8458
|
+
label: name(id),
|
|
8459
|
+
checked: picked.has(id),
|
|
8460
|
+
onCheckedChange: (on) => setPicked((p) => {
|
|
8461
|
+
const next = new Set(p);
|
|
8462
|
+
if (on) next.add(id);
|
|
8463
|
+
else next.delete(id);
|
|
8464
|
+
return next;
|
|
8465
|
+
})
|
|
8466
|
+
},
|
|
8467
|
+
id
|
|
8468
|
+
)) })
|
|
8469
|
+
] }),
|
|
8470
|
+
format === "csv" && /* @__PURE__ */ jsxs43(Stack13, { gap: "1.5", children: [
|
|
8471
|
+
/* @__PURE__ */ jsx57(chakra34.label, { textStyle: "label", htmlFor: "export-separator", children: q.exportSeparator ?? "Separator" }),
|
|
8472
|
+
/* @__PURE__ */ jsx57(
|
|
8473
|
+
SelectField,
|
|
8474
|
+
{
|
|
8475
|
+
id: "export-separator",
|
|
8476
|
+
value: separator,
|
|
8477
|
+
onChange: (e) => setSeparator(e.target.value),
|
|
8478
|
+
maxW: "16rem",
|
|
8479
|
+
options: [
|
|
8480
|
+
{ value: "comma", label: q.exportComma ?? "Comma ( , )" },
|
|
8481
|
+
{ value: "semicolon", label: q.exportSemicolon ?? "Semicolon ( ; )" },
|
|
8482
|
+
{ value: "tab", label: q.exportTab ?? "Tab" }
|
|
8483
|
+
]
|
|
8484
|
+
}
|
|
8485
|
+
)
|
|
8486
|
+
] }),
|
|
8487
|
+
columns.length > 0 && rows2.length > 0 && /* @__PURE__ */ jsxs43(Stack13, { gap: "1.5", children: [
|
|
8488
|
+
/* @__PURE__ */ jsx57(Text18, { textStyle: "label", children: q.exportPreview ?? "Preview" }),
|
|
8489
|
+
format === "csv" ? /* @__PURE__ */ jsx57(chakra34.pre, { dir: "ltr", textAlign: "start", m: "0", p: "3", bg: "bg.subtle", borderRadius: "l2", textStyle: "code", overflowX: "auto", whiteSpace: "pre", "data-export-preview": "", children: csv }) : /* @__PURE__ */ jsx57(chakra34.div, { overflowX: "auto", bg: "bg.subtle", borderRadius: "l2", "data-export-preview": "", children: /* @__PURE__ */ jsxs43(chakra34.table, { textStyle: "body.sm", borderCollapse: "collapse", w: "full", children: [
|
|
8490
|
+
/* @__PURE__ */ jsx57("thead", { children: /* @__PURE__ */ jsx57("tr", { children: columns.map((id) => /* @__PURE__ */ jsx57(chakra34.th, { textAlign: "start", fontWeight: "bold", px: "3", py: "1.5", borderBottomWidth: "1px", whiteSpace: "nowrap", children: name(id) }, id)) }) }),
|
|
8491
|
+
/* @__PURE__ */ jsx57("tbody", { children: rows2.map((r) => /* @__PURE__ */ jsx57("tr", { children: columns.map((id) => /* @__PURE__ */ jsx57(chakra34.td, { px: "3", py: "1.5", whiteSpace: "nowrap", maxW: "16rem", truncate: true, children: exportText(r.values[id]) }, id)) }, r.id)) })
|
|
8492
|
+
] }) })
|
|
8493
|
+
] })
|
|
8494
|
+
] }) }),
|
|
8495
|
+
/* @__PURE__ */ jsxs43(Dialog6.Footer, { children: [
|
|
8496
|
+
/* @__PURE__ */ jsx57(Dialog6.ActionTrigger, { asChild: true, children: /* @__PURE__ */ jsx57(Button, { variant: "cancel", children: labels.cancel }) }),
|
|
8497
|
+
/* @__PURE__ */ jsx57(Button, { variant: "primary", disabled: columns.length === 0, onClick: () => onExport({ columns, all, separator }), children: q.exportRun ?? "Export" })
|
|
8498
|
+
] }),
|
|
8499
|
+
/* @__PURE__ */ jsx57(Dialog6.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx57(CloseButton4, { size: "sm" }) })
|
|
8500
|
+
] }) })
|
|
8501
|
+
] }) });
|
|
8502
|
+
}
|
|
8503
|
+
|
|
8277
8504
|
// src/components/QueryableList.tsx
|
|
8278
|
-
import { Fragment as
|
|
8505
|
+
import { Fragment as Fragment21, jsx as jsx58, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
8279
8506
|
var PAIR = "";
|
|
8280
8507
|
var pairKey = (first, second) => `${first}${PAIR}${second}`;
|
|
8281
8508
|
var condition = (field, value) => value == null ? { field, op: "isEmpty" } : { field, op: "eq", value };
|
|
@@ -8336,17 +8563,18 @@ function QueryableList({
|
|
|
8336
8563
|
}) {
|
|
8337
8564
|
const labels = useAbpLabels().queryList;
|
|
8338
8565
|
const fmt = useFormatters();
|
|
8339
|
-
const byId =
|
|
8566
|
+
const byId = useMemo13(() => new Map((fields ?? []).map((f) => [f.id, f])), [fields]);
|
|
8340
8567
|
const query = result?.query ?? state.query ?? {};
|
|
8341
8568
|
const conditions = basicConditions(query.where ?? null);
|
|
8342
|
-
const [mode, setMode] =
|
|
8343
|
-
const [adding, setAdding] =
|
|
8344
|
-
const [naming, setNaming] =
|
|
8345
|
-
const [exporting, setExporting] =
|
|
8346
|
-
const [
|
|
8569
|
+
const [mode, setMode] = useState24(conditions === null ? "rql" : "basic");
|
|
8570
|
+
const [adding, setAdding] = useState24(false);
|
|
8571
|
+
const [naming, setNaming] = useState24(null);
|
|
8572
|
+
const [exporting, setExporting] = useState24(false);
|
|
8573
|
+
const [exportFormat, setExportFormat] = useState24(null);
|
|
8574
|
+
const [exported, setExported] = useState24(null);
|
|
8347
8575
|
const complex = conditions === null;
|
|
8348
8576
|
const failed = Boolean(error && state.rql);
|
|
8349
|
-
|
|
8577
|
+
useEffect17(() => {
|
|
8350
8578
|
if (complex || failed) setMode("rql");
|
|
8351
8579
|
}, [complex, failed]);
|
|
8352
8580
|
const label = (id) => byId.get(id)?.label ?? id;
|
|
@@ -8372,12 +8600,20 @@ function QueryableList({
|
|
|
8372
8600
|
const to = Math.min(skip + take, total);
|
|
8373
8601
|
const groupable = (fields ?? []).filter((f) => f.groupable);
|
|
8374
8602
|
const activeView = views?.find((v) => v.id === activeViewId) ?? null;
|
|
8375
|
-
async function runExport(format) {
|
|
8603
|
+
async function runExport(format, choice) {
|
|
8376
8604
|
if (!onExport) return;
|
|
8605
|
+
setExportFormat(null);
|
|
8377
8606
|
setExporting(true);
|
|
8378
8607
|
setExported(null);
|
|
8608
|
+
const controller = new AbortController();
|
|
8609
|
+
const toast = toaster.create({
|
|
8610
|
+
type: "loading",
|
|
8611
|
+
title: labels.exportPreparing ?? "Preparing the file\u2026 You can keep working.",
|
|
8612
|
+
action: { label: labels.exportCancel ?? "Cancel", onClick: () => controller.abort() }
|
|
8613
|
+
});
|
|
8379
8614
|
try {
|
|
8380
|
-
const done = await onExport(format);
|
|
8615
|
+
const done = await onExport(format, { ...choice, signal: controller.signal });
|
|
8616
|
+
toaster.update(toast, { type: "success", title: labels.exportReady ?? "Your file is ready", action: void 0 });
|
|
8381
8617
|
if (done?.truncated) {
|
|
8382
8618
|
setExported({
|
|
8383
8619
|
tone: "warning",
|
|
@@ -8385,15 +8621,20 @@ function QueryableList({
|
|
|
8385
8621
|
});
|
|
8386
8622
|
}
|
|
8387
8623
|
} catch (e) {
|
|
8388
|
-
|
|
8624
|
+
if (controller.signal.aborted) {
|
|
8625
|
+
toaster.dismiss(toast);
|
|
8626
|
+
} else {
|
|
8627
|
+
toaster.dismiss(toast);
|
|
8628
|
+
setExported({ tone: "danger", message: e instanceof Error ? e.message : String(e) });
|
|
8629
|
+
}
|
|
8389
8630
|
} finally {
|
|
8390
8631
|
setExporting(false);
|
|
8391
8632
|
}
|
|
8392
8633
|
}
|
|
8393
8634
|
const groupField = query.groupBy?.field ?? null;
|
|
8394
8635
|
const thenField = groupField ? query.groupBy?.then?.field ?? null : null;
|
|
8395
|
-
const [folded, setFolded] =
|
|
8396
|
-
|
|
8636
|
+
const [folded, setFolded] = useState24(() => /* @__PURE__ */ new Set());
|
|
8637
|
+
useEffect17(() => setFolded(/* @__PURE__ */ new Set()), [groupField, thenField]);
|
|
8397
8638
|
const grouped = Boolean(groupField && result?.groups && result.groups.length > 0);
|
|
8398
8639
|
const asTree = Boolean(tree && groupField === tree.field);
|
|
8399
8640
|
const groupOf = (row) => {
|
|
@@ -8406,7 +8647,7 @@ function QueryableList({
|
|
|
8406
8647
|
const firstOf = (key) => thenField ? key.slice(0, key.indexOf(PAIR)) : key;
|
|
8407
8648
|
const { locale } = useAbpLocale();
|
|
8408
8649
|
const groupName = (value, label2, period) => value == null ? labels.noGroupValue : period ? periodName(value, period, locale, { week: labels.periodWeek, quarter: labels.periodQuarter }) : label2 || value;
|
|
8409
|
-
const groupKeys =
|
|
8650
|
+
const groupKeys = useMemo13(() => {
|
|
8410
8651
|
const keys = [...new Set((result?.items ?? []).map(groupOf))];
|
|
8411
8652
|
return thenField ? [...keys, ...new Set(keys.map((k) => parentFoldKey(k.slice(0, k.indexOf(PAIR)))))] : keys;
|
|
8412
8653
|
}, [result, groupField, thenField]);
|
|
@@ -8422,15 +8663,15 @@ function QueryableList({
|
|
|
8422
8663
|
}
|
|
8423
8664
|
const sortable = (fields ?? []).filter((f) => f.sortable);
|
|
8424
8665
|
const groupLabel = groupField ? thenField ? `${label(groupField)} \xB7 ${label(thenField)}` : label(groupField) : null;
|
|
8425
|
-
return /* @__PURE__ */
|
|
8426
|
-
/* @__PURE__ */
|
|
8427
|
-
/* @__PURE__ */
|
|
8428
|
-
/* @__PURE__ */
|
|
8666
|
+
return /* @__PURE__ */ jsxs44(Stack14, { gap: "3", children: [
|
|
8667
|
+
/* @__PURE__ */ jsxs44(chakra35.div, { layerStyle: "panel", borderRadius: "l3", "data-query-toolbar": "", children: [
|
|
8668
|
+
/* @__PURE__ */ jsxs44(HStack12, { gap: "2", wrap: "wrap", justify: "space-between", px: "2.5", py: "2", borderBottomWidth: "1px", borderColor: "border.muted", children: [
|
|
8669
|
+
/* @__PURE__ */ jsxs44(HStack12, { gap: "2", wrap: "wrap", minW: "0", children: [
|
|
8429
8670
|
leading,
|
|
8430
|
-
leading != null && views && onSelectView && /* @__PURE__ */
|
|
8431
|
-
views && onSelectView && /* @__PURE__ */
|
|
8432
|
-
/* @__PURE__ */
|
|
8433
|
-
/* @__PURE__ */
|
|
8671
|
+
leading != null && views && onSelectView && /* @__PURE__ */ jsx58(chakra35.span, { w: "1px", h: "6", bg: "border", mx: "1", "aria-hidden": true }),
|
|
8672
|
+
views && onSelectView && /* @__PURE__ */ jsxs44(HStack12, { gap: "2", children: [
|
|
8673
|
+
/* @__PURE__ */ jsx58(Text19, { as: "span", textStyle: "xs", fontWeight: "semibold", color: "fg.muted", whiteSpace: "nowrap", hideBelow: "2xl", children: labels.savedView }),
|
|
8674
|
+
/* @__PURE__ */ jsx58(
|
|
8434
8675
|
SelectField,
|
|
8435
8676
|
{
|
|
8436
8677
|
width: "auto",
|
|
@@ -8442,62 +8683,62 @@ function QueryableList({
|
|
|
8442
8683
|
}
|
|
8443
8684
|
)
|
|
8444
8685
|
] }),
|
|
8445
|
-
onSaveView && (naming === null ? /* @__PURE__ */
|
|
8446
|
-
/* @__PURE__ */
|
|
8686
|
+
onSaveView && (naming === null ? /* @__PURE__ */ jsxs44(Button, { size: "sm", variant: "ghost", color: "fg.accent", onClick: () => setNaming(activeView?.isOwner ? activeView.name : ""), children: [
|
|
8687
|
+
/* @__PURE__ */ jsx58(Save, {}),
|
|
8447
8688
|
labels.saveView
|
|
8448
|
-
] }) : /* @__PURE__ */
|
|
8689
|
+
] }) : /* @__PURE__ */ jsxs44(HStack12, { gap: "1", as: "form", onSubmit: (e) => {
|
|
8449
8690
|
e.preventDefault();
|
|
8450
8691
|
if (naming.trim()) onSaveView(naming.trim(), activeView?.isOwner && naming.trim() === activeView.name ? activeView.id : null);
|
|
8451
8692
|
setNaming(null);
|
|
8452
8693
|
}, children: [
|
|
8453
|
-
/* @__PURE__ */
|
|
8454
|
-
/* @__PURE__ */
|
|
8455
|
-
/* @__PURE__ */
|
|
8694
|
+
/* @__PURE__ */ jsx58(Input7, { size: "sm", autoFocus: true, "aria-label": labels.viewName, placeholder: labels.viewName, value: naming, onChange: (e) => setNaming(e.target.value), maxW: "56" }),
|
|
8695
|
+
/* @__PURE__ */ jsx58(Button, { size: "sm", type: "submit", variant: "primary", disabled: !naming.trim(), children: labels.save }),
|
|
8696
|
+
/* @__PURE__ */ jsx58(IconButton, { size: "sm", variant: "ghost", "aria-label": labels.cancel, onClick: () => setNaming(null), children: /* @__PURE__ */ jsx58(X2, {}) })
|
|
8456
8697
|
] })),
|
|
8457
|
-
activeView?.isOwner && onDeleteView && naming === null && /* @__PURE__ */
|
|
8698
|
+
activeView?.isOwner && onDeleteView && naming === null && /* @__PURE__ */ jsx58(IconButton, { size: "sm", variant: "ghost", "aria-label": labels.deleteView, onClick: () => onDeleteView(activeView.id), children: /* @__PURE__ */ jsx58(Trash22, {}) })
|
|
8458
8699
|
] }),
|
|
8459
|
-
/* @__PURE__ */
|
|
8460
|
-
/* @__PURE__ */
|
|
8461
|
-
/* @__PURE__ */
|
|
8462
|
-
/* @__PURE__ */
|
|
8463
|
-
/* @__PURE__ */
|
|
8700
|
+
/* @__PURE__ */ jsxs44(HStack12, { gap: "2", wrap: "wrap", children: [
|
|
8701
|
+
/* @__PURE__ */ jsxs44(Menu5.Root, { positioning: { placement: "bottom-end" }, children: [
|
|
8702
|
+
/* @__PURE__ */ jsx58(Menu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs44(Button, { size: "sm", variant: "secondary", "aria-label": labels.groupBy, disabled: groupable.length === 0, children: [
|
|
8703
|
+
/* @__PURE__ */ jsx58(Rows3, {}),
|
|
8704
|
+
/* @__PURE__ */ jsx58(Text19, { as: "span", color: "fg.muted", fontWeight: "normal", children: labels.group }),
|
|
8464
8705
|
groupLabel ?? labels.noGrouping,
|
|
8465
|
-
/* @__PURE__ */
|
|
8706
|
+
/* @__PURE__ */ jsx58(ChevronDown3, {})
|
|
8466
8707
|
] }) }),
|
|
8467
|
-
/* @__PURE__ */
|
|
8468
|
-
/* @__PURE__ */
|
|
8469
|
-
|
|
8708
|
+
/* @__PURE__ */ jsx58(Portal17, { children: /* @__PURE__ */ jsx58(Menu5.Positioner, { children: /* @__PURE__ */ jsxs44(Menu5.Content, { minW: "48", children: [
|
|
8709
|
+
/* @__PURE__ */ jsxs44(
|
|
8710
|
+
Menu5.RadioItemGroup,
|
|
8470
8711
|
{
|
|
8471
8712
|
value: groupField ?? "",
|
|
8472
8713
|
onValueChange: (d) => change({ ...query, groupBy: d.value ? { field: d.value, aggregates: [] } : null }),
|
|
8473
8714
|
children: [
|
|
8474
|
-
/* @__PURE__ */
|
|
8715
|
+
/* @__PURE__ */ jsxs44(Menu5.RadioItem, { value: "", children: [
|
|
8475
8716
|
labels.noGrouping,
|
|
8476
|
-
/* @__PURE__ */
|
|
8717
|
+
/* @__PURE__ */ jsx58(Menu5.ItemIndicator, {})
|
|
8477
8718
|
] }),
|
|
8478
|
-
groupable.map((f) => /* @__PURE__ */
|
|
8719
|
+
groupable.map((f) => /* @__PURE__ */ jsxs44(Menu5.RadioItem, { value: f.id, children: [
|
|
8479
8720
|
f.label,
|
|
8480
|
-
/* @__PURE__ */
|
|
8721
|
+
/* @__PURE__ */ jsx58(Menu5.ItemIndicator, {})
|
|
8481
8722
|
] }, f.id))
|
|
8482
8723
|
]
|
|
8483
8724
|
}
|
|
8484
8725
|
),
|
|
8485
|
-
groupField && groupable.length > 1 && /* @__PURE__ */
|
|
8486
|
-
/* @__PURE__ */
|
|
8487
|
-
/* @__PURE__ */
|
|
8488
|
-
|
|
8726
|
+
groupField && groupable.length > 1 && /* @__PURE__ */ jsxs44(Fragment21, { children: [
|
|
8727
|
+
/* @__PURE__ */ jsx58(Menu5.Separator, {}),
|
|
8728
|
+
/* @__PURE__ */ jsxs44(
|
|
8729
|
+
Menu5.RadioItemGroup,
|
|
8489
8730
|
{
|
|
8490
8731
|
value: thenField ?? "",
|
|
8491
8732
|
onValueChange: (d) => change({ ...query, groupBy: { ...query.groupBy, then: d.value ? { field: d.value } : null } }),
|
|
8492
8733
|
children: [
|
|
8493
|
-
/* @__PURE__ */
|
|
8494
|
-
/* @__PURE__ */
|
|
8734
|
+
/* @__PURE__ */ jsx58(Menu5.ItemGroupLabel, { children: labels.thenBy }),
|
|
8735
|
+
/* @__PURE__ */ jsxs44(Menu5.RadioItem, { value: "", children: [
|
|
8495
8736
|
labels.noSecondGrouping,
|
|
8496
|
-
/* @__PURE__ */
|
|
8737
|
+
/* @__PURE__ */ jsx58(Menu5.ItemIndicator, {})
|
|
8497
8738
|
] }),
|
|
8498
|
-
groupable.filter((f) => f.id !== groupField).map((f) => /* @__PURE__ */
|
|
8739
|
+
groupable.filter((f) => f.id !== groupField).map((f) => /* @__PURE__ */ jsxs44(Menu5.RadioItem, { value: f.id, children: [
|
|
8499
8740
|
f.label,
|
|
8500
|
-
/* @__PURE__ */
|
|
8741
|
+
/* @__PURE__ */ jsx58(Menu5.ItemIndicator, {})
|
|
8501
8742
|
] }, f.id))
|
|
8502
8743
|
]
|
|
8503
8744
|
}
|
|
@@ -8505,15 +8746,29 @@ function QueryableList({
|
|
|
8505
8746
|
] })
|
|
8506
8747
|
] }) }) })
|
|
8507
8748
|
] }),
|
|
8508
|
-
/* @__PURE__ */
|
|
8509
|
-
onExport && !exportTarget && /* @__PURE__ */
|
|
8510
|
-
onExport && exportTarget && createPortal(/* @__PURE__ */
|
|
8749
|
+
/* @__PURE__ */ jsx58(ColumnsPopover, { fields: fields ?? [], columns: state.columns, onChange: (next) => onStateChange({ ...state, rql: result?.rql ?? state.rql, query: void 0, columns: next }) }),
|
|
8750
|
+
onExport && !exportTarget && /* @__PURE__ */ jsx58(ExportMenu, { busy: exporting, disabled: !result || Boolean(loading), onExport: setExportFormat }),
|
|
8751
|
+
onExport && exportTarget && createPortal(/* @__PURE__ */ jsx58(ExportMenu, { busy: exporting, disabled: !result || Boolean(loading), onExport: setExportFormat }), exportTarget),
|
|
8752
|
+
onExport && /* @__PURE__ */ jsx58(
|
|
8753
|
+
ExportDialog,
|
|
8754
|
+
{
|
|
8755
|
+
format: exportFormat,
|
|
8756
|
+
onClose: () => setExportFormat(null),
|
|
8757
|
+
fields: fields ?? [],
|
|
8758
|
+
shown: state.columns,
|
|
8759
|
+
columnLabels,
|
|
8760
|
+
found: total,
|
|
8761
|
+
filtered: Boolean((result?.rql ?? state.rql ?? "").trim()),
|
|
8762
|
+
sample: result?.items ?? [],
|
|
8763
|
+
onExport: (choice) => exportFormat && void runExport(exportFormat, choice)
|
|
8764
|
+
}
|
|
8765
|
+
),
|
|
8511
8766
|
actions
|
|
8512
8767
|
] })
|
|
8513
8768
|
] }),
|
|
8514
|
-
/* @__PURE__ */
|
|
8515
|
-
/* @__PURE__ */
|
|
8516
|
-
/* @__PURE__ */
|
|
8769
|
+
/* @__PURE__ */ jsxs44(HStack12, { gap: "2", align: "start", wrap: "wrap", justify: "space-between", px: "2.5", py: "2", children: [
|
|
8770
|
+
/* @__PURE__ */ jsxs44(HStack12, { gap: "2", align: "start", wrap: "wrap", flex: "1", minW: { base: "full", md: "0" }, children: [
|
|
8771
|
+
/* @__PURE__ */ jsx58(
|
|
8517
8772
|
SegmentedControl,
|
|
8518
8773
|
{
|
|
8519
8774
|
size: "sm",
|
|
@@ -8526,14 +8781,14 @@ function QueryableList({
|
|
|
8526
8781
|
]
|
|
8527
8782
|
}
|
|
8528
8783
|
),
|
|
8529
|
-
mode === "basic" && conditions !== null ? /* @__PURE__ */
|
|
8530
|
-
search && /* @__PURE__ */
|
|
8531
|
-
/* @__PURE__ */
|
|
8784
|
+
mode === "basic" && conditions !== null ? /* @__PURE__ */ jsxs44(HStack12, { gap: "2", wrap: "wrap", flex: "1", minW: "0", children: [
|
|
8785
|
+
search && /* @__PURE__ */ jsx58(QuickSearch, { initial: searchText, placeholder: search.placeholder ?? labels.searchPlaceholder, onRun: runSearch }, searchText),
|
|
8786
|
+
/* @__PURE__ */ jsxs44(AddButton, { onClick: () => setAdding(true), disabled: !fields, "data-add-filter": "", children: [
|
|
8532
8787
|
labels.addFilter,
|
|
8533
|
-
chips.length > 0 && /* @__PURE__ */
|
|
8788
|
+
chips.length > 0 && /* @__PURE__ */ jsx58(CountBadge, { value: chips.length, tone: "accent" })
|
|
8534
8789
|
] }),
|
|
8535
|
-
sortable.length > 0 && /* @__PURE__ */
|
|
8536
|
-
/* @__PURE__ */
|
|
8790
|
+
sortable.length > 0 && /* @__PURE__ */ jsxs44(HStack12, { gap: "1", flexShrink: 0, children: [
|
|
8791
|
+
/* @__PURE__ */ jsx58(
|
|
8537
8792
|
SelectField,
|
|
8538
8793
|
{
|
|
8539
8794
|
width: "auto",
|
|
@@ -8548,7 +8803,7 @@ function QueryableList({
|
|
|
8548
8803
|
]
|
|
8549
8804
|
}
|
|
8550
8805
|
),
|
|
8551
|
-
sort && /* @__PURE__ */
|
|
8806
|
+
sort && /* @__PURE__ */ jsx58(
|
|
8552
8807
|
IconButton,
|
|
8553
8808
|
{
|
|
8554
8809
|
size: "sm",
|
|
@@ -8556,11 +8811,11 @@ function QueryableList({
|
|
|
8556
8811
|
"aria-label": sort.direction === "desc" ? labels.sortDescending : labels.sortAscending,
|
|
8557
8812
|
title: sort.direction === "desc" ? labels.sortDescending : labels.sortAscending,
|
|
8558
8813
|
onClick: () => change({ ...query, orderBy: [{ field: sort.columnId, desc: sort.direction !== "desc" }] }),
|
|
8559
|
-
children: sort.direction === "desc" ? /* @__PURE__ */
|
|
8814
|
+
children: sort.direction === "desc" ? /* @__PURE__ */ jsx58(ArrowDownWideNarrow, {}) : /* @__PURE__ */ jsx58(ArrowUpNarrowWide, {})
|
|
8560
8815
|
}
|
|
8561
8816
|
)
|
|
8562
8817
|
] })
|
|
8563
|
-
] }) : /* @__PURE__ */
|
|
8818
|
+
] }) : /* @__PURE__ */ jsx58(
|
|
8564
8819
|
RqlBox,
|
|
8565
8820
|
{
|
|
8566
8821
|
initial: state.rql ?? result?.rql ?? "",
|
|
@@ -8571,11 +8826,11 @@ function QueryableList({
|
|
|
8571
8826
|
state.rql ?? result?.rql ?? ""
|
|
8572
8827
|
)
|
|
8573
8828
|
] }),
|
|
8574
|
-
attention != null && /* @__PURE__ */
|
|
8829
|
+
attention != null && /* @__PURE__ */ jsx58(HStack12, { gap: "2", wrap: "wrap", flexShrink: 0, children: attention })
|
|
8575
8830
|
] }),
|
|
8576
|
-
mode === "basic" && conditions !== null && chips.length > 0 && /* @__PURE__ */
|
|
8577
|
-
chips.map(({ c: c2, i }) => /* @__PURE__ */
|
|
8578
|
-
|
|
8831
|
+
mode === "basic" && conditions !== null && chips.length > 0 && /* @__PURE__ */ jsxs44(HStack12, { gap: "2", wrap: "wrap", px: "2.5", py: "2", borderTopWidth: "1px", borderColor: "border.muted", "data-filter-chips": "", children: [
|
|
8832
|
+
chips.map(({ c: c2, i }) => /* @__PURE__ */ jsxs44(
|
|
8833
|
+
chakra35.span,
|
|
8579
8834
|
{
|
|
8580
8835
|
display: "inline-flex",
|
|
8581
8836
|
alignItems: "center",
|
|
@@ -8589,17 +8844,17 @@ function QueryableList({
|
|
|
8589
8844
|
bg: "bg.selected",
|
|
8590
8845
|
textStyle: "sm",
|
|
8591
8846
|
children: [
|
|
8592
|
-
/* @__PURE__ */
|
|
8593
|
-
/* @__PURE__ */
|
|
8594
|
-
!NO_VALUE_OPS.has(c2.op) && /* @__PURE__ */
|
|
8595
|
-
/* @__PURE__ */
|
|
8847
|
+
/* @__PURE__ */ jsx58(Text19, { as: "span", fontWeight: "medium", children: label(c2.field) }),
|
|
8848
|
+
/* @__PURE__ */ jsx58(Text19, { as: "span", color: "fg.muted", children: opLabel(c2.op, c2.field) }),
|
|
8849
|
+
!NO_VALUE_OPS.has(c2.op) && /* @__PURE__ */ jsx58(Text19, { as: "span", children: valueText(c2.value) }),
|
|
8850
|
+
/* @__PURE__ */ jsx58(IconButton, { size: "xs", variant: "ghost", "aria-label": fill4(labels.removeFilter, { field: label(c2.field) }), onClick: () => setConditions(conditions.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx58(X2, {}) })
|
|
8596
8851
|
]
|
|
8597
8852
|
},
|
|
8598
8853
|
`${c2.field}-${i}`
|
|
8599
8854
|
)),
|
|
8600
|
-
/* @__PURE__ */
|
|
8855
|
+
/* @__PURE__ */ jsx58(Button, { size: "xs", variant: "ghost", onClick: () => setConditions(searching >= 0 ? [conditions[searching]] : []), children: labels.clearAll })
|
|
8601
8856
|
] }),
|
|
8602
|
-
adding && fields && conditions !== null && /* @__PURE__ */
|
|
8857
|
+
adding && fields && conditions !== null && /* @__PURE__ */ jsx58(
|
|
8603
8858
|
FilterBuilderDialog,
|
|
8604
8859
|
{
|
|
8605
8860
|
fields,
|
|
@@ -8614,26 +8869,26 @@ function QueryableList({
|
|
|
8614
8869
|
}
|
|
8615
8870
|
}
|
|
8616
8871
|
),
|
|
8617
|
-
toolbarFooter != null && /* @__PURE__ */
|
|
8872
|
+
toolbarFooter != null && /* @__PURE__ */ jsx58(chakra35.div, { borderTopWidth: "1px", borderColor: "border.muted", "data-toolbar-footer": "", children: toolbarFooter })
|
|
8618
8873
|
] }),
|
|
8619
|
-
mode === "basic" && error && !(loadFailed != null && error.failed && !result) && /* @__PURE__ */
|
|
8620
|
-
exported && /* @__PURE__ */
|
|
8621
|
-
/* @__PURE__ */
|
|
8622
|
-
/* @__PURE__ */
|
|
8874
|
+
mode === "basic" && error && !(loadFailed != null && error.failed && !result) && /* @__PURE__ */ jsx58(InlineAlert, { tone: "danger", children: error.message }),
|
|
8875
|
+
exported && /* @__PURE__ */ jsx58(InlineAlert, { tone: exported.tone, title: exported.tone === "danger" ? labels.exportFailed : void 0, children: /* @__PURE__ */ jsxs44(HStack12, { justify: "space-between", gap: "2", align: "start", children: [
|
|
8876
|
+
/* @__PURE__ */ jsx58(Text19, { as: "span", children: exported.message }),
|
|
8877
|
+
/* @__PURE__ */ jsx58(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.dismiss, onClick: () => setExported(null), children: /* @__PURE__ */ jsx58(X2, {}) })
|
|
8623
8878
|
] }) }),
|
|
8624
|
-
/* @__PURE__ */
|
|
8879
|
+
/* @__PURE__ */ jsx58(
|
|
8625
8880
|
Panel,
|
|
8626
8881
|
{
|
|
8627
8882
|
flush: true,
|
|
8628
8883
|
footer: (
|
|
8629
8884
|
// Expand and collapse at the start, the pages in the middle (the canvas's v12, UI round 9 step 67, round 10 step 73),
|
|
8630
8885
|
// the range at the end, or with the arrows in the simple form.
|
|
8631
|
-
/* @__PURE__ */
|
|
8632
|
-
/* @__PURE__ */
|
|
8633
|
-
/* @__PURE__ */
|
|
8634
|
-
/* @__PURE__ */
|
|
8886
|
+
/* @__PURE__ */ jsxs44(chakra35.div, { display: "grid", w: "full", gridTemplateColumns: { base: "1fr", md: "1fr auto 1fr" }, alignItems: "center", gap: "3", children: [
|
|
8887
|
+
/* @__PURE__ */ jsx58(HStack12, { gap: "3", children: grouped && /* @__PURE__ */ jsxs44(Fragment21, { children: [
|
|
8888
|
+
/* @__PURE__ */ jsx58(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: folded.size === 0, onClick: () => setFolded(/* @__PURE__ */ new Set()), children: labels.expandAll }),
|
|
8889
|
+
/* @__PURE__ */ jsx58(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: groupKeys.every((k) => folded.has(k)), onClick: () => setFolded(new Set(groupKeys)), children: labels.collapseAll })
|
|
8635
8890
|
] }) }),
|
|
8636
|
-
/* @__PURE__ */
|
|
8891
|
+
/* @__PURE__ */ jsx58(
|
|
8637
8892
|
Pagination,
|
|
8638
8893
|
{
|
|
8639
8894
|
page: Math.floor(skip / take) + 1,
|
|
@@ -8649,10 +8904,10 @@ function QueryableList({
|
|
|
8649
8904
|
pageOf: fill4(labels.pageOf, { page: fmt.number(Math.floor(skip / take) + 1), pages: fmt.number(Math.max(1, Math.ceil(total / take))) })
|
|
8650
8905
|
}
|
|
8651
8906
|
),
|
|
8652
|
-
/* @__PURE__ */
|
|
8907
|
+
/* @__PURE__ */ jsx58(Text19, { textStyle: "caption", color: "fg.muted", textAlign: { md: "end" }, fontVariantNumeric: "tabular-nums", "aria-live": "polite", children: result && pagination !== "simple" ? fill4(labels.range, { from: fmt.number(from), to: fmt.number(to), total: fmt.number(total) }) : " " })
|
|
8653
8908
|
] })
|
|
8654
8909
|
),
|
|
8655
|
-
children: layout === "cards" && cards ? /* @__PURE__ */
|
|
8910
|
+
children: layout === "cards" && cards ? /* @__PURE__ */ jsx58(
|
|
8656
8911
|
CardGrid,
|
|
8657
8912
|
{
|
|
8658
8913
|
"aria-label": ariaLabel,
|
|
@@ -8663,7 +8918,7 @@ function QueryableList({
|
|
|
8663
8918
|
render: cards.render,
|
|
8664
8919
|
empty: loadFailed != null && error?.failed && !result ? loadFailed : empty ?? labels.empty
|
|
8665
8920
|
}
|
|
8666
|
-
) : /* @__PURE__ */
|
|
8921
|
+
) : /* @__PURE__ */ jsx58(
|
|
8667
8922
|
DataTable,
|
|
8668
8923
|
{
|
|
8669
8924
|
"aria-label": ariaLabel,
|
|
@@ -8709,11 +8964,11 @@ function QueryableList({
|
|
|
8709
8964
|
const label2 = thenField ? info?.then?.label : info?.label;
|
|
8710
8965
|
const value = thenField ? info?.then?.value ?? null : info?.value ?? null;
|
|
8711
8966
|
const period = thenField ? query.groupBy?.then?.period : query.groupBy?.period;
|
|
8712
|
-
return /* @__PURE__ */
|
|
8713
|
-
/* @__PURE__ */
|
|
8714
|
-
/* @__PURE__ */
|
|
8967
|
+
return /* @__PURE__ */ jsxs44(HStack12, { gap: "2.5", flex: "1", minW: "0", children: [
|
|
8968
|
+
/* @__PURE__ */ jsx58(chakra35.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) }),
|
|
8969
|
+
/* @__PURE__ */ jsx58(CountBadge, { value: info?.count ?? rows2.length }),
|
|
8715
8970
|
!thenField && renderGroupAside?.({ field: groupField, value: info?.value ?? null, label: info?.label ?? "" }),
|
|
8716
|
-
conditions !== null && !period && /* @__PURE__ */
|
|
8971
|
+
conditions !== null && !period && /* @__PURE__ */ jsxs44(
|
|
8717
8972
|
Button,
|
|
8718
8973
|
{
|
|
8719
8974
|
size: "xs",
|
|
@@ -8731,8 +8986,8 @@ function QueryableList({
|
|
|
8731
8986
|
condition(field, value)
|
|
8732
8987
|
]),
|
|
8733
8988
|
children: [
|
|
8734
|
-
/* @__PURE__ */
|
|
8735
|
-
/* @__PURE__ */
|
|
8989
|
+
/* @__PURE__ */ jsx58(Filter, {}),
|
|
8990
|
+
/* @__PURE__ */ jsx58(chakra35.span, { hideBelow: "md", children: labels.filterToGroup })
|
|
8736
8991
|
]
|
|
8737
8992
|
}
|
|
8738
8993
|
)
|
|
@@ -8751,9 +9006,9 @@ function QueryableList({
|
|
|
8751
9006
|
const first = groups[0]?.rows[0];
|
|
8752
9007
|
const raw = first?.values[groupField];
|
|
8753
9008
|
const count = (result?.groups ?? []).filter((g) => groupKey(g.value) === parent).reduce((n, g) => n + g.count, 0);
|
|
8754
|
-
return /* @__PURE__ */
|
|
8755
|
-
/* @__PURE__ */
|
|
8756
|
-
/* @__PURE__ */
|
|
9009
|
+
return /* @__PURE__ */ jsxs44(HStack12, { gap: "2.5", flex: "1", minW: "0", children: [
|
|
9010
|
+
/* @__PURE__ */ jsx58(chakra35.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) }),
|
|
9011
|
+
/* @__PURE__ */ jsx58(CountBadge, { value: count }),
|
|
8757
9012
|
renderGroupAside?.({ field: groupField, value: info?.value ?? null, label: info?.label ?? "" })
|
|
8758
9013
|
] });
|
|
8759
9014
|
}
|
|
@@ -8789,15 +9044,15 @@ function QueryableList({
|
|
|
8789
9044
|
}
|
|
8790
9045
|
function QuickSearch({ initial, placeholder: placeholder2, onRun }) {
|
|
8791
9046
|
const labels = useAbpLabels().queryList;
|
|
8792
|
-
const [text, setText] =
|
|
9047
|
+
const [text, setText] = useState24(initial);
|
|
8793
9048
|
const timer = useRef19(void 0);
|
|
8794
|
-
|
|
9049
|
+
useEffect17(() => () => clearTimeout(timer.current), []);
|
|
8795
9050
|
function later(next) {
|
|
8796
9051
|
clearTimeout(timer.current);
|
|
8797
9052
|
timer.current = setTimeout(() => next.trim() !== initial.trim() && onRun(next), 400);
|
|
8798
9053
|
}
|
|
8799
|
-
return /* @__PURE__ */
|
|
8800
|
-
|
|
9054
|
+
return /* @__PURE__ */ jsx58(
|
|
9055
|
+
chakra35.form,
|
|
8801
9056
|
{
|
|
8802
9057
|
role: "search",
|
|
8803
9058
|
flex: "1",
|
|
@@ -8808,7 +9063,7 @@ function QuickSearch({ initial, placeholder: placeholder2, onRun }) {
|
|
|
8808
9063
|
clearTimeout(timer.current);
|
|
8809
9064
|
if (text.trim() !== initial.trim()) onRun(text);
|
|
8810
9065
|
},
|
|
8811
|
-
children: /* @__PURE__ */
|
|
9066
|
+
children: /* @__PURE__ */ jsx58(
|
|
8812
9067
|
SearchInput,
|
|
8813
9068
|
{
|
|
8814
9069
|
size: "sm",
|
|
@@ -8850,14 +9105,14 @@ function placeholderOf(id, kind) {
|
|
|
8850
9105
|
}
|
|
8851
9106
|
function ExportMenu({ busy, disabled, onExport }) {
|
|
8852
9107
|
const labels = useAbpLabels().queryList;
|
|
8853
|
-
return /* @__PURE__ */
|
|
8854
|
-
/* @__PURE__ */
|
|
8855
|
-
/* @__PURE__ */
|
|
9108
|
+
return /* @__PURE__ */ jsxs44(Menu5.Root, { positioning: { placement: "bottom-end" }, onSelect: (d) => onExport(d.value), children: [
|
|
9109
|
+
/* @__PURE__ */ jsx58(Menu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs44(Button, { size: "sm", variant: "secondary", disabled: disabled || busy, loading: busy, loadingText: labels.exporting, children: [
|
|
9110
|
+
/* @__PURE__ */ jsx58(Download, {}),
|
|
8856
9111
|
labels.export
|
|
8857
9112
|
] }) }),
|
|
8858
|
-
/* @__PURE__ */
|
|
8859
|
-
/* @__PURE__ */
|
|
8860
|
-
/* @__PURE__ */
|
|
9113
|
+
/* @__PURE__ */ jsx58(Portal17, { children: /* @__PURE__ */ jsx58(Menu5.Positioner, { children: /* @__PURE__ */ jsxs44(Menu5.Content, { minW: "48", children: [
|
|
9114
|
+
/* @__PURE__ */ jsx58(Menu5.Item, { value: "csv", children: labels.exportCsv }),
|
|
9115
|
+
/* @__PURE__ */ jsx58(Menu5.Item, { value: "xlsx", children: labels.exportExcel })
|
|
8861
9116
|
] }) }) })
|
|
8862
9117
|
] });
|
|
8863
9118
|
}
|
|
@@ -8868,14 +9123,14 @@ function RqlBox({
|
|
|
8868
9123
|
onRun
|
|
8869
9124
|
}) {
|
|
8870
9125
|
const labels = useAbpLabels().queryList;
|
|
8871
|
-
const [text, setText] =
|
|
8872
|
-
const [found, setFound] =
|
|
8873
|
-
const [active, setActive] =
|
|
8874
|
-
const [open, setOpen] =
|
|
9126
|
+
const [text, setText] = useState24(initial);
|
|
9127
|
+
const [found, setFound] = useState24(null);
|
|
9128
|
+
const [active, setActive] = useState24(0);
|
|
9129
|
+
const [open, setOpen] = useState24(false);
|
|
8875
9130
|
const input = useRef19(null);
|
|
8876
9131
|
const timer = useRef19(void 0);
|
|
8877
9132
|
const seq = useRef19(0);
|
|
8878
|
-
const listId =
|
|
9133
|
+
const listId = useId9();
|
|
8879
9134
|
function ask(value, caret) {
|
|
8880
9135
|
if (!suggest) return;
|
|
8881
9136
|
clearTimeout(timer.current);
|
|
@@ -8889,7 +9144,7 @@ function RqlBox({
|
|
|
8889
9144
|
}).catch(() => setOpen(false));
|
|
8890
9145
|
}, 120);
|
|
8891
9146
|
}
|
|
8892
|
-
|
|
9147
|
+
useEffect17(() => () => clearTimeout(timer.current), []);
|
|
8893
9148
|
function accept(item) {
|
|
8894
9149
|
if (!found) return;
|
|
8895
9150
|
const before = text.slice(0, found.replaceStart);
|
|
@@ -8937,9 +9192,9 @@ function RqlBox({
|
|
|
8937
9192
|
}
|
|
8938
9193
|
}
|
|
8939
9194
|
const hasSpan = error?.start != null && error.end != null && error.end >= error.start && error.end <= text.length;
|
|
8940
|
-
return /* @__PURE__ */
|
|
8941
|
-
/* @__PURE__ */
|
|
8942
|
-
/* @__PURE__ */
|
|
9195
|
+
return /* @__PURE__ */ jsxs44(Stack14, { gap: "1.5", flex: "1", minW: "0", position: "relative", children: [
|
|
9196
|
+
/* @__PURE__ */ jsxs44(HStack12, { gap: "2", children: [
|
|
9197
|
+
/* @__PURE__ */ jsx58(
|
|
8943
9198
|
Input7,
|
|
8944
9199
|
{
|
|
8945
9200
|
ref: input,
|
|
@@ -8965,9 +9220,9 @@ function RqlBox({
|
|
|
8965
9220
|
onKeyDown
|
|
8966
9221
|
}
|
|
8967
9222
|
),
|
|
8968
|
-
/* @__PURE__ */
|
|
9223
|
+
/* @__PURE__ */ jsx58(Button, { size: "sm", variant: "primary", onClick: () => onRun(text.trim()), children: labels.run })
|
|
8969
9224
|
] }),
|
|
8970
|
-
open && found && /* @__PURE__ */
|
|
9225
|
+
open && found && /* @__PURE__ */ jsx58(
|
|
8971
9226
|
Box12,
|
|
8972
9227
|
{
|
|
8973
9228
|
id: listId,
|
|
@@ -8986,7 +9241,7 @@ function RqlBox({
|
|
|
8986
9241
|
borderRadius: "md",
|
|
8987
9242
|
boxShadow: "md",
|
|
8988
9243
|
py: "1",
|
|
8989
|
-
children: found.items.map((item, i) => /* @__PURE__ */
|
|
9244
|
+
children: found.items.map((item, i) => /* @__PURE__ */ jsxs44(
|
|
8990
9245
|
HStack12,
|
|
8991
9246
|
{
|
|
8992
9247
|
id: `${listId}-${i}`,
|
|
@@ -9004,28 +9259,28 @@ function RqlBox({
|
|
|
9004
9259
|
},
|
|
9005
9260
|
onMouseEnter: () => setActive(i),
|
|
9006
9261
|
children: [
|
|
9007
|
-
/* @__PURE__ */
|
|
9008
|
-
/* @__PURE__ */
|
|
9262
|
+
/* @__PURE__ */ jsx58(Text19, { 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 }),
|
|
9263
|
+
/* @__PURE__ */ jsx58(Text19, { 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 })
|
|
9009
9264
|
]
|
|
9010
9265
|
},
|
|
9011
9266
|
`${item.kind}-${item.text}`
|
|
9012
9267
|
))
|
|
9013
9268
|
}
|
|
9014
9269
|
),
|
|
9015
|
-
error && /* @__PURE__ */
|
|
9270
|
+
error && /* @__PURE__ */ jsxs44(InlineAlert, { tone: "danger", size: "sm", children: [
|
|
9016
9271
|
error.message,
|
|
9017
|
-
hasSpan && /* @__PURE__ */
|
|
9272
|
+
hasSpan && /* @__PURE__ */ jsxs44(chakra35.code, { display: "block", mt: "1", fontFamily: "mono", whiteSpace: "pre-wrap", children: [
|
|
9018
9273
|
text.slice(0, error.start),
|
|
9019
|
-
/* @__PURE__ */
|
|
9274
|
+
/* @__PURE__ */ jsx58(chakra35.mark, { bg: "red.subtle", color: "fg", textDecoration: "underline wavy", textDecorationColor: "fg.error", children: text.slice(error.start, error.end) || " " }),
|
|
9020
9275
|
text.slice(error.end)
|
|
9021
9276
|
] })
|
|
9022
9277
|
] })
|
|
9023
9278
|
] });
|
|
9024
9279
|
}
|
|
9025
9280
|
function CardGrid({ rows: rows2, loading, count, minWidth, render: render2, empty, "aria-label": label }) {
|
|
9026
|
-
if (rows2 && rows2.length === 0 && !loading) return typeof empty === "string" ? /* @__PURE__ */
|
|
9027
|
-
return /* @__PURE__ */
|
|
9028
|
-
|
|
9281
|
+
if (rows2 && rows2.length === 0 && !loading) return typeof empty === "string" ? /* @__PURE__ */ jsx58(EmptyState, { title: empty }) : /* @__PURE__ */ jsx58(Fragment21, { children: empty });
|
|
9282
|
+
return /* @__PURE__ */ jsx58(
|
|
9283
|
+
chakra35.ul,
|
|
9029
9284
|
{
|
|
9030
9285
|
role: "list",
|
|
9031
9286
|
"aria-label": label,
|
|
@@ -9037,21 +9292,21 @@ function CardGrid({ rows: rows2, loading, count, minWidth, render: render2, empt
|
|
|
9037
9292
|
gap: "3",
|
|
9038
9293
|
gridTemplateColumns: `repeat(auto-fill, minmax(min(${minWidth}, 100%), 1fr))`,
|
|
9039
9294
|
"data-layout": "cards",
|
|
9040
|
-
children: rows2 ? rows2.map((row) => /* @__PURE__ */
|
|
9295
|
+
children: rows2 ? rows2.map((row) => /* @__PURE__ */ jsx58(chakra35.li, { display: "flex", minW: "0", children: render2(row) }, row.id)) : Array.from({ length: Math.min(count, 9) }, (_, i) => /* @__PURE__ */ jsx58(chakra35.li, { h: "9.5rem", rounded: "lg", bg: "bg.subtle", "aria-hidden": true }, i))
|
|
9041
9296
|
}
|
|
9042
9297
|
);
|
|
9043
9298
|
}
|
|
9044
9299
|
|
|
9045
9300
|
// src/components/FileDrop.tsx
|
|
9046
9301
|
import { forwardRef as forwardRef9, useLayoutEffect as useLayoutEffect4, useRef as useRef20 } from "react";
|
|
9047
|
-
import { Box as Box13, HStack as HStack13, Portal as
|
|
9302
|
+
import { Box as Box13, HStack as HStack13, Portal as Portal18, Text as Text20 } from "@chakra-ui/react";
|
|
9048
9303
|
import { ArrowDownToLine } from "lucide-react";
|
|
9049
|
-
import { jsx as
|
|
9304
|
+
import { jsx as jsx59, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9050
9305
|
var OUT3 = `cubic-bezier(${curves.out.join(", ")})`;
|
|
9051
9306
|
var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: over2 = false, hint, children, ...rest }, ref) {
|
|
9052
9307
|
const { reduce } = useMotionSetting();
|
|
9053
9308
|
const lit = awake || over2;
|
|
9054
|
-
return /* @__PURE__ */
|
|
9309
|
+
return /* @__PURE__ */ jsxs45(
|
|
9055
9310
|
Box13,
|
|
9056
9311
|
{
|
|
9057
9312
|
ref,
|
|
@@ -9070,7 +9325,7 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
9070
9325
|
...rest,
|
|
9071
9326
|
children: [
|
|
9072
9327
|
children,
|
|
9073
|
-
/* @__PURE__ */
|
|
9328
|
+
/* @__PURE__ */ jsx59(Presence, { show: lit, from: "fade", position: "absolute", inset: "0", rounded: "l2", zIndex: "1", pointerEvents: "none", children: /* @__PURE__ */ jsxs45(
|
|
9074
9329
|
HStack13,
|
|
9075
9330
|
{
|
|
9076
9331
|
h: "full",
|
|
@@ -9084,8 +9339,8 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
9084
9339
|
textAlign: "center",
|
|
9085
9340
|
style: { transition: "background-color 160ms ease" },
|
|
9086
9341
|
children: [
|
|
9087
|
-
/* @__PURE__ */
|
|
9088
|
-
/* @__PURE__ */
|
|
9342
|
+
/* @__PURE__ */ jsx59(Bob, { active: over2 && !reduce }),
|
|
9343
|
+
/* @__PURE__ */ jsx59(Text20, { as: "span", truncate: true, children: hint })
|
|
9089
9344
|
]
|
|
9090
9345
|
}
|
|
9091
9346
|
) })
|
|
@@ -9104,59 +9359,59 @@ function Bob({ active }) {
|
|
|
9104
9359
|
});
|
|
9105
9360
|
return () => animation?.cancel();
|
|
9106
9361
|
}, [active]);
|
|
9107
|
-
return /* @__PURE__ */
|
|
9362
|
+
return /* @__PURE__ */ jsx59(Box13, { as: "span", ref, display: "inline-flex", flexShrink: 0, _icon: { boxSize: "4" }, children: /* @__PURE__ */ jsx59(ArrowDownToLine, {}) });
|
|
9108
9363
|
}
|
|
9109
9364
|
function DropHint({ show, children }) {
|
|
9110
|
-
return /* @__PURE__ */
|
|
9111
|
-
/* @__PURE__ */
|
|
9112
|
-
/* @__PURE__ */
|
|
9365
|
+
return /* @__PURE__ */ jsx59(Portal18, { children: /* @__PURE__ */ jsx59(Box13, { position: "fixed", insetInline: "0", bottom: "6", display: "flex", justifyContent: "center", pointerEvents: "none", zIndex: "toast", px: "4", children: /* @__PURE__ */ jsx59(Presence, { show, from: "rise", children: /* @__PURE__ */ jsxs45(HStack13, { 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: [
|
|
9366
|
+
/* @__PURE__ */ jsx59(ArrowDownToLine, {}),
|
|
9367
|
+
/* @__PURE__ */ jsx59(Text20, { as: "span", truncate: true, children })
|
|
9113
9368
|
] }) }) }) });
|
|
9114
9369
|
}
|
|
9115
9370
|
|
|
9116
9371
|
// src/components/UploadList.tsx
|
|
9117
9372
|
import { useLayoutEffect as useLayoutEffect5, useRef as useRef21 } from "react";
|
|
9118
|
-
import { Box as Box14, chakra as
|
|
9373
|
+
import { Box as Box14, chakra as chakra36, HStack as HStack14, Stack as Stack15, Text as Text21 } from "@chakra-ui/react";
|
|
9119
9374
|
import { Check as Check3, File as FileIcon, RotateCcw, TriangleAlert, X as X3 } from "lucide-react";
|
|
9120
|
-
import { jsx as
|
|
9375
|
+
import { jsx as jsx60, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
9121
9376
|
var OUT4 = `cubic-bezier(${curves.out.join(", ")})`;
|
|
9122
9377
|
function UploadList({ rows: rows2, summary, fraction, announce, labels, onCancel, onRetry, onDismiss }) {
|
|
9123
|
-
return /* @__PURE__ */
|
|
9124
|
-
/* @__PURE__ */
|
|
9125
|
-
rows2.length > 0 && summary != null && /* @__PURE__ */
|
|
9126
|
-
/* @__PURE__ */
|
|
9127
|
-
fraction != null && /* @__PURE__ */
|
|
9378
|
+
return /* @__PURE__ */ jsxs46(Stack15, { gap: "2", "data-testid": "upload-list", children: [
|
|
9379
|
+
/* @__PURE__ */ jsx60(chakra36.span, { srOnly: true, "aria-live": "polite", children: announce }),
|
|
9380
|
+
rows2.length > 0 && summary != null && /* @__PURE__ */ jsxs46(Stack15, { gap: "1", children: [
|
|
9381
|
+
/* @__PURE__ */ jsx60(Text21, { textStyle: "caption", color: "fg.muted", children: summary }),
|
|
9382
|
+
fraction != null && /* @__PURE__ */ jsx60(Bar2, { fraction, tone: "accent", label: typeof summary === "string" ? summary : void 0 })
|
|
9128
9383
|
] }),
|
|
9129
|
-
/* @__PURE__ */
|
|
9384
|
+
/* @__PURE__ */ jsx60(Stack15, { gap: "1.5", position: "relative", children: /* @__PURE__ */ jsx60(PresenceList, { children: rows2.map((row) => /* @__PURE__ */ jsx60(PresenceItem, { children: /* @__PURE__ */ jsx60(Row, { row, labels, onCancel, onRetry, onDismiss }) }, row.id)) }) })
|
|
9130
9385
|
] });
|
|
9131
9386
|
}
|
|
9132
9387
|
function Row({ row, labels, onCancel, onRetry, onDismiss }) {
|
|
9133
9388
|
const going = row.state === "waiting" || row.state === "sending";
|
|
9134
9389
|
const trouble = row.state === "failed" || row.state === "refused";
|
|
9135
|
-
return /* @__PURE__ */
|
|
9136
|
-
/* @__PURE__ */
|
|
9137
|
-
/* @__PURE__ */
|
|
9138
|
-
/* @__PURE__ */
|
|
9139
|
-
/* @__PURE__ */
|
|
9140
|
-
/* @__PURE__ */
|
|
9390
|
+
return /* @__PURE__ */ jsxs46(HStack14, { 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: [
|
|
9391
|
+
/* @__PURE__ */ jsx60(Preview, { src: row.preview }),
|
|
9392
|
+
/* @__PURE__ */ jsxs46(Stack15, { gap: "1", flex: "1", minW: "0", children: [
|
|
9393
|
+
/* @__PURE__ */ jsxs46(HStack14, { gap: "2", justify: "space-between", children: [
|
|
9394
|
+
/* @__PURE__ */ jsx60(Text21, { as: "span", fontWeight: "medium", truncate: true, children: /* @__PURE__ */ jsx60("bdi", { children: row.name }) }),
|
|
9395
|
+
/* @__PURE__ */ jsx60(Text21, { as: "span", textStyle: "caption", color: trouble ? "fg.error" : "fg.muted", flexShrink: 0, fontVariantNumeric: "tabular-nums", children: row.state === "done" ? /* @__PURE__ */ jsx60(Done, {}) : row.status })
|
|
9141
9396
|
] }),
|
|
9142
|
-
(going || row.state === "done") && /* @__PURE__ */
|
|
9143
|
-
row.detail != null && /* @__PURE__ */
|
|
9144
|
-
trouble && /* @__PURE__ */
|
|
9397
|
+
(going || row.state === "done") && /* @__PURE__ */ jsx60(Bar2, { fraction: row.state === "done" ? 1 : row.fraction, tone: row.state === "done" ? "success" : "accent", label: row.name, quiet: row.state === "waiting" }),
|
|
9398
|
+
row.detail != null && /* @__PURE__ */ jsxs46(Text21, { as: "span", textStyle: "caption", color: trouble ? "fg.error" : "fg.muted", truncate: true, children: [
|
|
9399
|
+
trouble && /* @__PURE__ */ jsx60(Box14, { as: "span", display: "inline-flex", verticalAlign: "-0.15em", me: "1", _icon: { boxSize: "3.5" }, children: /* @__PURE__ */ jsx60(TriangleAlert, {}) }),
|
|
9145
9400
|
row.detail
|
|
9146
9401
|
] })
|
|
9147
9402
|
] }),
|
|
9148
|
-
going && /* @__PURE__ */
|
|
9149
|
-
row.state === "failed" && /* @__PURE__ */
|
|
9150
|
-
trouble && /* @__PURE__ */
|
|
9403
|
+
going && /* @__PURE__ */ jsx60(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.cancel(row.name), onClick: () => onCancel(row.id), children: /* @__PURE__ */ jsx60(X3, {}) }),
|
|
9404
|
+
row.state === "failed" && /* @__PURE__ */ jsx60(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.retry(row.name), onClick: () => onRetry(row.id), children: /* @__PURE__ */ jsx60(RotateCcw, {}) }),
|
|
9405
|
+
trouble && /* @__PURE__ */ jsx60(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.dismiss(row.name), onClick: () => onDismiss(row.id), children: /* @__PURE__ */ jsx60(X3, {}) })
|
|
9151
9406
|
] });
|
|
9152
9407
|
}
|
|
9153
9408
|
function Preview({ src }) {
|
|
9154
|
-
return /* @__PURE__ */
|
|
9409
|
+
return /* @__PURE__ */ jsx60(Box14, { boxSize: "8", flexShrink: 0, rounded: "l1", overflow: "hidden", bg: "bg.muted", color: "fg.subtle", display: "grid", placeItems: "center", _icon: { boxSize: "4" }, children: src ? /* @__PURE__ */ jsx60(chakra36.img, { src, alt: "", boxSize: "full", objectFit: "cover" }) : /* @__PURE__ */ jsx60(FileIcon, {}) });
|
|
9155
9410
|
}
|
|
9156
9411
|
function Bar2({ fraction, tone, label, quiet: quiet2 }) {
|
|
9157
9412
|
const { reduce } = useMotionSetting();
|
|
9158
9413
|
const percent = Math.round(Math.max(0, Math.min(1, fraction)) * 100);
|
|
9159
|
-
return /* @__PURE__ */
|
|
9414
|
+
return /* @__PURE__ */ jsx60(Box14, { 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__ */ jsx60(
|
|
9160
9415
|
Box14,
|
|
9161
9416
|
{
|
|
9162
9417
|
h: "full",
|
|
@@ -9183,11 +9438,11 @@ function Done() {
|
|
|
9183
9438
|
{ duration: 260, easing: OUT4 }
|
|
9184
9439
|
);
|
|
9185
9440
|
}, []);
|
|
9186
|
-
return /* @__PURE__ */
|
|
9441
|
+
return /* @__PURE__ */ jsx60(chakra36.span, { ref, display: "inline-grid", placeItems: "center", boxSize: "4", rounded: "full", bg: "fg.success", color: "bg", _icon: { boxSize: "3" }, children: /* @__PURE__ */ jsx60(Check3, { strokeWidth: 3 }) });
|
|
9187
9442
|
}
|
|
9188
9443
|
|
|
9189
9444
|
// src/files/drop.ts
|
|
9190
|
-
import { useEffect as
|
|
9445
|
+
import { useEffect as useEffect18, useRef as useRef22, useState as useState25, useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
9191
9446
|
|
|
9192
9447
|
// src/files/upload-plan.ts
|
|
9193
9448
|
var UPLOADS_AT_ONCE = 3;
|
|
@@ -9346,12 +9601,12 @@ function droppedFiles(data) {
|
|
|
9346
9601
|
return Promise.resolve(Array.from(data.files).filter((f) => !JUNK.test(f.name)).map((file) => ({ file, path: file.name })));
|
|
9347
9602
|
}
|
|
9348
9603
|
function useDropZone(ref, { enabled = true, onFiles }) {
|
|
9349
|
-
const [state, setState] =
|
|
9604
|
+
const [state, setState] = useState25({ over: false, part: null });
|
|
9350
9605
|
const take = useRef22(onFiles);
|
|
9351
|
-
|
|
9606
|
+
useEffect18(() => {
|
|
9352
9607
|
take.current = onFiles;
|
|
9353
9608
|
}, [onFiles]);
|
|
9354
|
-
|
|
9609
|
+
useEffect18(() => {
|
|
9355
9610
|
const zone = ref.current;
|
|
9356
9611
|
if (!zone || !enabled) return;
|
|
9357
9612
|
let depth = 0;
|
|
@@ -9399,10 +9654,10 @@ function useDropZone(ref, { enabled = true, onFiles }) {
|
|
|
9399
9654
|
}
|
|
9400
9655
|
function usePageDrop({ enabled = true, onFiles }) {
|
|
9401
9656
|
const take = useRef22(onFiles);
|
|
9402
|
-
|
|
9657
|
+
useEffect18(() => {
|
|
9403
9658
|
take.current = onFiles;
|
|
9404
9659
|
}, [onFiles]);
|
|
9405
|
-
|
|
9660
|
+
useEffect18(() => {
|
|
9406
9661
|
if (!enabled) return;
|
|
9407
9662
|
const move = (e) => {
|
|
9408
9663
|
if (!isFiles(e)) return;
|
|
@@ -9425,10 +9680,10 @@ function usePageDrop({ enabled = true, onFiles }) {
|
|
|
9425
9680
|
var editable = (target) => target instanceof HTMLElement && (target.isContentEditable || target.closest('input, textarea, select, [contenteditable=""], [contenteditable=true]') != null);
|
|
9426
9681
|
function usePastedFiles({ enabled = true, onFiles }) {
|
|
9427
9682
|
const take = useRef22(onFiles);
|
|
9428
|
-
|
|
9683
|
+
useEffect18(() => {
|
|
9429
9684
|
take.current = onFiles;
|
|
9430
9685
|
}, [onFiles]);
|
|
9431
|
-
|
|
9686
|
+
useEffect18(() => {
|
|
9432
9687
|
if (!enabled) return;
|
|
9433
9688
|
const paste = (e) => {
|
|
9434
9689
|
const data = e.clipboardData;
|
|
@@ -9453,8 +9708,8 @@ function usePastedFiles({ enabled = true, onFiles }) {
|
|
|
9453
9708
|
}
|
|
9454
9709
|
|
|
9455
9710
|
// src/components/SortableSections.tsx
|
|
9456
|
-
import { useMemo as
|
|
9457
|
-
import { Box as Box15, Stack as
|
|
9711
|
+
import { useMemo as useMemo14, useState as useState26 } from "react";
|
|
9712
|
+
import { Box as Box15, Stack as Stack16, Text as Text22 } from "@chakra-ui/react";
|
|
9458
9713
|
import {
|
|
9459
9714
|
DndContext as DndContext4,
|
|
9460
9715
|
DragOverlay as DragOverlay3,
|
|
@@ -9467,7 +9722,7 @@ import {
|
|
|
9467
9722
|
} from "@dnd-kit/core";
|
|
9468
9723
|
import { SortableContext as SortableContext3, sortableKeyboardCoordinates as sortableKeyboardCoordinates3, useSortable as useSortable3, verticalListSortingStrategy as verticalListSortingStrategy3 } from "@dnd-kit/sortable";
|
|
9469
9724
|
import { CSS as CSS4 } from "@dnd-kit/utilities";
|
|
9470
|
-
import { jsx as
|
|
9725
|
+
import { jsx as jsx61, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
9471
9726
|
var sectionId = (id) => `section:${id}`;
|
|
9472
9727
|
function SortableSections({
|
|
9473
9728
|
"aria-label": ariaLabel,
|
|
@@ -9481,13 +9736,13 @@ function SortableSections({
|
|
|
9481
9736
|
skeletonItemHeight = "9"
|
|
9482
9737
|
}) {
|
|
9483
9738
|
const loading = useLoading(own);
|
|
9484
|
-
const shown = loading && sections.length === 0 ? [0, 1].map((n) => ({ id: `skeleton-${n}`, header: /* @__PURE__ */
|
|
9739
|
+
const shown = loading && sections.length === 0 ? [0, 1].map((n) => ({ id: `skeleton-${n}`, header: /* @__PURE__ */ jsx61(TextBone, { width: boneWidth(n, 14, 22) }), items: [] })) : sections;
|
|
9485
9740
|
const sensors = useSensors4(
|
|
9486
9741
|
useSensor4(PointerSensor4, { activationConstraint: { distance: 6 } }),
|
|
9487
9742
|
useSensor4(KeyboardSensor3, { coordinateGetter: sortableKeyboardCoordinates3 })
|
|
9488
9743
|
);
|
|
9489
|
-
const [active, setActive] =
|
|
9490
|
-
const sectionOf =
|
|
9744
|
+
const [active, setActive] = useState26(null);
|
|
9745
|
+
const sectionOf = useMemo14(() => {
|
|
9491
9746
|
const map = /* @__PURE__ */ new Map();
|
|
9492
9747
|
for (const s of sections) for (const item of s.items) map.set(item.id, s.id);
|
|
9493
9748
|
return map;
|
|
@@ -9517,7 +9772,7 @@ function SortableSections({
|
|
|
9517
9772
|
if (from === target && !move.before && !move.after) return;
|
|
9518
9773
|
onMove(item, move);
|
|
9519
9774
|
}
|
|
9520
|
-
return /* @__PURE__ */
|
|
9775
|
+
return /* @__PURE__ */ jsxs47(
|
|
9521
9776
|
DndContext4,
|
|
9522
9777
|
{
|
|
9523
9778
|
sensors,
|
|
@@ -9527,16 +9782,16 @@ function SortableSections({
|
|
|
9527
9782
|
onDragCancel: () => setActive(null),
|
|
9528
9783
|
accessibility: { announcements, screenReaderInstructions: screenReaderInstructions ? { draggable: screenReaderInstructions } : void 0 },
|
|
9529
9784
|
children: [
|
|
9530
|
-
/* @__PURE__ */
|
|
9531
|
-
loading && s.items.length === 0 && Array.from({ length: skeletonItems }, (_, n) => /* @__PURE__ */
|
|
9532
|
-
/* @__PURE__ */
|
|
9533
|
-
/* @__PURE__ */
|
|
9785
|
+
/* @__PURE__ */ jsx61(Stack16, { role: "region", "aria-label": ariaLabel, gap: "4", children: shown.map((s) => /* @__PURE__ */ jsxs47(Section, { section: s, dragging: !!active, children: [
|
|
9786
|
+
loading && s.items.length === 0 && Array.from({ length: skeletonItems }, (_, n) => /* @__PURE__ */ jsxs47(Box15, { h: skeletonItemHeight, px: "2", display: "flex", alignItems: "center", gap: "3", "aria-hidden": "true", children: [
|
|
9787
|
+
/* @__PURE__ */ jsx61(Bone, { width: "14", height: "4" }),
|
|
9788
|
+
/* @__PURE__ */ jsx61(TextBone, { width: boneWidth(n, 16, 36) })
|
|
9534
9789
|
] }, n)),
|
|
9535
|
-
s.items.map((item) => /* @__PURE__ */
|
|
9536
|
-
!loading && s.items.length === 0 && s.empty && /* @__PURE__ */
|
|
9790
|
+
s.items.map((item) => /* @__PURE__ */ jsx61(SortableItem, { id: item.id, children: (dragging) => renderItem(item, { dragging }) }, item.id)),
|
|
9791
|
+
!loading && s.items.length === 0 && s.empty && /* @__PURE__ */ jsx61(Text22, { textStyle: "caption", color: "fg.subtle", textAlign: "center", py: "4", children: s.empty }),
|
|
9537
9792
|
!loading && s.footer
|
|
9538
9793
|
] }, s.id)) }),
|
|
9539
|
-
/* @__PURE__ */
|
|
9794
|
+
/* @__PURE__ */ jsx61(DragOverlay3, { children: active ? /* @__PURE__ */ jsx61(Box15, { shadow: "lg", rounded: "l2", bg: "bg.panel", children: renderItem(active, { dragging: true }) }) : null })
|
|
9540
9795
|
]
|
|
9541
9796
|
}
|
|
9542
9797
|
);
|
|
@@ -9544,10 +9799,10 @@ function SortableSections({
|
|
|
9544
9799
|
function Section({ section, dragging, children }) {
|
|
9545
9800
|
const id = sectionId(section.id);
|
|
9546
9801
|
const { setNodeRef, isOver } = useDroppable3({ id });
|
|
9547
|
-
return /* @__PURE__ */
|
|
9548
|
-
/* @__PURE__ */
|
|
9549
|
-
/* @__PURE__ */
|
|
9550
|
-
|
|
9802
|
+
return /* @__PURE__ */ jsxs47(Box15, { as: "section", borderWidth: "1px", borderColor: "border", rounded: "l3", bg: "bg.panel", "data-section": section.id, children: [
|
|
9803
|
+
/* @__PURE__ */ jsx61(Box15, { px: "3", py: "2", borderBottomWidth: "1px", borderColor: "border.muted", children: section.header }),
|
|
9804
|
+
/* @__PURE__ */ jsx61(SortableContext3, { id, items: section.items.map((i) => i.id), strategy: verticalListSortingStrategy3, children: /* @__PURE__ */ jsx61(
|
|
9805
|
+
Stack16,
|
|
9551
9806
|
{
|
|
9552
9807
|
ref: setNodeRef,
|
|
9553
9808
|
gap: "0",
|
|
@@ -9563,7 +9818,7 @@ function Section({ section, dragging, children }) {
|
|
|
9563
9818
|
}
|
|
9564
9819
|
function SortableItem({ id, children }) {
|
|
9565
9820
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = useSortable3({ id });
|
|
9566
|
-
return /* @__PURE__ */
|
|
9821
|
+
return /* @__PURE__ */ jsx61(
|
|
9567
9822
|
Box15,
|
|
9568
9823
|
{
|
|
9569
9824
|
ref: setNodeRef,
|
|
@@ -9580,10 +9835,10 @@ function SortableItem({ id, children }) {
|
|
|
9580
9835
|
}
|
|
9581
9836
|
|
|
9582
9837
|
// src/components/TimelineChart.tsx
|
|
9583
|
-
import { Fragment as
|
|
9584
|
-
import { Box as Box16, HStack as HStack15, Popover as Popover4, Portal as
|
|
9838
|
+
import { Fragment as Fragment22, useEffect as useEffect19, useLayoutEffect as useLayoutEffect6, useRef as useRef23, useState as useState27 } from "react";
|
|
9839
|
+
import { Box as Box16, HStack as HStack15, Popover as Popover4, Portal as Portal19, Stack as Stack17, Text as Text23 } from "@chakra-ui/react";
|
|
9585
9840
|
import { Flag, Trash2 as Trash23 } from "lucide-react";
|
|
9586
|
-
import { jsx as
|
|
9841
|
+
import { jsx as jsx62, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
9587
9842
|
var DAY2 = 864e5;
|
|
9588
9843
|
var toDay = (day) => Math.round(Date.parse(`${day}T00:00:00Z`) / DAY2);
|
|
9589
9844
|
var fromDay = (n) => new Date(n * DAY2).toISOString().slice(0, 10);
|
|
@@ -9622,8 +9877,8 @@ function TimelineChart({
|
|
|
9622
9877
|
const placeholders = useLoading(own) && rows2.length === 0;
|
|
9623
9878
|
const shown = placeholders ? Array.from({ length: skeletonRows }, (_, i) => ({ id: `skeleton-${i}` })) : rows2;
|
|
9624
9879
|
const root = useRef23(null);
|
|
9625
|
-
const [room, setRoom] =
|
|
9626
|
-
|
|
9880
|
+
const [room, setRoom] = useState27(0);
|
|
9881
|
+
useEffect19(() => {
|
|
9627
9882
|
const el = root.current;
|
|
9628
9883
|
if (!fill5 || !el) return;
|
|
9629
9884
|
const observer = new ResizeObserver(() => setRoom(Math.max(0, el.clientWidth - labelWidth)));
|
|
@@ -9633,7 +9888,7 @@ function TimelineChart({
|
|
|
9633
9888
|
const origin = toDay(from);
|
|
9634
9889
|
const days = Math.max(toDay(to) - origin + 1, fill5 ? Math.floor(room / dayWidth) : 0);
|
|
9635
9890
|
const width = days * dayWidth;
|
|
9636
|
-
const [drag, setDrag] =
|
|
9891
|
+
const [drag, setDrag] = useState27(null);
|
|
9637
9892
|
const moved = useRef23(false);
|
|
9638
9893
|
const scrolled = useRef23(0);
|
|
9639
9894
|
const lastWidth = useRef23(dayWidth);
|
|
@@ -9653,7 +9908,7 @@ function TimelineChart({
|
|
|
9653
9908
|
}, [dayWidth, labelWidth]);
|
|
9654
9909
|
const zoomRef = useRef23({ onZoom, dayWidth });
|
|
9655
9910
|
zoomRef.current = { onZoom, dayWidth };
|
|
9656
|
-
|
|
9911
|
+
useEffect19(() => {
|
|
9657
9912
|
const el = root.current;
|
|
9658
9913
|
if (!el) return;
|
|
9659
9914
|
let sum = 0;
|
|
@@ -9681,28 +9936,28 @@ function TimelineChart({
|
|
|
9681
9936
|
}
|
|
9682
9937
|
const { reduce } = useMotionSetting();
|
|
9683
9938
|
const layer = useRef23(null);
|
|
9684
|
-
const [linking, setLinking] =
|
|
9685
|
-
const [hot, setHot] =
|
|
9686
|
-
const [menu, setMenu] =
|
|
9687
|
-
|
|
9939
|
+
const [linking, setLinking] = useState27(null);
|
|
9940
|
+
const [hot, setHot] = useState27(null);
|
|
9941
|
+
const [menu, setMenu] = useState27(null);
|
|
9942
|
+
useEffect19(() => {
|
|
9688
9943
|
if (!linking) return;
|
|
9689
9944
|
const cancel = (e) => e.key === "Escape" && setLinking(null);
|
|
9690
9945
|
window.addEventListener("keydown", cancel);
|
|
9691
9946
|
return () => window.removeEventListener("keydown", cancel);
|
|
9692
9947
|
}, [linking]);
|
|
9693
|
-
const [card, setCard] =
|
|
9948
|
+
const [card, setCard] = useState27(null);
|
|
9694
9949
|
const cardTimer = useRef23(void 0);
|
|
9695
9950
|
const cardOff = () => {
|
|
9696
9951
|
clearTimeout(cardTimer.current);
|
|
9697
9952
|
setCard(null);
|
|
9698
9953
|
};
|
|
9699
|
-
|
|
9700
|
-
|
|
9954
|
+
useEffect19(() => () => clearTimeout(cardTimer.current), []);
|
|
9955
|
+
useEffect19(() => {
|
|
9701
9956
|
if (!card) return;
|
|
9702
9957
|
window.addEventListener("scroll", cardOff, true);
|
|
9703
9958
|
return () => window.removeEventListener("scroll", cardOff, true);
|
|
9704
9959
|
}, [card]);
|
|
9705
|
-
|
|
9960
|
+
useEffect19(() => {
|
|
9706
9961
|
const el = root.current;
|
|
9707
9962
|
if (!reveal || !el) return;
|
|
9708
9963
|
const at = toDay(reveal.day) - origin;
|
|
@@ -9711,7 +9966,7 @@ function TimelineChart({
|
|
|
9711
9966
|
el.scrollTo({ left: getComputedStyle(el).direction === "rtl" ? -x : x, behavior: reduce ? "auto" : "smooth" });
|
|
9712
9967
|
}, [reveal]);
|
|
9713
9968
|
const refocus = useRef23(null);
|
|
9714
|
-
|
|
9969
|
+
useEffect19(() => {
|
|
9715
9970
|
if (!refocus.current) return;
|
|
9716
9971
|
const bar = root.current?.querySelector(`[data-bar="${CSS.escape(refocus.current)}"]`);
|
|
9717
9972
|
if (bar && document.activeElement !== bar) bar.focus();
|
|
@@ -9852,7 +10107,7 @@ function TimelineChart({
|
|
|
9852
10107
|
const bandsTop = tickHeight, markersTop = tickHeight + (shownBands.length ? STRIP : 0);
|
|
9853
10108
|
const headerHeight = markersTop + (shownMarkers.length ? STRIP : 0);
|
|
9854
10109
|
const todayAt = today ? toDay(today) - origin : -1;
|
|
9855
|
-
return /* @__PURE__ */
|
|
10110
|
+
return /* @__PURE__ */ jsxs48(
|
|
9856
10111
|
Box16,
|
|
9857
10112
|
{
|
|
9858
10113
|
ref: root,
|
|
@@ -9870,9 +10125,9 @@ function TimelineChart({
|
|
|
9870
10125
|
},
|
|
9871
10126
|
onKeyDown: zoomKey,
|
|
9872
10127
|
children: [
|
|
9873
|
-
instructions && /* @__PURE__ */
|
|
9874
|
-
/* @__PURE__ */
|
|
9875
|
-
/* @__PURE__ */
|
|
10128
|
+
instructions && /* @__PURE__ */ jsx62(Text23, { srOnly: true, children: instructions }),
|
|
10129
|
+
/* @__PURE__ */ jsxs48(Box16, { display: "grid", gridTemplateColumns: fill5 ? `${labelWidth}px minmax(${width}px, 1fr)` : `${labelWidth}px ${width}px`, minW: "fit-content", children: [
|
|
10130
|
+
/* @__PURE__ */ jsx62(
|
|
9876
10131
|
Box16,
|
|
9877
10132
|
{
|
|
9878
10133
|
position: "sticky",
|
|
@@ -9891,8 +10146,8 @@ function TimelineChart({
|
|
|
9891
10146
|
children: corner
|
|
9892
10147
|
}
|
|
9893
10148
|
),
|
|
9894
|
-
/* @__PURE__ */
|
|
9895
|
-
ticks.map((t, i) => /* @__PURE__ */
|
|
10149
|
+
/* @__PURE__ */ jsxs48(Box16, { position: "sticky", top: "0", zIndex: "2", bg: "bg.muted", borderBottomWidth: "1px", borderColor: "border", h: `${headerHeight}px`, overflow: "clip", children: [
|
|
10150
|
+
ticks.map((t, i) => /* @__PURE__ */ jsx62(
|
|
9896
10151
|
Box16,
|
|
9897
10152
|
{
|
|
9898
10153
|
position: "absolute",
|
|
@@ -9903,8 +10158,8 @@ function TimelineChart({
|
|
|
9903
10158
|
borderInlineStartWidth: "1px",
|
|
9904
10159
|
borderColor: "border",
|
|
9905
10160
|
"aria-hidden": true,
|
|
9906
|
-
children: /* @__PURE__ */
|
|
9907
|
-
|
|
10161
|
+
children: /* @__PURE__ */ jsx62(
|
|
10162
|
+
Text23,
|
|
9908
10163
|
{
|
|
9909
10164
|
position: "sticky",
|
|
9910
10165
|
insetStart: `${labelWidth}px`,
|
|
@@ -9922,8 +10177,8 @@ function TimelineChart({
|
|
|
9922
10177
|
},
|
|
9923
10178
|
t.day
|
|
9924
10179
|
)),
|
|
9925
|
-
subTicks.map((t) => /* @__PURE__ */
|
|
9926
|
-
|
|
10180
|
+
subTicks.map((t) => /* @__PURE__ */ jsx62(
|
|
10181
|
+
Text23,
|
|
9927
10182
|
{
|
|
9928
10183
|
position: "absolute",
|
|
9929
10184
|
insetStart: `${t.day * dayWidth}px`,
|
|
@@ -9942,7 +10197,7 @@ function TimelineChart({
|
|
|
9942
10197
|
},
|
|
9943
10198
|
t.day
|
|
9944
10199
|
)),
|
|
9945
|
-
offRuns.filter((o) => o.kind === "holiday").map((o) => /* @__PURE__ */
|
|
10200
|
+
offRuns.filter((o) => o.kind === "holiday").map((o) => /* @__PURE__ */ jsx62(Tooltip, { content: o.label, children: /* @__PURE__ */ jsx62(
|
|
9946
10201
|
Box16,
|
|
9947
10202
|
{
|
|
9948
10203
|
position: "absolute",
|
|
@@ -9957,7 +10212,7 @@ function TimelineChart({
|
|
|
9957
10212
|
"aria-label": o.label
|
|
9958
10213
|
}
|
|
9959
10214
|
) }, `h${o.a}`)),
|
|
9960
|
-
shownBands.map((b) => /* @__PURE__ */
|
|
10215
|
+
shownBands.map((b) => /* @__PURE__ */ jsx62(Tooltip, { content: b.detail ?? b.label, children: /* @__PURE__ */ jsx62(
|
|
9961
10216
|
Box16,
|
|
9962
10217
|
{
|
|
9963
10218
|
position: "absolute",
|
|
@@ -9974,8 +10229,8 @@ function TimelineChart({
|
|
|
9974
10229
|
focusVisibleRing: "inside",
|
|
9975
10230
|
overflow: "clip",
|
|
9976
10231
|
"aria-label": b.label,
|
|
9977
|
-
children: /* @__PURE__ */
|
|
9978
|
-
|
|
10232
|
+
children: /* @__PURE__ */ jsx62(
|
|
10233
|
+
Text23,
|
|
9979
10234
|
{
|
|
9980
10235
|
position: "sticky",
|
|
9981
10236
|
insetStart: `${labelWidth}px`,
|
|
@@ -9987,12 +10242,12 @@ function TimelineChart({
|
|
|
9987
10242
|
color: b.current ? "colorPalette.fg" : "fg.muted",
|
|
9988
10243
|
fontWeight: b.current ? "medium" : void 0,
|
|
9989
10244
|
truncate: true,
|
|
9990
|
-
children: /* @__PURE__ */
|
|
10245
|
+
children: /* @__PURE__ */ jsx62("bdi", { children: b.label })
|
|
9991
10246
|
}
|
|
9992
10247
|
)
|
|
9993
10248
|
}
|
|
9994
10249
|
) }, b.id)),
|
|
9995
|
-
shownMarkers.map((m4) => /* @__PURE__ */
|
|
10250
|
+
shownMarkers.map((m4) => /* @__PURE__ */ jsx62(Tooltip, { content: m4.detail ?? m4.label, children: /* @__PURE__ */ jsxs48(
|
|
9996
10251
|
Box16,
|
|
9997
10252
|
{
|
|
9998
10253
|
position: "absolute",
|
|
@@ -10017,15 +10272,15 @@ function TimelineChart({
|
|
|
10017
10272
|
focusVisibleRing: "outside",
|
|
10018
10273
|
"aria-label": m4.label,
|
|
10019
10274
|
children: [
|
|
10020
|
-
/* @__PURE__ */
|
|
10021
|
-
/* @__PURE__ */
|
|
10275
|
+
/* @__PURE__ */ jsx62(Flag, { size: 11, "aria-hidden": true }),
|
|
10276
|
+
/* @__PURE__ */ jsx62("bdi", { children: m4.label })
|
|
10022
10277
|
]
|
|
10023
10278
|
}
|
|
10024
10279
|
) }, m4.id))
|
|
10025
10280
|
] }),
|
|
10026
|
-
/* @__PURE__ */
|
|
10027
|
-
/* @__PURE__ */
|
|
10028
|
-
offRuns.map((o) => /* @__PURE__ */
|
|
10281
|
+
/* @__PURE__ */ jsx62(Box16, { position: "sticky", insetStart: "0", zIndex: "1", bg: "bg.panel", borderInlineEndWidth: "1px", borderColor: "border", children: shown.map((r, i) => /* @__PURE__ */ jsx62(HStack15, { 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__ */ jsx62(TextBone, { width: boneWidth(i, 12, 26) }) : r.heading ?? (r.item && renderLabel(r.item)) }, r.id)) }),
|
|
10282
|
+
/* @__PURE__ */ jsxs48(Box16, { ref: layer, position: "relative", zIndex: "0", h: `${shown.length * rowHeight}px`, children: [
|
|
10283
|
+
offRuns.map((o) => /* @__PURE__ */ jsx62(
|
|
10029
10284
|
Box16,
|
|
10030
10285
|
{
|
|
10031
10286
|
position: "absolute",
|
|
@@ -10040,8 +10295,8 @@ function TimelineChart({
|
|
|
10040
10295
|
},
|
|
10041
10296
|
`o${o.a}`
|
|
10042
10297
|
)),
|
|
10043
|
-
ticks.map((t) => /* @__PURE__ */
|
|
10044
|
-
shownBands.filter((b) => b.current).map((b) => /* @__PURE__ */
|
|
10298
|
+
ticks.map((t) => /* @__PURE__ */ jsx62(Box16, { position: "absolute", insetStart: `${t.day * dayWidth}px`, top: "0", bottom: "0", borderInlineStartWidth: "1px", borderColor: "border.muted", "aria-hidden": true }, t.day)),
|
|
10299
|
+
shownBands.filter((b) => b.current).map((b) => /* @__PURE__ */ jsx62(
|
|
10045
10300
|
Box16,
|
|
10046
10301
|
{
|
|
10047
10302
|
position: "absolute",
|
|
@@ -10056,7 +10311,7 @@ function TimelineChart({
|
|
|
10056
10311
|
},
|
|
10057
10312
|
b.id
|
|
10058
10313
|
)),
|
|
10059
|
-
shownMarkers.map((m4) => /* @__PURE__ */
|
|
10314
|
+
shownMarkers.map((m4) => /* @__PURE__ */ jsx62(
|
|
10060
10315
|
Box16,
|
|
10061
10316
|
{
|
|
10062
10317
|
position: "absolute",
|
|
@@ -10073,7 +10328,7 @@ function TimelineChart({
|
|
|
10073
10328
|
},
|
|
10074
10329
|
m4.id
|
|
10075
10330
|
)),
|
|
10076
|
-
todayAt >= 0 && todayAt < days && /* @__PURE__ */
|
|
10331
|
+
todayAt >= 0 && todayAt < days && /* @__PURE__ */ jsx62(
|
|
10077
10332
|
Box16,
|
|
10078
10333
|
{
|
|
10079
10334
|
position: "absolute",
|
|
@@ -10086,7 +10341,7 @@ function TimelineChart({
|
|
|
10086
10341
|
"aria-hidden": true
|
|
10087
10342
|
}
|
|
10088
10343
|
),
|
|
10089
|
-
shown.map((r, i) => /* @__PURE__ */
|
|
10344
|
+
shown.map((r, i) => /* @__PURE__ */ jsx62(
|
|
10090
10345
|
Box16,
|
|
10091
10346
|
{
|
|
10092
10347
|
position: "absolute",
|
|
@@ -10101,7 +10356,7 @@ function TimelineChart({
|
|
|
10101
10356
|
},
|
|
10102
10357
|
r.id
|
|
10103
10358
|
)),
|
|
10104
|
-
placeholders && shown.map((r, i) => /* @__PURE__ */
|
|
10359
|
+
placeholders && shown.map((r, i) => /* @__PURE__ */ jsx62(
|
|
10105
10360
|
Bone,
|
|
10106
10361
|
{
|
|
10107
10362
|
position: "absolute",
|
|
@@ -10118,7 +10373,7 @@ function TimelineChart({
|
|
|
10118
10373
|
if (!bl || !bl.start && !bl.end) return null;
|
|
10119
10374
|
const a = Math.max(toDay(bl.start ?? bl.end) - origin, 0), z = Math.min(toDay(bl.end ?? bl.start) - origin, days - 1);
|
|
10120
10375
|
if (z < a) return null;
|
|
10121
|
-
return /* @__PURE__ */
|
|
10376
|
+
return /* @__PURE__ */ jsx62(
|
|
10122
10377
|
Box16,
|
|
10123
10378
|
{
|
|
10124
10379
|
position: "absolute",
|
|
@@ -10140,7 +10395,7 @@ function TimelineChart({
|
|
|
10140
10395
|
if (z < a) return null;
|
|
10141
10396
|
const w = (z - a + 1) * dayWidth - 2;
|
|
10142
10397
|
const palette3 = c2.tone === "over" ? "danger" : c2.tone === "full" ? "warning" : "accent";
|
|
10143
|
-
return /* @__PURE__ */
|
|
10398
|
+
return /* @__PURE__ */ jsx62(
|
|
10144
10399
|
Box16,
|
|
10145
10400
|
{
|
|
10146
10401
|
position: "absolute",
|
|
@@ -10181,8 +10436,8 @@ function TimelineChart({
|
|
|
10181
10436
|
const thin = tone === "rollup" && !single;
|
|
10182
10437
|
const diamond = single ? { w: `${DIAMOND}px`, h: `${DIAMOND}px`, top: `${i * rowHeight + rowHeight / 2 - DIAMOND / 2}px`, transform: "rotate(45deg)", rounded: "l1" } : null;
|
|
10183
10438
|
const canLink = !!onLink && item.linkable !== false && !drag;
|
|
10184
|
-
return /* @__PURE__ */
|
|
10185
|
-
/* @__PURE__ */
|
|
10439
|
+
return /* @__PURE__ */ jsxs48(Fragment22, { children: [
|
|
10440
|
+
/* @__PURE__ */ jsxs48(
|
|
10186
10441
|
Box16,
|
|
10187
10442
|
{
|
|
10188
10443
|
role: "button",
|
|
@@ -10238,7 +10493,7 @@ function TimelineChart({
|
|
|
10238
10493
|
"data-bar": item.id,
|
|
10239
10494
|
children: [
|
|
10240
10495
|
!single && !thin && renderBar?.(item),
|
|
10241
|
-
item.progress != null && !single && /* @__PURE__ */
|
|
10496
|
+
item.progress != null && !single && /* @__PURE__ */ jsx62(
|
|
10242
10497
|
Box16,
|
|
10243
10498
|
{
|
|
10244
10499
|
position: "absolute",
|
|
@@ -10254,7 +10509,7 @@ function TimelineChart({
|
|
|
10254
10509
|
),
|
|
10255
10510
|
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
|
|
10256
10511
|
// change would be saved twice (the second refused as a conflict).
|
|
10257
|
-
/* @__PURE__ */
|
|
10512
|
+
/* @__PURE__ */ jsx62(
|
|
10258
10513
|
Box16,
|
|
10259
10514
|
{
|
|
10260
10515
|
position: "absolute",
|
|
@@ -10278,7 +10533,7 @@ function TimelineChart({
|
|
|
10278
10533
|
]
|
|
10279
10534
|
}
|
|
10280
10535
|
),
|
|
10281
|
-
canLink && (hot === item.id || linking?.from.id === item.id) && /* @__PURE__ */
|
|
10536
|
+
canLink && (hot === item.id || linking?.from.id === item.id) && /* @__PURE__ */ jsx62(
|
|
10282
10537
|
Box16,
|
|
10283
10538
|
{
|
|
10284
10539
|
position: "absolute",
|
|
@@ -10300,12 +10555,12 @@ function TimelineChart({
|
|
|
10300
10555
|
onPointerUp: linkUp,
|
|
10301
10556
|
onPointerCancel: () => setLinking(null),
|
|
10302
10557
|
"aria-hidden": true,
|
|
10303
|
-
children: /* @__PURE__ */
|
|
10558
|
+
children: /* @__PURE__ */ jsx62(Box16, { w: "2.5", h: "2.5", rounded: "full", bg: "bg.panel", borderWidth: "2px", borderColor: "accent.solid" })
|
|
10304
10559
|
}
|
|
10305
10560
|
)
|
|
10306
10561
|
] }, item.id);
|
|
10307
10562
|
}),
|
|
10308
|
-
/* @__PURE__ */
|
|
10563
|
+
/* @__PURE__ */ jsx62(
|
|
10309
10564
|
Box16,
|
|
10310
10565
|
{
|
|
10311
10566
|
position: "absolute",
|
|
@@ -10317,8 +10572,8 @@ function TimelineChart({
|
|
|
10317
10572
|
zIndex: "1",
|
|
10318
10573
|
_rtl: { transform: "scaleX(-1)" },
|
|
10319
10574
|
"aria-hidden": !onUnlink,
|
|
10320
|
-
children: /* @__PURE__ */
|
|
10321
|
-
/* @__PURE__ */
|
|
10575
|
+
children: /* @__PURE__ */ jsxs48("svg", { width, height: rows2.length * rowHeight, style: { position: "absolute", left: 0, top: 0 }, children: [
|
|
10576
|
+
/* @__PURE__ */ jsx62("defs", { children: /* @__PURE__ */ jsx62("marker", { id: "abp-arrow", viewBox: "0 0 8 8", refX: "7", refY: "4", markerWidth: "7", markerHeight: "7", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx62("path", { d: "M 0 0 L 8 4 L 0 8 z", fill: "context-stroke" }) }) }),
|
|
10322
10577
|
links.map((l) => {
|
|
10323
10578
|
const f = ys.get(l.from), t = ys.get(l.to);
|
|
10324
10579
|
if (!f || !t) return null;
|
|
@@ -10329,8 +10584,8 @@ function TimelineChart({
|
|
|
10329
10584
|
const picked = menu?.from === l.from && menu.to === l.to;
|
|
10330
10585
|
const faint = !l.strong && links.some((x) => x.strong);
|
|
10331
10586
|
const open = (x, y) => setMenu({ from: l.from, to: l.to, x, y });
|
|
10332
|
-
return /* @__PURE__ */
|
|
10333
|
-
/* @__PURE__ */
|
|
10587
|
+
return /* @__PURE__ */ jsxs48("g", { children: [
|
|
10588
|
+
/* @__PURE__ */ jsx62(
|
|
10334
10589
|
"path",
|
|
10335
10590
|
{
|
|
10336
10591
|
d,
|
|
@@ -10342,7 +10597,7 @@ function TimelineChart({
|
|
|
10342
10597
|
markerEnd: "url(#abp-arrow)"
|
|
10343
10598
|
}
|
|
10344
10599
|
),
|
|
10345
|
-
onUnlink && /* @__PURE__ */
|
|
10600
|
+
onUnlink && /* @__PURE__ */ jsx62(
|
|
10346
10601
|
"path",
|
|
10347
10602
|
{
|
|
10348
10603
|
d,
|
|
@@ -10367,13 +10622,13 @@ function TimelineChart({
|
|
|
10367
10622
|
] })
|
|
10368
10623
|
}
|
|
10369
10624
|
),
|
|
10370
|
-
linking && /* @__PURE__ */
|
|
10371
|
-
/* @__PURE__ */
|
|
10372
|
-
/* @__PURE__ */
|
|
10625
|
+
linking && /* @__PURE__ */ jsxs48("svg", { width: "100%", height: shown.length * rowHeight, style: { position: "absolute", left: 0, top: 0, pointerEvents: "none", zIndex: 3 }, "aria-hidden": true, children: [
|
|
10626
|
+
/* @__PURE__ */ jsx62("line", { x1: linking.x0, y1: linking.y0, x2: linking.x, y2: linking.y, stroke: tv("colors.accent.solid"), strokeWidth: 2, strokeDasharray: "5 4" }),
|
|
10627
|
+
/* @__PURE__ */ jsx62("circle", { cx: linking.x, cy: linking.y, r: 4, fill: tv("colors.accent.solid") })
|
|
10373
10628
|
] })
|
|
10374
10629
|
] })
|
|
10375
10630
|
] }),
|
|
10376
|
-
card && renderCard && items.has(card.id) && /* @__PURE__ */
|
|
10631
|
+
card && renderCard && items.has(card.id) && /* @__PURE__ */ jsx62(Portal19, { children: /* @__PURE__ */ jsx62(
|
|
10377
10632
|
Box16,
|
|
10378
10633
|
{
|
|
10379
10634
|
id: "abp-timeline-card",
|
|
@@ -10397,7 +10652,7 @@ function TimelineChart({
|
|
|
10397
10652
|
children: renderCard(items.get(card.id))
|
|
10398
10653
|
}
|
|
10399
10654
|
) }),
|
|
10400
|
-
onUnlink && /* @__PURE__ */
|
|
10655
|
+
onUnlink && /* @__PURE__ */ jsx62(
|
|
10401
10656
|
Popover4.Root,
|
|
10402
10657
|
{
|
|
10403
10658
|
open: !!menu,
|
|
@@ -10406,13 +10661,13 @@ function TimelineChart({
|
|
|
10406
10661
|
unmountOnExit: true,
|
|
10407
10662
|
autoFocus: true,
|
|
10408
10663
|
positioning: { placement: "bottom", getAnchorRect: () => menu ? { x: menu.x, y: menu.y, width: 1, height: 1 } : null },
|
|
10409
|
-
children: /* @__PURE__ */
|
|
10410
|
-
/* @__PURE__ */
|
|
10411
|
-
/* @__PURE__ */
|
|
10664
|
+
children: /* @__PURE__ */ jsx62(Portal19, { children: /* @__PURE__ */ jsx62(Popover4.Positioner, { children: /* @__PURE__ */ jsx62(Popover4.Content, { w: "auto", maxW: "calc(100vw - 32px)", children: /* @__PURE__ */ jsx62(Popover4.Body, { children: menu && /* @__PURE__ */ jsxs48(Stack17, { gap: "2", children: [
|
|
10665
|
+
/* @__PURE__ */ jsx62(Text23, { textStyle: "label", children: linkTexts?.arrow(menu.from, menu.to) }),
|
|
10666
|
+
/* @__PURE__ */ jsxs48(Button, { size: "sm", variant: "secondary", onClick: () => {
|
|
10412
10667
|
onUnlink(menu);
|
|
10413
10668
|
setMenu(null);
|
|
10414
10669
|
}, children: [
|
|
10415
|
-
/* @__PURE__ */
|
|
10670
|
+
/* @__PURE__ */ jsx62(Trash23, {}),
|
|
10416
10671
|
linkTexts?.remove
|
|
10417
10672
|
] })
|
|
10418
10673
|
] }) }) }) }) })
|
|
@@ -10424,8 +10679,8 @@ function TimelineChart({
|
|
|
10424
10679
|
}
|
|
10425
10680
|
|
|
10426
10681
|
// src/components/TimelineCards.tsx
|
|
10427
|
-
import { useEffect as
|
|
10428
|
-
import { Box as Box17, chakra as
|
|
10682
|
+
import { useEffect as useEffect20, useMemo as useMemo15, useRef as useRef24, useState as useState28 } from "react";
|
|
10683
|
+
import { Box as Box17, chakra as chakra37, Grid as Grid4, Stack as Stack18, Text as Text24 } from "@chakra-ui/react";
|
|
10429
10684
|
|
|
10430
10685
|
// src/components/timeline-cards-math.ts
|
|
10431
10686
|
var DAY3 = 864e5;
|
|
@@ -10477,7 +10732,7 @@ function placeCards(items, first, days, scale, colW = columnWidth(scale)) {
|
|
|
10477
10732
|
}
|
|
10478
10733
|
|
|
10479
10734
|
// src/components/TimelineCards.tsx
|
|
10480
|
-
import { jsx as
|
|
10735
|
+
import { jsx as jsx63, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
10481
10736
|
var LANE = 60;
|
|
10482
10737
|
var KEYS = { d: "day", w: "week", m: "month" };
|
|
10483
10738
|
function TimelineCards(props) {
|
|
@@ -10491,8 +10746,8 @@ function TimelineCards(props) {
|
|
|
10491
10746
|
onScale(next);
|
|
10492
10747
|
}
|
|
10493
10748
|
};
|
|
10494
|
-
return /* @__PURE__ */
|
|
10495
|
-
|
|
10749
|
+
return /* @__PURE__ */ jsxs49(
|
|
10750
|
+
chakra37.div,
|
|
10496
10751
|
{
|
|
10497
10752
|
role: "region",
|
|
10498
10753
|
"aria-label": props["aria-label"],
|
|
@@ -10502,15 +10757,15 @@ function TimelineCards(props) {
|
|
|
10502
10757
|
overflow: "hidden",
|
|
10503
10758
|
"data-timeline-cards": scale,
|
|
10504
10759
|
children: [
|
|
10505
|
-
scale === "day" ? /* @__PURE__ */
|
|
10760
|
+
scale === "day" ? /* @__PURE__ */ jsx63(DayGrid, { ...props }) : /* @__PURE__ */ jsx63(Lanes, { ...props, scale }),
|
|
10506
10761
|
props.footer
|
|
10507
10762
|
]
|
|
10508
10763
|
}
|
|
10509
10764
|
);
|
|
10510
10765
|
}
|
|
10511
10766
|
function Card2({ item, p, range, cutStart, cutEnd, style }) {
|
|
10512
|
-
const card = /* @__PURE__ */
|
|
10513
|
-
|
|
10767
|
+
const card = /* @__PURE__ */ jsxs49(
|
|
10768
|
+
chakra37.button,
|
|
10514
10769
|
{
|
|
10515
10770
|
type: "button",
|
|
10516
10771
|
"data-timeline-card": item.id,
|
|
@@ -10534,18 +10789,18 @@ function Card2({ item, p, range, cutStart, cutEnd, style }) {
|
|
|
10534
10789
|
transition: "background 120ms, border-color 120ms",
|
|
10535
10790
|
...style,
|
|
10536
10791
|
children: [
|
|
10537
|
-
/* @__PURE__ */
|
|
10538
|
-
/* @__PURE__ */
|
|
10792
|
+
/* @__PURE__ */ jsx63(Box17, { as: "span", w: "3px", flexShrink: 0, bg: p.accent?.(item) ?? "border.emphasized", "aria-hidden": true }),
|
|
10793
|
+
/* @__PURE__ */ jsx63(Stack18, { as: "span", gap: "0.5", px: "2.5", py: "1.5", minW: "0", flex: "1", justify: "center", children: p.renderCard(item, { range }) })
|
|
10539
10794
|
]
|
|
10540
10795
|
}
|
|
10541
10796
|
);
|
|
10542
|
-
return p.details ? /* @__PURE__ */
|
|
10797
|
+
return p.details ? /* @__PURE__ */ jsx63(Tooltip, { content: p.details(item), positioning: { placement: "bottom-start" }, openDelay: 250, children: card }) : card;
|
|
10543
10798
|
}
|
|
10544
10799
|
function Lanes(p) {
|
|
10545
10800
|
const { days, today, items, scale } = p;
|
|
10546
10801
|
const box = useRef24(null);
|
|
10547
|
-
const [available, setAvailable] =
|
|
10548
|
-
|
|
10802
|
+
const [available, setAvailable] = useState28(0);
|
|
10803
|
+
useEffect20(() => {
|
|
10549
10804
|
const el = box.current;
|
|
10550
10805
|
if (!el) return;
|
|
10551
10806
|
const measure = () => setAvailable(el.clientWidth);
|
|
@@ -10555,18 +10810,18 @@ function Lanes(p) {
|
|
|
10555
10810
|
return () => observer.disconnect();
|
|
10556
10811
|
}, []);
|
|
10557
10812
|
const colW = columnWidth(scale, days.length, available);
|
|
10558
|
-
const byId =
|
|
10559
|
-
const { cards, lanes } =
|
|
10813
|
+
const byId = useMemo15(() => new Map(items.map((i) => [i.id, i])), [items]);
|
|
10814
|
+
const { cards, lanes } = useMemo15(() => placeCards(items, days[0], days.length, scale, colW), [items, days, scale, colW]);
|
|
10560
10815
|
const todayIdx = days.indexOf(today);
|
|
10561
10816
|
const gridW = days.length * colW;
|
|
10562
10817
|
const placeholders = useLoading(p.loading) && items.length === 0;
|
|
10563
10818
|
const height = (placeholders ? 4 : Math.max(lanes, 1)) * LANE + 16;
|
|
10564
|
-
return /* @__PURE__ */
|
|
10565
|
-
/* @__PURE__ */
|
|
10819
|
+
return /* @__PURE__ */ jsx63(chakra37.div, { overflowX: "auto", ref: box, children: /* @__PURE__ */ jsxs49(chakra37.div, { position: "relative", minW: "full", w: `${gridW}px`, children: [
|
|
10820
|
+
/* @__PURE__ */ jsx63(chakra37.div, { display: "flex", borderBottomWidth: "1px", borderColor: "border", bg: "bg.subtle", position: "sticky", top: "0", zIndex: "1", children: days.map((d) => {
|
|
10566
10821
|
const isToday = d === today;
|
|
10567
10822
|
const weekStart = new Date(dayNumber(d) * 864e5).getUTCDay() === 0;
|
|
10568
|
-
return /* @__PURE__ */
|
|
10569
|
-
|
|
10823
|
+
return /* @__PURE__ */ jsxs49(
|
|
10824
|
+
chakra37.div,
|
|
10570
10825
|
{
|
|
10571
10826
|
w: `${colW}px`,
|
|
10572
10827
|
flexShrink: 0,
|
|
@@ -10582,9 +10837,9 @@ function Lanes(p) {
|
|
|
10582
10837
|
borderInlineStartWidth: weekStart && scale === "month" ? "1px" : "0",
|
|
10583
10838
|
borderColor: "border",
|
|
10584
10839
|
children: [
|
|
10585
|
-
/* @__PURE__ */
|
|
10586
|
-
/* @__PURE__ */
|
|
10587
|
-
|
|
10840
|
+
/* @__PURE__ */ jsx63(Text24, { as: "span", children: p.weekday(d) }),
|
|
10841
|
+
/* @__PURE__ */ jsx63(
|
|
10842
|
+
Text24,
|
|
10588
10843
|
{
|
|
10589
10844
|
as: "span",
|
|
10590
10845
|
fontVariantNumeric: "tabular-nums",
|
|
@@ -10602,9 +10857,9 @@ function Lanes(p) {
|
|
|
10602
10857
|
d
|
|
10603
10858
|
);
|
|
10604
10859
|
}) }),
|
|
10605
|
-
/* @__PURE__ */
|
|
10606
|
-
todayIdx >= 0 && /* @__PURE__ */
|
|
10607
|
-
|
|
10860
|
+
/* @__PURE__ */ jsx63(chakra37.div, { position: "absolute", insetInlineStart: "0", top: "0", bottom: "0", display: "flex", pointerEvents: "none", "aria-hidden": true, children: days.map((d) => /* @__PURE__ */ jsx63(chakra37.div, { w: `${colW}px`, flexShrink: 0, borderInlineEndWidth: "1px", borderStyle: "dashed", borderColor: "border.muted" }, d)) }),
|
|
10861
|
+
todayIdx >= 0 && /* @__PURE__ */ jsx63(
|
|
10862
|
+
chakra37.div,
|
|
10608
10863
|
{
|
|
10609
10864
|
position: "absolute",
|
|
10610
10865
|
top: "0",
|
|
@@ -10618,7 +10873,7 @@ function Lanes(p) {
|
|
|
10618
10873
|
zIndex: "1"
|
|
10619
10874
|
}
|
|
10620
10875
|
),
|
|
10621
|
-
placeholders ? /* @__PURE__ */
|
|
10876
|
+
placeholders ? /* @__PURE__ */ jsx63(chakra37.div, { position: "relative", h: `${height}px`, "aria-hidden": true, children: [0, 1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ jsx63(
|
|
10622
10877
|
Bone,
|
|
10623
10878
|
{
|
|
10624
10879
|
position: "absolute",
|
|
@@ -10629,10 +10884,10 @@ function Lanes(p) {
|
|
|
10629
10884
|
borderRadius: "l2"
|
|
10630
10885
|
},
|
|
10631
10886
|
i
|
|
10632
|
-
)) }) : cards.length === 0 && p.empty ? /* @__PURE__ */
|
|
10887
|
+
)) }) : cards.length === 0 && p.empty ? /* @__PURE__ */ jsx63(chakra37.div, { position: "relative", py: "6", children: p.empty }) : /* @__PURE__ */ jsx63(chakra37.div, { position: "relative", h: `${height}px`, role: "list", children: cards.map((c2) => {
|
|
10633
10888
|
const item = byId.get(c2.id);
|
|
10634
|
-
return /* @__PURE__ */
|
|
10635
|
-
|
|
10889
|
+
return /* @__PURE__ */ jsx63(
|
|
10890
|
+
chakra37.div,
|
|
10636
10891
|
{
|
|
10637
10892
|
role: "listitem",
|
|
10638
10893
|
position: "absolute",
|
|
@@ -10641,7 +10896,7 @@ function Lanes(p) {
|
|
|
10641
10896
|
w: `${c2.width}px`,
|
|
10642
10897
|
display: "flex",
|
|
10643
10898
|
zIndex: "2",
|
|
10644
|
-
children: /* @__PURE__ */
|
|
10899
|
+
children: /* @__PURE__ */ jsx63(Card2, { item, p, range: c2.range, cutStart: c2.cutStart, cutEnd: c2.cutEnd, style: { w: "full" } })
|
|
10645
10900
|
},
|
|
10646
10901
|
c2.id
|
|
10647
10902
|
);
|
|
@@ -10656,8 +10911,8 @@ function DayGrid(p) {
|
|
|
10656
10911
|
const x = dayNumber(day);
|
|
10657
10912
|
return s <= x && x <= d;
|
|
10658
10913
|
});
|
|
10659
|
-
if (due.length === 0 && p.empty) return /* @__PURE__ */
|
|
10660
|
-
return /* @__PURE__ */
|
|
10914
|
+
if (due.length === 0 && p.empty) return /* @__PURE__ */ jsx63(chakra37.div, { py: "6", children: p.empty });
|
|
10915
|
+
return /* @__PURE__ */ jsx63(Grid4, { role: "list", templateColumns: "repeat(auto-fill, minmax(16rem, 1fr))", gap: "2", p: "3", children: due.map((i) => /* @__PURE__ */ jsx63(chakra37.div, { role: "listitem", display: "flex", children: /* @__PURE__ */ jsx63(Card2, { item: i, p, range: Boolean(i.start && i.start < i.due), style: { w: "full" } }) }, i.id)) });
|
|
10661
10916
|
}
|
|
10662
10917
|
export {
|
|
10663
10918
|
ABP_UI_VERSION,
|