@pythia-software/query-table-ui 0.5.0 → 0.7.0

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, FieldStats, WhereClause } 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 } 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,21 @@ 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;
35
+ panelList: react_jsx_runtime.JSX.Element;
36
+ panelDefinition: react_jsx_runtime.JSX.Element;
37
+ panelReference: react_jsx_runtime.JSX.Element;
38
+ panelPreview: react_jsx_runtime.JSX.Element;
39
+ dashboard: react_jsx_runtime.JSX.Element;
40
+ resize: react_jsx_runtime.JSX.Element;
41
+ alert: react_jsx_runtime.JSX.Element;
28
42
  add: react_jsx_runtime.JSX.Element;
29
43
  close: react_jsx_runtime.JSX.Element;
30
44
  check: react_jsx_runtime.JSX.Element;
@@ -34,6 +48,9 @@ declare const artwork: {
34
48
  arrowDown: react_jsx_runtime.JSX.Element;
35
49
  arrowLeft: react_jsx_runtime.JSX.Element;
36
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;
37
54
  grip: react_jsx_runtime.JSX.Element;
38
55
  pencil: react_jsx_runtime.JSX.Element;
39
56
  star: react_jsx_runtime.JSX.Element;
@@ -42,6 +59,7 @@ declare const artwork: {
42
59
  copy: react_jsx_runtime.JSX.Element;
43
60
  share: react_jsx_runtime.JSX.Element;
44
61
  refresh: react_jsx_runtime.JSX.Element;
62
+ stopwatch: react_jsx_runtime.JSX.Element;
45
63
  clock: react_jsx_runtime.JSX.Element;
46
64
  reset: react_jsx_runtime.JSX.Element;
47
65
  bookmark: react_jsx_runtime.JSX.Element;
@@ -55,6 +73,42 @@ interface IconProps {
55
73
  }
56
74
  declare function Icon({ name, size, className, filled }: IconProps): react_jsx_runtime.JSX.Element;
57
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
+
58
112
  interface TableClassNames {
59
113
  wrap?: string;
60
114
  table?: string;
@@ -88,11 +142,16 @@ interface QueryBuilderClassNames {
88
142
  }
89
143
  interface MenuClassNames {
90
144
  popover?: string;
145
+ submenu?: string;
91
146
  item?: string;
92
147
  separator?: string;
93
148
  }
94
149
 
95
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>;
96
155
  /** Ordered visible fields (widths already resolved), from `api.visibleFields`. */
97
156
  fields: FieldDef<Row>[];
98
157
  rows: Row[];
@@ -111,6 +170,8 @@ interface DataTableProps<Row> {
111
170
  /** Always-visible trailing column (row actions, links). */
112
171
  trailing?: (row: Row) => ReactNode;
113
172
  trailingLabel?: string;
173
+ /** Optional compact role badge before the column label. */
174
+ headerAdornment?: ((field: FieldDef<Row>) => ReactNode) | undefined;
114
175
  /** Total matching rows before pagination, when known. */
115
176
  total?: number | null;
116
177
  loading?: boolean;
@@ -126,7 +187,64 @@ interface DataTableProps<Row> {
126
187
  }
127
188
  declare function DataTable<Row>(props: DataTableProps<Row>): ReactNode;
128
189
 
190
+ /** Core owns computation and serialized presentation types. These aliases keep rendering imports focused. */
191
+
192
+ type MetricBucket = AggregationBucket;
193
+ type RenderingClause = AggregationClause;
194
+ /** Optional exact remainder for transports that truncate additive groups. */
195
+ type MetricRenderResult = Pick<AggregationResultEntry, "buckets" | "error" | "groupCount" | "coverage" | "scope" | "processedRows"> & {
196
+ other?: AggregationBucket;
197
+ };
198
+
199
+ type MetricToken = "accent" | "text" | "muted" | "grid" | "surface" | "other" | "null" | "error";
200
+ interface MetricTheme {
201
+ layers?: ReadonlyArray<{
202
+ id: string;
203
+ colors: ReadonlyArray<string>;
204
+ }>;
205
+ dimensions?: Readonly<Record<string, {
206
+ layer: string;
207
+ domain?: ReadonlyArray<MetricValue>;
208
+ overrides?: ReadonlyArray<{
209
+ value: MetricValue;
210
+ color: string;
211
+ }>;
212
+ identity?: string;
213
+ }>>;
214
+ tokens?: Partial<Record<MetricToken, string>>;
215
+ }
216
+ interface MetricClassNames {
217
+ root?: string;
218
+ metric?: string;
219
+ title?: string;
220
+ plot?: string;
221
+ axis?: string;
222
+ grid?: string;
223
+ legend?: string;
224
+ mark?: string;
225
+ }
226
+ declare function createMetricColorResolver(theme?: MetricTheme): {
227
+ token: (name: MetricToken) => string;
228
+ color(field: string, value: MetricValue): string;
229
+ };
230
+
129
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;
246
+ /** Additional diagnostics shown inside request activity. */
247
+ requestActivityDetails?: ReactNode;
130
248
  /** The controller; QueryBuilder drives it through the intent helpers. */
131
249
  api: QueryTableApi<Row>;
132
250
  /** All schema fields (for the field picker / sort picker). */
@@ -142,10 +260,31 @@ interface QueryBuilderProps<Row> {
142
260
  onCollapsedChange?: (collapsed: boolean) => void;
143
261
  /** Initial collapse state for uncontrolled mode. */
144
262
  defaultCollapsed?: boolean;
263
+ metricTheme?: MetricTheme;
264
+ metricLocale?: string;
265
+ }
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;
145
274
  }
146
- declare function QueryBuilder<Row>({ api, fields, total, running, classNames, collapsed, onCollapsedChange, defaultCollapsed, }: QueryBuilderProps<Row>): ReactNode;
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;
147
282
 
148
283
  interface MetricsPanelProps<Row> {
284
+ /** Enables quick editing using the transactional metrics editor. */
285
+ api?: QueryTableApi<Row>;
286
+ onEditMetric?: (id: string) => void;
287
+ onEditDashboard?: () => void;
149
288
  /** The aggregation API from useQueryTable (clauses + results + status). */
150
289
  aggregations: AggregationsApi;
151
290
  /** All schema fields, to resolve labels + the measure field's renderer. */
@@ -154,15 +293,106 @@ interface MetricsPanelProps<Row> {
154
293
  renderers?: RenderRegistry<Row>;
155
294
  /** Hidden entirely when there are no metrics unless this is set. */
156
295
  emptyMessage?: string;
157
- classNames?: {
158
- root?: string;
159
- metric?: string;
160
- };
296
+ classNames?: MetricClassNames;
297
+ theme?: MetricTheme;
298
+ locale?: string;
299
+ onInspect?: (bucket: MetricBucket, clause: RenderingClause) => void;
300
+ }
301
+ declare function MetricsPanel<Row>({ aggregations, api, onEditMetric, onEditDashboard, fields, renderers, emptyMessage, classNames, theme, locale, onInspect, }: MetricsPanelProps<Row>): ReactNode;
302
+ interface MetricCardProps<Row> {
303
+ /** Sparse cover axes and labelled box rows with independent whisker scales. */
304
+ compact?: boolean | undefined;
305
+ onEdit?: (() => void) | undefined;
306
+ clause: RenderingClause;
307
+ buckets?: MetricBucket[] | undefined;
308
+ result?: MetricRenderResult | undefined;
309
+ fields: FieldDef<Row>[];
310
+ loading?: boolean | undefined;
311
+ renderers?: RenderRegistry<Row> | undefined;
312
+ theme?: MetricTheme | undefined;
313
+ locale?: string | undefined;
314
+ className?: string | undefined;
315
+ classNames?: MetricClassNames | undefined;
316
+ onInspect?: ((bucket: MetricBucket, clause: RenderingClause) => void) | undefined;
161
317
  }
162
- declare function MetricsPanel<Row>({ aggregations, fields, renderers, emptyMessage, classNames, }: MetricsPanelProps<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;
163
382
 
164
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;
165
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;
166
396
  /** Already-shown field names, so the picker can mark/hide them. */
167
397
  excluded?: string[];
168
398
  /** Stats keyed by field name (optional). */
@@ -170,9 +400,10 @@ interface FieldPickerProps<Row> {
170
400
  /** When true, dim/disable fields with ≤1 distinct value ("gate on distinct"). */
171
401
  gateOnDistinct?: boolean;
172
402
  onPick: (field: FieldDef<Row>) => void;
403
+ /** Enables a dismissible overlay on mobile. Omit to stay inline at every viewport size. */
173
404
  onClose?: () => void;
174
405
  }
175
- 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;
176
407
 
177
408
  interface CellMenuProps<Row> {
178
409
  field: FieldDef<Row>;
@@ -183,8 +414,9 @@ interface CellMenuProps<Row> {
183
414
  onAddFilter: (clause: WhereClause) => void;
184
415
  onClose: () => void;
185
416
  classNames?: MenuClassNames;
417
+ returnFocus?: HTMLElement | null | undefined;
186
418
  }
187
- 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;
188
420
 
189
421
  interface SelectionToolbarProps {
190
422
  selection: SelectionApi;
@@ -207,8 +439,12 @@ declare function SavedQueriesModal({ saved, onClose, onLoad }: SavedQueriesModal
207
439
  interface SelectColumnEditorProps<Row> {
208
440
  api: QueryTableApi<Row>;
209
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;
210
446
  }
211
- 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;
212
448
 
213
449
  /** Consumer-owned presentation; canonical values remain in queries and URLs. */
214
450
  interface FilterValuePresentation {
@@ -222,4 +458,281 @@ declare function PresentedFilterValue({ field, value, label }: {
222
458
  label?: string;
223
459
  }): react_jsx_runtime.JSX.Element;
224
460
 
225
- export { type CellContext, CellMenu, type CellMenuProps, type CellRenderer, DataTable, type DataTableProps, FieldPicker, type FieldPickerProps, type FilterValuePresentation, FilterValueProvider, Icon, type IconName, type IconProps, type MenuClassNames, MetricsPanel, type MetricsPanelProps, PresentedFilterValue, QueryBuilder, type QueryBuilderClassNames, type QueryBuilderProps, type RenderRegistry, SavedQueriesModal, type SavedQueriesModalProps, SelectColumnEditor, type SelectColumnEditorProps, SelectionToolbar, type SelectionToolbarProps, type TableClassNames, defaultRenderers, resolveRenderer, safeLinkHref };
461
+ interface MetricsEditorProps<Row> {
462
+ api: QueryTableApi<Row>;
463
+ fields: FieldDef<Row>[];
464
+ onClose: () => void;
465
+ initialMetricId?: string;
466
+ initialView?: "editor" | "dashboard";
467
+ theme?: MetricTheme;
468
+ locale?: string;
469
+ }
470
+ /** Transactional query-local authoring; previews never mutate the table query. */
471
+ declare function MetricsEditor<Row>({ api, fields, onClose, initialMetricId, initialView, theme, locale, }: MetricsEditorProps<Row>): ReactNode;
472
+
473
+ interface MetricFormattedValue {
474
+ text: string;
475
+ error?: string;
476
+ raw: MetricValue | undefined;
477
+ }
478
+ declare function validateMetricFormat(format: MetricValueFormat): string | undefined;
479
+ /** Strict coordinate parser shared by calendar formatting and chronological charts. */
480
+ declare function metricTimestamp(value: MetricValue, format?: MetricValueFormat): {
481
+ date: Date;
482
+ timeZone: string | undefined;
483
+ };
484
+ declare function formatMetricOutput(value: MetricValue | undefined, format?: MetricValueFormat, locale?: string): MetricFormattedValue;
485
+
486
+ interface RequestActivityProps {
487
+ activity: RequestActivityApi;
488
+ /** Optional host diagnostics, e.g. database and network timings. */
489
+ children?: ReactNode;
490
+ id?: string;
491
+ }
492
+ declare function RequestActivity({ activity, children, id, }: RequestActivityProps): react_jsx_runtime.JSX.Element;
493
+
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 };