@pythia-software/query-table-ui 0.9.3 → 0.9.5

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
@@ -1958,8 +1958,9 @@ import { useCallback, useEffect as useEffect5, useRef as useRef5, useState as us
1958
1958
  import { createPortal as createPortal2 } from "react-dom";
1959
1959
  import { autoUpdate, flip, offset, shift, size, useFloating } from "@floating-ui/react";
1960
1960
  import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
1961
- function useFloatingOverlay({ anchor, onClose, returnFocus, width = 240, placement = "bottom-start", nodeId }) {
1962
- const mobile = useMobileLayout();
1961
+ function useFloatingOverlay({ anchor, onClose, returnFocus, width = 240, placement = "bottom-start", nodeId, modalOnMobile = true, retainAnchorFocus = false, maxHeight }) {
1962
+ const mobileLayout = useMobileLayout();
1963
+ const mobile = mobileLayout && modalOnMobile;
1963
1964
  const themeAnchor = useRef5(null);
1964
1965
  const theme = useOverlayTheme(themeAnchor);
1965
1966
  const surface = useRef5(null);
@@ -1984,7 +1985,7 @@ function useFloatingOverlay({ anchor, onClose, returnFocus, width = 240, placeme
1984
1985
  middleware: [offset(4), flip({ padding: 8 }), shift({ padding: 8 }), size({
1985
1986
  padding: 8,
1986
1987
  apply({ availableHeight, elements }) {
1987
- elements.floating.style.maxHeight = `${Math.max(0, availableHeight)}px`;
1988
+ elements.floating.style.maxHeight = `${Math.max(0, Math.min(availableHeight, maxHeight ?? Infinity))}px`;
1988
1989
  }
1989
1990
  })]
1990
1991
  });
@@ -2028,7 +2029,7 @@ function useFloatingOverlay({ anchor, onClose, returnFocus, width = 240, placeme
2028
2029
  close("outside");
2029
2030
  };
2030
2031
  const focusOutside = (event) => {
2031
- if (pointerOnAnchor && event.target instanceof Node && isElementAnchor && anchor.contains(event.target)) return;
2032
+ if ((pointerOnAnchor || retainAnchorFocus) && event.target instanceof Node && isElementAnchor && anchor.contains(event.target)) return;
2032
2033
  if (event.target instanceof Node && !surface.current?.contains(event.target)) close("outside");
2033
2034
  };
2034
2035
  const scroll = (event) => {
@@ -2047,7 +2048,7 @@ function useFloatingOverlay({ anchor, onClose, returnFocus, width = 240, placeme
2047
2048
  document.removeEventListener("scroll", scroll, true);
2048
2049
  window.removeEventListener("blur", blur);
2049
2050
  };
2050
- }, [close, mobile, isElementAnchor, anchor]);
2051
+ }, [close, mobile, isElementAnchor, anchor, retainAnchorFocus]);
2051
2052
  const setSurface = useCallback((element) => {
2052
2053
  surface.current = element;
2053
2054
  refs.setFloating(mobile ? null : element);
@@ -13135,11 +13136,11 @@ function SetFilterEditor({ api, field, returnFocus, classNames, mode: initialMod
13135
13136
  // src/QueryBuilder.tsx
13136
13137
  import {
13137
13138
  Fragment as Fragment23,
13138
- useEffect as useEffect21,
13139
- useId as useId10,
13139
+ useEffect as useEffect22,
13140
+ useId as useId11,
13140
13141
  useMemo as useMemo12,
13141
- useRef as useRef22,
13142
- useState as useState30
13142
+ useRef as useRef23,
13143
+ useState as useState31
13143
13144
  } from "react";
13144
13145
  import {
13145
13146
  NULLARY_OPS as NULLARY_OPS2,
@@ -13223,8 +13224,148 @@ function SavedQueriesModal({ saved, onClose, onLoad }) {
13223
13224
  }) }) }) });
13224
13225
  }
13225
13226
 
13227
+ // src/FilterValueAutocomplete.tsx
13228
+ import { useEffect as useEffect21, useId as useId10, useRef as useRef22, useState as useState30 } from "react";
13229
+ import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
13230
+ function FilterValueAutocomplete({ api, field, value, contextKey, className, widthChars, onChange }) {
13231
+ const input = useRef22(null);
13232
+ const listId = useId10();
13233
+ const [open, setOpen] = useState30(false);
13234
+ const [active, setActive] = useState30(null);
13235
+ const scopeKey = JSON.stringify([field.name, contextKey]);
13236
+ const requestKey = JSON.stringify([scopeKey, value]);
13237
+ const fetchValues = api.filterValues;
13238
+ const [known, setKnown] = useState30(null);
13239
+ const [response, setResponse] = useState30(null);
13240
+ const current = response?.key === requestKey && response.fetchValues === fetchValues ? response : null;
13241
+ const search = value.trim().toLowerCase();
13242
+ const previousValues = known?.scopeKey === scopeKey && known.fetchValues === fetchValues ? known.result.values.filter((choice) => choice.toLowerCase().includes(search)) : [];
13243
+ const values = [...new Set(current?.result?.values ?? previousValues)];
13244
+ const activeIndex = active === null ? -1 : values.indexOf(active);
13245
+ const activeId = open && activeIndex >= 0 ? `${listId}-${activeIndex}` : void 0;
13246
+ useEffect21(() => {
13247
+ let cancelled = false;
13248
+ setActive(null);
13249
+ const timer = setTimeout(() => {
13250
+ void Promise.resolve().then(() => fetchValues(field.name, value)).then(
13251
+ (result) => {
13252
+ if (cancelled) return;
13253
+ setResponse({ key: requestKey, fetchValues, result });
13254
+ setKnown({ scopeKey, fetchValues, result });
13255
+ },
13256
+ () => {
13257
+ if (!cancelled) setResponse({ key: requestKey, fetchValues, failed: true });
13258
+ }
13259
+ );
13260
+ }, 200);
13261
+ return () => {
13262
+ cancelled = true;
13263
+ clearTimeout(timer);
13264
+ };
13265
+ }, [fetchValues, requestKey, scopeKey, field.name, value]);
13266
+ useEffect21(() => {
13267
+ if (activeId) document.getElementById(activeId)?.scrollIntoView?.({ block: "nearest" });
13268
+ }, [activeId]);
13269
+ const close = () => {
13270
+ setOpen(false);
13271
+ setActive(null);
13272
+ };
13273
+ const choose = (choice) => {
13274
+ onChange(choice);
13275
+ close();
13276
+ input.current?.focus({ preventScroll: true });
13277
+ };
13278
+ const status = !current ? values.length ? "" : "Loading suggestions\u2026" : current.failed ? "Suggestions unavailable. Keep typing a value." : values.length === 0 ? "No matching values. Keep typing a value." : current.result?.hasMore ? "keep typing to refine\u2026" : "";
13279
+ return /* @__PURE__ */ jsxs33("span", { className: "qt-autocomplete", children: [
13280
+ /* @__PURE__ */ jsx38(
13281
+ "input",
13282
+ {
13283
+ ref: input,
13284
+ className,
13285
+ value,
13286
+ placeholder: "value",
13287
+ "aria-label": `Value for ${field.label}`,
13288
+ role: "combobox",
13289
+ "aria-autocomplete": "list",
13290
+ "aria-haspopup": "listbox",
13291
+ "aria-expanded": open,
13292
+ "aria-controls": open ? listId : void 0,
13293
+ "aria-activedescendant": activeId,
13294
+ "aria-describedby": open && status ? `${listId}-status` : void 0,
13295
+ autoComplete: "off",
13296
+ size: widthChars,
13297
+ style: { width: `${widthChars}ch` },
13298
+ onFocus: () => setOpen(true),
13299
+ onClick: () => setOpen(true),
13300
+ onChange: (event) => {
13301
+ setActive(null);
13302
+ setOpen(true);
13303
+ onChange(event.target.value);
13304
+ },
13305
+ onKeyDown: (event) => {
13306
+ if (event.nativeEvent.isComposing || event.keyCode === 229) return;
13307
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
13308
+ event.preventDefault();
13309
+ setOpen(true);
13310
+ if (values.length) {
13311
+ const next = !open || activeIndex < 0 ? event.key === "ArrowDown" ? 0 : values.length - 1 : (activeIndex + (event.key === "ArrowDown" ? 1 : -1) + values.length) % values.length;
13312
+ setActive(values[next]);
13313
+ }
13314
+ } else if (open && activeIndex >= 0 && (event.key === "Home" || event.key === "End")) {
13315
+ event.preventDefault();
13316
+ setActive(values[event.key === "Home" ? 0 : values.length - 1]);
13317
+ } else if (open && event.key === "Enter" && activeIndex >= 0) {
13318
+ event.preventDefault();
13319
+ choose(values[activeIndex]);
13320
+ } else if (open && event.key === "Escape") {
13321
+ event.preventDefault();
13322
+ event.stopPropagation();
13323
+ close();
13324
+ } else if (event.key === "Tab") close();
13325
+ }
13326
+ }
13327
+ ),
13328
+ open && input.current && /* @__PURE__ */ jsxs33(Suggestions, { anchor: input.current, onClose: close, children: [
13329
+ /* @__PURE__ */ jsx38("div", { id: listId, role: "listbox", "aria-label": `Suggestions for ${field.label}`, "aria-busy": !current, children: values.map((choice, index) => /* @__PURE__ */ jsx38(
13330
+ "div",
13331
+ {
13332
+ id: `${listId}-${index}`,
13333
+ role: "option",
13334
+ "aria-selected": choice === active,
13335
+ className: "qt-autocomplete-option",
13336
+ onMouseDown: (event) => event.preventDefault(),
13337
+ onClick: () => choose(choice),
13338
+ children: choice
13339
+ },
13340
+ choice
13341
+ )) }),
13342
+ status && /* @__PURE__ */ jsx38("p", { id: `${listId}-status`, role: "status", className: "qt-autocomplete-status", children: status })
13343
+ ] })
13344
+ ] });
13345
+ }
13346
+ function Suggestions({ anchor, onClose, children }) {
13347
+ const overlay = useFloatingOverlay({
13348
+ anchor,
13349
+ onClose,
13350
+ width: "max-content",
13351
+ maxHeight: 440,
13352
+ modalOnMobile: false,
13353
+ retainAnchorFocus: true
13354
+ });
13355
+ return /* @__PURE__ */ jsx38(OverlayPortal, { overlay, label: "Value suggestions", children: /* @__PURE__ */ jsx38(
13356
+ "div",
13357
+ {
13358
+ ref: overlay.setSurface,
13359
+ style: overlay.style,
13360
+ className: "qt-menu-surface qt-autocomplete-menu",
13361
+ onClick: (event) => event.stopPropagation(),
13362
+ children
13363
+ }
13364
+ ) });
13365
+ }
13366
+
13226
13367
  // src/QueryBuilder.tsx
13227
- import { Fragment as Fragment24, jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
13368
+ import { Fragment as Fragment24, jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
13228
13369
  var cx5 = (...parts) => parts.filter((p) => Boolean(p)).join(" ");
13229
13370
  var MAX_AUTO_REFRESH_POLLS = 1e3;
13230
13371
  var DEFAULT_AUTO_REFRESH_FREQUENCY_MS = 2e4;
@@ -13272,8 +13413,8 @@ function formatStatusTime(ms) {
13272
13413
  });
13273
13414
  }
