@abpjs/ui 0.2.0-next.34 → 0.2.0-next.36
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 +38 -0
- package/dist/guard.d.ts +5 -2
- package/dist/guard.js +387 -252
- package/dist/guard.js.map +1 -1
- package/dist/index.d.ts +89 -1
- package/dist/index.js +1153 -694
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1603,7 +1603,7 @@ function useTokenVar() {
|
|
|
1603
1603
|
}
|
|
1604
1604
|
|
|
1605
1605
|
// src/version.ts
|
|
1606
|
-
var ABP_UI_VERSION = true ? "0.2.0-next.
|
|
1606
|
+
var ABP_UI_VERSION = true ? "0.2.0-next.36" : "0.0.0-dev";
|
|
1607
1607
|
|
|
1608
1608
|
// src/provider/time-zone.tsx
|
|
1609
1609
|
import { createContext, useContext } from "react";
|
|
@@ -6335,9 +6335,9 @@ var MAX_HEIGHT = 12;
|
|
|
6335
6335
|
var overlaps = (a, b) => a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h;
|
|
6336
6336
|
function compactLayout(items, moved, direction = 0) {
|
|
6337
6337
|
const rank = (i) => i.id === moved ? i.y + (direction > 0 ? 0.5 : -0.5) : i.y;
|
|
6338
|
-
const
|
|
6338
|
+
const order2 = [...items].sort((a, b) => rank(a) - rank(b) || a.x - b.x);
|
|
6339
6339
|
const placed = [];
|
|
6340
|
-
for (const item of
|
|
6340
|
+
for (const item of order2) {
|
|
6341
6341
|
const next = { ...item };
|
|
6342
6342
|
for (let hits = placed.filter((p) => overlaps(p, next)); hits.length > 0; hits = placed.filter((p) => overlaps(p, next))) {
|
|
6343
6343
|
next.y = Math.max(...hits.map((p) => p.y + p.h));
|
|
@@ -6537,9 +6537,462 @@ function DashboardGrid({
|
|
|
6537
6537
|
] });
|
|
6538
6538
|
}
|
|
6539
6539
|
|
|
6540
|
+
// src/components/WidgetBoard.tsx
|
|
6541
|
+
import { useEffect as useEffect13, useLayoutEffect as useLayoutEffect3, useMemo as useMemo9, useRef as useRef14, useState as useState17 } from "react";
|
|
6542
|
+
import { Box as Box8, chakra as chakra21, HStack as HStack7, Text as Text12 } from "@chakra-ui/react";
|
|
6543
|
+
import { ArrowDown as ArrowDown2, ArrowUp as ArrowUp2, GripVertical as GripVertical3, Maximize2, Minimize2 } from "lucide-react";
|
|
6544
|
+
|
|
6545
|
+
// src/components/widget-board/layout.ts
|
|
6546
|
+
var TRACKS = 60;
|
|
6547
|
+
var GAP2 = 16;
|
|
6548
|
+
var NARROW = 720;
|
|
6549
|
+
var PRESETS = { half: 30, two: 40, full: 60 };
|
|
6550
|
+
var clamp = (n, lo, hi) => Math.min(hi, Math.max(lo, n));
|
|
6551
|
+
var trackWidth = (boardWidth) => (boardWidth + GAP2) / TRACKS;
|
|
6552
|
+
var spanPx = (w, boardWidth) => w * trackWidth(boardWidth) - GAP2;
|
|
6553
|
+
var tracksFor = (px, boardWidth) => clamp(Math.ceil((px + GAP2) / trackWidth(boardWidth)), 1, TRACKS);
|
|
6554
|
+
function fit(item) {
|
|
6555
|
+
const w = clamp(Math.round(item.w), 1, TRACKS);
|
|
6556
|
+
return { ...item, w, x: clamp(Math.round(item.x), 0, TRACKS - w), y: Math.max(0, item.y) };
|
|
6557
|
+
}
|
|
6558
|
+
var order = (a, b) => a.y - b.y || a.x - b.x || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
6559
|
+
var across = (a, b) => a.x < b.x + b.w && b.x < a.x + a.w;
|
|
6560
|
+
function pack(items, heights, options = {}) {
|
|
6561
|
+
const placed = [];
|
|
6562
|
+
for (const item of [...items].sort(order)) {
|
|
6563
|
+
const height = heights.get(item.id) ?? options.fallback ?? 160;
|
|
6564
|
+
const wide = options.narrow || options.expanded?.has(item.id);
|
|
6565
|
+
const x = wide ? 0 : clamp(item.x, 0, TRACKS - 1);
|
|
6566
|
+
const w = wide ? TRACKS : clamp(item.w, 1, TRACKS - x);
|
|
6567
|
+
const tops = [0, ...placed.filter((p) => across(p, { x, w })).map((p) => p.top + p.height + GAP2)].sort((a, b) => a - b);
|
|
6568
|
+
const top = tops.find((t) => !placed.some((p) => across(p, { x, w }) && t < p.top + p.height + GAP2 && p.top < t + height + GAP2)) ?? 0;
|
|
6569
|
+
placed.push({ id: item.id, x, w, top, height });
|
|
6570
|
+
}
|
|
6571
|
+
return placed;
|
|
6572
|
+
}
|
|
6573
|
+
var boardHeight = (placed) => placed.reduce((h, p) => Math.max(h, p.top + p.height), 0);
|
|
6574
|
+
function renumber(items) {
|
|
6575
|
+
const rank = new Map([...items].sort(order).map((i, n) => [i.id, n]));
|
|
6576
|
+
return items.map((i) => ({ ...i, y: rank.get(i.id) }));
|
|
6577
|
+
}
|
|
6578
|
+
function appendAt(items, w = TRACKS) {
|
|
6579
|
+
if (items.length === 0) return { x: 0, y: 0 };
|
|
6580
|
+
const last = [...items].sort(order)[items.length - 1];
|
|
6581
|
+
const beside = last.x + last.w;
|
|
6582
|
+
return { x: beside + Math.min(w, TRACKS) <= TRACKS ? beside : 0, y: last.y + 1 };
|
|
6583
|
+
}
|
|
6584
|
+
function snap(x, w, others, reach = 2) {
|
|
6585
|
+
let best = x;
|
|
6586
|
+
let distance = reach + 1;
|
|
6587
|
+
for (const o of others) {
|
|
6588
|
+
for (const edge of [o.x, o.x + o.w, o.x - w, o.x + o.w - w]) {
|
|
6589
|
+
const d = Math.abs(edge - x);
|
|
6590
|
+
if (edge >= 0 && edge + w <= TRACKS && d <= reach && d < distance) {
|
|
6591
|
+
best = edge;
|
|
6592
|
+
distance = d;
|
|
6593
|
+
}
|
|
6594
|
+
}
|
|
6595
|
+
}
|
|
6596
|
+
return clamp(best, 0, TRACKS - w);
|
|
6597
|
+
}
|
|
6598
|
+
function dropTarget(id, ghost, w, placed, items, boardWidth) {
|
|
6599
|
+
const others = placed.filter((p) => p.id !== id);
|
|
6600
|
+
const y = new Map(items.map((i) => [i.id, i.y]));
|
|
6601
|
+
const x = snap(Math.round(ghost.start / trackWidth(boardWidth)), w, others);
|
|
6602
|
+
const over2 = others.find((p) => across(p, { x, w }) && ghost.top >= p.top - GAP2 && ghost.top < p.top + p.height / 2);
|
|
6603
|
+
if (over2) return { x, y: y.get(over2.id) - 0.5 };
|
|
6604
|
+
const before = others.filter((p) => p.top <= ghost.top).map((p) => y.get(p.id));
|
|
6605
|
+
return { x, y: before.length ? Math.max(...before) + 0.5 : -0.5 };
|
|
6606
|
+
}
|
|
6607
|
+
function keyMove(item, move, placed, items) {
|
|
6608
|
+
const ys = items.map((i) => i.y);
|
|
6609
|
+
if (move.home) return { ...item, x: 0, y: Math.min(0, ...ys) - 1 };
|
|
6610
|
+
if (move.end) return { ...item, x: 0, y: Math.max(0, ...ys) + 1 };
|
|
6611
|
+
if (move.side) return { ...item, x: clamp(item.x + move.side, 0, TRACKS - item.w) };
|
|
6612
|
+
const me = placed.find((p) => p.id === item.id);
|
|
6613
|
+
if (!me || !move.vertical) return item;
|
|
6614
|
+
const y = new Map(items.map((i) => [i.id, i.y]));
|
|
6615
|
+
const column = placed.filter((p) => p.id !== item.id && across(p, me));
|
|
6616
|
+
if (move.vertical === "up") {
|
|
6617
|
+
const above = column.filter((p) => p.top < me.top).sort((a, b) => b.top - a.top)[0];
|
|
6618
|
+
return above ? { ...item, y: y.get(above.id) - 0.5 } : item;
|
|
6619
|
+
}
|
|
6620
|
+
const below = column.filter((p) => p.top > me.top).sort((a, b) => a.top - b.top)[0];
|
|
6621
|
+
return below ? { ...item, y: y.get(below.id) + 0.5 } : item;
|
|
6622
|
+
}
|
|
6623
|
+
function resize(item, w, min = 1) {
|
|
6624
|
+
const width = clamp(Math.round(w), Math.min(min, TRACKS), TRACKS);
|
|
6625
|
+
return { ...item, w: width, x: Math.min(item.x, TRACKS - width) };
|
|
6626
|
+
}
|
|
6627
|
+
function fromTwelve(items) {
|
|
6628
|
+
return renumber(items.map((i) => ({ ...i, x: i.x * 5, w: i.w * 5 })));
|
|
6629
|
+
}
|
|
6630
|
+
|
|
6631
|
+
// src/components/WidgetBoard.tsx
|
|
6632
|
+
import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6633
|
+
var strip = (i) => ({ id: i.id, x: i.x, y: i.y, w: i.w });
|
|
6634
|
+
function WidgetBoard({
|
|
6635
|
+
items,
|
|
6636
|
+
editable: editable2 = false,
|
|
6637
|
+
onLayoutChange,
|
|
6638
|
+
title,
|
|
6639
|
+
renderItem,
|
|
6640
|
+
menu,
|
|
6641
|
+
minWidth,
|
|
6642
|
+
labels,
|
|
6643
|
+
"aria-label": ariaLabel,
|
|
6644
|
+
loading: own
|
|
6645
|
+
}) {
|
|
6646
|
+
const { isRtl } = useAbpLocale();
|
|
6647
|
+
const waiting = useLoading(own) && items.length === 0;
|
|
6648
|
+
const board = useRef14(null);
|
|
6649
|
+
const [width, setWidth] = useState17(0);
|
|
6650
|
+
const [heights, setHeights] = useState17(/* @__PURE__ */ new Map());
|
|
6651
|
+
const [expanded, setExpanded] = useState17(/* @__PURE__ */ new Set());
|
|
6652
|
+
const [draft, setDraftState] = useState17(null);
|
|
6653
|
+
const [gesture, setGestureState] = useState17(null);
|
|
6654
|
+
const live = useRef14({ gesture: null, draft: null });
|
|
6655
|
+
const setGesture = (g) => {
|
|
6656
|
+
live.current.gesture = g;
|
|
6657
|
+
setGestureState(g);
|
|
6658
|
+
};
|
|
6659
|
+
const setDraft = (d) => {
|
|
6660
|
+
live.current.draft = d;
|
|
6661
|
+
setDraftState(d);
|
|
6662
|
+
};
|
|
6663
|
+
const [said, setSaid] = useState17("");
|
|
6664
|
+
const observer = useRef14(null);
|
|
6665
|
+
const bodies = useRef14(/* @__PURE__ */ new Map());
|
|
6666
|
+
const help = `${ariaLabel.replace(/\W+/g, "-")}-board-help`;
|
|
6667
|
+
const narrow = width > 0 && width < NARROW;
|
|
6668
|
+
const layout = useMemo9(() => (draft ?? items.map(strip)).map(fit), [draft, items]);
|
|
6669
|
+
const placed = useMemo9(() => pack(layout, heights, { narrow, expanded }), [layout, heights, narrow, expanded]);
|
|
6670
|
+
const byId = new Map(items.map((i) => [i.id, i]));
|
|
6671
|
+
const at = new Map(placed.map((p) => [p.id, p]));
|
|
6672
|
+
const can = editable2 && !narrow;
|
|
6673
|
+
useLayoutEffect3(() => {
|
|
6674
|
+
const el = board.current;
|
|
6675
|
+
if (!el) return;
|
|
6676
|
+
setWidth(el.getBoundingClientRect().width);
|
|
6677
|
+
const ro = new ResizeObserver(([entry]) => setWidth(entry.contentRect.width));
|
|
6678
|
+
ro.observe(el);
|
|
6679
|
+
return () => ro.disconnect();
|
|
6680
|
+
}, []);
|
|
6681
|
+
useEffect13(() => {
|
|
6682
|
+
observer.current = new ResizeObserver((entries) => {
|
|
6683
|
+
setHeights((old) => {
|
|
6684
|
+
let next = null;
|
|
6685
|
+
for (const entry of entries) {
|
|
6686
|
+
const id = entry.target.dataset.widget;
|
|
6687
|
+
const h = Math.ceil(entry.target.offsetHeight);
|
|
6688
|
+
if (old.get(id) !== h) (next ??= new Map(old)).set(id, h);
|
|
6689
|
+
}
|
|
6690
|
+
return next ?? old;
|
|
6691
|
+
});
|
|
6692
|
+
});
|
|
6693
|
+
for (const el of bodies.current.values()) observer.current.observe(el);
|
|
6694
|
+
return () => observer.current?.disconnect();
|
|
6695
|
+
}, []);
|
|
6696
|
+
const refs = useRef14(/* @__PURE__ */ new Map());
|
|
6697
|
+
const measure = (id) => {
|
|
6698
|
+
let ref = refs.current.get(id);
|
|
6699
|
+
if (!ref) {
|
|
6700
|
+
ref = (el) => {
|
|
6701
|
+
const old = bodies.current.get(id);
|
|
6702
|
+
if (old === el) return;
|
|
6703
|
+
if (old) observer.current?.unobserve(old);
|
|
6704
|
+
if (el) {
|
|
6705
|
+
bodies.current.set(id, el);
|
|
6706
|
+
observer.current?.observe(el);
|
|
6707
|
+
} else bodies.current.delete(id);
|
|
6708
|
+
};
|
|
6709
|
+
refs.current.set(id, ref);
|
|
6710
|
+
}
|
|
6711
|
+
return ref;
|
|
6712
|
+
};
|
|
6713
|
+
function commit(next, announce) {
|
|
6714
|
+
const numbered = renumber(next.map(fit));
|
|
6715
|
+
const merged = items.map((i) => ({ ...i, ...numbered.find((n) => n.id === i.id) }));
|
|
6716
|
+
setDraft(null);
|
|
6717
|
+
onLayoutChange?.(merged);
|
|
6718
|
+
if (announce) setSaid(announce);
|
|
6719
|
+
}
|
|
6720
|
+
function announceMove(id, next) {
|
|
6721
|
+
const numbered = renumber(next.map(fit));
|
|
6722
|
+
const me = numbered.find((i) => i.id === id);
|
|
6723
|
+
return labels.moved(title(byId.get(id)), me.y + 1, numbered.length, me.x + 1);
|
|
6724
|
+
}
|
|
6725
|
+
const minTracks = (item) => width ? tracksFor(minWidth?.(item) ?? 200, width) : 1;
|
|
6726
|
+
function grab(e, item) {
|
|
6727
|
+
if (!can || e.button !== 0) return;
|
|
6728
|
+
e.preventDefault();
|
|
6729
|
+
e.currentTarget.focus();
|
|
6730
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
6731
|
+
const p = at.get(item.id);
|
|
6732
|
+
const start = p.x * trackWidth(width);
|
|
6733
|
+
setGesture({ mode: "move", id: item.id, pointerX: e.clientX, pointerY: e.clientY, startLeft: start, startTop: p.top, dx: 0, dy: 0 });
|
|
6734
|
+
}
|
|
6735
|
+
function resizeStart(e, item) {
|
|
6736
|
+
if (!can || e.button !== 0) return;
|
|
6737
|
+
e.preventDefault();
|
|
6738
|
+
e.currentTarget.focus();
|
|
6739
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
6740
|
+
setGesture({ mode: "resize", id: item.id, pointerX: e.clientX, origin: layout.find((l) => l.id === item.id) });
|
|
6741
|
+
}
|
|
6742
|
+
function pointerMove(e) {
|
|
6743
|
+
const g = live.current.gesture;
|
|
6744
|
+
if (!g) return;
|
|
6745
|
+
const layout2 = (live.current.draft ?? items.map(strip)).map(fit);
|
|
6746
|
+
const dx = (e.clientX - g.pointerX) * (isRtl ? -1 : 1);
|
|
6747
|
+
if (g.mode === "resize") {
|
|
6748
|
+
const item = byId.get(g.id);
|
|
6749
|
+
const w = g.origin.w + Math.round(dx / trackWidth(width));
|
|
6750
|
+
setDraft(layout2.map((l) => l.id === g.id ? resize(g.origin, w, minTracks(item)) : l));
|
|
6751
|
+
return;
|
|
6752
|
+
}
|
|
6753
|
+
const dy = e.clientY - g.pointerY;
|
|
6754
|
+
setGesture({ ...g, dx, dy });
|
|
6755
|
+
const me = layout2.find((l) => l.id === g.id);
|
|
6756
|
+
const target = dropTarget(g.id, { start: g.startLeft + dx, top: g.startTop + dy }, me.w, pack(layout2.filter((l) => l.id !== g.id), heights, { expanded }), layout2, width);
|
|
6757
|
+
setDraft(layout2.map((l) => l.id === g.id ? { ...l, ...target } : l));
|
|
6758
|
+
const edge = 48;
|
|
6759
|
+
if (e.clientY < edge) window.scrollBy(0, -12);
|
|
6760
|
+
else if (e.clientY > window.innerHeight - edge) window.scrollBy(0, 12);
|
|
6761
|
+
}
|
|
6762
|
+
function pointerUp() {
|
|
6763
|
+
const g = live.current.gesture;
|
|
6764
|
+
const draft2 = live.current.draft;
|
|
6765
|
+
setGesture(null);
|
|
6766
|
+
if (!g || !draft2) return setDraft(null);
|
|
6767
|
+
const item = byId.get(g.id);
|
|
6768
|
+
if (g.mode === "resize") commit(draft2, labels.resized(title(item), draft2.find((d) => d.id === g.id).w));
|
|
6769
|
+
else commit(draft2, announceMove(g.id, draft2));
|
|
6770
|
+
}
|
|
6771
|
+
function cancel() {
|
|
6772
|
+
setGesture(null);
|
|
6773
|
+
setDraft(null);
|
|
6774
|
+
}
|
|
6775
|
+
useEffect13(() => {
|
|
6776
|
+
if (!gesture) return;
|
|
6777
|
+
const esc = (e) => e.key === "Escape" && cancel();
|
|
6778
|
+
window.addEventListener("keydown", esc);
|
|
6779
|
+
return () => window.removeEventListener("keydown", esc);
|
|
6780
|
+
}, [gesture]);
|
|
6781
|
+
const toEnd = (key) => key === "ArrowRight" ? isRtl ? -1 : 1 : key === "ArrowLeft" ? isRtl ? 1 : -1 : 0;
|
|
6782
|
+
function moveBy(item, move) {
|
|
6783
|
+
const me = layout.find((l) => l.id === item.id);
|
|
6784
|
+
const next = layout.map((l) => l.id === item.id ? keyMove(me, move, placed, layout) : l);
|
|
6785
|
+
if (JSON.stringify(next) === JSON.stringify(layout)) return;
|
|
6786
|
+
commit(next, announceMove(item.id, next));
|
|
6787
|
+
}
|
|
6788
|
+
function gripKey(e, item) {
|
|
6789
|
+
const side = toEnd(e.key);
|
|
6790
|
+
const move = side ? { side: side * (e.shiftKey ? 1 : 5) } : e.key === "ArrowUp" ? { vertical: "up" } : e.key === "ArrowDown" ? { vertical: "down" } : e.key === "Home" ? { home: true } : e.key === "End" ? { end: true } : null;
|
|
6791
|
+
if (!move) return;
|
|
6792
|
+
e.preventDefault();
|
|
6793
|
+
moveBy(item, move);
|
|
6794
|
+
}
|
|
6795
|
+
function setWidthOf(item, w) {
|
|
6796
|
+
const me = layout.find((l) => l.id === item.id);
|
|
6797
|
+
const next = resize(me, w, minTracks(item));
|
|
6798
|
+
if (next.w === me.w && next.x === me.x) return;
|
|
6799
|
+
commit(layout.map((l) => l.id === item.id ? next : l), labels.resized(title(item), next.w));
|
|
6800
|
+
}
|
|
6801
|
+
function handleKey(e, item) {
|
|
6802
|
+
const me = layout.find((l) => l.id === item.id);
|
|
6803
|
+
const side = toEnd(e.key);
|
|
6804
|
+
const w = side ? me.w + side * (e.shiftKey ? 5 : 1) : e.key === "Home" ? minTracks(item) : e.key === "End" ? TRACKS : null;
|
|
6805
|
+
if (w == null) return;
|
|
6806
|
+
e.preventDefault();
|
|
6807
|
+
if (e.key === "End") commit(layout.map((l) => l.id === item.id ? { ...l, x: 0, w: TRACKS } : l), labels.resized(title(item), TRACKS));
|
|
6808
|
+
else setWidthOf(item, w);
|
|
6809
|
+
}
|
|
6810
|
+
function toggle(id) {
|
|
6811
|
+
setExpanded((old) => {
|
|
6812
|
+
const next = new Set(old);
|
|
6813
|
+
if (!next.delete(id)) next.add(id);
|
|
6814
|
+
return next;
|
|
6815
|
+
});
|
|
6816
|
+
}
|
|
6817
|
+
const unit = trackWidth(width);
|
|
6818
|
+
const shown = (p) => ({ start: p.x * unit, width: spanPx(p.w, width) });
|
|
6819
|
+
const height = waiting ? 320 : boardHeight(placed);
|
|
6820
|
+
const moving = gesture?.mode === "move" ? gesture : null;
|
|
6821
|
+
const slot = moving ? at.get(moving.id) : null;
|
|
6822
|
+
const reveal = { opacity: 0 };
|
|
6823
|
+
return /* @__PURE__ */ jsxs29(Box8, { children: [
|
|
6824
|
+
can && /* @__PURE__ */ jsx38(chakra21.p, { id: help, srOnly: true, children: labels.instructions }),
|
|
6825
|
+
/* @__PURE__ */ jsx38(chakra21.p, { srOnly: true, role: "status", "aria-live": "polite", children: said }),
|
|
6826
|
+
/* @__PURE__ */ jsxs29(
|
|
6827
|
+
Box8,
|
|
6828
|
+
{
|
|
6829
|
+
ref: board,
|
|
6830
|
+
role: "list",
|
|
6831
|
+
"aria-label": ariaLabel,
|
|
6832
|
+
position: "relative",
|
|
6833
|
+
h: `${height}px`,
|
|
6834
|
+
onPointerMove: pointerMove,
|
|
6835
|
+
onPointerUp: pointerUp,
|
|
6836
|
+
onPointerCancel: cancel,
|
|
6837
|
+
css: { "@media (prefers-reduced-motion: reduce)": { "& [data-widget-slot]": { transition: "none !important" } } },
|
|
6838
|
+
children: [
|
|
6839
|
+
waiting && [[0, 30, 0], [30, 30, 0], [0, 20, 1], [20, 20, 1], [40, 20, 1]].map(([x, w, row], i) => /* @__PURE__ */ jsx38(
|
|
6840
|
+
Box8,
|
|
6841
|
+
{
|
|
6842
|
+
"aria-hidden": true,
|
|
6843
|
+
position: "absolute",
|
|
6844
|
+
top: `${row * 168}px`,
|
|
6845
|
+
insetInlineStart: `${x * unit}px`,
|
|
6846
|
+
w: `${spanPx(w, width)}px`,
|
|
6847
|
+
h: "152px",
|
|
6848
|
+
borderRadius: "l3",
|
|
6849
|
+
css: shineCss
|
|
6850
|
+
},
|
|
6851
|
+
i
|
|
6852
|
+
)),
|
|
6853
|
+
slot && /* @__PURE__ */ jsx38(
|
|
6854
|
+
Box8,
|
|
6855
|
+
{
|
|
6856
|
+
"aria-hidden": true,
|
|
6857
|
+
position: "absolute",
|
|
6858
|
+
top: `${slot.top}px`,
|
|
6859
|
+
insetInlineStart: `${shown(slot).start}px`,
|
|
6860
|
+
w: `${shown(slot).width}px`,
|
|
6861
|
+
h: `${slot.height}px`,
|
|
6862
|
+
borderWidth: "2px",
|
|
6863
|
+
borderStyle: "dashed",
|
|
6864
|
+
borderColor: "colorPalette.solid",
|
|
6865
|
+
colorPalette: "accent",
|
|
6866
|
+
borderRadius: "l3",
|
|
6867
|
+
bg: "colorPalette.subtle",
|
|
6868
|
+
opacity: 0.6
|
|
6869
|
+
}
|
|
6870
|
+
),
|
|
6871
|
+
placed.map((p) => {
|
|
6872
|
+
const item = byId.get(p.id);
|
|
6873
|
+
if (!item) return null;
|
|
6874
|
+
const isOpen = expanded.has(p.id);
|
|
6875
|
+
const dragging = moving?.id === p.id;
|
|
6876
|
+
const sizing = gesture?.mode === "resize" && gesture.id === p.id;
|
|
6877
|
+
const name = title(item);
|
|
6878
|
+
const start = dragging ? moving.startLeft + moving.dx : shown(p).start;
|
|
6879
|
+
const top = dragging ? moving.startTop + moving.dy : p.top;
|
|
6880
|
+
const presets = can ? [
|
|
6881
|
+
{ separator: true },
|
|
6882
|
+
{ id: "half", label: labels.half, onSelect: () => setWidthOf(item, PRESETS.half) },
|
|
6883
|
+
{ id: "two", label: labels.twoThirds, onSelect: () => setWidthOf(item, PRESETS.two) },
|
|
6884
|
+
{ id: "full", label: labels.full, onSelect: () => setWidthOf(item, PRESETS.full) },
|
|
6885
|
+
{ separator: true },
|
|
6886
|
+
{ id: "up", label: labels.moveUp, icon: /* @__PURE__ */ jsx38(ArrowUp2, {}), onSelect: () => moveBy(item, { vertical: "up" }) },
|
|
6887
|
+
{ id: "down", label: labels.moveDown, icon: /* @__PURE__ */ jsx38(ArrowDown2, {}), onSelect: () => moveBy(item, { vertical: "down" }) }
|
|
6888
|
+
] : [];
|
|
6889
|
+
const own2 = menu?.(item) ?? [];
|
|
6890
|
+
const red = own2.filter((e) => "danger" in e && e.danger);
|
|
6891
|
+
const entries = [...own2.filter((e) => !red.includes(e)), ...presets, ...red.length ? [{ separator: true }, ...red] : []].filter((e, i, all) => !("separator" in e) || i > 0 && i < all.length - 1 && !("separator" in all[i - 1]));
|
|
6892
|
+
return /* @__PURE__ */ jsx38(
|
|
6893
|
+
Box8,
|
|
6894
|
+
{
|
|
6895
|
+
role: "listitem",
|
|
6896
|
+
"data-widget-slot": "",
|
|
6897
|
+
position: "absolute",
|
|
6898
|
+
top: `${top}px`,
|
|
6899
|
+
insetInlineStart: `${start}px`,
|
|
6900
|
+
w: `${dragging || sizing ? spanPx(draftWidth(p, draft), width) : shown(p).width}px`,
|
|
6901
|
+
zIndex: dragging ? 3 : sizing ? 2 : void 0,
|
|
6902
|
+
visibility: width ? void 0 : "hidden",
|
|
6903
|
+
transition: dragging || sizing ? void 0 : "top 200ms ease, inset-inline-start 200ms ease, width 150ms ease",
|
|
6904
|
+
children: /* @__PURE__ */ jsxs29(
|
|
6905
|
+
chakra21.section,
|
|
6906
|
+
{
|
|
6907
|
+
"data-widget": p.id,
|
|
6908
|
+
ref: measure(p.id),
|
|
6909
|
+
"aria-label": name,
|
|
6910
|
+
position: "relative",
|
|
6911
|
+
display: "flex",
|
|
6912
|
+
flexDirection: "column",
|
|
6913
|
+
bg: "bg.panel",
|
|
6914
|
+
borderWidth: "1px",
|
|
6915
|
+
borderColor: "border",
|
|
6916
|
+
borderRadius: "l3",
|
|
6917
|
+
minW: "0",
|
|
6918
|
+
boxShadow: dragging ? "lg" : void 0,
|
|
6919
|
+
cursor: dragging ? "grabbing" : void 0,
|
|
6920
|
+
css: {
|
|
6921
|
+
"& [data-reveal]": dragging || sizing ? void 0 : reveal,
|
|
6922
|
+
"&:hover [data-reveal], &:focus-within [data-reveal]": { opacity: 1 },
|
|
6923
|
+
"@media (hover: none)": { "& [data-reveal]": { opacity: 1 } }
|
|
6924
|
+
},
|
|
6925
|
+
children: [
|
|
6926
|
+
/* @__PURE__ */ jsxs29(HStack7, { gap: "1", ps: "4", pe: "2", pt: "2", minH: "11", children: [
|
|
6927
|
+
/* @__PURE__ */ jsx38(Text12, { as: "h3", flex: "1", minW: "0", truncate: true, fontWeight: "semibold", textStyle: "body.sm", children: name }),
|
|
6928
|
+
/* @__PURE__ */ jsxs29(HStack7, { gap: "0.5", flexShrink: 0, children: [
|
|
6929
|
+
can && /* @__PURE__ */ jsx38(chakra21.span, { "data-reveal": "", display: "inline-flex", children: /* @__PURE__ */ jsx38(
|
|
6930
|
+
IconButton,
|
|
6931
|
+
{
|
|
6932
|
+
size: "xs",
|
|
6933
|
+
variant: "ghost",
|
|
6934
|
+
color: "fg.muted",
|
|
6935
|
+
"aria-label": labels.move(name),
|
|
6936
|
+
"aria-describedby": help,
|
|
6937
|
+
cursor: dragging ? "grabbing" : "grab",
|
|
6938
|
+
css: { touchAction: "none" },
|
|
6939
|
+
onPointerDown: (e) => grab(e, item),
|
|
6940
|
+
onKeyDown: (e) => gripKey(e, item),
|
|
6941
|
+
children: /* @__PURE__ */ jsx38(GripVertical3, {})
|
|
6942
|
+
}
|
|
6943
|
+
) }),
|
|
6944
|
+
!narrow && /* @__PURE__ */ jsx38(chakra21.span, { "data-reveal": "", display: "inline-flex", children: /* @__PURE__ */ jsx38(Tooltip, { content: isOpen ? labels.restore : labels.expand, children: /* @__PURE__ */ jsx38(IconButton, { size: "xs", variant: "ghost", color: "fg.muted", "aria-label": isOpen ? labels.restore : labels.expand, "aria-pressed": isOpen, onClick: () => toggle(p.id), children: isOpen ? /* @__PURE__ */ jsx38(Minimize2, {}) : /* @__PURE__ */ jsx38(Maximize2, {}) }) }) }),
|
|
6945
|
+
entries.length > 0 && /* @__PURE__ */ jsx38(RowMenu, { label: labels.actions(name), items: entries, size: "xs" })
|
|
6946
|
+
] })
|
|
6947
|
+
] }),
|
|
6948
|
+
/* @__PURE__ */ jsx38(Box8, { px: "4", pb: "4", pt: "1", minW: "0", overflowX: "auto", children: renderItem(item, { expanded: isOpen }) }),
|
|
6949
|
+
can && !isOpen && /* @__PURE__ */ jsx38(
|
|
6950
|
+
chakra21.span,
|
|
6951
|
+
{
|
|
6952
|
+
role: "slider",
|
|
6953
|
+
tabIndex: 0,
|
|
6954
|
+
"aria-label": labels.resize(name),
|
|
6955
|
+
"aria-describedby": help,
|
|
6956
|
+
"aria-orientation": "horizontal",
|
|
6957
|
+
"aria-valuemin": minTracks(item),
|
|
6958
|
+
"aria-valuemax": TRACKS,
|
|
6959
|
+
"aria-valuenow": draftWidth(p, draft),
|
|
6960
|
+
position: "absolute",
|
|
6961
|
+
top: "0",
|
|
6962
|
+
bottom: "0",
|
|
6963
|
+
insetInlineEnd: "-1.5",
|
|
6964
|
+
w: "3",
|
|
6965
|
+
cursor: "ew-resize",
|
|
6966
|
+
css: { touchAction: "none" },
|
|
6967
|
+
display: "flex",
|
|
6968
|
+
alignItems: "center",
|
|
6969
|
+
justifyContent: "center",
|
|
6970
|
+
"data-reveal": "",
|
|
6971
|
+
_focusVisible: { outline: "2px solid", outlineColor: "colorPalette.focusRing", outlineOffset: "1px", borderRadius: "full" },
|
|
6972
|
+
onPointerDown: (e) => resizeStart(e, item),
|
|
6973
|
+
onKeyDown: (e) => handleKey(e, item),
|
|
6974
|
+
children: /* @__PURE__ */ jsx38(chakra21.span, { w: "1", h: "8", borderRadius: "full", bg: "border.emphasized" })
|
|
6975
|
+
}
|
|
6976
|
+
)
|
|
6977
|
+
]
|
|
6978
|
+
}
|
|
6979
|
+
)
|
|
6980
|
+
},
|
|
6981
|
+
p.id
|
|
6982
|
+
);
|
|
6983
|
+
})
|
|
6984
|
+
]
|
|
6985
|
+
}
|
|
6986
|
+
)
|
|
6987
|
+
] });
|
|
6988
|
+
}
|
|
6989
|
+
function draftWidth(p, draft) {
|
|
6990
|
+
return draft?.find((d) => d.id === p.id)?.w ?? p.w;
|
|
6991
|
+
}
|
|
6992
|
+
|
|
6540
6993
|
// src/components/CategoryProgress.tsx
|
|
6541
|
-
import { Box as
|
|
6542
|
-
import { jsx as
|
|
6994
|
+
import { Box as Box9, HStack as HStack8 } from "@chakra-ui/react";
|
|
6995
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
6543
6996
|
function CategoryProgress({ todo, inProgress, done, size = "md", loading: own, "aria-label": ariaLabel }) {
|
|
6544
6997
|
const loading = useLoading(own);
|
|
6545
6998
|
const total = loading ? 0 : todo + inProgress + done;
|
|
@@ -6548,15 +7001,15 @@ function CategoryProgress({ todo, inProgress, done, size = "md", loading: own, "
|
|
|
6548
7001
|
{ key: "inProgress", value: inProgress },
|
|
6549
7002
|
{ key: "todo", value: todo }
|
|
6550
7003
|
];
|
|
6551
|
-
return /* @__PURE__ */
|
|
7004
|
+
return /* @__PURE__ */ jsx39(HStack8, { role: "img", "aria-label": ariaLabel, gap: "0", h: size === "sm" ? "1.5" : "2", w: "full", minW: "16", rounded: "full", overflow: "hidden", bg: "bg.muted", css: loading ? shineCss : void 0, children: total > 0 && parts.filter((p) => p.value > 0).map((p) => /* @__PURE__ */ jsx39(Box9, { h: "full", flexBasis: `${p.value / total * 100}%`, flexShrink: 0, bg: `statusCategory.${p.key}.solid` }, p.key)) });
|
|
6552
7005
|
}
|
|
6553
7006
|
|
|
6554
7007
|
// src/components/AttentionChip.tsx
|
|
6555
|
-
import { chakra as
|
|
7008
|
+
import { chakra as chakra23 } from "@chakra-ui/react";
|
|
6556
7009
|
|
|
6557
7010
|
// src/components/CountBadge.tsx
|
|
6558
|
-
import { chakra as
|
|
6559
|
-
import { jsx as
|
|
7011
|
+
import { chakra as chakra22 } from "@chakra-ui/react";
|
|
7012
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
6560
7013
|
var TONES2 = {
|
|
6561
7014
|
neutral: { bg: "bg.emphasized", color: "fg" },
|
|
6562
7015
|
accent: { bg: "accent.subtle", color: "accent.fg" },
|
|
@@ -6566,8 +7019,8 @@ var TONES2 = {
|
|
|
6566
7019
|
function CountBadge({ value, tone = "neutral", size = "sm", loading: own, ...rest }) {
|
|
6567
7020
|
const fmt = useFormatters();
|
|
6568
7021
|
const loading = useLoading(own);
|
|
6569
|
-
return /* @__PURE__ */
|
|
6570
|
-
|
|
7022
|
+
return /* @__PURE__ */ jsx40(
|
|
7023
|
+
chakra22.span,
|
|
6571
7024
|
{
|
|
6572
7025
|
display: "inline-flex",
|
|
6573
7026
|
alignItems: "center",
|
|
@@ -6591,11 +7044,11 @@ function CountBadge({ value, tone = "neutral", size = "sm", loading: own, ...res
|
|
|
6591
7044
|
}
|
|
6592
7045
|
|
|
6593
7046
|
// src/components/AttentionChip.tsx
|
|
6594
|
-
import { jsx as
|
|
7047
|
+
import { jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6595
7048
|
function AttentionChip({ count, children, tone = "neutral", pressed, onClick, disabled, loading: own }) {
|
|
6596
7049
|
const loading = useLoading(own);
|
|
6597
|
-
return /* @__PURE__ */
|
|
6598
|
-
|
|
7050
|
+
return /* @__PURE__ */ jsxs30(
|
|
7051
|
+
chakra23.button,
|
|
6599
7052
|
{
|
|
6600
7053
|
type: "button",
|
|
6601
7054
|
display: "inline-flex",
|
|
@@ -6620,7 +7073,7 @@ function AttentionChip({ count, children, tone = "neutral", pressed, onClick, di
|
|
|
6620
7073
|
disabled: disabled || loading,
|
|
6621
7074
|
onClick,
|
|
6622
7075
|
children: [
|
|
6623
|
-
/* @__PURE__ */
|
|
7076
|
+
/* @__PURE__ */ jsx41(CountBadge, { loading, value: count, tone: count === 0 ? "neutral" : tone === "neutral" ? "neutral" : tone }),
|
|
6624
7077
|
children
|
|
6625
7078
|
]
|
|
6626
7079
|
}
|
|
@@ -6628,13 +7081,13 @@ function AttentionChip({ count, children, tone = "neutral", pressed, onClick, di
|
|
|
6628
7081
|
}
|
|
6629
7082
|
|
|
6630
7083
|
// src/components/IconTile.tsx
|
|
6631
|
-
import { chakra as
|
|
6632
|
-
import { jsx as
|
|
7084
|
+
import { chakra as chakra24 } from "@chakra-ui/react";
|
|
7085
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
6633
7086
|
var SIZES = { sm: { box: "6", icon: "3.5" }, md: { box: "8", icon: "4" }, lg: { box: "10", icon: "5" } };
|
|
6634
7087
|
function IconTile({ children, size = "md", active = false, palette: palette3 }) {
|
|
6635
7088
|
const s = SIZES[size];
|
|
6636
|
-
return /* @__PURE__ */
|
|
6637
|
-
|
|
7089
|
+
return /* @__PURE__ */ jsx42(
|
|
7090
|
+
chakra24.span,
|
|
6638
7091
|
{
|
|
6639
7092
|
display: "inline-flex",
|
|
6640
7093
|
alignItems: "center",
|
|
@@ -6656,17 +7109,17 @@ function IconTile({ children, size = "md", active = false, palette: palette3 })
|
|
|
6656
7109
|
}
|
|
6657
7110
|
|
|
6658
7111
|
// src/components/PersonChip.tsx
|
|
6659
|
-
import { Avatar as Avatar2, chakra as
|
|
6660
|
-
import { jsx as
|
|
7112
|
+
import { Avatar as Avatar2, chakra as chakra25 } from "@chakra-ui/react";
|
|
7113
|
+
import { jsx as jsx43, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
6661
7114
|
var SIZES2 = { xs: "5", sm: "6", md: "8" };
|
|
6662
7115
|
function PersonChip({ id, name, picture, compact = false, size = "sm", loading: own }) {
|
|
6663
7116
|
if (useLoading(own)) {
|
|
6664
|
-
return /* @__PURE__ */
|
|
6665
|
-
/* @__PURE__ */
|
|
6666
|
-
!compact && /* @__PURE__ */
|
|
7117
|
+
return /* @__PURE__ */ jsxs31(chakra25.span, { display: "inline-flex", alignItems: "center", gap: "2", "aria-hidden": true, children: [
|
|
7118
|
+
/* @__PURE__ */ jsx43(Bone, { circle: true, height: SIZES2[size] }),
|
|
7119
|
+
!compact && /* @__PURE__ */ jsx43(TextBone, { width: 12 })
|
|
6667
7120
|
] });
|
|
6668
7121
|
}
|
|
6669
|
-
const avatar = /* @__PURE__ */
|
|
7122
|
+
const avatar = /* @__PURE__ */ jsxs31(
|
|
6670
7123
|
Avatar2.Root,
|
|
6671
7124
|
{
|
|
6672
7125
|
colorPalette: avatarPalette(id),
|
|
@@ -6679,20 +7132,20 @@ function PersonChip({ id, name, picture, compact = false, size = "sm", loading:
|
|
|
6679
7132
|
flexShrink: 0,
|
|
6680
7133
|
...compact ? { role: "img", "aria-label": name, title: name } : { "aria-hidden": true },
|
|
6681
7134
|
children: [
|
|
6682
|
-
/* @__PURE__ */
|
|
6683
|
-
picture && /* @__PURE__ */
|
|
7135
|
+
/* @__PURE__ */ jsx43(Avatar2.Fallback, { name }),
|
|
7136
|
+
picture && /* @__PURE__ */ jsx43(Avatar2.Image, { src: picture, alt: "" })
|
|
6684
7137
|
]
|
|
6685
7138
|
}
|
|
6686
7139
|
);
|
|
6687
7140
|
if (compact) return avatar;
|
|
6688
|
-
return /* @__PURE__ */
|
|
7141
|
+
return /* @__PURE__ */ jsxs31(chakra25.span, { display: "inline-flex", alignItems: "center", gap: "2", minW: "0", maxW: "full", children: [
|
|
6689
7142
|
avatar,
|
|
6690
|
-
/* @__PURE__ */
|
|
7143
|
+
/* @__PURE__ */ jsx43(chakra25.span, { truncate: true, children: name })
|
|
6691
7144
|
] });
|
|
6692
7145
|
}
|
|
6693
7146
|
|
|
6694
7147
|
// src/components/PriorityMark.tsx
|
|
6695
|
-
import { chakra as
|
|
7148
|
+
import { chakra as chakra26 } from "@chakra-ui/react";
|
|
6696
7149
|
|
|
6697
7150
|
// src/components/priority-level.ts
|
|
6698
7151
|
function priorityLevel(rank, of) {
|
|
@@ -6704,12 +7157,12 @@ function priorityLevel(rank, of) {
|
|
|
6704
7157
|
}
|
|
6705
7158
|
|
|
6706
7159
|
// src/components/PriorityMark.tsx
|
|
6707
|
-
import { jsx as
|
|
7160
|
+
import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6708
7161
|
function PriorityMark({ rank, of, children, title, loading }) {
|
|
6709
|
-
if (useLoading(loading)) return /* @__PURE__ */
|
|
7162
|
+
if (useLoading(loading)) return /* @__PURE__ */ jsx44(TextBone, { width: 7 });
|
|
6710
7163
|
const { bars, palette: palette3 } = priorityLevel(rank, of);
|
|
6711
|
-
return /* @__PURE__ */
|
|
6712
|
-
|
|
7164
|
+
return /* @__PURE__ */ jsxs32(
|
|
7165
|
+
chakra26.span,
|
|
6713
7166
|
{
|
|
6714
7167
|
display: "inline-flex",
|
|
6715
7168
|
alignItems: "center",
|
|
@@ -6720,8 +7173,8 @@ function PriorityMark({ rank, of, children, title, loading }) {
|
|
|
6720
7173
|
"aria-label": children == null ? title : void 0,
|
|
6721
7174
|
whiteSpace: "nowrap",
|
|
6722
7175
|
children: [
|
|
6723
|
-
/* @__PURE__ */
|
|
6724
|
-
|
|
7176
|
+
/* @__PURE__ */ jsx44(chakra26.svg, { viewBox: "0 0 12 12", w: "3", h: "3", flexShrink: 0, "aria-hidden": "true", children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx44(
|
|
7177
|
+
chakra26.rect,
|
|
6725
7178
|
{
|
|
6726
7179
|
x: i * 3 + 0.5,
|
|
6727
7180
|
y: 9 - i * 3,
|
|
@@ -6732,7 +7185,7 @@ function PriorityMark({ rank, of, children, title, loading }) {
|
|
|
6732
7185
|
},
|
|
6733
7186
|
i
|
|
6734
7187
|
)) }),
|
|
6735
|
-
children != null && /* @__PURE__ */
|
|
7188
|
+
children != null && /* @__PURE__ */ jsx44(chakra26.span, { color: palette3 === "blue" || palette3 === "gray" ? "fg.muted" : "colorPalette.fg", fontWeight: "medium", children })
|
|
6736
7189
|
]
|
|
6737
7190
|
}
|
|
6738
7191
|
);
|
|
@@ -6837,9 +7290,9 @@ function createHostRequest(options = {}) {
|
|
|
6837
7290
|
}
|
|
6838
7291
|
|
|
6839
7292
|
// src/host/slot-saves.ts
|
|
6840
|
-
import { useCallback as useCallback9, useRef as
|
|
7293
|
+
import { useCallback as useCallback9, useRef as useRef15 } from "react";
|
|
6841
7294
|
function useSlotSaves() {
|
|
6842
|
-
const saves =
|
|
7295
|
+
const saves = useRef15(/* @__PURE__ */ new Set());
|
|
6843
7296
|
const register = useCallback9((save) => {
|
|
6844
7297
|
saves.current.add(save);
|
|
6845
7298
|
return () => {
|
|
@@ -6878,27 +7331,27 @@ function abpListSource(request, path, options = {}) {
|
|
|
6878
7331
|
var pageCount = (total, pageSize) => Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
|
|
6879
7332
|
|
|
6880
7333
|
// src/lists/useListState.ts
|
|
6881
|
-
import { useCallback as useCallback10, useEffect as
|
|
7334
|
+
import { useCallback as useCallback10, useEffect as useEffect14, useMemo as useMemo10, useRef as useRef16, useState as useState18 } from "react";
|
|
6882
7335
|
function useListState(source, options = {}) {
|
|
6883
7336
|
const { searchDelay = 250 } = options;
|
|
6884
|
-
const [query, setQuery] =
|
|
6885
|
-
const [typed, setTyped] =
|
|
6886
|
-
const [rows2, setRows] =
|
|
6887
|
-
const [total, setTotal] =
|
|
6888
|
-
const [busy, setBusy] =
|
|
6889
|
-
const [error, setError] =
|
|
6890
|
-
const [round, setRound] =
|
|
6891
|
-
const told =
|
|
6892
|
-
|
|
7337
|
+
const [query, setQuery] = useState18(() => emptyQuery(options.initial));
|
|
7338
|
+
const [typed, setTyped] = useState18(query.search);
|
|
7339
|
+
const [rows2, setRows] = useState18(void 0);
|
|
7340
|
+
const [total, setTotal] = useState18(0);
|
|
7341
|
+
const [busy, setBusy] = useState18(true);
|
|
7342
|
+
const [error, setError] = useState18(null);
|
|
7343
|
+
const [round, setRound] = useState18(0);
|
|
7344
|
+
const told = useRef16(options.onQueryChange);
|
|
7345
|
+
useEffect14(() => {
|
|
6893
7346
|
told.current = options.onQueryChange;
|
|
6894
7347
|
});
|
|
6895
|
-
const [shownKey, setShownKey] =
|
|
7348
|
+
const [shownKey, setShownKey] = useState18(source.key);
|
|
6896
7349
|
if (shownKey !== source.key) {
|
|
6897
7350
|
setShownKey(source.key);
|
|
6898
7351
|
setRows(void 0);
|
|
6899
7352
|
setTotal(0);
|
|
6900
7353
|
}
|
|
6901
|
-
|
|
7354
|
+
useEffect14(() => {
|
|
6902
7355
|
const abort = new AbortController();
|
|
6903
7356
|
setBusy(true);
|
|
6904
7357
|
source.load(query, abort.signal).then(
|
|
@@ -6924,7 +7377,7 @@ function useListState(source, options = {}) {
|
|
|
6924
7377
|
return n;
|
|
6925
7378
|
});
|
|
6926
7379
|
}, []);
|
|
6927
|
-
|
|
7380
|
+
useEffect14(() => {
|
|
6928
7381
|
if (typed === query.search) return;
|
|
6929
7382
|
const timer = setTimeout(() => change((q) => ({ ...q, search: typed, page: 1 })), searchDelay);
|
|
6930
7383
|
return () => clearTimeout(timer);
|
|
@@ -6944,7 +7397,7 @@ function useListState(source, options = {}) {
|
|
|
6944
7397
|
const reload = useCallback10(() => setRound((r) => r + 1), []);
|
|
6945
7398
|
const pages = pageCount(total, query.pageSize);
|
|
6946
7399
|
const loading = busy && rows2 === void 0;
|
|
6947
|
-
return
|
|
7400
|
+
return useMemo10(
|
|
6948
7401
|
() => ({
|
|
6949
7402
|
query: { ...query, search: typed },
|
|
6950
7403
|
rows: rows2,
|
|
@@ -6968,13 +7421,13 @@ function useListState(source, options = {}) {
|
|
|
6968
7421
|
function useAreaListSource(area, path, options = {}) {
|
|
6969
7422
|
const request = useAreaRequest(area);
|
|
6970
7423
|
const key = JSON.stringify(options);
|
|
6971
|
-
return
|
|
7424
|
+
return useMemo10(() => abpListSource(request, path, options), [request, path, key]);
|
|
6972
7425
|
}
|
|
6973
7426
|
|
|
6974
7427
|
// src/components/FormDialog.tsx
|
|
6975
|
-
import { Fragment as Fragment15, useId as useId5, useRef as
|
|
6976
|
-
import { chakra as
|
|
6977
|
-
import { Fragment as Fragment16, jsx as
|
|
7428
|
+
import { Fragment as Fragment15, useId as useId5, useRef as useRef17, useState as useState19 } from "react";
|
|
7429
|
+
import { chakra as chakra27, CloseButton as CloseButton2, Dialog as Dialog4, Grid as Grid3, HStack as HStack9, Portal as Portal12, Stack as Stack8, Text as Text13 } from "@chakra-ui/react";
|
|
7430
|
+
import { Fragment as Fragment16, jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6978
7431
|
var isControl = (el) => el instanceof HTMLInputElement || el instanceof HTMLSelectElement || el instanceof HTMLTextAreaElement;
|
|
6979
7432
|
function invalidControls(form) {
|
|
6980
7433
|
return [...form.elements].filter((el) => isControl(el) && !el.disabled && el.willValidate && !el.checkValidity());
|
|
@@ -7014,10 +7467,10 @@ function FormDialog({
|
|
|
7014
7467
|
const previewHeading = useId5();
|
|
7015
7468
|
const labels = useAbpLabels();
|
|
7016
7469
|
const { locale } = useAbpLocale();
|
|
7017
|
-
const summary =
|
|
7018
|
-
const [problems, setProblems] =
|
|
7019
|
-
const typed =
|
|
7020
|
-
const tried =
|
|
7470
|
+
const summary = useRef17(null);
|
|
7471
|
+
const [problems, setProblems] = useState19([]);
|
|
7472
|
+
const typed = useRef17(/* @__PURE__ */ new WeakSet());
|
|
7473
|
+
const tried = useRef17(false);
|
|
7021
7474
|
const describe2 = (el) => ({ el, label: labelOf(el), message: el.validity.valueMissing ? labels.formRequired : el.validationMessage });
|
|
7022
7475
|
function submit(e) {
|
|
7023
7476
|
e.preventDefault();
|
|
@@ -7046,9 +7499,9 @@ function FormDialog({
|
|
|
7046
7499
|
mark(el, false);
|
|
7047
7500
|
if (problems.length > 0) setProblems(invalidControls(e.currentTarget).map(describe2));
|
|
7048
7501
|
}
|
|
7049
|
-
return /* @__PURE__ */
|
|
7050
|
-
/* @__PURE__ */
|
|
7051
|
-
/* @__PURE__ */
|
|
7502
|
+
return /* @__PURE__ */ jsx45(Dialog4.Root, { open, onOpenChange: (e) => onOpenChange(e.open), size: shape === "wide" ? "xl" : shape, placement: "center", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs33(Portal12, { children: [
|
|
7503
|
+
/* @__PURE__ */ jsx45(Dialog4.Backdrop, {}),
|
|
7504
|
+
/* @__PURE__ */ jsx45(Dialog4.Positioner, { children: /* @__PURE__ */ jsx45(Dialog4.Content, { asChild: true, ...shape === "wide" ? { maxW: "min(57.5rem, calc(100vw - 2rem))", w: "full" } : {}, children: /* @__PURE__ */ jsxs33(
|
|
7052
7505
|
"form",
|
|
7053
7506
|
{
|
|
7054
7507
|
onSubmit: hideSubmit ? (e) => e.preventDefault() : submit,
|
|
@@ -7057,18 +7510,18 @@ function FormDialog({
|
|
|
7057
7510
|
onInput: (e) => typed.current.add(e.target),
|
|
7058
7511
|
noValidate: true,
|
|
7059
7512
|
children: [
|
|
7060
|
-
/* @__PURE__ */
|
|
7061
|
-
/* @__PURE__ */
|
|
7513
|
+
/* @__PURE__ */ jsx45(Dialog4.Header, { children: /* @__PURE__ */ jsx45(Dialog4.Title, { children: title }) }),
|
|
7514
|
+
/* @__PURE__ */ jsx45(Dialog4.Body, { children: /* @__PURE__ */ jsxs33(
|
|
7062
7515
|
Grid3,
|
|
7063
7516
|
{
|
|
7064
7517
|
templateColumns: preview != null ? { base: "minmax(0, 1fr)", md: "minmax(0, 1.35fr) minmax(0, 1fr)" } : "minmax(0, 1fr)",
|
|
7065
7518
|
gap: "6",
|
|
7066
7519
|
alignItems: "start",
|
|
7067
7520
|
children: [
|
|
7068
|
-
/* @__PURE__ */
|
|
7069
|
-
description != null && /* @__PURE__ */
|
|
7070
|
-
problems.length > 0 && /* @__PURE__ */
|
|
7071
|
-
|
|
7521
|
+
/* @__PURE__ */ jsxs33(Stack8, { gap: "field", minW: "0", children: [
|
|
7522
|
+
description != null && /* @__PURE__ */ jsx45(Dialog4.Description, { children: description }),
|
|
7523
|
+
problems.length > 0 && /* @__PURE__ */ jsx45(chakra27.div, { ref: summary, tabIndex: -1, outline: "none", "data-form-problems": "", children: /* @__PURE__ */ jsx45(InlineAlert, { tone: "danger", title: formatMessage(locale, labels.formFix, { count: problems.length }), children: /* @__PURE__ */ jsx45(chakra27.ul, { ps: "4", listStyleType: "disc", children: problems.map((p, i) => /* @__PURE__ */ jsx45("li", { children: /* @__PURE__ */ jsx45(
|
|
7524
|
+
chakra27.button,
|
|
7072
7525
|
{
|
|
7073
7526
|
type: "button",
|
|
7074
7527
|
textDecoration: "underline",
|
|
@@ -7082,10 +7535,10 @@ function FormDialog({
|
|
|
7082
7535
|
}
|
|
7083
7536
|
) }, i)) }) }) }),
|
|
7084
7537
|
children,
|
|
7085
|
-
/* @__PURE__ */
|
|
7538
|
+
/* @__PURE__ */ jsx45(InlineAlert, { tone: "danger", children: error })
|
|
7086
7539
|
] }),
|
|
7087
|
-
preview != null && /* @__PURE__ */
|
|
7088
|
-
|
|
7540
|
+
preview != null && /* @__PURE__ */ jsxs33(
|
|
7541
|
+
chakra27.aside,
|
|
7089
7542
|
{
|
|
7090
7543
|
"aria-labelledby": previewHeading,
|
|
7091
7544
|
display: "flex",
|
|
@@ -7098,7 +7551,7 @@ function FormDialog({
|
|
|
7098
7551
|
position: { md: "sticky" },
|
|
7099
7552
|
top: "0",
|
|
7100
7553
|
children: [
|
|
7101
|
-
/* @__PURE__ */
|
|
7554
|
+
/* @__PURE__ */ jsx45(Text13, { id: previewHeading, textStyle: "label", children: previewTitle ?? labels.preview ?? "Preview" }),
|
|
7102
7555
|
preview
|
|
7103
7556
|
]
|
|
7104
7557
|
}
|
|
@@ -7106,48 +7559,48 @@ function FormDialog({
|
|
|
7106
7559
|
]
|
|
7107
7560
|
}
|
|
7108
7561
|
) }),
|
|
7109
|
-
/* @__PURE__ */
|
|
7110
|
-
dangerAction && /* @__PURE__ */
|
|
7111
|
-
/* @__PURE__ */
|
|
7112
|
-
/* @__PURE__ */
|
|
7562
|
+
/* @__PURE__ */ jsxs33(Dialog4.Footer, { children: [
|
|
7563
|
+
dangerAction && /* @__PURE__ */ jsxs33(Fragment16, { children: [
|
|
7564
|
+
/* @__PURE__ */ jsx45(Button, { variant: "link", danger: true, onClick: dangerAction.onClick, disabled: dangerAction.disabled, children: dangerAction.label }),
|
|
7565
|
+
/* @__PURE__ */ jsx45(chakra27.span, { flex: "1", "aria-hidden": true })
|
|
7113
7566
|
] }),
|
|
7114
|
-
/* @__PURE__ */
|
|
7115
|
-
!hideSubmit && /* @__PURE__ */
|
|
7567
|
+
/* @__PURE__ */ jsx45(Dialog4.ActionTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(Button, { variant: "cancel", children: labels.cancel }) }),
|
|
7568
|
+
!hideSubmit && /* @__PURE__ */ jsx45(Button, { type: "submit", variant: "primary", loading: busy, disabled: submitDisabled, children: submitLabel })
|
|
7116
7569
|
] }),
|
|
7117
|
-
/* @__PURE__ */
|
|
7570
|
+
/* @__PURE__ */ jsx45(Dialog4.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(CloseButton2, { size: "sm", "aria-label": labels.close }) })
|
|
7118
7571
|
]
|
|
7119
7572
|
}
|
|
7120
7573
|
) }) })
|
|
7121
7574
|
] }) });
|
|
7122
7575
|
}
|
|
7123
7576
|
function PreviewCard({ media, title, subtitle, items = [] }) {
|
|
7124
|
-
return /* @__PURE__ */
|
|
7125
|
-
/* @__PURE__ */
|
|
7577
|
+
return /* @__PURE__ */ jsxs33(Stack8, { gap: "4", p: "4", bg: "bg.panel", borderRadius: "l2", minW: "0", children: [
|
|
7578
|
+
/* @__PURE__ */ jsxs33(HStack9, { gap: "3", minW: "0", children: [
|
|
7126
7579
|
media,
|
|
7127
|
-
/* @__PURE__ */
|
|
7128
|
-
/* @__PURE__ */
|
|
7129
|
-
subtitle != null && /* @__PURE__ */
|
|
7580
|
+
/* @__PURE__ */ jsxs33(Stack8, { gap: "0.5", minW: "0", children: [
|
|
7581
|
+
/* @__PURE__ */ jsx45(Text13, { textStyle: "lg", fontWeight: "semibold", truncate: true, children: title }),
|
|
7582
|
+
subtitle != null && /* @__PURE__ */ jsx45(Text13, { as: "div", textStyle: "caption", color: "fg.muted", truncate: true, children: subtitle })
|
|
7130
7583
|
] })
|
|
7131
7584
|
] }),
|
|
7132
|
-
items.length > 0 && /* @__PURE__ */
|
|
7133
|
-
/* @__PURE__ */
|
|
7134
|
-
/* @__PURE__ */
|
|
7585
|
+
items.length > 0 && /* @__PURE__ */ jsx45(chakra27.dl, { display: "grid", gridTemplateColumns: "auto minmax(0, 1fr)", columnGap: "4", rowGap: "2", textStyle: "body.sm", m: "0", children: items.map((item, i) => /* @__PURE__ */ jsxs33(Fragment15, { children: [
|
|
7586
|
+
/* @__PURE__ */ jsx45(chakra27.dt, { color: "fg.muted", children: item.label }),
|
|
7587
|
+
/* @__PURE__ */ jsx45(chakra27.dd, { m: "0", minW: "0", ...item.wrap ? { lineClamp: 3 } : { truncate: true }, children: item.value ?? EMPTY_VALUE })
|
|
7135
7588
|
] }, i)) })
|
|
7136
7589
|
] });
|
|
7137
7590
|
}
|
|
7138
7591
|
|
|
7139
7592
|
// src/components/SaveBar.tsx
|
|
7140
7593
|
import { useId as useId6 } from "react";
|
|
7141
|
-
import { Box as
|
|
7594
|
+
import { Box as Box10, chakra as chakra28, Stack as Stack9, Text as Text14 } from "@chakra-ui/react";
|
|
7142
7595
|
import { FilePen } from "lucide-react";
|
|
7143
|
-
import { jsx as
|
|
7596
|
+
import { jsx as jsx46, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
7144
7597
|
var UNSAVED = "{count, plural, one {# change isn't saved yet} other {# changes aren't saved yet}}";
|
|
7145
7598
|
function SaveBar({ open, onSave, onDiscard, count = 1, message, title, saveLabel, busy, saveDisabled }) {
|
|
7146
7599
|
const labels = useAbpLabels();
|
|
7147
7600
|
const { locale } = useAbpLocale();
|
|
7148
7601
|
const heading = useId6();
|
|
7149
|
-
return /* @__PURE__ */
|
|
7150
|
-
|
|
7602
|
+
return /* @__PURE__ */ jsx46(Box10, { position: "fixed", insetInline: "0", bottom: "6", zIndex: "sticky", display: "flex", justifyContent: "center", px: "4", pointerEvents: "none", children: /* @__PURE__ */ jsx46(Presence, { show: open, from: "rise", maxW: "full", children: /* @__PURE__ */ jsxs34(
|
|
7603
|
+
chakra28.section,
|
|
7151
7604
|
{
|
|
7152
7605
|
"aria-labelledby": heading,
|
|
7153
7606
|
"data-testid": "save-bar",
|
|
@@ -7161,49 +7614,49 @@ function SaveBar({ open, onSave, onDiscard, count = 1, message, title, saveLabel
|
|
|
7161
7614
|
bg: "bg.selected",
|
|
7162
7615
|
color: "accent.fg",
|
|
7163
7616
|
children: [
|
|
7164
|
-
/* @__PURE__ */
|
|
7165
|
-
/* @__PURE__ */
|
|
7166
|
-
/* @__PURE__ */
|
|
7167
|
-
/* @__PURE__ */
|
|
7617
|
+
/* @__PURE__ */ jsx46(Box10, { flex: "none", display: "inline-flex", alignItems: "center", justifyContent: "center", boxSize: "8", borderRadius: "l2", bg: "bg.panel", "aria-hidden": true, children: /* @__PURE__ */ jsx46(FilePen, { size: 18, strokeWidth: 1.75 }) }),
|
|
7618
|
+
/* @__PURE__ */ jsxs34(Stack9, { gap: "0", flex: "1", minW: { base: "0", sm: "11.25rem" }, me: { sm: "4" }, "aria-live": "polite", children: [
|
|
7619
|
+
/* @__PURE__ */ jsx46(Text14, { id: heading, textStyle: "body.sm", fontWeight: "bold", color: "fg", children: title ?? labels.saveBar ?? "Save your changes?" }),
|
|
7620
|
+
/* @__PURE__ */ jsx46(Text14, { textStyle: "caption", children: message ?? formatMessage(locale, labels.unsavedChanges ?? UNSAVED, { count }) })
|
|
7168
7621
|
] }),
|
|
7169
|
-
/* @__PURE__ */
|
|
7170
|
-
/* @__PURE__ */
|
|
7622
|
+
/* @__PURE__ */ jsx46(Button, { variant: "ghost", color: "accent.fg", fontWeight: "bold", _hover: { bg: "accent.emphasized" }, onClick: onDiscard, disabled: busy, children: labels.discard ?? "Discard" }),
|
|
7623
|
+
/* @__PURE__ */ jsx46(Button, { variant: "primary", onClick: onSave, loading: busy, disabled: saveDisabled, children: saveLabel ?? labels.save ?? "Save" })
|
|
7171
7624
|
]
|
|
7172
7625
|
}
|
|
7173
7626
|
) }) });
|
|
7174
7627
|
}
|
|
7175
7628
|
|
|
7176
7629
|
// src/settings/SettingsLayout.tsx
|
|
7177
|
-
import { useState as
|
|
7178
|
-
import { Text as
|
|
7630
|
+
import { useState as useState20 } from "react";
|
|
7631
|
+
import { Text as Text15 } from "@chakra-ui/react";
|
|
7179
7632
|
|
|
7180
7633
|
// src/components/SearchInput.tsx
|
|
7181
7634
|
import { forwardRef as forwardRef7 } from "react";
|
|
7182
7635
|
import { Input as Input5, InputGroup } from "@chakra-ui/react";
|
|
7183
7636
|
import { Search as Search3 } from "lucide-react";
|
|
7184
|
-
import { jsx as
|
|
7637
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
7185
7638
|
var SearchInput = forwardRef7(function SearchInput2({ size = "md", maxW, ...rest }, ref) {
|
|
7186
7639
|
const skeleton = useLoading();
|
|
7187
|
-
return /* @__PURE__ */
|
|
7640
|
+
return /* @__PURE__ */ jsx47(
|
|
7188
7641
|
InputGroup,
|
|
7189
7642
|
{
|
|
7190
|
-
startElement: /* @__PURE__ */
|
|
7643
|
+
startElement: /* @__PURE__ */ jsx47(Search3, {}),
|
|
7191
7644
|
startOffset: "-0.25rem",
|
|
7192
7645
|
startElementProps: { color: "fg.subtle", _icon: { boxSize: "4" } },
|
|
7193
7646
|
maxW,
|
|
7194
7647
|
borderRadius: "l2",
|
|
7195
7648
|
"aria-hidden": skeleton || void 0,
|
|
7196
7649
|
css: skeleton ? ghostCss : void 0,
|
|
7197
|
-
children: /* @__PURE__ */
|
|
7650
|
+
children: /* @__PURE__ */ jsx47(Input5, { ref, type: "search", size, ...rest })
|
|
7198
7651
|
}
|
|
7199
7652
|
);
|
|
7200
7653
|
});
|
|
7201
7654
|
|
|
7202
7655
|
// src/settings/SettingsLayout.tsx
|
|
7203
|
-
import { jsx as
|
|
7656
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
7204
7657
|
var isCurrent = (pathname, href) => pathname === href || pathname.startsWith(`${href}/`);
|
|
7205
7658
|
function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav = [], children, ...shell }) {
|
|
7206
|
-
const [find, setFind] =
|
|
7659
|
+
const [find, setFind] = useState20("");
|
|
7207
7660
|
const q = find.trim().toLocaleLowerCase();
|
|
7208
7661
|
const sections = area.map(({ section, pages }) => ({
|
|
7209
7662
|
id: section.key,
|
|
@@ -7211,17 +7664,17 @@ function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav
|
|
|
7211
7664
|
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))
|
|
7212
7665
|
}));
|
|
7213
7666
|
const found = !q || sections.some((s) => s.items.length > 0);
|
|
7214
|
-
return /* @__PURE__ */
|
|
7667
|
+
return /* @__PURE__ */ jsx48(
|
|
7215
7668
|
AppShell,
|
|
7216
7669
|
{
|
|
7217
7670
|
...shell,
|
|
7218
7671
|
topNav,
|
|
7219
7672
|
sidebar: {
|
|
7220
7673
|
id: sidebarId,
|
|
7221
|
-
top: /* @__PURE__ */
|
|
7674
|
+
top: /* @__PURE__ */ jsx48(SearchInput, { size: "sm", value: find, onChange: (e) => setFind(e.target.value), placeholder: labels.find, "aria-label": labels.find }),
|
|
7222
7675
|
sections
|
|
7223
7676
|
},
|
|
7224
|
-
navFooter: !found ? /* @__PURE__ */
|
|
7677
|
+
navFooter: !found ? /* @__PURE__ */ jsx48(Text15, { textStyle: "caption", color: "fg.muted", px: "2", children: labels.noSetting }) : void 0,
|
|
7225
7678
|
children
|
|
7226
7679
|
}
|
|
7227
7680
|
);
|
|
@@ -7229,7 +7682,7 @@ function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav
|
|
|
7229
7682
|
|
|
7230
7683
|
// src/components/SegmentedControl.tsx
|
|
7231
7684
|
import { SegmentGroup } from "@chakra-ui/react";
|
|
7232
|
-
import { jsx as
|
|
7685
|
+
import { jsx as jsx49, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
7233
7686
|
function SegmentedControl({
|
|
7234
7687
|
"aria-label": ariaLabel,
|
|
7235
7688
|
items,
|
|
@@ -7241,7 +7694,7 @@ function SegmentedControl({
|
|
|
7241
7694
|
}) {
|
|
7242
7695
|
const loading = useLoading(own);
|
|
7243
7696
|
const h = size === "sm" ? "7" : "8";
|
|
7244
|
-
return /* @__PURE__ */
|
|
7697
|
+
return /* @__PURE__ */ jsxs35(
|
|
7245
7698
|
SegmentGroup.Root,
|
|
7246
7699
|
{
|
|
7247
7700
|
size: size === "sm" ? "sm" : "md",
|
|
@@ -7258,8 +7711,8 @@ function SegmentedControl({
|
|
|
7258
7711
|
w: fitted ? "full" : void 0,
|
|
7259
7712
|
"data-segmented": "",
|
|
7260
7713
|
children: [
|
|
7261
|
-
/* @__PURE__ */
|
|
7262
|
-
items.map((item) => /* @__PURE__ */
|
|
7714
|
+
/* @__PURE__ */ jsx49(SegmentGroup.Indicator, {}),
|
|
7715
|
+
items.map((item) => /* @__PURE__ */ jsxs35(
|
|
7263
7716
|
SegmentGroup.Item,
|
|
7264
7717
|
{
|
|
7265
7718
|
value: item.value,
|
|
@@ -7280,9 +7733,9 @@ function SegmentedControl({
|
|
|
7280
7733
|
_icon: { boxSize: "4", flexShrink: 0 },
|
|
7281
7734
|
children: [
|
|
7282
7735
|
item.icon,
|
|
7283
|
-
/* @__PURE__ */
|
|
7284
|
-
item.count != null && /* @__PURE__ */
|
|
7285
|
-
/* @__PURE__ */
|
|
7736
|
+
/* @__PURE__ */ jsx49(SegmentGroup.ItemText, { children: item.label }),
|
|
7737
|
+
item.count != null && /* @__PURE__ */ jsx49(CountBadge, { value: item.count, tone: item.value === value ? "accent" : "neutral" }),
|
|
7738
|
+
/* @__PURE__ */ jsx49(SegmentGroup.ItemHiddenInput, {})
|
|
7286
7739
|
]
|
|
7287
7740
|
},
|
|
7288
7741
|
item.value
|
|
@@ -7293,9 +7746,9 @@ function SegmentedControl({
|
|
|
7293
7746
|
}
|
|
7294
7747
|
|
|
7295
7748
|
// src/components/KanbanBoard.tsx
|
|
7296
|
-
import { useEffect as
|
|
7297
|
-
import { Box as
|
|
7298
|
-
import { Check as Check2, ChevronsLeft, ChevronsRight, GripVertical as
|
|
7749
|
+
import { useEffect as useEffect15, useLayoutEffect as useLayoutEffect4, useMemo as useMemo11, useRef as useRef18, useState as useState21 } from "react";
|
|
7750
|
+
import { Box as Box11, chakra as chakra29, HStack as HStack10, Stack as Stack10, Text as Text16 } from "@chakra-ui/react";
|
|
7751
|
+
import { Check as Check2, ChevronsLeft, ChevronsRight, GripVertical as GripVertical4 } from "lucide-react";
|
|
7299
7752
|
import {
|
|
7300
7753
|
DndContext as DndContext2,
|
|
7301
7754
|
DragOverlay as DragOverlay2,
|
|
@@ -7330,13 +7783,13 @@ function between(cell, from, to) {
|
|
|
7330
7783
|
}
|
|
7331
7784
|
|
|
7332
7785
|
// src/components/KanbanBoard.tsx
|
|
7333
|
-
import { Fragment as Fragment17, jsx as
|
|
7786
|
+
import { Fragment as Fragment17, jsx as jsx50, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7334
7787
|
var SKELETON_CARDS = [3, 2, 4, 1, 2];
|
|
7335
7788
|
function PlaceholderCard({ index }) {
|
|
7336
|
-
return /* @__PURE__ */
|
|
7337
|
-
/* @__PURE__ */
|
|
7338
|
-
/* @__PURE__ */
|
|
7339
|
-
/* @__PURE__ */
|
|
7789
|
+
return /* @__PURE__ */ jsxs36(Box11, { bg: "bg.panel", borderWidth: "1px", borderColor: "border", rounded: "l2", p: "2.5", children: [
|
|
7790
|
+
/* @__PURE__ */ jsx50(Box11, { mb: "1", children: /* @__PURE__ */ jsx50(RecordKey, { loading: true }) }),
|
|
7791
|
+
/* @__PURE__ */ jsx50(Text16, { textStyle: "body.sm", children: /* @__PURE__ */ jsx50(TextBone, { width: boneWidth(index, 14, 34) }) }),
|
|
7792
|
+
/* @__PURE__ */ jsx50(HStack10, { mt: "2", children: /* @__PURE__ */ jsx50(StatusPill, { loading: true, skeletonWidth: boneWidth(index, 5, 9) }) })
|
|
7340
7793
|
] });
|
|
7341
7794
|
}
|
|
7342
7795
|
var cellId = (lane, column) => `cell:${lane}::${column}`;
|
|
@@ -7369,8 +7822,8 @@ function KanbanBoard({
|
|
|
7369
7822
|
}) {
|
|
7370
7823
|
const loading = useLoading(own);
|
|
7371
7824
|
const [folded, fold] = useFolded(foldKey);
|
|
7372
|
-
const [movingColumn, setMovingColumn] =
|
|
7373
|
-
const [overColumn, setOverColumn] =
|
|
7825
|
+
const [movingColumn, setMovingColumn] = useState21(null);
|
|
7826
|
+
const [overColumn, setOverColumn] = useState21(null);
|
|
7374
7827
|
const movingCol = columns.find((c2) => c2.id === movingColumn);
|
|
7375
7828
|
const movingName = movingCol?.name ?? (typeof movingCol?.title === "string" ? movingCol.title : movingColumn ?? "");
|
|
7376
7829
|
const reorder = (id, to) => {
|
|
@@ -7382,24 +7835,24 @@ function KanbanBoard({
|
|
|
7382
7835
|
ids.splice(to, 0, id);
|
|
7383
7836
|
onReorderColumns(ids);
|
|
7384
7837
|
};
|
|
7385
|
-
const shownColumns = loading && columns.length === 0 ? Array.from({ length: skeletonColumns }, (_, n) => ({ id: `skeleton-${n}`, title: /* @__PURE__ */
|
|
7838
|
+
const shownColumns = loading && columns.length === 0 ? Array.from({ length: skeletonColumns }, (_, n) => ({ id: `skeleton-${n}`, title: /* @__PURE__ */ jsx50(TextBone, { width: boneWidth(n, 6, 12) }) })) : columns;
|
|
7386
7839
|
const rows2 = lanes && lanes.length > 0 ? lanes : [{ id: "", title: null }];
|
|
7387
7840
|
const sensors = useSensors2(
|
|
7388
7841
|
useSensor2(PointerSensor2, { activationConstraint: { distance: 6 } }),
|
|
7389
7842
|
useSensor2(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
|
|
7390
7843
|
);
|
|
7391
7844
|
const laned = !!lanes && lanes.length > 0;
|
|
7392
|
-
const [active, setActive] =
|
|
7393
|
-
const [carried, setCarried] =
|
|
7394
|
-
const [pending2, setPending] =
|
|
7395
|
-
const shown =
|
|
7396
|
-
const riding =
|
|
7397
|
-
const anchor =
|
|
7398
|
-
const draggedAt =
|
|
7845
|
+
const [active, setActive] = useState21(null);
|
|
7846
|
+
const [carried, setCarried] = useState21([]);
|
|
7847
|
+
const [pending2, setPending] = useState21(null);
|
|
7848
|
+
const shown = useMemo11(() => pending2 && pending2.on === items ? withMoves(items, pending2.ids, pending2.move, !laned) : items, [items, pending2, laned]);
|
|
7849
|
+
const riding = useMemo11(() => new Set(carried.map((i) => i.id)), [carried]);
|
|
7850
|
+
const anchor = useRef18(null);
|
|
7851
|
+
const draggedAt = useRef18(0);
|
|
7399
7852
|
const { reduce } = useMotionSetting();
|
|
7400
|
-
const region =
|
|
7401
|
-
const dropped =
|
|
7402
|
-
const placement =
|
|
7853
|
+
const region = useRef18(null);
|
|
7854
|
+
const dropped = useRef18(null);
|
|
7855
|
+
const placement = useMemo11(() => shown.map((i) => `${i.id}@${lanes && lanes.length > 0 ? i.lane : ""}/${i.column}`).join("|"), [shown, lanes]);
|
|
7403
7856
|
const notePlaces = useSlideItems(region, placement, {
|
|
7404
7857
|
paused: active != null,
|
|
7405
7858
|
skip: () => {
|
|
@@ -7408,7 +7861,7 @@ function KanbanBoard({
|
|
|
7408
7861
|
return id;
|
|
7409
7862
|
}
|
|
7410
7863
|
});
|
|
7411
|
-
const byCell =
|
|
7864
|
+
const byCell = useMemo11(() => {
|
|
7412
7865
|
const map = /* @__PURE__ */ new Map();
|
|
7413
7866
|
for (const item of shown) {
|
|
7414
7867
|
const id = cellId(lanes && lanes.length > 0 ? item.lane : "", item.column);
|
|
@@ -7417,7 +7870,7 @@ function KanbanBoard({
|
|
|
7417
7870
|
}
|
|
7418
7871
|
return map;
|
|
7419
7872
|
}, [shown, lanes]);
|
|
7420
|
-
const cellOf =
|
|
7873
|
+
const cellOf = useMemo11(() => {
|
|
7421
7874
|
const map = /* @__PURE__ */ new Map();
|
|
7422
7875
|
for (const [cell, list] of byCell) for (const item of list) map.set(item.id, cell);
|
|
7423
7876
|
return map;
|
|
@@ -7484,7 +7937,7 @@ function KanbanBoard({
|
|
|
7484
7937
|
const clear = () => {
|
|
7485
7938
|
if (onSelect && selected && selected.size > 0) onSelect(/* @__PURE__ */ new Set());
|
|
7486
7939
|
};
|
|
7487
|
-
|
|
7940
|
+
useEffect15(() => {
|
|
7488
7941
|
if (!onSelect || !selected || selected.size === 0 || active) return;
|
|
7489
7942
|
const key = (e) => {
|
|
7490
7943
|
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
@@ -7494,7 +7947,7 @@ function KanbanBoard({
|
|
|
7494
7947
|
document.addEventListener("keydown", key);
|
|
7495
7948
|
return () => document.removeEventListener("keydown", key);
|
|
7496
7949
|
}, [onSelect, selected, active]);
|
|
7497
|
-
return /* @__PURE__ */
|
|
7950
|
+
return /* @__PURE__ */ jsxs36(
|
|
7498
7951
|
DndContext2,
|
|
7499
7952
|
{
|
|
7500
7953
|
sensors,
|
|
@@ -7507,8 +7960,8 @@ function KanbanBoard({
|
|
|
7507
7960
|
},
|
|
7508
7961
|
accessibility: { announcements, screenReaderInstructions: screenReaderInstructions ? { draggable: screenReaderInstructions } : void 0 },
|
|
7509
7962
|
children: [
|
|
7510
|
-
/* @__PURE__ */
|
|
7511
|
-
|
|
7963
|
+
/* @__PURE__ */ jsx50(
|
|
7964
|
+
Box11,
|
|
7512
7965
|
{
|
|
7513
7966
|
ref: region,
|
|
7514
7967
|
role: "region",
|
|
@@ -7520,8 +7973,8 @@ function KanbanBoard({
|
|
|
7520
7973
|
if (Date.now() - draggedAt.current < 300) return;
|
|
7521
7974
|
if (e.target instanceof Element && !e.target.closest("[data-card], a, button, input, select, textarea")) clear();
|
|
7522
7975
|
},
|
|
7523
|
-
children: /* @__PURE__ */
|
|
7524
|
-
|
|
7976
|
+
children: /* @__PURE__ */ jsx50(Loading, { when: loading, children: /* @__PURE__ */ jsxs36(
|
|
7977
|
+
Box11,
|
|
7525
7978
|
{
|
|
7526
7979
|
display: "grid",
|
|
7527
7980
|
gridTemplateColumns: shownColumns.map((c2) => folded.has(c2.id) ? "3rem" : "minmax(288px, 1fr)").join(" "),
|
|
@@ -7531,8 +7984,8 @@ function KanbanBoard({
|
|
|
7531
7984
|
shownColumns.map((c2) => {
|
|
7532
7985
|
const isFolded = folded.has(c2.id);
|
|
7533
7986
|
const name = c2.name ?? (typeof c2.title === "string" ? c2.title : c2.id);
|
|
7534
|
-
return /* @__PURE__ */
|
|
7535
|
-
|
|
7987
|
+
return /* @__PURE__ */ jsxs36(
|
|
7988
|
+
Box11,
|
|
7536
7989
|
{
|
|
7537
7990
|
position: "sticky",
|
|
7538
7991
|
top: "0",
|
|
@@ -7556,8 +8009,8 @@ function KanbanBoard({
|
|
|
7556
8009
|
}
|
|
7557
8010
|
} : {},
|
|
7558
8011
|
children: [
|
|
7559
|
-
overColumn === c2.id && movingColumn && movingColumn !== c2.id && /* @__PURE__ */
|
|
7560
|
-
|
|
8012
|
+
overColumn === c2.id && movingColumn && movingColumn !== c2.id && /* @__PURE__ */ jsx50(
|
|
8013
|
+
Box11,
|
|
7561
8014
|
{
|
|
7562
8015
|
position: "absolute",
|
|
7563
8016
|
inset: "0",
|
|
@@ -7573,10 +8026,10 @@ function KanbanBoard({
|
|
|
7573
8026
|
roundedTop: "l3",
|
|
7574
8027
|
bg: "bg.panel",
|
|
7575
8028
|
"data-drop-column": "",
|
|
7576
|
-
children: /* @__PURE__ */
|
|
8029
|
+
children: /* @__PURE__ */ jsx50(Text16, { textStyle: "caption", fontWeight: "bold", color: "fg.accent", truncate: true, children: dropColumnLabel(movingName) })
|
|
7577
8030
|
}
|
|
7578
8031
|
),
|
|
7579
|
-
isFolded ? /* @__PURE__ */
|
|
8032
|
+
isFolded ? /* @__PURE__ */ jsx50(
|
|
7580
8033
|
Stack10,
|
|
7581
8034
|
{
|
|
7582
8035
|
align: "center",
|
|
@@ -7589,10 +8042,10 @@ function KanbanBoard({
|
|
|
7589
8042
|
roundedTop: "l3",
|
|
7590
8043
|
bg: c2.over ? "red.subtle" : "bg.subtle",
|
|
7591
8044
|
h: "full",
|
|
7592
|
-
children: /* @__PURE__ */
|
|
8045
|
+
children: /* @__PURE__ */ jsx50(FoldButton, { folded: true, label: foldLabel(name, true), onClick: () => fold(c2.id) })
|
|
7593
8046
|
}
|
|
7594
|
-
) : /* @__PURE__ */
|
|
7595
|
-
|
|
8047
|
+
) : /* @__PURE__ */ jsxs36(
|
|
8048
|
+
HStack10,
|
|
7596
8049
|
{
|
|
7597
8050
|
justify: "space-between",
|
|
7598
8051
|
gap: "2",
|
|
@@ -7608,8 +8061,8 @@ function KanbanBoard({
|
|
|
7608
8061
|
h: "full",
|
|
7609
8062
|
align: "start",
|
|
7610
8063
|
children: [
|
|
7611
|
-
/* @__PURE__ */
|
|
7612
|
-
onReorderColumns && !loading && /* @__PURE__ */
|
|
8064
|
+
/* @__PURE__ */ jsxs36(HStack10, { gap: "2", minW: "0", children: [
|
|
8065
|
+
onReorderColumns && !loading && /* @__PURE__ */ jsx50(
|
|
7613
8066
|
ColumnGrip,
|
|
7614
8067
|
{
|
|
7615
8068
|
label: reorderLabel(name, columns.findIndex((x) => x.id === c2.id) + 1, columns.length),
|
|
@@ -7622,11 +8075,11 @@ function KanbanBoard({
|
|
|
7622
8075
|
onStep: (by) => reorder(c2.id, columns.findIndex((x) => x.id === c2.id) + by)
|
|
7623
8076
|
}
|
|
7624
8077
|
),
|
|
7625
|
-
/* @__PURE__ */
|
|
7626
|
-
c2.count != null && /* @__PURE__ */
|
|
7627
|
-
c2.meta && /* @__PURE__ */
|
|
8078
|
+
/* @__PURE__ */ jsx50(Text16, { as: "span", textStyle: "label", truncate: true, display: "inline-flex", minW: "0", children: c2.title }),
|
|
8079
|
+
c2.count != null && /* @__PURE__ */ jsx50(CountBadge, { value: c2.count }),
|
|
8080
|
+
c2.meta && /* @__PURE__ */ jsx50(Text16, { textStyle: "caption", color: c2.over ? "fg.error" : "fg.muted", flexShrink: 0, children: c2.meta })
|
|
7628
8081
|
] }),
|
|
7629
|
-
!loading && /* @__PURE__ */
|
|
8082
|
+
!loading && /* @__PURE__ */ jsx50(FoldButton, { folded: false, label: foldLabel(name, false), onClick: () => fold(c2.id) })
|
|
7630
8083
|
]
|
|
7631
8084
|
}
|
|
7632
8085
|
)
|
|
@@ -7635,20 +8088,20 @@ function KanbanBoard({
|
|
|
7635
8088
|
c2.id
|
|
7636
8089
|
);
|
|
7637
8090
|
}),
|
|
7638
|
-
rows2.map((lane) => /* @__PURE__ */
|
|
8091
|
+
rows2.map((lane) => /* @__PURE__ */ jsx50(LaneRow, { lane, showTitle: !!lanes && lanes.length > 0, columns: shownColumns, span: shownColumns.length, children: shownColumns.map((c2, ci2) => {
|
|
7639
8092
|
const id = cellId(lane.id, c2.id);
|
|
7640
8093
|
const list = byCell.get(id) ?? [];
|
|
7641
8094
|
const allowed = active ? canDrop?.(active, c2.id, lane.id) !== false : true;
|
|
7642
8095
|
const last = lane.id === rows2[rows2.length - 1].id;
|
|
7643
8096
|
if (folded.has(c2.id)) {
|
|
7644
|
-
return /* @__PURE__ */
|
|
7645
|
-
lane.id === rows2[0].id && c2.count != null && /* @__PURE__ */
|
|
7646
|
-
lane.id === rows2[0].id && /* @__PURE__ */
|
|
8097
|
+
return /* @__PURE__ */ jsxs36(Cell, { id, allowed, dragging: !!active, items: [], column: c2.id, lane: lane.id, folded: true, last, children: [
|
|
8098
|
+
lane.id === rows2[0].id && c2.count != null && /* @__PURE__ */ jsx50(Box11, { alignSelf: "center", children: /* @__PURE__ */ jsx50(CountBadge, { value: c2.count }) }),
|
|
8099
|
+
lane.id === rows2[0].id && /* @__PURE__ */ jsx50(Box11, { css: { writingMode: "vertical-rl" }, alignSelf: "center", maxH: "56", overflow: "hidden", textStyle: "sm", title: c2.name, children: c2.title })
|
|
7647
8100
|
] }, id);
|
|
7648
8101
|
}
|
|
7649
8102
|
const footer = last && !loading ? columnFooter?.(c2.id) : null;
|
|
7650
|
-
return /* @__PURE__ */
|
|
7651
|
-
list.map((item) => /* @__PURE__ */
|
|
8103
|
+
return /* @__PURE__ */ jsxs36(Cell, { id, allowed, dragging: !!active, items: list.map((i) => i.id), column: c2.id, lane: lane.id, last, children: [
|
|
8104
|
+
list.map((item) => /* @__PURE__ */ jsx50(
|
|
7652
8105
|
SortableCard,
|
|
7653
8106
|
{
|
|
7654
8107
|
id: item.id,
|
|
@@ -7660,8 +8113,8 @@ function KanbanBoard({
|
|
|
7660
8113
|
item.id
|
|
7661
8114
|
)),
|
|
7662
8115
|
loading && list.length === 0 && // Not the board's cards: no data-slide, and not in its placement (ADR 0058's slides skip them).
|
|
7663
|
-
Array.from({ length: SKELETON_CARDS[ci2 % SKELETON_CARDS.length] }, (_, n) => /* @__PURE__ */
|
|
7664
|
-
!loading && list.length === 0 && empty && (typeof empty === "function" ? /* @__PURE__ */
|
|
8116
|
+
Array.from({ length: SKELETON_CARDS[ci2 % SKELETON_CARDS.length] }, (_, n) => /* @__PURE__ */ jsx50(Box11, { "aria-hidden": "true", children: skeletonCard ? skeletonCard(ci2 * 5 + n) : /* @__PURE__ */ jsx50(PlaceholderCard, { index: ci2 * 5 + n }) }, `skeleton-${n}`)),
|
|
8117
|
+
!loading && list.length === 0 && empty && (typeof empty === "function" ? /* @__PURE__ */ jsx50(EmptyState, { size: "xs", ...empty(c2.id) }) : /* @__PURE__ */ jsx50(EmptyState, { size: "xs", title: empty })),
|
|
7665
8118
|
footer
|
|
7666
8119
|
] }, id);
|
|
7667
8120
|
}) }, lane.id))
|
|
@@ -7670,23 +8123,23 @@ function KanbanBoard({
|
|
|
7670
8123
|
) })
|
|
7671
8124
|
}
|
|
7672
8125
|
),
|
|
7673
|
-
/* @__PURE__ */
|
|
8126
|
+
/* @__PURE__ */ jsx50(DragOverlay2, { dropAnimation: reduce ? null : landing, children: active ? /* @__PURE__ */ jsx50(Lifted, { carried: carried.length, reduce, count: carried.length > 1 ? carrying ? carrying(carried.length) : String(carried.length) : void 0, children: renderCard(active, { dragging: true }) }) : null })
|
|
7674
8127
|
]
|
|
7675
8128
|
}
|
|
7676
8129
|
);
|
|
7677
8130
|
}
|
|
7678
8131
|
function LaneRow({ lane, showTitle, span, children }) {
|
|
7679
|
-
return /* @__PURE__ */
|
|
7680
|
-
showTitle && /* @__PURE__ */
|
|
7681
|
-
/* @__PURE__ */
|
|
7682
|
-
lane.meta && /* @__PURE__ */
|
|
8132
|
+
return /* @__PURE__ */ jsxs36(Fragment17, { children: [
|
|
8133
|
+
showTitle && /* @__PURE__ */ jsxs36(HStack10, { gridColumn: `1 / span ${span}`, gap: "2", pt: "2", borderTopWidth: "1px", borderColor: "border.muted", "data-lane": lane.id, children: [
|
|
8134
|
+
/* @__PURE__ */ jsx50(Text16, { textStyle: "label", children: lane.title }),
|
|
8135
|
+
lane.meta && /* @__PURE__ */ jsx50(Text16, { textStyle: "caption", color: "fg.muted", children: lane.meta })
|
|
7683
8136
|
] }),
|
|
7684
8137
|
children
|
|
7685
8138
|
] });
|
|
7686
8139
|
}
|
|
7687
8140
|
function Cell({ id, items, allowed, dragging, column, lane, folded = false, last = true, children }) {
|
|
7688
8141
|
const { setNodeRef, isOver } = useDroppable2({ id, disabled: !allowed });
|
|
7689
|
-
return /* @__PURE__ */
|
|
8142
|
+
return /* @__PURE__ */ jsx50(SortableContext, { id, items, strategy: verticalListSortingStrategy, children: /* @__PURE__ */ jsx50(
|
|
7690
8143
|
Stack10,
|
|
7691
8144
|
{
|
|
7692
8145
|
ref: setNodeRef,
|
|
@@ -7715,8 +8168,8 @@ function SortableCard({
|
|
|
7715
8168
|
children
|
|
7716
8169
|
}) {
|
|
7717
8170
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = useSortable({ id, animateLayoutChanges: () => false });
|
|
7718
|
-
return /* @__PURE__ */
|
|
7719
|
-
|
|
8171
|
+
return /* @__PURE__ */ jsxs36(
|
|
8172
|
+
Box11,
|
|
7720
8173
|
{
|
|
7721
8174
|
ref: setNodeRef,
|
|
7722
8175
|
position: "relative",
|
|
@@ -7734,8 +8187,8 @@ function SortableCard({
|
|
|
7734
8187
|
cursor: "grab",
|
|
7735
8188
|
_focusVisible: { outline: "2px solid", outlineColor: "colorPalette.focusRing", rounded: "l2" },
|
|
7736
8189
|
children: [
|
|
7737
|
-
/* @__PURE__ */
|
|
7738
|
-
selected && !isDragging && !riding && /* @__PURE__ */
|
|
8190
|
+
/* @__PURE__ */ jsx50(Box11, { "data-slide": id, children: children(isDragging) }),
|
|
8191
|
+
selected && !isDragging && !riding && /* @__PURE__ */ jsx50(Mark, {})
|
|
7739
8192
|
]
|
|
7740
8193
|
}
|
|
7741
8194
|
);
|
|
@@ -7756,16 +8209,16 @@ var landing = {
|
|
|
7756
8209
|
}
|
|
7757
8210
|
};
|
|
7758
8211
|
function Lifted({ carried, count, reduce, children }) {
|
|
7759
|
-
const held =
|
|
8212
|
+
const held = useRef18(null);
|
|
7760
8213
|
const tv = useTokenVar();
|
|
7761
|
-
|
|
8214
|
+
useLayoutEffect4(() => {
|
|
7762
8215
|
if (reduce) return;
|
|
7763
8216
|
held.current?.animate?.([{ transform: "none", boxShadow: tv("shadows.sm") }, { transform: HELD, boxShadow: tv("shadows.xl") }], { duration: 160, easing: OUT2 });
|
|
7764
8217
|
}, []);
|
|
7765
8218
|
const layers = Math.min(2, Math.max(0, carried - 1));
|
|
7766
|
-
return /* @__PURE__ */
|
|
7767
|
-
Array.from({ length: layers }, (_, i) => /* @__PURE__ */
|
|
7768
|
-
|
|
8219
|
+
return /* @__PURE__ */ jsxs36(Box11, { position: "relative", cursor: "grabbing", "data-testid": "drag-preview", children: [
|
|
8220
|
+
Array.from({ length: layers }, (_, i) => /* @__PURE__ */ jsx50(
|
|
8221
|
+
Box11,
|
|
7769
8222
|
{
|
|
7770
8223
|
"data-layer": true,
|
|
7771
8224
|
position: "absolute",
|
|
@@ -7779,22 +8232,22 @@ function Lifted({ carried, count, reduce, children }) {
|
|
|
7779
8232
|
},
|
|
7780
8233
|
i
|
|
7781
8234
|
)),
|
|
7782
|
-
/* @__PURE__ */
|
|
7783
|
-
count != null && /* @__PURE__ */
|
|
8235
|
+
/* @__PURE__ */ jsx50(Box11, { ref: held, "data-held": true, rounded: "l2", shadow: reduce ? "lg" : "xl", style: { transform: reduce ? void 0 : HELD, transformOrigin: "50% 40%" }, children }),
|
|
8236
|
+
count != null && /* @__PURE__ */ jsx50(Count, { children: count })
|
|
7784
8237
|
] });
|
|
7785
8238
|
}
|
|
7786
8239
|
function Mark() {
|
|
7787
|
-
const ref =
|
|
8240
|
+
const ref = useRef18(null);
|
|
7788
8241
|
const { reduce } = useMotionSetting();
|
|
7789
|
-
|
|
8242
|
+
useLayoutEffect4(() => {
|
|
7790
8243
|
if (reduce) return;
|
|
7791
8244
|
ref.current?.animate?.([{ transform: "scale(0.4)", opacity: 0 }, { transform: "scale(1.12)", opacity: 1, offset: 0.65 }, { transform: "scale(1)", opacity: 1 }], {
|
|
7792
8245
|
duration: 220,
|
|
7793
8246
|
easing: OUT2
|
|
7794
8247
|
});
|
|
7795
8248
|
}, []);
|
|
7796
|
-
return /* @__PURE__ */
|
|
7797
|
-
|
|
8249
|
+
return /* @__PURE__ */ jsx50(
|
|
8250
|
+
chakra29.span,
|
|
7798
8251
|
{
|
|
7799
8252
|
ref,
|
|
7800
8253
|
position: "absolute",
|
|
@@ -7810,13 +8263,13 @@ function Mark() {
|
|
|
7810
8263
|
pointerEvents: "none",
|
|
7811
8264
|
"aria-hidden": "true",
|
|
7812
8265
|
_icon: { boxSize: "3" },
|
|
7813
|
-
children: /* @__PURE__ */
|
|
8266
|
+
children: /* @__PURE__ */ jsx50(Check2, { strokeWidth: 3 })
|
|
7814
8267
|
}
|
|
7815
8268
|
);
|
|
7816
8269
|
}
|
|
7817
8270
|
function Count({ children }) {
|
|
7818
|
-
return /* @__PURE__ */
|
|
7819
|
-
|
|
8271
|
+
return /* @__PURE__ */ jsx50(
|
|
8272
|
+
chakra29.span,
|
|
7820
8273
|
{
|
|
7821
8274
|
position: "absolute",
|
|
7822
8275
|
top: "-3.5",
|
|
@@ -7838,8 +8291,8 @@ function Count({ children }) {
|
|
|
7838
8291
|
);
|
|
7839
8292
|
}
|
|
7840
8293
|
function FoldButton({ folded, label, onClick }) {
|
|
7841
|
-
return /* @__PURE__ */
|
|
7842
|
-
|
|
8294
|
+
return /* @__PURE__ */ jsx50(
|
|
8295
|
+
chakra29.button,
|
|
7843
8296
|
{
|
|
7844
8297
|
type: "button",
|
|
7845
8298
|
display: "inline-flex",
|
|
@@ -7859,14 +8312,14 @@ function FoldButton({ folded, label, onClick }) {
|
|
|
7859
8312
|
title: label,
|
|
7860
8313
|
"aria-expanded": !folded,
|
|
7861
8314
|
onClick,
|
|
7862
|
-
children: /* @__PURE__ */
|
|
8315
|
+
children: /* @__PURE__ */ jsx50(DirectionalIcon, { children: folded ? /* @__PURE__ */ jsx50(ChevronsRight, { size: 16 }) : /* @__PURE__ */ jsx50(ChevronsLeft, { size: 16 }) })
|
|
7863
8316
|
}
|
|
7864
8317
|
);
|
|
7865
8318
|
}
|
|
7866
8319
|
function useFolded(key) {
|
|
7867
8320
|
const storage = key ? `board.folded.${key}` : null;
|
|
7868
|
-
const [folded, setFolded] =
|
|
7869
|
-
|
|
8321
|
+
const [folded, setFolded] = useState21(() => /* @__PURE__ */ new Set());
|
|
8322
|
+
useEffect15(() => {
|
|
7870
8323
|
if (!storage) return;
|
|
7871
8324
|
try {
|
|
7872
8325
|
const saved = JSON.parse(window.localStorage.getItem(storage) ?? "[]");
|
|
@@ -7889,8 +8342,8 @@ function useFolded(key) {
|
|
|
7889
8342
|
return [folded, fold];
|
|
7890
8343
|
}
|
|
7891
8344
|
function ColumnGrip({ label, moving, onDragStart, onDragEnd, onStep }) {
|
|
7892
|
-
return /* @__PURE__ */
|
|
7893
|
-
|
|
8345
|
+
return /* @__PURE__ */ jsx50(
|
|
8346
|
+
chakra29.button,
|
|
7894
8347
|
{
|
|
7895
8348
|
type: "button",
|
|
7896
8349
|
draggable: true,
|
|
@@ -7923,27 +8376,27 @@ function ColumnGrip({ label, moving, onDragStart, onDragEnd, onStep }) {
|
|
|
7923
8376
|
onDragStart();
|
|
7924
8377
|
},
|
|
7925
8378
|
onDragEnd,
|
|
7926
|
-
children: /* @__PURE__ */
|
|
8379
|
+
children: /* @__PURE__ */ jsx50(GripVertical4, {})
|
|
7927
8380
|
}
|
|
7928
8381
|
);
|
|
7929
8382
|
}
|
|
7930
8383
|
|
|
7931
8384
|
// src/components/LoadingState.tsx
|
|
7932
|
-
import { Box as
|
|
7933
|
-
import { jsx as
|
|
8385
|
+
import { Box as Box12, VisuallyHidden as VisuallyHidden2 } from "@chakra-ui/react";
|
|
8386
|
+
import { jsx as jsx51, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
7934
8387
|
function LoadingState({ lines = 3, label }) {
|
|
7935
8388
|
const labels = useAbpLabels();
|
|
7936
|
-
return /* @__PURE__ */
|
|
7937
|
-
/* @__PURE__ */
|
|
7938
|
-
/* @__PURE__ */
|
|
8389
|
+
return /* @__PURE__ */ jsxs37(Box12, { "aria-busy": "true", role: "status", children: [
|
|
8390
|
+
/* @__PURE__ */ jsx51(VisuallyHidden2, { children: label ?? labels.loading }),
|
|
8391
|
+
/* @__PURE__ */ jsx51(TextBone, { lines, width: "full" })
|
|
7939
8392
|
] });
|
|
7940
8393
|
}
|
|
7941
8394
|
|
|
7942
8395
|
// src/components/PageHeader.tsx
|
|
7943
8396
|
import { Fragment as Fragment18 } from "react";
|
|
7944
|
-
import { Breadcrumb, chakra as
|
|
8397
|
+
import { Breadcrumb, chakra as chakra30, Menu as Menu4, Portal as Portal13, useSlotRecipe as useSlotRecipe4 } from "@chakra-ui/react";
|
|
7945
8398
|
import { ChevronRight as ChevronRight3 } from "lucide-react";
|
|
7946
|
-
import { jsx as
|
|
8399
|
+
import { jsx as jsx52, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
7947
8400
|
var textOf = (label) => typeof label === "string" || typeof label === "number" ? String(label) : void 0;
|
|
7948
8401
|
function PageHeader({ title, description, breadcrumbs, meta, count, adornments, actions, loading: own, titleWidth = 24, documentTitle }) {
|
|
7949
8402
|
const recipe = useSlotRecipe4({ key: "abpPageHeader" });
|
|
@@ -7952,33 +8405,33 @@ function PageHeader({ title, description, breadcrumbs, meta, count, adornments,
|
|
|
7952
8405
|
usePageTitle(documentTitle !== void 0 ? documentTitle : text ? [text, where] : null);
|
|
7953
8406
|
const styles = recipe({});
|
|
7954
8407
|
const loading = useLoading(own);
|
|
7955
|
-
return /* @__PURE__ */
|
|
7956
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */
|
|
7957
|
-
/* @__PURE__ */
|
|
7958
|
-
/* @__PURE__ */
|
|
7959
|
-
count != null || adornments != null ? /* @__PURE__ */
|
|
7960
|
-
/* @__PURE__ */
|
|
7961
|
-
count != null && /* @__PURE__ */
|
|
8408
|
+
return /* @__PURE__ */ jsxs38(chakra30.div, { css: styles.root, children: [
|
|
8409
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx52(Breadcrumbs, { items: breadcrumbs }),
|
|
8410
|
+
/* @__PURE__ */ jsxs38(chakra30.div, { css: styles.row, children: [
|
|
8411
|
+
/* @__PURE__ */ jsxs38(chakra30.div, { css: styles.titleGroup, children: [
|
|
8412
|
+
count != null || adornments != null ? /* @__PURE__ */ jsxs38(chakra30.div, { display: "flex", alignItems: "center", gap: "2.5", flexWrap: "wrap", minW: "0", children: [
|
|
8413
|
+
/* @__PURE__ */ jsx52(chakra30.h1, { css: styles.title, children: loading && title == null ? /* @__PURE__ */ jsx52(TextBone, { width: titleWidth }) : title }),
|
|
8414
|
+
count != null && /* @__PURE__ */ jsx52(CountBadge, { value: count, size: "md" }),
|
|
7962
8415
|
adornments
|
|
7963
|
-
] }) : /* @__PURE__ */
|
|
7964
|
-
meta != null && /* @__PURE__ */
|
|
7965
|
-
description != null && /* @__PURE__ */
|
|
8416
|
+
] }) : /* @__PURE__ */ jsx52(chakra30.h1, { css: styles.title, children: loading && title == null ? /* @__PURE__ */ jsx52(TextBone, { width: titleWidth }) : title }),
|
|
8417
|
+
meta != null && /* @__PURE__ */ jsx52(chakra30.div, { css: styles.meta, children: meta }),
|
|
8418
|
+
description != null && /* @__PURE__ */ jsx52(chakra30.p, { css: styles.description, children: description })
|
|
7966
8419
|
] }),
|
|
7967
|
-
actions != null && /* @__PURE__ */
|
|
8420
|
+
actions != null && /* @__PURE__ */ jsx52(chakra30.div, { css: styles.actions, children: actions })
|
|
7968
8421
|
] })
|
|
7969
8422
|
] });
|
|
7970
8423
|
}
|
|
7971
8424
|
function Breadcrumbs({ items, loading: own }) {
|
|
7972
8425
|
const labels = useAbpLabels();
|
|
7973
8426
|
const loading = useLoading(own);
|
|
7974
|
-
const label = (item, i) => loading && item.label == null ? /* @__PURE__ */
|
|
8427
|
+
const label = (item, i) => loading && item.label == null ? /* @__PURE__ */ jsx52(TextBone, { width: 8 + i % 3 * 3 }) : item.label;
|
|
7975
8428
|
const Link = useLinkComponent();
|
|
7976
8429
|
const { shown, hidden } = foldBreadcrumbs(items);
|
|
7977
|
-
return /* @__PURE__ */
|
|
7978
|
-
n > 0 && /* @__PURE__ */
|
|
7979
|
-
entry == null ? /* @__PURE__ */
|
|
7980
|
-
/* @__PURE__ */
|
|
7981
|
-
|
|
8430
|
+
return /* @__PURE__ */ jsx52(Breadcrumb.Root, { "aria-label": labels.breadcrumb, children: /* @__PURE__ */ jsx52(Breadcrumb.List, { children: shown.map((entry, n) => /* @__PURE__ */ jsxs38(Fragment18, { children: [
|
|
8431
|
+
n > 0 && /* @__PURE__ */ jsx52(Breadcrumb.Separator, { children: /* @__PURE__ */ jsx52(ChevronRight3, {}) }),
|
|
8432
|
+
entry == null ? /* @__PURE__ */ jsx52(Breadcrumb.Item, { children: /* @__PURE__ */ jsxs38(Menu4.Root, { positioning: { placement: "bottom-start" }, children: [
|
|
8433
|
+
/* @__PURE__ */ jsx52(Menu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsx52(
|
|
8434
|
+
chakra30.button,
|
|
7982
8435
|
{
|
|
7983
8436
|
type: "button",
|
|
7984
8437
|
px: "1",
|
|
@@ -7992,19 +8445,19 @@ function Breadcrumbs({ items, loading: own }) {
|
|
|
7992
8445
|
children: "\u2026"
|
|
7993
8446
|
}
|
|
7994
8447
|
) }),
|
|
7995
|
-
/* @__PURE__ */
|
|
7996
|
-
] }) }) : /* @__PURE__ */
|
|
8448
|
+
/* @__PURE__ */ jsx52(Portal13, { children: /* @__PURE__ */ jsx52(Menu4.Positioner, { children: /* @__PURE__ */ jsx52(Menu4.Content, { minW: "40", children: hidden.map((h, k) => /* @__PURE__ */ jsx52(Menu4.Item, { value: String(k), asChild: Boolean(h.href), children: h.href ? /* @__PURE__ */ jsx52(Link, { href: h.href, children: h.label }) : /* @__PURE__ */ jsx52("span", { children: h.label }) }, k)) }) }) })
|
|
8449
|
+
] }) }) : /* @__PURE__ */ jsx52(Breadcrumb.Item, { children: entry.item.href && entry.index < items.length - 1 ? /* @__PURE__ */ jsx52(Breadcrumb.Link, { asChild: true, children: /* @__PURE__ */ jsx52(Link, { href: entry.item.href, children: label(entry.item, entry.index) }) }) : /* @__PURE__ */ jsx52(Breadcrumb.CurrentLink, { children: label(entry.item, entry.index) }) })
|
|
7997
8450
|
] }, entry ? entry.index : "more")) }) });
|
|
7998
8451
|
}
|
|
7999
8452
|
|
|
8000
8453
|
// src/components/Panel.tsx
|
|
8001
|
-
import { createContext as createContext11, forwardRef as forwardRef8, useContext as useContext11, useId as useId7, useState as
|
|
8002
|
-
import { chakra as
|
|
8454
|
+
import { createContext as createContext11, forwardRef as forwardRef8, useContext as useContext11, useId as useId7, useState as useState22 } from "react";
|
|
8455
|
+
import { chakra as chakra31, useSlotRecipe as useSlotRecipe5 } from "@chakra-ui/react";
|
|
8003
8456
|
import { ChevronRight as ChevronRight4 } from "lucide-react";
|
|
8004
|
-
import { Fragment as Fragment19, jsx as
|
|
8457
|
+
import { Fragment as Fragment19, jsx as jsx53, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
8005
8458
|
var ToneContext = createContext11("card");
|
|
8006
8459
|
function PanelTone({ tone, children }) {
|
|
8007
|
-
return /* @__PURE__ */
|
|
8460
|
+
return /* @__PURE__ */ jsx53(ToneContext.Provider, { value: tone, children });
|
|
8008
8461
|
}
|
|
8009
8462
|
var Panel = forwardRef8(function Panel2({
|
|
8010
8463
|
title,
|
|
@@ -8026,7 +8479,7 @@ var Panel = forwardRef8(function Panel2({
|
|
|
8026
8479
|
}, ref) {
|
|
8027
8480
|
const recipe = useSlotRecipe5({ key: "abpPanel" });
|
|
8028
8481
|
const inherited = useContext11(ToneContext);
|
|
8029
|
-
const [ownCollapsed, setOwnCollapsed] =
|
|
8482
|
+
const [ownCollapsed, setOwnCollapsed] = useState22(defaultCollapsed);
|
|
8030
8483
|
const folded = collapsible && (collapsedProp ?? ownCollapsed);
|
|
8031
8484
|
const styles = recipe({ flush, tone: tone ?? inherited, collapsed: folded });
|
|
8032
8485
|
const bodyId = useId7();
|
|
@@ -8036,64 +8489,64 @@ var Panel = forwardRef8(function Panel2({
|
|
|
8036
8489
|
if (collapsedProp === void 0) setOwnCollapsed(next);
|
|
8037
8490
|
onCollapsedChange?.(next);
|
|
8038
8491
|
};
|
|
8039
|
-
const heading = /* @__PURE__ */
|
|
8040
|
-
title != null && /* @__PURE__ */
|
|
8041
|
-
description != null && !folded && /* @__PURE__ */
|
|
8492
|
+
const heading = /* @__PURE__ */ jsxs39(chakra31.div, { css: styles.titleGroup, children: [
|
|
8493
|
+
title != null && /* @__PURE__ */ jsx53(chakra31.h2, { as: headingAs, css: styles.title, children: title }),
|
|
8494
|
+
description != null && !folded && /* @__PURE__ */ jsx53(chakra31.p, { css: styles.description, children: description })
|
|
8042
8495
|
] });
|
|
8043
|
-
const content = /* @__PURE__ */
|
|
8044
|
-
/* @__PURE__ */
|
|
8045
|
-
footer != null && /* @__PURE__ */
|
|
8496
|
+
const content = /* @__PURE__ */ jsxs39(Fragment19, { children: [
|
|
8497
|
+
/* @__PURE__ */ jsx53(chakra31.div, { css: styles.body, children: loading === void 0 ? children : /* @__PURE__ */ jsx53(Loading, { when: loading, children }) }),
|
|
8498
|
+
footer != null && /* @__PURE__ */ jsx53(chakra31.footer, { css: styles.footer, children: footer })
|
|
8046
8499
|
] });
|
|
8047
|
-
return /* @__PURE__ */
|
|
8048
|
-
hasHeader && /* @__PURE__ */
|
|
8049
|
-
collapsible ? /* @__PURE__ */
|
|
8050
|
-
/* @__PURE__ */
|
|
8500
|
+
return /* @__PURE__ */ jsxs39(chakra31.section, { ref, css: [styles.root, css], "data-collapsed": folded ? "" : void 0, ...rest, children: [
|
|
8501
|
+
hasHeader && /* @__PURE__ */ jsxs39(chakra31.header, { css: styles.header, children: [
|
|
8502
|
+
collapsible ? /* @__PURE__ */ jsxs39(chakra31.button, { type: "button", css: styles.toggle, "aria-expanded": !folded, "aria-controls": bodyId, onClick: toggle, children: [
|
|
8503
|
+
/* @__PURE__ */ jsx53(chakra31.span, { css: styles.chevron, "data-open": folded ? void 0 : "", "aria-hidden": true, children: /* @__PURE__ */ jsx53(ChevronRight4, { size: 16 }) }),
|
|
8051
8504
|
heading,
|
|
8052
|
-
folded && summary != null && /* @__PURE__ */
|
|
8505
|
+
folded && summary != null && /* @__PURE__ */ jsx53(chakra31.span, { css: styles.summary, children: summary })
|
|
8053
8506
|
] }) : heading,
|
|
8054
|
-
actions != null && /* @__PURE__ */
|
|
8507
|
+
actions != null && /* @__PURE__ */ jsx53(chakra31.div, { css: styles.actions, children: actions })
|
|
8055
8508
|
] }),
|
|
8056
|
-
collapsible ? /* @__PURE__ */
|
|
8509
|
+
collapsible ? /* @__PURE__ */ jsx53(Collapse, { open: !folded, id: bodyId, display: "flex", flexDirection: "column", flex: "1", minW: "0", children: content }) : content
|
|
8057
8510
|
] });
|
|
8058
8511
|
});
|
|
8059
8512
|
|
|
8060
8513
|
// src/components/PathChips.tsx
|
|
8061
|
-
import { chakra as
|
|
8514
|
+
import { chakra as chakra32, useSlotRecipe as useSlotRecipe6 } from "@chakra-ui/react";
|
|
8062
8515
|
import { ChevronRight as ChevronRight5 } from "lucide-react";
|
|
8063
|
-
import { jsx as
|
|
8516
|
+
import { jsx as jsx54, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
8064
8517
|
function PathChips({ path, highlightLast = true, loading: own, skeletonCount = 3, css, ...rest }) {
|
|
8065
8518
|
const labels = useAbpLabels();
|
|
8066
8519
|
const recipe = useSlotRecipe6({ key: "abpPathChips" });
|
|
8067
8520
|
const styles = recipe({});
|
|
8068
8521
|
const loading = useLoading(own) && path.length === 0;
|
|
8069
8522
|
const segments = loading ? Array.from({ length: skeletonCount }, (_, i) => "\xA0".repeat(boneWidth(i, 6, 12))) : path;
|
|
8070
|
-
return /* @__PURE__ */
|
|
8071
|
-
i > 0 && /* @__PURE__ */
|
|
8072
|
-
/* @__PURE__ */
|
|
8523
|
+
return /* @__PURE__ */ jsx54(chakra32.ol, { "aria-label": rest["aria-label"] ?? labels.path, "aria-hidden": loading || void 0, css: [styles.root, css], ...rest, children: segments.map((segment, i) => /* @__PURE__ */ jsxs40(chakra32.li, { css: styles.item, children: [
|
|
8524
|
+
i > 0 && /* @__PURE__ */ jsx54(chakra32.span, { css: styles.separator, "aria-hidden": "true", children: /* @__PURE__ */ jsx54(ChevronRight5, {}) }),
|
|
8525
|
+
/* @__PURE__ */ jsx54(chakra32.span, { css: loading ? [styles.chip, ghostCss] : styles.chip, "aria-current": !loading && highlightLast && i === path.length - 1 ? true : void 0, children: segment })
|
|
8073
8526
|
] }, `${i}:${segment}`)) });
|
|
8074
8527
|
}
|
|
8075
8528
|
|
|
8076
8529
|
// src/components/PropertyList.tsx
|
|
8077
|
-
import { chakra as
|
|
8078
|
-
import { jsx as
|
|
8530
|
+
import { chakra as chakra33, DataList } from "@chakra-ui/react";
|
|
8531
|
+
import { jsx as jsx55, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
8079
8532
|
function PropertyList({ items, size = "md", loading: own }) {
|
|
8080
8533
|
const loading = useLoading(own);
|
|
8081
8534
|
const arriving = useArriving(loading);
|
|
8082
|
-
return /* @__PURE__ */
|
|
8083
|
-
/* @__PURE__ */
|
|
8084
|
-
/* @__PURE__ */
|
|
8535
|
+
return /* @__PURE__ */ jsx55(DataList.Root, { orientation: "horizontal", size, children: items.map((item, i) => /* @__PURE__ */ jsxs41(DataList.Item, { children: [
|
|
8536
|
+
/* @__PURE__ */ jsx55(DataList.ItemLabel, { children: item.label }),
|
|
8537
|
+
/* @__PURE__ */ jsx55(DataList.ItemValue, { children: loading && item.value == null ? /* @__PURE__ */ jsx55(TextBone, { width: item.skeletonWidth ?? boneWidth(i, 8, 16) }) : arriving ? /* @__PURE__ */ jsx55(chakra33.span, { css: arriveCss, children: item.value }) : item.value })
|
|
8085
8538
|
] }, item.id ?? i)) });
|
|
8086
8539
|
}
|
|
8087
8540
|
|
|
8088
8541
|
// src/components/QueryableList.tsx
|
|
8089
|
-
import { useEffect as
|
|
8542
|
+
import { useEffect as useEffect18, useId as useId9, useMemo as useMemo14, useRef as useRef20, useState as useState25 } from "react";
|
|
8090
8543
|
import { createPortal } from "react-dom";
|
|
8091
|
-
import { Box as
|
|
8544
|
+
import { Box as Box13, chakra as chakra36, HStack as HStack13, Input as Input7, Menu as Menu5, Portal as Portal17, Stack as Stack14, Text as Text20 } from "@chakra-ui/react";
|
|
8092
8545
|
import { ArrowDownWideNarrow, ArrowUpNarrowWide, ChevronDown as ChevronDown3, Download, Filter, Rows3, Save, Trash2 as Trash22, X as X2 } from "lucide-react";
|
|
8093
8546
|
|
|
8094
8547
|
// src/components/query/ColumnsPopover.tsx
|
|
8095
|
-
import { useMemo as
|
|
8096
|
-
import { chakra as
|
|
8548
|
+
import { useMemo as useMemo12 } from "react";
|
|
8549
|
+
import { chakra as chakra34, HStack as HStack11, Popover as Popover3, Portal as Portal14, Stack as Stack11, Switch as Switch2, Text as Text17 } from "@chakra-ui/react";
|
|
8097
8550
|
import {
|
|
8098
8551
|
closestCenter,
|
|
8099
8552
|
DndContext as DndContext3,
|
|
@@ -8104,14 +8557,14 @@ import {
|
|
|
8104
8557
|
} from "@dnd-kit/core";
|
|
8105
8558
|
import { arrayMove, SortableContext as SortableContext2, sortableKeyboardCoordinates as sortableKeyboardCoordinates2, useSortable as useSortable2, verticalListSortingStrategy as verticalListSortingStrategy2 } from "@dnd-kit/sortable";
|
|
8106
8559
|
import { CSS as CSS3 } from "@dnd-kit/utilities";
|
|
8107
|
-
import { Columns3, GripVertical as
|
|
8108
|
-
import { jsx as
|
|
8560
|
+
import { Columns3, GripVertical as GripVertical5 } from "lucide-react";
|
|
8561
|
+
import { jsx as jsx56, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
8109
8562
|
function fill2(template, values) {
|
|
8110
8563
|
return template.replace(/\{(\w+)\}/g, (_, k) => values[k] ?? `{${k}}`);
|
|
8111
8564
|
}
|
|
8112
8565
|
function ColumnsPopover({ fields, columns, onChange }) {
|
|
8113
8566
|
const labels = useAbpLabels().queryList;
|
|
8114
|
-
const byId =
|
|
8567
|
+
const byId = useMemo12(() => new Map(fields.map((f) => [f.id, f])), [fields]);
|
|
8115
8568
|
const shown = columns.filter((c2) => byId.has(c2));
|
|
8116
8569
|
const hidden = fields.filter((f) => !columns.includes(f.id));
|
|
8117
8570
|
const sensors = useSensors3(useSensor3(PointerSensor3, { activationConstraint: { distance: 4 } }), useSensor3(KeyboardSensor2, { coordinateGetter: sortableKeyboardCoordinates2 }));
|
|
@@ -8122,19 +8575,19 @@ function ColumnsPopover({ fields, columns, onChange }) {
|
|
|
8122
8575
|
if (from < 0 || to < 0) return;
|
|
8123
8576
|
onChange(arrayMove(columns, from, to));
|
|
8124
8577
|
}
|
|
8125
|
-
return /* @__PURE__ */
|
|
8126
|
-
/* @__PURE__ */
|
|
8127
|
-
/* @__PURE__ */
|
|
8578
|
+
return /* @__PURE__ */ jsxs42(Popover3.Root, { positioning: { placement: "bottom-end" }, lazyMount: true, unmountOnExit: true, children: [
|
|
8579
|
+
/* @__PURE__ */ jsx56(Popover3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs42(Button, { size: "sm", variant: "secondary", disabled: fields.length === 0, children: [
|
|
8580
|
+
/* @__PURE__ */ jsx56(Columns3, {}),
|
|
8128
8581
|
labels.columns
|
|
8129
8582
|
] }) }),
|
|
8130
|
-
/* @__PURE__ */
|
|
8131
|
-
/* @__PURE__ */
|
|
8132
|
-
/* @__PURE__ */
|
|
8133
|
-
/* @__PURE__ */
|
|
8583
|
+
/* @__PURE__ */ jsx56(Portal14, { children: /* @__PURE__ */ jsx56(Popover3.Positioner, { children: /* @__PURE__ */ jsx56(Popover3.Content, { w: "80", maxW: "calc(100vw - 2rem)", children: /* @__PURE__ */ jsxs42(Popover3.Body, { p: "0", children: [
|
|
8584
|
+
/* @__PURE__ */ jsxs42(HStack11, { justify: "space-between", px: "3.5", pt: "3", pb: "1", children: [
|
|
8585
|
+
/* @__PURE__ */ jsx56(Text17, { textStyle: "sm", fontWeight: "semibold", children: labels.visibleColumns }),
|
|
8586
|
+
/* @__PURE__ */ jsx56(Button, { size: "xs", variant: "ghost", disabled: hidden.length === 0, onClick: () => onChange([...columns, ...hidden.map((f) => f.id)]), children: labels.showAllColumns })
|
|
8134
8587
|
] }),
|
|
8135
|
-
/* @__PURE__ */
|
|
8136
|
-
/* @__PURE__ */
|
|
8137
|
-
/* @__PURE__ */
|
|
8588
|
+
/* @__PURE__ */ jsx56(Text17, { textStyle: "caption", color: "fg.muted", px: "3.5", pb: "2", children: labels.columnsHint }),
|
|
8589
|
+
/* @__PURE__ */ jsxs42(chakra34.div, { maxH: "80", overflowY: "auto", pb: "2", children: [
|
|
8590
|
+
/* @__PURE__ */ jsx56(DndContext3, { sensors, collisionDetection: closestCenter, onDragEnd, children: /* @__PURE__ */ jsx56(SortableContext2, { items: shown, strategy: verticalListSortingStrategy2, children: /* @__PURE__ */ jsx56(Stack11, { gap: "0", role: "list", "aria-label": labels.visibleColumns, children: shown.map((id) => /* @__PURE__ */ jsx56(
|
|
8138
8591
|
ColumnRow,
|
|
8139
8592
|
{
|
|
8140
8593
|
id,
|
|
@@ -8145,7 +8598,7 @@ function ColumnsPopover({ fields, columns, onChange }) {
|
|
|
8145
8598
|
},
|
|
8146
8599
|
id
|
|
8147
8600
|
)) }) }) }),
|
|
8148
|
-
hidden.length > 0 && /* @__PURE__ */
|
|
8601
|
+
hidden.length > 0 && /* @__PURE__ */ jsx56(Stack11, { gap: "0", borderTopWidth: "1px", borderColor: "border.muted", mt: "1", pt: "1", role: "list", "aria-label": labels.hiddenColumns, children: hidden.map((f) => /* @__PURE__ */ jsx56(ColumnRow, { id: f.id, label: f.label, checked: false, onCheckedChange: () => onChange([...columns, f.id]) }, f.id)) })
|
|
8149
8602
|
] })
|
|
8150
8603
|
] }) }) }) })
|
|
8151
8604
|
] });
|
|
@@ -8154,8 +8607,8 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
8154
8607
|
const labels = useAbpLabels().queryList;
|
|
8155
8608
|
const sortable = useSortable2({ id, disabled: !checked });
|
|
8156
8609
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = sortable;
|
|
8157
|
-
return /* @__PURE__ */
|
|
8158
|
-
|
|
8610
|
+
return /* @__PURE__ */ jsxs42(
|
|
8611
|
+
HStack11,
|
|
8159
8612
|
{
|
|
8160
8613
|
ref: setNodeRef,
|
|
8161
8614
|
role: "listitem",
|
|
@@ -8171,8 +8624,8 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
8171
8624
|
style: { transform: CSS3.Transform.toString(transform), transition },
|
|
8172
8625
|
_hover: { bg: "bg.subtle" },
|
|
8173
8626
|
children: [
|
|
8174
|
-
checked ? /* @__PURE__ */
|
|
8175
|
-
|
|
8627
|
+
checked ? /* @__PURE__ */ jsx56(
|
|
8628
|
+
chakra34.button,
|
|
8176
8629
|
{
|
|
8177
8630
|
type: "button",
|
|
8178
8631
|
display: "inline-flex",
|
|
@@ -8184,13 +8637,13 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
8184
8637
|
"aria-label": fill2(labels.dragColumn, { field: label }),
|
|
8185
8638
|
...attributes,
|
|
8186
8639
|
...listeners2,
|
|
8187
|
-
children: /* @__PURE__ */
|
|
8640
|
+
children: /* @__PURE__ */ jsx56(GripVertical5, { size: 16 })
|
|
8188
8641
|
}
|
|
8189
|
-
) : /* @__PURE__ */
|
|
8190
|
-
/* @__PURE__ */
|
|
8191
|
-
/* @__PURE__ */
|
|
8192
|
-
/* @__PURE__ */
|
|
8193
|
-
/* @__PURE__ */
|
|
8642
|
+
) : /* @__PURE__ */ jsx56(chakra34.span, { w: "4", flexShrink: 0 }),
|
|
8643
|
+
/* @__PURE__ */ jsx56(Text17, { as: "span", flex: "1", textStyle: "sm", truncate: true, color: checked ? "fg" : "fg.muted", children: label }),
|
|
8644
|
+
/* @__PURE__ */ jsxs42(Switch2.Root, { size: "sm", colorPalette: "accent", checked, disabled, onCheckedChange, "aria-label": label, children: [
|
|
8645
|
+
/* @__PURE__ */ jsx56(Switch2.HiddenInput, {}),
|
|
8646
|
+
/* @__PURE__ */ jsx56(Switch2.Control, { children: /* @__PURE__ */ jsx56(Switch2.Thumb, {}) })
|
|
8194
8647
|
] })
|
|
8195
8648
|
]
|
|
8196
8649
|
}
|
|
@@ -8198,10 +8651,10 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
8198
8651
|
}
|
|
8199
8652
|
|
|
8200
8653
|
// src/components/query/FilterBuilder.tsx
|
|
8201
|
-
import { useEffect as
|
|
8202
|
-
import { CloseButton as CloseButton3, Dialog as Dialog5, HStack as
|
|
8654
|
+
import { useEffect as useEffect16, useId as useId8, useRef as useRef19, useState as useState23 } from "react";
|
|
8655
|
+
import { CloseButton as CloseButton3, Dialog as Dialog5, HStack as HStack12, Input as Input6, Portal as Portal15, Stack as Stack12, Text as Text18 } from "@chakra-ui/react";
|
|
8203
8656
|
import { Trash2 } from "lucide-react";
|
|
8204
|
-
import { Fragment as Fragment20, jsx as
|
|
8657
|
+
import { Fragment as Fragment20, jsx as jsx57, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
8205
8658
|
function fill3(template, values) {
|
|
8206
8659
|
return template.replace(/\{(\w+)\}/g, (_, k) => String(values[k] ?? `{${k}}`));
|
|
8207
8660
|
}
|
|
@@ -8214,9 +8667,9 @@ function conditionOf(d, field, own) {
|
|
|
8214
8667
|
}
|
|
8215
8668
|
function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, countMatches, onApply, onClose }) {
|
|
8216
8669
|
const labels = useAbpLabels().queryList;
|
|
8217
|
-
const [seq, setSeq] =
|
|
8218
|
-
const [rows2, setRows] =
|
|
8219
|
-
const [touched, setTouched] =
|
|
8670
|
+
const [seq, setSeq] = useState23(initial.length + 1);
|
|
8671
|
+
const [rows2, setRows] = useState23(() => initial.flatMap((c2, i) => c2.op === "in" && Array.isArray(c2.value) && fields.find((f) => f.id === c2.field)?.operators.includes("eq") ? c2.value.map((v, j) => ({ id: i * 100 + j + 1, field: c2.field, op: "eq", text: valueText(v), chosen: v })) : [{ id: i * 100 + 1, field: c2.field, op: c2.op, text: valueText(c2.value), chosen: c2.value }]));
|
|
8672
|
+
const [touched, setTouched] = useState23(false);
|
|
8220
8673
|
const own = (d) => {
|
|
8221
8674
|
const f = fields.find((x) => x.id === d.field);
|
|
8222
8675
|
return Boolean(f && renderValueEditor && !NO_VALUE_OPS.has(d.op) && renderValueEditor({ field: f, op: d.op, value: d.chosen, onChange: () => void 0 }) != null);
|
|
@@ -8225,14 +8678,14 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8225
8678
|
const incomplete = rows2.length - complete.length;
|
|
8226
8679
|
const repeats = new Set(rows2.map((r) => r.field)).size < rows2.length;
|
|
8227
8680
|
const key = JSON.stringify(complete);
|
|
8228
|
-
const counter =
|
|
8229
|
-
|
|
8681
|
+
const counter = useRef19(countMatches);
|
|
8682
|
+
useEffect16(() => {
|
|
8230
8683
|
counter.current = countMatches;
|
|
8231
8684
|
});
|
|
8232
8685
|
const counts = Boolean(countMatches);
|
|
8233
|
-
const [count, setCount] =
|
|
8234
|
-
const [total, setTotal] =
|
|
8235
|
-
|
|
8686
|
+
const [count, setCount] = useState23(null);
|
|
8687
|
+
const [total, setTotal] = useState23(null);
|
|
8688
|
+
useEffect16(() => {
|
|
8236
8689
|
if (!counts) return;
|
|
8237
8690
|
let gone = false;
|
|
8238
8691
|
counter.current?.([]).then((n) => !gone && setTotal(n), () => void 0);
|
|
@@ -8240,7 +8693,7 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8240
8693
|
gone = true;
|
|
8241
8694
|
};
|
|
8242
8695
|
}, [counts]);
|
|
8243
|
-
|
|
8696
|
+
useEffect16(() => {
|
|
8244
8697
|
if (!counts) return;
|
|
8245
8698
|
let gone = false;
|
|
8246
8699
|
const timer = setTimeout(() => {
|
|
@@ -8257,23 +8710,23 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8257
8710
|
setSeq((n) => n + 1);
|
|
8258
8711
|
};
|
|
8259
8712
|
const change = (id, patch) => setRows((r) => r.map((d) => d.id === id ? { ...d, ...patch, dirty: true } : d));
|
|
8260
|
-
return /* @__PURE__ */
|
|
8261
|
-
/* @__PURE__ */
|
|
8262
|
-
/* @__PURE__ */
|
|
8263
|
-
/* @__PURE__ */
|
|
8264
|
-
/* @__PURE__ */
|
|
8265
|
-
/* @__PURE__ */
|
|
8713
|
+
return /* @__PURE__ */ jsx57(Dialog5.Root, { open: true, onOpenChange: (e) => !e.open && onClose(), size: "lg", placement: "center", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs43(Portal15, { children: [
|
|
8714
|
+
/* @__PURE__ */ jsx57(Dialog5.Backdrop, {}),
|
|
8715
|
+
/* @__PURE__ */ jsx57(Dialog5.Positioner, { children: /* @__PURE__ */ jsxs43(Dialog5.Content, { "data-filter-builder": "", children: [
|
|
8716
|
+
/* @__PURE__ */ jsx57(Dialog5.Header, { children: /* @__PURE__ */ jsxs43(HStack12, { justify: "space-between", w: "full", gap: "3", children: [
|
|
8717
|
+
/* @__PURE__ */ jsx57(Dialog5.Title, { children: labels.buildFilters }),
|
|
8718
|
+
/* @__PURE__ */ jsx57(Button, { size: "xs", variant: "ghost", onClick: () => setRows([]), disabled: rows2.length === 0, children: labels.clearAll })
|
|
8266
8719
|
] }) }),
|
|
8267
|
-
/* @__PURE__ */
|
|
8268
|
-
/* @__PURE__ */
|
|
8720
|
+
/* @__PURE__ */ jsx57(Dialog5.Body, { children: /* @__PURE__ */ jsxs43(Stack12, { gap: "3", children: [
|
|
8721
|
+
/* @__PURE__ */ jsxs43(Text18, { textStyle: "sm", color: "fg.muted", children: [
|
|
8269
8722
|
labels.matchAll,
|
|
8270
|
-
repeats && /* @__PURE__ */
|
|
8723
|
+
repeats && /* @__PURE__ */ jsxs43(Fragment20, { children: [
|
|
8271
8724
|
" ",
|
|
8272
8725
|
labels.sameFieldAny
|
|
8273
8726
|
] })
|
|
8274
8727
|
] }),
|
|
8275
|
-
rows2.length === 0 && /* @__PURE__ */
|
|
8276
|
-
rows2.map((d) => /* @__PURE__ */
|
|
8728
|
+
rows2.length === 0 && /* @__PURE__ */ jsx57(Text18, { textStyle: "sm", color: "fg.muted", py: "2", children: labels.noConditions }),
|
|
8729
|
+
rows2.map((d) => /* @__PURE__ */ jsx57(
|
|
8277
8730
|
ConditionRow,
|
|
8278
8731
|
{
|
|
8279
8732
|
draft: d,
|
|
@@ -8286,29 +8739,29 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8286
8739
|
},
|
|
8287
8740
|
d.id
|
|
8288
8741
|
)),
|
|
8289
|
-
/* @__PURE__ */
|
|
8290
|
-
/* @__PURE__ */
|
|
8291
|
-
/* @__PURE__ */
|
|
8292
|
-
/* @__PURE__ */
|
|
8742
|
+
/* @__PURE__ */ jsx57(HStack12, { children: /* @__PURE__ */ jsx57(AddButton, { onClick: add, disabled: fields.length === 0, children: labels.addCondition }) }),
|
|
8743
|
+
/* @__PURE__ */ jsxs43(Stack12, { gap: "1", borderTopWidth: "1px", borderColor: "border.muted", pt: "3", children: [
|
|
8744
|
+
/* @__PURE__ */ jsx57(Text18, { textStyle: "xs", fontWeight: "bold", color: "fg.muted", children: labels.activeFilters }),
|
|
8745
|
+
/* @__PURE__ */ jsx57(Text18, { textStyle: "sm", "data-active-filters": "", children: complete.length === 0 ? labels.noneActive : complete.map((c2) => describe(c2, fields, labels)).join(" \xB7 ") })
|
|
8293
8746
|
] })
|
|
8294
8747
|
] }) }),
|
|
8295
|
-
/* @__PURE__ */
|
|
8296
|
-
/* @__PURE__ */
|
|
8748
|
+
/* @__PURE__ */ jsx57(Dialog5.Footer, { children: /* @__PURE__ */ jsxs43(HStack12, { justify: "space-between", w: "full", wrap: "wrap", gap: "2", children: [
|
|
8749
|
+
/* @__PURE__ */ jsxs43(Text18, { textStyle: "sm", color: "fg.muted", "aria-live": "polite", "data-filter-count": "", children: [
|
|
8297
8750
|
count != null && fill3(total != null ? labels.matchCount : labels.matchCountOnly, { count, total: total ?? "" }),
|
|
8298
|
-
incomplete > 0 && /* @__PURE__ */
|
|
8751
|
+
incomplete > 0 && /* @__PURE__ */ jsxs43(Fragment20, { children: [
|
|
8299
8752
|
" \xB7 ",
|
|
8300
8753
|
labels.incompleteSkipped
|
|
8301
8754
|
] })
|
|
8302
8755
|
] }),
|
|
8303
|
-
/* @__PURE__ */
|
|
8304
|
-
/* @__PURE__ */
|
|
8305
|
-
/* @__PURE__ */
|
|
8756
|
+
/* @__PURE__ */ jsxs43(HStack12, { gap: "2", children: [
|
|
8757
|
+
/* @__PURE__ */ jsx57(Button, { size: "sm", variant: "ghost", onClick: onClose, children: labels.cancel }),
|
|
8758
|
+
/* @__PURE__ */ jsx57(Button, { size: "sm", variant: "primary", onClick: () => {
|
|
8306
8759
|
setTouched(true);
|
|
8307
8760
|
onApply(mergeSameField(complete, fields));
|
|
8308
8761
|
}, children: labels.applyFilters })
|
|
8309
8762
|
] })
|
|
8310
8763
|
] }) }),
|
|
8311
|
-
/* @__PURE__ */
|
|
8764
|
+
/* @__PURE__ */ jsx57(Dialog5.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx57(CloseButton3, { size: "sm" }) })
|
|
8312
8765
|
] }) })
|
|
8313
8766
|
] }) });
|
|
8314
8767
|
}
|
|
@@ -8322,9 +8775,9 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8322
8775
|
const listId = useId8();
|
|
8323
8776
|
const field = fields.find((f) => f.id === draft.field);
|
|
8324
8777
|
const { op, text } = draft;
|
|
8325
|
-
const [options, setOptions] =
|
|
8778
|
+
const [options, setOptions] = useState23([]);
|
|
8326
8779
|
const own = field && renderValueEditor && !NO_VALUE_OPS.has(op) ? renderValueEditor({ field, op, value: draft.chosen, onChange: (v) => onChange({ chosen: v }) }) : null;
|
|
8327
|
-
|
|
8780
|
+
useEffect16(() => {
|
|
8328
8781
|
if (!suggest || !field || NO_VALUE_OPS.has(op) || own != null) return;
|
|
8329
8782
|
const typed = LIST_OPS.has(op) ? (text.split(",").pop() ?? "").trim() : text;
|
|
8330
8783
|
const prefix = `"${field.id}" = `;
|
|
@@ -8337,9 +8790,9 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8337
8790
|
clearTimeout(timer);
|
|
8338
8791
|
};
|
|
8339
8792
|
}, [suggest, field, op, text, own]);
|
|
8340
|
-
return /* @__PURE__ */
|
|
8341
|
-
/* @__PURE__ */
|
|
8342
|
-
/* @__PURE__ */
|
|
8793
|
+
return /* @__PURE__ */ jsxs43(Stack12, { gap: "1", "data-condition": "", children: [
|
|
8794
|
+
/* @__PURE__ */ jsxs43(HStack12, { gap: "1.5", wrap: "wrap", align: "start", children: [
|
|
8795
|
+
/* @__PURE__ */ jsx57(
|
|
8343
8796
|
SelectField,
|
|
8344
8797
|
{
|
|
8345
8798
|
width: "auto",
|
|
@@ -8353,7 +8806,7 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8353
8806
|
options: fields.map((f) => ({ value: f.id, label: f.label }))
|
|
8354
8807
|
}
|
|
8355
8808
|
),
|
|
8356
|
-
/* @__PURE__ */
|
|
8809
|
+
/* @__PURE__ */ jsx57(
|
|
8357
8810
|
SelectField,
|
|
8358
8811
|
{
|
|
8359
8812
|
width: "auto",
|
|
@@ -8365,8 +8818,8 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8365
8818
|
}
|
|
8366
8819
|
),
|
|
8367
8820
|
own,
|
|
8368
|
-
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */
|
|
8369
|
-
/* @__PURE__ */
|
|
8821
|
+
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */ jsxs43(Fragment20, { children: [
|
|
8822
|
+
/* @__PURE__ */ jsx57(
|
|
8370
8823
|
Input6,
|
|
8371
8824
|
{
|
|
8372
8825
|
size: "sm",
|
|
@@ -8380,17 +8833,17 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8380
8833
|
onChange: (e) => onChange({ text: e.target.value })
|
|
8381
8834
|
}
|
|
8382
8835
|
),
|
|
8383
|
-
/* @__PURE__ */
|
|
8836
|
+
/* @__PURE__ */ jsx57("datalist", { id: listId, children: options.filter((o) => o.kind !== "keyword").map((o) => /* @__PURE__ */ jsx57("option", { value: o.text.replace(/^"|"$/g, ""), children: o.label }, o.text)) })
|
|
8384
8837
|
] }),
|
|
8385
|
-
/* @__PURE__ */
|
|
8838
|
+
/* @__PURE__ */ jsx57(IconButton, { size: "sm", variant: "ghost", remove: true, "aria-label": fill3(labels.removeFilter, { field: field?.label ?? draft.field }), onClick: onRemove, children: /* @__PURE__ */ jsx57(Trash2, {}) })
|
|
8386
8839
|
] }),
|
|
8387
|
-
warn && /* @__PURE__ */
|
|
8840
|
+
warn && /* @__PURE__ */ jsx57(Text18, { textStyle: "xs", color: "fg.error", children: labels.incomplete })
|
|
8388
8841
|
] });
|
|
8389
8842
|
}
|
|
8390
8843
|
|
|
8391
8844
|
// src/components/query/ExportDialog.tsx
|
|
8392
|
-
import { useEffect as
|
|
8393
|
-
import { chakra as
|
|
8845
|
+
import { useEffect as useEffect17, useMemo as useMemo13, useState as useState24 } from "react";
|
|
8846
|
+
import { chakra as chakra35, CloseButton as CloseButton4, Dialog as Dialog6, Portal as Portal16, Stack as Stack13, Text as Text19 } from "@chakra-ui/react";
|
|
8394
8847
|
|
|
8395
8848
|
// src/components/query/exportText.ts
|
|
8396
8849
|
function exportText(value) {
|
|
@@ -8408,22 +8861,22 @@ function csvField(text, separator) {
|
|
|
8408
8861
|
}
|
|
8409
8862
|
|
|
8410
8863
|
// src/components/query/ExportDialog.tsx
|
|
8411
|
-
import { jsx as
|
|
8864
|
+
import { jsx as jsx58, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
8412
8865
|
var SEPARATORS = { comma: ",", semicolon: ";", tab: " " };
|
|
8413
8866
|
function ExportDialog({ format, onClose, fields, shown, columnLabels, found, filtered, sample, onExport }) {
|
|
8414
8867
|
const labels = useAbpLabels();
|
|
8415
8868
|
const q = labels.queryList;
|
|
8416
8869
|
const { locale } = useAbpLocale();
|
|
8417
8870
|
const fmt = useFormatters();
|
|
8418
|
-
const ordered =
|
|
8871
|
+
const ordered = useMemo13(() => {
|
|
8419
8872
|
const byId = new Map(fields.map((f) => [f.id, f]));
|
|
8420
8873
|
const first = shown.filter((id) => byId.has(id));
|
|
8421
8874
|
return [...first, ...fields.map((f) => f.id).filter((id) => !first.includes(id))];
|
|
8422
8875
|
}, [fields, shown]);
|
|
8423
|
-
const [picked, setPicked] =
|
|
8424
|
-
const [all, setAll] =
|
|
8425
|
-
const [separator, setSeparator] =
|
|
8426
|
-
|
|
8876
|
+
const [picked, setPicked] = useState24(new Set(shown));
|
|
8877
|
+
const [all, setAll] = useState24(false);
|
|
8878
|
+
const [separator, setSeparator] = useState24("comma");
|
|
8879
|
+
useEffect17(() => {
|
|
8427
8880
|
if (format) {
|
|
8428
8881
|
setPicked(new Set(shown));
|
|
8429
8882
|
setAll(false);
|
|
@@ -8437,14 +8890,14 @@ function ExportDialog({ format, onClose, fields, shown, columnLabels, found, fil
|
|
|
8437
8890
|
const rows2 = sample.slice(0, 3);
|
|
8438
8891
|
const sep = SEPARATORS[separator];
|
|
8439
8892
|
const csv = [columns.map((id) => csvField(name(id), sep)), ...rows2.map((r) => columns.map((id) => csvField(exportText(r.values[id]), sep)))].map((cells) => cells.join(sep === " " ? " " : sep)).join("\n");
|
|
8440
|
-
return /* @__PURE__ */
|
|
8441
|
-
/* @__PURE__ */
|
|
8442
|
-
/* @__PURE__ */
|
|
8443
|
-
/* @__PURE__ */
|
|
8444
|
-
/* @__PURE__ */
|
|
8445
|
-
filtered && /* @__PURE__ */
|
|
8446
|
-
/* @__PURE__ */
|
|
8447
|
-
/* @__PURE__ */
|
|
8893
|
+
return /* @__PURE__ */ jsx58(Dialog6.Root, { open: format != null, onOpenChange: (e) => !e.open && onClose(), size: "lg", placement: "center", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs44(Portal16, { children: [
|
|
8894
|
+
/* @__PURE__ */ jsx58(Dialog6.Backdrop, {}),
|
|
8895
|
+
/* @__PURE__ */ jsx58(Dialog6.Positioner, { children: /* @__PURE__ */ jsxs44(Dialog6.Content, { "data-export-dialog": "", children: [
|
|
8896
|
+
/* @__PURE__ */ jsx58(Dialog6.Header, { children: /* @__PURE__ */ jsx58(Dialog6.Title, { children: format === "xlsx" ? q.exportTitleExcel ?? "Export to Excel" : q.exportTitleCsv ?? "Export to CSV" }) }),
|
|
8897
|
+
/* @__PURE__ */ jsx58(Dialog6.Body, { children: /* @__PURE__ */ jsxs44(Stack13, { gap: "5", children: [
|
|
8898
|
+
filtered && /* @__PURE__ */ jsxs44(Stack13, { gap: "1.5", children: [
|
|
8899
|
+
/* @__PURE__ */ jsx58(Text19, { textStyle: "label", children: q.exportRows ?? "Rows" }),
|
|
8900
|
+
/* @__PURE__ */ jsx58(
|
|
8448
8901
|
SegmentedControl,
|
|
8449
8902
|
{
|
|
8450
8903
|
size: "sm",
|
|
@@ -8458,9 +8911,9 @@ function ExportDialog({ format, onClose, fields, shown, columnLabels, found, fil
|
|
|
8458
8911
|
}
|
|
8459
8912
|
)
|
|
8460
8913
|
] }),
|
|
8461
|
-
/* @__PURE__ */
|
|
8462
|
-
/* @__PURE__ */
|
|
8463
|
-
/* @__PURE__ */
|
|
8914
|
+
/* @__PURE__ */ jsxs44(Stack13, { gap: "1.5", role: "group", "aria-labelledby": "export-columns", children: [
|
|
8915
|
+
/* @__PURE__ */ jsx58(Text19, { id: "export-columns", textStyle: "label", children: q.exportColumns ?? "Columns" }),
|
|
8916
|
+
/* @__PURE__ */ jsx58(chakra35.div, { display: "grid", gridTemplateColumns: { base: "1fr", sm: "repeat(2, minmax(0, 1fr))" }, gap: "2", children: ordered.map((id) => /* @__PURE__ */ jsx58(
|
|
8464
8917
|
CheckboxField,
|
|
8465
8918
|
{
|
|
8466
8919
|
label: name(id),
|
|
@@ -8475,9 +8928,9 @@ function ExportDialog({ format, onClose, fields, shown, columnLabels, found, fil
|
|
|
8475
8928
|
id
|
|
8476
8929
|
)) })
|
|
8477
8930
|
] }),
|
|
8478
|
-
format === "csv" && /* @__PURE__ */
|
|
8479
|
-
/* @__PURE__ */
|
|
8480
|
-
/* @__PURE__ */
|
|
8931
|
+
format === "csv" && /* @__PURE__ */ jsxs44(Stack13, { gap: "1.5", children: [
|
|
8932
|
+
/* @__PURE__ */ jsx58(chakra35.label, { textStyle: "label", htmlFor: "export-separator", children: q.exportSeparator ?? "Separator" }),
|
|
8933
|
+
/* @__PURE__ */ jsx58(
|
|
8481
8934
|
SelectField,
|
|
8482
8935
|
{
|
|
8483
8936
|
id: "export-separator",
|
|
@@ -8492,25 +8945,25 @@ function ExportDialog({ format, onClose, fields, shown, columnLabels, found, fil
|
|
|
8492
8945
|
}
|
|
8493
8946
|
)
|
|
8494
8947
|
] }),
|
|
8495
|
-
columns.length > 0 && rows2.length > 0 && /* @__PURE__ */
|
|
8496
|
-
/* @__PURE__ */
|
|
8497
|
-
format === "csv" ? /* @__PURE__ */
|
|
8498
|
-
/* @__PURE__ */
|
|
8499
|
-
/* @__PURE__ */
|
|
8948
|
+
columns.length > 0 && rows2.length > 0 && /* @__PURE__ */ jsxs44(Stack13, { gap: "1.5", children: [
|
|
8949
|
+
/* @__PURE__ */ jsx58(Text19, { textStyle: "label", children: q.exportPreview ?? "Preview" }),
|
|
8950
|
+
format === "csv" ? /* @__PURE__ */ jsx58(chakra35.pre, { dir: "ltr", textAlign: "start", m: "0", p: "3", bg: "bg.subtle", borderRadius: "l2", textStyle: "code", overflowX: "auto", whiteSpace: "pre", "data-export-preview": "", children: csv }) : /* @__PURE__ */ jsx58(chakra35.div, { overflowX: "auto", bg: "bg.subtle", borderRadius: "l2", "data-export-preview": "", children: /* @__PURE__ */ jsxs44(chakra35.table, { textStyle: "body.sm", borderCollapse: "collapse", w: "full", children: [
|
|
8951
|
+
/* @__PURE__ */ jsx58("thead", { children: /* @__PURE__ */ jsx58("tr", { children: columns.map((id) => /* @__PURE__ */ jsx58(chakra35.th, { textAlign: "start", fontWeight: "bold", px: "3", py: "1.5", borderBottomWidth: "1px", whiteSpace: "nowrap", children: name(id) }, id)) }) }),
|
|
8952
|
+
/* @__PURE__ */ jsx58("tbody", { children: rows2.map((r) => /* @__PURE__ */ jsx58("tr", { children: columns.map((id) => /* @__PURE__ */ jsx58(chakra35.td, { px: "3", py: "1.5", whiteSpace: "nowrap", maxW: "16rem", truncate: true, children: exportText(r.values[id]) }, id)) }, r.id)) })
|
|
8500
8953
|
] }) })
|
|
8501
8954
|
] })
|
|
8502
8955
|
] }) }),
|
|
8503
|
-
/* @__PURE__ */
|
|
8504
|
-
/* @__PURE__ */
|
|
8505
|
-
/* @__PURE__ */
|
|
8956
|
+
/* @__PURE__ */ jsxs44(Dialog6.Footer, { children: [
|
|
8957
|
+
/* @__PURE__ */ jsx58(Dialog6.ActionTrigger, { asChild: true, children: /* @__PURE__ */ jsx58(Button, { variant: "cancel", children: labels.cancel }) }),
|
|
8958
|
+
/* @__PURE__ */ jsx58(Button, { variant: "primary", disabled: columns.length === 0, onClick: () => onExport({ columns, all, separator }), children: q.exportRun ?? "Export" })
|
|
8506
8959
|
] }),
|
|
8507
|
-
/* @__PURE__ */
|
|
8960
|
+
/* @__PURE__ */ jsx58(Dialog6.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx58(CloseButton4, { size: "sm" }) })
|
|
8508
8961
|
] }) })
|
|
8509
8962
|
] }) });
|
|
8510
8963
|
}
|
|
8511
8964
|
|
|
8512
8965
|
// src/components/QueryableList.tsx
|
|
8513
|
-
import { Fragment as Fragment21, jsx as
|
|
8966
|
+
import { Fragment as Fragment21, jsx as jsx59, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
8514
8967
|
var PAIR = "";
|
|
8515
8968
|
var pairKey = (first, second) => `${first}${PAIR}${second}`;
|
|
8516
8969
|
var condition = (field, value) => value == null ? { field, op: "isEmpty" } : { field, op: "eq", value };
|
|
@@ -8571,18 +9024,18 @@ function QueryableList({
|
|
|
8571
9024
|
}) {
|
|
8572
9025
|
const labels = useAbpLabels().queryList;
|
|
8573
9026
|
const fmt = useFormatters();
|
|
8574
|
-
const byId =
|
|
9027
|
+
const byId = useMemo14(() => new Map((fields ?? []).map((f) => [f.id, f])), [fields]);
|
|
8575
9028
|
const query = result?.query ?? state.query ?? {};
|
|
8576
9029
|
const conditions = basicConditions(query.where ?? null);
|
|
8577
|
-
const [mode, setMode] =
|
|
8578
|
-
const [adding, setAdding] =
|
|
8579
|
-
const [naming, setNaming] =
|
|
8580
|
-
const [exporting, setExporting] =
|
|
8581
|
-
const [exportFormat, setExportFormat] =
|
|
8582
|
-
const [exported, setExported] =
|
|
9030
|
+
const [mode, setMode] = useState25(conditions === null ? "rql" : "basic");
|
|
9031
|
+
const [adding, setAdding] = useState25(false);
|
|
9032
|
+
const [naming, setNaming] = useState25(null);
|
|
9033
|
+
const [exporting, setExporting] = useState25(false);
|
|
9034
|
+
const [exportFormat, setExportFormat] = useState25(null);
|
|
9035
|
+
const [exported, setExported] = useState25(null);
|
|
8583
9036
|
const complex = conditions === null;
|
|
8584
9037
|
const failed = Boolean(error && state.rql);
|
|
8585
|
-
|
|
9038
|
+
useEffect18(() => {
|
|
8586
9039
|
if (complex || failed) setMode("rql");
|
|
8587
9040
|
}, [complex, failed]);
|
|
8588
9041
|
const label = (id) => byId.get(id)?.label ?? id;
|
|
@@ -8641,8 +9094,8 @@ function QueryableList({
|
|
|
8641
9094
|
}
|
|
8642
9095
|
const groupField = query.groupBy?.field ?? null;
|
|
8643
9096
|
const thenField = groupField ? query.groupBy?.then?.field ?? null : null;
|
|
8644
|
-
const [folded, setFolded] =
|
|
8645
|
-
|
|
9097
|
+
const [folded, setFolded] = useState25(() => /* @__PURE__ */ new Set());
|
|
9098
|
+
useEffect18(() => setFolded(/* @__PURE__ */ new Set()), [groupField, thenField]);
|
|
8646
9099
|
const grouped = Boolean(groupField && result?.groups && result.groups.length > 0);
|
|
8647
9100
|
const asTree = Boolean(tree && groupField === tree.field);
|
|
8648
9101
|
const groupOf = (row) => {
|
|
@@ -8655,7 +9108,7 @@ function QueryableList({
|
|
|
8655
9108
|
const firstOf = (key) => thenField ? key.slice(0, key.indexOf(PAIR)) : key;
|
|
8656
9109
|
const { locale } = useAbpLocale();
|
|
8657
9110
|
const groupName = (value, label2, period) => value == null ? labels.noGroupValue : period ? periodName(value, period, locale, { week: labels.periodWeek, quarter: labels.periodQuarter }) : label2 || value;
|
|
8658
|
-
const groupKeys =
|
|
9111
|
+
const groupKeys = useMemo14(() => {
|
|
8659
9112
|
const keys = [...new Set((result?.items ?? []).map(groupOf))];
|
|
8660
9113
|
return thenField ? [...keys, ...new Set(keys.map((k) => parentFoldKey(k.slice(0, k.indexOf(PAIR)))))] : keys;
|
|
8661
9114
|
}, [result, groupField, thenField]);
|
|
@@ -8671,15 +9124,15 @@ function QueryableList({
|
|
|
8671
9124
|
}
|
|
8672
9125
|
const sortable = (fields ?? []).filter((f) => f.sortable);
|
|
8673
9126
|
const groupLabel = groupField ? thenField ? `${label(groupField)} \xB7 ${label(thenField)}` : label(groupField) : null;
|
|
8674
|
-
return /* @__PURE__ */
|
|
8675
|
-
/* @__PURE__ */
|
|
8676
|
-
/* @__PURE__ */
|
|
8677
|
-
/* @__PURE__ */
|
|
9127
|
+
return /* @__PURE__ */ jsxs45(Stack14, { gap: "3", children: [
|
|
9128
|
+
/* @__PURE__ */ jsxs45(chakra36.div, { layerStyle: "panel", borderRadius: "l3", "data-query-toolbar": "", children: [
|
|
9129
|
+
/* @__PURE__ */ jsxs45(HStack13, { gap: "2", wrap: "wrap", justify: "space-between", px: "2.5", py: "2", borderBottomWidth: "1px", borderColor: "border.muted", children: [
|
|
9130
|
+
/* @__PURE__ */ jsxs45(HStack13, { gap: "2", wrap: "wrap", minW: "0", children: [
|
|
8678
9131
|
leading,
|
|
8679
|
-
leading != null && views && onSelectView && /* @__PURE__ */
|
|
8680
|
-
views && onSelectView && /* @__PURE__ */
|
|
8681
|
-
/* @__PURE__ */
|
|
8682
|
-
/* @__PURE__ */
|
|
9132
|
+
leading != null && views && onSelectView && /* @__PURE__ */ jsx59(chakra36.span, { w: "1px", h: "6", bg: "border", mx: "1", "aria-hidden": true }),
|
|
9133
|
+
views && onSelectView && /* @__PURE__ */ jsxs45(HStack13, { gap: "2", children: [
|
|
9134
|
+
/* @__PURE__ */ jsx59(Text20, { as: "span", textStyle: "xs", fontWeight: "semibold", color: "fg.muted", whiteSpace: "nowrap", hideBelow: "2xl", children: labels.savedView }),
|
|
9135
|
+
/* @__PURE__ */ jsx59(
|
|
8683
9136
|
SelectField,
|
|
8684
9137
|
{
|
|
8685
9138
|
width: "auto",
|
|
@@ -8691,62 +9144,62 @@ function QueryableList({
|
|
|
8691
9144
|
}
|
|
8692
9145
|
)
|
|
8693
9146
|
] }),
|
|
8694
|
-
onSaveView && (naming === null ? /* @__PURE__ */
|
|
8695
|
-
/* @__PURE__ */
|
|
9147
|
+
onSaveView && (naming === null ? /* @__PURE__ */ jsxs45(Button, { size: "sm", variant: "ghost", color: "fg.accent", onClick: () => setNaming(activeView?.isOwner ? activeView.name : ""), children: [
|
|
9148
|
+
/* @__PURE__ */ jsx59(Save, {}),
|
|
8696
9149
|
labels.saveView
|
|
8697
|
-
] }) : /* @__PURE__ */
|
|
9150
|
+
] }) : /* @__PURE__ */ jsxs45(HStack13, { gap: "1", as: "form", onSubmit: (e) => {
|
|
8698
9151
|
e.preventDefault();
|
|
8699
9152
|
if (naming.trim()) onSaveView(naming.trim(), activeView?.isOwner && naming.trim() === activeView.name ? activeView.id : null);
|
|
8700
9153
|
setNaming(null);
|
|
8701
9154
|
}, children: [
|
|
8702
|
-
/* @__PURE__ */
|
|
8703
|
-
/* @__PURE__ */
|
|
8704
|
-
/* @__PURE__ */
|
|
9155
|
+
/* @__PURE__ */ jsx59(Input7, { size: "sm", autoFocus: true, "aria-label": labels.viewName, placeholder: labels.viewName, value: naming, onChange: (e) => setNaming(e.target.value), maxW: "56" }),
|
|
9156
|
+
/* @__PURE__ */ jsx59(Button, { size: "sm", type: "submit", variant: "primary", disabled: !naming.trim(), children: labels.save }),
|
|
9157
|
+
/* @__PURE__ */ jsx59(IconButton, { size: "sm", variant: "ghost", "aria-label": labels.cancel, onClick: () => setNaming(null), children: /* @__PURE__ */ jsx59(X2, {}) })
|
|
8705
9158
|
] })),
|
|
8706
|
-
activeView?.isOwner && onDeleteView && naming === null && /* @__PURE__ */
|
|
9159
|
+
activeView?.isOwner && onDeleteView && naming === null && /* @__PURE__ */ jsx59(IconButton, { size: "sm", variant: "ghost", "aria-label": labels.deleteView, onClick: () => onDeleteView(activeView.id), children: /* @__PURE__ */ jsx59(Trash22, {}) })
|
|
8707
9160
|
] }),
|
|
8708
|
-
/* @__PURE__ */
|
|
8709
|
-
/* @__PURE__ */
|
|
8710
|
-
/* @__PURE__ */
|
|
8711
|
-
/* @__PURE__ */
|
|
8712
|
-
/* @__PURE__ */
|
|
9161
|
+
/* @__PURE__ */ jsxs45(HStack13, { gap: "2", wrap: "wrap", children: [
|
|
9162
|
+
/* @__PURE__ */ jsxs45(Menu5.Root, { positioning: { placement: "bottom-end" }, children: [
|
|
9163
|
+
/* @__PURE__ */ jsx59(Menu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs45(Button, { size: "sm", variant: "secondary", "aria-label": labels.groupBy, disabled: groupable.length === 0, children: [
|
|
9164
|
+
/* @__PURE__ */ jsx59(Rows3, {}),
|
|
9165
|
+
/* @__PURE__ */ jsx59(Text20, { as: "span", color: "fg.muted", fontWeight: "normal", children: labels.group }),
|
|
8713
9166
|
groupLabel ?? labels.noGrouping,
|
|
8714
|
-
/* @__PURE__ */
|
|
9167
|
+
/* @__PURE__ */ jsx59(ChevronDown3, {})
|
|
8715
9168
|
] }) }),
|
|
8716
|
-
/* @__PURE__ */
|
|
8717
|
-
/* @__PURE__ */
|
|
9169
|
+
/* @__PURE__ */ jsx59(Portal17, { children: /* @__PURE__ */ jsx59(Menu5.Positioner, { children: /* @__PURE__ */ jsxs45(Menu5.Content, { minW: "48", children: [
|
|
9170
|
+
/* @__PURE__ */ jsxs45(
|
|
8718
9171
|
Menu5.RadioItemGroup,
|
|
8719
9172
|
{
|
|
8720
9173
|
value: groupField ?? "",
|
|
8721
9174
|
onValueChange: (d) => change({ ...query, groupBy: d.value ? { field: d.value, aggregates: [] } : null }),
|
|
8722
9175
|
children: [
|
|
8723
|
-
/* @__PURE__ */
|
|
9176
|
+
/* @__PURE__ */ jsxs45(Menu5.RadioItem, { value: "", children: [
|
|
8724
9177
|
labels.noGrouping,
|
|
8725
|
-
/* @__PURE__ */
|
|
9178
|
+
/* @__PURE__ */ jsx59(Menu5.ItemIndicator, {})
|
|
8726
9179
|
] }),
|
|
8727
|
-
groupable.map((f) => /* @__PURE__ */
|
|
9180
|
+
groupable.map((f) => /* @__PURE__ */ jsxs45(Menu5.RadioItem, { value: f.id, children: [
|
|
8728
9181
|
f.label,
|
|
8729
|
-
/* @__PURE__ */
|
|
9182
|
+
/* @__PURE__ */ jsx59(Menu5.ItemIndicator, {})
|
|
8730
9183
|
] }, f.id))
|
|
8731
9184
|
]
|
|
8732
9185
|
}
|
|
8733
9186
|
),
|
|
8734
|
-
groupField && groupable.length > 1 && /* @__PURE__ */
|
|
8735
|
-
/* @__PURE__ */
|
|
8736
|
-
/* @__PURE__ */
|
|
9187
|
+
groupField && groupable.length > 1 && /* @__PURE__ */ jsxs45(Fragment21, { children: [
|
|
9188
|
+
/* @__PURE__ */ jsx59(Menu5.Separator, {}),
|
|
9189
|
+
/* @__PURE__ */ jsxs45(
|
|
8737
9190
|
Menu5.RadioItemGroup,
|
|
8738
9191
|
{
|
|
8739
9192
|
value: thenField ?? "",
|
|
8740
9193
|
onValueChange: (d) => change({ ...query, groupBy: { ...query.groupBy, then: d.value ? { field: d.value } : null } }),
|
|
8741
9194
|
children: [
|
|
8742
|
-
/* @__PURE__ */
|
|
8743
|
-
/* @__PURE__ */
|
|
9195
|
+
/* @__PURE__ */ jsx59(Menu5.ItemGroupLabel, { children: labels.thenBy }),
|
|
9196
|
+
/* @__PURE__ */ jsxs45(Menu5.RadioItem, { value: "", children: [
|
|
8744
9197
|
labels.noSecondGrouping,
|
|
8745
|
-
/* @__PURE__ */
|
|
9198
|
+
/* @__PURE__ */ jsx59(Menu5.ItemIndicator, {})
|
|
8746
9199
|
] }),
|
|
8747
|
-
groupable.filter((f) => f.id !== groupField).map((f) => /* @__PURE__ */
|
|
9200
|
+
groupable.filter((f) => f.id !== groupField).map((f) => /* @__PURE__ */ jsxs45(Menu5.RadioItem, { value: f.id, children: [
|
|
8748
9201
|
f.label,
|
|
8749
|
-
/* @__PURE__ */
|
|
9202
|
+
/* @__PURE__ */ jsx59(Menu5.ItemIndicator, {})
|
|
8750
9203
|
] }, f.id))
|
|
8751
9204
|
]
|
|
8752
9205
|
}
|
|
@@ -8754,10 +9207,10 @@ function QueryableList({
|
|
|
8754
9207
|
] })
|
|
8755
9208
|
] }) }) })
|
|
8756
9209
|
] }),
|
|
8757
|
-
/* @__PURE__ */
|
|
8758
|
-
onExport && !exportTarget && /* @__PURE__ */
|
|
8759
|
-
onExport && exportTarget && createPortal(/* @__PURE__ */
|
|
8760
|
-
onExport && /* @__PURE__ */
|
|
9210
|
+
/* @__PURE__ */ jsx59(ColumnsPopover, { fields: fields ?? [], columns: state.columns, onChange: (next) => onStateChange({ ...state, rql: result?.rql ?? state.rql, query: void 0, columns: next }) }),
|
|
9211
|
+
onExport && !exportTarget && /* @__PURE__ */ jsx59(ExportMenu, { busy: exporting, disabled: !result || Boolean(loading), onExport: setExportFormat }),
|
|
9212
|
+
onExport && exportTarget && createPortal(/* @__PURE__ */ jsx59(ExportMenu, { busy: exporting, disabled: !result || Boolean(loading), onExport: setExportFormat }), exportTarget),
|
|
9213
|
+
onExport && /* @__PURE__ */ jsx59(
|
|
8761
9214
|
ExportDialog,
|
|
8762
9215
|
{
|
|
8763
9216
|
format: exportFormat,
|
|
@@ -8774,9 +9227,9 @@ function QueryableList({
|
|
|
8774
9227
|
actions
|
|
8775
9228
|
] })
|
|
8776
9229
|
] }),
|
|
8777
|
-
/* @__PURE__ */
|
|
8778
|
-
/* @__PURE__ */
|
|
8779
|
-
/* @__PURE__ */
|
|
9230
|
+
/* @__PURE__ */ jsxs45(HStack13, { gap: "2", align: "start", wrap: "wrap", justify: "space-between", px: "2.5", py: "2", children: [
|
|
9231
|
+
/* @__PURE__ */ jsxs45(HStack13, { gap: "2", align: "start", wrap: "wrap", flex: "1", minW: { base: "full", md: "0" }, children: [
|
|
9232
|
+
/* @__PURE__ */ jsx59(
|
|
8780
9233
|
SegmentedControl,
|
|
8781
9234
|
{
|
|
8782
9235
|
size: "sm",
|
|
@@ -8789,14 +9242,14 @@ function QueryableList({
|
|
|
8789
9242
|
]
|
|
8790
9243
|
}
|
|
8791
9244
|
),
|
|
8792
|
-
mode === "basic" && conditions !== null ? /* @__PURE__ */
|
|
8793
|
-
search && /* @__PURE__ */
|
|
8794
|
-
/* @__PURE__ */
|
|
9245
|
+
mode === "basic" && conditions !== null ? /* @__PURE__ */ jsxs45(HStack13, { gap: "2", wrap: "wrap", flex: "1", minW: "0", children: [
|
|
9246
|
+
search && /* @__PURE__ */ jsx59(QuickSearch, { initial: searchText, placeholder: search.placeholder ?? labels.searchPlaceholder, onRun: runSearch }, searchText),
|
|
9247
|
+
/* @__PURE__ */ jsxs45(AddButton, { onClick: () => setAdding(true), disabled: !fields, "data-add-filter": "", children: [
|
|
8795
9248
|
labels.addFilter,
|
|
8796
|
-
chips.length > 0 && /* @__PURE__ */
|
|
9249
|
+
chips.length > 0 && /* @__PURE__ */ jsx59(CountBadge, { value: chips.length, tone: "accent" })
|
|
8797
9250
|
] }),
|
|
8798
|
-
sortable.length > 0 && /* @__PURE__ */
|
|
8799
|
-
/* @__PURE__ */
|
|
9251
|
+
sortable.length > 0 && /* @__PURE__ */ jsxs45(HStack13, { gap: "1", flexShrink: 0, children: [
|
|
9252
|
+
/* @__PURE__ */ jsx59(
|
|
8800
9253
|
SelectField,
|
|
8801
9254
|
{
|
|
8802
9255
|
width: "auto",
|
|
@@ -8811,7 +9264,7 @@ function QueryableList({
|
|
|
8811
9264
|
]
|
|
8812
9265
|
}
|
|
8813
9266
|
),
|
|
8814
|
-
sort && /* @__PURE__ */
|
|
9267
|
+
sort && /* @__PURE__ */ jsx59(
|
|
8815
9268
|
IconButton,
|
|
8816
9269
|
{
|
|
8817
9270
|
size: "sm",
|
|
@@ -8819,11 +9272,11 @@ function QueryableList({
|
|
|
8819
9272
|
"aria-label": sort.direction === "desc" ? labels.sortDescending : labels.sortAscending,
|
|
8820
9273
|
title: sort.direction === "desc" ? labels.sortDescending : labels.sortAscending,
|
|
8821
9274
|
onClick: () => change({ ...query, orderBy: [{ field: sort.columnId, desc: sort.direction !== "desc" }] }),
|
|
8822
|
-
children: sort.direction === "desc" ? /* @__PURE__ */
|
|
9275
|
+
children: sort.direction === "desc" ? /* @__PURE__ */ jsx59(ArrowDownWideNarrow, {}) : /* @__PURE__ */ jsx59(ArrowUpNarrowWide, {})
|
|
8823
9276
|
}
|
|
8824
9277
|
)
|
|
8825
9278
|
] })
|
|
8826
|
-
] }) : /* @__PURE__ */
|
|
9279
|
+
] }) : /* @__PURE__ */ jsx59(
|
|
8827
9280
|
RqlBox,
|
|
8828
9281
|
{
|
|
8829
9282
|
initial: state.rql ?? result?.rql ?? "",
|
|
@@ -8834,11 +9287,11 @@ function QueryableList({
|
|
|
8834
9287
|
state.rql ?? result?.rql ?? ""
|
|
8835
9288
|
)
|
|
8836
9289
|
] }),
|
|
8837
|
-
attention != null && /* @__PURE__ */
|
|
9290
|
+
attention != null && /* @__PURE__ */ jsx59(HStack13, { gap: "2", wrap: "wrap", flexShrink: 0, children: attention })
|
|
8838
9291
|
] }),
|
|
8839
|
-
mode === "basic" && conditions !== null && chips.length > 0 && /* @__PURE__ */
|
|
8840
|
-
chips.map(({ c: c2, i }) => /* @__PURE__ */
|
|
8841
|
-
|
|
9292
|
+
mode === "basic" && conditions !== null && chips.length > 0 && /* @__PURE__ */ jsxs45(HStack13, { gap: "2", wrap: "wrap", px: "2.5", py: "2", borderTopWidth: "1px", borderColor: "border.muted", "data-filter-chips": "", children: [
|
|
9293
|
+
chips.map(({ c: c2, i }) => /* @__PURE__ */ jsxs45(
|
|
9294
|
+
chakra36.span,
|
|
8842
9295
|
{
|
|
8843
9296
|
display: "inline-flex",
|
|
8844
9297
|
alignItems: "center",
|
|
@@ -8852,17 +9305,17 @@ function QueryableList({
|
|
|
8852
9305
|
bg: "bg.selected",
|
|
8853
9306
|
textStyle: "sm",
|
|
8854
9307
|
children: [
|
|
8855
|
-
/* @__PURE__ */
|
|
8856
|
-
/* @__PURE__ */
|
|
8857
|
-
!NO_VALUE_OPS.has(c2.op) && /* @__PURE__ */
|
|
8858
|
-
/* @__PURE__ */
|
|
9308
|
+
/* @__PURE__ */ jsx59(Text20, { as: "span", fontWeight: "medium", children: label(c2.field) }),
|
|
9309
|
+
/* @__PURE__ */ jsx59(Text20, { as: "span", color: "fg.muted", children: opLabel(c2.op, c2.field) }),
|
|
9310
|
+
!NO_VALUE_OPS.has(c2.op) && /* @__PURE__ */ jsx59(Text20, { as: "span", children: valueText(c2.value) }),
|
|
9311
|
+
/* @__PURE__ */ jsx59(IconButton, { size: "xs", variant: "ghost", "aria-label": fill4(labels.removeFilter, { field: label(c2.field) }), onClick: () => setConditions(conditions.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx59(X2, {}) })
|
|
8859
9312
|
]
|
|
8860
9313
|
},
|
|
8861
9314
|
`${c2.field}-${i}`
|
|
8862
9315
|
)),
|
|
8863
|
-
/* @__PURE__ */
|
|
9316
|
+
/* @__PURE__ */ jsx59(Button, { size: "xs", variant: "ghost", onClick: () => setConditions(searching >= 0 ? [conditions[searching]] : []), children: labels.clearAll })
|
|
8864
9317
|
] }),
|
|
8865
|
-
adding && fields && conditions !== null && /* @__PURE__ */
|
|
9318
|
+
adding && fields && conditions !== null && /* @__PURE__ */ jsx59(
|
|
8866
9319
|
FilterBuilderDialog,
|
|
8867
9320
|
{
|
|
8868
9321
|
fields,
|
|
@@ -8877,26 +9330,26 @@ function QueryableList({
|
|
|
8877
9330
|
}
|
|
8878
9331
|
}
|
|
8879
9332
|
),
|
|
8880
|
-
toolbarFooter != null && /* @__PURE__ */
|
|
9333
|
+
toolbarFooter != null && /* @__PURE__ */ jsx59(chakra36.div, { borderTopWidth: "1px", borderColor: "border.muted", "data-toolbar-footer": "", children: toolbarFooter })
|
|
8881
9334
|
] }),
|
|
8882
|
-
mode === "basic" && error && !(loadFailed != null && error.failed && !result) && /* @__PURE__ */
|
|
8883
|
-
exported && /* @__PURE__ */
|
|
8884
|
-
/* @__PURE__ */
|
|
8885
|
-
/* @__PURE__ */
|
|
9335
|
+
mode === "basic" && error && !(loadFailed != null && error.failed && !result) && /* @__PURE__ */ jsx59(InlineAlert, { tone: "danger", children: error.message }),
|
|
9336
|
+
exported && /* @__PURE__ */ jsx59(InlineAlert, { tone: exported.tone, title: exported.tone === "danger" ? labels.exportFailed : void 0, children: /* @__PURE__ */ jsxs45(HStack13, { justify: "space-between", gap: "2", align: "start", children: [
|
|
9337
|
+
/* @__PURE__ */ jsx59(Text20, { as: "span", children: exported.message }),
|
|
9338
|
+
/* @__PURE__ */ jsx59(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.dismiss, onClick: () => setExported(null), children: /* @__PURE__ */ jsx59(X2, {}) })
|
|
8886
9339
|
] }) }),
|
|
8887
|
-
/* @__PURE__ */
|
|
9340
|
+
/* @__PURE__ */ jsx59(
|
|
8888
9341
|
Panel,
|
|
8889
9342
|
{
|
|
8890
9343
|
flush: true,
|
|
8891
9344
|
footer: (
|
|
8892
9345
|
// Expand and collapse at the start, the pages in the middle (the canvas's v12, UI round 9 step 67, round 10 step 73),
|
|
8893
9346
|
// the range at the end, or with the arrows in the simple form.
|
|
8894
|
-
/* @__PURE__ */
|
|
8895
|
-
/* @__PURE__ */
|
|
8896
|
-
/* @__PURE__ */
|
|
8897
|
-
/* @__PURE__ */
|
|
9347
|
+
/* @__PURE__ */ jsxs45(chakra36.div, { display: "grid", w: "full", gridTemplateColumns: { base: "1fr", md: "1fr auto 1fr" }, alignItems: "center", gap: "3", children: [
|
|
9348
|
+
/* @__PURE__ */ jsx59(HStack13, { gap: "3", children: grouped && /* @__PURE__ */ jsxs45(Fragment21, { children: [
|
|
9349
|
+
/* @__PURE__ */ jsx59(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: folded.size === 0, onClick: () => setFolded(/* @__PURE__ */ new Set()), children: labels.expandAll }),
|
|
9350
|
+
/* @__PURE__ */ jsx59(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: groupKeys.every((k) => folded.has(k)), onClick: () => setFolded(new Set(groupKeys)), children: labels.collapseAll })
|
|
8898
9351
|
] }) }),
|
|
8899
|
-
/* @__PURE__ */
|
|
9352
|
+
/* @__PURE__ */ jsx59(
|
|
8900
9353
|
Pagination,
|
|
8901
9354
|
{
|
|
8902
9355
|
page: Math.floor(skip / take) + 1,
|
|
@@ -8912,10 +9365,10 @@ function QueryableList({
|
|
|
8912
9365
|
pageOf: fill4(labels.pageOf, { page: fmt.number(Math.floor(skip / take) + 1), pages: fmt.number(Math.max(1, Math.ceil(total / take))) })
|
|
8913
9366
|
}
|
|
8914
9367
|
),
|
|
8915
|
-
/* @__PURE__ */
|
|
9368
|
+
/* @__PURE__ */ jsx59(Text20, { 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) }) : " " })
|
|
8916
9369
|
] })
|
|
8917
9370
|
),
|
|
8918
|
-
children: layout === "cards" && cards ? /* @__PURE__ */
|
|
9371
|
+
children: layout === "cards" && cards ? /* @__PURE__ */ jsx59(
|
|
8919
9372
|
CardGrid,
|
|
8920
9373
|
{
|
|
8921
9374
|
"aria-label": ariaLabel,
|
|
@@ -8926,7 +9379,7 @@ function QueryableList({
|
|
|
8926
9379
|
render: cards.render,
|
|
8927
9380
|
empty: loadFailed != null && error?.failed && !result ? loadFailed : empty ?? labels.empty
|
|
8928
9381
|
}
|
|
8929
|
-
) : /* @__PURE__ */
|
|
9382
|
+
) : /* @__PURE__ */ jsx59(
|
|
8930
9383
|
DataTable,
|
|
8931
9384
|
{
|
|
8932
9385
|
"aria-label": ariaLabel,
|
|
@@ -8972,11 +9425,11 @@ function QueryableList({
|
|
|
8972
9425
|
const label2 = thenField ? info?.then?.label : info?.label;
|
|
8973
9426
|
const value = thenField ? info?.then?.value ?? null : info?.value ?? null;
|
|
8974
9427
|
const period = thenField ? query.groupBy?.then?.period : query.groupBy?.period;
|
|
8975
|
-
return /* @__PURE__ */
|
|
8976
|
-
/* @__PURE__ */
|
|
8977
|
-
/* @__PURE__ */
|
|
9428
|
+
return /* @__PURE__ */ jsxs45(HStack13, { gap: "2.5", flex: "1", minW: "0", children: [
|
|
9429
|
+
/* @__PURE__ */ jsx59(chakra36.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) }),
|
|
9430
|
+
/* @__PURE__ */ jsx59(CountBadge, { value: info?.count ?? rows2.length }),
|
|
8978
9431
|
!thenField && renderGroupAside?.({ field: groupField, value: info?.value ?? null, label: info?.label ?? "" }),
|
|
8979
|
-
conditions !== null && !period && /* @__PURE__ */
|
|
9432
|
+
conditions !== null && !period && /* @__PURE__ */ jsxs45(
|
|
8980
9433
|
Button,
|
|
8981
9434
|
{
|
|
8982
9435
|
size: "xs",
|
|
@@ -8994,8 +9447,8 @@ function QueryableList({
|
|
|
8994
9447
|
condition(field, value)
|
|
8995
9448
|
]),
|
|
8996
9449
|
children: [
|
|
8997
|
-
/* @__PURE__ */
|
|
8998
|
-
/* @__PURE__ */
|
|
9450
|
+
/* @__PURE__ */ jsx59(Filter, {}),
|
|
9451
|
+
/* @__PURE__ */ jsx59(chakra36.span, { hideBelow: "md", children: labels.filterToGroup })
|
|
8999
9452
|
]
|
|
9000
9453
|
}
|
|
9001
9454
|
)
|
|
@@ -9014,9 +9467,9 @@ function QueryableList({
|
|
|
9014
9467
|
const first = groups[0]?.rows[0];
|
|
9015
9468
|
const raw = first?.values[groupField];
|
|
9016
9469
|
const count = (result?.groups ?? []).filter((g) => groupKey(g.value) === parent).reduce((n, g) => n + g.count, 0);
|
|
9017
|
-
return /* @__PURE__ */
|
|
9018
|
-
/* @__PURE__ */
|
|
9019
|
-
/* @__PURE__ */
|
|
9470
|
+
return /* @__PURE__ */ jsxs45(HStack13, { gap: "2.5", flex: "1", minW: "0", children: [
|
|
9471
|
+
/* @__PURE__ */ jsx59(chakra36.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) }),
|
|
9472
|
+
/* @__PURE__ */ jsx59(CountBadge, { value: count }),
|
|
9020
9473
|
renderGroupAside?.({ field: groupField, value: info?.value ?? null, label: info?.label ?? "" })
|
|
9021
9474
|
] });
|
|
9022
9475
|
}
|
|
@@ -9052,15 +9505,15 @@ function QueryableList({
|
|
|
9052
9505
|
}
|
|
9053
9506
|
function QuickSearch({ initial, placeholder: placeholder2, onRun }) {
|
|
9054
9507
|
const labels = useAbpLabels().queryList;
|
|
9055
|
-
const [text, setText] =
|
|
9056
|
-
const timer =
|
|
9057
|
-
|
|
9508
|
+
const [text, setText] = useState25(initial);
|
|
9509
|
+
const timer = useRef20(void 0);
|
|
9510
|
+
useEffect18(() => () => clearTimeout(timer.current), []);
|
|
9058
9511
|
function later(next) {
|
|
9059
9512
|
clearTimeout(timer.current);
|
|
9060
9513
|
timer.current = setTimeout(() => next.trim() !== initial.trim() && onRun(next), 400);
|
|
9061
9514
|
}
|
|
9062
|
-
return /* @__PURE__ */
|
|
9063
|
-
|
|
9515
|
+
return /* @__PURE__ */ jsx59(
|
|
9516
|
+
chakra36.form,
|
|
9064
9517
|
{
|
|
9065
9518
|
role: "search",
|
|
9066
9519
|
flex: "1",
|
|
@@ -9071,7 +9524,7 @@ function QuickSearch({ initial, placeholder: placeholder2, onRun }) {
|
|
|
9071
9524
|
clearTimeout(timer.current);
|
|
9072
9525
|
if (text.trim() !== initial.trim()) onRun(text);
|
|
9073
9526
|
},
|
|
9074
|
-
children: /* @__PURE__ */
|
|
9527
|
+
children: /* @__PURE__ */ jsx59(
|
|
9075
9528
|
SearchInput,
|
|
9076
9529
|
{
|
|
9077
9530
|
size: "sm",
|
|
@@ -9113,14 +9566,14 @@ function placeholderOf(id, kind) {
|
|
|
9113
9566
|
}
|
|
9114
9567
|
function ExportMenu({ busy, disabled, onExport }) {
|
|
9115
9568
|
const labels = useAbpLabels().queryList;
|
|
9116
|
-
return /* @__PURE__ */
|
|
9117
|
-
/* @__PURE__ */
|
|
9118
|
-
/* @__PURE__ */
|
|
9569
|
+
return /* @__PURE__ */ jsxs45(Menu5.Root, { positioning: { placement: "bottom-end" }, onSelect: (d) => onExport(d.value), children: [
|
|
9570
|
+
/* @__PURE__ */ jsx59(Menu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs45(Button, { size: "sm", variant: "secondary", disabled: disabled || busy, loading: busy, loadingText: labels.exporting, children: [
|
|
9571
|
+
/* @__PURE__ */ jsx59(Download, {}),
|
|
9119
9572
|
labels.export
|
|
9120
9573
|
] }) }),
|
|
9121
|
-
/* @__PURE__ */
|
|
9122
|
-
/* @__PURE__ */
|
|
9123
|
-
/* @__PURE__ */
|
|
9574
|
+
/* @__PURE__ */ jsx59(Portal17, { children: /* @__PURE__ */ jsx59(Menu5.Positioner, { children: /* @__PURE__ */ jsxs45(Menu5.Content, { minW: "48", children: [
|
|
9575
|
+
/* @__PURE__ */ jsx59(Menu5.Item, { value: "csv", children: labels.exportCsv }),
|
|
9576
|
+
/* @__PURE__ */ jsx59(Menu5.Item, { value: "xlsx", children: labels.exportExcel })
|
|
9124
9577
|
] }) }) })
|
|
9125
9578
|
] });
|
|
9126
9579
|
}
|
|
@@ -9131,13 +9584,13 @@ function RqlBox({
|
|
|
9131
9584
|
onRun
|
|
9132
9585
|
}) {
|
|
9133
9586
|
const labels = useAbpLabels().queryList;
|
|
9134
|
-
const [text, setText] =
|
|
9135
|
-
const [found, setFound] =
|
|
9136
|
-
const [active, setActive] =
|
|
9137
|
-
const [open, setOpen] =
|
|
9138
|
-
const input =
|
|
9139
|
-
const timer =
|
|
9140
|
-
const seq =
|
|
9587
|
+
const [text, setText] = useState25(initial);
|
|
9588
|
+
const [found, setFound] = useState25(null);
|
|
9589
|
+
const [active, setActive] = useState25(0);
|
|
9590
|
+
const [open, setOpen] = useState25(false);
|
|
9591
|
+
const input = useRef20(null);
|
|
9592
|
+
const timer = useRef20(void 0);
|
|
9593
|
+
const seq = useRef20(0);
|
|
9141
9594
|
const listId = useId9();
|
|
9142
9595
|
function ask(value, caret) {
|
|
9143
9596
|
if (!suggest) return;
|
|
@@ -9152,7 +9605,7 @@ function RqlBox({
|
|
|
9152
9605
|
}).catch(() => setOpen(false));
|
|
9153
9606
|
}, 120);
|
|
9154
9607
|
}
|
|
9155
|
-
|
|
9608
|
+
useEffect18(() => () => clearTimeout(timer.current), []);
|
|
9156
9609
|
function accept(item) {
|
|
9157
9610
|
if (!found) return;
|
|
9158
9611
|
const before = text.slice(0, found.replaceStart);
|
|
@@ -9200,9 +9653,9 @@ function RqlBox({
|
|
|
9200
9653
|
}
|
|
9201
9654
|
}
|
|
9202
9655
|
const hasSpan = error?.start != null && error.end != null && error.end >= error.start && error.end <= text.length;
|
|
9203
|
-
return /* @__PURE__ */
|
|
9204
|
-
/* @__PURE__ */
|
|
9205
|
-
/* @__PURE__ */
|
|
9656
|
+
return /* @__PURE__ */ jsxs45(Stack14, { gap: "1.5", flex: "1", minW: "0", position: "relative", children: [
|
|
9657
|
+
/* @__PURE__ */ jsxs45(HStack13, { gap: "2", children: [
|
|
9658
|
+
/* @__PURE__ */ jsx59(
|
|
9206
9659
|
Input7,
|
|
9207
9660
|
{
|
|
9208
9661
|
ref: input,
|
|
@@ -9228,10 +9681,10 @@ function RqlBox({
|
|
|
9228
9681
|
onKeyDown
|
|
9229
9682
|
}
|
|
9230
9683
|
),
|
|
9231
|
-
/* @__PURE__ */
|
|
9684
|
+
/* @__PURE__ */ jsx59(Button, { size: "sm", variant: "primary", onClick: () => onRun(text.trim()), children: labels.run })
|
|
9232
9685
|
] }),
|
|
9233
|
-
open && found && /* @__PURE__ */
|
|
9234
|
-
|
|
9686
|
+
open && found && /* @__PURE__ */ jsx59(
|
|
9687
|
+
Box13,
|
|
9235
9688
|
{
|
|
9236
9689
|
id: listId,
|
|
9237
9690
|
role: "listbox",
|
|
@@ -9249,8 +9702,8 @@ function RqlBox({
|
|
|
9249
9702
|
borderRadius: "md",
|
|
9250
9703
|
boxShadow: "md",
|
|
9251
9704
|
py: "1",
|
|
9252
|
-
children: found.items.map((item, i) => /* @__PURE__ */
|
|
9253
|
-
|
|
9705
|
+
children: found.items.map((item, i) => /* @__PURE__ */ jsxs45(
|
|
9706
|
+
HStack13,
|
|
9254
9707
|
{
|
|
9255
9708
|
id: `${listId}-${i}`,
|
|
9256
9709
|
role: "option",
|
|
@@ -9267,28 +9720,28 @@ function RqlBox({
|
|
|
9267
9720
|
},
|
|
9268
9721
|
onMouseEnter: () => setActive(i),
|
|
9269
9722
|
children: [
|
|
9270
|
-
/* @__PURE__ */
|
|
9271
|
-
/* @__PURE__ */
|
|
9723
|
+
/* @__PURE__ */ jsx59(Text20, { 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 }),
|
|
9724
|
+
/* @__PURE__ */ jsx59(Text20, { 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 })
|
|
9272
9725
|
]
|
|
9273
9726
|
},
|
|
9274
9727
|
`${item.kind}-${item.text}`
|
|
9275
9728
|
))
|
|
9276
9729
|
}
|
|
9277
9730
|
),
|
|
9278
|
-
error && /* @__PURE__ */
|
|
9731
|
+
error && /* @__PURE__ */ jsxs45(InlineAlert, { tone: "danger", size: "sm", children: [
|
|
9279
9732
|
error.message,
|
|
9280
|
-
hasSpan && /* @__PURE__ */
|
|
9733
|
+
hasSpan && /* @__PURE__ */ jsxs45(chakra36.code, { display: "block", mt: "1", fontFamily: "mono", whiteSpace: "pre-wrap", children: [
|
|
9281
9734
|
text.slice(0, error.start),
|
|
9282
|
-
/* @__PURE__ */
|
|
9735
|
+
/* @__PURE__ */ jsx59(chakra36.mark, { bg: "red.subtle", color: "fg", textDecoration: "underline wavy", textDecorationColor: "fg.error", children: text.slice(error.start, error.end) || " " }),
|
|
9283
9736
|
text.slice(error.end)
|
|
9284
9737
|
] })
|
|
9285
9738
|
] })
|
|
9286
9739
|
] });
|
|
9287
9740
|
}
|
|
9288
9741
|
function CardGrid({ rows: rows2, loading, count, minWidth, render: render2, empty, "aria-label": label }) {
|
|
9289
|
-
if (rows2 && rows2.length === 0 && !loading) return typeof empty === "string" ? /* @__PURE__ */
|
|
9290
|
-
return /* @__PURE__ */
|
|
9291
|
-
|
|
9742
|
+
if (rows2 && rows2.length === 0 && !loading) return typeof empty === "string" ? /* @__PURE__ */ jsx59(EmptyState, { title: empty }) : /* @__PURE__ */ jsx59(Fragment21, { children: empty });
|
|
9743
|
+
return /* @__PURE__ */ jsx59(
|
|
9744
|
+
chakra36.ul,
|
|
9292
9745
|
{
|
|
9293
9746
|
role: "list",
|
|
9294
9747
|
"aria-label": label,
|
|
@@ -9300,22 +9753,22 @@ function CardGrid({ rows: rows2, loading, count, minWidth, render: render2, empt
|
|
|
9300
9753
|
gap: "3",
|
|
9301
9754
|
gridTemplateColumns: `repeat(auto-fill, minmax(min(${minWidth}, 100%), 1fr))`,
|
|
9302
9755
|
"data-layout": "cards",
|
|
9303
|
-
children: rows2 ? rows2.map((row) => /* @__PURE__ */
|
|
9756
|
+
children: rows2 ? rows2.map((row) => /* @__PURE__ */ jsx59(chakra36.li, { display: "flex", minW: "0", children: render2(row) }, row.id)) : Array.from({ length: Math.min(count, 9) }, (_, i) => /* @__PURE__ */ jsx59(chakra36.li, { h: "9.5rem", rounded: "lg", bg: "bg.subtle", "aria-hidden": true }, i))
|
|
9304
9757
|
}
|
|
9305
9758
|
);
|
|
9306
9759
|
}
|
|
9307
9760
|
|
|
9308
9761
|
// src/components/FileDrop.tsx
|
|
9309
|
-
import { forwardRef as forwardRef9, useLayoutEffect as
|
|
9310
|
-
import { Box as
|
|
9762
|
+
import { forwardRef as forwardRef9, useLayoutEffect as useLayoutEffect5, useRef as useRef21 } from "react";
|
|
9763
|
+
import { Box as Box14, HStack as HStack14, Portal as Portal18, Text as Text21 } from "@chakra-ui/react";
|
|
9311
9764
|
import { ArrowDownToLine } from "lucide-react";
|
|
9312
|
-
import { jsx as
|
|
9765
|
+
import { jsx as jsx60, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
9313
9766
|
var OUT3 = `cubic-bezier(${curves.out.join(", ")})`;
|
|
9314
9767
|
var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: over2 = false, hint, children, ...rest }, ref) {
|
|
9315
9768
|
const { reduce } = useMotionSetting();
|
|
9316
9769
|
const lit = awake || over2;
|
|
9317
|
-
return /* @__PURE__ */
|
|
9318
|
-
|
|
9770
|
+
return /* @__PURE__ */ jsxs46(
|
|
9771
|
+
Box14,
|
|
9319
9772
|
{
|
|
9320
9773
|
ref,
|
|
9321
9774
|
position: "relative",
|
|
@@ -9333,8 +9786,8 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
9333
9786
|
...rest,
|
|
9334
9787
|
children: [
|
|
9335
9788
|
children,
|
|
9336
|
-
/* @__PURE__ */
|
|
9337
|
-
|
|
9789
|
+
/* @__PURE__ */ jsx60(Presence, { show: lit, from: "fade", position: "absolute", inset: "0", rounded: "l2", zIndex: "1", pointerEvents: "none", children: /* @__PURE__ */ jsxs46(
|
|
9790
|
+
HStack14,
|
|
9338
9791
|
{
|
|
9339
9792
|
h: "full",
|
|
9340
9793
|
justify: "center",
|
|
@@ -9347,8 +9800,8 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
9347
9800
|
textAlign: "center",
|
|
9348
9801
|
style: { transition: "background-color 160ms ease" },
|
|
9349
9802
|
children: [
|
|
9350
|
-
/* @__PURE__ */
|
|
9351
|
-
/* @__PURE__ */
|
|
9803
|
+
/* @__PURE__ */ jsx60(Bob, { active: over2 && !reduce }),
|
|
9804
|
+
/* @__PURE__ */ jsx60(Text21, { as: "span", truncate: true, children: hint })
|
|
9352
9805
|
]
|
|
9353
9806
|
}
|
|
9354
9807
|
) })
|
|
@@ -9357,8 +9810,8 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
9357
9810
|
);
|
|
9358
9811
|
});
|
|
9359
9812
|
function Bob({ active }) {
|
|
9360
|
-
const ref =
|
|
9361
|
-
|
|
9813
|
+
const ref = useRef21(null);
|
|
9814
|
+
useLayoutEffect5(() => {
|
|
9362
9815
|
if (!active) return;
|
|
9363
9816
|
const animation = ref.current?.animate?.([{ transform: "translateY(0)" }, { transform: "translateY(3px)" }, { transform: "translateY(0)" }], {
|
|
9364
9817
|
duration: 900,
|
|
@@ -9367,60 +9820,60 @@ function Bob({ active }) {
|
|
|
9367
9820
|
});
|
|
9368
9821
|
return () => animation?.cancel();
|
|
9369
9822
|
}, [active]);
|
|
9370
|
-
return /* @__PURE__ */
|
|
9823
|
+
return /* @__PURE__ */ jsx60(Box14, { as: "span", ref, display: "inline-flex", flexShrink: 0, _icon: { boxSize: "4" }, children: /* @__PURE__ */ jsx60(ArrowDownToLine, {}) });
|
|
9371
9824
|
}
|
|
9372
9825
|
function DropHint({ show, children }) {
|
|
9373
|
-
return /* @__PURE__ */
|
|
9374
|
-
/* @__PURE__ */
|
|
9375
|
-
/* @__PURE__ */
|
|
9826
|
+
return /* @__PURE__ */ jsx60(Portal18, { children: /* @__PURE__ */ jsx60(Box14, { position: "fixed", insetInline: "0", bottom: "6", display: "flex", justifyContent: "center", pointerEvents: "none", zIndex: "toast", px: "4", children: /* @__PURE__ */ jsx60(Presence, { show, from: "rise", children: /* @__PURE__ */ jsxs46(HStack14, { 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: [
|
|
9827
|
+
/* @__PURE__ */ jsx60(ArrowDownToLine, {}),
|
|
9828
|
+
/* @__PURE__ */ jsx60(Text21, { as: "span", truncate: true, children })
|
|
9376
9829
|
] }) }) }) });
|
|
9377
9830
|
}
|
|
9378
9831
|
|
|
9379
9832
|
// src/components/UploadList.tsx
|
|
9380
|
-
import { useLayoutEffect as
|
|
9381
|
-
import { Box as
|
|
9833
|
+
import { useLayoutEffect as useLayoutEffect6, useRef as useRef22 } from "react";
|
|
9834
|
+
import { Box as Box15, chakra as chakra37, HStack as HStack15, Stack as Stack15, Text as Text22 } from "@chakra-ui/react";
|
|
9382
9835
|
import { Check as Check3, File as FileIcon, RotateCcw, TriangleAlert, X as X3 } from "lucide-react";
|
|
9383
|
-
import { jsx as
|
|
9836
|
+
import { jsx as jsx61, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
9384
9837
|
var OUT4 = `cubic-bezier(${curves.out.join(", ")})`;
|
|
9385
9838
|
function UploadList({ rows: rows2, summary, fraction, announce, labels, onCancel, onRetry, onDismiss }) {
|
|
9386
|
-
return /* @__PURE__ */
|
|
9387
|
-
/* @__PURE__ */
|
|
9388
|
-
rows2.length > 0 && summary != null && /* @__PURE__ */
|
|
9389
|
-
/* @__PURE__ */
|
|
9390
|
-
fraction != null && /* @__PURE__ */
|
|
9839
|
+
return /* @__PURE__ */ jsxs47(Stack15, { gap: "2", "data-testid": "upload-list", children: [
|
|
9840
|
+
/* @__PURE__ */ jsx61(chakra37.span, { srOnly: true, "aria-live": "polite", children: announce }),
|
|
9841
|
+
rows2.length > 0 && summary != null && /* @__PURE__ */ jsxs47(Stack15, { gap: "1", children: [
|
|
9842
|
+
/* @__PURE__ */ jsx61(Text22, { textStyle: "caption", color: "fg.muted", children: summary }),
|
|
9843
|
+
fraction != null && /* @__PURE__ */ jsx61(Bar2, { fraction, tone: "accent", label: typeof summary === "string" ? summary : void 0 })
|
|
9391
9844
|
] }),
|
|
9392
|
-
/* @__PURE__ */
|
|
9845
|
+
/* @__PURE__ */ jsx61(Stack15, { gap: "1.5", position: "relative", children: /* @__PURE__ */ jsx61(PresenceList, { children: rows2.map((row) => /* @__PURE__ */ jsx61(PresenceItem, { children: /* @__PURE__ */ jsx61(Row, { row, labels, onCancel, onRetry, onDismiss }) }, row.id)) }) })
|
|
9393
9846
|
] });
|
|
9394
9847
|
}
|
|
9395
9848
|
function Row({ row, labels, onCancel, onRetry, onDismiss }) {
|
|
9396
9849
|
const going = row.state === "waiting" || row.state === "sending";
|
|
9397
9850
|
const trouble = row.state === "failed" || row.state === "refused";
|
|
9398
|
-
return /* @__PURE__ */
|
|
9399
|
-
/* @__PURE__ */
|
|
9400
|
-
/* @__PURE__ */
|
|
9401
|
-
/* @__PURE__ */
|
|
9402
|
-
/* @__PURE__ */
|
|
9403
|
-
/* @__PURE__ */
|
|
9851
|
+
return /* @__PURE__ */ jsxs47(HStack15, { 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: [
|
|
9852
|
+
/* @__PURE__ */ jsx61(Preview, { src: row.preview }),
|
|
9853
|
+
/* @__PURE__ */ jsxs47(Stack15, { gap: "1", flex: "1", minW: "0", children: [
|
|
9854
|
+
/* @__PURE__ */ jsxs47(HStack15, { gap: "2", justify: "space-between", children: [
|
|
9855
|
+
/* @__PURE__ */ jsx61(Text22, { as: "span", fontWeight: "medium", truncate: true, children: /* @__PURE__ */ jsx61("bdi", { children: row.name }) }),
|
|
9856
|
+
/* @__PURE__ */ jsx61(Text22, { as: "span", textStyle: "caption", color: trouble ? "fg.error" : "fg.muted", flexShrink: 0, fontVariantNumeric: "tabular-nums", children: row.state === "done" ? /* @__PURE__ */ jsx61(Done, {}) : row.status })
|
|
9404
9857
|
] }),
|
|
9405
|
-
(going || row.state === "done") && /* @__PURE__ */
|
|
9406
|
-
row.detail != null && /* @__PURE__ */
|
|
9407
|
-
trouble && /* @__PURE__ */
|
|
9858
|
+
(going || row.state === "done") && /* @__PURE__ */ jsx61(Bar2, { fraction: row.state === "done" ? 1 : row.fraction, tone: row.state === "done" ? "success" : "accent", label: row.name, quiet: row.state === "waiting" }),
|
|
9859
|
+
row.detail != null && /* @__PURE__ */ jsxs47(Text22, { as: "span", textStyle: "caption", color: trouble ? "fg.error" : "fg.muted", truncate: true, children: [
|
|
9860
|
+
trouble && /* @__PURE__ */ jsx61(Box15, { as: "span", display: "inline-flex", verticalAlign: "-0.15em", me: "1", _icon: { boxSize: "3.5" }, children: /* @__PURE__ */ jsx61(TriangleAlert, {}) }),
|
|
9408
9861
|
row.detail
|
|
9409
9862
|
] })
|
|
9410
9863
|
] }),
|
|
9411
|
-
going && /* @__PURE__ */
|
|
9412
|
-
row.state === "failed" && /* @__PURE__ */
|
|
9413
|
-
trouble && /* @__PURE__ */
|
|
9864
|
+
going && /* @__PURE__ */ jsx61(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.cancel(row.name), onClick: () => onCancel(row.id), children: /* @__PURE__ */ jsx61(X3, {}) }),
|
|
9865
|
+
row.state === "failed" && /* @__PURE__ */ jsx61(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.retry(row.name), onClick: () => onRetry(row.id), children: /* @__PURE__ */ jsx61(RotateCcw, {}) }),
|
|
9866
|
+
trouble && /* @__PURE__ */ jsx61(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.dismiss(row.name), onClick: () => onDismiss(row.id), children: /* @__PURE__ */ jsx61(X3, {}) })
|
|
9414
9867
|
] });
|
|
9415
9868
|
}
|
|
9416
9869
|
function Preview({ src }) {
|
|
9417
|
-
return /* @__PURE__ */
|
|
9870
|
+
return /* @__PURE__ */ jsx61(Box15, { boxSize: "8", flexShrink: 0, rounded: "l1", overflow: "hidden", bg: "bg.muted", color: "fg.subtle", display: "grid", placeItems: "center", _icon: { boxSize: "4" }, children: src ? /* @__PURE__ */ jsx61(chakra37.img, { src, alt: "", boxSize: "full", objectFit: "cover" }) : /* @__PURE__ */ jsx61(FileIcon, {}) });
|
|
9418
9871
|
}
|
|
9419
9872
|
function Bar2({ fraction, tone, label, quiet: quiet2 }) {
|
|
9420
9873
|
const { reduce } = useMotionSetting();
|
|
9421
9874
|
const percent = Math.round(Math.max(0, Math.min(1, fraction)) * 100);
|
|
9422
|
-
return /* @__PURE__ */
|
|
9423
|
-
|
|
9875
|
+
return /* @__PURE__ */ jsx61(Box15, { 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__ */ jsx61(
|
|
9876
|
+
Box15,
|
|
9424
9877
|
{
|
|
9425
9878
|
h: "full",
|
|
9426
9879
|
rounded: "full",
|
|
@@ -9433,9 +9886,9 @@ function Bar2({ fraction, tone, label, quiet: quiet2 }) {
|
|
|
9433
9886
|
) });
|
|
9434
9887
|
}
|
|
9435
9888
|
function Done() {
|
|
9436
|
-
const ref =
|
|
9889
|
+
const ref = useRef22(null);
|
|
9437
9890
|
const { reduce } = useMotionSetting();
|
|
9438
|
-
|
|
9891
|
+
useLayoutEffect6(() => {
|
|
9439
9892
|
if (reduce) return;
|
|
9440
9893
|
ref.current?.animate?.(
|
|
9441
9894
|
[
|
|
@@ -9446,11 +9899,11 @@ function Done() {
|
|
|
9446
9899
|
{ duration: 260, easing: OUT4 }
|
|
9447
9900
|
);
|
|
9448
9901
|
}, []);
|
|
9449
|
-
return /* @__PURE__ */
|
|
9902
|
+
return /* @__PURE__ */ jsx61(chakra37.span, { ref, display: "inline-grid", placeItems: "center", boxSize: "4", rounded: "full", bg: "fg.success", color: "bg", _icon: { boxSize: "3" }, children: /* @__PURE__ */ jsx61(Check3, { strokeWidth: 3 }) });
|
|
9450
9903
|
}
|
|
9451
9904
|
|
|
9452
9905
|
// src/files/drop.ts
|
|
9453
|
-
import { useEffect as
|
|
9906
|
+
import { useEffect as useEffect19, useRef as useRef23, useState as useState26, useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
9454
9907
|
|
|
9455
9908
|
// src/files/upload-plan.ts
|
|
9456
9909
|
var UPLOADS_AT_ONCE = 3;
|
|
@@ -9609,12 +10062,12 @@ function droppedFiles(data) {
|
|
|
9609
10062
|
return Promise.resolve(Array.from(data.files).filter((f) => !JUNK.test(f.name)).map((file) => ({ file, path: file.name })));
|
|
9610
10063
|
}
|
|
9611
10064
|
function useDropZone(ref, { enabled = true, onFiles }) {
|
|
9612
|
-
const [state, setState] =
|
|
9613
|
-
const take =
|
|
9614
|
-
|
|
10065
|
+
const [state, setState] = useState26({ over: false, part: null });
|
|
10066
|
+
const take = useRef23(onFiles);
|
|
10067
|
+
useEffect19(() => {
|
|
9615
10068
|
take.current = onFiles;
|
|
9616
10069
|
}, [onFiles]);
|
|
9617
|
-
|
|
10070
|
+
useEffect19(() => {
|
|
9618
10071
|
const zone = ref.current;
|
|
9619
10072
|
if (!zone || !enabled) return;
|
|
9620
10073
|
let depth = 0;
|
|
@@ -9661,11 +10114,11 @@ function useDropZone(ref, { enabled = true, onFiles }) {
|
|
|
9661
10114
|
return state;
|
|
9662
10115
|
}
|
|
9663
10116
|
function usePageDrop({ enabled = true, onFiles }) {
|
|
9664
|
-
const take =
|
|
9665
|
-
|
|
10117
|
+
const take = useRef23(onFiles);
|
|
10118
|
+
useEffect19(() => {
|
|
9666
10119
|
take.current = onFiles;
|
|
9667
10120
|
}, [onFiles]);
|
|
9668
|
-
|
|
10121
|
+
useEffect19(() => {
|
|
9669
10122
|
if (!enabled) return;
|
|
9670
10123
|
const move = (e) => {
|
|
9671
10124
|
if (!isFiles(e)) return;
|
|
@@ -9687,11 +10140,11 @@ function usePageDrop({ enabled = true, onFiles }) {
|
|
|
9687
10140
|
}
|
|
9688
10141
|
var editable = (target) => target instanceof HTMLElement && (target.isContentEditable || target.closest('input, textarea, select, [contenteditable=""], [contenteditable=true]') != null);
|
|
9689
10142
|
function usePastedFiles({ enabled = true, onFiles }) {
|
|
9690
|
-
const take =
|
|
9691
|
-
|
|
10143
|
+
const take = useRef23(onFiles);
|
|
10144
|
+
useEffect19(() => {
|
|
9692
10145
|
take.current = onFiles;
|
|
9693
10146
|
}, [onFiles]);
|
|
9694
|
-
|
|
10147
|
+
useEffect19(() => {
|
|
9695
10148
|
if (!enabled) return;
|
|
9696
10149
|
const paste = (e) => {
|
|
9697
10150
|
const data = e.clipboardData;
|
|
@@ -9716,8 +10169,8 @@ function usePastedFiles({ enabled = true, onFiles }) {
|
|
|
9716
10169
|
}
|
|
9717
10170
|
|
|
9718
10171
|
// src/components/SortableSections.tsx
|
|
9719
|
-
import { useMemo as
|
|
9720
|
-
import { Box as
|
|
10172
|
+
import { useMemo as useMemo15, useState as useState27 } from "react";
|
|
10173
|
+
import { Box as Box16, Stack as Stack16, Text as Text23 } from "@chakra-ui/react";
|
|
9721
10174
|
import {
|
|
9722
10175
|
DndContext as DndContext4,
|
|
9723
10176
|
DragOverlay as DragOverlay3,
|
|
@@ -9730,7 +10183,7 @@ import {
|
|
|
9730
10183
|
} from "@dnd-kit/core";
|
|
9731
10184
|
import { SortableContext as SortableContext3, sortableKeyboardCoordinates as sortableKeyboardCoordinates3, useSortable as useSortable3, verticalListSortingStrategy as verticalListSortingStrategy3 } from "@dnd-kit/sortable";
|
|
9732
10185
|
import { CSS as CSS4 } from "@dnd-kit/utilities";
|
|
9733
|
-
import { jsx as
|
|
10186
|
+
import { jsx as jsx62, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
9734
10187
|
var sectionId = (id) => `section:${id}`;
|
|
9735
10188
|
function SortableSections({
|
|
9736
10189
|
"aria-label": ariaLabel,
|
|
@@ -9744,13 +10197,13 @@ function SortableSections({
|
|
|
9744
10197
|
skeletonItemHeight = "9"
|
|
9745
10198
|
}) {
|
|
9746
10199
|
const loading = useLoading(own);
|
|
9747
|
-
const shown = loading && sections.length === 0 ? [0, 1].map((n) => ({ id: `skeleton-${n}`, header: /* @__PURE__ */
|
|
10200
|
+
const shown = loading && sections.length === 0 ? [0, 1].map((n) => ({ id: `skeleton-${n}`, header: /* @__PURE__ */ jsx62(TextBone, { width: boneWidth(n, 14, 22) }), items: [] })) : sections;
|
|
9748
10201
|
const sensors = useSensors4(
|
|
9749
10202
|
useSensor4(PointerSensor4, { activationConstraint: { distance: 6 } }),
|
|
9750
10203
|
useSensor4(KeyboardSensor3, { coordinateGetter: sortableKeyboardCoordinates3 })
|
|
9751
10204
|
);
|
|
9752
|
-
const [active, setActive] =
|
|
9753
|
-
const sectionOf =
|
|
10205
|
+
const [active, setActive] = useState27(null);
|
|
10206
|
+
const sectionOf = useMemo15(() => {
|
|
9754
10207
|
const map = /* @__PURE__ */ new Map();
|
|
9755
10208
|
for (const s of sections) for (const item of s.items) map.set(item.id, s.id);
|
|
9756
10209
|
return map;
|
|
@@ -9780,7 +10233,7 @@ function SortableSections({
|
|
|
9780
10233
|
if (from === target && !move.before && !move.after) return;
|
|
9781
10234
|
onMove(item, move);
|
|
9782
10235
|
}
|
|
9783
|
-
return /* @__PURE__ */
|
|
10236
|
+
return /* @__PURE__ */ jsxs48(
|
|
9784
10237
|
DndContext4,
|
|
9785
10238
|
{
|
|
9786
10239
|
sensors,
|
|
@@ -9790,16 +10243,16 @@ function SortableSections({
|
|
|
9790
10243
|
onDragCancel: () => setActive(null),
|
|
9791
10244
|
accessibility: { announcements, screenReaderInstructions: screenReaderInstructions ? { draggable: screenReaderInstructions } : void 0 },
|
|
9792
10245
|
children: [
|
|
9793
|
-
/* @__PURE__ */
|
|
9794
|
-
loading && s.items.length === 0 && Array.from({ length: skeletonItems }, (_, n) => /* @__PURE__ */
|
|
9795
|
-
/* @__PURE__ */
|
|
9796
|
-
/* @__PURE__ */
|
|
10246
|
+
/* @__PURE__ */ jsx62(Stack16, { role: "region", "aria-label": ariaLabel, gap: "4", children: shown.map((s) => /* @__PURE__ */ jsxs48(Section, { section: s, dragging: !!active, children: [
|
|
10247
|
+
loading && s.items.length === 0 && Array.from({ length: skeletonItems }, (_, n) => /* @__PURE__ */ jsxs48(Box16, { h: skeletonItemHeight, px: "2", display: "flex", alignItems: "center", gap: "3", "aria-hidden": "true", children: [
|
|
10248
|
+
/* @__PURE__ */ jsx62(Bone, { width: "14", height: "4" }),
|
|
10249
|
+
/* @__PURE__ */ jsx62(TextBone, { width: boneWidth(n, 16, 36) })
|
|
9797
10250
|
] }, n)),
|
|
9798
|
-
s.items.map((item) => /* @__PURE__ */
|
|
9799
|
-
!loading && s.items.length === 0 && s.empty && /* @__PURE__ */
|
|
10251
|
+
s.items.map((item) => /* @__PURE__ */ jsx62(SortableItem, { id: item.id, children: (dragging) => renderItem(item, { dragging }) }, item.id)),
|
|
10252
|
+
!loading && s.items.length === 0 && s.empty && /* @__PURE__ */ jsx62(Text23, { textStyle: "caption", color: "fg.subtle", textAlign: "center", py: "4", children: s.empty }),
|
|
9800
10253
|
!loading && s.footer
|
|
9801
10254
|
] }, s.id)) }),
|
|
9802
|
-
/* @__PURE__ */
|
|
10255
|
+
/* @__PURE__ */ jsx62(DragOverlay3, { children: active ? /* @__PURE__ */ jsx62(Box16, { shadow: "lg", rounded: "l2", bg: "bg.panel", children: renderItem(active, { dragging: true }) }) : null })
|
|
9803
10256
|
]
|
|
9804
10257
|
}
|
|
9805
10258
|
);
|
|
@@ -9807,9 +10260,9 @@ function SortableSections({
|
|
|
9807
10260
|
function Section({ section, dragging, children }) {
|
|
9808
10261
|
const id = sectionId(section.id);
|
|
9809
10262
|
const { setNodeRef, isOver } = useDroppable3({ id });
|
|
9810
|
-
return /* @__PURE__ */
|
|
9811
|
-
/* @__PURE__ */
|
|
9812
|
-
/* @__PURE__ */
|
|
10263
|
+
return /* @__PURE__ */ jsxs48(Box16, { as: "section", borderWidth: "1px", borderColor: "border", rounded: "l3", bg: "bg.panel", "data-section": section.id, children: [
|
|
10264
|
+
/* @__PURE__ */ jsx62(Box16, { px: "3", py: "2", borderBottomWidth: "1px", borderColor: "border.muted", children: section.header }),
|
|
10265
|
+
/* @__PURE__ */ jsx62(SortableContext3, { id, items: section.items.map((i) => i.id), strategy: verticalListSortingStrategy3, children: /* @__PURE__ */ jsx62(
|
|
9813
10266
|
Stack16,
|
|
9814
10267
|
{
|
|
9815
10268
|
ref: setNodeRef,
|
|
@@ -9826,8 +10279,8 @@ function Section({ section, dragging, children }) {
|
|
|
9826
10279
|
}
|
|
9827
10280
|
function SortableItem({ id, children }) {
|
|
9828
10281
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = useSortable3({ id });
|
|
9829
|
-
return /* @__PURE__ */
|
|
9830
|
-
|
|
10282
|
+
return /* @__PURE__ */ jsx62(
|
|
10283
|
+
Box16,
|
|
9831
10284
|
{
|
|
9832
10285
|
ref: setNodeRef,
|
|
9833
10286
|
style: { transform: CSS4.Transform.toString(transform), transition },
|
|
@@ -9843,10 +10296,10 @@ function SortableItem({ id, children }) {
|
|
|
9843
10296
|
}
|
|
9844
10297
|
|
|
9845
10298
|
// src/components/TimelineChart.tsx
|
|
9846
|
-
import { Fragment as Fragment22, useEffect as
|
|
9847
|
-
import { Box as
|
|
10299
|
+
import { Fragment as Fragment22, useEffect as useEffect20, useLayoutEffect as useLayoutEffect7, useRef as useRef24, useState as useState28 } from "react";
|
|
10300
|
+
import { Box as Box17, HStack as HStack16, Popover as Popover4, Portal as Portal19, Stack as Stack17, Text as Text24 } from "@chakra-ui/react";
|
|
9848
10301
|
import { Flag, Trash2 as Trash23 } from "lucide-react";
|
|
9849
|
-
import { jsx as
|
|
10302
|
+
import { jsx as jsx63, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
9850
10303
|
var DAY2 = 864e5;
|
|
9851
10304
|
var toDay = (day) => Math.round(Date.parse(`${day}T00:00:00Z`) / DAY2);
|
|
9852
10305
|
var fromDay = (n) => new Date(n * DAY2).toISOString().slice(0, 10);
|
|
@@ -9884,9 +10337,9 @@ function TimelineChart({
|
|
|
9884
10337
|
const tv = useTokenVar();
|
|
9885
10338
|
const placeholders = useLoading(own) && rows2.length === 0;
|
|
9886
10339
|
const shown = placeholders ? Array.from({ length: skeletonRows }, (_, i) => ({ id: `skeleton-${i}` })) : rows2;
|
|
9887
|
-
const root =
|
|
9888
|
-
const [room, setRoom] =
|
|
9889
|
-
|
|
10340
|
+
const root = useRef24(null);
|
|
10341
|
+
const [room, setRoom] = useState28(0);
|
|
10342
|
+
useEffect20(() => {
|
|
9890
10343
|
const el = root.current;
|
|
9891
10344
|
if (!fill5 || !el) return;
|
|
9892
10345
|
const observer = new ResizeObserver(() => setRoom(Math.max(0, el.clientWidth - labelWidth)));
|
|
@@ -9896,14 +10349,14 @@ function TimelineChart({
|
|
|
9896
10349
|
const origin = toDay(from);
|
|
9897
10350
|
const days = Math.max(toDay(to) - origin + 1, fill5 ? Math.floor(room / dayWidth) : 0);
|
|
9898
10351
|
const width = days * dayWidth;
|
|
9899
|
-
const [drag, setDrag] =
|
|
9900
|
-
const moved =
|
|
9901
|
-
const scrolled =
|
|
9902
|
-
const lastWidth =
|
|
9903
|
-
const anchor =
|
|
10352
|
+
const [drag, setDrag] = useState28(null);
|
|
10353
|
+
const moved = useRef24(false);
|
|
10354
|
+
const scrolled = useRef24(0);
|
|
10355
|
+
const lastWidth = useRef24(dayWidth);
|
|
10356
|
+
const anchor = useRef24(null);
|
|
9904
10357
|
const rtlOf = (el) => getComputedStyle(el).direction === "rtl";
|
|
9905
10358
|
const along = (el) => rtlOf(el) ? -el.scrollLeft : el.scrollLeft;
|
|
9906
|
-
|
|
10359
|
+
useLayoutEffect7(() => {
|
|
9907
10360
|
const el = root.current, before = lastWidth.current;
|
|
9908
10361
|
lastWidth.current = dayWidth;
|
|
9909
10362
|
if (!el || before === dayWidth) return;
|
|
@@ -9914,9 +10367,9 @@ function TimelineChart({
|
|
|
9914
10367
|
el.scrollLeft = rtlOf(el) ? -x : x;
|
|
9915
10368
|
scrolled.current = x;
|
|
9916
10369
|
}, [dayWidth, labelWidth]);
|
|
9917
|
-
const zoomRef =
|
|
10370
|
+
const zoomRef = useRef24({ onZoom, dayWidth });
|
|
9918
10371
|
zoomRef.current = { onZoom, dayWidth };
|
|
9919
|
-
|
|
10372
|
+
useEffect20(() => {
|
|
9920
10373
|
const el = root.current;
|
|
9921
10374
|
if (!el) return;
|
|
9922
10375
|
let sum = 0;
|
|
@@ -9943,29 +10396,29 @@ function TimelineChart({
|
|
|
9943
10396
|
onZoom(step);
|
|
9944
10397
|
}
|
|
9945
10398
|
const { reduce } = useMotionSetting();
|
|
9946
|
-
const layer =
|
|
9947
|
-
const [linking, setLinking] =
|
|
9948
|
-
const [hot, setHot] =
|
|
9949
|
-
const [menu, setMenu] =
|
|
9950
|
-
|
|
10399
|
+
const layer = useRef24(null);
|
|
10400
|
+
const [linking, setLinking] = useState28(null);
|
|
10401
|
+
const [hot, setHot] = useState28(null);
|
|
10402
|
+
const [menu, setMenu] = useState28(null);
|
|
10403
|
+
useEffect20(() => {
|
|
9951
10404
|
if (!linking) return;
|
|
9952
10405
|
const cancel = (e) => e.key === "Escape" && setLinking(null);
|
|
9953
10406
|
window.addEventListener("keydown", cancel);
|
|
9954
10407
|
return () => window.removeEventListener("keydown", cancel);
|
|
9955
10408
|
}, [linking]);
|
|
9956
|
-
const [card, setCard] =
|
|
9957
|
-
const cardTimer =
|
|
10409
|
+
const [card, setCard] = useState28(null);
|
|
10410
|
+
const cardTimer = useRef24(void 0);
|
|
9958
10411
|
const cardOff = () => {
|
|
9959
10412
|
clearTimeout(cardTimer.current);
|
|
9960
10413
|
setCard(null);
|
|
9961
10414
|
};
|
|
9962
|
-
|
|
9963
|
-
|
|
10415
|
+
useEffect20(() => () => clearTimeout(cardTimer.current), []);
|
|
10416
|
+
useEffect20(() => {
|
|
9964
10417
|
if (!card) return;
|
|
9965
10418
|
window.addEventListener("scroll", cardOff, true);
|
|
9966
10419
|
return () => window.removeEventListener("scroll", cardOff, true);
|
|
9967
10420
|
}, [card]);
|
|
9968
|
-
|
|
10421
|
+
useEffect20(() => {
|
|
9969
10422
|
const el = root.current;
|
|
9970
10423
|
if (!reveal || !el) return;
|
|
9971
10424
|
const at = toDay(reveal.day) - origin;
|
|
@@ -9973,8 +10426,8 @@ function TimelineChart({
|
|
|
9973
10426
|
const x = Math.max(0, at * dayWidth + dayWidth / 2 - (el.clientWidth - labelWidth) / 2);
|
|
9974
10427
|
el.scrollTo({ left: getComputedStyle(el).direction === "rtl" ? -x : x, behavior: reduce ? "auto" : "smooth" });
|
|
9975
10428
|
}, [reveal]);
|
|
9976
|
-
const refocus =
|
|
9977
|
-
|
|
10429
|
+
const refocus = useRef24(null);
|
|
10430
|
+
useEffect20(() => {
|
|
9978
10431
|
if (!refocus.current) return;
|
|
9979
10432
|
const bar = root.current?.querySelector(`[data-bar="${CSS.escape(refocus.current)}"]`);
|
|
9980
10433
|
if (bar && document.activeElement !== bar) bar.focus();
|
|
@@ -10115,8 +10568,8 @@ function TimelineChart({
|
|
|
10115
10568
|
const bandsTop = tickHeight, markersTop = tickHeight + (shownBands.length ? STRIP : 0);
|
|
10116
10569
|
const headerHeight = markersTop + (shownMarkers.length ? STRIP : 0);
|
|
10117
10570
|
const todayAt = today ? toDay(today) - origin : -1;
|
|
10118
|
-
return /* @__PURE__ */
|
|
10119
|
-
|
|
10571
|
+
return /* @__PURE__ */ jsxs49(
|
|
10572
|
+
Box17,
|
|
10120
10573
|
{
|
|
10121
10574
|
ref: root,
|
|
10122
10575
|
role: "region",
|
|
@@ -10133,10 +10586,10 @@ function TimelineChart({
|
|
|
10133
10586
|
},
|
|
10134
10587
|
onKeyDown: zoomKey,
|
|
10135
10588
|
children: [
|
|
10136
|
-
instructions && /* @__PURE__ */
|
|
10137
|
-
/* @__PURE__ */
|
|
10138
|
-
/* @__PURE__ */
|
|
10139
|
-
|
|
10589
|
+
instructions && /* @__PURE__ */ jsx63(Text24, { srOnly: true, children: instructions }),
|
|
10590
|
+
/* @__PURE__ */ jsxs49(Box17, { display: "grid", gridTemplateColumns: fill5 ? `${labelWidth}px minmax(${width}px, 1fr)` : `${labelWidth}px ${width}px`, minW: "fit-content", children: [
|
|
10591
|
+
/* @__PURE__ */ jsx63(
|
|
10592
|
+
Box17,
|
|
10140
10593
|
{
|
|
10141
10594
|
position: "sticky",
|
|
10142
10595
|
top: "0",
|
|
@@ -10154,9 +10607,9 @@ function TimelineChart({
|
|
|
10154
10607
|
children: corner
|
|
10155
10608
|
}
|
|
10156
10609
|
),
|
|
10157
|
-
/* @__PURE__ */
|
|
10158
|
-
ticks.map((t, i) => /* @__PURE__ */
|
|
10159
|
-
|
|
10610
|
+
/* @__PURE__ */ jsxs49(Box17, { position: "sticky", top: "0", zIndex: "2", bg: "bg.muted", borderBottomWidth: "1px", borderColor: "border", h: `${headerHeight}px`, overflow: "clip", children: [
|
|
10611
|
+
ticks.map((t, i) => /* @__PURE__ */ jsx63(
|
|
10612
|
+
Box17,
|
|
10160
10613
|
{
|
|
10161
10614
|
position: "absolute",
|
|
10162
10615
|
insetStart: `${t.day * dayWidth}px`,
|
|
@@ -10166,8 +10619,8 @@ function TimelineChart({
|
|
|
10166
10619
|
borderInlineStartWidth: "1px",
|
|
10167
10620
|
borderColor: "border",
|
|
10168
10621
|
"aria-hidden": true,
|
|
10169
|
-
children: /* @__PURE__ */
|
|
10170
|
-
|
|
10622
|
+
children: /* @__PURE__ */ jsx63(
|
|
10623
|
+
Text24,
|
|
10171
10624
|
{
|
|
10172
10625
|
position: "sticky",
|
|
10173
10626
|
insetStart: `${labelWidth}px`,
|
|
@@ -10185,8 +10638,8 @@ function TimelineChart({
|
|
|
10185
10638
|
},
|
|
10186
10639
|
t.day
|
|
10187
10640
|
)),
|
|
10188
|
-
subTicks.map((t) => /* @__PURE__ */
|
|
10189
|
-
|
|
10641
|
+
subTicks.map((t) => /* @__PURE__ */ jsx63(
|
|
10642
|
+
Text24,
|
|
10190
10643
|
{
|
|
10191
10644
|
position: "absolute",
|
|
10192
10645
|
insetStart: `${t.day * dayWidth}px`,
|
|
@@ -10205,8 +10658,8 @@ function TimelineChart({
|
|
|
10205
10658
|
},
|
|
10206
10659
|
t.day
|
|
10207
10660
|
)),
|
|
10208
|
-
offRuns.filter((o) => o.kind === "holiday").map((o) => /* @__PURE__ */
|
|
10209
|
-
|
|
10661
|
+
offRuns.filter((o) => o.kind === "holiday").map((o) => /* @__PURE__ */ jsx63(Tooltip, { content: o.label, children: /* @__PURE__ */ jsx63(
|
|
10662
|
+
Box17,
|
|
10210
10663
|
{
|
|
10211
10664
|
position: "absolute",
|
|
10212
10665
|
insetStart: `${o.a * dayWidth}px`,
|
|
@@ -10220,8 +10673,8 @@ function TimelineChart({
|
|
|
10220
10673
|
"aria-label": o.label
|
|
10221
10674
|
}
|
|
10222
10675
|
) }, `h${o.a}`)),
|
|
10223
|
-
shownBands.map((b) => /* @__PURE__ */
|
|
10224
|
-
|
|
10676
|
+
shownBands.map((b) => /* @__PURE__ */ jsx63(Tooltip, { content: b.detail ?? b.label, children: /* @__PURE__ */ jsx63(
|
|
10677
|
+
Box17,
|
|
10225
10678
|
{
|
|
10226
10679
|
position: "absolute",
|
|
10227
10680
|
insetStart: `${b.a * dayWidth + 1}px`,
|
|
@@ -10237,8 +10690,8 @@ function TimelineChart({
|
|
|
10237
10690
|
focusVisibleRing: "inside",
|
|
10238
10691
|
overflow: "clip",
|
|
10239
10692
|
"aria-label": b.label,
|
|
10240
|
-
children: /* @__PURE__ */
|
|
10241
|
-
|
|
10693
|
+
children: /* @__PURE__ */ jsx63(
|
|
10694
|
+
Text24,
|
|
10242
10695
|
{
|
|
10243
10696
|
position: "sticky",
|
|
10244
10697
|
insetStart: `${labelWidth}px`,
|
|
@@ -10250,13 +10703,13 @@ function TimelineChart({
|
|
|
10250
10703
|
color: b.current ? "colorPalette.fg" : "fg.muted",
|
|
10251
10704
|
fontWeight: b.current ? "medium" : void 0,
|
|
10252
10705
|
truncate: true,
|
|
10253
|
-
children: /* @__PURE__ */
|
|
10706
|
+
children: /* @__PURE__ */ jsx63("bdi", { children: b.label })
|
|
10254
10707
|
}
|
|
10255
10708
|
)
|
|
10256
10709
|
}
|
|
10257
10710
|
) }, b.id)),
|
|
10258
|
-
shownMarkers.map((m4) => /* @__PURE__ */
|
|
10259
|
-
|
|
10711
|
+
shownMarkers.map((m4) => /* @__PURE__ */ jsx63(Tooltip, { content: m4.detail ?? m4.label, children: /* @__PURE__ */ jsxs49(
|
|
10712
|
+
Box17,
|
|
10260
10713
|
{
|
|
10261
10714
|
position: "absolute",
|
|
10262
10715
|
insetStart: `${m4.at * dayWidth + dayWidth / 2 - 1}px`,
|
|
@@ -10280,16 +10733,16 @@ function TimelineChart({
|
|
|
10280
10733
|
focusVisibleRing: "outside",
|
|
10281
10734
|
"aria-label": m4.label,
|
|
10282
10735
|
children: [
|
|
10283
|
-
/* @__PURE__ */
|
|
10284
|
-
/* @__PURE__ */
|
|
10736
|
+
/* @__PURE__ */ jsx63(Flag, { size: 11, "aria-hidden": true }),
|
|
10737
|
+
/* @__PURE__ */ jsx63("bdi", { children: m4.label })
|
|
10285
10738
|
]
|
|
10286
10739
|
}
|
|
10287
10740
|
) }, m4.id))
|
|
10288
10741
|
] }),
|
|
10289
|
-
/* @__PURE__ */
|
|
10290
|
-
/* @__PURE__ */
|
|
10291
|
-
offRuns.map((o) => /* @__PURE__ */
|
|
10292
|
-
|
|
10742
|
+
/* @__PURE__ */ jsx63(Box17, { position: "sticky", insetStart: "0", zIndex: "1", bg: "bg.panel", borderInlineEndWidth: "1px", borderColor: "border", children: shown.map((r, i) => /* @__PURE__ */ jsx63(HStack16, { 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__ */ jsx63(TextBone, { width: boneWidth(i, 12, 26) }) : r.heading ?? (r.item && renderLabel(r.item)) }, r.id)) }),
|
|
10743
|
+
/* @__PURE__ */ jsxs49(Box17, { ref: layer, position: "relative", zIndex: "0", h: `${shown.length * rowHeight}px`, children: [
|
|
10744
|
+
offRuns.map((o) => /* @__PURE__ */ jsx63(
|
|
10745
|
+
Box17,
|
|
10293
10746
|
{
|
|
10294
10747
|
position: "absolute",
|
|
10295
10748
|
insetStart: `${o.a * dayWidth}px`,
|
|
@@ -10303,9 +10756,9 @@ function TimelineChart({
|
|
|
10303
10756
|
},
|
|
10304
10757
|
`o${o.a}`
|
|
10305
10758
|
)),
|
|
10306
|
-
ticks.map((t) => /* @__PURE__ */
|
|
10307
|
-
shownBands.filter((b) => b.current).map((b) => /* @__PURE__ */
|
|
10308
|
-
|
|
10759
|
+
ticks.map((t) => /* @__PURE__ */ jsx63(Box17, { position: "absolute", insetStart: `${t.day * dayWidth}px`, top: "0", bottom: "0", borderInlineStartWidth: "1px", borderColor: "border.muted", "aria-hidden": true }, t.day)),
|
|
10760
|
+
shownBands.filter((b) => b.current).map((b) => /* @__PURE__ */ jsx63(
|
|
10761
|
+
Box17,
|
|
10309
10762
|
{
|
|
10310
10763
|
position: "absolute",
|
|
10311
10764
|
insetStart: `${b.a * dayWidth}px`,
|
|
@@ -10319,8 +10772,8 @@ function TimelineChart({
|
|
|
10319
10772
|
},
|
|
10320
10773
|
b.id
|
|
10321
10774
|
)),
|
|
10322
|
-
shownMarkers.map((m4) => /* @__PURE__ */
|
|
10323
|
-
|
|
10775
|
+
shownMarkers.map((m4) => /* @__PURE__ */ jsx63(
|
|
10776
|
+
Box17,
|
|
10324
10777
|
{
|
|
10325
10778
|
position: "absolute",
|
|
10326
10779
|
insetStart: `${m4.at * dayWidth + dayWidth / 2 - 1}px`,
|
|
@@ -10336,8 +10789,8 @@ function TimelineChart({
|
|
|
10336
10789
|
},
|
|
10337
10790
|
m4.id
|
|
10338
10791
|
)),
|
|
10339
|
-
todayAt >= 0 && todayAt < days && /* @__PURE__ */
|
|
10340
|
-
|
|
10792
|
+
todayAt >= 0 && todayAt < days && /* @__PURE__ */ jsx63(
|
|
10793
|
+
Box17,
|
|
10341
10794
|
{
|
|
10342
10795
|
position: "absolute",
|
|
10343
10796
|
insetStart: `${todayAt * dayWidth + dayWidth / 2}px`,
|
|
@@ -10349,8 +10802,8 @@ function TimelineChart({
|
|
|
10349
10802
|
"aria-hidden": true
|
|
10350
10803
|
}
|
|
10351
10804
|
),
|
|
10352
|
-
shown.map((r, i) => /* @__PURE__ */
|
|
10353
|
-
|
|
10805
|
+
shown.map((r, i) => /* @__PURE__ */ jsx63(
|
|
10806
|
+
Box17,
|
|
10354
10807
|
{
|
|
10355
10808
|
position: "absolute",
|
|
10356
10809
|
insetStart: "0",
|
|
@@ -10364,7 +10817,7 @@ function TimelineChart({
|
|
|
10364
10817
|
},
|
|
10365
10818
|
r.id
|
|
10366
10819
|
)),
|
|
10367
|
-
placeholders && shown.map((r, i) => /* @__PURE__ */
|
|
10820
|
+
placeholders && shown.map((r, i) => /* @__PURE__ */ jsx63(
|
|
10368
10821
|
Bone,
|
|
10369
10822
|
{
|
|
10370
10823
|
position: "absolute",
|
|
@@ -10381,8 +10834,8 @@ function TimelineChart({
|
|
|
10381
10834
|
if (!bl || !bl.start && !bl.end) return null;
|
|
10382
10835
|
const a = Math.max(toDay(bl.start ?? bl.end) - origin, 0), z = Math.min(toDay(bl.end ?? bl.start) - origin, days - 1);
|
|
10383
10836
|
if (z < a) return null;
|
|
10384
|
-
return /* @__PURE__ */
|
|
10385
|
-
|
|
10837
|
+
return /* @__PURE__ */ jsx63(
|
|
10838
|
+
Box17,
|
|
10386
10839
|
{
|
|
10387
10840
|
position: "absolute",
|
|
10388
10841
|
insetStart: `${a * dayWidth}px`,
|
|
@@ -10403,8 +10856,8 @@ function TimelineChart({
|
|
|
10403
10856
|
if (z < a) return null;
|
|
10404
10857
|
const w = (z - a + 1) * dayWidth - 2;
|
|
10405
10858
|
const palette3 = c2.tone === "over" ? "danger" : c2.tone === "full" ? "warning" : "accent";
|
|
10406
|
-
return /* @__PURE__ */
|
|
10407
|
-
|
|
10859
|
+
return /* @__PURE__ */ jsx63(
|
|
10860
|
+
Box17,
|
|
10408
10861
|
{
|
|
10409
10862
|
position: "absolute",
|
|
10410
10863
|
insetStart: `${a * dayWidth + 1}px`,
|
|
@@ -10444,9 +10897,9 @@ function TimelineChart({
|
|
|
10444
10897
|
const thin = tone === "rollup" && !single;
|
|
10445
10898
|
const diamond = single ? { w: `${DIAMOND}px`, h: `${DIAMOND}px`, top: `${i * rowHeight + rowHeight / 2 - DIAMOND / 2}px`, transform: "rotate(45deg)", rounded: "l1" } : null;
|
|
10446
10899
|
const canLink = !!onLink && item.linkable !== false && !drag;
|
|
10447
|
-
return /* @__PURE__ */
|
|
10448
|
-
/* @__PURE__ */
|
|
10449
|
-
|
|
10900
|
+
return /* @__PURE__ */ jsxs49(Fragment22, { children: [
|
|
10901
|
+
/* @__PURE__ */ jsxs49(
|
|
10902
|
+
Box17,
|
|
10450
10903
|
{
|
|
10451
10904
|
role: "button",
|
|
10452
10905
|
tabIndex: 0,
|
|
@@ -10501,8 +10954,8 @@ function TimelineChart({
|
|
|
10501
10954
|
"data-bar": item.id,
|
|
10502
10955
|
children: [
|
|
10503
10956
|
!single && !thin && renderBar?.(item),
|
|
10504
|
-
item.progress != null && !single && /* @__PURE__ */
|
|
10505
|
-
|
|
10957
|
+
item.progress != null && !single && /* @__PURE__ */ jsx63(
|
|
10958
|
+
Box17,
|
|
10506
10959
|
{
|
|
10507
10960
|
position: "absolute",
|
|
10508
10961
|
insetStart: "0",
|
|
@@ -10517,8 +10970,8 @@ function TimelineChart({
|
|
|
10517
10970
|
),
|
|
10518
10971
|
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
|
|
10519
10972
|
// change would be saved twice (the second refused as a conflict).
|
|
10520
|
-
/* @__PURE__ */
|
|
10521
|
-
|
|
10973
|
+
/* @__PURE__ */ jsx63(
|
|
10974
|
+
Box17,
|
|
10522
10975
|
{
|
|
10523
10976
|
position: "absolute",
|
|
10524
10977
|
insetEnd: "0",
|
|
@@ -10541,8 +10994,8 @@ function TimelineChart({
|
|
|
10541
10994
|
]
|
|
10542
10995
|
}
|
|
10543
10996
|
),
|
|
10544
|
-
canLink && (hot === item.id || linking?.from.id === item.id) && /* @__PURE__ */
|
|
10545
|
-
|
|
10997
|
+
canLink && (hot === item.id || linking?.from.id === item.id) && /* @__PURE__ */ jsx63(
|
|
10998
|
+
Box17,
|
|
10546
10999
|
{
|
|
10547
11000
|
position: "absolute",
|
|
10548
11001
|
insetStart: `${single ? right + 3 : Math.max(right, left + 6)}px`,
|
|
@@ -10563,13 +11016,13 @@ function TimelineChart({
|
|
|
10563
11016
|
onPointerUp: linkUp,
|
|
10564
11017
|
onPointerCancel: () => setLinking(null),
|
|
10565
11018
|
"aria-hidden": true,
|
|
10566
|
-
children: /* @__PURE__ */
|
|
11019
|
+
children: /* @__PURE__ */ jsx63(Box17, { w: "2.5", h: "2.5", rounded: "full", bg: "bg.panel", borderWidth: "2px", borderColor: "accent.solid" })
|
|
10567
11020
|
}
|
|
10568
11021
|
)
|
|
10569
11022
|
] }, item.id);
|
|
10570
11023
|
}),
|
|
10571
|
-
/* @__PURE__ */
|
|
10572
|
-
|
|
11024
|
+
/* @__PURE__ */ jsx63(
|
|
11025
|
+
Box17,
|
|
10573
11026
|
{
|
|
10574
11027
|
position: "absolute",
|
|
10575
11028
|
insetInlineStart: "0",
|
|
@@ -10580,8 +11033,8 @@ function TimelineChart({
|
|
|
10580
11033
|
zIndex: "1",
|
|
10581
11034
|
_rtl: { transform: "scaleX(-1)" },
|
|
10582
11035
|
"aria-hidden": !onUnlink,
|
|
10583
|
-
children: /* @__PURE__ */
|
|
10584
|
-
/* @__PURE__ */
|
|
11036
|
+
children: /* @__PURE__ */ jsxs49("svg", { width, height: rows2.length * rowHeight, style: { position: "absolute", left: 0, top: 0 }, children: [
|
|
11037
|
+
/* @__PURE__ */ jsx63("defs", { children: /* @__PURE__ */ jsx63("marker", { id: "abp-arrow", viewBox: "0 0 8 8", refX: "7", refY: "4", markerWidth: "7", markerHeight: "7", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx63("path", { d: "M 0 0 L 8 4 L 0 8 z", fill: "context-stroke" }) }) }),
|
|
10585
11038
|
links.map((l) => {
|
|
10586
11039
|
const f = ys.get(l.from), t = ys.get(l.to);
|
|
10587
11040
|
if (!f || !t) return null;
|
|
@@ -10592,8 +11045,8 @@ function TimelineChart({
|
|
|
10592
11045
|
const picked = menu?.from === l.from && menu.to === l.to;
|
|
10593
11046
|
const faint = !l.strong && links.some((x) => x.strong);
|
|
10594
11047
|
const open = (x, y) => setMenu({ from: l.from, to: l.to, x, y });
|
|
10595
|
-
return /* @__PURE__ */
|
|
10596
|
-
/* @__PURE__ */
|
|
11048
|
+
return /* @__PURE__ */ jsxs49("g", { children: [
|
|
11049
|
+
/* @__PURE__ */ jsx63(
|
|
10597
11050
|
"path",
|
|
10598
11051
|
{
|
|
10599
11052
|
d,
|
|
@@ -10605,7 +11058,7 @@ function TimelineChart({
|
|
|
10605
11058
|
markerEnd: "url(#abp-arrow)"
|
|
10606
11059
|
}
|
|
10607
11060
|
),
|
|
10608
|
-
onUnlink && /* @__PURE__ */
|
|
11061
|
+
onUnlink && /* @__PURE__ */ jsx63(
|
|
10609
11062
|
"path",
|
|
10610
11063
|
{
|
|
10611
11064
|
d,
|
|
@@ -10630,14 +11083,14 @@ function TimelineChart({
|
|
|
10630
11083
|
] })
|
|
10631
11084
|
}
|
|
10632
11085
|
),
|
|
10633
|
-
linking && /* @__PURE__ */
|
|
10634
|
-
/* @__PURE__ */
|
|
10635
|
-
/* @__PURE__ */
|
|
11086
|
+
linking && /* @__PURE__ */ jsxs49("svg", { width: "100%", height: shown.length * rowHeight, style: { position: "absolute", left: 0, top: 0, pointerEvents: "none", zIndex: 3 }, "aria-hidden": true, children: [
|
|
11087
|
+
/* @__PURE__ */ jsx63("line", { x1: linking.x0, y1: linking.y0, x2: linking.x, y2: linking.y, stroke: tv("colors.accent.solid"), strokeWidth: 2, strokeDasharray: "5 4" }),
|
|
11088
|
+
/* @__PURE__ */ jsx63("circle", { cx: linking.x, cy: linking.y, r: 4, fill: tv("colors.accent.solid") })
|
|
10636
11089
|
] })
|
|
10637
11090
|
] })
|
|
10638
11091
|
] }),
|
|
10639
|
-
card && renderCard && items.has(card.id) && /* @__PURE__ */
|
|
10640
|
-
|
|
11092
|
+
card && renderCard && items.has(card.id) && /* @__PURE__ */ jsx63(Portal19, { children: /* @__PURE__ */ jsx63(
|
|
11093
|
+
Box17,
|
|
10641
11094
|
{
|
|
10642
11095
|
id: "abp-timeline-card",
|
|
10643
11096
|
role: "tooltip",
|
|
@@ -10660,7 +11113,7 @@ function TimelineChart({
|
|
|
10660
11113
|
children: renderCard(items.get(card.id))
|
|
10661
11114
|
}
|
|
10662
11115
|
) }),
|
|
10663
|
-
onUnlink && /* @__PURE__ */
|
|
11116
|
+
onUnlink && /* @__PURE__ */ jsx63(
|
|
10664
11117
|
Popover4.Root,
|
|
10665
11118
|
{
|
|
10666
11119
|
open: !!menu,
|
|
@@ -10669,13 +11122,13 @@ function TimelineChart({
|
|
|
10669
11122
|
unmountOnExit: true,
|
|
10670
11123
|
autoFocus: true,
|
|
10671
11124
|
positioning: { placement: "bottom", getAnchorRect: () => menu ? { x: menu.x, y: menu.y, width: 1, height: 1 } : null },
|
|
10672
|
-
children: /* @__PURE__ */
|
|
10673
|
-
/* @__PURE__ */
|
|
10674
|
-
/* @__PURE__ */
|
|
11125
|
+
children: /* @__PURE__ */ jsx63(Portal19, { children: /* @__PURE__ */ jsx63(Popover4.Positioner, { children: /* @__PURE__ */ jsx63(Popover4.Content, { w: "auto", maxW: "calc(100vw - 32px)", children: /* @__PURE__ */ jsx63(Popover4.Body, { children: menu && /* @__PURE__ */ jsxs49(Stack17, { gap: "2", children: [
|
|
11126
|
+
/* @__PURE__ */ jsx63(Text24, { textStyle: "label", children: linkTexts?.arrow(menu.from, menu.to) }),
|
|
11127
|
+
/* @__PURE__ */ jsxs49(Button, { size: "sm", variant: "secondary", onClick: () => {
|
|
10675
11128
|
onUnlink(menu);
|
|
10676
11129
|
setMenu(null);
|
|
10677
11130
|
}, children: [
|
|
10678
|
-
/* @__PURE__ */
|
|
11131
|
+
/* @__PURE__ */ jsx63(Trash23, {}),
|
|
10679
11132
|
linkTexts?.remove
|
|
10680
11133
|
] })
|
|
10681
11134
|
] }) }) }) }) })
|
|
@@ -10687,8 +11140,8 @@ function TimelineChart({
|
|
|
10687
11140
|
}
|
|
10688
11141
|
|
|
10689
11142
|
// src/components/TimelineCards.tsx
|
|
10690
|
-
import { useEffect as
|
|
10691
|
-
import { Box as
|
|
11143
|
+
import { useEffect as useEffect21, useMemo as useMemo16, useRef as useRef25, useState as useState29 } from "react";
|
|
11144
|
+
import { Box as Box18, chakra as chakra38, Grid as Grid4, Stack as Stack18, Text as Text25 } from "@chakra-ui/react";
|
|
10692
11145
|
|
|
10693
11146
|
// src/components/timeline-cards-math.ts
|
|
10694
11147
|
var DAY3 = 864e5;
|
|
@@ -10706,13 +11159,13 @@ function placeCards(items, first, days, scale, colW = columnWidth(scale)) {
|
|
|
10706
11159
|
const dueW = scale === "week" ? colW - 10 : 228;
|
|
10707
11160
|
const room = scale === "week" ? 24 : colW * 2;
|
|
10708
11161
|
const placed = [];
|
|
10709
|
-
const
|
|
11162
|
+
const order2 = items.map((it) => {
|
|
10710
11163
|
const d = dayNumber(it.due) - f;
|
|
10711
11164
|
const s0 = it.start ? dayNumber(it.start) - f : null;
|
|
10712
11165
|
const s = s0 != null && s0 <= d ? s0 : null;
|
|
10713
11166
|
return { it, d, s };
|
|
10714
11167
|
}).filter(({ d, s }) => d >= 0 && (s ?? d) < days).sort((a, b) => (a.s ?? a.d) - (b.s ?? b.d) || a.d - b.d);
|
|
10715
|
-
for (const { it, d, s } of
|
|
11168
|
+
for (const { it, d, s } of order2) {
|
|
10716
11169
|
if (s != null && s < d) {
|
|
10717
11170
|
const l0 = Math.max(0, s);
|
|
10718
11171
|
const l1 = Math.min(days - 1, d);
|
|
@@ -10740,7 +11193,7 @@ function placeCards(items, first, days, scale, colW = columnWidth(scale)) {
|
|
|
10740
11193
|
}
|
|
10741
11194
|
|
|
10742
11195
|
// src/components/TimelineCards.tsx
|
|
10743
|
-
import { jsx as
|
|
11196
|
+
import { jsx as jsx64, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
10744
11197
|
var LANE = 60;
|
|
10745
11198
|
var KEYS = { d: "day", w: "week", m: "month" };
|
|
10746
11199
|
function TimelineCards(props) {
|
|
@@ -10754,8 +11207,8 @@ function TimelineCards(props) {
|
|
|
10754
11207
|
onScale(next);
|
|
10755
11208
|
}
|
|
10756
11209
|
};
|
|
10757
|
-
return /* @__PURE__ */
|
|
10758
|
-
|
|
11210
|
+
return /* @__PURE__ */ jsxs50(
|
|
11211
|
+
chakra38.div,
|
|
10759
11212
|
{
|
|
10760
11213
|
role: "region",
|
|
10761
11214
|
"aria-label": props["aria-label"],
|
|
@@ -10765,15 +11218,15 @@ function TimelineCards(props) {
|
|
|
10765
11218
|
overflow: "hidden",
|
|
10766
11219
|
"data-timeline-cards": scale,
|
|
10767
11220
|
children: [
|
|
10768
|
-
scale === "day" ? /* @__PURE__ */
|
|
11221
|
+
scale === "day" ? /* @__PURE__ */ jsx64(DayGrid, { ...props }) : /* @__PURE__ */ jsx64(Lanes, { ...props, scale }),
|
|
10769
11222
|
props.footer
|
|
10770
11223
|
]
|
|
10771
11224
|
}
|
|
10772
11225
|
);
|
|
10773
11226
|
}
|
|
10774
11227
|
function Card2({ item, p, range, cutStart, cutEnd, style }) {
|
|
10775
|
-
const card = /* @__PURE__ */
|
|
10776
|
-
|
|
11228
|
+
const card = /* @__PURE__ */ jsxs50(
|
|
11229
|
+
chakra38.button,
|
|
10777
11230
|
{
|
|
10778
11231
|
type: "button",
|
|
10779
11232
|
"data-timeline-card": item.id,
|
|
@@ -10797,18 +11250,18 @@ function Card2({ item, p, range, cutStart, cutEnd, style }) {
|
|
|
10797
11250
|
transition: "background 120ms, border-color 120ms",
|
|
10798
11251
|
...style,
|
|
10799
11252
|
children: [
|
|
10800
|
-
/* @__PURE__ */
|
|
10801
|
-
/* @__PURE__ */
|
|
11253
|
+
/* @__PURE__ */ jsx64(Box18, { as: "span", w: "3px", flexShrink: 0, bg: p.accent?.(item) ?? "border.emphasized", "aria-hidden": true }),
|
|
11254
|
+
/* @__PURE__ */ jsx64(Stack18, { as: "span", gap: "0.5", px: "2.5", py: "1.5", minW: "0", flex: "1", justify: "center", children: p.renderCard(item, { range }) })
|
|
10802
11255
|
]
|
|
10803
11256
|
}
|
|
10804
11257
|
);
|
|
10805
|
-
return p.details ? /* @__PURE__ */
|
|
11258
|
+
return p.details ? /* @__PURE__ */ jsx64(Tooltip, { content: p.details(item), positioning: { placement: "bottom-start" }, openDelay: 250, children: card }) : card;
|
|
10806
11259
|
}
|
|
10807
11260
|
function Lanes(p) {
|
|
10808
11261
|
const { days, today, items, scale } = p;
|
|
10809
|
-
const box =
|
|
10810
|
-
const [available, setAvailable] =
|
|
10811
|
-
|
|
11262
|
+
const box = useRef25(null);
|
|
11263
|
+
const [available, setAvailable] = useState29(0);
|
|
11264
|
+
useEffect21(() => {
|
|
10812
11265
|
const el = box.current;
|
|
10813
11266
|
if (!el) return;
|
|
10814
11267
|
const measure = () => setAvailable(el.clientWidth);
|
|
@@ -10818,18 +11271,18 @@ function Lanes(p) {
|
|
|
10818
11271
|
return () => observer.disconnect();
|
|
10819
11272
|
}, []);
|
|
10820
11273
|
const colW = columnWidth(scale, days.length, available);
|
|
10821
|
-
const byId =
|
|
10822
|
-
const { cards, lanes } =
|
|
11274
|
+
const byId = useMemo16(() => new Map(items.map((i) => [i.id, i])), [items]);
|
|
11275
|
+
const { cards, lanes } = useMemo16(() => placeCards(items, days[0], days.length, scale, colW), [items, days, scale, colW]);
|
|
10823
11276
|
const todayIdx = days.indexOf(today);
|
|
10824
11277
|
const gridW = days.length * colW;
|
|
10825
11278
|
const placeholders = useLoading(p.loading) && items.length === 0;
|
|
10826
11279
|
const height = (placeholders ? 4 : Math.max(lanes, 1)) * LANE + 16;
|
|
10827
|
-
return /* @__PURE__ */
|
|
10828
|
-
/* @__PURE__ */
|
|
11280
|
+
return /* @__PURE__ */ jsx64(chakra38.div, { overflowX: "auto", ref: box, children: /* @__PURE__ */ jsxs50(chakra38.div, { position: "relative", minW: "full", w: `${gridW}px`, children: [
|
|
11281
|
+
/* @__PURE__ */ jsx64(chakra38.div, { display: "flex", borderBottomWidth: "1px", borderColor: "border", bg: "bg.subtle", position: "sticky", top: "0", zIndex: "1", children: days.map((d) => {
|
|
10829
11282
|
const isToday = d === today;
|
|
10830
11283
|
const weekStart = new Date(dayNumber(d) * 864e5).getUTCDay() === 0;
|
|
10831
|
-
return /* @__PURE__ */
|
|
10832
|
-
|
|
11284
|
+
return /* @__PURE__ */ jsxs50(
|
|
11285
|
+
chakra38.div,
|
|
10833
11286
|
{
|
|
10834
11287
|
w: `${colW}px`,
|
|
10835
11288
|
flexShrink: 0,
|
|
@@ -10845,9 +11298,9 @@ function Lanes(p) {
|
|
|
10845
11298
|
borderInlineStartWidth: weekStart && scale === "month" ? "1px" : "0",
|
|
10846
11299
|
borderColor: "border",
|
|
10847
11300
|
children: [
|
|
10848
|
-
/* @__PURE__ */
|
|
10849
|
-
/* @__PURE__ */
|
|
10850
|
-
|
|
11301
|
+
/* @__PURE__ */ jsx64(Text25, { as: "span", children: p.weekday(d) }),
|
|
11302
|
+
/* @__PURE__ */ jsx64(
|
|
11303
|
+
Text25,
|
|
10851
11304
|
{
|
|
10852
11305
|
as: "span",
|
|
10853
11306
|
fontVariantNumeric: "tabular-nums",
|
|
@@ -10865,9 +11318,9 @@ function Lanes(p) {
|
|
|
10865
11318
|
d
|
|
10866
11319
|
);
|
|
10867
11320
|
}) }),
|
|
10868
|
-
/* @__PURE__ */
|
|
10869
|
-
todayIdx >= 0 && /* @__PURE__ */
|
|
10870
|
-
|
|
11321
|
+
/* @__PURE__ */ jsx64(chakra38.div, { position: "absolute", insetInlineStart: "0", top: "0", bottom: "0", display: "flex", pointerEvents: "none", "aria-hidden": true, children: days.map((d) => /* @__PURE__ */ jsx64(chakra38.div, { w: `${colW}px`, flexShrink: 0, borderInlineEndWidth: "1px", borderStyle: "dashed", borderColor: "border.muted" }, d)) }),
|
|
11322
|
+
todayIdx >= 0 && /* @__PURE__ */ jsx64(
|
|
11323
|
+
chakra38.div,
|
|
10871
11324
|
{
|
|
10872
11325
|
position: "absolute",
|
|
10873
11326
|
top: "0",
|
|
@@ -10881,7 +11334,7 @@ function Lanes(p) {
|
|
|
10881
11334
|
zIndex: "1"
|
|
10882
11335
|
}
|
|
10883
11336
|
),
|
|
10884
|
-
placeholders ? /* @__PURE__ */
|
|
11337
|
+
placeholders ? /* @__PURE__ */ jsx64(chakra38.div, { position: "relative", h: `${height}px`, "aria-hidden": true, children: [0, 1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ jsx64(
|
|
10885
11338
|
Bone,
|
|
10886
11339
|
{
|
|
10887
11340
|
position: "absolute",
|
|
@@ -10892,10 +11345,10 @@ function Lanes(p) {
|
|
|
10892
11345
|
borderRadius: "l2"
|
|
10893
11346
|
},
|
|
10894
11347
|
i
|
|
10895
|
-
)) }) : cards.length === 0 && p.empty ? /* @__PURE__ */
|
|
11348
|
+
)) }) : cards.length === 0 && p.empty ? /* @__PURE__ */ jsx64(chakra38.div, { position: "relative", py: "6", children: p.empty }) : /* @__PURE__ */ jsx64(chakra38.div, { position: "relative", h: `${height}px`, role: "list", children: cards.map((c2) => {
|
|
10896
11349
|
const item = byId.get(c2.id);
|
|
10897
|
-
return /* @__PURE__ */
|
|
10898
|
-
|
|
11350
|
+
return /* @__PURE__ */ jsx64(
|
|
11351
|
+
chakra38.div,
|
|
10899
11352
|
{
|
|
10900
11353
|
role: "listitem",
|
|
10901
11354
|
position: "absolute",
|
|
@@ -10904,7 +11357,7 @@ function Lanes(p) {
|
|
|
10904
11357
|
w: `${c2.width}px`,
|
|
10905
11358
|
display: "flex",
|
|
10906
11359
|
zIndex: "2",
|
|
10907
|
-
children: /* @__PURE__ */
|
|
11360
|
+
children: /* @__PURE__ */ jsx64(Card2, { item, p, range: c2.range, cutStart: c2.cutStart, cutEnd: c2.cutEnd, style: { w: "full" } })
|
|
10908
11361
|
},
|
|
10909
11362
|
c2.id
|
|
10910
11363
|
);
|
|
@@ -10919,8 +11372,8 @@ function DayGrid(p) {
|
|
|
10919
11372
|
const x = dayNumber(day);
|
|
10920
11373
|
return s <= x && x <= d;
|
|
10921
11374
|
});
|
|
10922
|
-
if (due.length === 0 && p.empty) return /* @__PURE__ */
|
|
10923
|
-
return /* @__PURE__ */
|
|
11375
|
+
if (due.length === 0 && p.empty) return /* @__PURE__ */ jsx64(chakra38.div, { py: "6", children: p.empty });
|
|
11376
|
+
return /* @__PURE__ */ jsx64(Grid4, { role: "list", templateColumns: "repeat(auto-fill, minmax(16rem, 1fr))", gap: "2", p: "3", children: due.map((i) => /* @__PURE__ */ jsx64(chakra38.div, { role: "listitem", display: "flex", children: /* @__PURE__ */ jsx64(Card2, { item: i, p, range: Boolean(i.start && i.start < i.due), style: { w: "full" } }) }, i.id)) });
|
|
10924
11377
|
}
|
|
10925
11378
|
export {
|
|
10926
11379
|
ABP_UI_VERSION,
|
|
@@ -11024,9 +11477,13 @@ export {
|
|
|
11024
11477
|
TranslatedInput,
|
|
11025
11478
|
UPLOADS_AT_ONCE,
|
|
11026
11479
|
UploadList,
|
|
11480
|
+
TRACKS as WIDGET_TRACKS,
|
|
11481
|
+
PRESETS as WIDGET_WIDTHS,
|
|
11482
|
+
WidgetBoard,
|
|
11027
11483
|
abpConfig,
|
|
11028
11484
|
abpListParams,
|
|
11029
11485
|
abpListSource,
|
|
11486
|
+
appendAt,
|
|
11030
11487
|
arriveCss,
|
|
11031
11488
|
asMotionSetting,
|
|
11032
11489
|
avatarPalette,
|
|
@@ -11059,6 +11516,7 @@ export {
|
|
|
11059
11516
|
formatDateTime,
|
|
11060
11517
|
formatMessage,
|
|
11061
11518
|
formatNumber,
|
|
11519
|
+
fromTwelve,
|
|
11062
11520
|
getPasskey,
|
|
11063
11521
|
ghostCss,
|
|
11064
11522
|
groupKey,
|
|
@@ -11084,6 +11542,7 @@ export {
|
|
|
11084
11542
|
readAbpError,
|
|
11085
11543
|
readEvents,
|
|
11086
11544
|
refusal,
|
|
11545
|
+
renumber,
|
|
11087
11546
|
requestStepUp,
|
|
11088
11547
|
setStepUpHandler,
|
|
11089
11548
|
settingsArea,
|