@pythia-software/query-table-ui 0.9.6 → 0.9.8
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/README.md +9 -2
- package/dist/index.d.ts +46 -16
- package/dist/index.js +1957 -1285
- package/dist/index.js.map +1 -1
- package/dist/theme.css +24 -0
- package/dist/theme.css.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -115,7 +115,11 @@ Open **Column Widths** to resize in one step:
|
|
|
115
115
|
- **Fit All to Screen** fills the viewport; when content overflows, narrow
|
|
116
116
|
columns keep their content width and only the widest ones are trimmed. It
|
|
117
117
|
sets `query.fitToScreen`, so shared links and saved queries fit each viewer's
|
|
118
|
-
available table area after loading and when that area changes.
|
|
118
|
+
available table area after loading and when that area changes. No column
|
|
119
|
+
is trimmed below what its buttons and links need (links shorten to an
|
|
120
|
+
ellipsis first); if those minimums exceed the screen, the table scrolls
|
|
121
|
+
horizontally. Set `select.minWidth` on a field whose host renderer needs
|
|
122
|
+
room the table cannot measure.
|
|
119
123
|
- **Equal Widths** splits the viewport evenly.
|
|
120
124
|
- **Reset Widths** drops explicit widths back to schema defaults.
|
|
121
125
|
|
|
@@ -570,7 +574,7 @@ and original/decoded copying; objects, JSON strings and escaped strings share
|
|
|
570
574
|
the same inspector. Custom `render` functions and registered keys take precedence.
|
|
571
575
|
Detail properties inherit these displays and embed initially collapsed JSON
|
|
572
576
|
trees in popovers, modals, and expanded rows. A button beside the property label
|
|
573
|
-
opens the full viewer with
|
|
577
|
+
opens the full viewer with Filter/Find search, match navigation, and copy
|
|
574
578
|
controls. JSON property options can be edited, saved, and shared through the
|
|
575
579
|
existing property-view controls.
|
|
576
580
|
See the [cell display guide](../../docs/cell-displays.md) for typed configuration,
|
|
@@ -649,3 +653,6 @@ Hiding a pie remainder retains the full denominator and leaves its angular
|
|
|
649
653
|
share empty; it does not rescale the selected groups to 100%. A real group named
|
|
650
654
|
Other remains visible. Both settings survive query links and saved views.
|
|
651
655
|
Use `display.legendPosition: "none"` to hide the chart key.
|
|
656
|
+
|
|
657
|
+
JSON inspection choices now travel with item query links and snapshots. See
|
|
658
|
+
[portable inspection state and semantic attention](../../docs/json-inspection-state.md).
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, SetStateAction, CSSProperties, ButtonHTMLAttributes, PointerEvent, Ref, MutableRefObject } from 'react';
|
|
3
|
-
import { FieldDef, QueryState, LinkTargets, CellDisplay, 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';
|
|
3
|
+
import { FieldDef, QueryState, LinkTargets, CellDisplay, JsonCellDisplay, JsonInspectionState, JsonInspectionScope, AttentionRegistry, RowId, AggregationClause, AggregationBucket, AggregationResultEntry, MetricValue, SavedQuery, FieldStats, WhereClause, MetricValueFormat, FieldSchema, ScopedJsonInspectionState, PropertyViewState, RelationshipAdapter, ObjectReference, PropertyFormat, PropertyViewStorage, ItemPropertyMode, FormulaFunction, GroupedRow } from '@pythia-software/query-table-core';
|
|
4
4
|
import { ItemDetailsApi, SelectionApi, ColumnDragApi, QueryTableApi, QueryFilterApi, AggregationsApi, SavedQueriesApi, RequestActivityApi, PropertyViewApi, GroupingApi } from '@pythia-software/query-table-react';
|
|
5
5
|
import { Placement } from '@floating-ui/react';
|
|
6
6
|
|
|
@@ -85,18 +85,6 @@ interface IconProps {
|
|
|
85
85
|
}
|
|
86
86
|
declare function Icon({ name, size, className, filled }: IconProps): react.JSX.Element;
|
|
87
87
|
|
|
88
|
-
interface JsonCellProps {
|
|
89
|
-
value: unknown;
|
|
90
|
-
label?: string;
|
|
91
|
-
display?: JsonCellDisplay | undefined;
|
|
92
|
-
}
|
|
93
|
-
/** Compact cell plus a shared searchable inspector. Mountable outside DataTable. */
|
|
94
|
-
declare function JsonCell({ value, label, display }: JsonCellProps): ReactNode;
|
|
95
|
-
/** The same searchable JSON value embedded in item details, pages or host cards. */
|
|
96
|
-
declare function JsonValueView({ value, label, display, compact }: JsonCellProps & {
|
|
97
|
-
compact?: boolean;
|
|
98
|
-
}): ReactNode;
|
|
99
|
-
|
|
100
88
|
interface JsonEntry {
|
|
101
89
|
/** Unambiguous JSONPath; bracket notation preserves dots/quotes in keys. */
|
|
102
90
|
path: string;
|
|
@@ -121,6 +109,30 @@ declare function inspectJsonValue(input: unknown, display?: JsonCellDisplay, inc
|
|
|
121
109
|
/** Search keys, full paths and typed values; case insensitive, literal matching. */
|
|
122
110
|
declare function searchJsonEntries(entries: JsonEntry[], search: string): JsonEntry[];
|
|
123
111
|
|
|
112
|
+
interface JsonInspectionResolution {
|
|
113
|
+
status: "ready" | "unavailable";
|
|
114
|
+
missingPaths: string[];
|
|
115
|
+
selectedMatchUnavailable: boolean;
|
|
116
|
+
}
|
|
117
|
+
interface JsonCellProps {
|
|
118
|
+
value: unknown;
|
|
119
|
+
label?: string;
|
|
120
|
+
display?: JsonCellDisplay | undefined;
|
|
121
|
+
/** Controlled portable state. Omit to keep local state. */
|
|
122
|
+
inspectionState?: JsonInspectionState | undefined;
|
|
123
|
+
onInspectionStateChange?: ((state: JsonInspectionState) => void) | undefined;
|
|
124
|
+
inspectionScope?: JsonInspectionScope | undefined;
|
|
125
|
+
attention?: AttentionRegistry | undefined;
|
|
126
|
+
onInspectionResolution?: ((result: JsonInspectionResolution) => void) | undefined;
|
|
127
|
+
}
|
|
128
|
+
/** Compact cell plus a shared searchable inspector. Mountable outside DataTable. */
|
|
129
|
+
declare function JsonCell(props: JsonCellProps): ReactNode;
|
|
130
|
+
declare function createJsonInspectionState(inspection: JsonInspection, display?: JsonCellDisplay, compact?: boolean): JsonInspectionState;
|
|
131
|
+
/** The same searchable JSON value embedded in item details, pages or host cards. */
|
|
132
|
+
declare function JsonValueView(props: JsonCellProps & {
|
|
133
|
+
compact?: boolean;
|
|
134
|
+
}): ReactNode;
|
|
135
|
+
|
|
124
136
|
interface TableClassNames {
|
|
125
137
|
wrap?: string;
|
|
126
138
|
table?: string;
|
|
@@ -246,7 +258,14 @@ interface MetricClassNames {
|
|
|
246
258
|
}
|
|
247
259
|
declare function createMetricColorResolver(theme?: MetricTheme): {
|
|
248
260
|
token: (name: MetricToken) => string;
|
|
249
|
-
color(field: string, value: MetricValue)
|
|
261
|
+
color: (field: string, value: MetricValue) => string;
|
|
262
|
+
/**
|
|
263
|
+
* Colours whole group keys drawn together. Single values resolve as
|
|
264
|
+
* `color`. A tuple's colour depends only on the theme and its values,
|
|
265
|
+
* except that tuples sharing a chart take the next free colour rather
|
|
266
|
+
* than repeat one while the palette has room.
|
|
267
|
+
*/
|
|
268
|
+
tupleColors(fields: readonly string[], tuples: ReadonlyArray<readonly MetricValue[]>): (values: readonly MetricValue[]) => string;
|
|
250
269
|
};
|
|
251
270
|
|
|
252
271
|
interface QueryBuilderProps<Row> {
|
|
@@ -518,6 +537,12 @@ declare function RequestActivity({ activity, children, id, }: RequestActivityPro
|
|
|
518
537
|
|
|
519
538
|
interface ObjectPropertiesProps<Row> {
|
|
520
539
|
schema: FieldSchema<Row>;
|
|
540
|
+
recordId?: RowId;
|
|
541
|
+
jsonInspections?: readonly ScopedJsonInspectionState[];
|
|
542
|
+
onJsonInspectionChange?: (inspection: ScopedJsonInspectionState) => void;
|
|
543
|
+
attention?: AttentionRegistry | undefined;
|
|
544
|
+
/** Preserve focus for inspectors restored by semantic attention. */
|
|
545
|
+
preserveFocus?: boolean | undefined;
|
|
521
546
|
row: Row;
|
|
522
547
|
view: PropertyViewState;
|
|
523
548
|
onViewChange?: (view: PropertyViewState) => void;
|
|
@@ -526,6 +551,9 @@ interface ObjectPropertiesProps<Row> {
|
|
|
526
551
|
onOpenReference?: (reference: ObjectReference) => void;
|
|
527
552
|
/** Explicit projection coverage distinguishes unloaded fields from NULL values. */
|
|
528
553
|
loadedFields?: readonly string[];
|
|
554
|
+
/** The collection query the row came from, passed to renderers; group link
|
|
555
|
+
* summaries resolve their destinations from it. */
|
|
556
|
+
query?: QueryState;
|
|
529
557
|
locale?: string;
|
|
530
558
|
theme?: MetricTheme;
|
|
531
559
|
now?: number;
|
|
@@ -635,7 +663,7 @@ declare function EditorChoice({ selected, title, detail, code, onClick, }: {
|
|
|
635
663
|
}): react.JSX.Element;
|
|
636
664
|
|
|
637
665
|
declare function useMobileLayout(): boolean;
|
|
638
|
-
declare function ModalSurface({ title, onClose, children, className, chrome, returnFocus, backdropClassName, initialFocus, }: {
|
|
666
|
+
declare function ModalSurface({ title, onClose, children, className, chrome, returnFocus, backdropClassName, initialFocus, preserveFocus, }: {
|
|
639
667
|
title: string;
|
|
640
668
|
onClose: () => void;
|
|
641
669
|
children?: ReactNode;
|
|
@@ -644,6 +672,8 @@ declare function ModalSurface({ title, onClose, children, className, chrome, ret
|
|
|
644
672
|
returnFocus?: HTMLElement | null | undefined;
|
|
645
673
|
backdropClassName?: string | undefined;
|
|
646
674
|
initialFocus?: string | undefined;
|
|
675
|
+
/** Semantic attention may reveal a dialog while preserving the caller's focus. */
|
|
676
|
+
preserveFocus?: boolean | undefined;
|
|
647
677
|
}): ReactNode;
|
|
648
678
|
|
|
649
679
|
interface ReorderItem {
|
|
@@ -760,4 +790,4 @@ declare function GroupedColumnsEditor({ controller, onClose, renderers, initialF
|
|
|
760
790
|
renderers?: RenderRegistry<GroupedRow>;
|
|
761
791
|
}): react.JSX.Element;
|
|
762
792
|
|
|
763
|
-
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, type GroupLinkOptions, 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, createGroupLinkRenderer, createMetricColorResolver, defaultRenderers, formatMetricOutput, formatPropertyValue, inspectJsonValue, itemDetailHref, metricTimestamp, resolveRenderer, safeLinkHref, searchJsonEntries, useEditorWorkbench, useMobileLayout, validateMetricFormat };
|
|
793
|
+
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, type GroupLinkOptions, GroupedColumnsEditor, Icon, type IconName, type IconProps, ItemDetailShare, JsonCell, type JsonCellProps, type JsonEntry, type JsonInspection, type JsonInspectionResolution, 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, createGroupLinkRenderer, createJsonInspectionState, createMetricColorResolver, defaultRenderers, formatMetricOutput, formatPropertyValue, inspectJsonValue, itemDetailHref, metricTimestamp, resolveRenderer, safeLinkHref, searchJsonEntries, useEditorWorkbench, useMobileLayout, validateMetricFormat };
|