13274
13415
  function useFieldHasNull(api, fieldName) {
13275
- const [hasNull, setHasNull] = useState30(void 0);
13276
- useEffect21(() => {
13416
+ const [hasNull, setHasNull] = useState31(void 0);
13417
+ useEffect22(() => {
13277
13418
  if (!fieldName) return;
13278
13419
  let cancelled = false;
13279
13420
  void api.filterValues(fieldName, "").then((r) => {
@@ -13374,21 +13515,21 @@ function QueryBuilder({
13374
13515
  selectPresentation ?? (selectPresentation = groupingUI.selectPresentation);
13375
13516
  const mobile = useMobileLayout();
13376
13517
  const UNSAVED_QUERY_EDIT_ID = "__qt-unsaved-query__";
13377
- const [showSaved, setShowSaved] = useState30(false);
13378
- const [shareCopied, setShareCopied] = useState30(false);
13379
- const [showActivity, setShowActivity] = useState30(false);
13380
- const activityId = useId10();
13381
- const [showAutoRefresh, setShowAutoRefresh] = useState30(false);
13382
- const [autoRefreshFrequencyMs, setAutoRefreshFrequencyMs] = useState30(
13518
+ const [showSaved, setShowSaved] = useState31(false);
13519
+ const [shareCopied, setShareCopied] = useState31(false);
13520
+ const [showActivity, setShowActivity] = useState31(false);
13521
+ const activityId = useId11();
13522
+ const [showAutoRefresh, setShowAutoRefresh] = useState31(false);
13523
+ const [autoRefreshFrequencyMs, setAutoRefreshFrequencyMs] = useState31(
13383
13524
  DEFAULT_AUTO_REFRESH_FREQUENCY_MS
13384
13525
  );
13385
- const [autoRefreshTurnOffAfterMs, setAutoRefreshTurnOffAfterMs] = useState30(
13526
+ const [autoRefreshTurnOffAfterMs, setAutoRefreshTurnOffAfterMs] = useState31(
13386
13527
  DEFAULT_AUTO_REFRESH_TURN_OFF_AFTER_MS
13387
13528
  );
13388
- const [editingSavedId, setEditingSavedId] = useState30(null);
13389
- const [editingSavedName, setEditingSavedName] = useState30("");
13390
- const [lastSavedId, setLastSavedId] = useState30(null);
13391
- const [collapsedFallback, setCollapsedFallback] = useState30(defaultCollapsed);
13529
+ const [editingSavedId, setEditingSavedId] = useState31(null);
13530
+ const [editingSavedName, setEditingSavedName] = useState31("");
13531
+ const [lastSavedId, setLastSavedId] = useState31(null);
13532
+ const [collapsedFallback, setCollapsedFallback] = useState31(defaultCollapsed);
13392
13533
  const collapsedControlled = typeof collapsed !== "undefined";
13393
13534
  const isCollapsed = collapsedControlled ? collapsed : collapsedFallback;
13394
13535
  const setCollapsed = (next) => {
@@ -13398,8 +13539,8 @@ function QueryBuilder({
13398
13539
  }
13399
13540
  setCollapsedFallback(next);
13400
13541
  };
13401
- const [lastUpdatedAt, setLastUpdatedAt] = useState30(null);
13402
- const [lastFailureAt, setLastFailureAt] = useState30(null);
13542
+ const [lastUpdatedAt, setLastUpdatedAt] = useState31(null);
13543
+ const [lastFailureAt, setLastFailureAt] = useState31(null);
13403
13544
  const byName = useMemo12(
13404
13545
  () => new Map(fields.map((f) => [f.name, f])),
13405
13546
  [fields]
@@ -13416,7 +13557,7 @@ function QueryBuilder({
13416
13557
  );
13417
13558
  const isSavedQuery = activeSavedQuery != null;
13418
13559
  const isEditingUnsaved = editingSavedId === UNSAVED_QUERY_EDIT_ID;
13419
- const bodyId = useId10();
13560
+ const bodyId = useId11();
13420
13561
  const isEditingSaved = editingSavedId != null && activeSavedQuery?.id === editingSavedId;
13421
13562
  const showUpdateButton = api.saved.canUpdate && Boolean(lastSavedQuery) && !activeSavedQuery;
13422
13563
  const collapsedSummary = useMemo12(
@@ -13443,28 +13584,28 @@ function QueryBuilder({
13443
13584
  const lastUpdatedText = formatStatusTime(lastUpdatedAt);
13444
13585
  const failureText = api.error ? `Error: ${api.error.message}` : lastFailureAt ? `Last failure at ${formatStatusTime(lastFailureAt)}` : null;
13445
13586
  const isBusy = Boolean(running) || api.loading || api.links.busy;
13446
- const lastRowsRef = useRef22(null);
13447
- const lastTotalRef = useRef22(null);
13448
- const previousLoadingRef = useRef22(api.loading);
13449
- const autoRefreshRef = useRef22(null);
13450
- const shareFeedbackTimerRef = useRef22(
13587
+ const lastRowsRef = useRef23(null);
13588
+ const lastTotalRef = useRef23(null);
13589
+ const previousLoadingRef = useRef23(api.loading);
13590
+ const autoRefreshRef = useRef23(null);
13591
+ const shareFeedbackTimerRef = useRef23(
13451
13592
  null
13452
13593
  );
13453
- useEffect21(
13594
+ useEffect22(
13454
13595
  () => () => {
13455
13596
  if (shareFeedbackTimerRef.current)
13456
13597
  clearTimeout(shareFeedbackTimerRef.current);
13457
13598
  },
13458
13599
  []
13459
13600
  );
13460
- useEffect21(() => {
13601
+ useEffect22(() => {
13461
13602
  setShareCopied(false);
13462
13603
  if (shareFeedbackTimerRef.current) {
13463
13604
  clearTimeout(shareFeedbackTimerRef.current);
13464
13605
  shareFeedbackTimerRef.current = null;
13465
13606
  }
13466
13607
  }, [api.query]);
13467
- useEffect21(() => {
13608
+ useEffect22(() => {
13468
13609
  if (activeSavedQuery) {
13469
13610
  setLastSavedId(activeSavedQuery.id);
13470
13611
  if (!isEditingSaved) {
@@ -13478,12 +13619,12 @@ function QueryBuilder({
13478
13619
  setEditingSavedName("");
13479
13620
  }
13480
13621
  }, [activeSavedQuery, isEditingSaved, isEditingUnsaved]);
13481
- useEffect21(() => {
13622
+ useEffect22(() => {
13482
13623
  if (!lastSavedId || api.saved.items.some((item) => item.id === lastSavedId))
13483
13624
  return;
13484
13625
  setLastSavedId(null);
13485
13626
  }, [api.saved.items, lastSavedId]);
13486
- useEffect21(() => {
13627
+ useEffect22(() => {
13487
13628
  const hasData = api.rows.length > 0 || total != null;
13488
13629
  const rowsChanged = lastRowsRef.current !== api.rows;
13489
13630
  const totalChanged = lastTotalRef.current !== total;
@@ -13573,10 +13714,10 @@ function QueryBuilder({
13573
13714
  return;
13574
13715
  }
13575
13716
  }
13576
- useEffect21(() => {
13717
+ useEffect22(() => {
13577
13718
  if (isCollapsed) setShowSaved(false);
13578
13719
  }, [isCollapsed]);
13579
- useEffect21(() => {
13720
+ useEffect22(() => {
13580
13721
  if (!showAutoRefresh || !autoRefreshStatus) return;
13581
13722
  setAutoRefreshFrequencyMs(autoRefreshStatus.frequencyMs);
13582
13723
  setAutoRefreshTurnOffAfterMs(autoRefreshStatus.turnOffAfterMs);
@@ -13624,15 +13765,15 @@ function QueryBuilder({
13624
13765
  window.prompt("Copy this query URL", url.toString());
13625
13766
  }
13626
13767
  }
13627
- return /* @__PURE__ */ jsxs33("div", { className: cx5(
13768
+ return /* @__PURE__ */ jsxs34("div", { className: cx5(
13628
13769
  "qt-qb",
13629
13770
  api.grouping && "qt-qb--groupable",
13630
13771
  compact && "qt-qb--compact",
13631
13772
  classNames?.root
13632
13773
  ), children: [
13633
- /* @__PURE__ */ jsxs33("div", { className: "qt-qb-bar qt-qb-state-bar qt-qb-row", children: [
13634
- /* @__PURE__ */ jsxs33("span", { className: "qt-qb-state-main", children: [
13635
- /* @__PURE__ */ jsxs33(
13774
+ /* @__PURE__ */ jsxs34("div", { className: "qt-qb-bar qt-qb-state-bar qt-qb-row", children: [
13775
+ /* @__PURE__ */ jsxs34("span", { className: "qt-qb-state-main", children: [
13776
+ /* @__PURE__ */ jsxs34(
13636
13777
  "button",
13637
13778
  {
13638
13779
  type: "button",
@@ -13643,7 +13784,7 @@ function QueryBuilder({
13643
13784
  "aria-label": isCollapsed ? "Expand query builder" : "Collapse query builder",
13644
13785
  title: isCollapsed ? "Expand query builder" : "Collapse query builder",
13645
13786
  children: [
13646
- /* @__PURE__ */ jsx38(
13787
+ /* @__PURE__ */ jsx39(
13647
13788
  Icon,
13648
13789
  {
13649
13790
  name: "chevronDown",
@@ -13654,12 +13795,12 @@ function QueryBuilder({
13654
13795
  )
13655
13796
  }
13656
13797
  ),
13657
- /* @__PURE__ */ jsx38("span", { children: "Query" })
13798
+ /* @__PURE__ */ jsx39("span", { children: "Query" })
13658
13799
  ]
13659
13800
  }
13660
13801
  ),
13661
- savedQueryControls !== void 0 ? savedQueryControls : /* @__PURE__ */ jsxs33("span", { className: "qt-qb-saved", children: [
13662
- /* @__PURE__ */ jsx38(
13802
+ savedQueryControls !== void 0 ? savedQueryControls : /* @__PURE__ */ jsxs34("span", { className: "qt-qb-saved", children: [
13803
+ /* @__PURE__ */ jsx39(
13663
13804
  "button",
13664
13805
  {
13665
13806
  type: "button",
@@ -13671,11 +13812,11 @@ function QueryBuilder({
13671
13812
  "aria-label": isSavedQuery ? "Rename saved query" : "Save query",
13672
13813
  disabled: isBusy,
13673
13814
  onClick: beginEditSavedName,
13674
- children: /* @__PURE__ */ jsx38(Icon, { name: "star", size: 16, filled: isSavedQuery })
13815
+ children: /* @__PURE__ */ jsx39(Icon, { name: "star", size: 16, filled: isSavedQuery })
13675
13816
  }
13676
13817
  ),
13677
- isEditingSaved || isEditingUnsaved ? /* @__PURE__ */ jsxs33("span", { className: "qt-qb-saved-input-wrap", children: [
13678
- /* @__PURE__ */ jsx38(
13818
+ isEditingSaved || isEditingUnsaved ? /* @__PURE__ */ jsxs34("span", { className: "qt-qb-saved-input-wrap", children: [
13819
+ /* @__PURE__ */ jsx39(
13679
13820
  "input",
13680
13821
  {
13681
13822
  type: "text",
@@ -13698,7 +13839,7 @@ function QueryBuilder({
13698
13839
  onClick: (e) => e.stopPropagation()
13699
13840
  }
13700
13841
  ),
13701
- /* @__PURE__ */ jsx38(
13842
+ /* @__PURE__ */ jsx39(
13702
13843
  "button",
13703
13844
  {
13704
13845
  type: "button",
@@ -13710,10 +13851,10 @@ function QueryBuilder({
13710
13851
  cancelNameEdit();
13711
13852
  },
13712
13853
  onClick: (e) => e.stopPropagation(),
13713
- children: /* @__PURE__ */ jsx38(Icon, { name: "close" })
13854
+ children: /* @__PURE__ */ jsx39(Icon, { name: "close" })
13714
13855
  }
13715
13856
  )
13716
- ] }) : /* @__PURE__ */ jsx38(
13857
+ ] }) : /* @__PURE__ */ jsx39(
13717
13858
  "button",
13718
13859
  {
13719
13860
  type: "button",
@@ -13726,24 +13867,24 @@ function QueryBuilder({
13726
13867
  }
13727
13868
  )
13728
13869
  ] }),
13729
- isCollapsed ? /* @__PURE__ */ jsx38(
13870
+ isCollapsed ? /* @__PURE__ */ jsx39(
13730
13871
  "span",
13731
13872
  {
13732
13873
  className: "qt-qb-summary qt-truncate",
13733
13874
  title: summary ? void 0 : collapsedSummary,
13734
- children: summary ?? /* @__PURE__ */ jsxs33(Fragment24, { children: [
13735
- /* @__PURE__ */ jsx38("span", { className: "qt-qb-summary-kw", children: "WHERE" }),
13875
+ children: summary ?? /* @__PURE__ */ jsxs34(Fragment24, { children: [
13876
+ /* @__PURE__ */ jsx39("span", { className: "qt-qb-summary-kw", children: "WHERE" }),
13736
13877
  " ",
13737
- /* @__PURE__ */ jsx38("strong", { children: collapsedWhereText }),
13878
+ /* @__PURE__ */ jsx39("strong", { children: collapsedWhereText }),
13738
13879
  " ",
13739
- /* @__PURE__ */ jsx38("span", { className: "qt-qb-summary-kw", children: "ORDER BY" }),
13880
+ /* @__PURE__ */ jsx39("span", { className: "qt-qb-summary-kw", children: "ORDER BY" }),
13740
13881
  " ",
13741
- /* @__PURE__ */ jsx38("strong", { children: collapsedOrderText })
13882
+ /* @__PURE__ */ jsx39("strong", { children: collapsedOrderText })
13742
13883
  ] })
13743
13884
  }
13744
13885
  ) : null
13745
13886
  ] }),
13746
- savedQueryControls === void 0 && showUpdateButton ? /* @__PURE__ */ jsx38(
13887
+ savedQueryControls === void 0 && showUpdateButton ? /* @__PURE__ */ jsx39(
13747
13888
  "button",
13748
13889
  {
13749
13890
  type: "button",
@@ -13753,7 +13894,7 @@ function QueryBuilder({
13753
13894
  children: `Update Query '${lastSavedQuery?.name ?? "query"}'`
13754
13895
  }
13755
13896
  ) : null,
13756
- /* @__PURE__ */ jsxs33(
13897
+ /* @__PURE__ */ jsxs34(
13757
13898
  "button",
13758
13899
  {
13759
13900
  type: "button",
@@ -13763,28 +13904,28 @@ function QueryBuilder({
13763
13904
  "aria-live": "polite",
13764
13905
  disabled: api.loading || api.links.busy,
13765
13906
  children: [
13766
- /* @__PURE__ */ jsx38(Icon, { name: shareCopied ? "check" : "share" }),
13907
+ /* @__PURE__ */ jsx39(Icon, { name: shareCopied ? "check" : "share" }),
13767
13908
  shareCopied ? "Copied!" : "Share"
13768
13909
  ]
13769
13910
  }
13770
13911
  ),
13771
- api.links.kind === "local" && /* @__PURE__ */ jsx38("small", { role: "status", children: "Temporary link \xB7 this browser only" }),
13772
- api.links.error && /* @__PURE__ */ jsx38("small", { role: "alert", children: api.links.error.message }),
13773
- savedQueryControls === void 0 && /* @__PURE__ */ jsxs33(
13912
+ api.links.kind === "local" && /* @__PURE__ */ jsx39("small", { role: "status", children: "Temporary link \xB7 this browser only" }),
13913
+ api.links.error && /* @__PURE__ */ jsx39("small", { role: "alert", children: api.links.error.message }),
13914
+ savedQueryControls === void 0 && /* @__PURE__ */ jsxs34(
13774
13915
  "button",
13775
13916
  {
13776
13917
  type: "button",
13777
13918
  className: cx5("qt-btn", classNames?.button),
13778
13919
  onClick: () => setShowSaved(true),
13779
13920
  children: [
13780
- /* @__PURE__ */ jsx38(Icon, { name: "bookmark" }),
13921
+ /* @__PURE__ */ jsx39(Icon, { name: "bookmark" }),
13781
13922
  "Saved",
13782
13923
  api.saved.items.length > 0 ? ` (${api.saved.items.length})` : ""
13783
13924
  ]
13784
13925
  }
13785
13926
  ),
13786
- /* @__PURE__ */ jsxs33("div", { className: "qt-property-history qt-query-history", role: "group", "aria-label": "Query history", children: [
13787
- /* @__PURE__ */ jsx38(
13927
+ /* @__PURE__ */ jsxs34("div", { className: "qt-property-history qt-query-history", role: "group", "aria-label": "Query history", children: [
13928
+ /* @__PURE__ */ jsx39(
13788
13929
  "button",
13789
13930
  {
13790
13931
  type: "button",
@@ -13793,10 +13934,10 @@ function QueryBuilder({
13793
13934
  title: "Undo query change",
13794
13935
  disabled: !api.canUndo || isBusy,
13795
13936
  onClick: api.undo,
13796
- children: /* @__PURE__ */ jsx38(Icon, { name: "undo", size: 14 })
13937
+ children: /* @__PURE__ */ jsx39(Icon, { name: "undo", size: 14 })
13797
13938
  }
13798
13939
  ),
13799
- /* @__PURE__ */ jsx38(
13940
+ /* @__PURE__ */ jsx39(
13800
13941
  "button",
13801
13942
  {
13802
13943
  type: "button",
@@ -13805,10 +13946,10 @@ function QueryBuilder({
13805
13946
  title: "Redo query change",
13806
13947
  disabled: !api.canRedo || isBusy,
13807
13948
  onClick: api.redo,
13808
- children: /* @__PURE__ */ jsx38(Icon, { name: "redo", size: 14 })
13949
+ children: /* @__PURE__ */ jsx39(Icon, { name: "redo", size: 14 })
13809
13950
  }
13810
13951
  ),
13811
- /* @__PURE__ */ jsx38(
13952
+ /* @__PURE__ */ jsx39(
13812
13953
  "button",
13813
13954
  {
13814
13955
  type: "button",
@@ -13817,13 +13958,13 @@ function QueryBuilder({
13817
13958
  title: "Reset query",
13818
13959
  disabled: isBusy,
13819
13960
  onClick: api.resetAll,
13820
- children: /* @__PURE__ */ jsx38(Icon, { name: "reset", size: 14 })
13961
+ children: /* @__PURE__ */ jsx39(Icon, { name: "reset", size: 14 })
13821
13962
  }
13822
13963
  )
13823
13964
  ] })
13824
13965
  ] }),
13825
- !isCollapsed ? /* @__PURE__ */ jsx38("div", { className: "qt-qb-bar qt-qb-editor-bar", children: /* @__PURE__ */ jsxs33("div", { id: bodyId, className: "qt-qb-body", children: [
13826
- /* @__PURE__ */ jsx38(
13966
+ !isCollapsed ? /* @__PURE__ */ jsx39("div", { className: "qt-qb-bar qt-qb-editor-bar", children: /* @__PURE__ */ jsxs34("div", { id: bodyId, className: "qt-qb-body", children: [
13967
+ /* @__PURE__ */ jsx39(
13827
13968
  SelectRow,
13828
13969
  {
13829
13970
  api,
@@ -13833,7 +13974,7 @@ function QueryBuilder({
13833
13974
  presentation: selectPresentation
13834
13975
  }
13835
13976
  ),
13836
- whereRow ?? /* @__PURE__ */ jsx38(
13977
+ whereRow ?? /* @__PURE__ */ jsx39(
13837
13978
  WhereRow,
13838
13979
  {
13839
13980
  api,
@@ -13844,7 +13985,7 @@ function QueryBuilder({
13844
13985
  }
13845
13986
  ),
13846
13987
  clauses,
13847
- /* @__PURE__ */ jsx38(
13988
+ /* @__PURE__ */ jsx39(
13848
13989
  OrderRow,
13849
13990
  {
13850
13991
  api,
@@ -13853,7 +13994,7 @@ function QueryBuilder({
13853
13994
  disabled: isBusy
13854
13995
  }
13855
13996
  ),
13856
- /* @__PURE__ */ jsx38(
13997
+ /* @__PURE__ */ jsx39(
13857
13998
  WindowRow,
13858
13999
  {
13859
14000
  api,
@@ -13863,7 +14004,7 @@ function QueryBuilder({
13863
14004
  disabled: isBusy
13864
14005
  }
13865
14006
  ),
13866
- /* @__PURE__ */ jsx38(
14007
+ /* @__PURE__ */ jsx39(
13867
14008
  MetricsRow,
13868
14009
  {
13869
14010
  api,
@@ -13873,8 +14014,8 @@ function QueryBuilder({
13873
14014
  }
13874
14015
  )
13875
14016
  ] }) }) : null,
13876
- /* @__PURE__ */ jsxs33("div", { className: "qt-qb-bar qt-qb-run-bar qt-qb-row", children: [
13877
- /* @__PURE__ */ jsx38(
14017
+ /* @__PURE__ */ jsxs34("div", { className: "qt-qb-bar qt-qb-run-bar qt-qb-row", children: [
14018
+ /* @__PURE__ */ jsx39(
13878
14019
  "span",
13879
14020
  {
13880
14021
  className: "qt-qb-run-metric qt-qb-run-metric--strong",
@@ -13882,16 +14023,16 @@ function QueryBuilder({
13882
14023
  children: api.loading ? "loading\u2026" : `${rowSummary} rows`
13883
14024
  }
13884
14025
  ),
13885
- /* @__PURE__ */ jsxs33("span", { className: "qt-qb-run-metric", children: [
14026
+ /* @__PURE__ */ jsxs34("span", { className: "qt-qb-run-metric", children: [
13886
14027
  "Last updated ",
13887
14028
  lastUpdatedText
13888
14029
  ] }),
13889
- failureText ? /* @__PURE__ */ jsx38("span", { className: "qt-qb-run-error", children: failureText }) : null,
13890
- /* @__PURE__ */ jsxs33("span", { className: "qt-qb-run-actions", children: [
13891
- autoRefreshStatus ? /* @__PURE__ */ jsx38("span", { className: "qt-qb-auto-status", children: `Every ${formatDuration2(autoRefreshStatus.frequencyMs)}; clear after ${formatDuration2(
14030
+ failureText ? /* @__PURE__ */ jsx39("span", { className: "qt-qb-run-error", children: failureText }) : null,
14031
+ /* @__PURE__ */ jsxs34("span", { className: "qt-qb-run-actions", children: [
14032
+ autoRefreshStatus ? /* @__PURE__ */ jsx39("span", { className: "qt-qb-auto-status", children: `Every ${formatDuration2(autoRefreshStatus.frequencyMs)}; clear after ${formatDuration2(
13892
14033
  autoRefreshStatus.turnOffAfterMs
13893
14034
  )} (${autoRefreshStatus.pollCount} polls run)` }) : null,
13894
- /* @__PURE__ */ jsx38(
14035
+ /* @__PURE__ */ jsx39(
13895
14036
  "button",
13896
14037
  {
13897
14038
  type: "button",
@@ -13905,11 +14046,11 @@ function QueryBuilder({
13905
14046
  "aria-expanded": showActivity,
13906
14047
  "aria-controls": activityId,
13907
14048
  onClick: () => setShowActivity((v) => !v),
13908
- children: /* @__PURE__ */ jsx38(Icon, { name: "stopwatch" })
14049
+ children: /* @__PURE__ */ jsx39(Icon, { name: "stopwatch" })
13909
14050
  }
13910
14051
  ),
13911
- /* @__PURE__ */ jsxs33("span", { className: "qt-auto-refresh", children: [
13912
- /* @__PURE__ */ jsxs33(
14052
+ /* @__PURE__ */ jsxs34("span", { className: "qt-auto-refresh", children: [
14053
+ /* @__PURE__ */ jsxs34(
13913
14054
  "button",
13914
14055
  {
13915
14056
  type: "button",
@@ -13924,12 +14065,12 @@ function QueryBuilder({
13924
14065
  "aria-expanded": showAutoRefresh,
13925
14066
  title: autoRefreshStatus ? "View or clear auto-update" : "Configure auto-update",
13926
14067
  children: [
13927
- /* @__PURE__ */ jsx38(Icon, { name: "clock" }),
14068
+ /* @__PURE__ */ jsx39(Icon, { name: "clock" }),
13928
14069
  autoRefreshButtonText
13929
14070
  ]
13930
14071
  }
13931
14072
  ),
13932
- showAutoRefresh && autoRefreshRef.current ? /* @__PURE__ */ jsxs33(
14073
+ showAutoRefresh && autoRefreshRef.current ? /* @__PURE__ */ jsxs34(
13933
14074
  Popover,
13934
14075
  {
13935
14076
  anchor: autoRefreshRef.current,
@@ -13938,27 +14079,27 @@ function QueryBuilder({
13938
14079
  label: "Auto-refresh settings",
13939
14080
  onClose: () => setShowAutoRefresh(false),
13940
14081
  children: [
13941
- /* @__PURE__ */ jsxs33("label", { className: "qt-auto-refresh-field", children: [
13942
- /* @__PURE__ */ jsx38("span", { children: "Frequency" }),
13943
- /* @__PURE__ */ jsx38(
14082
+ /* @__PURE__ */ jsxs34("label", { className: "qt-auto-refresh-field", children: [
14083
+ /* @__PURE__ */ jsx39("span", { children: "Frequency" }),
14084
+ /* @__PURE__ */ jsx39(
13944
14085
  "select",
13945
14086
  {
13946
14087
  className: "qt-auto-refresh-select",
13947
14088
  value: autoRefreshFrequencyMs,
13948
14089
  onChange: (e) => setAutoRefreshFrequencyMs(Number(e.target.value)),
13949
- children: AUTO_REFRESH_FREQUENCIES.map((option) => /* @__PURE__ */ jsx38("option", { value: option.value, children: option.label }, option.value))
14090
+ children: AUTO_REFRESH_FREQUENCIES.map((option) => /* @__PURE__ */ jsx39("option", { value: option.value, children: option.label }, option.value))
13950
14091
  }
13951
14092
  )
13952
14093
  ] }),
13953
- /* @__PURE__ */ jsxs33("label", { className: "qt-auto-refresh-field", children: [
13954
- /* @__PURE__ */ jsx38("span", { children: "Turn off after" }),
13955
- /* @__PURE__ */ jsx38(
14094
+ /* @__PURE__ */ jsxs34("label", { className: "qt-auto-refresh-field", children: [
14095
+ /* @__PURE__ */ jsx39("span", { children: "Turn off after" }),
14096
+ /* @__PURE__ */ jsx39(
13956
14097
  "select",
13957
14098
  {
13958
14099
  className: "qt-auto-refresh-select",
13959
14100
  value: autoRefreshTurnOffAfterMs,
13960
14101
  onChange: (e) => setAutoRefreshTurnOffAfterMs(Number(e.target.value)),
13961
- children: AUTO_REFRESH_TURN_OFF_AFTER.map((option) => /* @__PURE__ */ jsx38(
14102
+ children: AUTO_REFRESH_TURN_OFF_AFTER.map((option) => /* @__PURE__ */ jsx39(
13962
14103
  "option",
13963
14104
  {
13964
14105
  value: option.value,
@@ -13976,7 +14117,7 @@ function QueryBuilder({
13976
14117
  }
13977
14118
  )
13978
14119
  ] }),
13979
- /* @__PURE__ */ jsx38(
14120
+ /* @__PURE__ */ jsx39(
13980
14121
  "span",
13981
14122
  {
13982
14123
  className: cx5(
@@ -13986,7 +14127,7 @@ function QueryBuilder({
13986
14127
  children: canSubmitAutoRefresh ? `${selectedAutoRefreshPolls} polls maximum` : `Choose between 1 and 1000 polls`
13987
14128
  }
13988
14129
  ),
13989
- autoRefreshStatus ? /* @__PURE__ */ jsxs33("span", { className: "qt-auto-refresh-status", children: [
14130
+ autoRefreshStatus ? /* @__PURE__ */ jsxs34("span", { className: "qt-auto-refresh-status", children: [
13990
14131
  "Active: every",
13991
14132
  " ",
13992
14133
  formatDuration2(autoRefreshStatus.frequencyMs),
@@ -13997,8 +14138,8 @@ function QueryBuilder({
13997
14138
  autoRefreshStatus.pollCount,
13998
14139
  " polls run."
13999
14140
  ] }) : null,
14000
- /* @__PURE__ */ jsxs33("span", { className: "qt-auto-refresh-actions", children: [
14001
- /* @__PURE__ */ jsx38(
14141
+ /* @__PURE__ */ jsxs34("span", { className: "qt-auto-refresh-actions", children: [
14142
+ /* @__PURE__ */ jsx39(
14002
14143
  "button",
14003
14144
  {
14004
14145
  type: "button",
@@ -14008,7 +14149,7 @@ function QueryBuilder({
14008
14149
  children: autoRefreshStatus ? "Update" : "Start"
14009
14150
  }
14010
14151
  ),
14011
- autoRefreshStatus ? /* @__PURE__ */ jsx38(
14152
+ autoRefreshStatus ? /* @__PURE__ */ jsx39(
14012
14153
  "button",
14013
14154
  {
14014
14155
  type: "button",
@@ -14025,7 +14166,7 @@ function QueryBuilder({
14025
14166
  }
14026
14167
  ) : null
14027
14168
  ] }),
14028
- /* @__PURE__ */ jsxs33(
14169
+ /* @__PURE__ */ jsxs34(
14029
14170
  "button",
14030
14171
  {
14031
14172
  type: "button",
@@ -14033,7 +14174,7 @@ function QueryBuilder({
14033
14174
  onClick: api.refresh,
14034
14175
  disabled: isBusy,
14035
14176
  children: [
14036
- /* @__PURE__ */ jsx38(Icon, { name: "refresh" }),
14177
+ /* @__PURE__ */ jsx39(Icon, { name: "refresh" }),
14037
14178
  "Run Now"
14038
14179
  ]
14039
14180
  }
@@ -14041,8 +14182,8 @@ function QueryBuilder({
14041
14182
  ] })
14042
14183
  ] }),
14043
14184
  groupingUI.overlays,
14044
- showActivity && /* @__PURE__ */ jsx38(RequestActivity, { id: activityId, activity: api.requestActivity, children: requestActivityDetails }),
14045
- savedQueryControls === void 0 && showSaved ? /* @__PURE__ */ jsx38(
14185
+ showActivity && /* @__PURE__ */ jsx39(RequestActivity, { id: activityId, activity: api.requestActivity, children: requestActivityDetails }),
14186
+ savedQueryControls === void 0 && showSaved ? /* @__PURE__ */ jsx39(
14046
14187
  SavedQueriesModal,
14047
14188
  {
14048
14189
  saved: api.saved,
@@ -14069,13 +14210,13 @@ function SelectRow({
14069
14210
  }
14070
14211
  }
14071
14212
  const mobile = useMobileLayout();
14072
- const [editingColumns, setEditingColumns] = useState30(false);
14073
- const [editingField, setEditingField] = useState30();
14213
+ const [editingColumns, setEditingColumns] = useState31(false);
14214
+ const [editingField, setEditingField] = useState31();
14074
14215
  function openColumnEditor(field) {
14075
14216
  setEditingField(field);
14076
14217
  setEditingColumns(true);
14077
14218
  }
14078
- const detailSettingsButton = (field) => field === ITEM_DETAILS_COLUMN3 && api.itemDetails ? /* @__PURE__ */ jsx38(
14219
+ const detailSettingsButton = (field) => field === ITEM_DETAILS_COLUMN3 && api.itemDetails ? /* @__PURE__ */ jsx39(
14079
14220
  "button",
14080
14221
  {
14081
14222
  type: "button",
@@ -14086,11 +14227,11 @@ function SelectRow({
14086
14227
  "aria-expanded": editingColumns && editingField === field,
14087
14228
  disabled,
14088
14229
  onClick: () => openColumnEditor(field),
14089
- children: /* @__PURE__ */ jsx38(Icon, { name: "chevronRight", size: 18 })
14230
+ children: /* @__PURE__ */ jsx39(Icon, { name: "chevronRight", size: 18 })
14090
14231
  }
14091
14232
  ) : null;
14092
- const [adding, setAdding] = useState30(false);
14093
- const addColumnRef = useRef22(null);
14233
+ const [adding, setAdding] = useState31(false);
14234
+ const addColumnRef = useRef23(null);
14094
14235
  const fieldLabelByName = useMemo12(
14095
14236
  () => new Map(select.fields.map((f) => [f.name, f.label])),
14096
14237
  [select.fields]
@@ -14101,10 +14242,10 @@ function SelectRow({
14101
14242
  const fieldNames = select.visible.map((c) => c.field);
14102
14243
  const dragSource = columnDrag.source;
14103
14244
  const rendered = columnDrag.preview(fieldNames);
14104
- const actions = /* @__PURE__ */ jsxs33(Fragment24, { children: [
14105
- /* @__PURE__ */ jsxs33(PickerAnchor, { children: [
14106
- /* @__PURE__ */ jsxs33("span", { className: "qt-split-btn", role: "group", "aria-label": "Column actions", children: [
14107
- /* @__PURE__ */ jsxs33(
14245
+ const actions = /* @__PURE__ */ jsxs34(Fragment24, { children: [
14246
+ /* @__PURE__ */ jsxs34(PickerAnchor, { children: [
14247
+ /* @__PURE__ */ jsxs34("span", { className: "qt-split-btn", role: "group", "aria-label": "Column actions", children: [
14248
+ /* @__PURE__ */ jsxs34(
14108
14249
  "button",
14109
14250
  {
14110
14251
  type: "button",
@@ -14116,12 +14257,12 @@ function SelectRow({
14116
14257
  onClick: () => setAdding(!adding),
14117
14258
  disabled: disabled || !presentation?.renderPicker && select.hidden.length === 0,
14118
14259
  children: [
14119
- /* @__PURE__ */ jsx38(Icon, { name: "add" }),
14260
+ /* @__PURE__ */ jsx39(Icon, { name: "add" }),
14120
14261
  mobile ? "Add" : "add column"
14121
14262
  ]
14122
14263
  }
14123
14264
  ),
14124
- /* @__PURE__ */ jsx38(
14265
+ /* @__PURE__ */ jsx39(
14125
14266
  "button",
14126
14267
  {
14127
14268
  type: "button",
@@ -14132,11 +14273,11 @@ function SelectRow({
14132
14273
  "aria-expanded": editingColumns,
14133
14274
  disabled,
14134
14275
  onClick: () => openColumnEditor(),
14135
- children: /* @__PURE__ */ jsx38(Icon, { name: "chevronRight", size: 18 })
14276
+ children: /* @__PURE__ */ jsx39(Icon, { name: "chevronRight", size: 18 })
14136
14277
  }
14137
14278
  )
14138
14279
  ] }),
14139
- adding ? presentation?.renderPicker ? presentation.renderPicker(() => setAdding(false)) : /* @__PURE__ */ jsx38(
14280
+ adding ? presentation?.renderPicker ? presentation.renderPicker(() => setAdding(false)) : /* @__PURE__ */ jsx39(
14140
14281
  FieldPicker,
14141
14282
  {
14142
14283
  anchor: addColumnRef.current ?? void 0,
@@ -14149,7 +14290,7 @@ function SelectRow({
14149
14290
  }
14150
14291
  ) : null
14151
14292
  ] }),
14152
- /* @__PURE__ */ jsx38(
14293
+ /* @__PURE__ */ jsx39(
14153
14294
  "button",
14154
14295
  {
14155
14296
  type: "button",
@@ -14162,12 +14303,12 @@ function SelectRow({
14162
14303
  }
14163
14304
  )
14164
14305
  ] });
14165
- return /* @__PURE__ */ jsxs33("div", { className: "qt-qb-row qt-qb-row--select", children: [
14166
- /* @__PURE__ */ jsxs33("div", { className: "qt-qb-section-header", children: [
14167
- /* @__PURE__ */ jsx38("span", { className: "qt-qb-kw", "data-mobile-label": "Columns", children: "select" }),
14306
+ return /* @__PURE__ */ jsxs34("div", { className: "qt-qb-row qt-qb-row--select", children: [
14307
+ /* @__PURE__ */ jsxs34("div", { className: "qt-qb-section-header", children: [
14308
+ /* @__PURE__ */ jsx39("span", { className: "qt-qb-kw", "data-mobile-label": "Columns", children: "select" }),
14168
14309
  mobile && actions
14169
14310
  ] }),
14170
- editingColumns && (presentation?.renderEditor ? presentation.renderEditor(() => setEditingColumns(false)) : /* @__PURE__ */ jsx38(
14311
+ editingColumns && (presentation?.renderEditor ? presentation.renderEditor(() => setEditingColumns(false)) : /* @__PURE__ */ jsx39(
14171
14312
  SelectColumnEditor,
14172
14313
  {
14173
14314
  api,
@@ -14176,7 +14317,7 @@ function SelectRow({
14176
14317
  notice: presentation?.editorNotice
14177
14318
  }
14178
14319
  )),
14179
- mobile ? /* @__PURE__ */ jsx38(
14320
+ mobile ? /* @__PURE__ */ jsx39(
14180
14321
  ReorderList,
14181
14322
  {
14182
14323
  className: "qt-query-reorder-list qt-query-reorder-list--columns",
@@ -14188,10 +14329,10 @@ function SelectRow({
14188
14329
  })),
14189
14330
  onMove: select.move,
14190
14331
  disabled,
14191
- renderItem: (item) => /* @__PURE__ */ jsxs33(Fragment24, { children: [
14192
- presentation?.renderChip?.(item.id, item.label) ?? /* @__PURE__ */ jsx38("span", { className: "qt-chip-field", children: item.label }),
14332
+ renderItem: (item) => /* @__PURE__ */ jsxs34(Fragment24, { children: [
14333
+ presentation?.renderChip?.(item.id, item.label) ?? /* @__PURE__ */ jsx39("span", { className: "qt-chip-field", children: item.label }),
14193
14334
  detailSettingsButton(item.id),
14194
- /* @__PURE__ */ jsx38(
14335
+ /* @__PURE__ */ jsx39(
14195
14336
  "button",
14196
14337
  {
14197
14338
  type: "button",
@@ -14199,14 +14340,14 @@ function SelectRow({
14199
14340
  onClick: () => removeColumn(item.id),
14200
14341
  disabled,
14201
14342
  "aria-label": `Remove ${item.label} column`,
14202
- children: /* @__PURE__ */ jsx38(Icon, { name: "close" })
14343
+ children: /* @__PURE__ */ jsx39(Icon, { name: "close" })
14203
14344
  }
14204
14345
  )
14205
14346
  ] })
14206
14347
  }
14207
14348
  ) : rendered.map((name) => {
14208
14349
  const label = fieldLabelByName.get(name) ?? name;
14209
- return /* @__PURE__ */ jsxs33(
14350
+ return /* @__PURE__ */ jsxs34(
14210
14351
  "span",
14211
14352
  {
14212
14353
  className: cx5(
@@ -14249,10 +14390,10 @@ function SelectRow({
14249
14390
  onDragEnd: () => columnDrag.end(),
14250
14391
  title: "drag to reorder",
14251
14392
  children: [
14252
- /* @__PURE__ */ jsx38("span", { "aria-hidden": true, className: "qt-chip-grip", children: /* @__PURE__ */ jsx38(Icon, { name: "grip" }) }),
14253
- presentation?.renderChip?.(name, label) ?? /* @__PURE__ */ jsx38("span", { className: "qt-chip-field", children: label }),
14393
+ /* @__PURE__ */ jsx39("span", { "aria-hidden": true, className: "qt-chip-grip", children: /* @__PURE__ */ jsx39(Icon, { name: "grip" }) }),
14394
+ presentation?.renderChip?.(name, label) ?? /* @__PURE__ */ jsx39("span", { className: "qt-chip-field", children: label }),
14254
14395
  detailSettingsButton(name),
14255
- /* @__PURE__ */ jsx38(
14396
+ /* @__PURE__ */ jsx39(
14256
14397
  "button",
14257
14398
  {
14258
14399
  type: "button",
@@ -14260,7 +14401,7 @@ function SelectRow({
14260
14401
  onClick: () => removeColumn(name),
14261
14402
  disabled,
14262
14403
  "aria-label": `Remove ${label} column`,
14263
- children: /* @__PURE__ */ jsx38(Icon, { name: "close" })
14404
+ children: /* @__PURE__ */ jsx39(Icon, { name: "close" })
14264
14405
  }
14265
14406
  )
14266
14407
  ]
@@ -14281,7 +14422,7 @@ function QueryFilterRow({
14281
14422
  () => new Map(fields.map((field) => [field.name, field])),
14282
14423
  [fields]
14283
14424
  );
14284
- return /* @__PURE__ */ jsx38(
14425
+ return /* @__PURE__ */ jsx39(
14285
14426
  WhereRow,
14286
14427
  {
14287
14428
  api,
@@ -14308,14 +14449,14 @@ function WhereRow({
14308
14449
  disabled,
14309
14450
  label = "where"
14310
14451
  }) {
14311
- const [adding, setAdding] = useState30(false);
14452
+ const [adding, setAdding] = useState31(false);
14312
14453
  const mobile = useMobileLayout();
14313
- const editorId = useId10();
14314
- const nextSetId = useRef22(0);
14315
- const addFilterButton = useRef22(null);
14316
- const [editingSet, setEditingSet] = useState30(null);
14317
- const [drag, setDrag] = useState30(null);
14318
- const [editingFilter, setEditingFilter] = useState30(null);
14454
+ const editorId = useId11();
14455
+ const nextSetId = useRef23(0);
14456
+ const addFilterButton = useRef23(null);
14457
+ const [editingSet, setEditingSet] = useState31(null);
14458
+ const [drag, setDrag] = useState31(null);
14459
+ const [editingFilter, setEditingFilter] = useState31(null);
14319
14460
  const where = api.query.where;
14320
14461
  const whereSignature = JSON.stringify(where);
14321
14462
  const setEditors = /* @__PURE__ */ new Map();
@@ -14330,7 +14471,7 @@ function WhereRow({
14330
14471
  hiddenSetTerms.add(index + offset3);
14331
14472
  index += set.count - 1;
14332
14473
  }
14333
- useEffect21(() => {
14474
+ useEffect22(() => {
14334
14475
  if (editingSet && editingSet.signature !== whereSignature)
14335
14476
  setEditingSet(null);
14336
14477
  }, [editingSet, whereSignature]);
@@ -14400,9 +14541,9 @@ function WhereRow({
14400
14541
  }
14401
14542
  setDrag(null);
14402
14543
  }
14403
- const actions = /* @__PURE__ */ jsxs33(Fragment24, { children: [
14404
- /* @__PURE__ */ jsxs33(PickerAnchor, { children: [
14405
- /* @__PURE__ */ jsxs33(
14544
+ const actions = /* @__PURE__ */ jsxs34(Fragment24, { children: [
14545
+ /* @__PURE__ */ jsxs34(PickerAnchor, { children: [
14546
+ /* @__PURE__ */ jsxs34(
14406
14547
  "button",
14407
14548
  {
14408
14549
  ref: addFilterButton,
@@ -14414,12 +14555,12 @@ function WhereRow({
14414
14555
  onClick: () => setAdding(!adding),
14415
14556
  disabled,
14416
14557
  children: [
14417
- /* @__PURE__ */ jsx38(Icon, { name: "add" }),
14558
+ /* @__PURE__ */ jsx39(Icon, { name: "add" }),
14418
14559
  label === "having" ? "having" : "add filter"
14419
14560
  ]
14420
14561
  }
14421
14562
  ),
14422
- adding && /* @__PURE__ */ jsx38(
14563
+ adding && /* @__PURE__ */ jsx39(
14423
14564
  FieldPicker,
14424
14565
  {
14425
14566
  anchor: addFilterButton.current ?? void 0,
@@ -14430,7 +14571,7 @@ function WhereRow({
14430
14571
  }
14431
14572
  )
14432
14573
  ] }),
14433
- where.length > 0 && /* @__PURE__ */ jsx38(
14574
+ where.length > 0 && /* @__PURE__ */ jsx39(
14434
14575
  "button",
14435
14576
  {
14436
14577
  type: "button",
@@ -14442,18 +14583,18 @@ function WhereRow({
14442
14583
  }
14443
14584
  )
14444
14585
  ] });
14445
- return /* @__PURE__ */ jsxs33("div", { className: cx5("qt-qb-row qt-qb-row--filters", where.length === 0 && "qt-qb-row--unused"), "data-clause": label, children: [
14446
- /* @__PURE__ */ jsxs33("div", { className: "qt-qb-section-header", children: [
14447
- /* @__PURE__ */ jsx38("span", { className: "qt-qb-kw", "data-mobile-label": label === "having" ? "Having" : "Filters", children: label }),
14586
+ return /* @__PURE__ */ jsxs34("div", { className: cx5("qt-qb-row qt-qb-row--filters", where.length === 0 && "qt-qb-row--unused"), "data-clause": label, children: [
14587
+ /* @__PURE__ */ jsxs34("div", { className: "qt-qb-section-header", children: [
14588
+ /* @__PURE__ */ jsx39("span", { className: "qt-qb-kw", "data-mobile-label": label === "having" ? "Having" : "Filters", children: label }),
14448
14589
  mobile && actions
14449
14590
  ] }),
14450
14591
  where.map((term, index) => {
14451
14592
  if (hiddenSetTerms.has(index)) return null;
14452
14593
  const set = setEditors.get(index);
14453
- return /* @__PURE__ */ jsxs33("span", { className: "qt-where-term-wrap", children: [
14454
- index > 0 && hasOr && /* @__PURE__ */ jsx38("span", { className: "qt-where-and", children: "AND" }),
14455
- set ? /* @__PURE__ */ jsxs33("span", { className: cx5("qt-chip", classNames?.chip), children: [
14456
- /* @__PURE__ */ jsxs33(
14594
+ return /* @__PURE__ */ jsxs34("span", { className: "qt-where-term-wrap", children: [
14595
+ index > 0 && hasOr && /* @__PURE__ */ jsx39("span", { className: "qt-where-and", children: "AND" }),
14596
+ set ? /* @__PURE__ */ jsxs34("span", { className: cx5("qt-chip", classNames?.chip), children: [
14597
+ /* @__PURE__ */ jsxs34(
14457
14598
  "button",
14458
14599
  {
14459
14600
  type: "button",
@@ -14475,8 +14616,8 @@ function WhereRow({
14475
14616
  ]
14476
14617
  }
14477
14618
  ),
14478
- set.metadata.values.map((value) => /* @__PURE__ */ jsxs33("span", { className: "qt-set-tag", children: [
14479
- /* @__PURE__ */ jsx38(
14619
+ set.metadata.values.map((value) => /* @__PURE__ */ jsxs34("span", { className: "qt-set-tag", children: [
14620
+ /* @__PURE__ */ jsx39(
14480
14621
  PresentedFilterValue,
14481
14622
  {
14482
14623
  field: set.field.name,
@@ -14484,7 +14625,7 @@ function WhereRow({
14484
14625
  label: setFilterValueLabel(set.field, value)
14485
14626
  }
14486
14627
  ),
14487
- /* @__PURE__ */ jsx38(
14628
+ /* @__PURE__ */ jsx39(
14488
14629
  "button",
14489
14630
  {
14490
14631
  type: "button",
@@ -14505,7 +14646,7 @@ function WhereRow({
14505
14646
  }
14506
14647
  )
14507
14648
  ] }, value)),
14508
- /* @__PURE__ */ jsx38(
14649
+ /* @__PURE__ */ jsx39(
14509
14650
  "button",
14510
14651
  {
14511
14652
  type: "button",
@@ -14516,7 +14657,7 @@ function WhereRow({
14516
14657
  children: "\u2715"
14517
14658
  }
14518
14659
  )
14519
- ] }) : /* @__PURE__ */ jsx38(
14660
+ ] }) : /* @__PURE__ */ jsx39(
14520
14661
  TermChip,
14521
14662
  {
14522
14663
  api,
@@ -14537,7 +14678,7 @@ function WhereRow({
14537
14678
  )
14538
14679
  ] }, index);
14539
14680
  }),
14540
- editingSet && /* @__PURE__ */ jsx38(
14681
+ editingSet && /* @__PURE__ */ jsx39(
14541
14682
  SetFilterEditor,
14542
14683
  {
14543
14684
  api,
@@ -14602,7 +14743,7 @@ function TermChip({
14602
14743
  const group = isOrGroup(term);
14603
14744
  const predicates = predicatesOf2(term);
14604
14745
  if (mobile)
14605
- return /* @__PURE__ */ jsx38(
14746
+ return /* @__PURE__ */ jsx39(
14606
14747
  MobileFilter,
14607
14748
  {
14608
14749
  api,
@@ -14615,7 +14756,7 @@ function TermChip({
14615
14756
  onOpenChange: onEditorChange
14616
14757
  }
14617
14758
  );
14618
- const grip = /* @__PURE__ */ jsx38(
14759
+ const grip = /* @__PURE__ */ jsx39(
14619
14760
  "span",
14620
14761
  {
14621
14762
  className: "qt-chip-grip",
@@ -14628,10 +14769,10 @@ function TermChip({
14628
14769
  },
14629
14770
  onDragEnd,
14630
14771
  title: "drag to reorder, or drop onto another filter to make an OR",
14631
- children: /* @__PURE__ */ jsx38(Icon, { name: "grip" })
14772
+ children: /* @__PURE__ */ jsx39(Icon, { name: "grip" })
14632
14773
  }
14633
14774
  );
14634
- return /* @__PURE__ */ jsxs33(
14775
+ return /* @__PURE__ */ jsxs34(
14635
14776
  "span",
14636
14777
  {
14637
14778
  className: cx5(
@@ -14649,9 +14790,9 @@ function TermChip({
14649
14790
  },
14650
14791
  children: [
14651
14792
  grip,
14652
- group ? /* @__PURE__ */ jsx38("span", { className: "qt-or-group", children: predicates.map((clause, predIndex) => /* @__PURE__ */ jsxs33("span", { className: "qt-or-member", children: [
14653
- predIndex > 0 && /* @__PURE__ */ jsx38("span", { className: "qt-chip-and qt-chip-or", children: "OR" }),
14654
- /* @__PURE__ */ jsx38(
14793
+ group ? /* @__PURE__ */ jsx39("span", { className: "qt-or-group", children: predicates.map((clause, predIndex) => /* @__PURE__ */ jsxs34("span", { className: "qt-or-member", children: [
14794
+ predIndex > 0 && /* @__PURE__ */ jsx39("span", { className: "qt-chip-and qt-chip-or", children: "OR" }),
14795
+ /* @__PURE__ */ jsx39(
14655
14796
  PredicateEditor,
14656
14797
  {
14657
14798
  api,
@@ -14663,7 +14804,7 @@ function TermChip({
14663
14804
  onRemove: () => api.removePredicate(index, predIndex)
14664
14805
  }
14665
14806
  )
14666
- ] }, predIndex)) }) : /* @__PURE__ */ jsx38(
14807
+ ] }, predIndex)) }) : /* @__PURE__ */ jsx39(
14667
14808
  PredicateEditor,
14668
14809
  {
14669
14810
  api,
@@ -14690,8 +14831,8 @@ function MobileFilter({
14690
14831
  onOpenChange
14691
14832
  }) {
14692
14833
  const predicates = predicatesOf2(term);
14693
- return /* @__PURE__ */ jsxs33(Fragment24, { children: [
14694
- /* @__PURE__ */ jsx38(
14834
+ return /* @__PURE__ */ jsxs34(Fragment24, { children: [
14835
+ /* @__PURE__ */ jsx39(
14695
14836
  MobileClauseSummary,
14696
14837
  {
14697
14838
  editLabel: `Edit filter: ${whereTermAsText(term, byName)}`,
@@ -14699,24 +14840,24 @@ function MobileFilter({
14699
14840
  className: classNames?.chip,
14700
14841
  filter: true,
14701
14842
  onEdit: () => onOpenChange(true),
14702
- children: /* @__PURE__ */ jsx38("span", { children: predicates.map((clause, position) => {
14843
+ children: /* @__PURE__ */ jsx39("span", { children: predicates.map((clause, position) => {
14703
14844
  const strategy = byName.get(clause.field)?.filter?.values;
14704
14845
  const option = strategy?.source === "static" ? strategy.options.find(
14705
14846
  (choice) => typeof choice !== "string" && choice.value === clause.value
14706
14847
  ) : void 0;
14707
14848
  const label = typeof option === "object" ? option.label : clause.value === "" ? '""' : clause.value;
14708
14849
  const emptyStringCondition = clause.value === "0" && (clause.op === "length_eq" || clause.op === "length_gt");
14709
- return /* @__PURE__ */ jsxs33("span", { className: "qt-mobile-filter-summary", children: [
14710
- position > 0 && /* @__PURE__ */ jsx38("small", { children: "OR" }),
14711
- /* @__PURE__ */ jsx38("strong", { children: byName.get(clause.field)?.label ?? clause.field }),
14712
- /* @__PURE__ */ jsxs33("span", { children: [
14850
+ return /* @__PURE__ */ jsxs34("span", { className: "qt-mobile-filter-summary", children: [
14851
+ position > 0 && /* @__PURE__ */ jsx39("small", { children: "OR" }),
14852
+ /* @__PURE__ */ jsx39("strong", { children: byName.get(clause.field)?.label ?? clause.field }),
14853
+ /* @__PURE__ */ jsxs34("span", { children: [
14713
14854
  choiceLabel(
14714
14855
  clause.op,
14715
14856
  Boolean(clause.negated),
14716
14857
  clause.value
14717
14858
  ),
14718
14859
  " ",
14719
- !NULLARY_OPS2.has(clause.op) && !emptyStringCondition && /* @__PURE__ */ jsx38(
14860
+ !NULLARY_OPS2.has(clause.op) && !emptyStringCondition && /* @__PURE__ */ jsx39(
14720
14861
  PresentedFilterValue,
14721
14862
  {
14722
14863
  field: clause.field,
@@ -14729,15 +14870,15 @@ function MobileFilter({
14729
14870
  }) })
14730
14871
  }
14731
14872
  ),
14732
- open && /* @__PURE__ */ jsx38(
14873
+ open && /* @__PURE__ */ jsx39(
14733
14874
  ModalSurface,
14734
14875
  {
14735
14876
  title: predicates.length > 1 ? "Edit filter group" : `Filter by ${byName.get(predicates[0].field)?.label ?? predicates[0].field}`,
14736
14877
  onClose: () => onOpenChange(false),
14737
- children: /* @__PURE__ */ jsxs33("div", { className: "qt-overlay-body qt-filter-editor", children: [
14738
- predicates.map((clause, position) => /* @__PURE__ */ jsxs33(Fragment23, { children: [
14739
- position > 0 && /* @__PURE__ */ jsx38("p", { className: "qt-muted", children: "OR" }),
14740
- /* @__PURE__ */ jsx38(
14878
+ children: /* @__PURE__ */ jsxs34("div", { className: "qt-overlay-body qt-filter-editor", children: [
14879
+ predicates.map((clause, position) => /* @__PURE__ */ jsxs34(Fragment23, { children: [
14880
+ position > 0 && /* @__PURE__ */ jsx39("p", { className: "qt-muted", children: "OR" }),
14881
+ /* @__PURE__ */ jsx39(
14741
14882
  PredicateEditor,
14742
14883
  {
14743
14884
  api,
@@ -14754,7 +14895,7 @@ function MobileFilter({
14754
14895
  }
14755
14896
  )
14756
14897
  ] }, position)),
14757
- predicates.length > 1 && /* @__PURE__ */ jsx38(
14898
+ predicates.length > 1 && /* @__PURE__ */ jsx39(
14758
14899
  "button",
14759
14900
  {
14760
14901
  type: "button",
@@ -14768,9 +14909,9 @@ function MobileFilter({
14768
14909
  children: "Remove filter group"
14769
14910
  }
14770
14911
  ),
14771
- api.query.where.length > 1 && /* @__PURE__ */ jsxs33("label", { className: "qt-filter-combine", children: [
14912
+ api.query.where.length > 1 && /* @__PURE__ */ jsxs34("label", { className: "qt-filter-combine", children: [
14772
14913
  "Match either filter (OR)",
14773
- /* @__PURE__ */ jsxs33(
14914
+ /* @__PURE__ */ jsxs34(
14774
14915
  "select",
14775
14916
  {
14776
14917
  className: "qt-input",
@@ -14782,9 +14923,9 @@ function MobileFilter({
14782
14923
  api.mergeFilters(index, Number(event.target.value));
14783
14924
  },
14784
14925
  children: [
14785
- /* @__PURE__ */ jsx38("option", { value: "", children: "Combine with another filter\u2026" }),
14926
+ /* @__PURE__ */ jsx39("option", { value: "", children: "Combine with another filter\u2026" }),
14786
14927
  api.query.where.map(
14787
- (candidate, position) => position !== index && /* @__PURE__ */ jsx38("option", { value: position, children: whereTermAsText(candidate, byName) }, position)
14928
+ (candidate, position) => position !== index && /* @__PURE__ */ jsx39("option", { value: position, children: whereTermAsText(candidate, byName) }, position)
14788
14929
  )
14789
14930
  ]
14790
14931
  }
@@ -14837,7 +14978,7 @@ function OpPicker({
14837
14978
  ) : { op: choice.op, negated: false };
14838
14979
  return resolved.op === clause.op && Boolean(resolved.negated) === Boolean(clause.negated);
14839
14980
  };
14840
- return /* @__PURE__ */ jsx38("span", { className: "qt-op-picker", children: /* @__PURE__ */ jsx38(
14981
+ return /* @__PURE__ */ jsx39("span", { className: "qt-op-picker", children: /* @__PURE__ */ jsx39(
14841
14982
  MenuButton,
14842
14983
  {
14843
14984
  label: "Choose condition",
@@ -14847,15 +14988,15 @@ function OpPicker({
14847
14988
  disabled: disabled || visiblePairs.length === 0,
14848
14989
  "aria-label": choiceLabel(clause.op, Boolean(clause.negated), clause.value)
14849
14990
  },
14850
- trigger: /* @__PURE__ */ jsxs33(Fragment24, { children: [
14991
+ trigger: /* @__PURE__ */ jsxs34(Fragment24, { children: [
14851
14992
  choiceLabel(clause.op, Boolean(clause.negated), clause.value),
14852
- /* @__PURE__ */ jsx38(Icon, { name: "chevronDown", size: 12, className: "qt-op-caret" })
14993
+ /* @__PURE__ */ jsx39(Icon, { name: "chevronDown", size: 12, className: "qt-op-caret" })
14853
14994
  ] }),
14854
- children: /* @__PURE__ */ jsxs33(MenuGroup, { label: `Condition for ${field?.label ?? clause.field}`, columns: 2, className: "qt-op-pop", children: [
14855
- /* @__PURE__ */ jsx38("span", { className: "qt-cm-col-head", children: "keep" }),
14856
- /* @__PURE__ */ jsx38("span", { className: "qt-cm-col-head qt-cm-col-head--neg", children: "exclude" }),
14857
- visiblePairs.map((pair, i) => /* @__PURE__ */ jsxs33(Fragment23, { children: [
14858
- /* @__PURE__ */ jsx38(
14995
+ children: /* @__PURE__ */ jsxs34(MenuGroup, { label: `Condition for ${field?.label ?? clause.field}`, columns: 2, className: "qt-op-pop", children: [
14996
+ /* @__PURE__ */ jsx39("span", { className: "qt-cm-col-head", children: "keep" }),
14997
+ /* @__PURE__ */ jsx39("span", { className: "qt-cm-col-head qt-cm-col-head--neg", children: "exclude" }),
14998
+ visiblePairs.map((pair, i) => /* @__PURE__ */ jsxs34(Fragment23, { children: [
14999
+ /* @__PURE__ */ jsx39(
14859
15000
  MenuItem,
14860
15001
  {
14861
15002
  className: cx5("qt-op-cell", isActive(pair.keep) && "qt-op-cell--on"),
@@ -14865,7 +15006,7 @@ function OpPicker({
14865
15006
  children: choiceLabel(pair.keep.op, pair.keep.negated, clause.value)
14866
15007
  }
14867
15008
  ),
14868
- /* @__PURE__ */ jsx38(
15009
+ /* @__PURE__ */ jsx39(
14869
15010
  MenuItem,
14870
15011
  {
14871
15012
  className: cx5("qt-op-cell", "qt-op-cell--neg", isActive(pair.exclude) && "qt-op-cell--on"),
@@ -14903,7 +15044,7 @@ function PredicateEditor({
14903
15044
  choice.negated ? negateClause2(next, field ? opsForField3(field) : void 0) : next
14904
15045
  );
14905
15046
  }
14906
- const conditionControl = /* @__PURE__ */ jsx38(
15047
+ const conditionControl = /* @__PURE__ */ jsx39(
14907
15048
  OpPicker,
14908
15049
  {
14909
15050
  field,
@@ -14913,12 +15054,16 @@ function PredicateEditor({
14913
15054
  onPick: pickOp
14914
15055
  }
14915
15056
  );
14916
- const valueControl = needsValue ? /* @__PURE__ */ jsx38(
15057
+ const valueControl = needsValue ? /* @__PURE__ */ jsx39(
14917
15058
  ValueInput,
14918
15059
  {
14919
15060
  api,
14920
15061
  field,
14921
15062
  value: clause.value,
15063
+ contextKey: JSON.stringify(
15064
+ { ...api.query, offset: 0 },
15065
+ (_key, entry) => entry === clause ? { ...clause, value: "" } : entry
15066
+ ),
14922
15067
  forceFreeform: isRegex || isLength,
14923
15068
  numeric: isLength,
14924
15069
  placeholder: isRegex ? "regex" : isLength ? "length" : field?.type === "datetime" ? "ISO date or signed duration" : "value",
@@ -14926,7 +15071,7 @@ function PredicateEditor({
14926
15071
  onChange: (value) => onChange({ ...clause, value })
14927
15072
  }
14928
15073
  ) : null;
14929
- const removeControl = /* @__PURE__ */ jsx38(
15074
+ const removeControl = /* @__PURE__ */ jsx39(
14930
15075
  "button",
14931
15076
  {
14932
15077
  type: "button",
@@ -14934,13 +15079,13 @@ function PredicateEditor({
14934
15079
  onClick: onRemove,
14935
15080
  disabled,
14936
15081
  "aria-label": `Remove ${field?.label ?? clause.field} filter`,
14937
- children: mobile ? "Remove filter" : /* @__PURE__ */ jsx38(Icon, { name: "close" })
15082
+ children: mobile ? "Remove filter" : /* @__PURE__ */ jsx39(Icon, { name: "close" })
14938
15083
  }
14939
15084
  );
14940
15085
  if (mobile)
14941
- return /* @__PURE__ */ jsxs33("div", { className: "qt-mobile-predicate qt-mobile-form", children: [
14942
- showField && /* @__PURE__ */ jsx38("strong", { className: "qt-mobile-form-field--wide", children: field?.label ?? clause.field }),
14943
- /* @__PURE__ */ jsxs33(
15086
+ return /* @__PURE__ */ jsxs34("div", { className: "qt-mobile-predicate qt-mobile-form", children: [
15087
+ showField && /* @__PURE__ */ jsx39("strong", { className: "qt-mobile-form-field--wide", children: field?.label ?? clause.field }),
15088
+ /* @__PURE__ */ jsxs34(
14944
15089
  "label",
14945
15090
  {
14946
15091
  className: cx5(
@@ -14948,19 +15093,19 @@ function PredicateEditor({
14948
15093
  !needsValue && "qt-mobile-form-field--wide"
14949
15094
  ),
14950
15095
  children: [
14951
- /* @__PURE__ */ jsx38("span", { children: "Condition" }),
15096
+ /* @__PURE__ */ jsx39("span", { children: "Condition" }),
14952
15097
  conditionControl
14953
15098
  ]
14954
15099
  }
14955
15100
  ),
14956
- valueControl && /* @__PURE__ */ jsxs33("label", { className: "qt-mobile-form-field", children: [
14957
- /* @__PURE__ */ jsx38("span", { children: "Value" }),
15101
+ valueControl && /* @__PURE__ */ jsxs34("label", { className: "qt-mobile-form-field", children: [
15102
+ /* @__PURE__ */ jsx39("span", { children: "Value" }),
14958
15103
  valueControl
14959
15104
  ] }),
14960
15105
  removeControl
14961
15106
  ] });
14962
- return /* @__PURE__ */ jsxs33("span", { className: "qt-pred", children: [
14963
- /* @__PURE__ */ jsx38("span", { className: "qt-chip-field", children: field?.label ?? clause.field }),
15107
+ return /* @__PURE__ */ jsxs34("span", { className: "qt-pred", children: [
15108
+ /* @__PURE__ */ jsx39("span", { className: "qt-chip-field", children: field?.label ?? clause.field }),
14964
15109
  conditionControl,
14965
15110
  valueControl,
14966
15111
  removeControl
@@ -14970,6 +15115,7 @@ function ValueInput({
14970
15115
  api,
14971
15116
  field,
14972
15117
  value,
15118
+ contextKey,
14973
15119
  forceFreeform,
14974
15120
  numeric: numeric2,
14975
15121
  placeholder = "value",
@@ -14980,7 +15126,7 @@ function ValueInput({
14980
15126
  const strategy = field ? filterValuesFor(field) : { source: "freeform" };
14981
15127
  if (!forceFreeform && strategy.source === "static") {
14982
15128
  if (presentation.render || presentation.label || strategy.options.some((o) => typeof o !== "string")) {
14983
- return /* @__PURE__ */ jsx38(
15129
+ return /* @__PURE__ */ jsx39(
14984
15130
  PresentedValueInput,
14985
15131
  {
14986
15132
  field: field?.name ?? "",
@@ -14990,7 +15136,7 @@ function ValueInput({
14990
15136
  }
14991
15137
  );
14992
15138
  }
14993
- return /* @__PURE__ */ jsxs33(
15139
+ return /* @__PURE__ */ jsxs34(
14994
15140
  "select",
14995
15141
  {
14996
15142
  className: cx5("qt-chip-val", classNames?.select),
@@ -14998,10 +15144,10 @@ function ValueInput({
14998
15144
  value,
14999
15145
  onChange: (e) => onChange(e.target.value),
15000
15146
  children: [
15001
- /* @__PURE__ */ jsx38("option", { value: "", children: "\u2014" }),
15147
+ /* @__PURE__ */ jsx39("option", { value: "", children: "\u2014" }),
15002
15148
  strategy.options.map((o) => {
15003
15149
  const option = typeof o === "string" ? { value: o, label: o } : o;
15004
- return /* @__PURE__ */ jsx38("option", { value: option.value, children: option.label }, option.value);
15150
+ return /* @__PURE__ */ jsx39("option", { value: option.value, children: option.label }, option.value);
15005
15151
  })
15006
15152
  ]
15007
15153
  }
@@ -15014,7 +15160,7 @@ function ValueInput({
15014
15160
  5,
15015
15161
  4
15016
15162
  );
15017
- return /* @__PURE__ */ jsx38(
15163
+ return /* @__PURE__ */ jsx39(
15018
15164
  "input",
15019
15165
  {
15020
15166
  className: cx5("qt-chip-val", classNames?.input),
@@ -15029,63 +15175,19 @@ function ValueInput({
15029
15175
  }
15030
15176
  );
15031
15177
  }
15032
- return /* @__PURE__ */ jsx38(
15033
- AutocompleteInput,
15178
+ return /* @__PURE__ */ jsx39(
15179
+ FilterValueAutocomplete,
15034
15180
  {
15035
15181
  api,
15036
15182
  field,
15037
15183
  value,
15038
- classNames,
15184
+ contextKey,
15185
+ className: cx5("qt-chip-val", classNames?.input),
15186
+ widthChars: chipFieldWidthForInput(value || "value", field.type, 5, 4),
15039
15187
  onChange
15040
15188
  }
15041
15189
  );
15042
15190
  }
15043
- function AutocompleteInput({
15044
- api,
15045
- field,
15046
- value,
15047
- classNames,
15048
- onChange
15049
- }) {
15050
- const [result, setResult] = useState30({
15051
- values: [],
15052
- hasMore: false
15053
- });
15054
- const listId = useId10();
15055
- useEffect21(() => {
15056
- let cancelled = false;
15057
- const t = setTimeout(() => {
15058
- void api.filterValues(field.name, value).then((r) => {
15059
- if (!cancelled) setResult(r);
15060
- }).catch(() => {
15061
- if (!cancelled) setResult({ values: [], hasMore: false });
15062
- });
15063
- }, 200);
15064
- return () => {
15065
- cancelled = true;
15066
- clearTimeout(t);
15067
- };
15068
- }, [api, field.name, value]);
15069
- return /* @__PURE__ */ jsxs33("span", { className: "qt-autocomplete", children: [
15070
- /* @__PURE__ */ jsx38(
15071
- "input",
15072
- {
15073
- className: cx5("qt-chip-val", classNames?.input),
15074
- value,
15075
- placeholder: "value",
15076
- "aria-label": `Value for ${field.label}`,
15077
- list: listId,
15078
- size: chipFieldWidthForInput(value || "value", field.type, 5, 4),
15079
- style: {
15080
- width: `${chipFieldWidthForInput(value || "value", field.type, 5, 4)}ch`
15081
- },
15082
- onChange: (e) => onChange(e.target.value)
15083
- }
15084
- ),
15085
- /* @__PURE__ */ jsx38("datalist", { id: listId, children: result.values.map((v) => /* @__PURE__ */ jsx38("option", { value: v }, v)) }),
15086
- result.hasMore && /* @__PURE__ */ jsx38("span", { className: "qt-autocomplete-hint", children: "keep typing to refine\u2026" })
15087
- ] });
15088
- }
15089
15191
  function MobileClauseSummary({
15090
15192
  editLabel,
15091
15193
  disabled,
@@ -15094,7 +15196,7 @@ function MobileClauseSummary({
15094
15196
  onEdit,
15095
15197
  children
15096
15198
  }) {
15097
- return /* @__PURE__ */ jsx38("div", { className: cx5("qt-mobile-clause", className), children: /* @__PURE__ */ jsxs33(
15199
+ return /* @__PURE__ */ jsx39("div", { className: cx5("qt-mobile-clause", className), children: /* @__PURE__ */ jsxs34(
15098
15200
  "button",
15099
15201
  {
15100
15202
  type: "button",
@@ -15107,7 +15209,7 @@ function MobileClauseSummary({
15107
15209
  onClick: onEdit,
15108
15210
  children: [
15109
15211
  children,
15110
- /* @__PURE__ */ jsx38("span", { className: "qt-mobile-filter-edit", children: /* @__PURE__ */ jsx38(Icon, { name: "pencil" }) })
15212
+ /* @__PURE__ */ jsx39("span", { className: "qt-mobile-filter-edit", children: /* @__PURE__ */ jsx39(Icon, { name: "pencil" }) })
15111
15213
  ]
15112
15214
  }
15113
15215
  ) });
@@ -15123,20 +15225,20 @@ function MobileChipEditor({
15123
15225
  }) {
15124
15226
  const mobile = useMobileLayout();
15125
15227
  if (!mobile) return children;
15126
- return /* @__PURE__ */ jsxs33(Fragment24, { children: [
15127
- /* @__PURE__ */ jsx38(
15228
+ return /* @__PURE__ */ jsxs34(Fragment24, { children: [
15229
+ /* @__PURE__ */ jsx39(
15128
15230
  MobileClauseSummary,
15129
15231
  {
15130
15232
  editLabel: `Edit ${title}: ${summary}`,
15131
15233
  disabled,
15132
15234
  onEdit: () => onOpenChange(true),
15133
- children: /* @__PURE__ */ jsxs33("span", { className: "qt-mobile-filter-summary", children: [
15134
- /* @__PURE__ */ jsx38("strong", { children: summaryTitle }),
15135
- /* @__PURE__ */ jsx38("span", { children: summary })
15235
+ children: /* @__PURE__ */ jsxs34("span", { className: "qt-mobile-filter-summary", children: [
15236
+ /* @__PURE__ */ jsx39("strong", { children: summaryTitle }),
15237
+ /* @__PURE__ */ jsx39("span", { children: summary })
15136
15238
  ] })
15137
15239
  }
15138
15240
  ),
15139
- open && /* @__PURE__ */ jsx38(ModalSurface, { title, onClose: () => onOpenChange(false), children: /* @__PURE__ */ jsx38("div", { className: "qt-overlay-body qt-mobile-chip-editor", children }) })
15241
+ open && /* @__PURE__ */ jsx39(ModalSurface, { title, onClose: () => onOpenChange(false), children: /* @__PURE__ */ jsx39("div", { className: "qt-overlay-body qt-mobile-chip-editor", children }) })
15140
15242
  ] });
15141
15243
  }
15142
15244
  function OrderTermChip({
@@ -15162,10 +15264,10 @@ function OrderTermChip({
15162
15264
  }) {
15163
15265
  const fieldHasNull = useFieldHasNull(api, field?.name);
15164
15266
  const mobile = useMobileLayout();
15165
- const [extractOpen, setExtractOpen] = useState30(false);
15267
+ const [extractOpen, setExtractOpen] = useState31(false);
15166
15268
  const title = `Sort by ${label}`;
15167
15269
  const summary = `${term.dir === "asc" ? "Ascending" : "Descending"}${showPriority ? ` \xB7 Priority ${priority}` : ""}${term.extract ? " \xB7 Regex extraction" : ""}`;
15168
- const extractionEditor = extractOpen && /* @__PURE__ */ jsx38(
15270
+ const extractionEditor = extractOpen && /* @__PURE__ */ jsx39(
15169
15271
  SortExtractionEditor,
15170
15272
  {
15171
15273
  api,
@@ -15185,8 +15287,8 @@ function OrderTermChip({
15185
15287
  }
15186
15288
  );
15187
15289
  if (mobile)
15188
- return /* @__PURE__ */ jsxs33(Fragment24, { children: [
15189
- /* @__PURE__ */ jsx38(
15290
+ return /* @__PURE__ */ jsxs34(Fragment24, { children: [
15291
+ /* @__PURE__ */ jsx39(
15190
15292
  MobileChipEditor,
15191
15293
  {
15192
15294
  title,
@@ -15195,10 +15297,10 @@ function OrderTermChip({
15195
15297
  disabled,
15196
15298
  open: editorOpen,
15197
15299
  onOpenChange: onEditorChange,
15198
- children: /* @__PURE__ */ jsxs33("div", { className: "qt-mobile-form", children: [
15199
- /* @__PURE__ */ jsxs33("label", { className: "qt-mobile-form-field", children: [
15200
- /* @__PURE__ */ jsx38("span", { children: "Direction" }),
15201
- /* @__PURE__ */ jsxs33(
15300
+ children: /* @__PURE__ */ jsxs34("div", { className: "qt-mobile-form", children: [
15301
+ /* @__PURE__ */ jsxs34("label", { className: "qt-mobile-form-field", children: [
15302
+ /* @__PURE__ */ jsx39("span", { children: "Direction" }),
15303
+ /* @__PURE__ */ jsxs34(
15202
15304
  "select",
15203
15305
  {
15204
15306
  className: cx5("qt-input", classNames?.select),
@@ -15208,15 +15310,15 @@ function OrderTermChip({
15208
15310
  dir: event.target.value
15209
15311
  }),
15210
15312
  children: [
15211
- /* @__PURE__ */ jsx38("option", { value: "asc", children: "Ascending" }),
15212
- /* @__PURE__ */ jsx38("option", { value: "desc", children: "Descending" })
15313
+ /* @__PURE__ */ jsx39("option", { value: "asc", children: "Ascending" }),
15314
+ /* @__PURE__ */ jsx39("option", { value: "desc", children: "Descending" })
15213
15315
  ]
15214
15316
  }
15215
15317
  )
15216
15318
  ] }),
15217
- (term.extract != null || fieldHasNull !== false) && /* @__PURE__ */ jsxs33("label", { className: "qt-mobile-form-field", children: [
15218
- /* @__PURE__ */ jsx38("span", { children: "Null values" }),
15219
- /* @__PURE__ */ jsxs33(
15319
+ (term.extract != null || fieldHasNull !== false) && /* @__PURE__ */ jsxs34("label", { className: "qt-mobile-form-field", children: [
15320
+ /* @__PURE__ */ jsx39("span", { children: "Null values" }),
15321
+ /* @__PURE__ */ jsxs34(
15220
15322
  "select",
15221
15323
  {
15222
15324
  className: cx5("qt-input", classNames?.select),
@@ -15226,15 +15328,15 @@ function OrderTermChip({
15226
15328
  nulls: event.target.value
15227
15329
  }),
15228
15330
  children: [
15229
- /* @__PURE__ */ jsx38("option", { value: "last", children: "Last" }),
15230
- /* @__PURE__ */ jsx38("option", { value: "first", children: "First" })
15331
+ /* @__PURE__ */ jsx39("option", { value: "last", children: "Last" }),
15332
+ /* @__PURE__ */ jsx39("option", { value: "first", children: "First" })
15231
15333
  ]
15232
15334
  }
15233
15335
  )
15234
15336
  ] }),
15235
- /* @__PURE__ */ jsxs33("div", { className: "qt-mobile-form-field qt-mobile-form-field--wide", children: [
15236
- /* @__PURE__ */ jsx38("span", { children: "Extraction" }),
15237
- /* @__PURE__ */ jsxs33(
15337
+ /* @__PURE__ */ jsxs34("div", { className: "qt-mobile-form-field qt-mobile-form-field--wide", children: [
15338
+ /* @__PURE__ */ jsx39("span", { children: "Extraction" }),
15339
+ /* @__PURE__ */ jsxs34(
15238
15340
  "button",
15239
15341
  {
15240
15342
  type: "button",
@@ -15243,13 +15345,13 @@ function OrderTermChip({
15243
15345
  onClick: () => setExtractOpen(true),
15244
15346
  "aria-label": `Configure regex extract for ${label}`,
15245
15347
  children: [
15246
- /* @__PURE__ */ jsx38(Icon, { name: term.extract ? "pencil" : "add" }),
15348
+ /* @__PURE__ */ jsx39(Icon, { name: term.extract ? "pencil" : "add" }),
15247
15349
  term.extract ? "Edit regex extraction" : "regex extract"
15248
15350
  ]
15249
15351
  }
15250
15352
  )
15251
15353
  ] }),
15252
- /* @__PURE__ */ jsx38("div", { className: "qt-mobile-form-actions", children: /* @__PURE__ */ jsx38(
15354
+ /* @__PURE__ */ jsx39("div", { className: "qt-mobile-form-actions", children: /* @__PURE__ */ jsx39(
15253
15355
  "button",
15254
15356
  {
15255
15357
  type: "button",
@@ -15265,8 +15367,8 @@ function OrderTermChip({
15265
15367
  ),
15266
15368
  extractionEditor
15267
15369
  ] });
15268
- return /* @__PURE__ */ jsxs33(Fragment24, { children: [
15269
- /* @__PURE__ */ jsxs33(
15370
+ return /* @__PURE__ */ jsxs34(Fragment24, { children: [
15371
+ /* @__PURE__ */ jsxs34(
15270
15372
  "span",
15271
15373
  {
15272
15374
  className: cx5(
@@ -15290,10 +15392,10 @@ function OrderTermChip({
15290
15392
  onDragEnd,
15291
15393
  title: "drag to reorder sort priority",
15292
15394
  children: [
15293
- /* @__PURE__ */ jsx38("span", { "aria-hidden": true, className: "qt-chip-grip", children: /* @__PURE__ */ jsx38(Icon, { name: "grip" }) }),
15294
- showPriority && /* @__PURE__ */ jsx38("span", { className: "qt-chip-priority", children: priority }),
15295
- /* @__PURE__ */ jsx38("span", { className: "qt-chip-field", children: label }),
15296
- /* @__PURE__ */ jsxs33(
15395
+ /* @__PURE__ */ jsx39("span", { "aria-hidden": true, className: "qt-chip-grip", children: /* @__PURE__ */ jsx39(Icon, { name: "grip" }) }),
15396
+ showPriority && /* @__PURE__ */ jsx39("span", { className: "qt-chip-priority", children: priority }),
15397
+ /* @__PURE__ */ jsx39("span", { className: "qt-chip-field", children: label }),
15398
+ /* @__PURE__ */ jsxs34(
15297
15399
  "button",
15298
15400
  {
15299
15401
  type: "button",
@@ -15301,12 +15403,12 @@ function OrderTermChip({
15301
15403
  disabled,
15302
15404
  onClick: () => updateTerm(dataIndex, { dir: term.dir === "asc" ? "desc" : "asc" }),
15303
15405
  children: [
15304
- /* @__PURE__ */ jsx38(Icon, { name: term.dir === "asc" ? "arrowUp" : "arrowDown" }),
15406
+ /* @__PURE__ */ jsx39(Icon, { name: term.dir === "asc" ? "arrowUp" : "arrowDown" }),
15305
15407
  term.dir === "asc" ? "asc" : "desc"
15306
15408
  ]
15307
15409
  }
15308
15410
  ),
15309
- term.extract && /* @__PURE__ */ jsxs33(
15411
+ term.extract && /* @__PURE__ */ jsxs34(
15310
15412
  "button",
15311
15413
  {
15312
15414
  type: "button",
@@ -15316,12 +15418,12 @@ function OrderTermChip({
15316
15418
  disabled,
15317
15419
  onClick: () => setExtractOpen(true),
15318
15420
  children: [
15319
- /* @__PURE__ */ jsx38(Icon, { name: "pencil" }),
15421
+ /* @__PURE__ */ jsx39(Icon, { name: "pencil" }),
15320
15422
  "regex extraction"
15321
15423
  ]
15322
15424
  }
15323
15425
  ),
15324
- (term.extract != null || fieldHasNull !== false) && /* @__PURE__ */ jsxs33(
15426
+ (term.extract != null || fieldHasNull !== false) && /* @__PURE__ */ jsxs34(
15325
15427
  "button",
15326
15428
  {
15327
15429
  type: "button",
@@ -15337,7 +15439,7 @@ function OrderTermChip({
15337
15439
  ]
15338
15440
  }
15339
15441
  ),
15340
- /* @__PURE__ */ jsx38(
15442
+ /* @__PURE__ */ jsx39(
15341
15443
  "button",
15342
15444
  {
15343
15445
  type: "button",
@@ -15345,7 +15447,7 @@ function OrderTermChip({
15345
15447
  onClick: () => removeTerm(dataIndex),
15346
15448
  disabled,
15347
15449
  "aria-label": `Remove ${label} sort`,
15348
- children: /* @__PURE__ */ jsx38(Icon, { name: "close" })
15450
+ children: /* @__PURE__ */ jsx39(Icon, { name: "close" })
15349
15451
  }
15350
15452
  )
15351
15453
  ]
@@ -15366,11 +15468,11 @@ function OrderRow({
15366
15468
  () => new Map(fields.map((f) => [f.name, f])),
15367
15469
  [fields]
15368
15470
  );
15369
- const [drag, setDrag] = useState30(null);
15370
- const [adding, setAdding] = useState30(false);
15371
- const [regexField, setRegexField] = useState30(null);
15372
- const [regexDirection, setRegexDirection] = useState30("desc");
15373
- const [editingSort, setEditingSort] = useState30(null);
15471
+ const [drag, setDrag] = useState31(null);
15472
+ const [adding, setAdding] = useState31(false);
15473
+ const [regexField, setRegexField] = useState31(null);
15474
+ const [regexDirection, setRegexDirection] = useState31("desc");
15475
+ const [editingSort, setEditingSort] = useState31(null);
15374
15476
  function setOrderBy(next) {
15375
15477
  api.setSort(next);
15376
15478
  }
@@ -15463,7 +15565,7 @@ function OrderRow({
15463
15565
  }
15464
15566
  const renderTerm = (name, position) => {
15465
15567
  const term = termByField.get(name);
15466
- return /* @__PURE__ */ jsx38(
15568
+ return /* @__PURE__ */ jsx39(
15467
15569
  OrderTermChip,
15468
15570
  {
15469
15571
  api,
@@ -15493,10 +15595,10 @@ function OrderRow({
15493
15595
  const next = api.defaults.orderBy[i];
15494
15596
  return term.field === next?.field && term.dir === next?.dir && (term.nulls ?? "last") === (next?.nulls ?? "last") && (term.extract?.regex ?? null) === (next?.extract?.regex ?? null);
15495
15597
  });
15496
- const actions = /* @__PURE__ */ jsxs33(Fragment24, { children: [
15497
- /* @__PURE__ */ jsxs33(PickerAnchor, { children: [
15498
- /* @__PURE__ */ jsxs33("span", { className: "qt-split-btn", role: "group", "aria-label": "Sort actions", children: [
15499
- /* @__PURE__ */ jsxs33(
15598
+ const actions = /* @__PURE__ */ jsxs34(Fragment24, { children: [
15599
+ /* @__PURE__ */ jsxs34(PickerAnchor, { children: [
15600
+ /* @__PURE__ */ jsxs34("span", { className: "qt-split-btn", role: "group", "aria-label": "Sort actions", children: [
15601
+ /* @__PURE__ */ jsxs34(
15500
15602
  "button",
15501
15603
  {
15502
15604
  type: "button",
@@ -15507,12 +15609,12 @@ function OrderRow({
15507
15609
  onClick: () => setAdding((previous) => !previous),
15508
15610
  disabled: disabled || sortable.length === 0,
15509
15611
  children: [
15510
- /* @__PURE__ */ jsx38(Icon, { name: "add" }),
15612
+ /* @__PURE__ */ jsx39(Icon, { name: "add" }),
15511
15613
  mobile ? "Add" : "add sort"
15512
15614
  ]
15513
15615
  }
15514
15616
  ),
15515
- /* @__PURE__ */ jsx38(
15617
+ /* @__PURE__ */ jsx39(
15516
15618
  "button",
15517
15619
  {
15518
15620
  type: "button",
@@ -15523,11 +15625,11 @@ function OrderRow({
15523
15625
  "aria-expanded": regexField != null,
15524
15626
  disabled: disabled || sortable.length === 0,
15525
15627
  onClick: () => openRegexConfigurator(),
15526
- children: /* @__PURE__ */ jsx38(Icon, { name: "chevronRight", size: 18 })
15628
+ children: /* @__PURE__ */ jsx39(Icon, { name: "chevronRight", size: 18 })
15527
15629
  }
15528
15630
  )
15529
15631
  ] }),
15530
- adding && /* @__PURE__ */ jsx38(
15632
+ adding && /* @__PURE__ */ jsx39(
15531
15633
  SortPicker,
15532
15634
  {
15533
15635
  fields: sortable,
@@ -15537,7 +15639,7 @@ function OrderRow({
15537
15639
  }
15538
15640
  )
15539
15641
  ] }),
15540
- !isDefaultOrderBy && /* @__PURE__ */ jsx38(
15642
+ !isDefaultOrderBy && /* @__PURE__ */ jsx39(
15541
15643
  "button",
15542
15644
  {
15543
15645
  type: "button",
@@ -15548,13 +15650,13 @@ function OrderRow({
15548
15650
  }
15549
15651
  )
15550
15652
  ] });
15551
- return /* @__PURE__ */ jsxs33("div", { className: cx5("qt-qb-row qt-qb-row--sort", orderBy.length === 0 && "qt-qb-row--unused"), children: [
15552
- /* @__PURE__ */ jsxs33("div", { className: "qt-qb-section-header", children: [
15553
- /* @__PURE__ */ jsx38("span", { className: "qt-qb-kw", "data-mobile-label": "Sort", children: "order by" }),
15653
+ return /* @__PURE__ */ jsxs34("div", { className: cx5("qt-qb-row qt-qb-row--sort", orderBy.length === 0 && "qt-qb-row--unused"), children: [
15654
+ /* @__PURE__ */ jsxs34("div", { className: "qt-qb-section-header", children: [
15655
+ /* @__PURE__ */ jsx39("span", { className: "qt-qb-kw", "data-mobile-label": "Sort", children: "order by" }),
15554
15656
  mobile && actions
15555
15657
  ] }),
15556
- orderBy.length === 0 && !adding && /* @__PURE__ */ jsx38("span", { className: "qt-qb-hint", children: "(default)" }),
15557
- mobile && orderBy.length > 0 ? /* @__PURE__ */ jsx38(
15658
+ orderBy.length === 0 && !adding && /* @__PURE__ */ jsx39("span", { className: "qt-qb-hint", children: "(default)" }),
15659
+ mobile && orderBy.length > 0 ? /* @__PURE__ */ jsx39(
15558
15660
  ReorderList,
15559
15661
  {
15560
15662
  className: "qt-query-reorder-list",
@@ -15576,7 +15678,7 @@ function OrderRow({
15576
15678
  }
15577
15679
  ) : rendered.map(renderTerm),
15578
15680
  !mobile && actions,
15579
- regexField && /* @__PURE__ */ jsx38(
15681
+ regexField && /* @__PURE__ */ jsx39(
15580
15682
  SortExtractionEditor,
15581
15683
  {
15582
15684
  api,
@@ -15617,17 +15719,17 @@ function WindowRow({
15617
15719
  compact
15618
15720
  }) {
15619
15721
  const { query } = api;
15620
- const offsetId = useId10();
15621
- const [addingOffset, setAddingOffset] = useState30(false);
15622
- const offsetInput = useRef22(null);
15623
- const [limitDraft, setLimitDraft] = useState30(String(query.limit));
15624
- const [offsetDraft, setOffsetDraft] = useState30(String(query.offset));
15625
- useEffect21(() => setLimitDraft(String(query.limit)), [query.limit]);
15626
- useEffect21(() => setOffsetDraft(String(query.offset)), [query.offset]);
15627
- useEffect21(() => {
15722
+ const offsetId = useId11();
15723
+ const [addingOffset, setAddingOffset] = useState31(false);
15724
+ const offsetInput = useRef23(null);
15725
+ const [limitDraft, setLimitDraft] = useState31(String(query.limit));
15726
+ const [offsetDraft, setOffsetDraft] = useState31(String(query.offset));
15727
+ useEffect22(() => setLimitDraft(String(query.limit)), [query.limit]);
15728
+ useEffect22(() => setOffsetDraft(String(query.offset)), [query.offset]);
15729
+ useEffect22(() => {
15628
15730
  if (query.offset > 0) setAddingOffset(false);
15629
15731
  }, [query.offset]);
15630
- useEffect21(() => {
15732
+ useEffect22(() => {
15631
15733
  if (addingOffset) {
15632
15734
  offsetInput.current?.focus();
15633
15735
  offsetInput.current?.select();
@@ -15639,10 +15741,10 @@ function WindowRow({
15639
15741
  function commitOffset() {
15640
15742
  api.setOffset(Math.max(0, Number(offsetDraft) || 0));
15641
15743
  }
15642
- return /* @__PURE__ */ jsxs33("div", { className: "qt-qb-row qt-qb-pagination", children: [
15643
- /* @__PURE__ */ jsxs33("label", { className: "qt-qb-window-field", children: [
15644
- /* @__PURE__ */ jsx38("span", { className: "qt-qb-kw", "data-mobile-label": "Limit", children: "limit" }),
15645
- /* @__PURE__ */ jsx38(
15744
+ return /* @__PURE__ */ jsxs34("div", { className: "qt-qb-row qt-qb-pagination", children: [
15745
+ /* @__PURE__ */ jsxs34("label", { className: "qt-qb-window-field", children: [
15746
+ /* @__PURE__ */ jsx39("span", { className: "qt-qb-kw", "data-mobile-label": "Limit", children: "limit" }),
15747
+ /* @__PURE__ */ jsx39(
15646
15748
  "input",
15647
15749
  {
15648
15750
  className: cx5("qt-qb-num", classNames?.input),
@@ -15656,8 +15758,8 @@ function WindowRow({
15656
15758
  }
15657
15759
  )
15658
15760
  ] }),
15659
- !compact || query.offset > 0 || addingOffset ? /* @__PURE__ */ jsxs33("div", { className: "qt-qb-window-field", children: [
15660
- /* @__PURE__ */ jsx38(
15761
+ !compact || query.offset > 0 || addingOffset ? /* @__PURE__ */ jsxs34("div", { className: "qt-qb-window-field", children: [
15762
+ /* @__PURE__ */ jsx39(
15661
15763
  "label",
15662
15764
  {
15663
15765
  className: "qt-qb-kw",
@@ -15666,8 +15768,8 @@ function WindowRow({
15666
15768
  children: "offset"
15667
15769
  }
15668
15770
  ),
15669
- /* @__PURE__ */ jsxs33("span", { className: "qt-qb-num-combo", children: [
15670
- /* @__PURE__ */ jsx38(
15771
+ /* @__PURE__ */ jsxs34("span", { className: "qt-qb-num-combo", children: [
15772
+ /* @__PURE__ */ jsx39(
15671
15773
  "input",
15672
15774
  {
15673
15775
  ref: offsetInput,
@@ -15682,7 +15784,7 @@ function WindowRow({
15682
15784
  onKeyDown: (e) => e.key === "Enter" && commitOffset()
15683
15785
  }
15684
15786
  ),
15685
- query.offset >= query.limit && /* @__PURE__ */ jsxs33(
15787
+ query.offset >= query.limit && /* @__PURE__ */ jsxs34(
15686
15788
  "button",
15687
15789
  {
15688
15790
  type: "button",
@@ -15697,7 +15799,7 @@ function WindowRow({
15697
15799
  ]
15698
15800
  }
15699
15801
  ),
15700
- /* @__PURE__ */ jsxs33(
15802
+ /* @__PURE__ */ jsxs34(
15701
15803
  "button",
15702
15804
  {
15703
15805
  type: "button",
@@ -15713,12 +15815,12 @@ function WindowRow({
15713
15815
  }
15714
15816
  )
15715
15817
  ] }),
15716
- compact && /* @__PURE__ */ jsx38("button", { type: "button", className: "qt-chip-x", "aria-label": "Clear offset", disabled, onClick: () => {
15818
+ compact && /* @__PURE__ */ jsx39("button", { type: "button", className: "qt-chip-x", "aria-label": "Clear offset", disabled, onClick: () => {
15717
15819
  setAddingOffset(false);
15718
15820
  api.setOffset(0);
15719
- }, children: /* @__PURE__ */ jsx38(Icon, { name: "close" }) })
15720
- ] }) : /* @__PURE__ */ jsxs33("button", { type: "button", className: "qt-add", "aria-label": "Add offset", disabled, onClick: () => setAddingOffset(true), children: [
15721
- /* @__PURE__ */ jsx38(Icon, { name: "add" }),
15821
+ }, children: /* @__PURE__ */ jsx39(Icon, { name: "close" }) })
15822
+ ] }) : /* @__PURE__ */ jsxs34("button", { type: "button", className: "qt-add", "aria-label": "Add offset", disabled, onClick: () => setAddingOffset(true), children: [
15823
+ /* @__PURE__ */ jsx39(Icon, { name: "add" }),
15722
15824
  "add offset"
15723
15825
  ] })
15724
15826
  ] });
@@ -15729,7 +15831,7 @@ function MetricsRow({
15729
15831
  theme,
15730
15832
  locale
15731
15833
  }) {
15732
- const [editing, setEditing] = useState30(false);
15834
+ const [editing, setEditing] = useState31(false);
15733
15835
  const allFields = useMemo12(
15734
15836
  () => [
15735
15837
  ...fields,
@@ -15739,10 +15841,10 @@ function MetricsRow({
15739
15841
  ],
15740
15842
  [fields, api.computed.catalogue]
15741
15843
  );
15742
- return /* @__PURE__ */ jsxs33(Fragment24, { children: [
15743
- api.aggregations.clauses.length === 0 && /* @__PURE__ */ jsx38("div", { className: "qt-qb-row qt-qb-row--metrics qt-qb-row--unused", children: /* @__PURE__ */ jsxs33("div", { className: "qt-qb-section-header", children: [
15744
- /* @__PURE__ */ jsx38("span", { className: "qt-qb-kw", "data-mobile-label": "Metrics", children: "metrics" }),
15745
- /* @__PURE__ */ jsxs33(
15844
+ return /* @__PURE__ */ jsxs34(Fragment24, { children: [
15845
+ api.aggregations.clauses.length === 0 && /* @__PURE__ */ jsx39("div", { className: "qt-qb-row qt-qb-row--metrics qt-qb-row--unused", children: /* @__PURE__ */ jsxs34("div", { className: "qt-qb-section-header", children: [
15846
+ /* @__PURE__ */ jsx39("span", { className: "qt-qb-kw", "data-mobile-label": "Metrics", children: "metrics" }),
15847
+ /* @__PURE__ */ jsxs34(
15746
15848
  "button",
15747
15849
  {
15748
15850
  type: "button",
@@ -15751,14 +15853,14 @@ function MetricsRow({
15751
15853
  "aria-haspopup": "dialog",
15752
15854
  onClick: () => setEditing(true),
15753
15855
  children: [
15754
- /* @__PURE__ */ jsx38(Icon, { name: "add" }),
15856
+ /* @__PURE__ */ jsx39(Icon, { name: "add" }),
15755
15857
  "add metric",
15756
- /* @__PURE__ */ jsx38(Icon, { name: "arrowRight", size: 14 })
15858
+ /* @__PURE__ */ jsx39(Icon, { name: "arrowRight", size: 14 })
15757
15859
  ]
15758
15860
  }
15759
15861
  )
15760
15862
  ] }) }),
15761
- editing && /* @__PURE__ */ jsx38(
15863
+ editing && /* @__PURE__ */ jsx39(
15762
15864
  MetricsEditor,
15763
15865
  {
15764
15866
  api,
@@ -15772,17 +15874,17 @@ function MetricsRow({
15772
15874
  }
15773
15875
 
15774
15876
  // src/SelectionToolbar.tsx
15775
- import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
15877
+ import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
15776
15878
  var cx6 = (...parts) => parts.filter(Boolean).join(" ");
15777
15879
  function SelectionToolbar({ selection, actions, alwaysShow, className }) {
15778
15880
  if (selection.count === 0 && !alwaysShow) return null;
15779
15881
  const selectedIds = [...selection.selected];
15780
- return /* @__PURE__ */ jsxs34("div", { className: cx6("qt-selection-toolbar", className), role: "toolbar", children: [
15781
- /* @__PURE__ */ jsxs34("span", { className: "qt-selection-count", children: [
15882
+ return /* @__PURE__ */ jsxs35("div", { className: cx6("qt-selection-toolbar", className), role: "toolbar", children: [
15883
+ /* @__PURE__ */ jsxs35("span", { className: "qt-selection-count", children: [
15782
15884
  selection.count,
15783
15885
  " selected"
15784
15886
  ] }),
15785
- /* @__PURE__ */ jsx39(
15887
+ /* @__PURE__ */ jsx40(
15786
15888
  "button",
15787
15889
  {
15788
15890
  type: "button",
@@ -15792,7 +15894,7 @@ function SelectionToolbar({ selection, actions, alwaysShow, className }) {
15792
15894
  children: "clear"
15793
15895
  }
15794
15896
  ),
15795
- /* @__PURE__ */ jsx39("span", { className: "qt-selection-actions", children: actions(selectedIds, selection) })
15897
+ /* @__PURE__ */ jsx40("span", { className: "qt-selection-actions", children: actions(selectedIds, selection) })
15796
15898
  ] });
15797
15899
  }
15798
15900
  export {