@abpjs/ui 0.2.0-next.10 → 0.2.0-next.12

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/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.10" : "0.0.0-dev";
1563
+ var ABP_UI_VERSION = true ? "0.2.0-next.12" : "0.0.0-dev";
1564
1564
 
1565
1565
  // src/provider/time-zone.tsx
1566
1566
  import { createContext, useContext } from "react";
@@ -5787,8 +5787,127 @@ function useSlotSaves() {
5787
5787
  return { register, run };
5788
5788
  }
5789
5789
 
5790
+ // src/lists/list-source.ts
5791
+ var DEFAULT_PAGE_SIZE = 25;
5792
+ function emptyQuery(initial = {}) {
5793
+ return { page: 1, pageSize: DEFAULT_PAGE_SIZE, sort: null, search: "", filters: {}, ...initial };
5794
+ }
5795
+ function abpListParams(query, options = {}) {
5796
+ const params = new URLSearchParams(options.fixed);
5797
+ params.set("skipCount", String((query.page - 1) * query.pageSize));
5798
+ params.set("maxResultCount", String(query.pageSize));
5799
+ if (query.sort) params.set("sorting", `${options.sortFields?.[query.sort.columnId] ?? query.sort.columnId} ${query.sort.direction}`);
5800
+ if (query.search.trim()) params.set(options.searchParam ?? "filter", query.search.trim());
5801
+ for (const [name, value] of Object.entries(query.filters)) if (value) params.set(name, value);
5802
+ return params;
5803
+ }
5804
+ function abpListSource(request, path, options = {}) {
5805
+ return {
5806
+ key: `${path}?${new URLSearchParams(options.fixed).toString()}`,
5807
+ load: async (query, signal) => {
5808
+ const answer = await request(`${path}?${abpListParams(query, options)}`, { signal });
5809
+ return { items: answer.items, total: Number(answer.totalCount) };
5810
+ }
5811
+ };
5812
+ }
5813
+ var pageCount = (total, pageSize) => Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
5814
+
5815
+ // src/lists/useListState.ts
5816
+ import { useCallback as useCallback10, useEffect as useEffect9, useMemo as useMemo8, useRef as useRef14, useState as useState13 } from "react";
5817
+ function useListState(source, options = {}) {
5818
+ const { searchDelay = 250 } = options;
5819
+ const [query, setQuery] = useState13(() => emptyQuery(options.initial));
5820
+ const [typed, setTyped] = useState13(query.search);
5821
+ const [rows, setRows] = useState13(void 0);
5822
+ const [total, setTotal] = useState13(0);
5823
+ const [busy, setBusy] = useState13(true);
5824
+ const [error, setError] = useState13(null);
5825
+ const [round, setRound] = useState13(0);
5826
+ const told = useRef14(options.onQueryChange);
5827
+ useEffect9(() => {
5828
+ told.current = options.onQueryChange;
5829
+ });
5830
+ const [shownKey, setShownKey] = useState13(source.key);
5831
+ if (shownKey !== source.key) {
5832
+ setShownKey(source.key);
5833
+ setRows(void 0);
5834
+ setTotal(0);
5835
+ }
5836
+ useEffect9(() => {
5837
+ const abort = new AbortController();
5838
+ setBusy(true);
5839
+ source.load(query, abort.signal).then(
5840
+ (page) => {
5841
+ if (abort.signal.aborted) return;
5842
+ setRows(page.items);
5843
+ setTotal(page.total);
5844
+ setError(null);
5845
+ setBusy(false);
5846
+ },
5847
+ (e) => {
5848
+ if (abort.signal.aborted) return;
5849
+ setError(errorText(e));
5850
+ setBusy(false);
5851
+ }
5852
+ );
5853
+ return () => abort.abort();
5854
+ }, [query, round, source.key]);
5855
+ const change = useCallback10((next) => {
5856
+ setQuery((q) => {
5857
+ const n = next(q);
5858
+ told.current?.(n);
5859
+ return n;
5860
+ });
5861
+ }, []);
5862
+ useEffect9(() => {
5863
+ if (typed === query.search) return;
5864
+ const timer = setTimeout(() => change((q) => ({ ...q, search: typed, page: 1 })), searchDelay);
5865
+ return () => clearTimeout(timer);
5866
+ }, [typed, query.search, searchDelay, change]);
5867
+ const setFilter = useCallback10(
5868
+ (name, value) => change((q) => {
5869
+ const filters = { ...q.filters };
5870
+ if (value) filters[name] = value;
5871
+ else delete filters[name];
5872
+ return { ...q, filters, page: 1 };
5873
+ }),
5874
+ [change]
5875
+ );
5876
+ const setSort = useCallback10((sort) => change((q) => ({ ...q, sort, page: 1 })), [change]);
5877
+ const setPage = useCallback10((page) => change((q) => ({ ...q, page })), [change]);
5878
+ const setPageSize = useCallback10((pageSize) => change((q) => ({ ...q, pageSize, page: 1 })), [change]);
5879
+ const reload = useCallback10(() => setRound((r) => r + 1), []);
5880
+ const pages = pageCount(total, query.pageSize);
5881
+ const loading = busy && rows === void 0;
5882
+ return useMemo8(
5883
+ () => ({
5884
+ query: { ...query, search: typed },
5885
+ rows,
5886
+ total,
5887
+ pages,
5888
+ loading,
5889
+ refreshing: busy && rows !== void 0,
5890
+ error,
5891
+ setSearch: setTyped,
5892
+ setFilter,
5893
+ setSort,
5894
+ setPage,
5895
+ setPageSize,
5896
+ reload,
5897
+ table: { rows, loading, error, sort: query.sort, onSortChange: setSort, sortMode: "manual" },
5898
+ pagination: { page: query.page, pages, onPage: setPage }
5899
+ }),
5900
+ [query, typed, rows, total, pages, loading, busy, error, setFilter, setSort, setPage, setPageSize, reload]
5901
+ );
5902
+ }
5903
+ function useAreaListSource(area, path, options = {}) {
5904
+ const request = useAreaRequest(area);
5905
+ const key = JSON.stringify(options);
5906
+ return useMemo8(() => abpListSource(request, path, options), [request, path, key]);
5907
+ }
5908
+
5790
5909
  // src/components/FormDialog.tsx
