@pythia-software/query-table-ui 0.6.0 → 0.7.1

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.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, SetStateAction } from 'react';
3
- import { FieldDef, QueryState, RowId, AggregationClause, AggregationBucket, AggregationResultEntry, MetricValue, FieldStats, WhereClause, MetricValueFormat } from '@pythia-software/query-table-core';
2
+ import { ReactNode, SetStateAction, ButtonHTMLAttributes, CSSProperties, PointerEvent, Ref, MutableRefObject } from 'react';
3
+ import { FieldDef, QueryState, JsonCellDisplay, RowId, AggregationClause, AggregationBucket, AggregationResultEntry, MetricValue, SavedQuery, FieldStats, WhereClause, MetricValueFormat, FieldSchema, PropertyViewState, RelationshipAdapter, ObjectReference, PropertyFormat, PropertyViewStorage, ItemPropertyMode, FormulaFunction, GroupedRow } from '@pythia-software/query-table-core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import { SelectionApi, ColumnDragApi, QueryTableApi, AggregationsApi, SavedQueriesApi, RequestActivityApi } from '@pythia-software/query-table-react';
5
+ import { ItemDetailsApi, SelectionApi, ColumnDragApi, QueryTableApi, QueryFilterApi, AggregationsApi, SavedQueriesApi, RequestActivityApi, PropertyViewApi, GroupingApi } from '@pythia-software/query-table-react';
6
+ import { Placement } from '@floating-ui/react';
6
7
 
