@abpjs/ui 0.2.0-next.29 → 0.2.0-next.30
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 +9 -0
- package/dist/index.d.ts +37 -3
- package/dist/index.js +260 -189
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1560,7 +1560,7 @@ function useTokenVar() {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
|
|
1562
1562
|
// src/version.ts
|
|
1563
|
-
var ABP_UI_VERSION = true ? "0.2.0-next.
|
|
1563
|
+
var ABP_UI_VERSION = true ? "0.2.0-next.30" : "0.0.0-dev";
|
|
1564
1564
|
|
|
1565
1565
|
// src/provider/time-zone.tsx
|
|
1566
1566
|
import { createContext, useContext } from "react";
|
|
@@ -1577,7 +1577,7 @@ function useAbpTimeZone() {
|
|
|
1577
1577
|
import { ChakraProvider, LocaleProvider } from "@chakra-ui/react";
|
|
1578
1578
|
|
|
1579
1579
|
// src/components/ConfirmDialog.tsx
|
|
1580
|
-
import { createContext as createContext4, useCallback, useContext as useContext4, useId, useRef as useRef2, useState as useState2 } from "react";
|
|
1580
|
+
import { createContext as createContext4, useCallback, useContext as useContext4, useEffect as useEffect2, useId, useRef as useRef2, useState as useState2 } from "react";
|
|
1581
1581
|
import { chakra as chakra3, CloseButton, Dialog, Input, Portal, Stack } from "@chakra-ui/react";
|
|
1582
1582
|
|
|
1583
1583
|
// src/provider/labels.tsx
|
|
@@ -1708,6 +1708,7 @@ var defaultQueryListLabels = {
|
|
|
1708
1708
|
var defaultLabels = {
|
|
1709
1709
|
close: "Close",
|
|
1710
1710
|
typeToConfirm: "Type {value} to confirm",
|
|
1711
|
+
preview: "Preview",
|
|
1711
1712
|
cancel: "Cancel",
|
|
1712
1713
|
confirm: "Confirm",
|
|
1713
1714
|
retry: "Retry",
|
|
@@ -1957,6 +1958,9 @@ function ConfirmDialog({
|
|
|
1957
1958
|
const [typed, setTyped] = useState2("");
|
|
1958
1959
|
const typedId = useId();
|
|
1959
1960
|
const locked = typeToConfirm != null && typed.trim() !== typeToConfirm;
|
|
1961
|
+
useEffect2(() => {
|
|
1962
|
+
if (open) setTyped("");
|
|
1963
|
+
}, [open, typeToConfirm]);
|
|
1960
1964
|
return /* @__PURE__ */ jsx6(
|
|
1961
1965
|
Dialog.Root,
|
|
1962
1966
|
{
|
|
@@ -2040,7 +2044,7 @@ function useConfirm() {
|
|
|
2040
2044
|
}
|
|
2041
2045
|
|
|
2042
2046
|
// src/motion/MotionProvider.tsx
|
|
2043
|
-
import { useCallback as useCallback3, useEffect as
|
|
2047
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useMemo, useState as useState4, useSyncExternalStore } from "react";
|
|
2044
2048
|
import { domAnimation, LazyMotion, MotionConfig } from "motion/react";
|
|
2045
2049
|
|
|
2046
2050
|
// src/motion/Celebrate.tsx
|
|
@@ -2206,7 +2210,7 @@ function MotionProvider({ setting: initial = "system", children }) {
|
|
|
2206
2210
|
const [setting, setState] = useState4(initial);
|
|
2207
2211
|
const systemReduces = useSystemReduces();
|
|
2208
2212
|
const reduce = setting === "reduced" || setting === "system" && systemReduces;
|
|
2209
|
-
|
|
2213
|
+
useEffect3(() => {
|
|
2210
2214
|
document.documentElement.dataset.motion = setting;
|
|
2211
2215
|
}, [setting]);
|
|
2212
2216
|
const setSetting = useCallback3((next) => setState(next), []);
|
|
@@ -2333,7 +2337,7 @@ function EmotionRegistry({ useServerInsertedHTML, children }) {
|
|
|
2333
2337
|
}
|
|
2334
2338
|
|
|
2335
2339
|
// src/host/HostContext.tsx
|
|
2336
|
-
import { createContext as createContext7, useCallback as useCallback4, useContext as useContext7, useEffect as
|
|
2340
|
+
import { createContext as createContext7, useCallback as useCallback4, useContext as useContext7, useEffect as useEffect4, useInsertionEffect, useMemo as useMemo2, useRef as useRef4, useState as useState6 } from "react";
|
|
2337
2341
|
|
|
2338
2342
|
// src/host/errors.ts
|
|
2339
2343
|
var AbpApiError = class extends Error {
|
|
@@ -2428,7 +2432,7 @@ function useApiQuery(area, path) {
|
|
|
2428
2432
|
if (id === seq.current) setLoading(false);
|
|
2429
2433
|
}
|
|
2430
2434
|
}, [path, request]);
|
|
2431
|
-
|
|
2435
|
+
useEffect4(() => {
|
|
2432
2436
|
void reload();
|
|
2433
2437
|
}, [reload]);
|
|
2434
2438
|
return { data, error, loading, reload, setData };
|
|
@@ -2493,7 +2497,7 @@ function useNames(kind, ids) {
|
|
|
2493
2497
|
const can = Boolean(kind === "people" ? host?.names : host?.scopes?.name);
|
|
2494
2498
|
const [names, setNames] = useState6({});
|
|
2495
2499
|
const key = useMemo2(() => [...new Set(ids)].sort().join(","), [ids]);
|
|
2496
|
-
|
|
2500
|
+
useEffect4(() => {
|
|
2497
2501
|
const wanted = key ? key.split(",") : [];
|
|
2498
2502
|
const h = latest.current;
|
|
2499
2503
|
const resolve = kind === "people" ? h?.names : h?.scopes?.name;
|
|
@@ -2512,7 +2516,7 @@ function HostSlot({ name, context }) {
|
|
|
2512
2516
|
}
|
|
2513
2517
|
|
|
2514
2518
|
// src/host/StepUpDialog.tsx
|
|
2515
|
-
import { useEffect as
|
|
2519
|
+
import { useEffect as useEffect5, useRef as useRef5, useState as useState7 } from "react";
|
|
2516
2520
|
import { chakra as chakra6, Dialog as Dialog2, Grid, HStack, Input as Input2, Portal as Portal4, Stack as Stack3, Text } from "@chakra-ui/react";
|
|
2517
2521
|
|
|
2518
2522
|
// src/components/Field.tsx
|
|
@@ -2974,7 +2978,7 @@ function StepUpDialog() {
|
|
|
2974
2978
|
const strong = need?.level === "strong";
|
|
2975
2979
|
const settingUp = need?.code === "strong_factor_required";
|
|
2976
2980
|
const call = (path, init = {}) => host.request(`${base}${path}`, { ...init, stepUp: false });
|
|
2977
|
-
|
|
2981
|
+
useEffect5(() => {
|
|
2978
2982
|
setStepUpHandler(
|
|
2979
2983
|
(asked) => new Promise((resolve) => {
|
|
2980
2984
|
settle.current = resolve;
|
|
@@ -3362,7 +3366,7 @@ function AbpTree({ children, system = defaultSystem, host, locale = "en", labels
|
|
|
3362
3366
|
}
|
|
3363
3367
|
|
|
3364
3368
|
// src/components/TranslatedInput.tsx
|
|
3365
|
-
import { useEffect as
|
|
3369
|
+
import { useEffect as useEffect6, useId as useId2, useRef as useRef6, useState as useState8 } from "react";
|
|
3366
3370
|
import { Box, chakra as chakra7, Group, HStack as HStack2, Input as Input3, Popover, Portal as Portal5, Stack as Stack4, Text as Text2 } from "@chakra-ui/react";
|
|
3367
3371
|
import { Languages } from "lucide-react";
|
|
3368
3372
|
|
|
@@ -3444,7 +3448,7 @@ function TranslatedInput({
|
|
|
3444
3448
|
const [suggestions, setSuggestions] = useState8([]);
|
|
3445
3449
|
const [active, setActive] = useState8(0);
|
|
3446
3450
|
const [place, setPlace] = useState8(null);
|
|
3447
|
-
|
|
3451
|
+
useEffect6(() => {
|
|
3448
3452
|
if (!suggestNames || !focused || query.trim().length < MIN_QUERY) {
|
|
3449
3453
|
setSuggestions([]);
|
|
3450
3454
|
return;
|
|
@@ -3463,7 +3467,7 @@ function TranslatedInput({
|
|
|
3463
3467
|
};
|
|
3464
3468
|
}, [query, focused, suggestNames]);
|
|
3465
3469
|
const open = focused && suggestions.length > 0;
|
|
3466
|
-
|
|
3470
|
+
useEffect6(() => {
|
|
3467
3471
|
if (!open) return;
|
|
3468
3472
|
const measure = () => {
|
|
3469
3473
|
const rect = input.current?.getBoundingClientRect();
|
|
@@ -3769,10 +3773,10 @@ function ListFooter({ list, form = "simple" }) {
|
|
|
3769
3773
|
}
|
|
3770
3774
|
|
|
3771
3775
|
// src/utils/settled.ts
|
|
3772
|
-
import { useEffect as
|
|
3776
|
+
import { useEffect as useEffect7, useState as useState9 } from "react";
|
|
3773
3777
|
function useSettledValue(value, ms = 250) {
|
|
3774
3778
|
const [settled, setSettled] = useState9(value);
|
|
3775
|
-
|
|
3779
|
+
useEffect7(() => {
|
|
3776
3780
|
const timer = setTimeout(() => setSettled(value), ms);
|
|
3777
3781
|
return () => clearTimeout(timer);
|
|
3778
3782
|
}, [value, ms]);
|
|
@@ -3780,7 +3784,7 @@ function useSettledValue(value, ms = 250) {
|
|
|
3780
3784
|
}
|
|
3781
3785
|
|
|
3782
3786
|
// src/components/SearchPicker.tsx
|
|
3783
|
-
import { Fragment as Fragment4, useEffect as
|
|
3787
|
+
import { Fragment as Fragment4, useEffect as useEffect8, useId as useId3, useMemo as useMemo5, useState as useState10 } from "react";
|
|
3784
3788
|
import { Box as Box2, chakra as chakra10, Input as Input4, Spinner as Spinner2, Text as Text5 } from "@chakra-ui/react";
|
|
3785
3789
|
import { Plus as Plus2 } from "lucide-react";
|
|
3786
3790
|
import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
@@ -3804,7 +3808,7 @@ function Highlight({ text, query }) {
|
|
|
3804
3808
|
}
|
|
3805
3809
|
function useSettled(value, ms) {
|
|
3806
3810
|
const [settled, setSettled] = useState10(value);
|
|
3807
|
-
|
|
3811
|
+
useEffect8(() => {
|
|
3808
3812
|
const timer = setTimeout(() => setSettled(value), ms);
|
|
3809
3813
|
return () => clearTimeout(timer);
|
|
3810
3814
|
}, [value, ms]);
|
|
@@ -3839,7 +3843,7 @@ function SearchPicker({
|
|
|
3839
3843
|
const [failed, setFailed] = useState10(false);
|
|
3840
3844
|
const settled = useSettled(query, 200);
|
|
3841
3845
|
const canSearch = search != null;
|
|
3842
|
-
|
|
3846
|
+
useEffect8(() => {
|
|
3843
3847
|
if (!open || !search) return;
|
|
3844
3848
|
let cancelled = false;
|
|
3845
3849
|
search(settled.trim()).then((list) => {
|
|
@@ -4026,7 +4030,7 @@ function GroupPicker({ messages, ...rest }) {
|
|
|
4026
4030
|
}
|
|
4027
4031
|
|
|
4028
4032
|
// src/provider/title.tsx
|
|
4029
|
-
import { createContext as createContext10, useContext as useContext10, useEffect as
|
|
4033
|
+
import { createContext as createContext10, useContext as useContext10, useEffect as useEffect9, useRef as useRef7, useState as useState11, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
4030
4034
|
|
|
4031
4035
|
// src/provider/title-claims.ts
|
|
4032
4036
|
var TITLE_SEPARATOR = " \xB7 ";
|
|
@@ -4117,26 +4121,26 @@ function usePageTitle(title) {
|
|
|
4117
4121
|
const id = useRef7(0);
|
|
4118
4122
|
const parts = partsOf(title);
|
|
4119
4123
|
const key = parts.join("\0");
|
|
4120
|
-
|
|
4124
|
+
useEffect9(() => {
|
|
4121
4125
|
if (!store) return;
|
|
4122
4126
|
const mine = store.open();
|
|
4123
4127
|
id.current = mine;
|
|
4124
4128
|
return () => store.setParts(mine, null);
|
|
4125
4129
|
}, [store]);
|
|
4126
|
-
|
|
4130
|
+
useEffect9(() => {
|
|
4127
4131
|
if (store && id.current) store.setParts(id.current, key ? key.split("\0") : null);
|
|
4128
4132
|
}, [store, key]);
|
|
4129
4133
|
}
|
|
4130
4134
|
function usePageTitleSite(name) {
|
|
4131
4135
|
const store = useContext10(TitleContext);
|
|
4132
4136
|
const id = useRef7(0);
|
|
4133
|
-
|
|
4137
|
+
useEffect9(() => {
|
|
4134
4138
|
if (!store) return;
|
|
4135
4139
|
const mine = store.open();
|
|
4136
4140
|
id.current = mine;
|
|
4137
4141
|
return () => store.setSite(mine, null);
|
|
4138
4142
|
}, [store]);
|
|
4139
|
-
|
|
4143
|
+
useEffect9(() => {
|
|
4140
4144
|
if (store && id.current) store.setSite(id.current, name ?? null);
|
|
4141
4145
|
}, [store, name]);
|
|
4142
4146
|
}
|
|
@@ -4152,7 +4156,7 @@ function compareOrdinal(a, b) {
|
|
|
4152
4156
|
}
|
|
4153
4157
|
|
|
4154
4158
|
// src/motion/components.tsx
|
|
4155
|
-
import { Children, cloneElement, isValidElement, useEffect as
|
|
4159
|
+
import { Children, cloneElement, isValidElement, useEffect as useEffect10, useLayoutEffect as useLayoutEffect2, useRef as useRef9 } from "react";
|
|
4156
4160
|
import { AnimatePresence as AnimatePresence2, m as m2 } from "motion/react";
|
|
4157
4161
|
import { chakra as chakra11 } from "@chakra-ui/react";
|
|
4158
4162
|
|
|
@@ -4391,7 +4395,7 @@ function Counter({ value, format, fromZero = true, ...rest }) {
|
|
|
4391
4395
|
const ref = useRef9(null);
|
|
4392
4396
|
const shown = useRef9(fromZero ? 0 : value);
|
|
4393
4397
|
const write = format ?? ((n) => new Intl.NumberFormat(locale, { numberingSystem: "latn", maximumFractionDigits: Number.isInteger(value) ? 0 : 1 }).format(n));
|
|
4394
|
-
|
|
4398
|
+
useEffect10(() => {
|
|
4395
4399
|
const element = ref.current;
|
|
4396
4400
|
if (!element) return;
|
|
4397
4401
|
if (reduce) {
|
|
@@ -4451,7 +4455,7 @@ function Pressable({ lift = false, css, ...rest }) {
|
|
|
4451
4455
|
function ArriveOnChange({ token, children, ...rest }) {
|
|
4452
4456
|
const ref = useRef9(null);
|
|
4453
4457
|
const first = useRef9(true);
|
|
4454
|
-
|
|
4458
|
+
useEffect10(() => {
|
|
4455
4459
|
if (first.current) {
|
|
4456
4460
|
first.current = false;
|
|
4457
4461
|
return;
|
|
@@ -4464,7 +4468,7 @@ function Nudge({ on, children }) {
|
|
|
4464
4468
|
const { reduce } = useMotionSetting();
|
|
4465
4469
|
const ref = useRef9(null);
|
|
4466
4470
|
const last = useRef9(null);
|
|
4467
|
-
|
|
4471
|
+
useEffect10(() => {
|
|
4468
4472
|
const before = last.current;
|
|
4469
4473
|
last.current = on;
|
|
4470
4474
|
if (before == null || on <= before || reduce) return;
|
|
@@ -4679,7 +4683,7 @@ function NavItem({ item, styles, collapsed, group, nested }) {
|
|
|
4679
4683
|
}
|
|
4680
4684
|
|
|
4681
4685
|
// src/components/CommandPalette.tsx
|
|
4682
|
-
import { Fragment as Fragment9, useEffect as
|
|
4686
|
+
import { Fragment as Fragment9, useEffect as useEffect11, useId as useId4, useMemo as useMemo6, useRef as useRef10, useState as useState13 } from "react";
|
|
4683
4687
|
import { chakra as chakra13, Dialog as Dialog3, HStack as HStack4, Portal as Portal8, Spinner as Spinner3, Stack as Stack5, Text as Text6 } from "@chakra-ui/react";
|
|
4684
4688
|
import { CornerDownLeft, Search } from "lucide-react";
|
|
4685
4689
|
import { Fragment as Fragment10, jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
@@ -4704,10 +4708,10 @@ function CommandPalette({ open, onOpenChange, search, labels }) {
|
|
|
4704
4708
|
const [groups, setGroups] = useState13(null);
|
|
4705
4709
|
const [active, setActive] = useState13(0);
|
|
4706
4710
|
const latest = useRef10(search);
|
|
4707
|
-
|
|
4711
|
+
useEffect11(() => {
|
|
4708
4712
|
latest.current = search;
|
|
4709
4713
|
});
|
|
4710
|
-
|
|
4714
|
+
useEffect11(() => {
|
|
4711
4715
|
if (!open) return;
|
|
4712
4716
|
let gone = false;
|
|
4713
4717
|
const timer = setTimeout(() => {
|
|
@@ -4745,7 +4749,7 @@ function CommandPalette({ open, onOpenChange, search, labels }) {
|
|
|
4745
4749
|
choose(items[active]);
|
|
4746
4750
|
}
|
|
4747
4751
|
}
|
|
4748
|
-
|
|
4752
|
+
useEffect11(() => {
|
|
4749
4753
|
document.getElementById(`${listId}-${active}`)?.scrollIntoView({ block: "nearest" });
|
|
4750
4754
|
}, [active, listId]);
|
|
4751
4755
|
let n = -1;
|
|
@@ -5964,7 +5968,7 @@ function TreeCell({ node, folded, label, contextLabel, onFold, children }) {
|
|
|
5964
5968
|
}
|
|
5965
5969
|
|
|
5966
5970
|
// src/components/CalendarGrid.tsx
|
|
5967
|
-
import { useEffect as
|
|
5971
|
+
import { useEffect as useEffect12, useMemo as useMemo8, useRef as useRef12, useState as useState15 } from "react";
|
|
5968
5972
|
import { Box as Box5, chakra as chakra19, Grid as Grid2, Stack as Stack7, Text as Text10 } from "@chakra-ui/react";
|
|
5969
5973
|
import { DndContext, DragOverlay, PointerSensor, useDraggable, useDroppable, useSensor, useSensors } from "@dnd-kit/core";
|
|
5970
5974
|
import { jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
@@ -5995,7 +5999,7 @@ function CalendarGrid({
|
|
|
5995
5999
|
const [active, setActive] = useState15(null);
|
|
5996
6000
|
const root = useRef12(null);
|
|
5997
6001
|
const refocus = useRef12(null);
|
|
5998
|
-
|
|
6002
|
+
useEffect12(() => {
|
|
5999
6003
|
if (!refocus.current) return;
|
|
6000
6004
|
const chip = root.current?.querySelector(`[data-item="${CSS.escape(refocus.current)}"]`);
|
|
6001
6005
|
if (chip && document.activeElement !== chip) chip.focus();
|
|
@@ -6797,7 +6801,7 @@ function abpListSource(request, path, options = {}) {
|
|
|
6797
6801
|
var pageCount = (total, pageSize) => Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
|
|
6798
6802
|
|
|
6799
6803
|
// src/lists/useListState.ts
|
|
6800
|
-
import { useCallback as useCallback10, useEffect as
|
|
6804
|
+
import { useCallback as useCallback10, useEffect as useEffect13, useMemo as useMemo9, useRef as useRef15, useState as useState17 } from "react";
|
|
6801
6805
|
function useListState(source, options = {}) {
|
|
6802
6806
|
const { searchDelay = 250 } = options;
|
|
6803
6807
|
const [query, setQuery] = useState17(() => emptyQuery(options.initial));
|
|
@@ -6808,7 +6812,7 @@ function useListState(source, options = {}) {
|
|
|
6808
6812
|
const [error, setError] = useState17(null);
|
|
6809
6813
|
const [round, setRound] = useState17(0);
|
|
6810
6814
|
const told = useRef15(options.onQueryChange);
|
|
6811
|
-
|
|
6815
|
+
useEffect13(() => {
|
|
6812
6816
|
told.current = options.onQueryChange;
|
|
6813
6817
|
});
|
|
6814
6818
|
const [shownKey, setShownKey] = useState17(source.key);
|
|
@@ -6817,7 +6821,7 @@ function useListState(source, options = {}) {
|
|
|
6817
6821
|
setRows(void 0);
|
|
6818
6822
|
setTotal(0);
|
|
6819
6823
|
}
|
|
6820
|
-
|
|
6824
|
+
useEffect13(() => {
|
|
6821
6825
|
const abort = new AbortController();
|
|
6822
6826
|
setBusy(true);
|
|
6823
6827
|
source.load(query, abort.signal).then(
|
|
@@ -6843,7 +6847,7 @@ function useListState(source, options = {}) {
|
|
|
6843
6847
|
return n;
|
|
6844
6848
|
});
|
|
6845
6849
|
}, []);
|
|
6846
|
-
|
|
6850
|
+
useEffect13(() => {
|
|
6847
6851
|
if (typed === query.search) return;
|
|
6848
6852
|
const timer = setTimeout(() => change((q) => ({ ...q, search: typed, page: 1 })), searchDelay);
|
|
6849
6853
|
return () => clearTimeout(timer);
|
|
@@ -6891,9 +6895,9 @@ function useAreaListSource(area, path, options = {}) {
|
|
|
6891
6895
|
}
|
|
6892
6896
|
|
|
6893
6897
|
// src/components/FormDialog.tsx
|
|
6894
|
-
import { useRef as useRef16, useState as useState18 } from "react";
|
|
6895
|
-
import { chakra as chakra26, CloseButton as CloseButton2, Dialog as Dialog4, Portal as Portal12, Stack as Stack8 } from "@chakra-ui/react";
|
|
6896
|
-
import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6898
|
+
import { Fragment as Fragment15, useId as useId5, useRef as useRef16, useState as useState18 } from "react";
|
|
6899
|
+
import { chakra as chakra26, CloseButton as CloseButton2, Dialog as Dialog4, Grid as Grid3, HStack as HStack8, Portal as Portal12, Stack as Stack8, Text as Text12 } from "@chakra-ui/react";
|
|
6900
|
+
import { Fragment as Fragment16, jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6897
6901
|
var isControl = (el) => el instanceof HTMLInputElement || el instanceof HTMLSelectElement || el instanceof HTMLTextAreaElement;
|
|
6898
6902
|
function invalidControls(form) {
|
|
6899
6903
|
return [...form.elements].filter((el) => isControl(el) && !el.disabled && el.willValidate && !el.checkValidity());
|
|
@@ -6912,7 +6916,25 @@ function mark(el, wrong) {
|
|
|
6912
6916
|
delete el.dataset.leftInvalid;
|
|
6913
6917
|
}
|
|
6914
6918
|
}
|
|
6915
|
-
function FormDialog({
|
|
6919
|
+
function FormDialog({
|
|
6920
|
+
open,
|
|
6921
|
+
onOpenChange,
|
|
6922
|
+
title,
|
|
6923
|
+
description,
|
|
6924
|
+
submitLabel,
|
|
6925
|
+
onSubmit,
|
|
6926
|
+
busy,
|
|
6927
|
+
error,
|
|
6928
|
+
size,
|
|
6929
|
+
hideSubmit,
|
|
6930
|
+
submitDisabled,
|
|
6931
|
+
preview,
|
|
6932
|
+
previewTitle,
|
|
6933
|
+
dangerAction,
|
|
6934
|
+
children
|
|
6935
|
+
}) {
|
|
6936
|
+
const shape = size ?? (preview != null ? "wide" : "md");
|
|
6937
|
+
const previewHeading = useId5();
|
|
6916
6938
|
const labels = useAbpLabels();
|
|
6917
6939
|
const { locale } = useAbpLocale();
|
|
6918
6940
|
const summary = useRef16(null);
|
|
@@ -6941,9 +6963,9 @@ function FormDialog({ open, onOpenChange, title, description, submitLabel, onSub
|
|
|
6941
6963
|
mark(e.target, wrong);
|
|
6942
6964
|
if (problems.length > 0) setProblems(invalidControls(e.currentTarget).map(describe2));
|
|
6943
6965
|
}
|
|
6944
|
-
return /* @__PURE__ */ jsx44(Dialog4.Root, { open, onOpenChange: (e) => onOpenChange(e.open), size, placement: "center", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs32(Portal12, { children: [
|
|
6966
|
+
return /* @__PURE__ */ jsx44(Dialog4.Root, { open, onOpenChange: (e) => onOpenChange(e.open), size: shape === "wide" ? "xl" : shape, placement: "center", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs32(Portal12, { children: [
|
|
6945
6967
|
/* @__PURE__ */ jsx44(Dialog4.Backdrop, {}),
|
|
6946
|
-
/* @__PURE__ */ jsx44(Dialog4.Positioner, { children: /* @__PURE__ */ jsx44(Dialog4.Content, { asChild: true, children: /* @__PURE__ */ jsxs32(
|
|
6968
|
+
/* @__PURE__ */ jsx44(Dialog4.Positioner, { children: /* @__PURE__ */ jsx44(Dialog4.Content, { asChild: true, ...shape === "wide" ? { maxW: "min(57.5rem, calc(100vw - 2rem))", w: "full" } : {}, children: /* @__PURE__ */ jsxs32(
|
|
6947
6969
|
"form",
|
|
6948
6970
|
{
|
|
6949
6971
|
onSubmit: hideSubmit ? (e) => e.preventDefault() : submit,
|
|
@@ -6952,27 +6974,60 @@ function FormDialog({ open, onOpenChange, title, description, submitLabel, onSub
|
|
|
6952
6974
|
noValidate: true,
|
|
6953
6975
|
children: [
|
|
6954
6976
|
/* @__PURE__ */ jsx44(Dialog4.Header, { children: /* @__PURE__ */ jsx44(Dialog4.Title, { children: title }) }),
|
|
6955
|
-
/* @__PURE__ */ jsx44(Dialog4.Body, { children: /* @__PURE__ */ jsxs32(
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6977
|
+
/* @__PURE__ */ jsx44(Dialog4.Body, { children: /* @__PURE__ */ jsxs32(
|
|
6978
|
+
Grid3,
|
|
6979
|
+
{
|
|
6980
|
+
templateColumns: preview != null ? { base: "minmax(0, 1fr)", md: "minmax(0, 1.35fr) minmax(0, 1fr)" } : "minmax(0, 1fr)",
|
|
6981
|
+
gap: "6",
|
|
6982
|
+
alignItems: "start",
|
|
6983
|
+
children: [
|
|
6984
|
+
/* @__PURE__ */ jsxs32(Stack8, { gap: "field", minW: "0", children: [
|
|
6985
|
+
description != null && /* @__PURE__ */ jsx44(Dialog4.Description, { children: description }),
|
|
6986
|
+
problems.length > 0 && /* @__PURE__ */ jsx44(chakra26.div, { ref: summary, tabIndex: -1, outline: "none", "data-form-problems": "", children: /* @__PURE__ */ jsx44(InlineAlert, { tone: "danger", title: formatMessage(locale, labels.formFix, { count: problems.length }), children: /* @__PURE__ */ jsx44(chakra26.ul, { ps: "4", listStyleType: "disc", children: problems.map((p, i) => /* @__PURE__ */ jsx44("li", { children: /* @__PURE__ */ jsx44(
|
|
6987
|
+
chakra26.button,
|
|
6988
|
+
{
|
|
6989
|
+
type: "button",
|
|
6990
|
+
textDecoration: "underline",
|
|
6991
|
+
cursor: "pointer",
|
|
6992
|
+
textAlign: "start",
|
|
6993
|
+
onClick: () => {
|
|
6994
|
+
p.el.focus();
|
|
6995
|
+
p.el.scrollIntoView({ block: "center" });
|
|
6996
|
+
},
|
|
6997
|
+
children: p.label ? `${p.label}: ${p.message}` : p.message
|
|
6998
|
+
}
|
|
6999
|
+
) }, i)) }) }) }),
|
|
7000
|
+
children,
|
|
7001
|
+
/* @__PURE__ */ jsx44(InlineAlert, { tone: "danger", children: error })
|
|
7002
|
+
] }),
|
|
7003
|
+
preview != null && /* @__PURE__ */ jsxs32(
|
|
7004
|
+
chakra26.aside,
|
|
7005
|
+
{
|
|
7006
|
+
"aria-labelledby": previewHeading,
|
|
7007
|
+
display: "flex",
|
|
7008
|
+
flexDirection: "column",
|
|
7009
|
+
gap: "2",
|
|
7010
|
+
p: "4",
|
|
7011
|
+
bg: "bg.subtle",
|
|
7012
|
+
borderRadius: "l3",
|
|
7013
|
+
minW: "0",
|
|
7014
|
+
position: { md: "sticky" },
|
|
7015
|
+
top: "0",
|
|
7016
|
+
children: [
|
|
7017
|
+
/* @__PURE__ */ jsx44(Text12, { id: previewHeading, textStyle: "label", children: previewTitle ?? labels.preview ?? "Preview" }),
|
|
7018
|
+
preview
|
|
7019
|
+
]
|
|
7020
|
+
}
|
|
7021
|
+
)
|
|
7022
|
+
]
|
|
7023
|
+
}
|
|
7024
|
+
) }),
|
|
6974
7025
|
/* @__PURE__ */ jsxs32(Dialog4.Footer, { children: [
|
|
6975
|
-
|
|
7026
|
+
dangerAction && /* @__PURE__ */ jsxs32(Fragment16, { children: [
|
|
7027
|
+
/* @__PURE__ */ jsx44(Button, { variant: "link", danger: true, onClick: dangerAction.onClick, disabled: dangerAction.disabled, children: dangerAction.label }),
|
|
7028
|
+
/* @__PURE__ */ jsx44(chakra26.span, { flex: "1", "aria-hidden": true })
|
|
7029
|
+
] }),
|
|
7030
|
+
/* @__PURE__ */ jsx44(Dialog4.ActionTrigger, { asChild: true, children: /* @__PURE__ */ jsx44(Button, { variant: "cancel", children: labels.cancel }) }),
|
|
6976
7031
|
!hideSubmit && /* @__PURE__ */ jsx44(Button, { type: "submit", variant: "primary", loading: busy, disabled: submitDisabled, children: submitLabel })
|
|
6977
7032
|
] }),
|
|
6978
7033
|
/* @__PURE__ */ jsx44(Dialog4.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx44(CloseButton2, { size: "sm", "aria-label": labels.close }) })
|
|
@@ -6981,10 +7036,25 @@ function FormDialog({ open, onOpenChange, title, description, submitLabel, onSub
|
|
|
6981
7036
|
) }) })
|
|
6982
7037
|
] }) });
|
|
6983
7038
|
}
|
|
7039
|
+
function PreviewCard({ media, title, subtitle, items = [] }) {
|
|
7040
|
+
return /* @__PURE__ */ jsxs32(Stack8, { gap: "4", p: "4", bg: "bg.panel", borderRadius: "l2", minW: "0", children: [
|
|
7041
|
+
/* @__PURE__ */ jsxs32(HStack8, { gap: "3", minW: "0", children: [
|
|
7042
|
+
media,
|
|
7043
|
+
/* @__PURE__ */ jsxs32(Stack8, { gap: "0.5", minW: "0", children: [
|
|
7044
|
+
/* @__PURE__ */ jsx44(Text12, { textStyle: "lg", fontWeight: "semibold", truncate: true, children: title }),
|
|
7045
|
+
subtitle != null && /* @__PURE__ */ jsx44(Text12, { as: "div", textStyle: "caption", color: "fg.muted", truncate: true, children: subtitle })
|
|
7046
|
+
] })
|
|
7047
|
+
] }),
|
|
7048
|
+
items.length > 0 && /* @__PURE__ */ jsx44(chakra26.dl, { display: "grid", gridTemplateColumns: "auto minmax(0, 1fr)", columnGap: "4", rowGap: "2", textStyle: "body.sm", m: "0", children: items.map((item, i) => /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
7049
|
+
/* @__PURE__ */ jsx44(chakra26.dt, { color: "fg.muted", children: item.label }),
|
|
7050
|
+
/* @__PURE__ */ jsx44(chakra26.dd, { m: "0", minW: "0", truncate: true, children: item.value ?? EMPTY_VALUE })
|
|
7051
|
+
] }, i)) })
|
|
7052
|
+
] });
|
|
7053
|
+
}
|
|
6984
7054
|
|
|
6985
7055
|
// src/settings/SettingsLayout.tsx
|
|
6986
7056
|
import { useState as useState19 } from "react";
|
|
6987
|
-
import { Text as
|
|
7057
|
+
import { Text as Text13 } from "@chakra-ui/react";
|
|
6988
7058
|
|
|
6989
7059
|
// src/components/SearchInput.tsx
|
|
6990
7060
|
import { forwardRef as forwardRef7 } from "react";
|
|
@@ -7030,7 +7100,7 @@ function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav
|
|
|
7030
7100
|
top: /* @__PURE__ */ jsx46(SearchInput, { size: "sm", value: find, onChange: (e) => setFind(e.target.value), placeholder: labels.find, "aria-label": labels.find }),
|
|
7031
7101
|
sections
|
|
7032
7102
|
},
|
|
7033
|
-
navFooter: !found ? /* @__PURE__ */ jsx46(
|
|
7103
|
+
navFooter: !found ? /* @__PURE__ */ jsx46(Text13, { textStyle: "caption", color: "fg.muted", px: "2", children: labels.noSetting }) : void 0,
|
|
7034
7104
|
children
|
|
7035
7105
|
}
|
|
7036
7106
|
);
|
|
@@ -7102,8 +7172,8 @@ function SegmentedControl({
|
|
|
7102
7172
|
}
|
|
7103
7173
|
|
|
7104
7174
|
// src/components/KanbanBoard.tsx
|
|
7105
|
-
import { useEffect as
|
|
7106
|
-
import { Box as Box9, chakra as chakra27, HStack as
|
|
7175
|
+
import { useEffect as useEffect14, useLayoutEffect as useLayoutEffect3, useMemo as useMemo10, useRef as useRef17, useState as useState20 } from "react";
|
|
7176
|
+
import { Box as Box9, chakra as chakra27, HStack as HStack9, Stack as Stack9, Text as Text14 } from "@chakra-ui/react";
|
|
7107
7177
|
import { Check as Check2, ChevronsLeft, ChevronsRight, GripVertical as GripVertical3 } from "lucide-react";
|
|
7108
7178
|
import {
|
|
7109
7179
|
DndContext as DndContext2,
|
|
@@ -7139,13 +7209,13 @@ function between(cell, from, to) {
|
|
|
7139
7209
|
}
|
|
7140
7210
|
|
|
7141
7211
|
// src/components/KanbanBoard.tsx
|
|
7142
|
-
import { Fragment as
|
|
7212
|
+
import { Fragment as Fragment17, jsx as jsx48, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
7143
7213
|
var SKELETON_CARDS = [3, 2, 4, 1, 2];
|
|
7144
7214
|
function PlaceholderCard({ index }) {
|
|
7145
7215
|
return /* @__PURE__ */ jsxs34(Box9, { bg: "bg.panel", borderWidth: "1px", borderColor: "border", rounded: "l2", p: "2.5", children: [
|
|
7146
7216
|
/* @__PURE__ */ jsx48(Box9, { mb: "1", children: /* @__PURE__ */ jsx48(RecordKey, { loading: true }) }),
|
|
7147
|
-
/* @__PURE__ */ jsx48(
|
|
7148
|
-
/* @__PURE__ */ jsx48(
|
|
7217
|
+
/* @__PURE__ */ jsx48(Text14, { textStyle: "body.sm", children: /* @__PURE__ */ jsx48(TextBone, { width: boneWidth(index, 14, 34) }) }),
|
|
7218
|
+
/* @__PURE__ */ jsx48(HStack9, { mt: "2", children: /* @__PURE__ */ jsx48(StatusPill, { loading: true, skeletonWidth: boneWidth(index, 5, 9) }) })
|
|
7149
7219
|
] });
|
|
7150
7220
|
}
|
|
7151
7221
|
var cellId = (lane, column) => `cell:${lane}::${column}`;
|
|
@@ -7293,7 +7363,7 @@ function KanbanBoard({
|
|
|
7293
7363
|
const clear = () => {
|
|
7294
7364
|
if (onSelect && selected && selected.size > 0) onSelect(/* @__PURE__ */ new Set());
|
|
7295
7365
|
};
|
|
7296
|
-
|
|
7366
|
+
useEffect14(() => {
|
|
7297
7367
|
if (!onSelect || !selected || selected.size === 0 || active) return;
|
|
7298
7368
|
const key = (e) => {
|
|
7299
7369
|
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
@@ -7382,7 +7452,7 @@ function KanbanBoard({
|
|
|
7382
7452
|
roundedTop: "l3",
|
|
7383
7453
|
bg: "bg.panel",
|
|
7384
7454
|
"data-drop-column": "",
|
|
7385
|
-
children: /* @__PURE__ */ jsx48(
|
|
7455
|
+
children: /* @__PURE__ */ jsx48(Text14, { textStyle: "caption", fontWeight: "bold", color: "fg.accent", truncate: true, children: dropColumnLabel(movingName) })
|
|
7386
7456
|
}
|
|
7387
7457
|
),
|
|
7388
7458
|
isFolded ? /* @__PURE__ */ jsx48(
|
|
@@ -7401,7 +7471,7 @@ function KanbanBoard({
|
|
|
7401
7471
|
children: /* @__PURE__ */ jsx48(FoldButton, { folded: true, label: foldLabel(name, true), onClick: () => fold(c2.id) })
|
|
7402
7472
|
}
|
|
7403
7473
|
) : /* @__PURE__ */ jsxs34(
|
|
7404
|
-
|
|
7474
|
+
HStack9,
|
|
7405
7475
|
{
|
|
7406
7476
|
justify: "space-between",
|
|
7407
7477
|
gap: "2",
|
|
@@ -7417,7 +7487,7 @@ function KanbanBoard({
|
|
|
7417
7487
|
h: "full",
|
|
7418
7488
|
align: "start",
|
|
7419
7489
|
children: [
|
|
7420
|
-
/* @__PURE__ */ jsxs34(
|
|
7490
|
+
/* @__PURE__ */ jsxs34(HStack9, { gap: "2", minW: "0", children: [
|
|
7421
7491
|
onReorderColumns && !loading && /* @__PURE__ */ jsx48(
|
|
7422
7492
|
ColumnGrip,
|
|
7423
7493
|
{
|
|
@@ -7431,9 +7501,9 @@ function KanbanBoard({
|
|
|
7431
7501
|
onStep: (by) => reorder(c2.id, columns.findIndex((x) => x.id === c2.id) + by)
|
|
7432
7502
|
}
|
|
7433
7503
|
),
|
|
7434
|
-
/* @__PURE__ */ jsx48(
|
|
7504
|
+
/* @__PURE__ */ jsx48(Text14, { as: "span", textStyle: "label", truncate: true, display: "inline-flex", minW: "0", children: c2.title }),
|
|
7435
7505
|
c2.count != null && /* @__PURE__ */ jsx48(CountBadge, { value: c2.count }),
|
|
7436
|
-
c2.meta && /* @__PURE__ */ jsx48(
|
|
7506
|
+
c2.meta && /* @__PURE__ */ jsx48(Text14, { textStyle: "caption", color: c2.over ? "fg.error" : "fg.muted", flexShrink: 0, children: c2.meta })
|
|
7437
7507
|
] }),
|
|
7438
7508
|
!loading && /* @__PURE__ */ jsx48(FoldButton, { folded: false, label: foldLabel(name, false), onClick: () => fold(c2.id) })
|
|
7439
7509
|
]
|
|
@@ -7485,10 +7555,10 @@ function KanbanBoard({
|
|
|
7485
7555
|
);
|
|
7486
7556
|
}
|
|
7487
7557
|
function LaneRow({ lane, showTitle, span, children }) {
|
|
7488
|
-
return /* @__PURE__ */ jsxs34(
|
|
7489
|
-
showTitle && /* @__PURE__ */ jsxs34(
|
|
7490
|
-
/* @__PURE__ */ jsx48(
|
|
7491
|
-
lane.meta && /* @__PURE__ */ jsx48(
|
|
7558
|
+
return /* @__PURE__ */ jsxs34(Fragment17, { children: [
|
|
7559
|
+
showTitle && /* @__PURE__ */ jsxs34(HStack9, { gridColumn: `1 / span ${span}`, gap: "2", pt: "2", borderTopWidth: "1px", borderColor: "border.muted", "data-lane": lane.id, children: [
|
|
7560
|
+
/* @__PURE__ */ jsx48(Text14, { textStyle: "label", children: lane.title }),
|
|
7561
|
+
lane.meta && /* @__PURE__ */ jsx48(Text14, { textStyle: "caption", color: "fg.muted", children: lane.meta })
|
|
7492
7562
|
] }),
|
|
7493
7563
|
children
|
|
7494
7564
|
] });
|
|
@@ -7675,7 +7745,7 @@ function FoldButton({ folded, label, onClick }) {
|
|
|
7675
7745
|
function useFolded(key) {
|
|
7676
7746
|
const storage = key ? `board.folded.${key}` : null;
|
|
7677
7747
|
const [folded, setFolded] = useState20(() => /* @__PURE__ */ new Set());
|
|
7678
|
-
|
|
7748
|
+
useEffect14(() => {
|
|
7679
7749
|
if (!storage) return;
|
|
7680
7750
|
try {
|
|
7681
7751
|
const saved = JSON.parse(window.localStorage.getItem(storage) ?? "[]");
|
|
@@ -7749,7 +7819,7 @@ function LoadingState({ lines = 3, label }) {
|
|
|
7749
7819
|
}
|
|
7750
7820
|
|
|
7751
7821
|
// src/components/PageHeader.tsx
|
|
7752
|
-
import { Fragment as
|
|
7822
|
+
import { Fragment as Fragment18 } from "react";
|
|
7753
7823
|
import { Breadcrumb, chakra as chakra28, Menu as Menu3, Portal as Portal13, useSlotRecipe as useSlotRecipe4 } from "@chakra-ui/react";
|
|
7754
7824
|
import { ChevronRight as ChevronRight3 } from "lucide-react";
|
|
7755
7825
|
import { jsx as jsx50, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
@@ -7783,7 +7853,7 @@ function Breadcrumbs({ items, loading: own }) {
|
|
|
7783
7853
|
const label = (item, i) => loading && item.label == null ? /* @__PURE__ */ jsx50(TextBone, { width: 8 + i % 3 * 3 }) : item.label;
|
|
7784
7854
|
const Link = useLinkComponent();
|
|
7785
7855
|
const { shown, hidden } = foldBreadcrumbs(items);
|
|
7786
|
-
return /* @__PURE__ */ jsx50(Breadcrumb.Root, { "aria-label": labels.breadcrumb, children: /* @__PURE__ */ jsx50(Breadcrumb.List, { children: shown.map((entry, n) => /* @__PURE__ */ jsxs36(
|
|
7856
|
+
return /* @__PURE__ */ jsx50(Breadcrumb.Root, { "aria-label": labels.breadcrumb, children: /* @__PURE__ */ jsx50(Breadcrumb.List, { children: shown.map((entry, n) => /* @__PURE__ */ jsxs36(Fragment18, { children: [
|
|
7787
7857
|
n > 0 && /* @__PURE__ */ jsx50(Breadcrumb.Separator, { children: /* @__PURE__ */ jsx50(ChevronRight3, {}) }),
|
|
7788
7858
|
entry == null ? /* @__PURE__ */ jsx50(Breadcrumb.Item, { children: /* @__PURE__ */ jsxs36(Menu3.Root, { positioning: { placement: "bottom-start" }, children: [
|
|
7789
7859
|
/* @__PURE__ */ jsx50(Menu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx50(
|
|
@@ -7861,14 +7931,14 @@ function PropertyList({ items, size = "md", loading: own }) {
|
|
|
7861
7931
|
}
|
|
7862
7932
|
|
|
7863
7933
|
// src/components/QueryableList.tsx
|
|
7864
|
-
import { useEffect as
|
|
7934
|
+
import { useEffect as useEffect16, useId as useId7, useMemo as useMemo12, useRef as useRef19, useState as useState22 } from "react";
|
|
7865
7935
|
import { createPortal } from "react-dom";
|
|
7866
|
-
import { Box as Box11, chakra as chakra33, HStack as
|
|
7936
|
+
import { Box as Box11, chakra as chakra33, HStack as HStack12, Input as Input7, Menu as Menu4, Portal as Portal16, Stack as Stack12, Text as Text17 } from "@chakra-ui/react";
|
|
7867
7937
|
import { ArrowDownWideNarrow, ArrowUpNarrowWide, ChevronDown as ChevronDown3, Download, Filter, Rows3, Save, Trash2 as Trash22, X as X2 } from "lucide-react";
|
|
7868
7938
|
|
|
7869
7939
|
// src/components/query/ColumnsPopover.tsx
|
|
7870
7940
|
import { useMemo as useMemo11 } from "react";
|
|
7871
|
-
import { chakra as chakra32, HStack as
|
|
7941
|
+
import { chakra as chakra32, HStack as HStack10, Popover as Popover3, Portal as Portal14, Stack as Stack10, Switch as Switch2, Text as Text15 } from "@chakra-ui/react";
|
|
7872
7942
|
import {
|
|
7873
7943
|
closestCenter,
|
|
7874
7944
|
DndContext as DndContext3,
|
|
@@ -7903,11 +7973,11 @@ function ColumnsPopover({ fields, columns, onChange }) {
|
|
|
7903
7973
|
labels.columns
|
|
7904
7974
|
] }) }),
|
|
7905
7975
|
/* @__PURE__ */ jsx54(Portal14, { children: /* @__PURE__ */ jsx54(Popover3.Positioner, { children: /* @__PURE__ */ jsx54(Popover3.Content, { w: "80", maxW: "calc(100vw - 2rem)", children: /* @__PURE__ */ jsxs40(Popover3.Body, { p: "0", children: [
|
|
7906
|
-
/* @__PURE__ */ jsxs40(
|
|
7907
|
-
/* @__PURE__ */ jsx54(
|
|
7976
|
+
/* @__PURE__ */ jsxs40(HStack10, { justify: "space-between", px: "3.5", pt: "3", pb: "1", children: [
|
|
7977
|
+
/* @__PURE__ */ jsx54(Text15, { textStyle: "sm", fontWeight: "semibold", children: labels.visibleColumns }),
|
|
7908
7978
|
/* @__PURE__ */ jsx54(Button, { size: "xs", variant: "ghost", disabled: hidden.length === 0, onClick: () => onChange([...columns, ...hidden.map((f) => f.id)]), children: labels.showAllColumns })
|
|
7909
7979
|
] }),
|
|
7910
|
-
/* @__PURE__ */ jsx54(
|
|
7980
|
+
/* @__PURE__ */ jsx54(Text15, { textStyle: "caption", color: "fg.muted", px: "3.5", pb: "2", children: labels.columnsHint }),
|
|
7911
7981
|
/* @__PURE__ */ jsxs40(chakra32.div, { maxH: "80", overflowY: "auto", pb: "2", children: [
|
|
7912
7982
|
/* @__PURE__ */ jsx54(DndContext3, { sensors, collisionDetection: closestCenter, onDragEnd, children: /* @__PURE__ */ jsx54(SortableContext2, { items: shown, strategy: verticalListSortingStrategy2, children: /* @__PURE__ */ jsx54(Stack10, { gap: "0", role: "list", "aria-label": labels.visibleColumns, children: shown.map((id) => /* @__PURE__ */ jsx54(
|
|
7913
7983
|
ColumnRow,
|
|
@@ -7930,7 +8000,7 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
7930
8000
|
const sortable = useSortable2({ id, disabled: !checked });
|
|
7931
8001
|
const { attributes, listeners: listeners2, setNodeRef, transform, transition, isDragging } = sortable;
|
|
7932
8002
|
return /* @__PURE__ */ jsxs40(
|
|
7933
|
-
|
|
8003
|
+
HStack10,
|
|
7934
8004
|
{
|
|
7935
8005
|
ref: setNodeRef,
|
|
7936
8006
|
role: "listitem",
|
|
@@ -7962,7 +8032,7 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
7962
8032
|
children: /* @__PURE__ */ jsx54(GripVertical4, { size: 16 })
|
|
7963
8033
|
}
|
|
7964
8034
|
) : /* @__PURE__ */ jsx54(chakra32.span, { w: "4", flexShrink: 0 }),
|
|
7965
|
-
/* @__PURE__ */ jsx54(
|
|
8035
|
+
/* @__PURE__ */ jsx54(Text15, { as: "span", flex: "1", textStyle: "sm", truncate: true, color: checked ? "fg" : "fg.muted", children: label }),
|
|
7966
8036
|
/* @__PURE__ */ jsxs40(Switch2.Root, { size: "sm", colorPalette: "accent", checked, disabled, onCheckedChange, "aria-label": label, children: [
|
|
7967
8037
|
/* @__PURE__ */ jsx54(Switch2.HiddenInput, {}),
|
|
7968
8038
|
/* @__PURE__ */ jsx54(Switch2.Control, { children: /* @__PURE__ */ jsx54(Switch2.Thumb, {}) })
|
|
@@ -7973,10 +8043,10 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
|
|
|
7973
8043
|
}
|
|
7974
8044
|
|
|
7975
8045
|
// src/components/query/FilterBuilder.tsx
|
|
7976
|
-
import { useEffect as
|
|
7977
|
-
import { CloseButton as CloseButton3, Dialog as Dialog5, HStack as
|
|
8046
|
+
import { useEffect as useEffect15, useId as useId6, useRef as useRef18, useState as useState21 } from "react";
|
|
8047
|
+
import { CloseButton as CloseButton3, Dialog as Dialog5, HStack as HStack11, Input as Input6, Portal as Portal15, Stack as Stack11, Text as Text16 } from "@chakra-ui/react";
|
|
7978
8048
|
import { Trash2 } from "lucide-react";
|
|
7979
|
-
import { Fragment as
|
|
8049
|
+
import { Fragment as Fragment19, jsx as jsx55, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
7980
8050
|
function fill3(template, values) {
|
|
7981
8051
|
return template.replace(/\{(\w+)\}/g, (_, k) => String(values[k] ?? `{${k}}`));
|
|
7982
8052
|
}
|
|
@@ -8001,13 +8071,13 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8001
8071
|
const repeats = new Set(rows2.map((r) => r.field)).size < rows2.length;
|
|
8002
8072
|
const key = JSON.stringify(complete);
|
|
8003
8073
|
const counter = useRef18(countMatches);
|
|
8004
|
-
|
|
8074
|
+
useEffect15(() => {
|
|
8005
8075
|
counter.current = countMatches;
|
|
8006
8076
|
});
|
|
8007
8077
|
const counts = Boolean(countMatches);
|
|
8008
8078
|
const [count, setCount] = useState21(null);
|
|
8009
8079
|
const [total, setTotal] = useState21(null);
|
|
8010
|
-
|
|
8080
|
+
useEffect15(() => {
|
|
8011
8081
|
if (!counts) return;
|
|
8012
8082
|
let gone = false;
|
|
8013
8083
|
counter.current?.([]).then((n) => !gone && setTotal(n), () => void 0);
|
|
@@ -8015,7 +8085,7 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8015
8085
|
gone = true;
|
|
8016
8086
|
};
|
|
8017
8087
|
}, [counts]);
|
|
8018
|
-
|
|
8088
|
+
useEffect15(() => {
|
|
8019
8089
|
if (!counts) return;
|
|
8020
8090
|
let gone = false;
|
|
8021
8091
|
const timer = setTimeout(() => {
|
|
@@ -8035,19 +8105,19 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8035
8105
|
return /* @__PURE__ */ jsx55(Dialog5.Root, { open: true, onOpenChange: (e) => !e.open && onClose(), size: "lg", placement: "center", scrollBehavior: "inside", children: /* @__PURE__ */ jsxs41(Portal15, { children: [
|
|
8036
8106
|
/* @__PURE__ */ jsx55(Dialog5.Backdrop, {}),
|
|
8037
8107
|
/* @__PURE__ */ jsx55(Dialog5.Positioner, { children: /* @__PURE__ */ jsxs41(Dialog5.Content, { "data-filter-builder": "", children: [
|
|
8038
|
-
/* @__PURE__ */ jsx55(Dialog5.Header, { children: /* @__PURE__ */ jsxs41(
|
|
8108
|
+
/* @__PURE__ */ jsx55(Dialog5.Header, { children: /* @__PURE__ */ jsxs41(HStack11, { justify: "space-between", w: "full", gap: "3", children: [
|
|
8039
8109
|
/* @__PURE__ */ jsx55(Dialog5.Title, { children: labels.buildFilters }),
|
|
8040
8110
|
/* @__PURE__ */ jsx55(Button, { size: "xs", variant: "ghost", onClick: () => setRows([]), disabled: rows2.length === 0, children: labels.clearAll })
|
|
8041
8111
|
] }) }),
|
|
8042
8112
|
/* @__PURE__ */ jsx55(Dialog5.Body, { children: /* @__PURE__ */ jsxs41(Stack11, { gap: "3", children: [
|
|
8043
|
-
/* @__PURE__ */ jsxs41(
|
|
8113
|
+
/* @__PURE__ */ jsxs41(Text16, { textStyle: "sm", color: "fg.muted", children: [
|
|
8044
8114
|
labels.matchAll,
|
|
8045
|
-
repeats && /* @__PURE__ */ jsxs41(
|
|
8115
|
+
repeats && /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
8046
8116
|
" ",
|
|
8047
8117
|
labels.sameFieldAny
|
|
8048
8118
|
] })
|
|
8049
8119
|
] }),
|
|
8050
|
-
rows2.length === 0 && /* @__PURE__ */ jsx55(
|
|
8120
|
+
rows2.length === 0 && /* @__PURE__ */ jsx55(Text16, { textStyle: "sm", color: "fg.muted", py: "2", children: labels.noConditions }),
|
|
8051
8121
|
rows2.map((d) => /* @__PURE__ */ jsx55(
|
|
8052
8122
|
ConditionRow,
|
|
8053
8123
|
{
|
|
@@ -8061,21 +8131,21 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
|
|
|
8061
8131
|
},
|
|
8062
8132
|
d.id
|
|
8063
8133
|
)),
|
|
8064
|
-
/* @__PURE__ */ jsx55(
|
|
8134
|
+
/* @__PURE__ */ jsx55(HStack11, { children: /* @__PURE__ */ jsx55(AddButton, { onClick: add, disabled: fields.length === 0, children: labels.addCondition }) }),
|
|
8065
8135
|
/* @__PURE__ */ jsxs41(Stack11, { gap: "1", borderTopWidth: "1px", borderColor: "border.muted", pt: "3", children: [
|
|
8066
|
-
/* @__PURE__ */ jsx55(
|
|
8067
|
-
/* @__PURE__ */ jsx55(
|
|
8136
|
+
/* @__PURE__ */ jsx55(Text16, { textStyle: "xs", fontWeight: "bold", color: "fg.muted", children: labels.activeFilters }),
|
|
8137
|
+
/* @__PURE__ */ jsx55(Text16, { textStyle: "sm", "data-active-filters": "", children: complete.length === 0 ? labels.noneActive : complete.map((c2) => describe(c2, fields, labels)).join(" \xB7 ") })
|
|
8068
8138
|
] })
|
|
8069
8139
|
] }) }),
|
|
8070
|
-
/* @__PURE__ */ jsx55(Dialog5.Footer, { children: /* @__PURE__ */ jsxs41(
|
|
8071
|
-
/* @__PURE__ */ jsxs41(
|
|
8140
|
+
/* @__PURE__ */ jsx55(Dialog5.Footer, { children: /* @__PURE__ */ jsxs41(HStack11, { justify: "space-between", w: "full", wrap: "wrap", gap: "2", children: [
|
|
8141
|
+
/* @__PURE__ */ jsxs41(Text16, { textStyle: "sm", color: "fg.muted", "aria-live": "polite", "data-filter-count": "", children: [
|
|
8072
8142
|
count != null && fill3(total != null ? labels.matchCount : labels.matchCountOnly, { count, total: total ?? "" }),
|
|
8073
|
-
incomplete > 0 && /* @__PURE__ */ jsxs41(
|
|
8143
|
+
incomplete > 0 && /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
8074
8144
|
" \xB7 ",
|
|
8075
8145
|
labels.incompleteSkipped
|
|
8076
8146
|
] })
|
|
8077
8147
|
] }),
|
|
8078
|
-
/* @__PURE__ */ jsxs41(
|
|
8148
|
+
/* @__PURE__ */ jsxs41(HStack11, { gap: "2", children: [
|
|
8079
8149
|
/* @__PURE__ */ jsx55(Button, { size: "sm", variant: "ghost", onClick: onClose, children: labels.cancel }),
|
|
8080
8150
|
/* @__PURE__ */ jsx55(Button, { size: "sm", variant: "primary", onClick: () => {
|
|
8081
8151
|
setTouched(true);
|
|
@@ -8094,12 +8164,12 @@ function describe(c2, fields, labels) {
|
|
|
8094
8164
|
}
|
|
8095
8165
|
function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChange, onRemove }) {
|
|
8096
8166
|
const labels = useAbpLabels().queryList;
|
|
8097
|
-
const listId =
|
|
8167
|
+
const listId = useId6();
|
|
8098
8168
|
const field = fields.find((f) => f.id === draft.field);
|
|
8099
8169
|
const { op, text } = draft;
|
|
8100
8170
|
const [options, setOptions] = useState21([]);
|
|
8101
8171
|
const own = field && renderValueEditor && !NO_VALUE_OPS.has(op) ? renderValueEditor({ field, op, value: draft.chosen, onChange: (v) => onChange({ chosen: v }) }) : null;
|
|
8102
|
-
|
|
8172
|
+
useEffect15(() => {
|
|
8103
8173
|
if (!suggest || !field || NO_VALUE_OPS.has(op) || own != null) return;
|
|
8104
8174
|
const typed = LIST_OPS.has(op) ? (text.split(",").pop() ?? "").trim() : text;
|
|
8105
8175
|
const prefix = `"${field.id}" = `;
|
|
@@ -8113,7 +8183,7 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8113
8183
|
};
|
|
8114
8184
|
}, [suggest, field, op, text, own]);
|
|
8115
8185
|
return /* @__PURE__ */ jsxs41(Stack11, { gap: "1", "data-condition": "", children: [
|
|
8116
|
-
/* @__PURE__ */ jsxs41(
|
|
8186
|
+
/* @__PURE__ */ jsxs41(HStack11, { gap: "1.5", wrap: "wrap", align: "start", children: [
|
|
8117
8187
|
/* @__PURE__ */ jsx55(
|
|
8118
8188
|
SelectField,
|
|
8119
8189
|
{
|
|
@@ -8140,7 +8210,7 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8140
8210
|
}
|
|
8141
8211
|
),
|
|
8142
8212
|
own,
|
|
8143
|
-
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */ jsxs41(
|
|
8213
|
+
!NO_VALUE_OPS.has(op) && own == null && /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
8144
8214
|
/* @__PURE__ */ jsx55(
|
|
8145
8215
|
Input6,
|
|
8146
8216
|
{
|
|
@@ -8159,12 +8229,12 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
|
|
|
8159
8229
|
] }),
|
|
8160
8230
|
/* @__PURE__ */ jsx55(IconButton, { size: "sm", variant: "ghost", remove: true, "aria-label": fill3(labels.removeFilter, { field: field?.label ?? draft.field }), onClick: onRemove, children: /* @__PURE__ */ jsx55(Trash2, {}) })
|
|
8161
8231
|
] }),
|
|
8162
|
-
warn && /* @__PURE__ */ jsx55(
|
|
8232
|
+
warn && /* @__PURE__ */ jsx55(Text16, { textStyle: "xs", color: "fg.error", children: labels.incomplete })
|
|
8163
8233
|
] });
|
|
8164
8234
|
}
|
|
8165
8235
|
|
|
8166
8236
|
// src/components/QueryableList.tsx
|
|
8167
|
-
import { Fragment as
|
|
8237
|
+
import { Fragment as Fragment20, jsx as jsx56, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
8168
8238
|
var PAIR = "";
|
|
8169
8239
|
var pairKey = (first, second) => `${first}${PAIR}${second}`;
|
|
8170
8240
|
var condition = (field, value) => value == null ? { field, op: "isEmpty" } : { field, op: "eq", value };
|
|
@@ -8235,7 +8305,7 @@ function QueryableList({
|
|
|
8235
8305
|
const [exported, setExported] = useState22(null);
|
|
8236
8306
|
const complex = conditions === null;
|
|
8237
8307
|
const failed = Boolean(error && state.rql);
|
|
8238
|
-
|
|
8308
|
+
useEffect16(() => {
|
|
8239
8309
|
if (complex || failed) setMode("rql");
|
|
8240
8310
|
}, [complex, failed]);
|
|
8241
8311
|
const label = (id) => byId.get(id)?.label ?? id;
|
|
@@ -8282,7 +8352,7 @@ function QueryableList({
|
|
|
8282
8352
|
const groupField = query.groupBy?.field ?? null;
|
|
8283
8353
|
const thenField = groupField ? query.groupBy?.then?.field ?? null : null;
|
|
8284
8354
|
const [folded, setFolded] = useState22(() => /* @__PURE__ */ new Set());
|
|
8285
|
-
|
|
8355
|
+
useEffect16(() => setFolded(/* @__PURE__ */ new Set()), [groupField, thenField]);
|
|
8286
8356
|
const grouped = Boolean(groupField && result?.groups && result.groups.length > 0);
|
|
8287
8357
|
const asTree = Boolean(tree && groupField === tree.field);
|
|
8288
8358
|
const groupOf = (row) => {
|
|
@@ -8313,12 +8383,12 @@ function QueryableList({
|
|
|
8313
8383
|
const groupLabel = groupField ? thenField ? `${label(groupField)} \xB7 ${label(thenField)}` : label(groupField) : null;
|
|
8314
8384
|
return /* @__PURE__ */ jsxs42(Stack12, { gap: "3", children: [
|
|
8315
8385
|
/* @__PURE__ */ jsxs42(chakra33.div, { layerStyle: "panel", borderRadius: "l3", "data-query-toolbar": "", children: [
|
|
8316
|
-
/* @__PURE__ */ jsxs42(
|
|
8317
|
-
/* @__PURE__ */ jsxs42(
|
|
8386
|
+
/* @__PURE__ */ jsxs42(HStack12, { gap: "2", wrap: "wrap", justify: "space-between", px: "2.5", py: "2", borderBottomWidth: "1px", borderColor: "border.muted", children: [
|
|
8387
|
+
/* @__PURE__ */ jsxs42(HStack12, { gap: "2", wrap: "wrap", minW: "0", children: [
|
|
8318
8388
|
leading,
|
|
8319
8389
|
leading != null && views && onSelectView && /* @__PURE__ */ jsx56(chakra33.span, { w: "1px", h: "6", bg: "border", mx: "1", "aria-hidden": true }),
|
|
8320
|
-
views && onSelectView && /* @__PURE__ */ jsxs42(
|
|
8321
|
-
/* @__PURE__ */ jsx56(
|
|
8390
|
+
views && onSelectView && /* @__PURE__ */ jsxs42(HStack12, { gap: "2", children: [
|
|
8391
|
+
/* @__PURE__ */ jsx56(Text17, { as: "span", textStyle: "xs", fontWeight: "semibold", color: "fg.muted", whiteSpace: "nowrap", hideBelow: "2xl", children: labels.savedView }),
|
|
8322
8392
|
/* @__PURE__ */ jsx56(
|
|
8323
8393
|
SelectField,
|
|
8324
8394
|
{
|
|
@@ -8334,7 +8404,7 @@ function QueryableList({
|
|
|
8334
8404
|
onSaveView && (naming === null ? /* @__PURE__ */ jsxs42(Button, { size: "sm", variant: "ghost", color: "fg.accent", onClick: () => setNaming(activeView?.isOwner ? activeView.name : ""), children: [
|
|
8335
8405
|
/* @__PURE__ */ jsx56(Save, {}),
|
|
8336
8406
|
labels.saveView
|
|
8337
|
-
] }) : /* @__PURE__ */ jsxs42(
|
|
8407
|
+
] }) : /* @__PURE__ */ jsxs42(HStack12, { gap: "1", as: "form", onSubmit: (e) => {
|
|
8338
8408
|
e.preventDefault();
|
|
8339
8409
|
if (naming.trim()) onSaveView(naming.trim(), activeView?.isOwner && naming.trim() === activeView.name ? activeView.id : null);
|
|
8340
8410
|
setNaming(null);
|
|
@@ -8345,11 +8415,11 @@ function QueryableList({
|
|
|
8345
8415
|
] })),
|
|
8346
8416
|
activeView?.isOwner && onDeleteView && naming === null && /* @__PURE__ */ jsx56(IconButton, { size: "sm", variant: "ghost", "aria-label": labels.deleteView, onClick: () => onDeleteView(activeView.id), children: /* @__PURE__ */ jsx56(Trash22, {}) })
|
|
8347
8417
|
] }),
|
|
8348
|
-
/* @__PURE__ */ jsxs42(
|
|
8418
|
+
/* @__PURE__ */ jsxs42(HStack12, { gap: "2", wrap: "wrap", children: [
|
|
8349
8419
|
/* @__PURE__ */ jsxs42(Menu4.Root, { positioning: { placement: "bottom-end" }, children: [
|
|
8350
8420
|
/* @__PURE__ */ jsx56(Menu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs42(Button, { size: "sm", variant: "secondary", "aria-label": labels.groupBy, disabled: groupable.length === 0, children: [
|
|
8351
8421
|
/* @__PURE__ */ jsx56(Rows3, {}),
|
|
8352
|
-
/* @__PURE__ */ jsx56(
|
|
8422
|
+
/* @__PURE__ */ jsx56(Text17, { as: "span", color: "fg.muted", fontWeight: "normal", children: labels.group }),
|
|
8353
8423
|
groupLabel ?? labels.noGrouping,
|
|
8354
8424
|
/* @__PURE__ */ jsx56(ChevronDown3, {})
|
|
8355
8425
|
] }) }),
|
|
@@ -8371,7 +8441,7 @@ function QueryableList({
|
|
|
8371
8441
|
]
|
|
8372
8442
|
}
|
|
8373
8443
|
),
|
|
8374
|
-
groupField && groupable.length > 1 && /* @__PURE__ */ jsxs42(
|
|
8444
|
+
groupField && groupable.length > 1 && /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
8375
8445
|
/* @__PURE__ */ jsx56(Menu4.Separator, {}),
|
|
8376
8446
|
/* @__PURE__ */ jsxs42(
|
|
8377
8447
|
Menu4.RadioItemGroup,
|
|
@@ -8400,8 +8470,8 @@ function QueryableList({
|
|
|
8400
8470
|
actions
|
|
8401
8471
|
] })
|
|
8402
8472
|
] }),
|
|
8403
|
-
/* @__PURE__ */ jsxs42(
|
|
8404
|
-
/* @__PURE__ */ jsxs42(
|
|
8473
|
+
/* @__PURE__ */ jsxs42(HStack12, { gap: "2", align: "start", wrap: "wrap", justify: "space-between", px: "2.5", py: "2", children: [
|
|
8474
|
+
/* @__PURE__ */ jsxs42(HStack12, { gap: "2", align: "start", wrap: "wrap", flex: "1", minW: { base: "full", md: "0" }, children: [
|
|
8405
8475
|
/* @__PURE__ */ jsx56(
|
|
8406
8476
|
SegmentedControl,
|
|
8407
8477
|
{
|
|
@@ -8415,13 +8485,13 @@ function QueryableList({
|
|
|
8415
8485
|
]
|
|
8416
8486
|
}
|
|
8417
8487
|
),
|
|
8418
|
-
mode === "basic" && conditions !== null ? /* @__PURE__ */ jsxs42(
|
|
8488
|
+
mode === "basic" && conditions !== null ? /* @__PURE__ */ jsxs42(HStack12, { gap: "2", wrap: "wrap", flex: "1", minW: "0", children: [
|
|
8419
8489
|
search && /* @__PURE__ */ jsx56(QuickSearch, { initial: searchText, placeholder: search.placeholder ?? labels.searchPlaceholder, onRun: runSearch }, searchText),
|
|
8420
8490
|
/* @__PURE__ */ jsxs42(AddButton, { onClick: () => setAdding(true), disabled: !fields, "data-add-filter": "", children: [
|
|
8421
8491
|
labels.addFilter,
|
|
8422
8492
|
chips.length > 0 && /* @__PURE__ */ jsx56(CountBadge, { value: chips.length, tone: "accent" })
|
|
8423
8493
|
] }),
|
|
8424
|
-
sortable.length > 0 && /* @__PURE__ */ jsxs42(
|
|
8494
|
+
sortable.length > 0 && /* @__PURE__ */ jsxs42(HStack12, { gap: "1", flexShrink: 0, children: [
|
|
8425
8495
|
/* @__PURE__ */ jsx56(
|
|
8426
8496
|
SelectField,
|
|
8427
8497
|
{
|
|
@@ -8460,9 +8530,9 @@ function QueryableList({
|
|
|
8460
8530
|
state.rql ?? result?.rql ?? ""
|
|
8461
8531
|
)
|
|
8462
8532
|
] }),
|
|
8463
|
-
attention != null && /* @__PURE__ */ jsx56(
|
|
8533
|
+
attention != null && /* @__PURE__ */ jsx56(HStack12, { gap: "2", wrap: "wrap", flexShrink: 0, children: attention })
|
|
8464
8534
|
] }),
|
|
8465
|
-
mode === "basic" && conditions !== null && chips.length > 0 && /* @__PURE__ */ jsxs42(
|
|
8535
|
+
mode === "basic" && conditions !== null && chips.length > 0 && /* @__PURE__ */ jsxs42(HStack12, { gap: "2", wrap: "wrap", px: "2.5", py: "2", borderTopWidth: "1px", borderColor: "border.muted", "data-filter-chips": "", children: [
|
|
8466
8536
|
chips.map(({ c: c2, i }) => /* @__PURE__ */ jsxs42(
|
|
8467
8537
|
chakra33.span,
|
|
8468
8538
|
{
|
|
@@ -8478,9 +8548,9 @@ function QueryableList({
|
|
|
8478
8548
|
bg: "bg.selected",
|
|
8479
8549
|
textStyle: "sm",
|
|
8480
8550
|
children: [
|
|
8481
|
-
/* @__PURE__ */ jsx56(
|
|
8482
|
-
/* @__PURE__ */ jsx56(
|
|
8483
|
-
!NO_VALUE_OPS.has(c2.op) && /* @__PURE__ */ jsx56(
|
|
8551
|
+
/* @__PURE__ */ jsx56(Text17, { as: "span", fontWeight: "medium", children: label(c2.field) }),
|
|
8552
|
+
/* @__PURE__ */ jsx56(Text17, { as: "span", color: "fg.muted", children: opLabel(c2.op, c2.field) }),
|
|
8553
|
+
!NO_VALUE_OPS.has(c2.op) && /* @__PURE__ */ jsx56(Text17, { as: "span", children: valueText(c2.value) }),
|
|
8484
8554
|
/* @__PURE__ */ jsx56(IconButton, { size: "xs", variant: "ghost", "aria-label": fill4(labels.removeFilter, { field: label(c2.field) }), onClick: () => setConditions(conditions.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx56(X2, {}) })
|
|
8485
8555
|
]
|
|
8486
8556
|
},
|
|
@@ -8506,8 +8576,8 @@ function QueryableList({
|
|
|
8506
8576
|
toolbarFooter != null && /* @__PURE__ */ jsx56(chakra33.div, { borderTopWidth: "1px", borderColor: "border.muted", "data-toolbar-footer": "", children: toolbarFooter })
|
|
8507
8577
|
] }),
|
|
8508
8578
|
mode === "basic" && error && !(loadFailed != null && error.failed && !result) && /* @__PURE__ */ jsx56(InlineAlert, { tone: "danger", children: error.message }),
|
|
8509
|
-
exported && /* @__PURE__ */ jsx56(InlineAlert, { tone: exported.tone, title: exported.tone === "danger" ? labels.exportFailed : void 0, children: /* @__PURE__ */ jsxs42(
|
|
8510
|
-
/* @__PURE__ */ jsx56(
|
|
8579
|
+
exported && /* @__PURE__ */ jsx56(InlineAlert, { tone: exported.tone, title: exported.tone === "danger" ? labels.exportFailed : void 0, children: /* @__PURE__ */ jsxs42(HStack12, { justify: "space-between", gap: "2", align: "start", children: [
|
|
8580
|
+
/* @__PURE__ */ jsx56(Text17, { as: "span", children: exported.message }),
|
|
8511
8581
|
/* @__PURE__ */ jsx56(IconButton, { size: "xs", variant: "ghost", "aria-label": labels.dismiss, onClick: () => setExported(null), children: /* @__PURE__ */ jsx56(X2, {}) })
|
|
8512
8582
|
] }) }),
|
|
8513
8583
|
/* @__PURE__ */ jsx56(
|
|
@@ -8518,7 +8588,7 @@ function QueryableList({
|
|
|
8518
8588
|
// Expand and collapse at the start, the pages in the middle (the canvas's v12, UI round 9 step 67, round 10 step 73),
|
|
8519
8589
|
// the range at the end, or with the arrows in the simple form.
|
|
8520
8590
|
/* @__PURE__ */ jsxs42(chakra33.div, { display: "grid", w: "full", gridTemplateColumns: { base: "1fr", md: "1fr auto 1fr" }, alignItems: "center", gap: "3", children: [
|
|
8521
|
-
/* @__PURE__ */ jsx56(
|
|
8591
|
+
/* @__PURE__ */ jsx56(HStack12, { gap: "3", children: grouped && /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
8522
8592
|
/* @__PURE__ */ jsx56(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: folded.size === 0, onClick: () => setFolded(/* @__PURE__ */ new Set()), children: labels.expandAll }),
|
|
8523
8593
|
/* @__PURE__ */ jsx56(Button, { size: "xs", variant: "ghost", color: "fg.accent", disabled: groupKeys.every((k) => folded.has(k)), onClick: () => setFolded(new Set(groupKeys)), children: labels.collapseAll })
|
|
8524
8594
|
] }) }),
|
|
@@ -8538,7 +8608,7 @@ function QueryableList({
|
|
|
8538
8608
|
pageOf: fill4(labels.pageOf, { page: fmt.number(Math.floor(skip / take) + 1), pages: fmt.number(Math.max(1, Math.ceil(total / take))) })
|
|
8539
8609
|
}
|
|
8540
8610
|
),
|
|
8541
|
-
/* @__PURE__ */ jsx56(
|
|
8611
|
+
/* @__PURE__ */ jsx56(Text17, { 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) }) : " " })
|
|
8542
8612
|
] })
|
|
8543
8613
|
),
|
|
8544
8614
|
children: layout === "cards" && cards ? /* @__PURE__ */ jsx56(
|
|
@@ -8598,7 +8668,7 @@ function QueryableList({
|
|
|
8598
8668
|
const label2 = thenField ? info?.then?.label : info?.label;
|
|
8599
8669
|
const value = thenField ? info?.then?.value ?? null : info?.value ?? null;
|
|
8600
8670
|
const period = thenField ? query.groupBy?.then?.period : query.groupBy?.period;
|
|
8601
|
-
return /* @__PURE__ */ jsxs42(
|
|
8671
|
+
return /* @__PURE__ */ jsxs42(HStack12, { gap: "2.5", flex: "1", minW: "0", children: [
|
|
8602
8672
|
/* @__PURE__ */ jsx56(chakra33.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) }),
|
|
8603
8673
|
/* @__PURE__ */ jsx56(CountBadge, { value: info?.count ?? rows2.length }),
|
|
8604
8674
|
!thenField && renderGroupAside?.({ field: groupField, value: info?.value ?? null, label: info?.label ?? "" }),
|
|
@@ -8640,7 +8710,7 @@ function QueryableList({
|
|
|
8640
8710
|
const first = groups[0]?.rows[0];
|
|
8641
8711
|
const raw = first?.values[groupField];
|
|
8642
8712
|
const count = (result?.groups ?? []).filter((g) => groupKey(g.value) === parent).reduce((n, g) => n + g.count, 0);
|
|
8643
|
-
return /* @__PURE__ */ jsxs42(
|
|
8713
|
+
return /* @__PURE__ */ jsxs42(HStack12, { gap: "2.5", flex: "1", minW: "0", children: [
|
|
8644
8714
|
/* @__PURE__ */ jsx56(chakra33.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) }),
|
|
8645
8715
|
/* @__PURE__ */ jsx56(CountBadge, { value: count }),
|
|
8646
8716
|
renderGroupAside?.({ field: groupField, value: info?.value ?? null, label: info?.label ?? "" })
|
|
@@ -8680,7 +8750,7 @@ function QuickSearch({ initial, placeholder: placeholder2, onRun }) {
|
|
|
8680
8750
|
const labels = useAbpLabels().queryList;
|
|
8681
8751
|
const [text, setText] = useState22(initial);
|
|
8682
8752
|
const timer = useRef19(void 0);
|
|
8683
|
-
|
|
8753
|
+
useEffect16(() => () => clearTimeout(timer.current), []);
|
|
8684
8754
|
function later(next) {
|
|
8685
8755
|
clearTimeout(timer.current);
|
|
8686
8756
|
timer.current = setTimeout(() => next.trim() !== initial.trim() && onRun(next), 400);
|
|
@@ -8764,7 +8834,7 @@ function RqlBox({
|
|
|
8764
8834
|
const input = useRef19(null);
|
|
8765
8835
|
const timer = useRef19(void 0);
|
|
8766
8836
|
const seq = useRef19(0);
|
|
8767
|
-
const listId =
|
|
8837
|
+
const listId = useId7();
|
|
8768
8838
|
function ask(value, caret) {
|
|
8769
8839
|
if (!suggest) return;
|
|
8770
8840
|
clearTimeout(timer.current);
|
|
@@ -8778,7 +8848,7 @@ function RqlBox({
|
|
|
8778
8848
|
}).catch(() => setOpen(false));
|
|
8779
8849
|
}, 120);
|
|
8780
8850
|
}
|
|
8781
|
-
|
|
8851
|
+
useEffect16(() => () => clearTimeout(timer.current), []);
|
|
8782
8852
|
function accept(item) {
|
|
8783
8853
|
if (!found) return;
|
|
8784
8854
|
const before = text.slice(0, found.replaceStart);
|
|
@@ -8827,7 +8897,7 @@ function RqlBox({
|
|
|
8827
8897
|
}
|
|
8828
8898
|
const hasSpan = error?.start != null && error.end != null && error.end >= error.start && error.end <= text.length;
|
|
8829
8899
|
return /* @__PURE__ */ jsxs42(Stack12, { gap: "1.5", flex: "1", minW: "0", position: "relative", children: [
|
|
8830
|
-
/* @__PURE__ */ jsxs42(
|
|
8900
|
+
/* @__PURE__ */ jsxs42(HStack12, { gap: "2", children: [
|
|
8831
8901
|
/* @__PURE__ */ jsx56(
|
|
8832
8902
|
Input7,
|
|
8833
8903
|
{
|
|
@@ -8876,7 +8946,7 @@ function RqlBox({
|
|
|
8876
8946
|
boxShadow: "md",
|
|
8877
8947
|
py: "1",
|
|
8878
8948
|
children: found.items.map((item, i) => /* @__PURE__ */ jsxs42(
|
|
8879
|
-
|
|
8949
|
+
HStack12,
|
|
8880
8950
|
{
|
|
8881
8951
|
id: `${listId}-${i}`,
|
|
8882
8952
|
role: "option",
|
|
@@ -8893,8 +8963,8 @@ function RqlBox({
|
|
|
8893
8963
|
},
|
|
8894
8964
|
onMouseEnter: () => setActive(i),
|
|
8895
8965
|
children: [
|
|
8896
|
-
/* @__PURE__ */ jsx56(
|
|
8897
|
-
/* @__PURE__ */ jsx56(
|
|
8966
|
+
/* @__PURE__ */ jsx56(Text17, { 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 }),
|
|
8967
|
+
/* @__PURE__ */ jsx56(Text17, { 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 })
|
|
8898
8968
|
]
|
|
8899
8969
|
},
|
|
8900
8970
|
`${item.kind}-${item.text}`
|
|
@@ -8912,7 +8982,7 @@ function RqlBox({
|
|
|
8912
8982
|
] });
|
|
8913
8983
|
}
|
|
8914
8984
|
function CardGrid({ rows: rows2, loading, count, minWidth, render: render2, empty, "aria-label": label }) {
|
|
8915
|
-
if (rows2 && rows2.length === 0 && !loading) return typeof empty === "string" ? /* @__PURE__ */ jsx56(EmptyState, { title: empty }) : /* @__PURE__ */ jsx56(
|
|
8985
|
+
if (rows2 && rows2.length === 0 && !loading) return typeof empty === "string" ? /* @__PURE__ */ jsx56(EmptyState, { title: empty }) : /* @__PURE__ */ jsx56(Fragment20, { children: empty });
|
|
8916
8986
|
return /* @__PURE__ */ jsx56(
|
|
8917
8987
|
chakra33.ul,
|
|
8918
8988
|
{
|
|
@@ -8933,7 +9003,7 @@ function CardGrid({ rows: rows2, loading, count, minWidth, render: render2, empt
|
|
|
8933
9003
|
|
|
8934
9004
|
// src/components/FileDrop.tsx
|
|
8935
9005
|
import { forwardRef as forwardRef9, useLayoutEffect as useLayoutEffect4, useRef as useRef20 } from "react";
|
|
8936
|
-
import { Box as Box12, HStack as
|
|
9006
|
+
import { Box as Box12, HStack as HStack13, Portal as Portal17, Text as Text18 } from "@chakra-ui/react";
|
|
8937
9007
|
import { ArrowDownToLine } from "lucide-react";
|
|
8938
9008
|
import { jsx as jsx57, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
8939
9009
|
var OUT3 = `cubic-bezier(${curves.out.join(", ")})`;
|
|
@@ -8960,7 +9030,7 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
8960
9030
|
children: [
|
|
8961
9031
|
children,
|
|
8962
9032
|
/* @__PURE__ */ jsx57(Presence, { show: lit, from: "fade", position: "absolute", inset: "0", rounded: "l2", zIndex: "1", pointerEvents: "none", children: /* @__PURE__ */ jsxs43(
|
|
8963
|
-
|
|
9033
|
+
HStack13,
|
|
8964
9034
|
{
|
|
8965
9035
|
h: "full",
|
|
8966
9036
|
justify: "center",
|
|
@@ -8974,7 +9044,7 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
|
|
|
8974
9044
|
style: { transition: "background-color 160ms ease" },
|
|
8975
9045
|
children: [
|
|
8976
9046
|
/* @__PURE__ */ jsx57(Bob, { active: over2 && !reduce }),
|
|
8977
|
-
/* @__PURE__ */ jsx57(
|
|
9047
|
+
/* @__PURE__ */ jsx57(Text18, { as: "span", truncate: true, children: hint })
|
|
8978
9048
|
]
|
|
8979
9049
|
}
|
|
8980
9050
|
) })
|
|
@@ -8996,15 +9066,15 @@ function Bob({ active }) {
|
|
|
8996
9066
|
return /* @__PURE__ */ jsx57(Box12, { as: "span", ref, display: "inline-flex", flexShrink: 0, _icon: { boxSize: "4" }, children: /* @__PURE__ */ jsx57(ArrowDownToLine, {}) });
|
|
8997
9067
|
}
|
|
8998
9068
|
function DropHint({ show, children }) {
|
|
8999
|
-
return /* @__PURE__ */ jsx57(Portal17, { children: /* @__PURE__ */ jsx57(Box12, { position: "fixed", insetInline: "0", bottom: "6", display: "flex", justifyContent: "center", pointerEvents: "none", zIndex: "toast", px: "4", children: /* @__PURE__ */ jsx57(Presence, { show, from: "rise", children: /* @__PURE__ */ jsxs43(
|
|
9069
|
+
return /* @__PURE__ */ jsx57(Portal17, { children: /* @__PURE__ */ jsx57(Box12, { position: "fixed", insetInline: "0", bottom: "6", display: "flex", justifyContent: "center", pointerEvents: "none", zIndex: "toast", px: "4", children: /* @__PURE__ */ jsx57(Presence, { show, from: "rise", children: /* @__PURE__ */ jsxs43(HStack13, { gap: "2", px: "4", py: "2", rounded: "full", bg: "bg.inverted", color: "fg.inverted", shadow: "lg", textStyle: "body.sm", fontWeight: "medium", maxW: "lg", "data-testid": "drop-hint", _icon: { boxSize: "4" }, children: [
|
|
9000
9070
|
/* @__PURE__ */ jsx57(ArrowDownToLine, {}),
|
|
9001
|
-
/* @__PURE__ */ jsx57(
|
|
9071
|
+
/* @__PURE__ */ jsx57(Text18, { as: "span", truncate: true, children })
|
|
9002
9072
|
] }) }) }) });
|
|
9003
9073
|
}
|
|
9004
9074
|
|
|
9005
9075
|
// src/components/UploadList.tsx
|
|
9006
9076
|
import { useLayoutEffect as useLayoutEffect5, useRef as useRef21 } from "react";
|
|
9007
|
-
import { Box as Box13, chakra as chakra34, HStack as
|
|
9077
|
+
import { Box as Box13, chakra as chakra34, HStack as HStack14, Stack as Stack13, Text as Text19 } from "@chakra-ui/react";
|
|
9008
9078
|
import { Check as Check3, File as FileIcon, RotateCcw, TriangleAlert, X as X3 } from "lucide-react";
|
|
9009
9079
|
import { jsx as jsx58, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9010
9080
|
var OUT4 = `cubic-bezier(${curves.out.join(", ")})`;
|
|
@@ -9012,7 +9082,7 @@ function UploadList({ rows: rows2, summary, fraction, announce, labels, onCancel
|
|
|
9012
9082
|
return /* @__PURE__ */ jsxs44(Stack13, { gap: "2", "data-testid": "upload-list", children: [
|
|
9013
9083
|
/* @__PURE__ */ jsx58(chakra34.span, { srOnly: true, "aria-live": "polite", children: announce }),
|
|
9014
9084
|
rows2.length > 0 && summary != null && /* @__PURE__ */ jsxs44(Stack13, { gap: "1", children: [
|
|
9015
|
-
/* @__PURE__ */ jsx58(
|
|
9085
|
+
/* @__PURE__ */ jsx58(Text19, { textStyle: "caption", color: "fg.muted", children: summary }),
|
|
9016
9086
|
fraction != null && /* @__PURE__ */ jsx58(Bar2, { fraction, tone: "accent", label: typeof summary === "string" ? summary : void 0 })
|
|
9017
9087
|
] }),
|
|
9018
9088
|
/* @__PURE__ */ jsx58(Stack13, { gap: "1.5", position: "relative", children: /* @__PURE__ */ jsx58(PresenceList, { children: rows2.map((row) => /* @__PURE__ */ jsx58(PresenceItem, { children: /* @__PURE__ */ jsx58(Row, { row, labels, onCancel, onRetry, onDismiss }) }, row.id)) }) })
|
|
@@ -9021,15 +9091,15 @@ function UploadList({ rows: rows2, summary, fraction, announce, labels, onCancel
|
|
|
9021
9091
|
function Row({ row, labels, onCancel, onRetry, onDismiss }) {
|
|
9022
9092
|
const going = row.state === "waiting" || row.state === "sending";
|
|
9023
9093
|
const trouble = row.state === "failed" || row.state === "refused";
|
|
9024
|
-
return /* @__PURE__ */ jsxs44(
|
|
9094
|
+
return /* @__PURE__ */ jsxs44(HStack14, { gap: "3", px: "3", py: "2", rounded: "l2", bg: "bg.subtle", borderWidth: "1px", borderColor: trouble ? "border.error" : "border.muted", "data-upload": row.name, "data-state": row.state, children: [
|
|
9025
9095
|
/* @__PURE__ */ jsx58(Preview, { src: row.preview }),
|
|
9026
9096
|
/* @__PURE__ */ jsxs44(Stack13, { gap: "1", flex: "1", minW: "0", children: [
|
|
9027
|
-
/* @__PURE__ */ jsxs44(
|
|
9028
|
-
/* @__PURE__ */ jsx58(
|
|
9029
|
-
/* @__PURE__ */ jsx58(
|
|
9097
|
+
/* @__PURE__ */ jsxs44(HStack14, { gap: "2", justify: "space-between", children: [
|
|
9098
|
+
/* @__PURE__ */ jsx58(Text19, { as: "span", fontWeight: "medium", truncate: true, children: /* @__PURE__ */ jsx58("bdi", { children: row.name }) }),
|
|
9099
|
+
/* @__PURE__ */ jsx58(Text19, { as: "span", textStyle: "caption", color: trouble ? "fg.error" : "fg.muted", flexShrink: 0, fontVariantNumeric: "tabular-nums", children: row.state === "done" ? /* @__PURE__ */ jsx58(Done, {}) : row.status })
|
|
9030
9100
|
] }),
|
|
9031
9101
|
(going || row.state === "done") && /* @__PURE__ */ jsx58(Bar2, { fraction: row.state === "done" ? 1 : row.fraction, tone: row.state === "done" ? "success" : "accent", label: row.name, quiet: row.state === "waiting" }),
|
|
9032
|
-
row.detail != null && /* @__PURE__ */ jsxs44(
|
|
9102
|
+
row.detail != null && /* @__PURE__ */ jsxs44(Text19, { as: "span", textStyle: "caption", color: trouble ? "fg.error" : "fg.muted", truncate: true, children: [
|
|
9033
9103
|
trouble && /* @__PURE__ */ jsx58(Box13, { as: "span", display: "inline-flex", verticalAlign: "-0.15em", me: "1", _icon: { boxSize: "3.5" }, children: /* @__PURE__ */ jsx58(TriangleAlert, {}) }),
|
|
9034
9104
|
row.detail
|
|
9035
9105
|
] })
|
|
@@ -9076,7 +9146,7 @@ function Done() {
|
|
|
9076
9146
|
}
|
|
9077
9147
|
|
|
9078
9148
|
// src/files/drop.ts
|
|
9079
|
-
import { useEffect as
|
|
9149
|
+
import { useEffect as useEffect17, useRef as useRef22, useState as useState23, useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
9080
9150
|
|
|
9081
9151
|
// src/files/upload-plan.ts
|
|
9082
9152
|
var UPLOADS_AT_ONCE = 3;
|
|
@@ -9237,10 +9307,10 @@ function droppedFiles(data) {
|
|
|
9237
9307
|
function useDropZone(ref, { enabled = true, onFiles }) {
|
|
9238
9308
|
const [state, setState] = useState23({ over: false, part: null });
|
|
9239
9309
|
const take = useRef22(onFiles);
|
|
9240
|
-
|
|
9310
|
+
useEffect17(() => {
|
|
9241
9311
|
take.current = onFiles;
|
|
9242
9312
|
}, [onFiles]);
|
|
9243
|
-
|
|
9313
|
+
useEffect17(() => {
|
|
9244
9314
|
const zone = ref.current;
|
|
9245
9315
|
if (!zone || !enabled) return;
|
|
9246
9316
|
let depth = 0;
|
|
@@ -9288,10 +9358,10 @@ function useDropZone(ref, { enabled = true, onFiles }) {
|
|
|
9288
9358
|
}
|
|
9289
9359
|
function usePageDrop({ enabled = true, onFiles }) {
|
|
9290
9360
|
const take = useRef22(onFiles);
|
|
9291
|
-
|
|
9361
|
+
useEffect17(() => {
|
|
9292
9362
|
take.current = onFiles;
|
|
9293
9363
|
}, [onFiles]);
|
|
9294
|
-
|
|
9364
|
+
useEffect17(() => {
|
|
9295
9365
|
if (!enabled) return;
|
|
9296
9366
|
const move = (e) => {
|
|
9297
9367
|
if (!isFiles(e)) return;
|
|
@@ -9314,10 +9384,10 @@ function usePageDrop({ enabled = true, onFiles }) {
|
|
|
9314
9384
|
var editable = (target) => target instanceof HTMLElement && (target.isContentEditable || target.closest('input, textarea, select, [contenteditable=""], [contenteditable=true]') != null);
|
|
9315
9385
|
function usePastedFiles({ enabled = true, onFiles }) {
|
|
9316
9386
|
const take = useRef22(onFiles);
|
|
9317
|
-
|
|
9387
|
+
useEffect17(() => {
|
|
9318
9388
|
take.current = onFiles;
|
|
9319
9389
|
}, [onFiles]);
|
|
9320
|
-
|
|
9390
|
+
useEffect17(() => {
|
|
9321
9391
|
if (!enabled) return;
|
|
9322
9392
|
const paste = (e) => {
|
|
9323
9393
|
const data = e.clipboardData;
|
|
@@ -9343,7 +9413,7 @@ function usePastedFiles({ enabled = true, onFiles }) {
|
|
|
9343
9413
|
|
|
9344
9414
|
// src/components/SortableSections.tsx
|
|
9345
9415
|
import { useMemo as useMemo13, useState as useState24 } from "react";
|
|
9346
|
-
import { Box as Box14, Stack as Stack14, Text as
|
|
9416
|
+
import { Box as Box14, Stack as Stack14, Text as Text20 } from "@chakra-ui/react";
|
|
9347
9417
|
import {
|
|
9348
9418
|
DndContext as DndContext4,
|
|
9349
9419
|
DragOverlay as DragOverlay3,
|
|
@@ -9422,7 +9492,7 @@ function SortableSections({
|
|
|
9422
9492
|
/* @__PURE__ */ jsx59(TextBone, { width: boneWidth(n, 16, 36) })
|
|
9423
9493
|
] }, n)),
|
|
9424
9494
|
s.items.map((item) => /* @__PURE__ */ jsx59(SortableItem, { id: item.id, children: (dragging) => renderItem(item, { dragging }) }, item.id)),
|
|
9425
|
-
!loading && s.items.length === 0 && s.empty && /* @__PURE__ */ jsx59(
|
|
9495
|
+
!loading && s.items.length === 0 && s.empty && /* @__PURE__ */ jsx59(Text20, { textStyle: "caption", color: "fg.subtle", textAlign: "center", py: "4", children: s.empty }),
|
|
9426
9496
|
!loading && s.footer
|
|
9427
9497
|
] }, s.id)) }),
|
|
9428
9498
|
/* @__PURE__ */ jsx59(DragOverlay3, { children: active ? /* @__PURE__ */ jsx59(Box14, { shadow: "lg", rounded: "l2", bg: "bg.panel", children: renderItem(active, { dragging: true }) }) : null })
|
|
@@ -9469,8 +9539,8 @@ function SortableItem({ id, children }) {
|
|
|
9469
9539
|
}
|
|
9470
9540
|
|
|
9471
9541
|
// src/components/TimelineChart.tsx
|
|
9472
|
-
import { Fragment as
|
|
9473
|
-
import { Box as Box15, HStack as
|
|
9542
|
+
import { Fragment as Fragment21, useEffect as useEffect18, useLayoutEffect as useLayoutEffect6, useRef as useRef23, useState as useState25 } from "react";
|
|
9543
|
+
import { Box as Box15, HStack as HStack15, Popover as Popover4, Portal as Portal18, Stack as Stack15, Text as Text21 } from "@chakra-ui/react";
|
|
9474
9544
|
import { Flag, Trash2 as Trash23 } from "lucide-react";
|
|
9475
9545
|
import { jsx as jsx60, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
9476
9546
|
var DAY2 = 864e5;
|
|
@@ -9512,7 +9582,7 @@ function TimelineChart({
|
|
|
9512
9582
|
const shown = placeholders ? Array.from({ length: skeletonRows }, (_, i) => ({ id: `skeleton-${i}` })) : rows2;
|
|
9513
9583
|
const root = useRef23(null);
|
|
9514
9584
|
const [room, setRoom] = useState25(0);
|
|
9515
|
-
|
|
9585
|
+
useEffect18(() => {
|
|
9516
9586
|
const el = root.current;
|
|
9517
9587
|
if (!fill5 || !el) return;
|
|
9518
9588
|
const observer = new ResizeObserver(() => setRoom(Math.max(0, el.clientWidth - labelWidth)));
|
|
@@ -9542,7 +9612,7 @@ function TimelineChart({
|
|
|
9542
9612
|
}, [dayWidth, labelWidth]);
|
|
9543
9613
|
const zoomRef = useRef23({ onZoom, dayWidth });
|
|
9544
9614
|
zoomRef.current = { onZoom, dayWidth };
|
|
9545
|
-
|
|
9615
|
+
useEffect18(() => {
|
|
9546
9616
|
const el = root.current;
|
|
9547
9617
|
if (!el) return;
|
|
9548
9618
|
let sum = 0;
|
|
@@ -9573,7 +9643,7 @@ function TimelineChart({
|
|
|
9573
9643
|
const [linking, setLinking] = useState25(null);
|
|
9574
9644
|
const [hot, setHot] = useState25(null);
|
|
9575
9645
|
const [menu, setMenu] = useState25(null);
|
|
9576
|
-
|
|
9646
|
+
useEffect18(() => {
|
|
9577
9647
|
if (!linking) return;
|
|
9578
9648
|
const cancel = (e) => e.key === "Escape" && setLinking(null);
|
|
9579
9649
|
window.addEventListener("keydown", cancel);
|
|
@@ -9585,13 +9655,13 @@ function TimelineChart({
|
|
|
9585
9655
|
clearTimeout(cardTimer.current);
|
|
9586
9656
|
setCard(null);
|
|
9587
9657
|
};
|
|
9588
|
-
|
|
9589
|
-
|
|
9658
|
+
useEffect18(() => () => clearTimeout(cardTimer.current), []);
|
|
9659
|
+
useEffect18(() => {
|
|
9590
9660
|
if (!card) return;
|
|
9591
9661
|
window.addEventListener("scroll", cardOff, true);
|
|
9592
9662
|
return () => window.removeEventListener("scroll", cardOff, true);
|
|
9593
9663
|
}, [card]);
|
|
9594
|
-
|
|
9664
|
+
useEffect18(() => {
|
|
9595
9665
|
const el = root.current;
|
|
9596
9666
|
if (!reveal || !el) return;
|
|
9597
9667
|
const at = toDay(reveal.day) - origin;
|
|
@@ -9600,7 +9670,7 @@ function TimelineChart({
|
|
|
9600
9670
|
el.scrollTo({ left: getComputedStyle(el).direction === "rtl" ? -x : x, behavior: reduce ? "auto" : "smooth" });
|
|
9601
9671
|
}, [reveal]);
|
|
9602
9672
|
const refocus = useRef23(null);
|
|
9603
|
-
|
|
9673
|
+
useEffect18(() => {
|
|
9604
9674
|
if (!refocus.current) return;
|
|
9605
9675
|
const bar = root.current?.querySelector(`[data-bar="${CSS.escape(refocus.current)}"]`);
|
|
9606
9676
|
if (bar && document.activeElement !== bar) bar.focus();
|
|
@@ -9759,7 +9829,7 @@ function TimelineChart({
|
|
|
9759
9829
|
},
|
|
9760
9830
|
onKeyDown: zoomKey,
|
|
9761
9831
|
children: [
|
|
9762
|
-
instructions && /* @__PURE__ */ jsx60(
|
|
9832
|
+
instructions && /* @__PURE__ */ jsx60(Text21, { srOnly: true, children: instructions }),
|
|
9763
9833
|
/* @__PURE__ */ jsxs46(Box15, { display: "grid", gridTemplateColumns: fill5 ? `${labelWidth}px minmax(${width}px, 1fr)` : `${labelWidth}px ${width}px`, minW: "fit-content", children: [
|
|
9764
9834
|
/* @__PURE__ */ jsx60(
|
|
9765
9835
|
Box15,
|
|
@@ -9793,7 +9863,7 @@ function TimelineChart({
|
|
|
9793
9863
|
borderColor: "border",
|
|
9794
9864
|
"aria-hidden": true,
|
|
9795
9865
|
children: /* @__PURE__ */ jsx60(
|
|
9796
|
-
|
|
9866
|
+
Text21,
|
|
9797
9867
|
{
|
|
9798
9868
|
position: "sticky",
|
|
9799
9869
|
insetStart: `${labelWidth}px`,
|
|
@@ -9812,7 +9882,7 @@ function TimelineChart({
|
|
|
9812
9882
|
t.day
|
|
9813
9883
|
)),
|
|
9814
9884
|
subTicks.map((t) => /* @__PURE__ */ jsx60(
|
|
9815
|
-
|
|
9885
|
+
Text21,
|
|
9816
9886
|
{
|
|
9817
9887
|
position: "absolute",
|
|
9818
9888
|
insetStart: `${t.day * dayWidth}px`,
|
|
@@ -9864,7 +9934,7 @@ function TimelineChart({
|
|
|
9864
9934
|
overflow: "clip",
|
|
9865
9935
|
"aria-label": b.label,
|
|
9866
9936
|
children: /* @__PURE__ */ jsx60(
|
|
9867
|
-
|
|
9937
|
+
Text21,
|
|
9868
9938
|
{
|
|
9869
9939
|
position: "sticky",
|
|
9870
9940
|
insetStart: `${labelWidth}px`,
|
|
@@ -9912,7 +9982,7 @@ function TimelineChart({
|
|
|
9912
9982
|
}
|
|
9913
9983
|
) }, m4.id))
|
|
9914
9984
|
] }),
|
|
9915
|
-
/* @__PURE__ */ jsx60(Box15, { position: "sticky", insetStart: "0", zIndex: "1", bg: "bg.panel", borderInlineEndWidth: "1px", borderColor: "border", children: shown.map((r, i) => /* @__PURE__ */ jsx60(
|
|
9985
|
+
/* @__PURE__ */ jsx60(Box15, { position: "sticky", insetStart: "0", zIndex: "1", bg: "bg.panel", borderInlineEndWidth: "1px", borderColor: "border", children: shown.map((r, i) => /* @__PURE__ */ jsx60(HStack15, { h: `${rowHeight}px`, px: "3", gap: "2", borderBottomWidth: "1px", borderColor: "border.muted", bg: r.heading && !r.lane ? "bg.subtle" : void 0, minW: "0", children: placeholders ? /* @__PURE__ */ jsx60(TextBone, { width: boneWidth(i, 12, 26) }) : r.heading ?? (r.item && renderLabel(r.item)) }, r.id)) }),
|
|
9916
9986
|
/* @__PURE__ */ jsxs46(Box15, { ref: layer, position: "relative", zIndex: "0", h: `${shown.length * rowHeight}px`, children: [
|
|
9917
9987
|
offRuns.map((o) => /* @__PURE__ */ jsx60(
|
|
9918
9988
|
Box15,
|
|
@@ -10070,7 +10140,7 @@ function TimelineChart({
|
|
|
10070
10140
|
const thin = tone === "rollup" && !single;
|
|
10071
10141
|
const diamond = single ? { w: `${DIAMOND}px`, h: `${DIAMOND}px`, top: `${i * rowHeight + rowHeight / 2 - DIAMOND / 2}px`, transform: "rotate(45deg)", rounded: "l1" } : null;
|
|
10072
10142
|
const canLink = !!onLink && item.linkable !== false && !drag;
|
|
10073
|
-
return /* @__PURE__ */ jsxs46(
|
|
10143
|
+
return /* @__PURE__ */ jsxs46(Fragment21, { children: [
|
|
10074
10144
|
/* @__PURE__ */ jsxs46(
|
|
10075
10145
|
Box15,
|
|
10076
10146
|
{
|
|
@@ -10296,7 +10366,7 @@ function TimelineChart({
|
|
|
10296
10366
|
autoFocus: true,
|
|
10297
10367
|
positioning: { placement: "bottom", getAnchorRect: () => menu ? { x: menu.x, y: menu.y, width: 1, height: 1 } : null },
|
|
10298
10368
|
children: /* @__PURE__ */ jsx60(Portal18, { children: /* @__PURE__ */ jsx60(Popover4.Positioner, { children: /* @__PURE__ */ jsx60(Popover4.Content, { w: "auto", maxW: "calc(100vw - 32px)", children: /* @__PURE__ */ jsx60(Popover4.Body, { children: menu && /* @__PURE__ */ jsxs46(Stack15, { gap: "2", children: [
|
|
10299
|
-
/* @__PURE__ */ jsx60(
|
|
10369
|
+
/* @__PURE__ */ jsx60(Text21, { textStyle: "label", children: linkTexts?.arrow(menu.from, menu.to) }),
|
|
10300
10370
|
/* @__PURE__ */ jsxs46(Button, { size: "sm", variant: "secondary", onClick: () => {
|
|
10301
10371
|
onUnlink(menu);
|
|
10302
10372
|
setMenu(null);
|
|
@@ -10313,8 +10383,8 @@ function TimelineChart({
|
|
|
10313
10383
|
}
|
|
10314
10384
|
|
|
10315
10385
|
// src/components/TimelineCards.tsx
|
|
10316
|
-
import { useEffect as
|
|
10317
|
-
import { Box as Box16, chakra as chakra35, Grid as
|
|
10386
|
+
import { useEffect as useEffect19, useMemo as useMemo14, useRef as useRef24, useState as useState26 } from "react";
|
|
10387
|
+
import { Box as Box16, chakra as chakra35, Grid as Grid4, Stack as Stack16, Text as Text22 } from "@chakra-ui/react";
|
|
10318
10388
|
|
|
10319
10389
|
// src/components/timeline-cards-math.ts
|
|
10320
10390
|
var DAY3 = 864e5;
|
|
@@ -10434,7 +10504,7 @@ function Lanes(p) {
|
|
|
10434
10504
|
const { days, today, items, scale } = p;
|
|
10435
10505
|
const box = useRef24(null);
|
|
10436
10506
|
const [available, setAvailable] = useState26(0);
|
|
10437
|
-
|
|
10507
|
+
useEffect19(() => {
|
|
10438
10508
|
const el = box.current;
|
|
10439
10509
|
if (!el) return;
|
|
10440
10510
|
const measure = () => setAvailable(el.clientWidth);
|
|
@@ -10471,9 +10541,9 @@ function Lanes(p) {
|
|
|
10471
10541
|
borderInlineStartWidth: weekStart && scale === "month" ? "1px" : "0",
|
|
10472
10542
|
borderColor: "border",
|
|
10473
10543
|
children: [
|
|
10474
|
-
/* @__PURE__ */ jsx61(
|
|
10544
|
+
/* @__PURE__ */ jsx61(Text22, { as: "span", children: p.weekday(d) }),
|
|
10475
10545
|
/* @__PURE__ */ jsx61(
|
|
10476
|
-
|
|
10546
|
+
Text22,
|
|
10477
10547
|
{
|
|
10478
10548
|
as: "span",
|
|
10479
10549
|
fontVariantNumeric: "tabular-nums",
|
|
@@ -10546,7 +10616,7 @@ function DayGrid(p) {
|
|
|
10546
10616
|
return s <= x && x <= d;
|
|
10547
10617
|
});
|
|
10548
10618
|
if (due.length === 0 && p.empty) return /* @__PURE__ */ jsx61(chakra35.div, { py: "6", children: p.empty });
|
|
10549
|
-
return /* @__PURE__ */ jsx61(
|
|
10619
|
+
return /* @__PURE__ */ jsx61(Grid4, { role: "list", templateColumns: "repeat(auto-fill, minmax(16rem, 1fr))", gap: "2", p: "3", children: due.map((i) => /* @__PURE__ */ jsx61(chakra35.div, { role: "listitem", display: "flex", children: /* @__PURE__ */ jsx61(Card2, { item: i, p, range: Boolean(i.start && i.start < i.due), style: { w: "full" } }) }, i.id)) });
|
|
10550
10620
|
}
|
|
10551
10621
|
export {
|
|
10552
10622
|
ABP_UI_VERSION,
|
|
@@ -10616,6 +10686,7 @@ export {
|
|
|
10616
10686
|
PresenceItem,
|
|
10617
10687
|
PresenceList,
|
|
10618
10688
|
Pressable,
|
|
10689
|
+
PreviewCard,
|
|
10619
10690
|
PriorityMark,
|
|
10620
10691
|
PropertyList,
|
|
10621
10692
|
QueryableList,
|