@abpjs/ui 0.2.0-next.30 → 0.2.0-next.31
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/guard.d.ts +84 -13
- package/dist/guard.js +235 -38
- package/dist/guard.js.map +1 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +487 -445
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1560,7 +1560,7 @@ function useTokenVar() {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
|
|
1562
1562
|
// src/version.ts
|
|
1563
|
-
var ABP_UI_VERSION = true ? "0.2.0-next.
|
|
1563
|
+
var ABP_UI_VERSION = true ? "0.2.0-next.31" : "0.0.0-dev";
|
|
1564
1564
|
|
|
1565
1565
|
// src/provider/time-zone.tsx
|
|
1566
1566
|
import { createContext, useContext } from "react";
|
|
@@ -1709,6 +1709,10 @@ var defaultLabels = {
|
|
|
1709
1709
|
close: "Close",
|
|
1710
1710
|
typeToConfirm: "Type {value} to confirm",
|
|
1711
1711
|
preview: "Preview",
|
|
1712
|
+
saveBar: "Save your changes?",
|
|
1713
|
+
unsavedChanges: "{count, plural, one {# change isn't saved yet} other {# changes aren't saved yet}}",
|
|
1714
|
+
discard: "Discard",
|
|
1715
|
+
save: "Save",
|
|
1712
1716
|
cancel: "Cancel",
|
|
1713
1717
|
confirm: "Confirm",
|
|
1714
1718
|
retry: "Retry",
|
|
@@ -7052,34 +7056,71 @@ function PreviewCard({ media, title, subtitle, items = [] }) {
|
|
|
7052
7056
|
] });
|
|
7053
7057
|
}
|
|
7054
7058
|
|
|
7059
|
+
// src/components/SaveBar.tsx
|
|
7060
|
+
import { useId as useId6 } from "react";
|
|
7061
|
+
import { Box as Box9, chakra as chakra27, Stack as Stack9, Text as Text13 } from "@chakra-ui/react";
|
|
7062
|
+
import { FilePen } from "lucide-react";
|
|
7063
|
+
import { jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
7064
|
+
var UNSAVED = "{count, plural, one {# change isn't saved yet} other {# changes aren't saved yet}}";
|
|
7065
|
+
function SaveBar({ open, onSave, onDiscard, count = 1, message, title, saveLabel, busy, saveDisabled }) {
|
|
7066
|
+
const labels = useAbpLabels();
|
|
7067
|
+
const { locale } = useAbpLocale();
|
|
7068
|
+
const heading = useId6();
|
|
7069
|
+
return /* @__PURE__ */ jsx45(Box9, { position: "fixed", insetInline: "0", bottom: "6", zIndex: "sticky", display: "flex", justifyContent: "center", px: "4", pointerEvents: "none", children: /* @__PURE__ */ jsx45(Presence, { show: open, from: "rise", maxW: "full", children: /* @__PURE__ */ jsxs33(
|
|
7070
|
+
chakra27.section,
|
|
7071
|
+
{
|
|
7072
|
+
"aria-labelledby": heading,
|
|
7073
|
+
"data-testid": "save-bar",
|
|
7074
|
+
pointerEvents: "auto",
|
|
7075
|
+
display: "flex",
|
|
7076
|
+
flexWrap: { base: "wrap", sm: "nowrap" },
|
|
7077
|
+
alignItems: "center",
|
|
7078
|
+
gap: "3",
|
|
7079
|
+
p: "2",
|
|
7080
|
+
borderRadius: "l3",
|
|
7081
|
+
bg: "bg.selected",
|
|
7082
|
+
color: "accent.fg",
|
|
7083
|
+
children: [
|
|
7084
|
+
/* @__PURE__ */ jsx45(Box9, { flex: "none", display: "inline-flex", alignItems: "center", justifyContent: "center", boxSize: "8", borderRadius: "l2", bg: "bg.panel", "aria-hidden": true, children: /* @__PURE__ */ jsx45(FilePen, { size: 18, strokeWidth: 1.75 }) }),
|
|
7085
|
+
/* @__PURE__ */ jsxs33(Stack9, { gap: "0", flex: "1", minW: { base: "0", sm: "11.25rem" }, me: { sm: "4" }, "aria-live": "polite", children: [
|
|
7086
|
+
/* @__PURE__ */ jsx45(Text13, { id: heading, textStyle: "body.sm", fontWeight: "bold", color: "fg", children: title ?? labels.saveBar ?? "Save your changes?" }),
|
|
7087
|
+
/* @__PURE__ */ jsx45(Text13, { textStyle: "caption", children: message ?? formatMessage(locale, labels.unsavedChanges ?? UNSAVED, { count }) })
|
|
7088
|
+
] }),
|
|
7089
|
+
/* @__PURE__ */ jsx45(Button, { variant: "ghost", color: "accent.fg", fontWeight: "bold", _hover: { bg: "accent.emphasized" }, onClick: onDiscard, disabled: busy, children: labels.discard ?? "Discard" }),
|
|
7090
|
+
/* @__PURE__ */ jsx45(Button, { variant: "primary", onClick: onSave, loading: busy, disabled: saveDisabled, children: saveLabel ?? labels.save ?? "Save" })
|
|
7091
|
+
]
|
|
7092
|
+
}
|
|
7093
|
+
) }) });
|
|
7094
|
+
}
|
|
7095
|
+
|
|
7055
7096
|
// src/settings/SettingsLayout.tsx
|
|
7056
7097
|
import { useState as useState19 } from "react";
|
|
7057
|
-
import { Text as
|
|
7098
|
+
import { Text as Text14 } from "@chakra-ui/react";
|
|
7058
7099
|
|
|
7059
7100
|
// src/components/SearchInput.tsx
|
|
7060
7101
|
import { forwardRef as forwardRef7 } from "react";
|
|
7061
7102
|
import { Input as Input5, InputGroup } from "@chakra-ui/react";
|
|
7062
7103
|
import { Search as Search3 } from "lucide-react";
|
|
7063
|
-
import { jsx as
|
|
7104
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
7064
7105
|
var SearchInput = forwardRef7(function SearchInput2({ size = "md", maxW, ...rest }, ref) {
|
|
7065
7106
|
const skeleton = useLoading();
|
|
7066
|
-
return /* @__PURE__ */
|
|
7107
|
+
return /* @__PURE__ */ jsx46(
|
|
7067
7108
|
InputGroup,
|
|
7068
7109
|
{
|
|
7069
|
-
startElement: /* @__PURE__ */
|
|
7110
|
+
startElement: /* @__PURE__ */ jsx46(Search3, {}),
|
|
7070
7111
|
startOffset: "-0.25rem",
|
|
7071
7112
|
startElementProps: { color: "fg.subtle", _icon: { boxSize: "4" } },
|
|
7072
7113
|
maxW,
|
|
7073
7114
|
borderRadius: "l2",
|
|
7074
7115
|
"aria-hidden": skeleton || void 0,
|
|
7075
7116
|
css: skeleton ? ghostCss : void 0,
|
|
7076
|
-
children: /* @__PURE__ */
|
|
7117
|
+
children: /* @__PURE__ */ jsx46(Input5, { ref, type: "search", size, ...rest })
|
|
7077
7118
|
}
|
|
7078
7119
|
);
|
|
7079
7120
|
});
|
|
7080
7121
|
|
|
7081
7122
|
// src/settings/SettingsLayout.tsx
|
|
7082
|
-
import { jsx as
|
|
7123
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
7083
7124
|
var isCurrent = (pathname, href) => pathname === href || pathname.startsWith(`${href}/`);
|
|
7084
7125
|
function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav = [], children, ...shell }) {
|
|
7085
7126
|
const [find, setFind] = useState19("");
|
|
@@ -7090,17 +7131,17 @@ function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav
|
|
|
7090
7131
|
items: pages.map((p) => ({ id: p.id, href: p.href, icon: p.icon, label: p.title, current: isCurrent(pathname, p.href) })).filter((i) => !q || i.label.toLocaleLowerCase().includes(q) || section.title.toLocaleLowerCase().includes(q))
|
|
7091
7132
|
}));
|
|
7092
7133
|
const found = !q || sections.some((s) => s.items.length > 0);
|
|
7093
|
-
return /* @__PURE__ */
|
|
7134
|
+
return /* @__PURE__ */ jsx47(
|
|
7094
7135
|
AppShell,
|
|
7095
7136
|
{
|
|
7096
7137
|
...shell,
|
|
7097
7138
|
topNav,
|
|
7098
7139
|
sidebar: {
|
|
7099
7140
|
id: sidebarId,
|
|
7100
|
-
top: /* @__PURE__ */
|
|
7141
|
+
top: /* @__PURE__ */ jsx47(SearchInput, { size: "sm", value: find, onChange: (e) => setFind(e.target.value), placeholder: labels.find, "aria-label": labels.find }),
|
|
7101
7142
|
sections
|
|
7102
7143
|
},
|
|
7103
|
-
navFooter: !found ? /* @__PURE__ */
|
|
7144
|
+
navFooter: !found ? /* @__PURE__ */ jsx47(Text14, { textStyle: "caption", color: "fg.muted", px: "2", children: labels.noSetting }) : void 0,
|
|
7104
7145
|
children
|
|
7105
7146
|
}
|
|
7106
7147
|
);
|
|
@@ -7108,7 +7149,7 @@ function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav
|
|
|
7108
7149
|
|
|
7109
7150
|
// src/components/SegmentedControl.tsx
|
|
7110
7151
|
import { SegmentGroup } from "@chakra-ui/react";
|
|
7111
|
-
import { jsx as
|
|
7152
|
+
import { jsx as jsx48, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
7112
7153
|
function SegmentedControl({
|
|
7113
7154
|
"aria-label": ariaLabel,
|
|
7114
7155
|
items,
|
|
@@ -7120,7 +7161,7 @@ function SegmentedControl({
|
|
|
7120
7161
|
}) {
|
|
7121
7162
|
const loading = useLoading(own);
|
|
7122
7163
|
const h = size === "sm" ? "7" : "8";
|
|
7123
|
-
return /* @__PURE__ */
|
|
7164
|
+
return /* @__PURE__ */ jsxs34(
|
|
7124
7165
|
SegmentGroup.Root,
|
|
7125
7166
|
{
|
|
7126
7167
|
size: size === "sm" ? "sm" : "md",
|
|
@@ -7137,8 +7178,8 @@ function SegmentedControl({
|
|
|
7137
7178
|
w: fitted ? "full" : void 0,
|
|
7138
7179
|
"data-segmented": "",
|
|
7139
7180
|
children: [
|
|
7140
|
-
/* @__PURE__ */
|
|
7141
|
-
items.map((item) => /* @__PURE__ */
|
|
7181
|
+
/* @__PURE__ */ jsx48(SegmentGroup.Indicator, {}),
|
|
7182
|
+
items.map((item) => /* @__PURE__ */ jsxs34(
|
|
7142
7183
|
SegmentGroup.Item,
|
|
7143
7184
|
{
|
|
7144
7185
|
value: item.value,
|
|
@@ -7159,9 +7200,9 @@ function SegmentedControl({
|
|
|
7159
7200
|
_icon: { boxSize: "4", flexShrink: 0 },
|
|
7160
7201
|
children: [
|
|
7161
7202
|
item.icon,
|
|
7162
|
-
/* @__PURE__ */
|
|
7163
|
-
item.count != null && /* @__PURE__ */
|
|
7164
|
-
/* @__PURE__ */
|
|
7203
|
+
/* @__PURE__ */ jsx48(SegmentGroup.ItemText, { children: item.label }),
|
|
7204
|
+
item.count != null && /* @__PURE__ */ jsx48(CountBadge, { value: item.count, tone: item.value === value ? "accent" : "neutral" }),
|
|
7205
|
+
/* @__PURE__ */ jsx48(SegmentGroup.ItemHiddenInput, {})
|
|
7165
7206
|
]
|
|
7166
7207
|
},
|
|
7167
7208
|
item.value
|
|
@@ -7173,7 +7214,7 @@ function SegmentedControl({
|
|
|
7173
7214
|
|
|
7174
7215
|
// src/components/KanbanBoard.tsx
|
|
7175
7216
|
import { useEffect as useEffect14, useLayoutEffect as useLayoutEffect3, useMemo as useMemo10, useRef as useRef17, useState as useState20 } from "react";
|
|
7176
|
-
import { Box as
|
|
7217
|
+
import { Box as Box10, chakra as chakra28, HStack as HStack9, Stack as Stack10, Text as Text15 } from "@chakra-ui/react";
|
|
7177
7218
|
import { Check as Check2, ChevronsLeft, ChevronsRight, GripVertical as GripVertical3 } from "lucide-react";
|
|
7178
7219
|
import {
|
|
7179
7220
|
DndContext as DndContext2,
|
|
@@ -7209,13 +7250,13 @@ function between(cell, from, to) {
|
|
|
7209
7250
|
}
|
|
7210
7251
|
|
|
7211
7252
|
// src/components/KanbanBoard.tsx
|
|
7212
|
-
import { Fragment as Fragment17, jsx as
|
|
7253
|
+
import { Fragment as Fragment17, jsx as jsx49, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
7213
7254
|
var SKELETON_CARDS = [3, 2, 4, 1, 2];
|
|
7214
7255
|
function PlaceholderCard({ index }) {
|
|
7215
|
-
return /* @__PURE__ */
|
|
7216
|
-
/* @__PURE__ */
|
|
7217
|
-
/* @__PURE__ */
|
|
7218
|
-
/* @__PURE__ */
|
|
7256
|
+
return /* @__PURE__ */ jsxs35(Box10, { bg: "bg.panel", borderWidth: "1px", borderColor: "border", rounded: "l2", p: "2.5", children: [
|
|
7257
|
+
/* @__PURE__ */ jsx49(Box10, { mb: "1", children: /* @__PURE__ */ jsx49(RecordKey, { loading: true }) }),
|
|
7258
|
+
/* @__PURE__ */ jsx49(Text15, { textStyle: "body.sm", children: /* @__PURE__ */ jsx49(TextBone, { width: boneWidth(index, 14, 34) }) }),
|
|
7259
|
+
/* @__PURE__ */ jsx49(HStack9, { mt: "2", children: /* @__PURE__ */ jsx49(StatusPill, { loading: true, skeletonWidth: boneWidth(index, 5, 9) }) })
|
|
7219
7260
|
] });
|
|
7220
7261
|
}
|
|
7221
7262
|
var cellId = (lane, column) => `cell:${lane}::${column}`;
|
|
@@ -7261,7 +7302,7 @@ function KanbanBoard({
|
|
|
7261
7302
|
ids.splice(to, 0, id);
|
|
7262
7303
|
onReorderColumns(ids);
|
|
7263
7304
|
};
|
|
7264
|
-
const shownColumns = loading && columns.length === 0 ? Array.from({ length: skeletonColumns }, (_, n) => ({ id: `skeleton-${n}`, title: /* @__PURE__ */
|
|
7305
|
+
const shownColumns = loading && columns.length === 0 ? Array.from({ length: skeletonColumns }, (_, n) => ({ id: `skeleton-${n}`, title: /* @__PURE__ */ jsx49(TextBone, { width: boneWidth(n, 6, 12) }) })) : columns;
|
|
7265
7306
|
const rows2 = lanes && lanes.length > 0 ? lanes : [{ id: "", title: null }];
|
|
7266
7307
|
const sensors = useSensors2(
|
|
7267
7308
|
useSensor2(PointerSensor2, { activationConstraint: { distance: 6 } }),
|
|
@@ -7373,7 +7414,7 @@ function KanbanBoard({
|
|
|
7373
7414
|
document.addEventListener("keydown", key);
|
|
7374
7415
|
return () => document.removeEventListener("keydown", key);
|
|
7375
7416
|
}, [onSelect, selected, active]);
|
|
7376
|
-
return /* @__PURE__ */
|
|
7417
|
+
return /* @__PURE__ */ jsxs35(
|
|
7377
7418
|
DndContext2,
|
|
7378
7419
|
{
|
|
7379
7420
|
sensors,
|
|
@@ -7386,8 +7427,8 @@ function KanbanBoard({
|
|
|
7386
7427
|
},
|
|
7387
7428
|
accessibility: { announcements, screenReaderInstructions: screenReaderInstructions ? { draggable: screenReaderInstructions } : void 0 },
|
|
7388
7429
|
children: [
|
|
7389
|
-
/* @__PURE__ */
|
|
7390
|
-
|
|
7430
|
+
/* @__PURE__ */ jsx49(
|
|
7431
|
+
Box10,
|
|
7391
7432
|
{
|
|
7392
7433
|
ref: region,
|
|
7393
7434
|
role: "region",
|
|
@@ -7399,8 +7440,8 @@ function KanbanBoard({
|
|
|
7399
7440
|
if (Date.now() - draggedAt.current < 300) return;
|
|
7400
7441
|
if (e.target instanceof Element && !e.target.closest("[data-card], a, button, input, select, textarea")) clear();
|
|
7401
7442
|
},
|
|
7402
|
-
children: /* @__PURE__ */
|
|
7403
|
-
|
|
7443
|
+
children: /* @__PURE__ */ jsx49(Loading, { when: loading, children: /* @__PURE__ */ jsxs35(
|
|
7444
|
+
Box10,
|
|
7404
7445
|
{
|
|
7405
7446
|
display: "grid",
|
|
7406
7447
|
gridTemplateColumns: shownColumns.map((c2) => folded.has(c2.id) ? "3rem" : "minmax(288px, 1fr)").join(" "),
|
|
@@ -7410,8 +7451,8 @@ function KanbanBoard({
|
|
|
7410
7451
|
shownColumns.map((c2) => {
|
|
7411
7452
|
const isFolded = folded.has(c2.id);
|
|
7412
7453
|
const name = c2.name ?? (typeof c2.title === "string" ? c2.title : c2.id);
|
|
7413
|
-
return /* @__PURE__ */
|
|
7414
|
-
|
|
7454
|
+
return /* @__PURE__ */ jsxs35(
|
|
7455
|
+
Box10,
|
|
7415
7456
|
{
|
|
7416
7457
|
position: "sticky",
|
|
7417
7458
|
top: "0",
|
|
@@ -7435,8 +7476,8 @@ function KanbanBoard({
|
|
|
7435
7476
|
}
|
|
7436
7477
|
} : {},
|
|
7437
7478
|
children: [
|
|
7438
|
-
overColumn === c2.id && movingColumn && movingColumn !== c2.id && /* @__PURE__ */
|
|
7439
|
-
|
|
7479
|
+
overColumn === c2.id && movingColumn && movingColumn !== c2.id && /* @__PURE__ */ jsx49(
|
|
7480
|
+
Box10,
|
|
7440
7481
|
{
|
|
7441
7482
|
position: "absolute",
|
|
7442
7483
|
inset: "0",
|
|
@@ -7452,11 +7493,11 @@ function KanbanBoard({
|
|
|
7452
7493
|
roundedTop: "l3",
|
|
7453
7494
|
bg: "bg.panel",
|
|
7454
7495
|
"data-drop-column": "",
|
|
7455
|
-
children: /* @__PURE__ */
|
|
7496
|
+
children: /* @__PURE__ */ jsx49(Text15, { textStyle: "caption", fontWeight: "bold", color: "fg.accent", truncate: true, children: dropColumnLabel(movingName) })
|
|
7456
7497
|
}
|
|
7457
7498
|
),
|
|
7458
|
-
isFolded ? /* @__PURE__ */
|
|
7459
|
-
|
|
7499
|
+
isFolded ? /* @__PURE__ */ jsx49(
|
|
7500
|
+
Stack10,
|
|
7460
7501
|
{
|
|
7461
7502
|
align: "center",
|
|
7462
7503
|
gap: "2",
|
|
@@ -7468,9 +7509,9 @@ function KanbanBoard({
|
|
|
7468
7509
|
roundedTop: "l3",
|
|
7469
7510
|
bg: c2.over ? "red.subtle" : "bg.subtle",
|
|
7470
7511
|
h: "full",
|
|
7471
|
-
children: /* @__PURE__ */
|
|
7512
|
+
children: /* @__PURE__ */ jsx49(FoldButton, { folded: true, label: foldLabel(name, true), onClick: () => fold(c2.id) })
|
|
7472
7513
|
}
|
|
7473
|
-
) : /* @__PURE__ */
|
|
7514
|
+
) : /* @__PURE__ */ jsxs35(
|
|
7474
7515
|
HStack9,
|
|
7475
7516
|
{
|
|
7476
7517
|
justify: "space-between",
|
|
@@ -7487,8 +7528,8 @@ function KanbanBoard({
|
|
|
7487
7528
|
h: "full",
|
|
7488
7529
|
align: "start",
|
|
7489
7530
|
children: [
|
|
7490
|
-
/* @__PURE__ */
|
|
7491
|
-
onReorderColumns && !loading && /* @__PURE__ */
|
|
7531
|
+
/* @__PURE__ */ jsxs35(HStack9, { gap: "2", minW: "0", children: [
|
|
7532
|
+
onReorderColumns && !loading && /* @__PURE__ */ jsx49(
|
|
7492
7533
|
ColumnGrip,
|
|
7493
7534
|
{
|
|
7494
7535
|
label: reorderLabel(name, columns.findIndex((x) => x.id === c2.id) + 1, columns.length),
|
|
@@ -7501,11 +7542,11 @@ function KanbanBoard({
|
|
|
7501
7542
|
onStep: (by) => reorder(c2.id, columns.findIndex((x) => x.id === c2.id) + by)
|
|
7502
7543
|
}
|
|
7503
7544
|
),
|
|
7504
|
-
/* @__PURE__ */
|
|
7505
|
-
c2.count != null && /* @__PURE__ */
|
|
7506
|
-
c2.meta && /* @__PURE__ */
|
|
7545
|
+
/* @__PURE__ */ jsx49(Text15, { as: "span", textStyle: "label", truncate: true, display: "inline-flex", minW: "0", children: c2.title }),
|
|
7546
|
+
c2.count != null && /* @__PURE__ */ jsx49(CountBadge, { value: c2.count }),
|
|
7547
|
+
c2.meta && /* @__PURE__ */ jsx49(Text15, { textStyle: "caption", color: c2.over ? "fg.error" : "fg.muted", flexShrink: 0, children: c2.meta })
|
|
7507
7548
|
] }),
|
|
7508
|
-
!loading && /* @__PURE__ */
|
|
7549
|
+
!loading && /* @__PURE__ */ jsx49(FoldButton, { folded: false, label: foldLabel(name, false), onClick: () => fold(c2.id) })
|
|
7509
7550
|
]
|
|
7510
7551
|
}
|
|
7511
7552
|
)
|
|
@@ -7514,20 +7555,20 @@ function KanbanBoard({
|
|
|
7514
7555
|
c2.id
|
|
7515
7556
|
);
|
|
7516
7557
|
}),
|
|
7517
|
-
rows2.map((lane) => /* @__PURE__ */
|
|
7558
|
+
rows2.map((lane) => /* @__PURE__ */ jsx49(LaneRow, { lane, showTitle: !!lanes && lanes.length > 0, columns: shownColumns, span: shownColumns.length, children: shownColumns.map((c2, ci2) => {
|
|
7518
7559
|
const id = cellId(lane.id, c2.id);
|
|
7519
7560
|
const list = byCell.get(id) ?? [];
|
|
7520
7561
|
const allowed = active ? canDrop?.(active, c2.id, lane.id) !== false : true;
|
|
7521
7562
|
const last = lane.id === rows2[rows2.length - 1].id;
|
|
7522
7563
|
if (folded.has(c2.id)) {
|
|
7523
|
-
return /* @__PURE__ */
|
|
7524
|
-
lane.id === rows2[0].id && c2.count != null && /* @__PURE__ */
|
|
7525
|
-
lane.id === rows2[0].id && /* @__PURE__ */
|
|
7564
|
+
return /* @__PURE__ */ jsxs35(Cell, { id, allowed, dragging: !!active, items: [], column: c2.id, lane: lane.id, folded: true, last, children: [
|
|
7565
|
+
lane.id === rows2[0].id && c2.count != null && /* @__PURE__ */ jsx49(Box10, { alignSelf: "center", children: /* @__PURE__ */ jsx49(CountBadge, { value: c2.count }) }),
|
|
7566
|
+
lane.id === rows2[0].id && /* @__PURE__ */ jsx49(Box10, { css: { writingMode: "vertical-rl" }, alignSelf: "center", maxH: "56", overflow: "hidden", textStyle: "sm", title: c2.name, children: c2.title })
|
|
7526
7567
|
] }, id);
|
|
7527
7568
|
}
|
|
7528
7569
|
const footer = last && !loading ? columnFooter?.(c2.id) : null;
|
|
7529
|
-
return /* @__PURE__ */
|
|
7530
|
-
list.map((item) => /* @__PURE__ */
|
|
7570
|
+
return /* @__PURE__ */ jsxs35(Cell, { id, allowed, dragging: !!active, items: list.map((i) => i.id), column: c2.id, lane: lane.id, last, children: [
|
|
7571
|
+
list.map((item) => /* @__PURE__ */ jsx49(
|
|
7531
7572
|
SortableCard,
|
|
7532
7573
|
{
|
|
7533
7574
|
id: item.id,
|
|
@@ -7539,8 +7580,8 @@ function KanbanBoard({
|
|
|
7539
7580
|
item.id
|
|
7540
7581
|
)),
|
|
7541
7582
|
loading && list.length === 0 && // Not the board's cards: no data-slide, and not in its placement (ADR 0058's slides skip them).
|
|
7542
|
-
Array.from({ length: SKELETON_CARDS[ci2 % SKELETON_CARDS.length] }, (_, n) => /* @__PURE__ */
|
|
7543
|
-
!loading && list.length === 0 && empty && (typeof empty === "function" ? /* @__PURE__ */
|
|
7583
|
+
Array.from({ length: SKELETON_CARDS[ci2 % SKELETON_CARDS.length] }, (_, n) => /* @__PURE__ */ jsx49(Box10, { "aria-hidden": "true", children: skeletonCard ? skeletonCard(ci2 * 5 + n) : /* @__PURE__ */ jsx49(PlaceholderCard, { index: ci2 * 5 + n }) }, `skeleton-${n}`)),
|
|
7584
|
+
!loading && list.length === 0 && empty && (typeof empty === "function" ? /* @__PURE__ */ jsx49(EmptyState, { size: "xs", ...empty(c2.id) }) : /* @__PURE__ */ jsx49(EmptyState, { size: "xs", title: empty })),
|
|
7544
7585
|
footer
|
|
7545
7586
|
] }, id);
|
|
7546
7587
|
}) }, lane.id))
|
|
@@ -7549,24 +7590,24 @@ function KanbanBoard({
|
|
|
7549
7590
|
) })
|
|
7550
7591
|
}
|
|
7551
7592
|
),
|
|
7552
|
-
/* @__PURE__ */
|
|
7593
|
+
/* @__PURE__ */ jsx49(DragOverlay2, { dropAnimation: reduce ? null : landing, children: active ? /* @__PURE__ */ jsx49(Lifted, { carried: carried.length, reduce, count: carried.length > 1 ? carrying ? carrying(carried.length) : String(carried.length) : void 0, children: renderCard(active, { dragging: true }) }) : null })
|
|
7553
7594
|
]
|
|
7554
7595
|
}
|
|
7555
7596
|
);
|
|
7556
7597
|
}
|
|
7557
7598
|
function LaneRow({ lane, showTitle, span, children }) {
|
|
7558
|
-
return /* @__PURE__ */
|
|
7559
|
-
showTitle && /* @__PURE__ */
|
|
7560
|
-
/* @__PURE__ */
|
|
7561
|
-
lane.meta && /* @__PURE__ */
|
|
7599
|
+
return /* @__PURE__ */ jsxs35(Fragment17, { children: [
|
|
7600
|
+
showTitle && /* @__PURE__ */ jsxs35(HStack9, { gridColumn: `1 / span ${span}`, gap: "2", pt: "2", borderTopWidth: "1px", borderColor: "border.muted", "data-lane": lane.id, children: [
|
|
7601
|
+
/* @__PURE__ */ jsx49(Text15, { textStyle: "label", children: lane.title }),
|
|
7602
|
+
lane.meta && /* @__PURE__ */ jsx49(Text15, { textStyle: "caption", color: "fg.muted", children: lane.meta })
|
|
7562
7603
|
] }),
|
|
7563
7604
|
children
|
|
7564
7605
|
] });
|
|
7565
7606
|
}
|
|
7566
7607
|
function Cell({ id, items, allowed, dragging, column, lane, folded = false, last = true, children }) {
|
|
7567
7608
|
const { setNodeRef, isOver } = useDroppable2({ id, disabled: !allowed });
|
|
7568
|
-
return /* @__PURE__ */
|
|
7569
|
-
|
|
7609
|
+
return /* @__PURE__ */ jsx49(SortableContext, { id, items, strategy: verticalListSortingStrategy, children: /* @__PURE__ */ jsx49(
|
|
7610
|
+
Stack10,
|
|
7570
7611
|
{
|
|
7571
7612
|
ref: setNodeRef,
|
|
7572
7613
|
gap: "2",
|
|
@@ -7594,8 +7635,8 @@ function SortableCard({
|
|
|
7594
7635
|
children
|
|
7595
7636
|
}) {
|
|
7596
7637
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = useSortable({ id, animateLayoutChanges: () => false });
|
|
7597
|
-
return /* @__PURE__ */
|
|
7598
|
-
|
|
7638
|
+
return /* @__PURE__ */ jsxs35(
|
|
7639
|
+
Box10,
|
|
7599
7640
|
{
|
|
7600
7641
|
ref: setNodeRef,
|
|
7601
7642
|
position: "relative",
|
|
@@ -7613,8 +7654,8 @@ function SortableCard({
|
|
|
7613
7654
|
cursor: "grab",
|
|
7614
7655
|
_focusVisible: { outline: "2px solid", outlineColor: "colorPalette.focusRing", rounded: "l2" },
|
|
7615
7656
|
children: [
|
|
7616
|
-
/* @__PURE__ */
|
|
7617
|
-
selected && !isDragging && !riding && /* @__PURE__ */
|
|
7657
|
+
/* @__PURE__ */ jsx49(Box10, { "data-slide": id, children: children(isDragging) }),
|
|
7658
|
+
selected && !isDragging && !riding && /* @__PURE__ */ jsx49(Mark, {})
|
|
7618
7659
|
]
|
|
7619
7660
|
}
|
|
7620
7661
|
);
|
|
@@ -7642,9 +7683,9 @@ function Lifted({ carried, count, reduce, children }) {
|
|
|
7642
7683
|
held.current?.animate?.([{ transform: "none", boxShadow: tv("shadows.sm") }, { transform: HELD, boxShadow: tv("shadows.xl") }], { duration: 160, easing: OUT2 });
|
|
7643
7684
|
}, []);
|
|
7644
7685
|
const layers = Math.min(2, Math.max(0, carried - 1));
|
|
7645
|
-
return /* @__PURE__ */
|
|
7646
|
-
Array.from({ length: layers }, (_, i) => /* @__PURE__ */
|
|
7647
|
-
|
|
7686
|
+
return /* @__PURE__ */ jsxs35(Box10, { position: "relative", cursor: "grabbing", "data-testid": "drag-preview", children: [
|
|
7687
|
+
Array.from({ length: layers }, (_, i) => /* @__PURE__ */ jsx49(
|
|
7688
|
+
Box10,
|
|
7648
7689
|
{
|
|
7649
7690
|
"data-layer": true,
|
|
7650
7691
|
position: "absolute",
|
|
@@ -7658,8 +7699,8 @@ function Lifted({ carried, count, reduce, children }) {
|
|
|
7658
7699
|
},
|
|
7659
7700
|
i
|
|
7660
7701
|
)),
|
|
7661
|
-
/* @__PURE__ */
|
|
7662
|
-
count != null && /* @__PURE__ */
|
|
7702
|
+
/* @__PURE__ */ jsx49(Box10, { ref: held, "data-held": true, rounded: "l2", shadow: reduce ? "lg" : "xl", style: { transform: reduce ? void 0 : HELD, transformOrigin: "50% 40%" }, children }),
|
|
7703
|
+
count != null && /* @__PURE__ */ jsx49(Count, { children: count })
|
|
7663
7704
|
] });
|
|
7664
7705
|
}
|
|
7665
7706
|
function Mark() {
|
|
@@ -7672,8 +7713,8 @@ function Mark() {
|
|
|
7672
7713
|
easing: OUT2
|
|
7673
7714
|
});
|
|
7674
7715
|
}, []);
|
|
7675
|
-
return /* @__PURE__ */
|
|
7676
|
-
|
|
7716
|
+
return /* @__PURE__ */ jsx49(
|
|
7717
|
+
chakra28.span,
|
|
7677
7718
|
{
|
|
7678
7719
|
ref,
|
|
7679
7720
|
position: "absolute",
|
|
@@ -7689,13 +7730,13 @@ function Mark() {
|
|
|
7689
7730
|
pointerEvents: "none",
|
|
7690
7731
|
"aria-hidden": "true",
|
|
7691
7732
|
_icon: { boxSize: "3" },
|
|
7692
|
-
children: /* @__PURE__ */
|
|
7733
|
+
children: /* @__PURE__ */ jsx49(Check2, { strokeWidth: 3 })
|
|
7693
7734
|
}
|
|
7694
7735
|
);
|
|
7695
7736
|
}
|
|
7696
7737
|
function Count({ children }) {
|
|
7697
|
-
return /* @__PURE__ */
|
|
7698
|
-
|
|
7738
|
+
return /* @__PURE__ */ jsx49(
|
|
7739
|
+
chakra28.span,
|
|
7699
7740
|
{
|
|
7700
7741
|
position: "absolute",
|
|
7701
7742
|
top: "-3.5",
|
|
@@ -7717,8 +7758,8 @@ function Count({ children }) {
|
|
|
7717
7758
|
);
|
|
7718
7759
|
}
|
|
7719
7760
|
function FoldButton({ folded, label, onClick }) {
|
|
7720
|
-
return /* @__PURE__ */
|
|
7721
|
-
|
|
7761
|
+
return /* @__PURE__ */ jsx49(
|
|
7762
|
+
chakra28.button,
|
|
7722
7763
|
{
|
|
7723
7764
|
type: "button",
|
|
7724
7765
|
display: "inline-flex",
|
|
@@ -7738,7 +7779,7 @@ function FoldButton({ folded, label, onClick }) {
|
|
|
7738
7779
|
title: label,
|
|
7739
7780
|
"aria-expanded": !folded,
|
|
7740
7781
|
onClick,
|
|
7741
|
-
children: /* @__PURE__ */
|
|
7782
|
+
children: /* @__PURE__ */ jsx49(DirectionalIcon, { children: folded ? /* @__PURE__ */ jsx49(ChevronsRight, { size: 16 }) : /* @__PURE__ */ jsx49(ChevronsLeft, { size: 16 }) })
|
|
7742
7783
|
}
|
|
7743
7784
|
);
|
|
7744
7785
|
}
|
|
@@ -7768,8 +7809,8 @@ function useFolded(key) {
|
|
|
7768
7809
|
return [folded, fold];
|
|
7769
7810
|
}
|
|
7770
7811
|
function ColumnGrip({ label, moving, onDragStart, onDragEnd, onStep }) {
|
|
7771
|
-
return /* @__PURE__ */
|
|
7772
|
-
|
|
7812
|
+
return /* @__PURE__ */ jsx49(
|
|
7813
|
+
chakra28.button,
|
|
7773
7814
|
{
|
|
7774
7815
|
type: "button",
|
|
7775
7816
|
draggable: true,
|
|
@@ -7802,27 +7843,27 @@ function ColumnGrip({ label, moving, onDragStart, onDragEnd, onStep }) {
|
|
|
7802
7843
|
onDragStart();
|
|
7803
7844
|
},
|
|
7804
7845
|
onDragEnd,
|
|
7805
|
-
children: /* @__PURE__ */
|
|
7846
|
+
children: /* @__PURE__ */ jsx49(GripVertical3, {})
|
|
7806
7847
|
}
|
|
7807
7848
|
);
|
|
7808
7849
|
}
|
|
7809
7850
|
|
|
7810
7851
|
// src/components/LoadingState.tsx
|
|
7811
|
-
import { Box as
|
|
7812
|
-
import { jsx as
|
|
7852
|
+
import { Box as Box11, VisuallyHidden as VisuallyHidden2 } from "@chakra-ui/react";
|
|
7853
|
+
import { jsx as jsx50, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7813
7854
|
function LoadingState({ lines = 3, label }) {
|
|
7814
7855
|
const labels = useAbpLabels();
|
|
7815
|
-
return /* @__PURE__ */
|
|
7816
|
-
/* @__PURE__ */
|
|
7817
|
-
/* @__PURE__ */
|
|
7856
|
+
return /* @__PURE__ */ jsxs36(Box11, { "aria-busy": "true", role: "status", children: [
|
|
7857
|
+
/* @__PURE__ */ jsx50(VisuallyHidden2, { children: label ?? labels.loading }),
|
|
7858
|
+
/* @__PURE__ */ jsx50(TextBone, { lines, width: "full" })
|
|
7818
7859
|
] });
|
|
7819
7860
|
}
|
|
7820
7861
|
|
|
7821
7862
|
// src/components/PageHeader.tsx
|
|
7822
7863
|
import { Fragment as Fragment18 } from "react";
|
|
7823
|
-
import { Breadcrumb, chakra as
|
|
7864
|
+
import { Breadcrumb, chakra as chakra29, Menu as Menu3, Portal as Portal13, useSlotRecipe as useSlotRecipe4 } from "@chakra-ui/react";
|
|
7824
7865
|
import { ChevronRight as ChevronRight3 } from "lucide-react";
|
|
7825
|
-
import { jsx as
|
|
7866
|
+
import { jsx as jsx51, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
7826
7867
|
var textOf = (label) => typeof label === "string" || typeof label === "number" ? String(label) : void 0;
|
|
7827
7868
|
function PageHeader({ title, description, breadcrumbs, meta, count, adornments, actions, loading: own, titleWidth = 24, documentTitle }) {
|
|
7828
7869
|
const recipe = useSlotRecipe4({ key: "abpPageHeader" });
|
|
@@ -7831,33 +7872,33 @@ function PageHeader({ title, description, breadcrumbs, meta, count, adornments,
|
|
|
7831
7872
|
usePageTitle(documentTitle !== void 0 ? documentTitle : text ? [text, where] : null);
|
|
7832
7873
|
const styles = recipe({});
|
|
7833
7874
|
const loading = useLoading(own);
|
|
7834
|
-
return /* @__PURE__ */
|
|
7835
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */
|
|
7836
|
-
/* @__PURE__ */
|
|
7837
|
-
/* @__PURE__ */
|
|
7838
|
-
count != null || adornments != null ? /* @__PURE__ */
|
|
7839
|
-
/* @__PURE__ */
|
|
7840
|
-
count != null && /* @__PURE__ */
|
|
7875
|
+
return /* @__PURE__ */ jsxs37(chakra29.div, { css: styles.root, children: [
|
|
7876
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx51(Breadcrumbs, { items: breadcrumbs }),
|
|
7877
|
+
/* @__PURE__ */ jsxs37(chakra29.div, { css: styles.row, children: [
|
|
7878
|
+
/* @__PURE__ */ jsxs37(chakra29.div, { css: styles.titleGroup, children: [
|
|
7879
|
+
count != null || adornments != null ? /* @__PURE__ */ jsxs37(chakra29.div, { display: "flex", alignItems: "center", gap: "2.5", flexWrap: "wrap", minW: "0", children: [
|
|
7880
|
+
/* @__PURE__ */ jsx51(chakra29.h1, { css: styles.title, children: loading && title == null ? /* @__PURE__ */ jsx51(TextBone, { width: titleWidth }) : title }),
|
|
7881
|
+
count != null && /* @__PURE__ */ jsx51(CountBadge, { value: count, size: "md" }),
|
|
7841
7882
|
adornments
|
|
7842
|
-
] }) : /* @__PURE__ */
|
|
7843
|
-
meta != null && /* @__PURE__ */
|
|
7844
|
-
description != null && /* @__PURE__ */
|
|
7883
|
+
] }) : /* @__PURE__ */ jsx51(chakra29.h1, { css: styles.title, children: loading && title == null ? /* @__PURE__ */ jsx51(TextBone, { width: titleWidth }) : title }),
|
|
7884
|
+
meta != null && /* @__PURE__ */ jsx51(chakra29.div, { css: styles.meta, children: meta }),
|
|
7885
|
+
description != null && /* @__PURE__ */ jsx51(chakra29.p, { css: styles.description, children: description })
|
|
7845
7886
|
] }),
|
|
7846
|
-
actions != null && /* @__PURE__ */
|
|
7887
|
+
actions != null && /* @__PURE__ */ jsx51(chakra29.div, { css: styles.actions, children: actions })
|
|
7847
7888
|
] })
|
|
7848
7889
|
] });
|
|
7849
7890
|
}
|
|
7850
7891
|
function Breadcrumbs({ items, loading: own }) {
|
|
7851
7892
|
const labels = useAbpLabels();
|
|
7852
7893
|
const loading = useLoading(own);
|
|
7853
|
-
const label = (item, i) => loading && item.label == null ? /* @__PURE__ */
|
|
7894
|
+
const label = (item, i) => loading && item.label == null ? /* @__PURE__ */ jsx51(TextBone, { width: 8 + i % 3 * 3 }) : item.label;
|
|
7854
7895
|
const Link = useLinkComponent();
|
|
7855
7896
|
const { shown, hidden } = foldBreadcrumbs(items);
|
|
7856
|
-
return /* @__PURE__ */
|
|
7857
|
-
n > 0 && /* @__PURE__ */
|
|
7858
|
-
entry == null ? /* @__PURE__ */
|
|
7859
|
-
/* @__PURE__ */
|
|
7860
|
-
|
|
7897
|
+
return /* @__PURE__ */ jsx51(Breadcrumb.Root, { "aria-label": labels.breadcrumb, children: /* @__PURE__ */ jsx51(Breadcrumb.List, { children: shown.map((entry, n) => /* @__PURE__ */ jsxs37(Fragment18, { children: [
|
|
7898
|
+
n > 0 && /* @__PURE__ */ jsx51(Breadcrumb.Separator, { children: /* @__PURE__ */ jsx51(ChevronRight3, {}) }),
|
|
7899
|
+
entry == null ? /* @__PURE__ */ jsx51(Breadcrumb.Item, { children: /* @__PURE__ */ jsxs37(Menu3.Root, { positioning: { placement: "bottom-start" }, children: [
|
|
7900
|
+
/* @__PURE__ */ jsx51(Menu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx51(
|
|
7901
|
+
chakra29.button,
|
|
7861
7902
|
{
|
|
7862
7903
|
type: "button",
|
|
7863
7904
|
px: "1",
|
|
@@ -7871,74 +7912,74 @@ function Breadcrumbs({ items, loading: own }) {
|
|
|
7871
7912
|
children: "\u2026"
|
|
7872
7913
|
}
|
|
7873
7914
|
) }),
|
|
7874
|
-
/* @__PURE__ */
|
|
7875
|
-
] }) }) : /* @__PURE__ */
|
|
7915
|
+
/* @__PURE__ */ jsx51(Portal13, { children: /* @__PURE__ */ jsx51(Menu3.Positioner, { children: /* @__PURE__ */ jsx51(Menu3.Content, { minW: "40", children: hidden.map((h, k) => /* @__PURE__ */ jsx51(Menu3.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
|
+
] }) }) : /* @__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) }) })
|
|
7876
7917
|
] }, entry ? entry.index : "more")) }) });
|
|
7877
7918
|
}
|
|
7878
7919
|
|
|
7879
7920
|
// src/components/Panel.tsx
|
|
7880
7921
|
import { createContext as createContext11, forwardRef as forwardRef8, useContext as useContext11 } from "react";
|
|
7881
|
-
import { chakra as
|
|
7882
|
-
import { jsx as
|
|
7922
|
+
import { chakra as chakra30, useSlotRecipe as useSlotRecipe5 } from "@chakra-ui/react";
|
|
7923
|
+
import { jsx as jsx52, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
7883
7924
|
var ToneContext = createContext11("card");
|
|
7884
7925
|
function PanelTone({ tone, children }) {
|
|
7885
|
-
return /* @__PURE__ */
|
|
7926
|
+
return /* @__PURE__ */ jsx52(ToneContext.Provider, { value: tone, children });
|
|
7886
7927
|
}
|
|
7887
7928
|
var Panel = forwardRef8(function Panel2({ title, description, actions, footer, flush = false, headingAs = "h2", loading, tone, children, css, ...rest }, ref) {
|
|
7888
7929
|
const recipe = useSlotRecipe5({ key: "abpPanel" });
|
|
7889
7930
|
const inherited = useContext11(ToneContext);
|
|
7890
7931
|
const styles = recipe({ flush, tone: tone ?? inherited });
|
|
7891
7932
|
const hasHeader = title != null || actions != null || description != null;
|
|
7892
|
-
return /* @__PURE__ */
|
|
7893
|
-
hasHeader && /* @__PURE__ */
|
|
7894
|
-
/* @__PURE__ */
|
|
7895
|
-
title != null && /* @__PURE__ */
|
|
7896
|
-
description != null && /* @__PURE__ */
|
|
7933
|
+
return /* @__PURE__ */ jsxs38(chakra30.section, { ref, css: [styles.root, css], ...rest, children: [
|
|
7934
|
+
hasHeader && /* @__PURE__ */ jsxs38(chakra30.header, { css: styles.header, children: [
|
|
7935
|
+
/* @__PURE__ */ jsxs38(chakra30.div, { css: styles.titleGroup, children: [
|
|
7936
|
+
title != null && /* @__PURE__ */ jsx52(chakra30.h2, { as: headingAs, css: styles.title, children: title }),
|
|
7937
|
+
description != null && /* @__PURE__ */ jsx52(chakra30.p, { css: styles.description, children: description })
|
|
7897
7938
|
] }),
|
|
7898
|
-
actions != null && /* @__PURE__ */
|
|
7939
|
+
actions != null && /* @__PURE__ */ jsx52(chakra30.div, { css: styles.actions, children: actions })
|
|
7899
7940
|
] }),
|
|
7900
|
-
/* @__PURE__ */
|
|
7901
|
-
footer != null && /* @__PURE__ */
|
|
7941
|
+
/* @__PURE__ */ jsx52(chakra30.div, { css: styles.body, children: loading === void 0 ? children : /* @__PURE__ */ jsx52(Loading, { when: loading, children }) }),
|
|
7942
|
+
footer != null && /* @__PURE__ */ jsx52(chakra30.footer, { css: styles.footer, children: footer })
|
|
7902
7943
|
] });
|
|
7903
7944
|
});
|
|
7904
7945
|
|
|
7905
7946
|
// src/components/PathChips.tsx
|
|
7906
|
-
import { chakra as
|
|
7947
|
+
import { chakra as chakra31, useSlotRecipe as useSlotRecipe6 } from "@chakra-ui/react";
|
|
7907
7948
|
import { ChevronRight as ChevronRight4 } from "lucide-react";
|
|
7908
|
-
import { jsx as
|
|
7949
|
+
import { jsx as jsx53, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
7909
7950
|
function PathChips({ path, highlightLast = true, loading: own, skeletonCount = 3, css, ...rest }) {
|
|
7910
7951
|
const labels = useAbpLabels();
|
|
7911
7952
|
const recipe = useSlotRecipe6({ key: "abpPathChips" });
|
|
7912
7953
|
const styles = recipe({});
|
|
7913
7954
|
const loading = useLoading(own) && path.length === 0;
|
|
7914
7955
|
const segments = loading ? Array.from({ length: skeletonCount }, (_, i) => "\xA0".repeat(boneWidth(i, 6, 12))) : path;
|
|
7915
|
-
return /* @__PURE__ */
|
|
7916
|
-
i > 0 && /* @__PURE__ */
|
|
7917
|
-
/* @__PURE__ */
|
|
7956
|
+
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(ChevronRight4, {}) }),
|
|
7958
|
+
/* @__PURE__ */ jsx53(chakra31.span, { css: loading ? [styles.chip, ghostCss] : styles.chip, "aria-current": !loading && highlightLast && i === path.length - 1 ? true : void 0, children: segment })
|
|
7918
7959
|
] }, `${i}:${segment}`)) });
|
|
7919
7960
|
}
|
|
7920
7961
|
|
|
7921
7962
|
// src/components/PropertyList.tsx
|
|
7922
|
-
import { chakra as
|
|
7923
|
-
import { jsx as
|
|
7963
|
+
import { chakra as chakra32, DataList } from "@chakra-ui/react";
|
|
7964
|
+
import { jsx as jsx54, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
7924
7965
|
function PropertyList({ items, size = "md", loading: own }) {
|
|
7925
7966
|
const loading = useLoading(own);
|
|
7926
7967
|
const arriving = useArriving(loading);
|
|
7927
|
-
return /* @__PURE__ */
|
|
7928
|
-
/* @__PURE__ */
|
|
7929
|
-
/* @__PURE__ */
|
|
7968
|
+
return /* @__PURE__ */ jsx54(DataList.Root, { orientation: "horizontal", size, children: items.map((item, i) => /* @__PURE__ */ jsxs40(DataList.Item, { children: [
|
|
7969
|
+
/* @__PURE__ */ jsx54(DataList.ItemLabel, { children: item.label }),
|
|
7970
|
+
/* @__PURE__ */ jsx54(DataList.ItemValue, { children: loading && item.value == null ? /* @__PURE__ */ jsx54(TextBone, { width: item.skeletonWidth ?? boneWidth(i, 8, 16) }) : arriving ? /* @__PURE__ */ jsx54(chakra32.span, { css: arriveCss, children: item.value }) : item.value })
|
|
7930
7971
|
] }, item.id ?? i)) });
|
|
7931
7972
|
}
|
|
7932
7973
|
|
|
7933
7974
|
// src/components/QueryableList.tsx
|
|
7934
|
-
import { useEffect as useEffect16, useId as
|
|
7975
|
+
import { useEffect as useEffect16, useId as useId8, useMemo as useMemo12, useRef as useRef19, useState as useState22 } from "react";
|
|
7935
7976
|
import { createPortal } from "react-dom";
|
|
7936
|
-
import { Box as
|
|
7977
|
+
import { Box as Box12, chakra as chakra34, HStack as HStack12, Input as Input7, Menu as Menu4, Portal as Portal16, Stack as Stack13, Text as Text18 } from "@chakra-ui/react";
|
|
7937
7978
|
import { ArrowDownWideNarrow, ArrowUpNarrowWide, ChevronDown as ChevronDown3, Download, Filter, Rows3, Save, Trash2 as Trash22, X as X2 } from "lucide-react";
|
|
7938
7979
|
|
|
7939
7980
|
// src/components/query/ColumnsPopover.tsx
|
|
7940
7981
|
import { useMemo as useMemo11 } from "react";
|
|
7941
|
-
import { chakra as
|
|
7982
|
+
import { chakra as chakra33, HStack as HStack10, Popover as Popover3, Portal as Portal14, Stack as Stack11, Switch as Switch2, Text as Text16 } from "@chakra-ui/react";
|
|
7942
7983
|
import {
|
|
7943
7984
|
closestCenter,
|
|
7944
7985
|
DndContext as DndContext3,
|
|
@@ -7950,7 +7991,7 @@ import {
|
|
|
7950
7991
|
import { arrayMove, SortableContext as SortableContext2, sortableKeyboardCoordinates as sortableKeyboardCoordinates2, useSortable as useSortable2, verticalListSortingStrategy as verticalListSortingStrategy2 } from "@dnd-kit/sortable";
|
|
7951
7992
|
import { CSS as CSS3 } from "@dnd-kit/utilities";
|
|
7952
7993
|
import { Columns3, GripVertical as GripVertical4 } from "lucide-react";
|
|
7953
|
-
import { jsx as
|
|
7994
|
+
import { jsx as jsx55, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
7954
7995
|
function fill2(template, values) {
|
|
7955
7996
|
return template.replace(/\{(\w+)\}/g, (_, k) => values[k] ?? `{${k}}`);
|
|
7956
7997
|
}
|
|
@@ -7967,19 +8008,19 @@ function ColumnsPopover({ fields, columns, onChange }) {
|
|
|
7967
8008
|
if (from < 0 || to < 0) return;
|
|
7968
8009
|
onChange(arrayMove(columns, from, to));
|
|
7969
8010
|
}
|
|
7970
|
-
return /* @__PURE__ */
|
|
7971
|
-
/* @__PURE__ */
|
|
7972
|
-
/* @__PURE__ */
|
|
8011
|
+
return /* @__PURE__ */ jsxs41(Popover3.Root, { positioning: { placement: "bottom-end" }, lazyMount: true, unmountOnExit: true, children: [
|
|
8012
|
+
/* @__PURE__ */ jsx55(Popover3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs41(Button, { size: "sm", variant: "secondary", disabled: fields.length === 0, children: [
|
|
8013
|
+
/* @__PURE__ */ jsx55(Columns3, {}),
|
|
7973
8014
|
labels.columns
|
|
7974
8015
|
] }) }),
|
|
7975
|
-
/* @__PURE__ */
|
|
7976
|
-
/* @__PURE__ */
|
|
7977
|
-
/* @__PURE__ */
|
|
7978
|
-
/* @__PURE__ */
|
|
8016
|
+
/* @__PURE__ */ jsx55(Portal14, { children: /* @__PURE__ */ jsx55(Popover3.Positioner, { children: /* @__PURE__ */ jsx55(Popover3.Content, { w: "80", maxW: "calc(100vw - 2rem)", children: /* @__PURE__ */ jsxs41(Popover3.Body, { p: "0", children: [
|
|
8017
|
+
/* @__PURE__ */ jsxs41(HStack10, { justify: "space-between", px: "3.5", pt: "3", pb: "1", children: [
|
|
8018
|
+
/* @__PURE__ */ jsx55(Text16, { textStyle: "sm", fontWeight: "semibold", children: labels.visibleColumns }),
|
|
8019
|
+
/* @__PURE__ */ jsx55(Button, { size: "xs", variant: "ghost", disabled: hidden.length === 0, onClick: () => onChange([...columns, ...hidden.map((f) => f.id)]), children: labels.showAllColumns })
|
|
7979
8020
|
] }),
|
|
7980
|
-
/* @__PURE__ */
|
|
7981
|
-
/* @__PURE__ */
|
|
7982
|
-
/* @__PURE__ */
|
|
8021
|
+
/* @__PURE__ */ jsx55(Text16, { textStyle: "caption", color: "fg.muted", px: "3.5", pb: "2", children: labels.columnsHint }),
|
|
8022
|
+
/* @__PURE__ */ jsxs41(chakra33.div, { maxH: "80", overflowY: "auto", pb: "2", children: [
|
|
8023
|
+
/* @__PURE__ */ jsx55(DndContext3, { sensors, collisionDetection: closestCenter, onDragEnd, children: /* @__PURE__ */ jsx55(SortableContext2, { items: shown, strategy: verticalListSortingStrategy2, children: /* @__PURE__ */ jsx55(Stack11, { gap: "0", role: "list", "aria-label": labels.visibleColumns, children: shown.map((id) => /* @__PURE__ */ jsx55(
|
|
7983
8024
|
ColumnRow,
|
|
7984
8025
|
{
|
|
7985
8026
|
id,
|
|
@@ -7990,7 +8031,7 @@ function ColumnsPopover({ fields, columns, onChange }) {
|
|
|
7990
8031
|
},
|
|
7991
8032
|
id
|
|
7992
8033
|
)) }) }) }),
|
|
7993
|
-
hidden.length > 0 && /* @__PURE__ */
|
|
8034
|
+
hidden.length > 0 && /* @__PURE__ */ jsx55(Stack11, { gap: "0", borderTopWidth: "1px", borderColor: "border.muted", mt: "1", pt: "1", role: "list", "aria-label": labels.hiddenColumns, children: hidden.map((f) => /* @__PURE__ */ jsx55(ColumnRow, { id: f.id, label: f.label, checked: false, onCheckedChange: () => onChange([...columns, f.id]) }, f.id)) })
|
|
7994
8035
|
] })
|
|
7995
8036
|
] }) }) }) })
|
|
7996
8037
|
] });
|
|
@@ -7999,7 +8040,7 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
7999
8040
|
const labels = useAbpLabels().queryList;
|
|
8000
8041
|
const sortable = useSortable2({ id, disabled: !checked });
|
|
8001
8042
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = sortable;
|
|
8002
|
-
return /* @__PURE__ */
|
|
8043
|
+
return /* @__PURE__ */ jsxs41(
|
|
8003
8044
|
HStack10,
|
|
8004
8045
|
{
|
|
8005
8046
|
ref: setNodeRef,
|
|
@@ -8016,8 +8057,8 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
8016
8057
|
style: { transform: CSS3.Transform.toString(transform), transition },
|
|
8017
8058
|
_hover: { bg: "bg.subtle" },
|
|
8018
8059
|
children: [
|
|
8019
|
-
checked ? /* @__PURE__ */
|
|
8020
|
-
|
|
8060
|
+
checked ? /* @__PURE__ */ jsx55(
|
|
8061
|
+
chakra33.button,
|
|
8021
8062
|
{
|
|
8022
8063
|
type: "button",
|
|
8023
8064
|
display: "inline-flex",
|
|
@@ -8029,13 +8070,13 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
8029
8070
|
"aria-label": fill2(labels.dragColumn, { field: label }),
|
|
8030
8071
|
...attributes,
|
|
8031
8072
|
...listeners2,
|
|
8032
|
-
children: /* @__PURE__ */
|
|
8073
|
+
children: /* @__PURE__ */ jsx55(GripVertical4, { size: 16 })
|
|
8033
8074
|
}
|
|
8034
|
-
) : /* @__PURE__ */
|
|
8035
|
-
/* @__PURE__ */
|
|
8036
|
-
/* @__PURE__ */
|
|
8037
|
-
/* @__PURE__ */
|
|
8038
|
-
/* @__PURE__ */
|
|
8075
|
+
) : /* @__PURE__ */ jsx55(chakra33.span, { w: "4", flexShrink: 0 }),
|
|
8076
|
+
/* @__PURE__ */ jsx55(Text16, { as: "span", flex: "1", textStyle: "sm", truncate: true, color: checked ? "fg" : "fg.muted", children: label }),
|
|
8077
|
+
/* @__PURE__ */ jsxs41(Switch2.Root, { size: "sm", colorPalette: "accent", checked, disabled, onCheckedChange, "aria-label": label, children: [
|
|
8078
|
+
/* @__PURE__ */ jsx55(Switch2.HiddenInput, {}),
|
|
8079
|
+
/* @__PURE__ */ jsx55(Switch2.Control, { children: /* @__PURE__ */ jsx55(Switch2.Thumb, {}) })
|
|
8039
8080
|
] })
|
|
8040
8081
|
]
|
|
8041
8082
|
}
|
|
@@ -8043,10 +8084,10 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
8043
8084
|
}
|
|
8044
8085
|
|
|
8045
8086
|
// src/components/query/FilterBuilder.tsx
|
|
8046
|
-
import { useEffect as useEffect15, useId as
|
|
8047
|
-
import { CloseButton as CloseButton3, Dialog as Dialog5, HStack as HStack11, Input as Input6, Portal as Portal15, Stack as
|
|
8087
|
+
import { useEffect as useEffect15, useId as useId7, useRef as useRef18, useState as useState21 } from "react";
|
|
8088
|
+
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";
|
|
8048
8089
|
import { Trash2 } from "lucide-react";
|
|
8049
|
-
import { Fragment as Fragment19, jsx as
|
|
8090
|
+
import { Fragment as Fragment19, jsx as jsx56, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
8050
8091
|
function fill3(template, values) {
|
|
8051
8092
|
return template.replace(/\{(\w+)\}/g, (_, k) => String(values[k] ?? `{${k}}`));
|
|
8052
8093
|
}
|
|
@@ -8102,23 +8143,23 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8102
8143
|
setSeq((n) => n + 1);
|
|
8103
8144
|
};
|
|
8104
8145
|
const change = (id, patch) => setRows((r) => r.map((d) => d.id === id ? { ...d, ...patch, dirty: true } : d));
|
|
8105
|
-
return /* @__PURE__ */
|
|
8106
|
-
/* @__PURE__ */
|
|
8107
|
-
/* @__PURE__ */
|
|
8108
|
-
/* @__PURE__ */
|
|
8109
|
-
/* @__PURE__ */
|
|
8110
|
-
/* @__PURE__ */
|
|
8146
|
+
return /* @__PURE__ */ jsx56(Dialog5.Root, { open: true, onOpenChange: (e) => !e.open && onClose(), size: "lg", placement: "center", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs42(Portal15, { children: [
|
|
8147
|
+
/* @__PURE__ */ jsx56(Dialog5.Backdrop, {}),
|
|
8148
|
+
/* @__PURE__ */ jsx56(Dialog5.Positioner, { children: /* @__PURE__ */ jsxs42(Dialog5.Content, { "data-filter-builder": "", children: [
|
|
8149
|
+
/* @__PURE__ */ jsx56(Dialog5.Header, { children: /* @__PURE__ */ jsxs42(HStack11, { justify: "space-between", w: "full", gap: "3", children: [
|
|
8150
|
+
/* @__PURE__ */ jsx56(Dialog5.Title, { children: labels.buildFilters }),
|
|
8151
|
+
/* @__PURE__ */ jsx56(Button, { size: "xs", variant: "ghost", onClick: () => setRows([]), disabled: rows2.length === 0, children: labels.clearAll })
|
|
8111
8152
|
] }) }),
|
|
8112
|
-
/* @__PURE__ */
|
|
8113
|
-
/* @__PURE__ */
|
|
8153
|
+
/* @__PURE__ */ jsx56(Dialog5.Body, { children: /* @__PURE__ */ jsxs42(Stack12, { gap: "3", children: [
|
|
8154
|
+
/* @__PURE__ */ jsxs42(Text17, { textStyle: "sm", color: "fg.muted", children: [
|
|
8114
8155
|
labels.matchAll,
|
|
8115
|
-
repeats && /* @__PURE__ */
|
|
8156
|
+
repeats && /* @__PURE__ */ jsxs42(Fragment19, { children: [
|
|
8116
8157
|
" ",
|
|
8117
8158
|
labels.sameFieldAny
|
|
8118
8159
|
] })
|
|
8119
8160
|
] }),
|
|
8120
|
-
rows2.length === 0 && /* @__PURE__ */
|
|
8121
|
-
rows2.map((d) => /* @__PURE__ */
|
|
8161
|
+
rows2.length === 0 && /* @__PURE__ */ jsx56(Text17, { textStyle: "sm", color: "fg.muted", py: "2", children: labels.noConditions }),
|
|
8162
|
+
rows2.map((d) => /* @__PURE__ */ jsx56(
|
|
8122
8163
|
ConditionRow,
|
|
8123
8164
|
{
|
|
8124
8165
|
draft: d,
|
|
@@ -8131,29 +8172,29 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8131
8172
|
},
|
|
8132
8173
|
d.id
|
|
8133
8174
|
)),
|
|
8134
|
-
/* @__PURE__ */
|
|
8135
|
-
/* @__PURE__ */
|
|
8136
|
-
/* @__PURE__ */
|
|
8137
|
-
/* @__PURE__ */
|
|
8175
|
+
/* @__PURE__ */ jsx56(HStack11, { children: /* @__PURE__ */ jsx56(AddButton, { onClick: add, disabled: fields.length === 0, children: labels.addCondition }) }),
|
|
8176
|
+
/* @__PURE__ */ jsxs42(Stack12, { gap: "1", borderTopWidth: "1px", borderColor: "border.muted", pt: "3", children: [
|
|
8177
|
+
/* @__PURE__ */ jsx56(Text17, { textStyle: "xs", fontWeight: "bold", color: "fg.muted", children: labels.activeFilters }),
|
|
8178
|
+
/* @__PURE__ */ jsx56(Text17, { textStyle: "sm", "data-active-filters": "", children: complete.length === 0 ? labels.noneActive : complete.map((c2) => describe(c2, fields, labels)).join(" \xB7 ") })
|
|
8138
8179
|
] })
|
|
8139
8180
|
] }) }),
|
|
8140
|
-
/* @__PURE__ */
|
|
8141
|
-
/* @__PURE__ */
|
|
8181
|
+
/* @__PURE__ */ jsx56(Dialog5.Footer, { children: /* @__PURE__ */ jsxs42(HStack11, { justify: "space-between", w: "full", wrap: "wrap", gap: "2", children: [
|
|
8182
|
+
/* @__PURE__ */ jsxs42(Text17, { textStyle: "sm", color: "fg.muted", "aria-live": "polite", "data-filter-count": "", children: [
|
|
8142
8183
|
count != null && fill3(total != null ? labels.matchCount : labels.matchCountOnly, { count, total: total ?? "" }),
|
|
8143
|
-
incomplete > 0 && /* @__PURE__ */
|
|
8184
|
+
incomplete > 0 && /* @__PURE__ */ jsxs42(Fragment19, { children: [
|
|
8144
8185
|
" \xB7 ",
|
|
8145
8186
|
labels.incompleteSkipped
|
|
8146
8187
|
] })
|
|
8147
8188
|
] }),
|
|
8148
|
-
/* @__PURE__ */
|
|
8149
|
-
/* @__PURE__ */
|
|
8150
|
-
/* @__PURE__ */
|
|
8189
|
+
/* @__PURE__ */ jsxs42(HStack11, { gap: "2", children: [
|
|
8190
|
+
/* @__PURE__ */ jsx56(Button, { size: "sm", variant: "ghost", onClick: onClose, children: labels.cancel }),
|
|
8191
|
+
/* @__PURE__ */ jsx56(Button, { size: "sm", variant: "primary", onClick: () => {
|
|
8151
8192
|
setTouched(true);
|
|
8152
8193
|
onApply(mergeSameField(complete, fields));
|
|
8153
8194
|
}, children: labels.applyFilters })
|
|
8154
8195
|
] })
|
|
8155
8196
|
] }) }),
|
|
8156
|
-
/* @__PURE__ */
|
|
8197
|
+
/* @__PURE__ */ jsx56(Dialog5.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx56(CloseButton3, { size: "sm" }) })
|
|
8157
8198
|
] }) })
|
|
8158
8199
|
] }) });
|
|
8159
8200
|
}
|
|
@@ -8164,7 +8205,7 @@ function describe(c2, fields, labels) {
|
|
|
8164
8205
|
}
|
|
8165
8206
|
function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChange, onRemove }) {
|
|
8166
8207
|
const labels = useAbpLabels().queryList;
|
|
8167
|
-
const listId =
|
|
8208
|
+
const listId = useId7();
|
|
8168
8209
|
const field = fields.find((f) => f.id === draft.field);
|
|
8169
8210
|
const { op, text } = draft;
|
|
8170
8211
|
const [options, setOptions] = useState21([]);
|
|
@@ -8182,9 +8223,9 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8182
8223
|
clearTimeout(timer);
|
|
8183
8224
|
};
|
|
8184
8225
|
}, [suggest, field, op, text, own]);
|
|
8185
|
-
return /* @__PURE__ */
|
|
8186
|
-
/* @__PURE__ */
|
|
8187
|
-
/* @__PURE__ */
|
|
8226
|
+
return /* @__PURE__ */ jsxs42(Stack12, { gap: "1", "data-condition": "", children: [
|
|
8227
|
+
/* @__PURE__ */ jsxs42(HStack11, { gap: "1.5", wrap: "wrap", align: "start", children: [
|
|
8228
|
+
/* @__PURE__ */ jsx56(
|
|
8188
8229
|
SelectField,
|
|
8189
8230
|
{
|
|
8190
8231
|
width: "auto",
|
|
@@ -8198,7 +8239,7 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8198
8239
|
options: fields.map((f) => ({ value: f.id, label: f.label }))
|
|
8199
8240
|
}
|
|
8200
8241
|
),
|
|
8201
|
-
/* @__PURE__ */
|
|
8242
|
+
/* @__PURE__ */ jsx56(
|
|
8202
8243
|
SelectField,
|
|
8203
8244
|
{
|
|
8204
8245
|
width: "auto",
|
|
@@ -8210,8 +8251,8 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8210
8251
|
}
|
|
8211
8252
|
),
|
|
8212
8253
|
own,
|
|
8213
|
-
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */
|
|
8214
|
-
/* @__PURE__ */
|
|
8254
|
+
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */ jsxs42(Fragment19, { children: [
|
|
8255
|
+
/* @__PURE__ */ jsx56(
|
|
8215
8256
|
Input6,
|
|
8216
8257
|
{
|
|
8217
8258
|
size: "sm",
|
|
@@ -8225,16 +8266,16 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8225
8266
|
onChange: (e) => onChange({ text: e.target.value })
|
|
8226
8267
|
}
|
|
8227
8268
|
),
|
|
8228
|
-
/* @__PURE__ */
|
|
8269
|
+
/* @__PURE__ */ jsx56("datalist", { id: listId, children: options.filter((o) => o.kind !== "keyword").map((o) => /* @__PURE__ */ jsx56("option", { value: o.text.replace(/^"|"$/g, ""), children: o.label }, o.text)) })
|
|
8229
8270
|
] }),
|
|
8230
|
-
/* @__PURE__ */
|
|
8271
|
+
/* @__PURE__ */ jsx56(IconButton, { size: "sm", variant: "ghost", remove: true, "aria-label": fill3(labels.removeFilter, { field: field?.label ?? draft.field }), onClick: onRemove, children: /* @__PURE__ */ jsx56(Trash2, {}) })
|
|
8231
8272
|
] }),
|
|
8232
|
-
warn && /* @__PURE__ */
|
|
8273
|
+
warn && /* @__PURE__ */ jsx56(Text17, { textStyle: "xs", color: "fg.error", children: labels.incomplete })
|
|
8233
8274
|
] });
|
|
8234
8275
|
}
|
|
8235
8276
|
|
|
8236
8277
|
// src/components/QueryableList.tsx
|
|
8237
|
-
import { Fragment as Fragment20, jsx as
|
|
8278
|
+
import { Fragment as Fragment20, jsx as jsx57, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
8238
8279
|
var PAIR = "";
|
|
8239
8280
|
var pairKey = (first, second) => `${first}${PAIR}${second}`;
|
|
8240
8281
|
var condition = (field, value) => value == null ? { field, op: "isEmpty" } : { field, op: "eq", value };
|
|
@@ -8381,15 +8422,15 @@ function QueryableList({
|
|
|
8381
8422
|
}
|
|
8382
8423
|
const sortable = (fields ?? []).filter((f) => f.sortable);
|
|
8383
8424
|
const groupLabel = groupField ? thenField ? `${label(groupField)} \xB7 ${label(thenField)}` : label(groupField) : null;
|
|
8384
|
-
return /* @__PURE__ */
|
|
8385
|
-
/* @__PURE__ */
|
|
8386
|
-
/* @__PURE__ */
|
|
8387
|
-
/* @__PURE__ */
|
|
8425
|
+
return /* @__PURE__ */ jsxs43(Stack13, { gap: "3", children: [
|
|
8426
|
+
/* @__PURE__ */ jsxs43(chakra34.div, { layerStyle: "panel", borderRadius: "l3", "data-query-toolbar": "", children: [
|
|
8427
|
+
/* @__PURE__ */ jsxs43(HStack12, { gap: "2", wrap: "wrap", justify: "space-between", px: "2.5", py: "2", borderBottomWidth: "1px", borderColor: "border.muted", children: [
|
|
8428
|
+
/* @__PURE__ */ jsxs43(HStack12, { gap: "2", wrap: "wrap", minW: "0", children: [
|
|
8388
8429
|
leading,
|
|
8389
|
-
leading != null && views && onSelectView && /* @__PURE__ */
|
|
8390
|
-
views && onSelectView && /* @__PURE__ */
|
|
8391
|
-
/* @__PURE__ */
|
|
8392
|
-
/* @__PURE__ */
|
|
8430
|
+
leading != null && views && onSelectView && /* @__PURE__ */ jsx57(chakra34.span, { w: "1px", h: "6", bg: "border", mx: "1", "aria-hidden": true }),
|
|
8431
|
+
views && onSelectView && /* @__PURE__ */ jsxs43(HStack12, { gap: "2", children: [
|
|
8432
|
+
/* @__PURE__ */ jsx57(Text18, { as: "span", textStyle: "xs", fontWeight: "semibold", color: "fg.muted", whiteSpace: "nowrap", hideBelow: "2xl", children: labels.savedView }),
|
|
8433
|
+
/* @__PURE__ */ jsx57(
|
|
8393
8434
|
SelectField,
|
|
8394
8435
|
{
|
|
8395
8436
|
width: "auto",
|
|
@@ -8401,62 +8442,62 @@ function QueryableList({
|
|
|
8401
8442
|
}
|
|
8402
8443
|
)
|
|
8403
8444
|
] }),
|
|
8404
|
-
onSaveView && (naming === null ? /* @__PURE__ */
|
|
8405
|
-
/* @__PURE__ */
|
|
8445
|
+
onSaveView && (naming === null ? /* @__PURE__ */ jsxs43(Button, { size: "sm", variant: "ghost", color: "fg.accent", onClick: () => setNaming(activeView?.isOwner ? activeView.name : ""), children: [
|
|
8446
|
+
/* @__PURE__ */ jsx57(Save, {}),
|
|
8406
8447
|
labels.saveView
|
|
8407
|
-
] }) : /* @__PURE__ */
|
|
8448
|
+
] }) : /* @__PURE__ */ jsxs43(HStack12, { gap: "1", as: "form", onSubmit: (e) => {
|
|
8408
8449
|
e.preventDefault();
|
|
8409
8450
|
if (naming.trim()) onSaveView(naming.trim(), activeView?.isOwner && naming.trim() === activeView.name ? activeView.id : null);
|
|
8410
8451
|
setNaming(null);
|
|
8411
8452
|
}, children: [
|
|
8412
|
-
/* @__PURE__ */
|
|
8413
|
-
/* @__PURE__ */
|
|
8414
|
-
/* @__PURE__ */
|
|
8453
|
+
/* @__PURE__ */ jsx57(Input7, { size: "sm", autoFocus: true, "aria-label": labels.viewName, placeholder: labels.viewName, value: naming, onChange: (e) => setNaming(e.target.value), maxW: "56" }),
|
|
8454
|
+
/* @__PURE__ */ jsx57(Button, { size: "sm", type: "submit", variant: "primary", disabled: !naming.trim(), children: labels.save }),
|
|
8455
|
+
/* @__PURE__ */ jsx57(IconButton, { size: "sm", variant: "ghost", "aria-label": labels.cancel, onClick: () => setNaming(null), children: /* @__PURE__ */ jsx57(X2, {}) })
|
|
8415
8456
|
] })),
|
|
8416
|
-
activeView?.isOwner && onDeleteView && naming === null && /* @__PURE__ */
|
|
8457
|
+
activeView?.isOwner && onDeleteView && naming === null && /* @__PURE__ */ jsx57(IconButton, { size: "sm", variant: "ghost", "aria-label": labels.deleteView, onClick: () => onDeleteView(activeView.id), children: /* @__PURE__ */ jsx57(Trash22, {}) })
|
|
8417
8458
|
] }),
|
|
8418
|
-
/* @__PURE__ */
|
|
8419
|
-
/* @__PURE__ */
|
|
8420
|
-
/* @__PURE__ */
|
|
8421
|
-
/* @__PURE__ */
|
|
8422
|
-
/* @__PURE__ */
|
|
8459
|
+
/* @__PURE__ */ jsxs43(HStack12, { gap: "2", wrap: "wrap", children: [
|
|
8460
|
+
/* @__PURE__ */ jsxs43(Menu4.Root, { positioning: { placement: "bottom-end" }, children: [
|
|
8461
|
+
/* @__PURE__ */ jsx57(Menu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs43(Button, { size: "sm", variant: "secondary", "aria-label": labels.groupBy, disabled: groupable.length === 0, children: [
|
|
8462
|
+
/* @__PURE__ */ jsx57(Rows3, {}),
|
|
8463
|
+
/* @__PURE__ */ jsx57(Text18, { as: "span", color: "fg.muted", fontWeight: "normal", children: labels.group }),
|
|
8423
8464
|
groupLabel ?? labels.noGrouping,
|
|
8424
|
-
/* @__PURE__ */
|
|
8465
|
+
/* @__PURE__ */ jsx57(ChevronDown3, {})
|
|
8425
8466
|
] }) }),
|
|
8426
|
-
/* @__PURE__ */
|
|
8427
|
-
/* @__PURE__ */
|
|
8467
|
+
/* @__PURE__ */ jsx57(Portal16, { children: /* @__PURE__ */ jsx57(Menu4.Positioner, { children: /* @__PURE__ */ jsxs43(Menu4.Content, { minW: "48", children: [
|
|
8468
|
+
/* @__PURE__ */ jsxs43(
|
|
8428
8469
|
Menu4.RadioItemGroup,
|
|
8429
8470
|
{
|
|
8430
8471
|
value: groupField ?? "",
|
|
8431
8472
|
onValueChange: (d) => change({ ...query, groupBy: d.value ? { field: d.value, aggregates: [] } : null }),
|
|
8432
8473
|
children: [
|
|
8433
|
-
/* @__PURE__ */
|
|
8474
|
+
/* @__PURE__ */ jsxs43(Menu4.RadioItem, { value: "", children: [
|
|
8434
8475
|
labels.noGrouping,
|
|
8435
|
-
/* @__PURE__ */
|
|
8476
|
+
/* @__PURE__ */ jsx57(Menu4.ItemIndicator, {})
|
|
8436
8477
|
] }),
|
|
8437
|
-
groupable.map((f) => /* @__PURE__ */
|
|
8478
|
+
groupable.map((f) => /* @__PURE__ */ jsxs43(Menu4.RadioItem, { value: f.id, children: [
|
|
8438
8479
|
f.label,
|
|
8439
|
-
/* @__PURE__ */
|
|
8480
|
+
/* @__PURE__ */ jsx57(Menu4.ItemIndicator, {})
|
|
8440
8481
|
] }, f.id))
|
|
8441
8482
|
]
|
|
8442
8483
|
}
|
|
8443
8484
|
),
|
|
8444
|
-
groupField && groupable.length > 1 && /* @__PURE__ */
|
|
8445
|
-
/* @__PURE__ */
|
|
8446
|
-
/* @__PURE__ */
|
|
8485
|
+
groupField && groupable.length > 1 && /* @__PURE__ */ jsxs43(Fragment20, { children: [
|
|
8486
|
+
/* @__PURE__ */ jsx57(Menu4.Separator, {}),
|
|
8487
|
+
/* @__PURE__ */ jsxs43(
|
|
8447
8488
|
Menu4.RadioItemGroup,
|
|
8448
8489
|
{
|
|
8449
8490
|
value: thenField ?? "",
|
|
8450
8491
|
onValueChange: (d) => change({ ...query, groupBy: { ...query.groupBy, then: d.value ? { field: d.value } : null } }),
|
|
8451
8492
|
children: [
|
|
8452
|
-
/* @__PURE__ */
|
|
8453
|
-
/* @__PURE__ */
|
|
8493
|
+
/* @__PURE__ */ jsx57(Menu4.ItemGroupLabel, { children: labels.thenBy }),
|
|
8494
|
+
/* @__PURE__ */ jsxs43(Menu4.RadioItem, { value: "", children: [
|
|
8454
8495
|
labels.noSecondGrouping,
|
|
8455
|
-
/* @__PURE__ */
|
|
8496
|
+
/* @__PURE__ */ jsx57(Menu4.ItemIndicator, {})
|
|
8456
8497
|
] }),
|
|
8457
|
-
groupable.filter((f) => f.id !== groupField).map((f) => /* @__PURE__ */
|
|
8498
|
+
groupable.filter((f) => f.id !== groupField).map((f) => /* @__PURE__ */ jsxs43(Menu4.RadioItem, { value: f.id, children: [
|
|
8458
8499
|
f.label,
|
|
8459
|
-
/* @__PURE__ */
|
|
8500
|
+
/* @__PURE__ */ jsx57(Menu4.ItemIndicator, {})
|
|
8460
8501
|
] }, f.id))
|
|
8461
8502
|
]
|
|
8462
8503
|
}
|
|
@@ -8464,15 +8505,15 @@ function QueryableList({
|
|
|
8464
8505
|
] })
|
|
8465
8506
|
] }) }) })
|
|
8466
8507
|
] }),
|
|
8467
|
-
/* @__PURE__ */
|
|
8468
|
-
onExport && !exportTarget && /* @__PURE__ */
|
|
8469
|
-
onExport && exportTarget && createPortal(/* @__PURE__ */
|
|
8508
|
+
/* @__PURE__ */ jsx57(ColumnsPopover, { fields: fields ?? [], columns: state.columns, onChange: (next) => onStateChange({ ...state, rql: result?.rql ?? state.rql, query: void 0, columns: next }) }),
|
|
8509
|
+
onExport && !exportTarget && /* @__PURE__ */ jsx57(ExportMenu, { busy: exporting, disabled: !result || Boolean(loading), onExport: runExport }),
|
|
8510
|
+
onExport && exportTarget && createPortal(/* @__PURE__ */ jsx57(ExportMenu, { busy: exporting, disabled: !result || Boolean(loading), onExport: runExport }), exportTarget),
|
|
8470
8511
|
actions
|
|
8471
8512
|
] })
|
|
8472
8513
|
] }),
|
|
8473
|
-
/* @__PURE__ */
|
|
8474
|
-
/* @__PURE__ */
|
|
8475
|
-
/* @__PURE__ */
|
|
8514
|
+
/* @__PURE__ */ jsxs43(HStack12, { gap: "2", align: "start", wrap: "wrap", justify: "space-between", px: "2.5", py: "2", children: [
|
|
8515
|
+
/* @__PURE__ */ jsxs43(HStack12, { gap: "2", align: "start", wrap: "wrap", flex: "1", minW: { base: "full", md: "0" }, children: [
|
|
8516
|
+
/* @__PURE__ */ jsx57(
|
|
8476
8517
|
SegmentedControl,
|
|
8477
8518
|
{
|
|
8478
8519
|
size: "sm",
|
|
@@ -8485,14 +8526,14 @@ function QueryableList({
|
|
|
8485
8526
|
]
|
|
8486
8527
|
}
|
|
8487
8528
|
),
|
|
8488
|
-
mode === "basic" && conditions !== null ? /* @__PURE__ */
|
|
8489
|
-
search && /* @__PURE__ */
|
|
8490
|
-
/* @__PURE__ */
|
|
8529
|
+
mode === "basic" && conditions !== null ? /* @__PURE__ */ jsxs43(HStack12, { gap: "2", wrap: "wrap", flex: "1", minW: "0", children: [
|
|
8530
|
+
search && /* @__PURE__ */ jsx57(QuickSearch, { initial: searchText, placeholder: search.placeholder ?? labels.searchPlaceholder, onRun: runSearch }, searchText),
|
|
8531
|
+
/* @__PURE__ */ jsxs43(AddButton, { onClick: () => setAdding(true), disabled: !fields, "data-add-filter": "", children: [
|
|
8491
8532
|
labels.addFilter,
|
|
8492
|
-
chips.length > 0 && /* @__PURE__ */
|
|
8533
|
+
chips.length > 0 && /* @__PURE__ */ jsx57(CountBadge, { value: chips.length, tone: "accent" })
|
|
8493
8534
|
] }),
|
|
8494
|
-
sortable.length > 0 && /* @__PURE__ */
|
|
8495
|
-
/* @__PURE__ */
|
|
8535
|
+
sortable.length > 0 && /* @__PURE__ */ jsxs43(HStack12, { gap: "1", flexShrink: 0, children: [
|
|
8536
|
+
/* @__PURE__ */ jsx57(
|
|
8496
8537
|
SelectField,
|
|
8497
8538
|
{
|
|
8498
8539
|
width: "auto",
|
|
@@ -8507,7 +8548,7 @@ function QueryableList({
|
|
|
8507
8548
|
]
|
|
8508
8549
|
}
|
|
8509
8550
|
),
|
|
8510
|
-
sort && /* @__PURE__ */
|
|
8551
|
+
sort && /* @__PURE__ */ jsx57(
|
|
8511
8552
|
IconButton,
|
|
8512
8553
|
{
|
|
8513
8554
|
size: "sm",
|
|
@@ -8515,11 +8556,11 @@ function QueryableList({
|
|
|
8515
8556
|
"aria-label": sort.direction === "desc" ? labels.sortDescending : labels.sortAscending,
|
|
8516
8557
|
title: sort.direction === "desc" ? labels.sortDescending : labels.sortAscending,
|
|
8517
8558
|
onClick: () => change({ ...query, orderBy: [{ field: sort.columnId, desc: sort.direction !== "desc" }] }),
|
|
8518
|
-
children: sort.direction === "desc" ? /* @__PURE__ */
|
|
8559
|
+
children: sort.direction === "desc" ? /* @__PURE__ */ jsx57(ArrowDownWideNarrow, {}) : /* @__PURE__ */ jsx57(ArrowUpNarrowWide, {})
|
|
8519
8560
|
}
|
|
8520
8561
|
)
|
|
8521
8562
|
] })
|
|
8522
|
-
] }) : /* @__PURE__ */
|
|
8563
|
+
] }) : /* @__PURE__ */ jsx57(
|
|
8523
8564
|
RqlBox,
|
|
8524
8565
|
{
|
|
8525
8566
|
initial: state.rql ?? result?.rql ?? "",
|
|
@@ -8530,11 +8571,11 @@ function QueryableList({
|
|
|
8530
8571
|
state.rql ?? result?.rql ?? ""
|
|
8531
8572
|
)
|
|
8532
8573
|
] }),
|
|
8533
|
-
attention != null && /* @__PURE__ */
|
|
8574
|
+
attention != null && /* @__PURE__ */ jsx57(HStack12, { gap: "2", wrap: "wrap", flexShrink: 0, children: attention })
|
|
8534
8575
|
] }),
|
|
8535
|
-
mode === "basic" && conditions !== null && chips.length > 0 && /* @__PURE__ */
|
|
8536
|
-
chips.map(({ c: c2, i }) => /* @__PURE__ */
|
|
8537
|
-
|
|
8576
|
+
mode === "basic" && conditions !== null && chips.length > 0 && /* @__PURE__ */ jsxs43(HStack12, { gap: "2", wrap: "wrap", px: "2.5", py: "2", borderTopWidth: "1px", borderColor: "border.muted", "data-filter-chips": "", children: [
|
|
8577
|
+
chips.map(({ c: c2, i }) => /* @__PURE__ */ jsxs43(
|
|
8578
|
+
chakra34.span,
|
|
8538
8579
|
{
|
|
8539
8580
|
display: "inline-flex",
|
|
8540
8581
|
alignItems: "center",
|
|
@@ -8548,17 +8589,17 @@ function QueryableList({
|
|
|
8548
8589
|
bg: "bg.selected",
|
|
8549
8590
|
textStyle: "sm",
|
|
8550
8591
|
children: [
|
|
8551
|
-
/* @__PURE__ */
|
|
8552
|
-
/* @__PURE__ */
|
|
8553
|
-
!NO_VALUE_OPS.has(c2.op) && /* @__PURE__ */
|
|
8554
|
-
/* @__PURE__ */
|
|
8592
|
+
/* @__PURE__ */ jsx57(Text18, { as: "span", fontWeight: "medium", children: label(c2.field) }),
|
|
8593
|
+
/* @__PURE__ */ jsx57(Text18, { as: "span", color: "fg.muted", children: opLabel(c2.op, c2.field) }),
|
|
8594
|
+
!NO_VALUE_OPS.has(c2.op) && /* @__PURE__ */ jsx57(Text18, { as: "span", children: valueText(c2.value) }),
|
|
8595
|
+
/* @__PURE__ */ jsx57(IconButton, { size: "xs", variant: "ghost", "aria-label": fill4(labels.removeFilter, { field: label(c2.field) }), onClick: () => setConditions(conditions.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx57(X2, {}) })
|
|
8555
8596
|
]
|
|
8556
8597
|
},
|
|
8557
8598
|
`${c2.field}-${i}`
|
|
8558
8599
|
)),
|
|
8559
|
-
/* @__PURE__ */
|
|
8600
|
+
/* @__PURE__ */ jsx57(Button, { size: "xs", variant: "ghost", onClick: () => setConditions(searching >= 0 ? [conditions[searching]] : []), children: labels.clearAll })
|
|
8560
8601
|
] }),
|
|
8561
|
-
adding && fields && conditions !== null && /* @__PURE__ */
|
|
8602
|
+
adding && fields && conditions !== null && /* @__PURE__ */ jsx57(
|
|
8562
8603
|
FilterBuilderDialog,
|
|
8563
8604
|
{
|
|
8564
8605
|
fields,
|
|
@@ -8573,26 +8614,26 @@ function QueryableList({
|
|
|
8573
8614
|
}
|
|
8574
8615
|
}
|
|
8575
8616
|
),
|
|
8576
|
-
toolbarFooter != null && /* @__PURE__ */
|
|
8617
|
+
toolbarFooter != null && /* @__PURE__ */ jsx57(chakra34.div, { borderTopWidth: "1px", borderColor: "border.muted", "data-toolbar-footer": "", children: toolbarFooter })
|
|
8577
8618
|
] }),
|
|
8578
|
-
mode === "basic" && error && !(loadFailed != null && error.failed && !result) && /* @__PURE__ */
|
|
8579
|
-
exported && /* @__PURE__ */
|
|
8580
|
-
/* @__PURE__ */
|
|
8581
|
-
/* @__PURE__ */
|
|
8619
|
+
mode === "basic" && error && !(loadFailed != null && error.failed && !result) && /* @__PURE__ */ jsx57(InlineAlert, { tone: "danger", children: error.message }),
|
|
8620
|
+
exported && /* @__PURE__ */ jsx57(InlineAlert, { tone: exported.tone, title: exported.tone === "danger" ? labels.exportFailed : void 0, children: /* @__PURE__ */ jsxs43(HStack12, { justify: "space-between", gap: "2", align: "start", children: [
|
|
8621
|
+
/* @__PURE__ */ jsx57(Text18, { as: "span", children: exported.message }),
|
|
8622
|
+
/* @__PURE__ */ jsx57(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.dismiss, onClick: () => setExported(null), children: /* @__PURE__ */ jsx57(X2, {}) })
|
|
8582
8623
|
] }) }),
|
|
8583
|
-
/* @__PURE__ */
|
|
8624
|
+
/* @__PURE__ */ jsx57(
|
|
8584
8625
|
Panel,
|
|
8585
8626
|
{
|
|
8586
8627
|
flush: true,
|
|
8587
8628
|
footer: (
|
|
8588
8629
|
// Expand and collapse at the start, the pages in the middle (the canvas's v12, UI round 9 step 67, round 10 step 73),
|
|
8589
8630
|
// the range at the end, or with the arrows in the simple form.
|
|
8590
|
-
/* @__PURE__ */
|
|
8591
|
-
/* @__PURE__ */
|
|
8592
|
-
/* @__PURE__ */
|
|
8593
|
-
/* @__PURE__ */
|
|
8631
|
+
/* @__PURE__ */ jsxs43(chakra34.div, { display: "grid", w: "full", gridTemplateColumns: { base: "1fr", md: "1fr auto 1fr" }, alignItems: "center", gap: "3", children: [
|
|
8632
|
+
/* @__PURE__ */ jsx57(HStack12, { gap: "3", children: grouped && /* @__PURE__ */ jsxs43(Fragment20, { children: [
|
|
8633
|
+
/* @__PURE__ */ jsx57(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: folded.size === 0, onClick: () => setFolded(/* @__PURE__ */ new Set()), children: labels.expandAll }),
|
|
8634
|
+
/* @__PURE__ */ jsx57(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: groupKeys.every((k) => folded.has(k)), onClick: () => setFolded(new Set(groupKeys)), children: labels.collapseAll })
|
|
8594
8635
|
] }) }),
|
|
8595
|
-
/* @__PURE__ */
|
|
8636
|
+
/* @__PURE__ */ jsx57(
|
|
8596
8637
|
Pagination,
|
|
8597
8638
|
{
|
|
8598
8639
|
page: Math.floor(skip / take) + 1,
|
|
@@ -8608,10 +8649,10 @@ function QueryableList({
|
|
|
8608
8649
|
pageOf: fill4(labels.pageOf, { page: fmt.number(Math.floor(skip / take) + 1), pages: fmt.number(Math.max(1, Math.ceil(total / take))) })
|
|
8609
8650
|
}
|
|
8610
8651
|
),
|
|
8611
|
-
/* @__PURE__ */
|
|
8652
|
+
/* @__PURE__ */ jsx57(Text18, { 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) }) : " " })
|
|
8612
8653
|
] })
|
|
8613
8654
|
),
|
|
8614
|
-
children: layout === "cards" && cards ? /* @__PURE__ */
|
|
8655
|
+
children: layout === "cards" && cards ? /* @__PURE__ */ jsx57(
|
|
8615
8656
|
CardGrid,
|
|
8616
8657
|
{
|
|
8617
8658
|
"aria-label": ariaLabel,
|
|
@@ -8622,7 +8663,7 @@ function QueryableList({
|
|
|
8622
8663
|
render: cards.render,
|
|
8623
8664
|
empty: loadFailed != null && error?.failed && !result ? loadFailed : empty ?? labels.empty
|
|
8624
8665
|
}
|
|
8625
|
-
) : /* @__PURE__ */
|
|
8666
|
+
) : /* @__PURE__ */ jsx57(
|
|
8626
8667
|
DataTable,
|
|
8627
8668
|
{
|
|
8628
8669
|
"aria-label": ariaLabel,
|
|
@@ -8668,11 +8709,11 @@ function QueryableList({
|
|
|
8668
8709
|
const label2 = thenField ? info?.then?.label : info?.label;
|
|
8669
8710
|
const value = thenField ? info?.then?.value ?? null : info?.value ?? null;
|
|
8670
8711
|
const period = thenField ? query.groupBy?.then?.period : query.groupBy?.period;
|
|
8671
|
-
return /* @__PURE__ */
|
|
8672
|
-
/* @__PURE__ */
|
|
8673
|
-
/* @__PURE__ */
|
|
8712
|
+
return /* @__PURE__ */ jsxs43(HStack12, { gap: "2.5", flex: "1", minW: "0", children: [
|
|
8713
|
+
/* @__PURE__ */ jsx57(chakra34.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) }),
|
|
8714
|
+
/* @__PURE__ */ jsx57(CountBadge, { value: info?.count ?? rows2.length }),
|
|
8674
8715
|
!thenField && renderGroupAside?.({ field: groupField, value: info?.value ?? null, label: info?.label ?? "" }),
|
|
8675
|
-
conditions !== null && !period && /* @__PURE__ */
|
|
8716
|
+
conditions !== null && !period && /* @__PURE__ */ jsxs43(
|
|
8676
8717
|
Button,
|
|
8677
8718
|
{
|
|
8678
8719
|
size: "xs",
|
|
@@ -8690,8 +8731,8 @@ function QueryableList({
|
|
|
8690
8731
|
condition(field, value)
|
|
8691
8732
|
]),
|
|
8692
8733
|
children: [
|
|
8693
|
-
/* @__PURE__ */
|
|
8694
|
-
/* @__PURE__ */
|
|
8734
|
+
/* @__PURE__ */ jsx57(Filter, {}),
|
|
8735
|
+
/* @__PURE__ */ jsx57(chakra34.span, { hideBelow: "md", children: labels.filterToGroup })
|
|
8695
8736
|
]
|
|
8696
8737
|
}
|
|
8697
8738
|
)
|
|
@@ -8710,9 +8751,9 @@ function QueryableList({
|
|
|
8710
8751
|
const first = groups[0]?.rows[0];
|
|
8711
8752
|
const raw = first?.values[groupField];
|
|
8712
8753
|
const count = (result?.groups ?? []).filter((g) => groupKey(g.value) === parent).reduce((n, g) => n + g.count, 0);
|
|
8713
|
-
return /* @__PURE__ */
|
|
8714
|
-
/* @__PURE__ */
|
|
8715
|
-
/* @__PURE__ */
|
|
8754
|
+
return /* @__PURE__ */ jsxs43(HStack12, { gap: "2.5", flex: "1", minW: "0", children: [
|
|
8755
|
+
/* @__PURE__ */ jsx57(chakra34.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) }),
|
|
8756
|
+
/* @__PURE__ */ jsx57(CountBadge, { value: count }),
|
|
8716
8757
|
renderGroupAside?.({ field: groupField, value: info?.value ?? null, label: info?.label ?? "" })
|
|
8717
8758
|
] });
|
|
8718
8759
|
}
|
|
@@ -8755,8 +8796,8 @@ function QuickSearch({ initial, placeholder: placeholder2, onRun }) {
|
|
|
8755
8796
|
clearTimeout(timer.current);
|
|
8756
8797
|
timer.current = setTimeout(() => next.trim() !== initial.trim() && onRun(next), 400);
|
|
8757
8798
|
}
|
|
8758
|
-
return /* @__PURE__ */
|
|
8759
|
-
|
|
8799
|
+
return /* @__PURE__ */ jsx57(
|
|
8800
|
+
chakra34.form,
|
|
8760
8801
|
{
|
|
8761
8802
|
role: "search",
|
|
8762
8803
|
flex: "1",
|
|
@@ -8767,7 +8808,7 @@ function QuickSearch({ initial, placeholder: placeholder2, onRun }) {
|
|
|
8767
8808
|
clearTimeout(timer.current);
|
|
8768
8809
|
if (text.trim() !== initial.trim()) onRun(text);
|
|
8769
8810
|
},
|
|
8770
|
-
children: /* @__PURE__ */
|
|
8811
|
+
children: /* @__PURE__ */ jsx57(
|
|
8771
8812
|
SearchInput,
|
|
8772
8813
|
{
|
|
8773
8814
|
size: "sm",
|
|
@@ -8809,14 +8850,14 @@ function placeholderOf(id, kind) {
|
|
|
8809
8850
|
}
|
|
8810
8851
|
function ExportMenu({ busy, disabled, onExport }) {
|
|
8811
8852
|
const labels = useAbpLabels().queryList;
|
|
8812
|
-
return /* @__PURE__ */
|
|
8813
|
-
/* @__PURE__ */
|
|
8814
|
-
/* @__PURE__ */
|
|
8853
|
+
return /* @__PURE__ */ jsxs43(Menu4.Root, { positioning: { placement: "bottom-end" }, onSelect: (d) => onExport(d.value), children: [
|
|
8854
|
+
/* @__PURE__ */ jsx57(Menu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs43(Button, { size: "sm", variant: "secondary", disabled: disabled || busy, loading: busy, loadingText: labels.exporting, children: [
|
|
8855
|
+
/* @__PURE__ */ jsx57(Download, {}),
|
|
8815
8856
|
labels.export
|
|
8816
8857
|
] }) }),
|
|
8817
|
-
/* @__PURE__ */
|
|
8818
|
-
/* @__PURE__ */
|
|
8819
|
-
/* @__PURE__ */
|
|
8858
|
+
/* @__PURE__ */ jsx57(Portal16, { children: /* @__PURE__ */ jsx57(Menu4.Positioner, { children: /* @__PURE__ */ jsxs43(Menu4.Content, { minW: "48", children: [
|
|
8859
|
+
/* @__PURE__ */ jsx57(Menu4.Item, { value: "csv", children: labels.exportCsv }),
|
|
8860
|
+
/* @__PURE__ */ jsx57(Menu4.Item, { value: "xlsx", children: labels.exportExcel })
|
|
8820
8861
|
] }) }) })
|
|
8821
8862
|
] });
|
|
8822
8863
|
}
|
|
@@ -8834,7 +8875,7 @@ function RqlBox({
|
|
|
8834
8875
|
const input = useRef19(null);
|
|
8835
8876
|
const timer = useRef19(void 0);
|
|
8836
8877
|
const seq = useRef19(0);
|
|
8837
|
-
const listId =
|
|
8878
|
+
const listId = useId8();
|
|
8838
8879
|
function ask(value, caret) {
|
|
8839
8880
|
if (!suggest) return;
|
|
8840
8881
|
clearTimeout(timer.current);
|
|
@@ -8896,9 +8937,9 @@ function RqlBox({
|
|
|
8896
8937
|
}
|
|
8897
8938
|
}
|
|
8898
8939
|
const hasSpan = error?.start != null && error.end != null && error.end >= error.start && error.end <= text.length;
|
|
8899
|
-
return /* @__PURE__ */
|
|
8900
|
-
/* @__PURE__ */
|
|
8901
|
-
/* @__PURE__ */
|
|
8940
|
+
return /* @__PURE__ */ jsxs43(Stack13, { gap: "1.5", flex: "1", minW: "0", position: "relative", children: [
|
|
8941
|
+
/* @__PURE__ */ jsxs43(HStack12, { gap: "2", children: [
|
|
8942
|
+
/* @__PURE__ */ jsx57(
|
|
8902
8943
|
Input7,
|
|
8903
8944
|
{
|
|
8904
8945
|
ref: input,
|
|
@@ -8924,10 +8965,10 @@ function RqlBox({
|
|
|
8924
8965
|
onKeyDown
|
|
8925
8966
|
}
|
|
8926
8967
|
),
|
|
8927
|
-
/* @__PURE__ */
|
|
8968
|
+
/* @__PURE__ */ jsx57(Button, { size: "sm", variant: "primary", onClick: () => onRun(text.trim()), children: labels.run })
|
|
8928
8969
|
] }),
|
|
8929
|
-
open && found && /* @__PURE__ */
|
|
8930
|
-
|
|
8970
|
+
open && found && /* @__PURE__ */ jsx57(
|
|
8971
|
+
Box12,
|
|
8931
8972
|
{
|
|
8932
8973
|
id: listId,
|
|
8933
8974
|
role: "listbox",
|
|
@@ -8945,7 +8986,7 @@ function RqlBox({
|
|
|
8945
8986
|
borderRadius: "md",
|
|
8946
8987
|
boxShadow: "md",
|
|
8947
8988
|
py: "1",
|
|
8948
|
-
children: found.items.map((item, i) => /* @__PURE__ */
|
|
8989
|
+
children: found.items.map((item, i) => /* @__PURE__ */ jsxs43(
|
|
8949
8990
|
HStack12,
|
|
8950
8991
|
{
|
|
8951
8992
|
id: `${listId}-${i}`,
|
|
@@ -8963,28 +9004,28 @@ function RqlBox({
|
|
|
8963
9004
|
},
|
|
8964
9005
|
onMouseEnter: () => setActive(i),
|
|
8965
9006
|
children: [
|
|
8966
|
-
/* @__PURE__ */
|
|
8967
|
-
/* @__PURE__ */
|
|
9007
|
+
/* @__PURE__ */ jsx57(Text18, { 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 }),
|
|
9008
|
+
/* @__PURE__ */ jsx57(Text18, { 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 })
|
|
8968
9009
|
]
|
|
8969
9010
|
},
|
|
8970
9011
|
`${item.kind}-${item.text}`
|
|
8971
9012
|
))
|
|
8972
9013
|
}
|
|
8973
9014
|
),
|
|
8974
|
-
error && /* @__PURE__ */
|
|
9015
|
+
error && /* @__PURE__ */ jsxs43(InlineAlert, { tone: "danger", size: "sm", children: [
|
|
8975
9016
|
error.message,
|
|
8976
|
-
hasSpan && /* @__PURE__ */
|
|
9017
|
+
hasSpan && /* @__PURE__ */ jsxs43(chakra34.code, { display: "block", mt: "1", fontFamily: "mono", whiteSpace: "pre-wrap", children: [
|
|
8977
9018
|
text.slice(0, error.start),
|
|
8978
|
-
/* @__PURE__ */
|
|
9019
|
+
/* @__PURE__ */ jsx57(chakra34.mark, { bg: "red.subtle", color: "fg", textDecoration: "underline wavy", textDecorationColor: "fg.error", children: text.slice(error.start, error.end) || " " }),
|
|
8979
9020
|
text.slice(error.end)
|
|
8980
9021
|
] })
|
|
8981
9022
|
] })
|
|
8982
9023
|
] });
|
|
8983
9024
|
}
|
|
8984
9025
|
function CardGrid({ rows: rows2, loading, count, minWidth, render: render2, empty, "aria-label": label }) {
|
|
8985
|
-
if (rows2 && rows2.length === 0 && !loading) return typeof empty === "string" ? /* @__PURE__ */
|
|
8986
|
-
return /* @__PURE__ */
|
|
8987
|
-
|
|
9026
|
+
if (rows2 && rows2.length === 0 && !loading) return typeof empty === "string" ? /* @__PURE__ */ jsx57(EmptyState, { title: empty }) : /* @__PURE__ */ jsx57(Fragment20, { children: empty });
|
|
9027
|
+
return /* @__PURE__ */ jsx57(
|
|
9028
|
+
chakra34.ul,
|
|
8988
9029
|
{
|
|
8989
9030
|
role: "list",
|
|
8990
9031
|
"aria-label": label,
|
|
@@ -8996,22 +9037,22 @@ function CardGrid({ rows: rows2, loading, count, minWidth, render: render2, empt
|
|
|
8996
9037
|
gap: "3",
|
|
8997
9038
|
gridTemplateColumns: `repeat(auto-fill, minmax(min(${minWidth}, 100%), 1fr))`,
|
|
8998
9039
|
"data-layout": "cards",
|
|
8999
|
-
children: rows2 ? rows2.map((row) => /* @__PURE__ */
|
|
9040
|
+
children: rows2 ? rows2.map((row) => /* @__PURE__ */ jsx57(chakra34.li, { display: "flex", minW: "0", children: render2(row) }, row.id)) : Array.from({ length: Math.min(count, 9) }, (_, i) => /* @__PURE__ */ jsx57(chakra34.li, { h: "9.5rem", rounded: "lg", bg: "bg.subtle", "aria-hidden": true }, i))
|
|
9000
9041
|
}
|
|
9001
9042
|
);
|
|
9002
9043
|
}
|
|
9003
9044
|
|
|
9004
9045
|
// src/components/FileDrop.tsx
|
|
9005
9046
|
import { forwardRef as forwardRef9, useLayoutEffect as useLayoutEffect4, useRef as useRef20 } from "react";
|
|
9006
|
-
import { Box as
|
|
9047
|
+
import { Box as Box13, HStack as HStack13, Portal as Portal17, Text as Text19 } from "@chakra-ui/react";
|
|
9007
9048
|
import { ArrowDownToLine } from "lucide-react";
|
|
9008
|
-
import { jsx as
|
|
9049
|
+
import { jsx as jsx58, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9009
9050
|
var OUT3 = `cubic-bezier(${curves.out.join(", ")})`;
|
|
9010
9051
|
var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: over2 = false, hint, children, ...rest }, ref) {
|
|
9011
9052
|
const { reduce } = useMotionSetting();
|
|
9012
9053
|
const lit = awake || over2;
|
|
9013
|
-
return /* @__PURE__ */
|
|
9014
|
-
|
|
9054
|
+
return /* @__PURE__ */ jsxs44(
|
|
9055
|
+
Box13,
|
|
9015
9056
|
{
|
|
9016
9057
|
ref,
|
|
9017
9058
|
position: "relative",
|
|
@@ -9029,7 +9070,7 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
9029
9070
|
...rest,
|
|
9030
9071
|
children: [
|
|
9031
9072
|
children,
|
|
9032
|
-
/* @__PURE__ */
|
|
9073
|
+
/* @__PURE__ */ jsx58(Presence, { show: lit, from: "fade", position: "absolute", inset: "0", rounded: "l2", zIndex: "1", pointerEvents: "none", children: /* @__PURE__ */ jsxs44(
|
|
9033
9074
|
HStack13,
|
|
9034
9075
|
{
|
|
9035
9076
|
h: "full",
|
|
@@ -9043,8 +9084,8 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
9043
9084
|
textAlign: "center",
|
|
9044
9085
|
style: { transition: "background-color 160ms ease" },
|
|
9045
9086
|
children: [
|
|
9046
|
-
/* @__PURE__ */
|
|
9047
|
-
/* @__PURE__ */
|
|
9087
|
+
/* @__PURE__ */ jsx58(Bob, { active: over2 && !reduce }),
|
|
9088
|
+
/* @__PURE__ */ jsx58(Text19, { as: "span", truncate: true, children: hint })
|
|
9048
9089
|
]
|
|
9049
9090
|
}
|
|
9050
9091
|
) })
|
|
@@ -9063,60 +9104,60 @@ function Bob({ active }) {
|
|
|
9063
9104
|
});
|
|
9064
9105
|
return () => animation?.cancel();
|
|
9065
9106
|
}, [active]);
|
|
9066
|
-
return /* @__PURE__ */
|
|
9107
|
+
return /* @__PURE__ */ jsx58(Box13, { as: "span", ref, display: "inline-flex", flexShrink: 0, _icon: { boxSize: "4" }, children: /* @__PURE__ */ jsx58(ArrowDownToLine, {}) });
|
|
9067
9108
|
}
|
|
9068
9109
|
function DropHint({ show, children }) {
|
|
9069
|
-
return /* @__PURE__ */
|
|
9070
|
-
/* @__PURE__ */
|
|
9071
|
-
/* @__PURE__ */
|
|
9110
|
+
return /* @__PURE__ */ jsx58(Portal17, { children: /* @__PURE__ */ jsx58(Box13, { position: "fixed", insetInline: "0", bottom: "6", display: "flex", justifyContent: "center", pointerEvents: "none", zIndex: "toast", px: "4", children: /* @__PURE__ */ jsx58(Presence, { show, from: "rise", children: /* @__PURE__ */ jsxs44(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: [
|
|
9111
|
+
/* @__PURE__ */ jsx58(ArrowDownToLine, {}),
|
|
9112
|
+
/* @__PURE__ */ jsx58(Text19, { as: "span", truncate: true, children })
|
|
9072
9113
|
] }) }) }) });
|
|
9073
9114
|
}
|
|
9074
9115
|
|
|
9075
9116
|
// src/components/UploadList.tsx
|
|
9076
9117
|
import { useLayoutEffect as useLayoutEffect5, useRef as useRef21 } from "react";
|
|
9077
|
-
import { Box as
|
|
9118
|
+
import { Box as Box14, chakra as chakra35, HStack as HStack14, Stack as Stack14, Text as Text20 } from "@chakra-ui/react";
|
|
9078
9119
|
import { Check as Check3, File as FileIcon, RotateCcw, TriangleAlert, X as X3 } from "lucide-react";
|
|
9079
|
-
import { jsx as
|
|
9120
|
+
import { jsx as jsx59, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9080
9121
|
var OUT4 = `cubic-bezier(${curves.out.join(", ")})`;
|
|
9081
9122
|
function UploadList({ rows: rows2, summary, fraction, announce, labels, onCancel, onRetry, onDismiss }) {
|
|
9082
|
-
return /* @__PURE__ */
|
|
9083
|
-
/* @__PURE__ */
|
|
9084
|
-
rows2.length > 0 && summary != null && /* @__PURE__ */
|
|
9085
|
-
/* @__PURE__ */
|
|
9086
|
-
fraction != null && /* @__PURE__ */
|
|
9123
|
+
return /* @__PURE__ */ jsxs45(Stack14, { gap: "2", "data-testid": "upload-list", children: [
|
|
9124
|
+
/* @__PURE__ */ jsx59(chakra35.span, { srOnly: true, "aria-live": "polite", children: announce }),
|
|
9125
|
+
rows2.length > 0 && summary != null && /* @__PURE__ */ jsxs45(Stack14, { gap: "1", children: [
|
|
9126
|
+
/* @__PURE__ */ jsx59(Text20, { textStyle: "caption", color: "fg.muted", children: summary }),
|
|
9127
|
+
fraction != null && /* @__PURE__ */ jsx59(Bar2, { fraction, tone: "accent", label: typeof summary === "string" ? summary : void 0 })
|
|
9087
9128
|
] }),
|
|
9088
|
-
/* @__PURE__ */
|
|
9129
|
+
/* @__PURE__ */ jsx59(Stack14, { gap: "1.5", position: "relative", children: /* @__PURE__ */ jsx59(PresenceList, { children: rows2.map((row) => /* @__PURE__ */ jsx59(PresenceItem, { children: /* @__PURE__ */ jsx59(Row, { row, labels, onCancel, onRetry, onDismiss }) }, row.id)) }) })
|
|
9089
9130
|
] });
|
|
9090
9131
|
}
|
|
9091
9132
|
function Row({ row, labels, onCancel, onRetry, onDismiss }) {
|
|
9092
9133
|
const going = row.state === "waiting" || row.state === "sending";
|
|
9093
9134
|
const trouble = row.state === "failed" || row.state === "refused";
|
|
9094
|
-
return /* @__PURE__ */
|
|
9095
|
-
/* @__PURE__ */
|
|
9096
|
-
/* @__PURE__ */
|
|
9097
|
-
/* @__PURE__ */
|
|
9098
|
-
/* @__PURE__ */
|
|
9099
|
-
/* @__PURE__ */
|
|
9135
|
+
return /* @__PURE__ */ jsxs45(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: [
|
|
9136
|
+
/* @__PURE__ */ jsx59(Preview, { src: row.preview }),
|
|
9137
|
+
/* @__PURE__ */ jsxs45(Stack14, { gap: "1", flex: "1", minW: "0", children: [
|
|
9138
|
+
/* @__PURE__ */ jsxs45(HStack14, { gap: "2", justify: "space-between", children: [
|
|
9139
|
+
/* @__PURE__ */ jsx59(Text20, { as: "span", fontWeight: "medium", truncate: true, children: /* @__PURE__ */ jsx59("bdi", { children: row.name }) }),
|
|
9140
|
+
/* @__PURE__ */ jsx59(Text20, { as: "span", textStyle: "caption", color: trouble ? "fg.error" : "fg.muted", flexShrink: 0, fontVariantNumeric: "tabular-nums", children: row.state === "done" ? /* @__PURE__ */ jsx59(Done, {}) : row.status })
|
|
9100
9141
|
] }),
|
|
9101
|
-
(going || row.state === "done") && /* @__PURE__ */
|
|
9102
|
-
row.detail != null && /* @__PURE__ */
|
|
9103
|
-
trouble && /* @__PURE__ */
|
|
9142
|
+
(going || row.state === "done") && /* @__PURE__ */ jsx59(Bar2, { fraction: row.state === "done" ? 1 : row.fraction, tone: row.state === "done" ? "success" : "accent", label: row.name, quiet: row.state === "waiting" }),
|
|
9143
|
+
row.detail != null && /* @__PURE__ */ jsxs45(Text20, { as: "span", textStyle: "caption", color: trouble ? "fg.error" : "fg.muted", truncate: true, children: [
|
|
9144
|
+
trouble && /* @__PURE__ */ jsx59(Box14, { as: "span", display: "inline-flex", verticalAlign: "-0.15em", me: "1", _icon: { boxSize: "3.5" }, children: /* @__PURE__ */ jsx59(TriangleAlert, {}) }),
|
|
9104
9145
|
row.detail
|
|
9105
9146
|
] })
|
|
9106
9147
|
] }),
|
|
9107
|
-
going && /* @__PURE__ */
|
|
9108
|
-
row.state === "failed" && /* @__PURE__ */
|
|
9109
|
-
trouble && /* @__PURE__ */
|
|
9148
|
+
going && /* @__PURE__ */ jsx59(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.cancel(row.name), onClick: () => onCancel(row.id), children: /* @__PURE__ */ jsx59(X3, {}) }),
|
|
9149
|
+
row.state === "failed" && /* @__PURE__ */ jsx59(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.retry(row.name), onClick: () => onRetry(row.id), children: /* @__PURE__ */ jsx59(RotateCcw, {}) }),
|
|
9150
|
+
trouble && /* @__PURE__ */ jsx59(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.dismiss(row.name), onClick: () => onDismiss(row.id), children: /* @__PURE__ */ jsx59(X3, {}) })
|
|
9110
9151
|
] });
|
|
9111
9152
|
}
|
|
9112
9153
|
function Preview({ src }) {
|
|
9113
|
-
return /* @__PURE__ */
|
|
9154
|
+
return /* @__PURE__ */ jsx59(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__ */ jsx59(chakra35.img, { src, alt: "", boxSize: "full", objectFit: "cover" }) : /* @__PURE__ */ jsx59(FileIcon, {}) });
|
|
9114
9155
|
}
|
|
9115
9156
|
function Bar2({ fraction, tone, label, quiet: quiet2 }) {
|
|
9116
9157
|
const { reduce } = useMotionSetting();
|
|
9117
9158
|
const percent = Math.round(Math.max(0, Math.min(1, fraction)) * 100);
|
|
9118
|
-
return /* @__PURE__ */
|
|
9119
|
-
|
|
9159
|
+
return /* @__PURE__ */ jsx59(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__ */ jsx59(
|
|
9160
|
+
Box14,
|
|
9120
9161
|
{
|
|
9121
9162
|
h: "full",
|
|
9122
9163
|
rounded: "full",
|
|
@@ -9142,7 +9183,7 @@ function Done() {
|
|
|
9142
9183
|
{ duration: 260, easing: OUT4 }
|
|
9143
9184
|
);
|
|
9144
9185
|
}, []);
|
|
9145
|
-
return /* @__PURE__ */
|
|
9186
|
+
return /* @__PURE__ */ jsx59(chakra35.span, { ref, display: "inline-grid", placeItems: "center", boxSize: "4", rounded: "full", bg: "fg.success", color: "bg", _icon: { boxSize: "3" }, children: /* @__PURE__ */ jsx59(Check3, { strokeWidth: 3 }) });
|
|
9146
9187
|
}
|
|
9147
9188
|
|
|
9148
9189
|
// src/files/drop.ts
|
|
@@ -9413,7 +9454,7 @@ function usePastedFiles({ enabled = true, onFiles }) {
|
|
|
9413
9454
|
|
|
9414
9455
|
// src/components/SortableSections.tsx
|
|
9415
9456
|
import { useMemo as useMemo13, useState as useState24 } from "react";
|
|
9416
|
-
import { Box as
|
|
9457
|
+
import { Box as Box15, Stack as Stack15, Text as Text21 } from "@chakra-ui/react";
|
|
9417
9458
|
import {
|
|
9418
9459
|
DndContext as DndContext4,
|
|
9419
9460
|
DragOverlay as DragOverlay3,
|
|
@@ -9426,7 +9467,7 @@ import {
|
|
|
9426
9467
|
} from "@dnd-kit/core";
|
|
9427
9468
|
import { SortableContext as SortableContext3, sortableKeyboardCoordinates as sortableKeyboardCoordinates3, useSortable as useSortable3, verticalListSortingStrategy as verticalListSortingStrategy3 } from "@dnd-kit/sortable";
|
|
9428
9469
|
import { CSS as CSS4 } from "@dnd-kit/utilities";
|
|
9429
|
-
import { jsx as
|
|
9470
|
+
import { jsx as jsx60, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
9430
9471
|
var sectionId = (id) => `section:${id}`;
|
|
9431
9472
|
function SortableSections({
|
|
9432
9473
|
"aria-label": ariaLabel,
|
|
@@ -9440,7 +9481,7 @@ function SortableSections({
|
|
|
9440
9481
|
skeletonItemHeight = "9"
|
|
9441
9482
|
}) {
|
|
9442
9483
|
const loading = useLoading(own);
|
|
9443
|
-
const shown = loading && sections.length === 0 ? [0, 1].map((n) => ({ id: `skeleton-${n}`, header: /* @__PURE__ */
|
|
9484
|
+
const shown = loading && sections.length === 0 ? [0, 1].map((n) => ({ id: `skeleton-${n}`, header: /* @__PURE__ */ jsx60(TextBone, { width: boneWidth(n, 14, 22) }), items: [] })) : sections;
|
|
9444
9485
|
const sensors = useSensors4(
|
|
9445
9486
|
useSensor4(PointerSensor4, { activationConstraint: { distance: 6 } }),
|
|
9446
9487
|
useSensor4(KeyboardSensor3, { coordinateGetter: sortableKeyboardCoordinates3 })
|
|
@@ -9476,7 +9517,7 @@ function SortableSections({
|
|
|
9476
9517
|
if (from === target && !move.before && !move.after) return;
|
|
9477
9518
|
onMove(item, move);
|
|
9478
9519
|
}
|
|
9479
|
-
return /* @__PURE__ */
|
|
9520
|
+
return /* @__PURE__ */ jsxs46(
|
|
9480
9521
|
DndContext4,
|
|
9481
9522
|
{
|
|
9482
9523
|
sensors,
|
|
@@ -9486,16 +9527,16 @@ function SortableSections({
|
|
|
9486
9527
|
onDragCancel: () => setActive(null),
|
|
9487
9528
|
accessibility: { announcements, screenReaderInstructions: screenReaderInstructions ? { draggable: screenReaderInstructions } : void 0 },
|
|
9488
9529
|
children: [
|
|
9489
|
-
/* @__PURE__ */
|
|
9490
|
-
loading && s.items.length === 0 && Array.from({ length: skeletonItems }, (_, n) => /* @__PURE__ */
|
|
9491
|
-
/* @__PURE__ */
|
|
9492
|
-
/* @__PURE__ */
|
|
9530
|
+
/* @__PURE__ */ jsx60(Stack15, { role: "region", "aria-label": ariaLabel, gap: "4", children: shown.map((s) => /* @__PURE__ */ jsxs46(Section, { section: s, dragging: !!active, children: [
|
|
9531
|
+
loading && s.items.length === 0 && Array.from({ length: skeletonItems }, (_, n) => /* @__PURE__ */ jsxs46(Box15, { h: skeletonItemHeight, px: "2", display: "flex", alignItems: "center", gap: "3", "aria-hidden": "true", children: [
|
|
9532
|
+
/* @__PURE__ */ jsx60(Bone, { width: "14", height: "4" }),
|
|
9533
|
+
/* @__PURE__ */ jsx60(TextBone, { width: boneWidth(n, 16, 36) })
|
|
9493
9534
|
] }, n)),
|
|
9494
|
-
s.items.map((item) => /* @__PURE__ */
|
|
9495
|
-
!loading && s.items.length === 0 && s.empty && /* @__PURE__ */
|
|
9535
|
+
s.items.map((item) => /* @__PURE__ */ jsx60(SortableItem, { id: item.id, children: (dragging) => renderItem(item, { dragging }) }, item.id)),
|
|
9536
|
+
!loading && s.items.length === 0 && s.empty && /* @__PURE__ */ jsx60(Text21, { textStyle: "caption", color: "fg.subtle", textAlign: "center", py: "4", children: s.empty }),
|
|
9496
9537
|
!loading && s.footer
|
|
9497
9538
|
] }, s.id)) }),
|
|
9498
|
-
/* @__PURE__ */
|
|
9539
|
+
/* @__PURE__ */ jsx60(DragOverlay3, { children: active ? /* @__PURE__ */ jsx60(Box15, { shadow: "lg", rounded: "l2", bg: "bg.panel", children: renderItem(active, { dragging: true }) }) : null })
|
|
9499
9540
|
]
|
|
9500
9541
|
}
|
|
9501
9542
|
);
|
|
@@ -9503,10 +9544,10 @@ function SortableSections({
|
|
|
9503
9544
|
function Section({ section, dragging, children }) {
|
|
9504
9545
|
const id = sectionId(section.id);
|
|
9505
9546
|
const { setNodeRef, isOver } = useDroppable3({ id });
|
|
9506
|
-
return /* @__PURE__ */
|
|
9507
|
-
/* @__PURE__ */
|
|
9508
|
-
/* @__PURE__ */
|
|
9509
|
-
|
|
9547
|
+
return /* @__PURE__ */ jsxs46(Box15, { as: "section", borderWidth: "1px", borderColor: "border", rounded: "l3", bg: "bg.panel", "data-section": section.id, children: [
|
|
9548
|
+
/* @__PURE__ */ jsx60(Box15, { px: "3", py: "2", borderBottomWidth: "1px", borderColor: "border.muted", children: section.header }),
|
|
9549
|
+
/* @__PURE__ */ jsx60(SortableContext3, { id, items: section.items.map((i) => i.id), strategy: verticalListSortingStrategy3, children: /* @__PURE__ */ jsx60(
|
|
9550
|
+
Stack15,
|
|
9510
9551
|
{
|
|
9511
9552
|
ref: setNodeRef,
|
|
9512
9553
|
gap: "0",
|
|
@@ -9522,8 +9563,8 @@ function Section({ section, dragging, children }) {
|
|
|
9522
9563
|
}
|
|
9523
9564
|
function SortableItem({ id, children }) {
|
|
9524
9565
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = useSortable3({ id });
|
|
9525
|
-
return /* @__PURE__ */
|
|
9526
|
-
|
|
9566
|
+
return /* @__PURE__ */ jsx60(
|
|
9567
|
+
Box15,
|
|
9527
9568
|
{
|
|
9528
9569
|
ref: setNodeRef,
|
|
9529
9570
|
style: { transform: CSS4.Transform.toString(transform), transition },
|
|
@@ -9540,9 +9581,9 @@ function SortableItem({ id, children }) {
|
|
|
9540
9581
|
|
|
9541
9582
|
// src/components/TimelineChart.tsx
|
|
9542
9583
|
import { Fragment as Fragment21, useEffect as useEffect18, useLayoutEffect as useLayoutEffect6, useRef as useRef23, useState as useState25 } from "react";
|
|
9543
|
-
import { Box as
|
|
9584
|
+
import { Box as Box16, HStack as HStack15, Popover as Popover4, Portal as Portal18, Stack as Stack16, Text as Text22 } from "@chakra-ui/react";
|
|
9544
9585
|
import { Flag, Trash2 as Trash23 } from "lucide-react";
|
|
9545
|
-
import { jsx as
|
|
9586
|
+
import { jsx as jsx61, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
9546
9587
|
var DAY2 = 864e5;
|
|
9547
9588
|
var toDay = (day) => Math.round(Date.parse(`${day}T00:00:00Z`) / DAY2);
|
|
9548
9589
|
var fromDay = (n) => new Date(n * DAY2).toISOString().slice(0, 10);
|
|
@@ -9811,8 +9852,8 @@ function TimelineChart({
|
|
|
9811
9852
|
const bandsTop = tickHeight, markersTop = tickHeight + (shownBands.length ? STRIP : 0);
|
|
9812
9853
|
const headerHeight = markersTop + (shownMarkers.length ? STRIP : 0);
|
|
9813
9854
|
const todayAt = today ? toDay(today) - origin : -1;
|
|
9814
|
-
return /* @__PURE__ */
|
|
9815
|
-
|
|
9855
|
+
return /* @__PURE__ */ jsxs47(
|
|
9856
|
+
Box16,
|
|
9816
9857
|
{
|
|
9817
9858
|
ref: root,
|
|
9818
9859
|
role: "region",
|
|
@@ -9829,10 +9870,10 @@ function TimelineChart({
|
|
|
9829
9870
|
},
|
|
9830
9871
|
onKeyDown: zoomKey,
|
|
9831
9872
|
children: [
|
|
9832
|
-
instructions && /* @__PURE__ */
|
|
9833
|
-
/* @__PURE__ */
|
|
9834
|
-
/* @__PURE__ */
|
|
9835
|
-
|
|
9873
|
+
instructions && /* @__PURE__ */ jsx61(Text22, { srOnly: true, children: instructions }),
|
|
9874
|
+
/* @__PURE__ */ jsxs47(Box16, { display: "grid", gridTemplateColumns: fill5 ? `${labelWidth}px minmax(${width}px, 1fr)` : `${labelWidth}px ${width}px`, minW: "fit-content", children: [
|
|
9875
|
+
/* @__PURE__ */ jsx61(
|
|
9876
|
+
Box16,
|
|
9836
9877
|
{
|
|
9837
9878
|
position: "sticky",
|
|
9838
9879
|
top: "0",
|
|
@@ -9850,9 +9891,9 @@ function TimelineChart({
|
|
|
9850
9891
|
children: corner
|
|
9851
9892
|
}
|
|
9852
9893
|
),
|
|
9853
|
-
/* @__PURE__ */
|
|
9854
|
-
ticks.map((t, i) => /* @__PURE__ */
|
|
9855
|
-
|
|
9894
|
+
/* @__PURE__ */ jsxs47(Box16, { position: "sticky", top: "0", zIndex: "2", bg: "bg.muted", borderBottomWidth: "1px", borderColor: "border", h: `${headerHeight}px`, overflow: "clip", children: [
|
|
9895
|
+
ticks.map((t, i) => /* @__PURE__ */ jsx61(
|
|
9896
|
+
Box16,
|
|
9856
9897
|
{
|
|
9857
9898
|
position: "absolute",
|
|
9858
9899
|
insetStart: `${t.day * dayWidth}px`,
|
|
@@ -9862,8 +9903,8 @@ function TimelineChart({
|
|
|
9862
9903
|
borderInlineStartWidth: "1px",
|
|
9863
9904
|
borderColor: "border",
|
|
9864
9905
|
"aria-hidden": true,
|
|
9865
|
-
children: /* @__PURE__ */
|
|
9866
|
-
|
|
9906
|
+
children: /* @__PURE__ */ jsx61(
|
|
9907
|
+
Text22,
|
|
9867
9908
|
{
|
|
9868
9909
|
position: "sticky",
|
|
9869
9910
|
insetStart: `${labelWidth}px`,
|
|
@@ -9881,8 +9922,8 @@ function TimelineChart({
|
|
|
9881
9922
|
},
|
|
9882
9923
|
t.day
|
|
9883
9924
|
)),
|
|
9884
|
-
subTicks.map((t) => /* @__PURE__ */
|
|
9885
|
-
|
|
9925
|
+
subTicks.map((t) => /* @__PURE__ */ jsx61(
|
|
9926
|
+
Text22,
|
|
9886
9927
|
{
|
|
9887
9928
|
position: "absolute",
|
|
9888
9929
|
insetStart: `${t.day * dayWidth}px`,
|
|
@@ -9901,8 +9942,8 @@ function TimelineChart({
|
|
|
9901
9942
|
},
|
|
9902
9943
|
t.day
|
|
9903
9944
|
)),
|
|
9904
|
-
offRuns.filter((o) => o.kind === "holiday").map((o) => /* @__PURE__ */
|
|
9905
|
-
|
|
9945
|
+
offRuns.filter((o) => o.kind === "holiday").map((o) => /* @__PURE__ */ jsx61(Tooltip, { content: o.label, children: /* @__PURE__ */ jsx61(
|
|
9946
|
+
Box16,
|
|
9906
9947
|
{
|
|
9907
9948
|
position: "absolute",
|
|
9908
9949
|
insetStart: `${o.a * dayWidth}px`,
|
|
@@ -9916,8 +9957,8 @@ function TimelineChart({
|
|
|
9916
9957
|
"aria-label": o.label
|
|
9917
9958
|
}
|
|
9918
9959
|
) }, `h${o.a}`)),
|
|
9919
|
-
shownBands.map((b) => /* @__PURE__ */
|
|
9920
|
-
|
|
9960
|
+
shownBands.map((b) => /* @__PURE__ */ jsx61(Tooltip, { content: b.detail ?? b.label, children: /* @__PURE__ */ jsx61(
|
|
9961
|
+
Box16,
|
|
9921
9962
|
{
|
|
9922
9963
|
position: "absolute",
|
|
9923
9964
|
insetStart: `${b.a * dayWidth + 1}px`,
|
|
@@ -9933,8 +9974,8 @@ function TimelineChart({
|
|
|
9933
9974
|
focusVisibleRing: "inside",
|
|
9934
9975
|
overflow: "clip",
|
|
9935
9976
|
"aria-label": b.label,
|
|
9936
|
-
children: /* @__PURE__ */
|
|
9937
|
-
|
|
9977
|
+
children: /* @__PURE__ */ jsx61(
|
|
9978
|
+
Text22,
|
|
9938
9979
|
{
|
|
9939
9980
|
position: "sticky",
|
|
9940
9981
|
insetStart: `${labelWidth}px`,
|
|
@@ -9946,13 +9987,13 @@ function TimelineChart({
|
|
|
9946
9987
|
color: b.current ? "colorPalette.fg" : "fg.muted",
|
|
9947
9988
|
fontWeight: b.current ? "medium" : void 0,
|
|
9948
9989
|
truncate: true,
|
|
9949
|
-
children: /* @__PURE__ */
|
|
9990
|
+
children: /* @__PURE__ */ jsx61("bdi", { children: b.label })
|
|
9950
9991
|
}
|
|
9951
9992
|
)
|
|
9952
9993
|
}
|
|
9953
9994
|
) }, b.id)),
|
|
9954
|
-
shownMarkers.map((m4) => /* @__PURE__ */
|
|
9955
|
-
|
|
9995
|
+
shownMarkers.map((m4) => /* @__PURE__ */ jsx61(Tooltip, { content: m4.detail ?? m4.label, children: /* @__PURE__ */ jsxs47(
|
|
9996
|
+
Box16,
|
|
9956
9997
|
{
|
|
9957
9998
|
position: "absolute",
|
|
9958
9999
|
insetStart: `${m4.at * dayWidth + dayWidth / 2 - 1}px`,
|
|
@@ -9976,16 +10017,16 @@ function TimelineChart({
|
|
|
9976
10017
|
focusVisibleRing: "outside",
|
|
9977
10018
|
"aria-label": m4.label,
|
|
9978
10019
|
children: [
|
|
9979
|
-
/* @__PURE__ */
|
|
9980
|
-
/* @__PURE__ */
|
|
10020
|
+
/* @__PURE__ */ jsx61(Flag, { size: 11, "aria-hidden": true }),
|
|
10021
|
+
/* @__PURE__ */ jsx61("bdi", { children: m4.label })
|
|
9981
10022
|
]
|
|
9982
10023
|
}
|
|
9983
10024
|
) }, m4.id))
|
|
9984
10025
|
] }),
|
|
9985
|
-
/* @__PURE__ */
|
|
9986
|
-
/* @__PURE__ */
|
|
9987
|
-
offRuns.map((o) => /* @__PURE__ */
|
|
9988
|
-
|
|
10026
|
+
/* @__PURE__ */ jsx61(Box16, { position: "sticky", insetStart: "0", zIndex: "1", bg: "bg.panel", borderInlineEndWidth: "1px", borderColor: "border", children: shown.map((r, i) => /* @__PURE__ */ jsx61(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__ */ jsx61(TextBone, { width: boneWidth(i, 12, 26) }) : r.heading ?? (r.item && renderLabel(r.item)) }, r.id)) }),
|
|
10027
|
+
/* @__PURE__ */ jsxs47(Box16, { ref: layer, position: "relative", zIndex: "0", h: `${shown.length * rowHeight}px`, children: [
|
|
10028
|
+
offRuns.map((o) => /* @__PURE__ */ jsx61(
|
|
10029
|
+
Box16,
|
|
9989
10030
|
{
|
|
9990
10031
|
position: "absolute",
|
|
9991
10032
|
insetStart: `${o.a * dayWidth}px`,
|
|
@@ -9999,9 +10040,9 @@ function TimelineChart({
|
|
|
9999
10040
|
},
|
|
10000
10041
|
`o${o.a}`
|
|
10001
10042
|
)),
|
|
10002
|
-
ticks.map((t) => /* @__PURE__ */
|
|
10003
|
-
shownBands.filter((b) => b.current).map((b) => /* @__PURE__ */
|
|
10004
|
-
|
|
10043
|
+
ticks.map((t) => /* @__PURE__ */ jsx61(Box16, { position: "absolute", insetStart: `${t.day * dayWidth}px`, top: "0", bottom: "0", borderInlineStartWidth: "1px", borderColor: "border.muted", "aria-hidden": true }, t.day)),
|
|
10044
|
+
shownBands.filter((b) => b.current).map((b) => /* @__PURE__ */ jsx61(
|
|
10045
|
+
Box16,
|
|
10005
10046
|
{
|
|
10006
10047
|
position: "absolute",
|
|
10007
10048
|
insetStart: `${b.a * dayWidth}px`,
|
|
@@ -10015,8 +10056,8 @@ function TimelineChart({
|
|
|
10015
10056
|
},
|
|
10016
10057
|
b.id
|
|
10017
10058
|
)),
|
|
10018
|
-
shownMarkers.map((m4) => /* @__PURE__ */
|
|
10019
|
-
|
|
10059
|
+
shownMarkers.map((m4) => /* @__PURE__ */ jsx61(
|
|
10060
|
+
Box16,
|
|
10020
10061
|
{
|
|
10021
10062
|
position: "absolute",
|
|
10022
10063
|
insetStart: `${m4.at * dayWidth + dayWidth / 2 - 1}px`,
|
|
@@ -10032,8 +10073,8 @@ function TimelineChart({
|
|
|
10032
10073
|
},
|
|
10033
10074
|
m4.id
|
|
10034
10075
|
)),
|
|
10035
|
-
todayAt >= 0 && todayAt < days && /* @__PURE__ */
|
|
10036
|
-
|
|
10076
|
+
todayAt >= 0 && todayAt < days && /* @__PURE__ */ jsx61(
|
|
10077
|
+
Box16,
|
|
10037
10078
|
{
|
|
10038
10079
|
position: "absolute",
|
|
10039
10080
|
insetStart: `${todayAt * dayWidth + dayWidth / 2}px`,
|
|
@@ -10045,8 +10086,8 @@ function TimelineChart({
|
|
|
10045
10086
|
"aria-hidden": true
|
|
10046
10087
|
}
|
|
10047
10088
|
),
|
|
10048
|
-
shown.map((r, i) => /* @__PURE__ */
|
|
10049
|
-
|
|
10089
|
+
shown.map((r, i) => /* @__PURE__ */ jsx61(
|
|
10090
|
+
Box16,
|
|
10050
10091
|
{
|
|
10051
10092
|
position: "absolute",
|
|
10052
10093
|
insetStart: "0",
|
|
@@ -10060,7 +10101,7 @@ function TimelineChart({
|
|
|
10060
10101
|
},
|
|
10061
10102
|
r.id
|
|
10062
10103
|
)),
|
|
10063
|
-
placeholders && shown.map((r, i) => /* @__PURE__ */
|
|
10104
|
+
placeholders && shown.map((r, i) => /* @__PURE__ */ jsx61(
|
|
10064
10105
|
Bone,
|
|
10065
10106
|
{
|
|
10066
10107
|
position: "absolute",
|
|
@@ -10077,8 +10118,8 @@ function TimelineChart({
|
|
|
10077
10118
|
if (!bl || !bl.start && !bl.end) return null;
|
|
10078
10119
|
const a = Math.max(toDay(bl.start ?? bl.end) - origin, 0), z = Math.min(toDay(bl.end ?? bl.start) - origin, days - 1);
|
|
10079
10120
|
if (z < a) return null;
|
|
10080
|
-
return /* @__PURE__ */
|
|
10081
|
-
|
|
10121
|
+
return /* @__PURE__ */ jsx61(
|
|
10122
|
+
Box16,
|
|
10082
10123
|
{
|
|
10083
10124
|
position: "absolute",
|
|
10084
10125
|
insetStart: `${a * dayWidth}px`,
|
|
@@ -10099,8 +10140,8 @@ function TimelineChart({
|
|
|
10099
10140
|
if (z < a) return null;
|
|
10100
10141
|
const w = (z - a + 1) * dayWidth - 2;
|
|
10101
10142
|
const palette3 = c2.tone === "over" ? "danger" : c2.tone === "full" ? "warning" : "accent";
|
|
10102
|
-
return /* @__PURE__ */
|
|
10103
|
-
|
|
10143
|
+
return /* @__PURE__ */ jsx61(
|
|
10144
|
+
Box16,
|
|
10104
10145
|
{
|
|
10105
10146
|
position: "absolute",
|
|
10106
10147
|
insetStart: `${a * dayWidth + 1}px`,
|
|
@@ -10140,9 +10181,9 @@ function TimelineChart({
|
|
|
10140
10181
|
const thin = tone === "rollup" && !single;
|
|
10141
10182
|
const diamond = single ? { w: `${DIAMOND}px`, h: `${DIAMOND}px`, top: `${i * rowHeight + rowHeight / 2 - DIAMOND / 2}px`, transform: "rotate(45deg)", rounded: "l1" } : null;
|
|
10142
10183
|
const canLink = !!onLink && item.linkable !== false && !drag;
|
|
10143
|
-
return /* @__PURE__ */
|
|
10144
|
-
/* @__PURE__ */
|
|
10145
|
-
|
|
10184
|
+
return /* @__PURE__ */ jsxs47(Fragment21, { children: [
|
|
10185
|
+
/* @__PURE__ */ jsxs47(
|
|
10186
|
+
Box16,
|
|
10146
10187
|
{
|
|
10147
10188
|
role: "button",
|
|
10148
10189
|
tabIndex: 0,
|
|
@@ -10197,8 +10238,8 @@ function TimelineChart({
|
|
|
10197
10238
|
"data-bar": item.id,
|
|
10198
10239
|
children: [
|
|
10199
10240
|
!single && !thin && renderBar?.(item),
|
|
10200
|
-
item.progress != null && !single && /* @__PURE__ */
|
|
10201
|
-
|
|
10241
|
+
item.progress != null && !single && /* @__PURE__ */ jsx61(
|
|
10242
|
+
Box16,
|
|
10202
10243
|
{
|
|
10203
10244
|
position: "absolute",
|
|
10204
10245
|
insetStart: "0",
|
|
@@ -10213,8 +10254,8 @@ function TimelineChart({
|
|
|
10213
10254
|
),
|
|
10214
10255
|
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
|
|
10215
10256
|
// change would be saved twice (the second refused as a conflict).
|
|
10216
|
-
/* @__PURE__ */
|
|
10217
|
-
|
|
10257
|
+
/* @__PURE__ */ jsx61(
|
|
10258
|
+
Box16,
|
|
10218
10259
|
{
|
|
10219
10260
|
position: "absolute",
|
|
10220
10261
|
insetEnd: "0",
|
|
@@ -10237,8 +10278,8 @@ function TimelineChart({
|
|
|
10237
10278
|
]
|
|
10238
10279
|
}
|
|
10239
10280
|
),
|
|
10240
|
-
canLink && (hot === item.id || linking?.from.id === item.id) && /* @__PURE__ */
|
|
10241
|
-
|
|
10281
|
+
canLink && (hot === item.id || linking?.from.id === item.id) && /* @__PURE__ */ jsx61(
|
|
10282
|
+
Box16,
|
|
10242
10283
|
{
|
|
10243
10284
|
position: "absolute",
|
|
10244
10285
|
insetStart: `${single ? right + 3 : Math.max(right, left + 6)}px`,
|
|
@@ -10259,13 +10300,13 @@ function TimelineChart({
|
|
|
10259
10300
|
onPointerUp: linkUp,
|
|
10260
10301
|
onPointerCancel: () => setLinking(null),
|
|
10261
10302
|
"aria-hidden": true,
|
|
10262
|
-
children: /* @__PURE__ */
|
|
10303
|
+
children: /* @__PURE__ */ jsx61(Box16, { w: "2.5", h: "2.5", rounded: "full", bg: "bg.panel", borderWidth: "2px", borderColor: "accent.solid" })
|
|
10263
10304
|
}
|
|
10264
10305
|
)
|
|
10265
10306
|
] }, item.id);
|
|
10266
10307
|
}),
|
|
10267
|
-
/* @__PURE__ */
|
|
10268
|
-
|
|
10308
|
+
/* @__PURE__ */ jsx61(
|
|
10309
|
+
Box16,
|
|
10269
10310
|
{
|
|
10270
10311
|
position: "absolute",
|
|
10271
10312
|
insetInlineStart: "0",
|
|
@@ -10276,8 +10317,8 @@ function TimelineChart({
|
|
|
10276
10317
|
zIndex: "1",
|
|
10277
10318
|
_rtl: { transform: "scaleX(-1)" },
|
|
10278
10319
|
"aria-hidden": !onUnlink,
|
|
10279
|
-
children: /* @__PURE__ */
|
|
10280
|
-
/* @__PURE__ */
|
|
10320
|
+
children: /* @__PURE__ */ jsxs47("svg", { width, height: rows2.length * rowHeight, style: { position: "absolute", left: 0, top: 0 }, children: [
|
|
10321
|
+
/* @__PURE__ */ jsx61("defs", { children: /* @__PURE__ */ jsx61("marker", { id: "abp-arrow", viewBox: "0 0 8 8", refX: "7", refY: "4", markerWidth: "7", markerHeight: "7", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx61("path", { d: "M 0 0 L 8 4 L 0 8 z", fill: "context-stroke" }) }) }),
|
|
10281
10322
|
links.map((l) => {
|
|
10282
10323
|
const f = ys.get(l.from), t = ys.get(l.to);
|
|
10283
10324
|
if (!f || !t) return null;
|
|
@@ -10288,8 +10329,8 @@ function TimelineChart({
|
|
|
10288
10329
|
const picked = menu?.from === l.from && menu.to === l.to;
|
|
10289
10330
|
const faint = !l.strong && links.some((x) => x.strong);
|
|
10290
10331
|
const open = (x, y) => setMenu({ from: l.from, to: l.to, x, y });
|
|
10291
|
-
return /* @__PURE__ */
|
|
10292
|
-
/* @__PURE__ */
|
|
10332
|
+
return /* @__PURE__ */ jsxs47("g", { children: [
|
|
10333
|
+
/* @__PURE__ */ jsx61(
|
|
10293
10334
|
"path",
|
|
10294
10335
|
{
|
|
10295
10336
|
d,
|
|
@@ -10301,7 +10342,7 @@ function TimelineChart({
|
|
|
10301
10342
|
markerEnd: "url(#abp-arrow)"
|
|
10302
10343
|
}
|
|
10303
10344
|
),
|
|
10304
|
-
onUnlink && /* @__PURE__ */
|
|
10345
|
+
onUnlink && /* @__PURE__ */ jsx61(
|
|
10305
10346
|
"path",
|
|
10306
10347
|
{
|
|
10307
10348
|
d,
|
|
@@ -10326,14 +10367,14 @@ function TimelineChart({
|
|
|
10326
10367
|
] })
|
|
10327
10368
|
}
|
|
10328
10369
|
),
|
|
10329
|
-
linking && /* @__PURE__ */
|
|
10330
|
-
/* @__PURE__ */
|
|
10331
|
-
/* @__PURE__ */
|
|
10370
|
+
linking && /* @__PURE__ */ jsxs47("svg", { width: "100%", height: shown.length * rowHeight, style: { position: "absolute", left: 0, top: 0, pointerEvents: "none", zIndex: 3 }, "aria-hidden": true, children: [
|
|
10371
|
+
/* @__PURE__ */ jsx61("line", { x1: linking.x0, y1: linking.y0, x2: linking.x, y2: linking.y, stroke: tv("colors.accent.solid"), strokeWidth: 2, strokeDasharray: "5 4" }),
|
|
10372
|
+
/* @__PURE__ */ jsx61("circle", { cx: linking.x, cy: linking.y, r: 4, fill: tv("colors.accent.solid") })
|
|
10332
10373
|
] })
|
|
10333
10374
|
] })
|
|
10334
10375
|
] }),
|
|
10335
|
-
card && renderCard && items.has(card.id) && /* @__PURE__ */
|
|
10336
|
-
|
|
10376
|
+
card && renderCard && items.has(card.id) && /* @__PURE__ */ jsx61(Portal18, { children: /* @__PURE__ */ jsx61(
|
|
10377
|
+
Box16,
|
|
10337
10378
|
{
|
|
10338
10379
|
id: "abp-timeline-card",
|
|
10339
10380
|
role: "tooltip",
|
|
@@ -10356,7 +10397,7 @@ function TimelineChart({
|
|
|
10356
10397
|
children: renderCard(items.get(card.id))
|
|
10357
10398
|
}
|
|
10358
10399
|
) }),
|
|
10359
|
-
onUnlink && /* @__PURE__ */
|
|
10400
|
+
onUnlink && /* @__PURE__ */ jsx61(
|
|
10360
10401
|
Popover4.Root,
|
|
10361
10402
|
{
|
|
10362
10403
|
open: !!menu,
|
|
@@ -10365,13 +10406,13 @@ function TimelineChart({
|
|
|
10365
10406
|
unmountOnExit: true,
|
|
10366
10407
|
autoFocus: true,
|
|
10367
10408
|
positioning: { placement: "bottom", getAnchorRect: () => menu ? { x: menu.x, y: menu.y, width: 1, height: 1 } : null },
|
|
10368
|
-
children: /* @__PURE__ */
|
|
10369
|
-
/* @__PURE__ */
|
|
10370
|
-
/* @__PURE__ */
|
|
10409
|
+
children: /* @__PURE__ */ jsx61(Portal18, { children: /* @__PURE__ */ jsx61(Popover4.Positioner, { children: /* @__PURE__ */ jsx61(Popover4.Content, { w: "auto", maxW: "calc(100vw - 32px)", children: /* @__PURE__ */ jsx61(Popover4.Body, { children: menu && /* @__PURE__ */ jsxs47(Stack16, { gap: "2", children: [
|
|
10410
|
+
/* @__PURE__ */ jsx61(Text22, { textStyle: "label", children: linkTexts?.arrow(menu.from, menu.to) }),
|
|
10411
|
+
/* @__PURE__ */ jsxs47(Button, { size: "sm", variant: "secondary", onClick: () => {
|
|
10371
10412
|
onUnlink(menu);
|
|
10372
10413
|
setMenu(null);
|
|
10373
10414
|
}, children: [
|
|
10374
|
-
/* @__PURE__ */
|
|
10415
|
+
/* @__PURE__ */ jsx61(Trash23, {}),
|
|
10375
10416
|
linkTexts?.remove
|
|
10376
10417
|
] })
|
|
10377
10418
|
] }) }) }) }) })
|
|
@@ -10384,7 +10425,7 @@ function TimelineChart({
|
|
|
10384
10425
|
|
|
10385
10426
|
// src/components/TimelineCards.tsx
|
|
10386
10427
|
import { useEffect as useEffect19, useMemo as useMemo14, useRef as useRef24, useState as useState26 } from "react";
|
|
10387
|
-
import { Box as
|
|
10428
|
+
import { Box as Box17, chakra as chakra36, Grid as Grid4, Stack as Stack17, Text as Text23 } from "@chakra-ui/react";
|
|
10388
10429
|
|
|
10389
10430
|
// src/components/timeline-cards-math.ts
|
|
10390
10431
|
var DAY3 = 864e5;
|
|
@@ -10436,7 +10477,7 @@ function placeCards(items, first, days, scale, colW = columnWidth(scale)) {
|
|
|
10436
10477
|
}
|
|
10437
10478
|
|
|
10438
10479
|
// src/components/TimelineCards.tsx
|
|
10439
|
-
import { jsx as
|
|
10480
|
+
import { jsx as jsx62, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
10440
10481
|
var LANE = 60;
|
|
10441
10482
|
var KEYS = { d: "day", w: "week", m: "month" };
|
|
10442
10483
|
function TimelineCards(props) {
|
|
@@ -10450,8 +10491,8 @@ function TimelineCards(props) {
|
|
|
10450
10491
|
onScale(next);
|
|
10451
10492
|
}
|
|
10452
10493
|
};
|
|
10453
|
-
return /* @__PURE__ */
|
|
10454
|
-
|
|
10494
|
+
return /* @__PURE__ */ jsxs48(
|
|
10495
|
+
chakra36.div,
|
|
10455
10496
|
{
|
|
10456
10497
|
role: "region",
|
|
10457
10498
|
"aria-label": props["aria-label"],
|
|
@@ -10461,15 +10502,15 @@ function TimelineCards(props) {
|
|
|
10461
10502
|
overflow: "hidden",
|
|
10462
10503
|
"data-timeline-cards": scale,
|
|
10463
10504
|
children: [
|
|
10464
|
-
scale === "day" ? /* @__PURE__ */
|
|
10505
|
+
scale === "day" ? /* @__PURE__ */ jsx62(DayGrid, { ...props }) : /* @__PURE__ */ jsx62(Lanes, { ...props, scale }),
|
|
10465
10506
|
props.footer
|
|
10466
10507
|
]
|
|
10467
10508
|
}
|
|
10468
10509
|
);
|
|
10469
10510
|
}
|
|
10470
10511
|
function Card2({ item, p, range, cutStart, cutEnd, style }) {
|
|
10471
|
-
const card = /* @__PURE__ */
|
|
10472
|
-
|
|
10512
|
+
const card = /* @__PURE__ */ jsxs48(
|
|
10513
|
+
chakra36.button,
|
|
10473
10514
|
{
|
|
10474
10515
|
type: "button",
|
|
10475
10516
|
"data-timeline-card": item.id,
|
|
@@ -10493,12 +10534,12 @@ function Card2({ item, p, range, cutStart, cutEnd, style }) {
|
|
|
10493
10534
|
transition: "background 120ms, border-color 120ms",
|
|
10494
10535
|
...style,
|
|
10495
10536
|
children: [
|
|
10496
|
-
/* @__PURE__ */
|
|
10497
|
-
/* @__PURE__ */
|
|
10537
|
+
/* @__PURE__ */ jsx62(Box17, { as: "span", w: "3px", flexShrink: 0, bg: p.accent?.(item) ?? "border.emphasized", "aria-hidden": true }),
|
|
10538
|
+
/* @__PURE__ */ jsx62(Stack17, { as: "span", gap: "0.5", px: "2.5", py: "1.5", minW: "0", flex: "1", justify: "center", children: p.renderCard(item, { range }) })
|
|
10498
10539
|
]
|
|
10499
10540
|
}
|
|
10500
10541
|
);
|
|
10501
|
-
return p.details ? /* @__PURE__ */
|
|
10542
|
+
return p.details ? /* @__PURE__ */ jsx62(Tooltip, { content: p.details(item), positioning: { placement: "bottom-start" }, openDelay: 250, children: card }) : card;
|
|
10502
10543
|
}
|
|
10503
10544
|
function Lanes(p) {
|
|
10504
10545
|
const { days, today, items, scale } = p;
|
|
@@ -10520,12 +10561,12 @@ function Lanes(p) {
|
|
|
10520
10561
|
const gridW = days.length * colW;
|
|
10521
10562
|
const placeholders = useLoading(p.loading) && items.length === 0;
|
|
10522
10563
|
const height = (placeholders ? 4 : Math.max(lanes, 1)) * LANE + 16;
|
|
10523
|
-
return /* @__PURE__ */
|
|
10524
|
-
/* @__PURE__ */
|
|
10564
|
+
return /* @__PURE__ */ jsx62(chakra36.div, { overflowX: "auto", ref: box, children: /* @__PURE__ */ jsxs48(chakra36.div, { position: "relative", minW: "full", w: `${gridW}px`, children: [
|
|
10565
|
+
/* @__PURE__ */ jsx62(chakra36.div, { display: "flex", borderBottomWidth: "1px", borderColor: "border", bg: "bg.subtle", position: "sticky", top: "0", zIndex: "1", children: days.map((d) => {
|
|
10525
10566
|
const isToday = d === today;
|
|
10526
10567
|
const weekStart = new Date(dayNumber(d) * 864e5).getUTCDay() === 0;
|
|
10527
|
-
return /* @__PURE__ */
|
|
10528
|
-
|
|
10568
|
+
return /* @__PURE__ */ jsxs48(
|
|
10569
|
+
chakra36.div,
|
|
10529
10570
|
{
|
|
10530
10571
|
w: `${colW}px`,
|
|
10531
10572
|
flexShrink: 0,
|
|
@@ -10541,9 +10582,9 @@ function Lanes(p) {
|
|
|
10541
10582
|
borderInlineStartWidth: weekStart && scale === "month" ? "1px" : "0",
|
|
10542
10583
|
borderColor: "border",
|
|
10543
10584
|
children: [
|
|
10544
|
-
/* @__PURE__ */
|
|
10545
|
-
/* @__PURE__ */
|
|
10546
|
-
|
|
10585
|
+
/* @__PURE__ */ jsx62(Text23, { as: "span", children: p.weekday(d) }),
|
|
10586
|
+
/* @__PURE__ */ jsx62(
|
|
10587
|
+
Text23,
|
|
10547
10588
|
{
|
|
10548
10589
|
as: "span",
|
|
10549
10590
|
fontVariantNumeric: "tabular-nums",
|
|
@@ -10561,9 +10602,9 @@ function Lanes(p) {
|
|
|
10561
10602
|
d
|
|
10562
10603
|
);
|
|
10563
10604
|
}) }),
|
|
10564
|
-
/* @__PURE__ */
|
|
10565
|
-
todayIdx >= 0 && /* @__PURE__ */
|
|
10566
|
-
|
|
10605
|
+
/* @__PURE__ */ jsx62(chakra36.div, { position: "absolute", insetInlineStart: "0", top: "0", bottom: "0", display: "flex", pointerEvents: "none", "aria-hidden": true, children: days.map((d) => /* @__PURE__ */ jsx62(chakra36.div, { w: `${colW}px`, flexShrink: 0, borderInlineEndWidth: "1px", borderStyle: "dashed", borderColor: "border.muted" }, d)) }),
|
|
10606
|
+
todayIdx >= 0 && /* @__PURE__ */ jsx62(
|
|
10607
|
+
chakra36.div,
|
|
10567
10608
|
{
|
|
10568
10609
|
position: "absolute",
|
|
10569
10610
|
top: "0",
|
|
@@ -10577,7 +10618,7 @@ function Lanes(p) {
|
|
|
10577
10618
|
zIndex: "1"
|
|
10578
10619
|
}
|
|
10579
10620
|
),
|
|
10580
|
-
placeholders ? /* @__PURE__ */
|
|
10621
|
+
placeholders ? /* @__PURE__ */ jsx62(chakra36.div, { position: "relative", h: `${height}px`, "aria-hidden": true, children: [0, 1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ jsx62(
|
|
10581
10622
|
Bone,
|
|
10582
10623
|
{
|
|
10583
10624
|
position: "absolute",
|
|
@@ -10588,10 +10629,10 @@ function Lanes(p) {
|
|
|
10588
10629
|
borderRadius: "l2"
|
|
10589
10630
|
},
|
|
10590
10631
|
i
|
|
10591
|
-
)) }) : cards.length === 0 && p.empty ? /* @__PURE__ */
|
|
10632
|
+
)) }) : cards.length === 0 && p.empty ? /* @__PURE__ */ jsx62(chakra36.div, { position: "relative", py: "6", children: p.empty }) : /* @__PURE__ */ jsx62(chakra36.div, { position: "relative", h: `${height}px`, role: "list", children: cards.map((c2) => {
|
|
10592
10633
|
const item = byId.get(c2.id);
|
|
10593
|
-
return /* @__PURE__ */
|
|
10594
|
-
|
|
10634
|
+
return /* @__PURE__ */ jsx62(
|
|
10635
|
+
chakra36.div,
|
|
10595
10636
|
{
|
|
10596
10637
|
role: "listitem",
|
|
10597
10638
|
position: "absolute",
|
|
@@ -10600,7 +10641,7 @@ function Lanes(p) {
|
|
|
10600
10641
|
w: `${c2.width}px`,
|
|
10601
10642
|
display: "flex",
|
|
10602
10643
|
zIndex: "2",
|
|
10603
|
-
children: /* @__PURE__ */
|
|
10644
|
+
children: /* @__PURE__ */ jsx62(Card2, { item, p, range: c2.range, cutStart: c2.cutStart, cutEnd: c2.cutEnd, style: { w: "full" } })
|
|
10604
10645
|
},
|
|
10605
10646
|
c2.id
|
|
10606
10647
|
);
|
|
@@ -10615,8 +10656,8 @@ function DayGrid(p) {
|
|
|
10615
10656
|
const x = dayNumber(day);
|
|
10616
10657
|
return s <= x && x <= d;
|
|
10617
10658
|
});
|
|
10618
|
-
if (due.length === 0 && p.empty) return /* @__PURE__ */
|
|
10619
|
-
return /* @__PURE__ */
|
|
10659
|
+
if (due.length === 0 && p.empty) return /* @__PURE__ */ jsx62(chakra36.div, { py: "6", children: p.empty });
|
|
10660
|
+
return /* @__PURE__ */ jsx62(Grid4, { role: "list", templateColumns: "repeat(auto-fill, minmax(16rem, 1fr))", gap: "2", p: "3", children: due.map((i) => /* @__PURE__ */ jsx62(chakra36.div, { role: "listitem", display: "flex", children: /* @__PURE__ */ jsx62(Card2, { item: i, p, range: Boolean(i.start && i.start < i.due), style: { w: "full" } }) }, i.id)) });
|
|
10620
10661
|
}
|
|
10621
10662
|
export {
|
|
10622
10663
|
ABP_UI_VERSION,
|
|
@@ -10697,6 +10738,7 @@ export {
|
|
|
10697
10738
|
SHOWN,
|
|
10698
10739
|
STEP_UP_REQUIRED,
|
|
10699
10740
|
STRONG_FACTOR_REQUIRED,
|
|
10741
|
+
SaveBar,
|
|
10700
10742
|
SearchInput,
|
|
10701
10743
|
SearchPicker,
|
|
10702
10744
|
SegmentedControl,
|