7
8
  interface CellContext<Row = any, V = unknown> {
8
9
  value: V;
@@ -10,6 +11,8 @@ interface CellContext<Row = any, V = unknown> {
10
11
  field: FieldDef<Row, V>;
11
12
  /** Current query — lets renderers reflect active state (e.g. highlight matches). */
12
13
  query: QueryState;
14
+ /** Detail surfaces can embed richer content directly instead of opening another dialog. */
15
+ presentation?: "cell" | "property";
13
16
  }
14
17
  type CellRenderer<Row = any, V = unknown> = (ctx: CellContext<Row, V>) => ReactNode;
15
18
  type RenderRegistry<Row = any> = Record<string, CellRenderer<Row>>;
@@ -21,10 +24,14 @@ declare function safeLinkHref(value: unknown): string | null;
21
24
  * referenced from FieldDef.render. Consumers spread these and add their own. */
22
25
  declare const defaultRenderers: RenderRegistry;
23
26
  /** Resolve a FieldDef's renderer: inline fn wins, else registry lookup, else
24
- * the `text` fallback. */
27
+ * declarative display, else the `text` fallback. */
25
28
  declare function resolveRenderer<Row>(field: FieldDef<Row>, registry: RenderRegistry<Row>): CellRenderer<Row>;
26
29
 
27
30
  declare const artwork: {
31
+ externalLink: react_jsx_runtime.JSX.Element;
32
+ itemHover: react_jsx_runtime.JSX.Element;
33
+ itemModal: react_jsx_runtime.JSX.Element;
34
+ itemExpand: react_jsx_runtime.JSX.Element;
28
35
  panelList: react_jsx_runtime.JSX.Element;
29
36
  panelDefinition: react_jsx_runtime.JSX.Element;
30
37
  panelReference: react_jsx_runtime.JSX.Element;
@@ -41,6 +48,9 @@ declare const artwork: {
41
48
  arrowDown: react_jsx_runtime.JSX.Element;
42
49
  arrowLeft: react_jsx_runtime.JSX.Element;
43
50
  arrowRight: react_jsx_runtime.JSX.Element;
51
+ skipForward: react_jsx_runtime.JSX.Element;
52
+ pointer: react_jsx_runtime.JSX.Element;
53
+ eye: react_jsx_runtime.JSX.Element;
44
54
  grip: react_jsx_runtime.JSX.Element;
45
55
  pencil: react_jsx_runtime.JSX.Element;
46
56
  star: react_jsx_runtime.JSX.Element;
@@ -63,6 +73,42 @@ interface IconProps {
63
73
  }
64
74
  declare function Icon({ name, size, className, filled }: IconProps): react_jsx_runtime.JSX.Element;
65
75
 
76
+ interface JsonCellProps {
77
+ value: unknown;
78
+ label?: string;
79
+ display?: JsonCellDisplay | undefined;
80
+ }
81
+ /** Compact cell plus a shared searchable inspector. Mountable outside DataTable. */
82
+ declare function JsonCell({ value, label, display }: JsonCellProps): ReactNode;
83
+ /** The same searchable JSON value embedded in item details, pages or host cards. */
84
+ declare function JsonValueView({ value, label, display, compact }: JsonCellProps & {
85
+ compact?: boolean;
86
+ }): ReactNode;
87
+
88
+ interface JsonEntry {
89
+ /** Unambiguous JSONPath; bracket notation preserves dots/quotes in keys. */
90
+ path: string;
91
+ parent: string | null;
92
+ key: string;
93
+ depth: number;
94
+ type: "object" | "array" | "string" | "number" | "boolean" | "null";
95
+ text: string;
96
+ children: number;
97
+ value: unknown;
98
+ }
99
+ interface JsonInspection {
100
+ value: unknown;
101
+ raw: string;
102
+ formatted: string;
103
+ preview: string;
104
+ entries: JsonEntry[];
105
+ error?: string;
106
+ limited?: boolean;
107
+ }
108
+ declare function inspectJsonValue(input: unknown, display?: JsonCellDisplay, includeEntries?: boolean): JsonInspection;
109
+ /** Search keys, full paths and typed values; case insensitive, literal matching. */
110
+ declare function searchJsonEntries(entries: JsonEntry[], search: string): JsonEntry[];
111
+
66
112
  interface TableClassNames {
67
113
  wrap?: string;
68
114
  table?: string;
@@ -96,11 +142,16 @@ interface QueryBuilderClassNames {
96
142
  }
97
143
  interface MenuClassNames {
98
144
  popover?: string;
145
+ submenu?: string;
99
146
  item?: string;
100
147
  separator?: string;
101
148
  }
102
149
 
103
150
  interface DataTableProps<Row> {
151
+ /** Built-in details from api.itemDetails; no render or route callbacks needed. */
152
+ itemDetails?: ItemDetailsApi<Row>;
153
+ /** Optional detail renderer overrides, layered over the table registry. */
154
+ itemRenderers?: RenderRegistry<Row>;
104
155
  /** Ordered visible fields (widths already resolved), from `api.visibleFields`. */
105
156
  fields: FieldDef<Row>[];
106
157
  rows: Row[];
@@ -119,6 +170,8 @@ interface DataTableProps<Row> {
119
170
  /** Always-visible trailing column (row actions, links). */
120
171
  trailing?: (row: Row) => ReactNode;
121
172
  trailingLabel?: string;
173
+ /** Optional compact role badge before the column label. */
174
+ headerAdornment?: ((field: FieldDef<Row>) => ReactNode) | undefined;
122
175
  /** Total matching rows before pagination, when known. */
123
176
  total?: number | null;
124
177
  loading?: boolean;
@@ -176,6 +229,20 @@ declare function createMetricColorResolver(theme?: MetricTheme): {
176
229
  };
177
230
 
178
231
  interface QueryBuilderProps<Row> {
232
+ /** Collect unused clauses into a compact row of add actions. */
233
+ compact?: boolean;
234
+ /** Additional clauses, inserted after WHERE and before ORDER BY. */
235
+ clauses?: ReactNode;
236
+ /** Replace WHERE when its inputs belong to a different result stage. */
237
+ whereRow?: ReactNode;
238
+ /** Host-owned summary shown when the editor is collapsed. */
239
+ summary?: ReactNode;
240
+ selectPresentation?: SelectPresentation;
241
+ /** Match/share the entire host definition when it contains more than QueryState. */
242
+ matchesSavedQuery?: (saved: SavedQuery) => boolean;
243
+ /** Replace the built-in saved-query controls with host-owned controls. */
244
+ savedQueryControls?: ReactNode;
245
+ shareUrl?: string;
179
246
  /** Additional diagnostics shown inside request activity. */
180
247
  requestActivityDetails?: ReactNode;
181
248
  /** The controller; QueryBuilder drives it through the intent helpers. */
@@ -196,7 +263,22 @@ interface QueryBuilderProps<Row> {
196
263
  metricTheme?: MetricTheme;
197
264
  metricLocale?: string;
198
265
  }
199
- declare function QueryBuilder<Row>({ api, fields, total, running, classNames, collapsed, onCollapsedChange, defaultCollapsed, metricTheme, metricLocale, requestActivityDetails, }: QueryBuilderProps<Row>): ReactNode;
266
+ interface SelectPresentation {
267
+ /** Replaces a chip's label; existing drag and remove controls are retained. */
268
+ renderChip?: (field: string, label: string) => ReactNode;
269
+ /** Replaces the add-column picker; call onClose after a selection or dismissal. */
270
+ renderPicker?: (onClose: () => void) => ReactNode;
271
+ renderEditor?: (onClose: () => void) => ReactNode;
272
+ hint?: ReactNode;
273
+ editorNotice?: ReactNode;
274
+ }
275
+ declare function QueryBuilder<Row>({ api, fields, total, running, classNames, collapsed, onCollapsedChange, defaultCollapsed, compact, metricTheme, metricLocale, requestActivityDetails, clauses, whereRow, summary, selectPresentation, matchesSavedQuery, savedQueryControls, shareUrl, }: QueryBuilderProps<Row>): ReactNode;
276
+ /** Reuse the same typed predicates for a host's source or result filter stage. */
277
+ declare function QueryFilterRow<Row>({ api, fields, label, }: {
278
+ api: QueryFilterApi<Row>;
279
+ fields: FieldDef<Row>[];
280
+ label?: "where" | "having";
281
+ }): react_jsx_runtime.JSX.Element;
200
282
 
201
283
  interface MetricsPanelProps<Row> {
202
284
  /** Enables quick editing using the transactional metrics editor. */
@@ -218,6 +300,8 @@ interface MetricsPanelProps<Row> {
218
300
  }
219
301
  declare function MetricsPanel<Row>({ aggregations, api, onEditMetric, onEditDashboard, fields, renderers, emptyMessage, classNames, theme, locale, onInspect, }: MetricsPanelProps<Row>): ReactNode;
220
302
  interface MetricCardProps<Row> {
303
+ /** Sparse cover axes and dense labelled box rows sharing one scale and observed extremes. */
304
+ compact?: boolean | undefined;
221
305
  onEdit?: (() => void) | undefined;
222
306
  clause: RenderingClause;
223
307
  buckets?: MetricBucket[] | undefined;
@@ -231,10 +315,84 @@ interface MetricCardProps<Row> {
231
315
  classNames?: MetricClassNames | undefined;
232
316
  onInspect?: ((bucket: MetricBucket, clause: RenderingClause) => void) | undefined;
233
317
  }
234
- declare function MetricCard<Row>({ clause, buckets: explicitBuckets, onEdit, result, fields, loading, renderers, theme, locale, className, classNames, onInspect, }: MetricCardProps<Row>): ReactNode;
318
+ declare function MetricCard<Row>({ compact, clause, buckets: explicitBuckets, onEdit, result, fields, loading, renderers, theme, locale, className, classNames, onInspect, }: MetricCardProps<Row>): ReactNode;
319
+
320
+ type OverlayAnchor = HTMLElement | {
321
+ x: number;
322
+ y: number;
323
+ };
324
+ interface FloatingOverlayOptions {
325
+ anchor: OverlayAnchor;
326
+ onClose: () => void;
327
+ returnFocus?: HTMLElement | null | undefined;
328
+ width?: number | undefined;
329
+ placement?: Placement | undefined;
330
+ nodeId?: string | undefined;
331
+ }
332
+
333
+ /** A trigger element, or viewport coordinates for a context menu. */
334
+ type MenuAnchor = OverlayAnchor;
335
+ interface MenuProps {
336
+ label: string;
337
+ anchor: MenuAnchor;
338
+ onClose: () => void;
339
+ children: ReactNode;
340
+ width?: number;
341
+ initialFocus?: "first" | "last";
342
+ classNames?: MenuClassNames | undefined;
343
+ /** Focus destination after selection or Escape (defaults to the trigger/current focus). */
344
+ returnFocus?: HTMLElement | null | undefined;
345
+ }
346
+ /** Mounted while open. Desktop menus escape clipping; phones use the shared sheet. */
347
+ declare function Menu(props: MenuProps): ReactNode;
348
+ interface MenuItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick" | "onSelect"> {
349
+ onSelect?: (() => void) | undefined;
350
+ closeOnSelect?: boolean;
351
+ checked?: boolean | undefined;
352
+ selectionType?: "checkbox" | "radio";
353
+ icon?: ReactNode;
354
+ shortcut?: string;
355
+ tone?: "default" | "danger";
356
+ /** Typeahead label for rich content (defaults to visible text). */
357
+ textValue?: string;
358
+ }
359
+ declare const MenuItem: react.ForwardRefExoticComponent<MenuItemProps & react.RefAttributes<HTMLButtonElement>>;
360
+ interface MenuSubmenuProps {
361
+ label: string;
362
+ children: ReactNode;
363
+ disabled?: boolean;
364
+ width?: number;
365
+ }
366
+ declare function MenuSubmenu({ label, children, disabled, width }: MenuSubmenuProps): ReactNode;
367
+ declare function MenuSeparator(): ReactNode;
368
+ interface MenuGroupProps {
369
+ label: string;
370
+ children: ReactNode;
371
+ className?: string;
372
+ /** Column count for paired action grids; arrows follow rows and columns. */
373
+ columns?: number;
374
+ }
375
+ interface MenuButtonProps extends Omit<MenuProps, "anchor" | "onClose" | "returnFocus" | "initialFocus"> {
376
+ trigger: ReactNode;
377
+ buttonProps?: Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick" | "onKeyDown" | "children" | "type">;
378
+ }
379
+ /** Uncontrolled action trigger, including ArrowUp/Down opening and focus return. */
380
+ declare function MenuButton({ trigger, buttonProps, ...menuProps }: MenuButtonProps): ReactNode;
381
+ declare function MenuGroup({ label, children, className, columns }: MenuGroupProps): ReactNode;
235
382
 
236
383
  interface FieldPickerProps<Row> {
384
+ /** Optional next-step content, sharing the same anchored header and Back/Close controls. */
385
+ children?: ReactNode;
386
+ title?: string;
387
+ onBack?: () => void;
388
+ searchValue?: string;
389
+ onSearchChange?: (value: string) => void;
390
+ description?: string;
237
391
  fields: FieldDef<Row>[];
392
+ /** Optional field content; the picker retains search, focus, and selection. */
393
+ renderField?: (field: FieldDef<Row>) => ReactNode;
394
+ /** With onClose, supply a trigger (or wrap in PickerAnchor) for a floating picker; otherwise inline on desktop. */
395
+ anchor?: MenuAnchor | undefined;
238
396
  /** Already-shown field names, so the picker can mark/hide them. */
239
397
  excluded?: string[];
240
398
  /** Stats keyed by field name (optional). */
@@ -242,9 +400,10 @@ interface FieldPickerProps<Row> {
242
400
  /** When true, dim/disable fields with ≤1 distinct value ("gate on distinct"). */
243
401
  gateOnDistinct?: boolean;
244
402
  onPick: (field: FieldDef<Row>) => void;
403
+ /** Enables a dismissible overlay on mobile. Omit to stay inline at every viewport size. */
245
404
  onClose?: () => void;
246
405
  }
247
- declare function FieldPicker<Row>({ fields, excluded, stats, gateOnDistinct, onPick, onClose, }: FieldPickerProps<Row>): ReactNode;
406
+ declare function FieldPicker<Row>({ children, fields, renderField, anchor, excluded, stats, gateOnDistinct, onPick, onClose, title, description, onBack, searchValue, onSearchChange, }: FieldPickerProps<Row>): ReactNode;
248
407
 
249
408
  interface CellMenuProps<Row> {
250
409
  field: FieldDef<Row>;
@@ -255,8 +414,9 @@ interface CellMenuProps<Row> {
255
414
  onAddFilter: (clause: WhereClause) => void;
256
415
  onClose: () => void;
257
416
  classNames?: MenuClassNames;
417
+ returnFocus?: HTMLElement | null | undefined;
258
418
  }
259
- declare function CellMenu<Row>({ field, value, x, y, onAddFilter, onClose, classNames }: CellMenuProps<Row>): ReactNode;
419
+ declare function CellMenu<Row>({ field, value, x, y, onAddFilter, onClose, classNames, returnFocus }: CellMenuProps<Row>): ReactNode;
260
420
 
261
421
  interface SelectionToolbarProps {
262
422
  selection: SelectionApi;
@@ -279,8 +439,12 @@ declare function SavedQueriesModal({ saved, onClose, onLoad }: SavedQueriesModal
279
439
  interface SelectColumnEditorProps<Row> {
280
440
  api: QueryTableApi<Row>;
281
441
  onClose: () => void;
442
+ /** Jump directly to this column's settings when opening the editor. */
443
+ initialField?: string;
444
+ /** Context for the result fields being selected, e.g. a grouped-row schema. */
445
+ notice?: ReactNode;
282
446
  }
283
- declare function SelectColumnEditor<Row>({ api, onClose, }: SelectColumnEditorProps<Row>): react_jsx_runtime.JSX.Element;
447
+ declare function SelectColumnEditor<Row>({ api, onClose, initialField, notice: contextNotice, }: SelectColumnEditorProps<Row>): react_jsx_runtime.JSX.Element;
284
448
 
285
449
  /** Consumer-owned presentation; canonical values remain in queries and URLs. */
286
450
  interface FilterValuePresentation {
@@ -327,4 +491,248 @@ interface RequestActivityProps {
327
491
  }
328
492
  declare function RequestActivity({ activity, children, id, }: RequestActivityProps): react_jsx_runtime.JSX.Element;
329
493
 
330
- export { type CellContext, CellMenu, type CellMenuProps, type CellRenderer, DataTable, type DataTableProps, FieldPicker, type FieldPickerProps, type FilterValuePresentation, FilterValueProvider, Icon, type IconName, type IconProps, type MenuClassNames, MetricCard, type MetricCardProps, type MetricClassNames, type MetricTheme, MetricsEditor, type MetricsEditorProps, MetricsPanel, type MetricsPanelProps, PresentedFilterValue, QueryBuilder, type QueryBuilderClassNames, type QueryBuilderProps, type RenderRegistry, RequestActivity, type RequestActivityProps, SavedQueriesModal, type SavedQueriesModalProps, SelectColumnEditor, type SelectColumnEditorProps, SelectionToolbar, type SelectionToolbarProps, type TableClassNames, createMetricColorResolver, defaultRenderers, formatMetricOutput, metricTimestamp, resolveRenderer, safeLinkHref, validateMetricFormat };
494
+ interface ObjectPropertiesProps<Row> {
495
+ schema: FieldSchema<Row>;
496
+ row: Row;
497
+ view: PropertyViewState;
498
+ onViewChange?: (view: PropertyViewState) => void;
499
+ renderers?: RenderRegistry<Row>;
500
+ relationships?: RelationshipAdapter;
501
+ onOpenReference?: (reference: ObjectReference) => void;
502
+ /** Explicit projection coverage distinguishes unloaded fields from NULL values. */
503
+ loadedFields?: readonly string[];
504
+ locale?: string;
505
+ theme?: MetricTheme;
506
+ now?: number;
507
+ className?: string;
508
+ }
509
+ declare function formatPropertyValue(value: unknown, format: PropertyFormat, locale?: string, now?: number): {
510
+ text: string;
511
+ error?: string;
512
+ };
513
+ declare function ObjectProperties<Row>(props: ObjectPropertiesProps<Row>): ReactNode;
514
+
515
+ declare function PropertyViewEditor<Row>({ schema, view, onApply, onClose, preview, scope, }: {
516
+ preview?: Omit<ObjectPropertiesProps<Row>, "view">;
517
+ scope?: string;
518
+ schema: FieldSchema<Row>;
519
+ view: PropertyViewState;
520
+ onApply: (view: PropertyViewState) => void;
521
+ onClose: () => void;
522
+ }): ReactNode;
523
+ declare function PropertyViewControls<Row>({ api, schema, preview, scope, shareAction, onClose, closeLabel, compact, }: {
524
+ onClose?: () => void;
525
+ closeLabel?: string;
526
+ compact?: boolean;
527
+ shareAction?: ReactNode;
528
+ preview?: Omit<ObjectPropertiesProps<Row>, "view">;
529
+ scope?: string;
530
+ api: PropertyViewApi;
531
+ schema: FieldSchema<Row>;
532
+ }): ReactNode;
533
+
534
+ interface ObjectInspectorProps<Row> extends Omit<ObjectPropertiesProps<Row>, "view"> {
535
+ storage?: PropertyViewStorage;
536
+ initialView?: PropertyViewState;
537
+ objectType?: string;
538
+ /** Accessible identity; surrounding page/modal owns visible item headings. */
539
+ typeLabel?: string;
540
+ title?: ReactNode;
541
+ subtitle?: ReactNode;
542
+ /** Share one controller across table details and standalone cards. */
543
+ propertyApi?: PropertyViewApi;
544
+ /** Names the edited modality in the properties editor's context strip. */
545
+ viewScope?: string;
546
+ /** Host-owned share URL, including identity and the supplied property snapshot. */
547
+ shareUrl?: (view: PropertyViewState) => string;
548
+ shareAction?: ReactNode;
549
+ /** Show a close control beside the view history when this card is a dialog. */
550
+ onClose?: () => void;
551
+ closeLabel?: string;
552
+ /** Icon controls for a compact surface such as a popover. */
553
+ compact?: boolean;
554
+ }
555
+ /** Opinionated read-only item card, starting with the same state bar as the builder. */
556
+ declare function ObjectInspector<Row>(props: ObjectInspectorProps<Row>): ReactNode;
557
+
558
+ /** Snapshot the item and collection state, even when URL synchronization is off.
559
+ * A popover is shared as a modal with that popover's current appearance. */
560
+ declare function itemDetailHref<Row>(api: ItemDetailsApi<Row>, query: QueryState, id: RowId, mode?: ItemPropertyMode): string;
561
+ declare function ItemDetailShare<Row>({ api, query, id, mode, compact }: {
562
+ api: ItemDetailsApi<Row>;
563
+ query: QueryState;
564
+ id: RowId;
565
+ mode?: ItemPropertyMode;
566
+ compact?: boolean;
567
+ }): ReactNode;
568
+
569
+ interface PopoverProps extends Omit<FloatingOverlayOptions, "nodeId"> {
570
+ label: string;
571
+ children: ReactNode;
572
+ className?: string;
573
+ /** Desktop focus selector, scoped to this surface (defaults to its first control). */
574
+ initialFocus?: string;
575
+ }
576
+ /** A form or searchable picker sharing menus' floating and mobile surface. */
577
+ declare function Popover({ label, children, className, initialFocus, ...options }: PopoverProps): react_jsx_runtime.JSX.Element;
578
+
579
+ /** Keeps a button and its chooser together without inserting an input into the query. */
580
+ declare function PickerAnchor({ children }: {
581
+ children: ReactNode;
582
+ }): react_jsx_runtime.JSX.Element;
583
+ declare function PickerSurface({ title, children, onClose, mobileChrome, }: {
584
+ title: string;
585
+ children: ReactNode;
586
+ onClose: () => void;
587
+ /** Editors with their own Apply/Cancel header can keep that chrome on mobile. */
588
+ mobileChrome?: boolean;
589
+ }): react_jsx_runtime.JSX.Element;
590
+
591
+ /** Shared chrome for query-local metric and column workbenches. */
592
+ declare function EditorContext({ shown, total, filters, noun, locale, children, }: {
593
+ shown: number;
594
+ total: number | null;
595
+ filters: number;
596
+ noun?: string;
597
+ locale?: string | undefined;
598
+ children?: ReactNode;
599
+ }): react_jsx_runtime.JSX.Element;
600
+ declare function EditorPaneTitle({ children, actions, }: {
601
+ children: ReactNode;
602
+ actions?: ReactNode;
603
+ }): react_jsx_runtime.JSX.Element;
604
+ declare function EditorChoice({ selected, title, detail, code, onClick, }: {
605
+ selected: boolean;
606
+ title: string;
607
+ detail?: string;
608
+ code?: string;
609
+ onClick: () => void;
610
+ }): react_jsx_runtime.JSX.Element;
611
+
612
+ declare function useMobileLayout(): boolean;
613
+ declare function ModalSurface({ title, onClose, children, className, chrome, returnFocus, backdropClassName, initialFocus, }: {
614
+ title: string;
615
+ onClose: () => void;
616
+ children?: ReactNode;
617
+ className?: string;
618
+ chrome?: boolean;
619
+ returnFocus?: HTMLElement | null | undefined;
620
+ backdropClassName?: string | undefined;
621
+ initialFocus?: string | undefined;
622
+ }): ReactNode;
623
+
624
+ interface ReorderItem {
625
+ id: string;
626
+ label: string;
627
+ }
628
+ declare function ReorderList({ items, onMove, disabled, className, renderItem, showHint, layout, itemStyle, itemClassName, }: {
629
+ items: ReorderItem[];
630
+ onMove: (id: string, position: number) => void;
631
+ disabled?: boolean | undefined;
632
+ className?: string;
633
+ renderItem?: (item: ReorderItem, position: number) => ReactNode;
634
+ showHint?: boolean;
635
+ layout?: "vertical" | "wrap";
636
+ itemStyle?: (item: ReorderItem, position: number) => CSSProperties;
637
+ itemClassName?: (item: ReorderItem, position: number) => string;
638
+ }): ReactNode;
639
+
640
+ interface EditorPaneSize {
641
+ width: number;
642
+ minWidth: number;
643
+ /** Initial/reset visibility. Updated defaults take effect on the next reset. */
644
+ defaultVisible?: boolean;
645
+ }
646
+ declare function useEditorWorkbench(panes: readonly EditorPaneSize[], isEditor?: boolean): {
647
+ root: react.MutableRefObject<HTMLDivElement | null>;
648
+ header: react.MutableRefObject<HTMLElement | null>;
649
+ widths: number[];
650
+ minWidths: number[];
651
+ visiblePanes: boolean[];
652
+ visibleIndices: number[];
653
+ nextPane: (index: number) => number | undefined;
654
+ togglePane: (index: number) => void;
655
+ showPane: (index: number) => void;
656
+ hidePane: (index: number) => void;
657
+ startResize: (event: PointerEvent<HTMLElement>, index: number) => void;
658
+ resetPanes: () => void;
659
+ stepResize: (index: number, delta: number) => void;
660
+ reset: () => void;
661
+ };
662
+
663
+ type EditorWorkbench = ReturnType<typeof useEditorWorkbench>;
664
+ /** Shared shell for transactional editors. Panel geometry never changes query state. */
665
+ declare function EditorModal({ title, titleId, closeLabel, onClose, workbench, headerActions, panelControls, children, className, }: {
666
+ title: string;
667
+ titleId?: string;
668
+ closeLabel?: string;
669
+ onClose: () => void;
670
+ workbench: EditorWorkbench;
671
+ headerActions?: ReactNode;
672
+ panelControls?: ReactNode;
673
+ children: ReactNode;
674
+ className?: string;
675
+ }): react_jsx_runtime.JSX.Element;
676
+ declare function EditorPanelToggle({ workbench, index, label, icon, paneId, collapse, }: {
677
+ workbench: EditorWorkbench;
678
+ index: number;
679
+ label: string;
680
+ icon: IconName;
681
+ paneId: string;
682
+ collapse?: boolean;
683
+ }): react_jsx_runtime.JSX.Element;
684
+ declare function EditorPanelSeparator({ workbench, index, label, controls, }: {
685
+ workbench: EditorWorkbench;
686
+ index: number;
687
+ label: string;
688
+ controls: string;
689
+ }): react_jsx_runtime.JSX.Element | null;
690
+
691
+ interface FormulaEditorActions {
692
+ insertFunction: (name: string) => void;
693
+ }
694
+ interface FormulaEditorProps {
695
+ actionsRef?: Ref<FormulaEditorActions>;
696
+ functions?: readonly FormulaFunction[];
697
+ value: string;
698
+ onChange: (value: string) => void;
699
+ fields: FieldDef[];
700
+ compile: (value: string) => unknown;
701
+ /** Metric authoring uses a separate reference pane and no suggestions. */
702
+ suggestions?: boolean;
703
+ showLibrary?: boolean;
704
+ rows?: number;
705
+ ariaLabel?: string;
706
+ inputRef?: MutableRefObject<HTMLTextAreaElement | null>;
707
+ onFocus?: () => void;
708
+ onReady?: (input: HTMLTextAreaElement) => void;
709
+ }
710
+ declare function FormulaEditor({ value, actionsRef, functions, onChange, fields, compile, suggestions, showLibrary, ariaLabel, inputRef, onFocus, onReady, rows, }: FormulaEditorProps): react_jsx_runtime.JSX.Element;
711
+
712
+ declare function FormulaFunctionBrowser({ onInsert, functions, variant, }: {
713
+ onInsert?: (name: string) => void;
714
+ functions?: readonly FormulaFunction[];
715
+ variant?: "card" | "panel";
716
+ }): react_jsx_runtime.JSX.Element;
717
+
718
+ /** Presentation metadata supplied by the host, independent of field type. */
719
+ interface ColumnRole {
720
+ kind: "row" | "key" | "aggregate";
721
+ badge: string;
722
+ title: string;
723
+ }
724
+ /** Role colors inherit the instance's --qt-column-{role}-* CSS tokens. */
725
+ declare function ColumnRoleBadge({ role, className, }: {
726
+ role: ColumnRole | undefined;
727
+ className?: string;
728
+ }): react_jsx_runtime.JSX.Element | null;
729
+
730
+ type Controller = GroupingApi<GroupedRow>;
731
+ declare function GroupedColumnsEditor({ controller, onClose, renderers, initialFormulaField, }: {
732
+ initialFormulaField?: string;
733
+ controller: Controller;
734
+ onClose: () => void;
735
+ renderers?: RenderRegistry<GroupedRow>;
736
+ }): react_jsx_runtime.JSX.Element;
737
+
738
+ export { type CellContext, CellMenu, type CellMenuProps, type CellRenderer, type ColumnRole, ColumnRoleBadge, DataTable, type DataTableProps, EditorChoice, EditorContext, EditorModal, type EditorPaneSize, EditorPaneTitle, EditorPanelSeparator, EditorPanelToggle, type EditorWorkbench, FieldPicker, type FieldPickerProps, type FilterValuePresentation, FilterValueProvider, FormulaEditor, type FormulaEditorActions, type FormulaEditorProps, FormulaFunctionBrowser, GroupedColumnsEditor, Icon, type IconName, type IconProps, ItemDetailShare, JsonCell, type JsonCellProps, type JsonEntry, type JsonInspection, JsonValueView, Menu, type MenuAnchor, MenuButton, type MenuButtonProps, type MenuClassNames, MenuGroup, type MenuGroupProps, MenuItem, type MenuItemProps, type MenuProps, MenuSeparator, MenuSubmenu, type MenuSubmenuProps, MetricCard, type MetricCardProps, type MetricClassNames, type MetricTheme, MetricsEditor, type MetricsEditorProps, MetricsPanel, type MetricsPanelProps, ModalSurface, ObjectInspector, type ObjectInspectorProps, ObjectProperties, type ObjectPropertiesProps, PickerAnchor, PickerSurface, Popover, type PopoverProps, PresentedFilterValue, PropertyViewControls, PropertyViewEditor, QueryBuilder, type QueryBuilderClassNames, type QueryBuilderProps, QueryFilterRow, type RenderRegistry, ReorderList, RequestActivity, type RequestActivityProps, SavedQueriesModal, type SavedQueriesModalProps, SelectColumnEditor, type SelectColumnEditorProps, type SelectPresentation, SelectionToolbar, type SelectionToolbarProps, type TableClassNames, createMetricColorResolver, defaultRenderers, formatMetricOutput, formatPropertyValue, inspectJsonValue, itemDetailHref, metricTimestamp, resolveRenderer, safeLinkHref, searchJsonEntries, useEditorWorkbench, useMobileLayout, validateMetricFormat };