5791
- import { useRef as useRef14, useState as useState13 } from "react";
5910
+ import { useRef as useRef15, useState as useState14 } from "react";
5792
5911
  import { chakra as chakra22, CloseButton as CloseButton2, Dialog as Dialog4, Portal as Portal10, Stack as Stack6 } from "@chakra-ui/react";
5793
5912
  import { jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
5794
5913
  var isControl = (el) => el instanceof HTMLInputElement || el instanceof HTMLSelectElement || el instanceof HTMLTextAreaElement;
@@ -5812,10 +5931,10 @@ function mark(el, wrong) {
5812
5931
  function FormDialog({ open, onOpenChange, title, description, submitLabel, onSubmit, busy, error, size = "md", hideSubmit, submitDisabled, children }) {
5813
5932
  const labels = useAbpLabels();
5814
5933
  const { locale } = useAbpLocale();
5815
- const summary = useRef14(null);
5816
- const [problems, setProblems] = useState13([]);
5817
- const typed = useRef14(/* @__PURE__ */ new WeakSet());
5818
- const tried = useRef14(false);
5934
+ const summary = useRef15(null);
5935
+ const [problems, setProblems] = useState14([]);
5936
+ const typed = useRef15(/* @__PURE__ */ new WeakSet());
5937
+ const tried = useRef15(false);
5819
5938
  const describe2 = (el) => ({ el, label: labelOf(el), message: el.validity.valueMissing ? labels.formRequired : el.validationMessage });
5820
5939
  function submit(e) {
5821
5940
  e.preventDefault();
@@ -5880,7 +5999,7 @@ function FormDialog({ open, onOpenChange, title, description, submitLabel, onSub
5880
5999
  }
5881
6000
 
5882
6001
  // src/settings/SettingsLayout.tsx
5883
- import { useState as useState14 } from "react";
6002
+ import { useState as useState15 } from "react";
5884
6003
  import { Text as Text7 } from "@chakra-ui/react";
5885
6004
 
5886
6005
  // src/components/SearchInput.tsx
@@ -5909,7 +6028,7 @@ var SearchInput = forwardRef7(function SearchInput2({ size = "md", maxW, ...rest
5909
6028
  import { jsx as jsx40 } from "react/jsx-runtime";
5910
6029
  var isCurrent = (pathname, href) => pathname === href || pathname.startsWith(`${href}/`);
5911
6030
  function SettingsLayout({ area, pathname, sidebarId = "settings", labels, topNav = [], children, ...shell }) {
5912
- const [find, setFind] = useState14("");
6031
+ const [find, setFind] = useState15("");
5913
6032
  const q = find.trim().toLocaleLowerCase();
5914
6033
  const sections = area.map(({ section, pages }) => ({
5915
6034
  id: section.key,
@@ -5999,7 +6118,7 @@ function SegmentedControl({
5999
6118
  }
6000
6119
 
6001
6120
  // src/components/KanbanBoard.tsx
6002
- import { useEffect as useEffect9, useLayoutEffect as useLayoutEffect3, useMemo as useMemo8, useRef as useRef15, useState as useState15 } from "react";
6121
+ import { useEffect as useEffect10, useLayoutEffect as useLayoutEffect3, useMemo as useMemo9, useRef as useRef16, useState as useState16 } from "react";
6003
6122
  import { Box as Box6, chakra as chakra23, HStack as HStack7, Stack as Stack7, Text as Text8 } from "@chakra-ui/react";
6004
6123
  import { Check as Check2, ChevronsLeft, ChevronsRight, GripVertical as GripVertical3 } from "lucide-react";
6005
6124
  import {
@@ -6075,8 +6194,8 @@ function KanbanBoard({
6075
6194
  }) {
6076
6195
  const loading = useLoading(own);
6077
6196
  const [folded, fold] = useFolded(foldKey);
6078
- const [movingColumn, setMovingColumn] = useState15(null);
6079
- const [overColumn, setOverColumn] = useState15(null);
6197
+ const [movingColumn, setMovingColumn] = useState16(null);
6198
+ const [overColumn, setOverColumn] = useState16(null);
6080
6199
  const movingCol = columns.find((c2) => c2.id === movingColumn);
6081
6200
  const movingName = movingCol?.name ?? (typeof movingCol?.title === "string" ? movingCol.title : movingColumn ?? "");
6082
6201
  const reorder = (id, to) => {
@@ -6095,17 +6214,17 @@ function KanbanBoard({
6095
6214
  useSensor2(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
6096
6215
  );
6097
6216
  const laned = !!lanes && lanes.length > 0;
6098
- const [active, setActive] = useState15(null);
6099
- const [carried, setCarried] = useState15([]);
6100
- const [pending2, setPending] = useState15(null);
6101
- const shown = useMemo8(() => pending2 && pending2.on === items ? withMoves(items, pending2.ids, pending2.move, !laned) : items, [items, pending2, laned]);
6102
- const riding = useMemo8(() => new Set(carried.map((i) => i.id)), [carried]);
6103
- const anchor = useRef15(null);
6104
- const draggedAt = useRef15(0);
6217
+ const [active, setActive] = useState16(null);
6218
+ const [carried, setCarried] = useState16([]);
6219
+ const [pending2, setPending] = useState16(null);
6220
+ const shown = useMemo9(() => pending2 && pending2.on === items ? withMoves(items, pending2.ids, pending2.move, !laned) : items, [items, pending2, laned]);
6221
+ const riding = useMemo9(() => new Set(carried.map((i) => i.id)), [carried]);
6222
+ const anchor = useRef16(null);
6223
+ const draggedAt = useRef16(0);
6105
6224
  const { reduce } = useMotionSetting();
6106
- const region = useRef15(null);
6107
- const dropped = useRef15(null);
6108
- const placement = useMemo8(() => shown.map((i) => `${i.id}@${lanes && lanes.length > 0 ? i.lane : ""}/${i.column}`).join("|"), [shown, lanes]);
6225
+ const region = useRef16(null);
6226
+ const dropped = useRef16(null);
6227
+ const placement = useMemo9(() => shown.map((i) => `${i.id}@${lanes && lanes.length > 0 ? i.lane : ""}/${i.column}`).join("|"), [shown, lanes]);
6109
6228
  const notePlaces = useSlideItems(region, placement, {
6110
6229
  paused: active != null,
6111
6230
  skip: () => {
@@ -6114,7 +6233,7 @@ function KanbanBoard({
6114
6233
  return id;
6115
6234
  }
6116
6235
  });
6117
- const byCell = useMemo8(() => {
6236
+ const byCell = useMemo9(() => {
6118
6237
  const map = /* @__PURE__ */ new Map();
6119
6238
  for (const item of shown) {
6120
6239
  const id = cellId(lanes && lanes.length > 0 ? item.lane : "", item.column);
@@ -6123,7 +6242,7 @@ function KanbanBoard({
6123
6242
  }
6124
6243
  return map;
6125
6244
  }, [shown, lanes]);
6126
- const cellOf = useMemo8(() => {
6245
+ const cellOf = useMemo9(() => {
6127
6246
  const map = /* @__PURE__ */ new Map();
6128
6247
  for (const [cell, list] of byCell) for (const item of list) map.set(item.id, cell);
6129
6248
  return map;
@@ -6190,7 +6309,7 @@ function KanbanBoard({
6190
6309
  const clear = () => {
6191
6310
  if (onSelect && selected && selected.size > 0) onSelect(/* @__PURE__ */ new Set());
6192
6311
  };
6193
- useEffect9(() => {
6312
+ useEffect10(() => {
6194
6313
  if (!onSelect || !selected || selected.size === 0 || active) return;
6195
6314
  const key = (e) => {
6196
6315
  if (e.key !== "Escape" || e.defaultPrevented) return;
@@ -6462,7 +6581,7 @@ var landing = {
6462
6581
  }
6463
6582
  };
6464
6583
  function Lifted({ carried, count, reduce, children }) {
6465
- const held = useRef15(null);
6584
+ const held = useRef16(null);
6466
6585
  const tv = useTokenVar();
6467
6586
  useLayoutEffect3(() => {
6468
6587
  if (reduce) return;
@@ -6490,7 +6609,7 @@ function Lifted({ carried, count, reduce, children }) {
6490
6609
  ] });
6491
6610
  }
6492
6611
  function Mark() {
6493
- const ref = useRef15(null);
6612
+ const ref = useRef16(null);
6494
6613
  const { reduce } = useMotionSetting();
6495
6614
  useLayoutEffect3(() => {
6496
6615
  if (reduce) return;
@@ -6571,8 +6690,8 @@ function FoldButton({ folded, label, onClick }) {
6571
6690
  }
6572
6691
  function useFolded(key) {
6573
6692
  const storage = key ? `board.folded.${key}` : null;
6574
- const [folded, setFolded] = useState15(() => /* @__PURE__ */ new Set());
6575
- useEffect9(() => {
6693
+ const [folded, setFolded] = useState16(() => /* @__PURE__ */ new Set());
6694
+ useEffect10(() => {
6576
6695
  if (!storage) return;
6577
6696
  try {
6578
6697
  const saved = JSON.parse(window.localStorage.getItem(storage) ?? "[]");
@@ -6758,13 +6877,13 @@ function PropertyList({ items, size = "md", loading: own }) {
6758
6877
  }
6759
6878
 
6760
6879
  // src/components/QueryableList.tsx
6761
- import { useEffect as useEffect11, useId as useId3, useMemo as useMemo10, useRef as useRef17, useState as useState17 } from "react";
6880
+ import { useEffect as useEffect12, useId as useId3, useMemo as useMemo11, useRef as useRef18, useState as useState18 } from "react";
6762
6881
  import { createPortal } from "react-dom";
6763
6882
  import { Box as Box8, chakra as chakra29, HStack as HStack10, Input as Input4, Menu as Menu3, Portal as Portal14, Stack as Stack10, Text as Text11 } from "@chakra-ui/react";
6764
6883
  import { ArrowDownWideNarrow, ArrowUpNarrowWide, ChevronDown as ChevronDown3, Download, Filter, Plus as Plus2, Rows3, Save, Trash2 as Trash22, X as X2 } from "lucide-react";
6765
6884
 
6766
6885
  // src/components/query/ColumnsPopover.tsx
6767
- import { useMemo as useMemo9 } from "react";
6886
+ import { useMemo as useMemo10 } from "react";
6768
6887
  import { chakra as chakra28, HStack as HStack8, Popover as Popover2, Portal as Portal12, Stack as Stack8, Switch as Switch2, Text as Text9 } from "@chakra-ui/react";
6769
6888
  import {
6770
6889
  closestCenter,
@@ -6783,7 +6902,7 @@ function fill(template, values) {
6783
6902
  }
6784
6903
  function ColumnsPopover({ fields, columns, onChange }) {
6785
6904
  const labels = useAbpLabels().queryList;
6786
- const byId = useMemo9(() => new Map(fields.map((f) => [f.id, f])), [fields]);
6905
+ const byId = useMemo10(() => new Map(fields.map((f) => [f.id, f])), [fields]);
6787
6906
  const shown = columns.filter((c2) => byId.has(c2));
6788
6907
  const hidden = fields.filter((f) => !columns.includes(f.id));
6789
6908
  const sensors = useSensors3(useSensor3(PointerSensor3, { activationConstraint: { distance: 4 } }), useSensor3(KeyboardSensor2, { coordinateGetter: sortableKeyboardCoordinates2 }));
@@ -6870,7 +6989,7 @@ function ColumnRow({ id, label, checked, disabled, onCheckedChange }) {
6870
6989
  }
6871
6990
 
6872
6991
  // src/components/query/FilterBuilder.tsx
6873
- import { useEffect as useEffect10, useId as useId2, useRef as useRef16, useState as useState16 } from "react";
6992
+ import { useEffect as useEffect11, useId as useId2, useRef as useRef17, useState as useState17 } from "react";
6874
6993
  import { CloseButton as CloseButton3, Dialog as Dialog5, HStack as HStack9, Input as Input3, Portal as Portal13, Stack as Stack9, Text as Text10 } from "@chakra-ui/react";
6875
6994
  import { Plus, Trash2 } from "lucide-react";
6876
6995
  import { Fragment as Fragment13, jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
@@ -6886,9 +7005,9 @@ function conditionOf(d, field, own) {
6886
7005
  }
6887
7006
  function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, countMatches, onApply, onClose }) {
6888
7007
  const labels = useAbpLabels().queryList;
6889
- const [seq, setSeq] = useState16(initial.length + 1);
6890
- const [rows, setRows] = useState16(() => 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 }]));
6891
- const [touched, setTouched] = useState16(false);
7008
+ const [seq, setSeq] = useState17(initial.length + 1);
7009
+ const [rows, setRows] = useState17(() => 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 }]));
7010
+ const [touched, setTouched] = useState17(false);
6892
7011
  const own = (d) => {
6893
7012
  const f = fields.find((x) => x.id === d.field);
6894
7013
  return Boolean(f && renderValueEditor && !NO_VALUE_OPS.has(d.op) && renderValueEditor({ field: f, op: d.op, value: d.chosen, onChange: () => void 0 }) != null);
@@ -6897,14 +7016,14 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
6897
7016
  const incomplete = rows.length - complete.length;
6898
7017
  const repeats = new Set(rows.map((r) => r.field)).size < rows.length;
6899
7018
  const key = JSON.stringify(complete);
6900
- const counter = useRef16(countMatches);
6901
- useEffect10(() => {
7019
+ const counter = useRef17(countMatches);
7020
+ useEffect11(() => {
6902
7021
  counter.current = countMatches;
6903
7022
  });
6904
7023
  const counts = Boolean(countMatches);
6905
- const [count, setCount] = useState16(null);
6906
- const [total, setTotal] = useState16(null);
6907
- useEffect10(() => {
7024
+ const [count, setCount] = useState17(null);
7025
+ const [total, setTotal] = useState17(null);
7026
+ useEffect11(() => {
6908
7027
  if (!counts) return;
6909
7028
  let gone = false;
6910
7029
  counter.current?.([]).then((n) => !gone && setTotal(n), () => void 0);
@@ -6912,7 +7031,7 @@ function FilterBuilderDialog({ fields, initial, suggest, renderValueEditor, coun
6912
7031
  gone = true;
6913
7032
  };
6914
7033
  }, [counts]);
6915
- useEffect10(() => {
7034
+ useEffect11(() => {
6916
7035
  if (!counts) return;
6917
7036
  let gone = false;
6918
7037
  const timer = setTimeout(() => {
@@ -6997,9 +7116,9 @@ function ConditionRow({ draft, fields, suggest, renderValueEditor, warn, onChang
6997
7116
  const listId = useId2();
6998
7117
  const field = fields.find((f) => f.id === draft.field);
6999
7118
  const { op, text } = draft;
7000
- const [options, setOptions] = useState16([]);
7119
+ const [options, setOptions] = useState17([]);
7001
7120
  const own = field && renderValueEditor && !NO_VALUE_OPS.has(op) ? renderValueEditor({ field, op, value: draft.chosen, onChange: (v) => onChange({ chosen: v }) }) : null;
7002
- useEffect10(() => {
7121
+ useEffect11(() => {
7003
7122
  if (!suggest || !field || NO_VALUE_OPS.has(op) || own != null) return;
7004
7123
  const typed = LIST_OPS.has(op) ? (text.split(",").pop() ?? "").trim() : text;
7005
7124
  const prefix = `"${field.id}" = `;
@@ -7121,17 +7240,17 @@ function QueryableList({
7121
7240
  }) {
7122
7241
  const labels = useAbpLabels().queryList;
7123
7242
  const fmt = useFormatters();
7124
- const byId = useMemo10(() => new Map((fields ?? []).map((f) => [f.id, f])), [fields]);
7243
+ const byId = useMemo11(() => new Map((fields ?? []).map((f) => [f.id, f])), [fields]);
7125
7244
  const query = result?.query ?? state.query ?? {};
7126
7245
  const conditions = basicConditions(query.where ?? null);
7127
- const [mode, setMode] = useState17(conditions === null ? "rql" : "basic");
7128
- const [adding, setAdding] = useState17(false);
7129
- const [naming, setNaming] = useState17(null);
7130
- const [exporting, setExporting] = useState17(false);
7131
- const [exported, setExported] = useState17(null);
7246
+ const [mode, setMode] = useState18(conditions === null ? "rql" : "basic");
7247
+ const [adding, setAdding] = useState18(false);
7248
+ const [naming, setNaming] = useState18(null);
7249
+ const [exporting, setExporting] = useState18(false);
7250
+ const [exported, setExported] = useState18(null);
7132
7251
  const complex = conditions === null;
7133
7252
  const failed = Boolean(error && state.rql);
7134
- useEffect11(() => {
7253
+ useEffect12(() => {
7135
7254
  if (complex || failed) setMode("rql");
7136
7255
  }, [complex, failed]);
7137
7256
  const label = (id) => byId.get(id)?.label ?? id;
@@ -7177,8 +7296,8 @@ function QueryableList({
7177
7296
  }
7178
7297
  const groupField = query.groupBy?.field ?? null;
7179
7298
  const thenField = groupField ? query.groupBy?.then?.field ?? null : null;
7180
- const [folded, setFolded] = useState17(() => /* @__PURE__ */ new Set());
7181
- useEffect11(() => setFolded(/* @__PURE__ */ new Set()), [groupField, thenField]);
7299
+ const [folded, setFolded] = useState18(() => /* @__PURE__ */ new Set());
7300
+ useEffect12(() => setFolded(/* @__PURE__ */ new Set()), [groupField, thenField]);
7182
7301
  const grouped = Boolean(groupField && result?.groups && result.groups.length > 0);
7183
7302
  const asTree = Boolean(tree && groupField === tree.field);
7184
7303
  const groupOf = (row) => {
@@ -7191,7 +7310,7 @@ function QueryableList({
7191
7310
  const firstOf = (key) => thenField ? key.slice(0, key.indexOf(PAIR)) : key;
7192
7311
  const { locale } = useAbpLocale();
7193
7312
  const groupName = (value, label2, period) => value == null ? labels.noGroupValue : period ? periodName(value, period, locale, { week: labels.periodWeek, quarter: labels.periodQuarter }) : label2 || value;
7194
- const groupKeys = useMemo10(() => {
7313
+ const groupKeys = useMemo11(() => {
7195
7314
  const keys = [...new Set((result?.items ?? []).map(groupOf))];
7196
7315
  return thenField ? [...keys, ...new Set(keys.map((k) => parentFoldKey(k.slice(0, k.indexOf(PAIR)))))] : keys;
7197
7316
  }, [result, groupField, thenField]);
@@ -7560,9 +7679,9 @@ function QueryableList({
7560
7679
  }
7561
7680
  function QuickSearch({ initial, placeholder: placeholder2, onRun }) {
7562
7681
  const labels = useAbpLabels().queryList;
7563
- const [text, setText] = useState17(initial);
7564
- const timer = useRef17(void 0);
7565
- useEffect11(() => () => clearTimeout(timer.current), []);
7682
+ const [text, setText] = useState18(initial);
7683
+ const timer = useRef18(void 0);
7684
+ useEffect12(() => () => clearTimeout(timer.current), []);
7566
7685
  function later(next) {
7567
7686
  clearTimeout(timer.current);
7568
7687
  timer.current = setTimeout(() => next.trim() !== initial.trim() && onRun(next), 400);
@@ -7639,13 +7758,13 @@ function RqlBox({
7639
7758
  onRun
7640
7759
  }) {
7641
7760
  const labels = useAbpLabels().queryList;
7642
- const [text, setText] = useState17(initial);
7643
- const [found, setFound] = useState17(null);
7644
- const [active, setActive] = useState17(0);
7645
- const [open, setOpen] = useState17(false);
7646
- const input = useRef17(null);
7647
- const timer = useRef17(void 0);
7648
- const seq = useRef17(0);
7761
+ const [text, setText] = useState18(initial);
7762
+ const [found, setFound] = useState18(null);
7763
+ const [active, setActive] = useState18(0);
7764
+ const [open, setOpen] = useState18(false);
7765
+ const input = useRef18(null);
7766
+ const timer = useRef18(void 0);
7767
+ const seq = useRef18(0);
7649
7768
  const listId = useId3();
7650
7769
  function ask(value, caret) {
7651
7770
  if (!suggest) return;
@@ -7660,7 +7779,7 @@ function RqlBox({
7660
7779
  }).catch(() => setOpen(false));
7661
7780
  }, 120);
7662
7781
  }
7663
- useEffect11(() => () => clearTimeout(timer.current), []);
7782
+ useEffect12(() => () => clearTimeout(timer.current), []);
7664
7783
  function accept(item) {
7665
7784
  if (!found) return;
7666
7785
  const before = text.slice(0, found.replaceStart);
@@ -7795,7 +7914,7 @@ function RqlBox({
7795
7914
  }
7796
7915
 
7797
7916
  // src/components/FileDrop.tsx
7798
- import { forwardRef as forwardRef9, useLayoutEffect as useLayoutEffect4, useRef as useRef18 } from "react";
7917
+ import { forwardRef as forwardRef9, useLayoutEffect as useLayoutEffect4, useRef as useRef19 } from "react";
7799
7918
  import { Box as Box9, HStack as HStack11, Portal as Portal15, Text as Text12 } from "@chakra-ui/react";
7800
7919
  import { ArrowDownToLine } from "lucide-react";
7801
7920
  import { jsx as jsx51, jsxs as jsxs36 } from "react/jsx-runtime";
@@ -7846,7 +7965,7 @@ var FileDropArea = forwardRef9(function FileDropArea2({ awake = false, over: ove
7846
7965
  );
7847
7966
  });
7848
7967
  function Bob({ active }) {
7849
- const ref = useRef18(null);
7968
+ const ref = useRef19(null);
7850
7969
  useLayoutEffect4(() => {
7851
7970
  if (!active) return;
7852
7971
  const animation = ref.current?.animate?.([{ transform: "translateY(0)" }, { transform: "translateY(3px)" }, { transform: "translateY(0)" }], {
@@ -7866,7 +7985,7 @@ function DropHint({ show, children }) {
7866
7985
  }
7867
7986
 
7868
7987
  // src/components/UploadList.tsx
7869
- import { useLayoutEffect as useLayoutEffect5, useRef as useRef19 } from "react";
7988
+ import { useLayoutEffect as useLayoutEffect5, useRef as useRef20 } from "react";
7870
7989
  import { Box as Box10, chakra as chakra30, HStack as HStack12, Stack as Stack11, Text as Text13 } from "@chakra-ui/react";
7871
7990
  import { Check as Check3, File as FileIcon, RotateCcw, TriangleAlert, X as X3 } from "lucide-react";
7872
7991
  import { jsx as jsx52, jsxs as jsxs37 } from "react/jsx-runtime";
@@ -7922,7 +8041,7 @@ function Bar2({ fraction, tone, label, quiet: quiet2 }) {
7922
8041
  ) });
7923
8042
  }
7924
8043
  function Done() {
7925
- const ref = useRef19(null);
8044
+ const ref = useRef20(null);
7926
8045
  const { reduce } = useMotionSetting();
7927
8046
  useLayoutEffect5(() => {
7928
8047
  if (reduce) return;
@@ -7939,7 +8058,7 @@ function Done() {
7939
8058
  }
7940
8059
 
7941
8060
  // src/files/drop.ts
7942
- import { useEffect as useEffect12, useRef as useRef20, useState as useState18, useSyncExternalStore as useSyncExternalStore3 } from "react";
8061
+ import { useEffect as useEffect13, useRef as useRef21, useState as useState19, useSyncExternalStore as useSyncExternalStore3 } from "react";
7943
8062
 
7944
8063
  // src/files/upload-plan.ts
7945
8064
  var UPLOADS_AT_ONCE = 3;
@@ -8098,12 +8217,12 @@ function droppedFiles(data) {
8098
8217
  return Promise.resolve(Array.from(data.files).filter((f) => !JUNK.test(f.name)).map((file) => ({ file, path: file.name })));
8099
8218
  }
8100
8219
  function useDropZone(ref, { enabled = true, onFiles }) {
8101
- const [state, setState] = useState18({ over: false, part: null });
8102
- const take = useRef20(onFiles);
8103
- useEffect12(() => {
8220
+ const [state, setState] = useState19({ over: false, part: null });
8221
+ const take = useRef21(onFiles);
8222
+ useEffect13(() => {
8104
8223
  take.current = onFiles;
8105
8224
  }, [onFiles]);
8106
- useEffect12(() => {
8225
+ useEffect13(() => {
8107
8226
  const zone = ref.current;
8108
8227
  if (!zone || !enabled) return;
8109
8228
  let depth = 0;
@@ -8150,11 +8269,11 @@ function useDropZone(ref, { enabled = true, onFiles }) {
8150
8269
  return state;
8151
8270
  }
8152
8271
  function usePageDrop({ enabled = true, onFiles }) {
8153
- const take = useRef20(onFiles);
8154
- useEffect12(() => {
8272
+ const take = useRef21(onFiles);
8273
+ useEffect13(() => {
8155
8274
  take.current = onFiles;
8156
8275
  }, [onFiles]);
8157
- useEffect12(() => {
8276
+ useEffect13(() => {
8158
8277
  if (!enabled) return;
8159
8278
  const move = (e) => {
8160
8279
  if (!isFiles(e)) return;
@@ -8176,11 +8295,11 @@ function usePageDrop({ enabled = true, onFiles }) {
8176
8295
  }
8177
8296
  var editable = (target) => target instanceof HTMLElement && (target.isContentEditable || target.closest('input, textarea, select, [contenteditable=""], [contenteditable=true]') != null);
8178
8297
  function usePastedFiles({ enabled = true, onFiles }) {
8179
- const take = useRef20(onFiles);
8180
- useEffect12(() => {
8298
+ const take = useRef21(onFiles);
8299
+ useEffect13(() => {
8181
8300
  take.current = onFiles;
8182
8301
  }, [onFiles]);
8183
- useEffect12(() => {
8302
+ useEffect13(() => {
8184
8303
  if (!enabled) return;
8185
8304
  const paste = (e) => {
8186
8305
  const data = e.clipboardData;
@@ -8205,7 +8324,7 @@ function usePastedFiles({ enabled = true, onFiles }) {
8205
8324
  }
8206
8325
 
8207
8326
  // src/components/SortableSections.tsx
8208
- import { useMemo as useMemo11, useState as useState19 } from "react";
8327
+ import { useMemo as useMemo12, useState as useState20 } from "react";
8209
8328
  import { Box as Box11, Stack as Stack12, Text as Text14 } from "@chakra-ui/react";
8210
8329
  import {
8211
8330
  DndContext as DndContext4,
@@ -8238,8 +8357,8 @@ function SortableSections({
8238
8357
  useSensor4(PointerSensor4, { activationConstraint: { distance: 6 } }),
8239
8358
  useSensor4(KeyboardSensor3, { coordinateGetter: sortableKeyboardCoordinates3 })
8240
8359
  );
8241
- const [active, setActive] = useState19(null);
8242
- const sectionOf = useMemo11(() => {
8360
+ const [active, setActive] = useState20(null);
8361
+ const sectionOf = useMemo12(() => {
8243
8362
  const map = /* @__PURE__ */ new Map();
8244
8363
  for (const s of sections) for (const item of s.items) map.set(item.id, s.id);
8245
8364
  return map;
@@ -8332,7 +8451,7 @@ function SortableItem({ id, children }) {
8332
8451
  }
8333
8452
 
8334
8453
  // src/components/TimelineChart.tsx
8335
- import { Fragment as Fragment15, useEffect as useEffect13, useLayoutEffect as useLayoutEffect6, useRef as useRef21, useState as useState20 } from "react";
8454
+ import { Fragment as Fragment15, useEffect as useEffect14, useLayoutEffect as useLayoutEffect6, useRef as useRef22, useState as useState21 } from "react";
8336
8455
  import { Box as Box12, HStack as HStack13, Popover as Popover3, Portal as Portal16, Stack as Stack13, Text as Text15 } from "@chakra-ui/react";
8337
8456
  import { Flag, Trash2 as Trash23 } from "lucide-react";
8338
8457
  import { jsx as jsx54, jsxs as jsxs39 } from "react/jsx-runtime";
@@ -8373,9 +8492,9 @@ function TimelineChart({
8373
8492
  const tv = useTokenVar();
8374
8493
  const placeholders = useLoading(own) && rows.length === 0;
8375
8494
  const shown = placeholders ? Array.from({ length: skeletonRows }, (_, i) => ({ id: `skeleton-${i}` })) : rows;
8376
- const root = useRef21(null);
8377
- const [room, setRoom] = useState20(0);
8378
- useEffect13(() => {
8495
+ const root = useRef22(null);
8496
+ const [room, setRoom] = useState21(0);
8497
+ useEffect14(() => {
8379
8498
  const el = root.current;
8380
8499
  if (!fill4 || !el) return;
8381
8500
  const observer = new ResizeObserver(() => setRoom(Math.max(0, el.clientWidth - labelWidth)));
@@ -8385,11 +8504,11 @@ function TimelineChart({
8385
8504
  const origin = toDay(from);
8386
8505
  const days = Math.max(toDay(to) - origin + 1, fill4 ? Math.floor(room / dayWidth) : 0);
8387
8506
  const width = days * dayWidth;
8388
- const [drag, setDrag] = useState20(null);
8389
- const moved = useRef21(false);
8390
- const scrolled = useRef21(0);
8391
- const lastWidth = useRef21(dayWidth);
8392
- const anchor = useRef21(null);
8507
+ const [drag, setDrag] = useState21(null);
8508
+ const moved = useRef22(false);
8509
+ const scrolled = useRef22(0);
8510
+ const lastWidth = useRef22(dayWidth);
8511
+ const anchor = useRef22(null);
8393
8512
  const rtlOf = (el) => getComputedStyle(el).direction === "rtl";
8394
8513
  const along = (el) => rtlOf(el) ? -el.scrollLeft : el.scrollLeft;
8395
8514
  useLayoutEffect6(() => {
@@ -8403,9 +8522,9 @@ function TimelineChart({
8403
8522
  el.scrollLeft = rtlOf(el) ? -x : x;
8404
8523
  scrolled.current = x;
8405
8524
  }, [dayWidth, labelWidth]);
8406
- const zoomRef = useRef21({ onZoom, dayWidth });
8525
+ const zoomRef = useRef22({ onZoom, dayWidth });
8407
8526
  zoomRef.current = { onZoom, dayWidth };
8408
- useEffect13(() => {
8527
+ useEffect14(() => {
8409
8528
  const el = root.current;
8410
8529
  if (!el) return;
8411
8530
  let sum = 0;
@@ -8432,29 +8551,29 @@ function TimelineChart({
8432
8551
  onZoom(step);
8433
8552
  }
8434
8553
  const { reduce } = useMotionSetting();
8435
- const layer = useRef21(null);
8436
- const [linking, setLinking] = useState20(null);
8437
- const [hot, setHot] = useState20(null);
8438
- const [menu, setMenu] = useState20(null);
8439
- useEffect13(() => {
8554
+ const layer = useRef22(null);
8555
+ const [linking, setLinking] = useState21(null);
8556
+ const [hot, setHot] = useState21(null);
8557
+ const [menu, setMenu] = useState21(null);
8558
+ useEffect14(() => {
8440
8559
  if (!linking) return;
8441
8560
  const cancel = (e) => e.key === "Escape" && setLinking(null);
8442
8561
  window.addEventListener("keydown", cancel);
8443
8562
  return () => window.removeEventListener("keydown", cancel);
8444
8563
  }, [linking]);
8445
- const [card, setCard] = useState20(null);
8446
- const cardTimer = useRef21(void 0);
8564
+ const [card, setCard] = useState21(null);
8565
+ const cardTimer = useRef22(void 0);
8447
8566
  const cardOff = () => {
8448
8567
  clearTimeout(cardTimer.current);
8449
8568
  setCard(null);
8450
8569
  };
8451
- useEffect13(() => () => clearTimeout(cardTimer.current), []);
8452
- useEffect13(() => {
8570
+ useEffect14(() => () => clearTimeout(cardTimer.current), []);
8571
+ useEffect14(() => {
8453
8572
  if (!card) return;
8454
8573
  window.addEventListener("scroll", cardOff, true);
8455
8574
  return () => window.removeEventListener("scroll", cardOff, true);
8456
8575
  }, [card]);
8457
- useEffect13(() => {
8576
+ useEffect14(() => {
8458
8577
  const el = root.current;
8459
8578
  if (!reveal || !el) return;
8460
8579
  const at = toDay(reveal.day) - origin;
@@ -8462,8 +8581,8 @@ function TimelineChart({
8462
8581
  const x = Math.max(0, at * dayWidth + dayWidth / 2 - (el.clientWidth - labelWidth) / 2);
8463
8582
  el.scrollTo({ left: getComputedStyle(el).direction === "rtl" ? -x : x, behavior: reduce ? "auto" : "smooth" });
8464
8583
  }, [reveal]);
8465
- const refocus = useRef21(null);
8466
- useEffect13(() => {
8584
+ const refocus = useRef22(null);
8585
+ useEffect14(() => {
8467
8586
  if (!refocus.current) return;
8468
8587
  const bar = root.current?.querySelector(`[data-bar="${CSS.escape(refocus.current)}"]`);
8469
8588
  if (bar && document.activeElement !== bar) bar.focus();
@@ -9176,7 +9295,7 @@ function TimelineChart({
9176
9295
  }
9177
9296
 
9178
9297
  // src/components/TimelineCards.tsx
9179
- import { useEffect as useEffect14, useMemo as useMemo12, useRef as useRef22, useState as useState21 } from "react";
9298
+ import { useEffect as useEffect15, useMemo as useMemo13, useRef as useRef23, useState as useState22 } from "react";
9180
9299
  import { Box as Box13, chakra as chakra31, Grid as Grid3, Stack as Stack14, Text as Text16 } from "@chakra-ui/react";
9181
9300
 
9182
9301
  // src/components/timeline-cards-math.ts
@@ -9295,9 +9414,9 @@ function Card({ item, p, range, cutStart, cutEnd, style }) {
9295
9414
  }
9296
9415
  function Lanes(p) {
9297
9416
  const { days, today, items, scale } = p;
9298
- const box = useRef22(null);
9299
- const [available, setAvailable] = useState21(0);
9300
- useEffect14(() => {
9417
+ const box = useRef23(null);
9418
+ const [available, setAvailable] = useState22(0);
9419
+ useEffect15(() => {
9301
9420
  const el = box.current;
9302
9421
  if (!el) return;
9303
9422
  const measure = () => setAvailable(el.clientWidth);
@@ -9307,8 +9426,8 @@ function Lanes(p) {
9307
9426
  return () => observer.disconnect();
9308
9427
  }, []);
9309
9428
  const colW = columnWidth(scale, days.length, available);
9310
- const byId = useMemo12(() => new Map(items.map((i) => [i.id, i])), [items]);
9311
- const { cards, lanes } = useMemo12(() => placeCards(items, days[0], days.length, scale, colW), [items, days, scale, colW]);
9429
+ const byId = useMemo13(() => new Map(items.map((i) => [i.id, i])), [items]);
9430
+ const { cards, lanes } = useMemo13(() => placeCards(items, days[0], days.length, scale, colW), [items, days, scale, colW]);
9312
9431
  const todayIdx = days.indexOf(today);
9313
9432
  const gridW = days.length * colW;
9314
9433
  const placeholders = useLoading(p.loading) && items.length === 0;
@@ -9435,6 +9554,7 @@ export {
9435
9554
  ConfirmProvider,
9436
9555
  CountBadge,
9437
9556
  Counter,
9557
+ DEFAULT_PAGE_SIZE,
9438
9558
  DashboardGrid,
9439
9559
  DataTable,
9440
9560
  DirectionalIcon,
@@ -9500,6 +9620,8 @@ export {
9500
9620
  UPLOADS_AT_ONCE,
9501
9621
  UploadList,
9502
9622
  abpConfig,
9623
+ abpListParams,
9624
+ abpListSource,
9503
9625
  arriveCss,
9504
9626
  asMotionSetting,
9505
9627
  avatarPalette,
@@ -9521,6 +9643,7 @@ export {
9521
9643
  defaultQueryListLabels,
9522
9644
  directionOf,
9523
9645
  droppedFiles,
9646
+ emptyQuery,
9524
9647
  errorText,
9525
9648
  fileNameOf,
9526
9649
  findSettingsPage,
@@ -9540,6 +9663,7 @@ export {
9540
9663
  durations2 as motionDurations,
9541
9664
  needsStepUp,
9542
9665
  notify,
9666
+ pageCount,
9543
9667
  pageList,
9544
9668
  partsOf,
9545
9669
  passkeysSupported,
@@ -9568,6 +9692,7 @@ export {
9568
9692
  useApiDownload,
9569
9693
  useApiQuery,
9570
9694
  useAreaEvents,
9695
+ useAreaListSource,
9571
9696
  useAreaRequest,
9572
9697
  useArriving,
9573
9698
  useCan,
@@ -9580,6 +9705,7 @@ export {
9580
9705
  useHost,
9581
9706
  useHostLanguages,
9582
9707
  useLinkComponent,
9708
+ useListState,
9583
9709
  useLoading,
9584
9710
  useMe,
9585
9711
  useMotionSetting,