@altertable/data-app-react 0.76.0 → 0.77.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/chunks/{SectionHeading-DLVTKa91.js → SectionHeading-Bz5RIXit.js} +532 -525
- package/dist/chunks/SectionHeading-Bz5RIXit.js.map +1 -0
- package/dist/index.js +173 -36
- package/dist/index.js.map +1 -1
- package/dist/types/chunks/DateTimeRangePicker.d.ts +120 -120
- package/dist/types/index.d.ts +179 -188
- package/dist/types/ui/index.d.ts +19 -14
- package/dist/ui/index.js +455 -98
- package/dist/ui/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunks/SectionHeading-DLVTKa91.js.map +0 -1
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
import { DataAppDefinition, QueryDefinitions } from "@altertable/data-app/config";
|
|
2
|
-
import {
|
|
2
|
+
import { DataReading, DataView, DateTimeRangeComparison, DateTimeRangeFilter, DateTimeRangeFilterOptions, DateTimeRangePreset as DateTimeRangePreset$1, DateTimeRangeSelection, DisplayedSnapshot, FilterCollection, FilterValues, HistoryMode, MetricReading, dateTimeRangeFilter, dateTimeRangePresets } from "@altertable/data-app/internal";
|
|
3
3
|
import { CSSProperties, ComponentPropsWithRef, ComponentType, ReactNode, Ref, RefObject } from "react";
|
|
4
4
|
import { Button } from "react-aria-components";
|
|
5
5
|
import { Placement } from "@floating-ui/react";
|
|
6
6
|
import { LucideProps } from "lucide-react";
|
|
7
|
-
import { DateRangeContract, DateTimeRange, DateTimeRangePreset, DisclosedQuery } from "@altertable/data-app/contract";
|
|
8
7
|
import { DateFormat, MetricFormat } from "@altertable/data-app/format";
|
|
8
|
+
import { DateTimeRange, DateTimeRangeInput, DateTimeRangePolicy, DateTimeRangePreset, DisclosedQuery } from "@altertable/data-app/contract";
|
|
9
9
|
import { ThemeController } from "@altertable/data-app/appearance";
|
|
10
|
-
//#region src/ui/Button.d.ts
|
|
11
|
-
type ButtonProps = ComponentPropsWithRef<'button'> & {
|
|
12
|
-
/** Inline actions retain button semantics without a padded control surface. */
|
|
13
|
-
variant?: 'primary' | 'elevated' | 'outline' | 'ghost' | 'inline';
|
|
14
|
-
size?: 'default' | 'compact' | 'icon' | 'icon-compact';
|
|
15
|
-
};
|
|
16
|
-
declare function Button$1({ className, type, variant, size, disabled, ...props }: ButtonProps): import("react").JSX.Element;
|
|
17
|
-
/** React Aria trigger behavior with the same presentation as the native Button. */
|
|
18
|
-
declare function PressButton({ variant, size, className, ...props }: Omit<ComponentPropsWithRef<typeof Button>, 'className'> & Pick<ButtonProps, 'variant' | 'size'> & {
|
|
19
|
-
className?: string;
|
|
20
|
-
}): import("react").JSX.Element;
|
|
21
|
-
//#endregion
|
|
22
10
|
//#region src/ui/data-identifiers.d.ts
|
|
23
11
|
type TableIdentifier = {
|
|
24
12
|
catalog: string;
|
|
@@ -65,6 +53,109 @@ type MetricComparison = {
|
|
|
65
53
|
favorableDirection?: 'up' | 'down';
|
|
66
54
|
};
|
|
67
55
|
//#endregion
|
|
56
|
+
//#region src/ui/Button.d.ts
|
|
57
|
+
type ButtonProps = ComponentPropsWithRef<'button'> & {
|
|
58
|
+
/** Inline actions retain button semantics without a padded control surface. */
|
|
59
|
+
variant?: 'primary' | 'elevated' | 'outline' | 'ghost' | 'inline';
|
|
60
|
+
size?: 'default' | 'compact' | 'icon' | 'icon-compact';
|
|
61
|
+
};
|
|
62
|
+
declare function Button$1({ className, type, variant, size, disabled, ...props }: ButtonProps): import("react").JSX.Element;
|
|
63
|
+
/** React Aria trigger behavior with the same presentation as the native Button. */
|
|
64
|
+
declare function PressButton({ variant, size, className, ...props }: Omit<ComponentPropsWithRef<typeof Button>, 'className'> & Pick<ButtonProps, 'variant' | 'size'> & {
|
|
65
|
+
className?: string;
|
|
66
|
+
}): import("react").JSX.Element;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/ui/Sheet.d.ts
|
|
69
|
+
type SheetDialogProps = Omit<ComponentPropsWithRef<'dialog'>, 'children' | 'open' | 'title' | 'aria-labelledby'>;
|
|
70
|
+
type SheetProps = {
|
|
71
|
+
open: boolean;
|
|
72
|
+
onOpenChange: (open: boolean) => void;
|
|
73
|
+
title: ReactNode;
|
|
74
|
+
description?: ReactNode;
|
|
75
|
+
children: ReactNode;
|
|
76
|
+
headerActions?: ReactNode;
|
|
77
|
+
footer?: ReactNode;
|
|
78
|
+
wide?: boolean;
|
|
79
|
+
placement?: 'side' | 'center';
|
|
80
|
+
/** Edge for side placement. Defaults to right; small screens use a bottom sheet. */
|
|
81
|
+
side?: 'left' | 'right';
|
|
82
|
+
returnFocus?: RefObject<HTMLElement | SVGElement | null>;
|
|
83
|
+
} & SheetDialogProps;
|
|
84
|
+
/**
|
|
85
|
+
* Uses the native dialog top layer and focus trap. Closing keeps the modal mounted until its
|
|
86
|
+
* exit transition completes.
|
|
87
|
+
*/
|
|
88
|
+
declare function Sheet({ open, onOpenChange, title, description, children, headerActions, footer, wide, placement, side, returnFocus, className, onCancel, onClose, onClick, onTransitionEnd, ref, ...props }: SheetProps): import("react").JSX.Element;
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/ui/AboutData.d.ts
|
|
91
|
+
type InspectionRecords = {
|
|
92
|
+
scope: string;
|
|
93
|
+
content: ReactNode;
|
|
94
|
+
};
|
|
95
|
+
type AboutTab = 'records' | 'glossary' | 'queries';
|
|
96
|
+
type AboutEmpty = {
|
|
97
|
+
glossary: {
|
|
98
|
+
title: string;
|
|
99
|
+
description?: string;
|
|
100
|
+
};
|
|
101
|
+
queries: {
|
|
102
|
+
title: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
type AboutSubject = {
|
|
107
|
+
empty?: AboutEmpty;
|
|
108
|
+
id?: string;
|
|
109
|
+
title?: ReactNode;
|
|
110
|
+
description?: ReactNode;
|
|
111
|
+
visual?: ReactNode;
|
|
112
|
+
visualKind?: 'metric' | 'chart' | 'widget';
|
|
113
|
+
dataContext?: DataContext;
|
|
114
|
+
references?: {
|
|
115
|
+
kind: 'ids';
|
|
116
|
+
glossaryIds?: readonly string[];
|
|
117
|
+
queryNames?: readonly string[];
|
|
118
|
+
} | {
|
|
119
|
+
kind: 'entries';
|
|
120
|
+
entries: readonly GlossaryEntry[];
|
|
121
|
+
};
|
|
122
|
+
queries?: DisclosedQuery[];
|
|
123
|
+
records?: InspectionRecords;
|
|
124
|
+
};
|
|
125
|
+
type AboutDataProps = AboutSubject & {
|
|
126
|
+
variant?: ButtonProps['variant'];
|
|
127
|
+
iconOnly?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Register the global inspect shortcut. Defaults on for existing toolbar triggers; local
|
|
130
|
+
* triggers set false.
|
|
131
|
+
*/
|
|
132
|
+
shortcut?: boolean;
|
|
133
|
+
tooltip?: ReactNode;
|
|
134
|
+
children?: ReactNode;
|
|
135
|
+
footer?: ReactNode;
|
|
136
|
+
portalRoot?: RefObject<HTMLElement | null>;
|
|
137
|
+
sheetProps?: SheetDialogProps;
|
|
138
|
+
headerActions?: ReactNode;
|
|
139
|
+
open?: boolean;
|
|
140
|
+
onOpenChange?: (open: boolean) => void;
|
|
141
|
+
/** Initial inspect tab. While open, the URL's `tab` parameter tracks selection. */
|
|
142
|
+
tab?: AboutTab;
|
|
143
|
+
trigger?: boolean;
|
|
144
|
+
} & Omit<ComponentPropsWithRef<'button'>, 'children' | 'title'>;
|
|
145
|
+
declare function AboutData(props: AboutDataProps): import("react").JSX.Element;
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/ui/WidgetEvidence.d.ts
|
|
148
|
+
type EvidenceDetails = Omit<AboutSubject, 'id' | 'title' | 'description' | 'visual' | 'visualKind' | 'references'> & {
|
|
149
|
+
id: string;
|
|
150
|
+
};
|
|
151
|
+
type WidgetEvidence = EvidenceDetails & ({
|
|
152
|
+
glossaryIds: [string, ...string[]];
|
|
153
|
+
queryNames?: string[];
|
|
154
|
+
} | {
|
|
155
|
+
queryNames: [string, ...string[]];
|
|
156
|
+
glossaryIds?: string[];
|
|
157
|
+
});
|
|
158
|
+
//#endregion
|
|
68
159
|
//#region src/ui/metric.d.ts
|
|
69
160
|
type MetricDefinition = {
|
|
70
161
|
id: string;
|
|
@@ -177,97 +268,6 @@ declare function createDataContext<const Names extends Record<string, string>>(q
|
|
|
177
268
|
}) => MetricDefinition;
|
|
178
269
|
};
|
|
179
270
|
//#endregion
|
|
180
|
-
//#region src/ui/Sheet.d.ts
|
|
181
|
-
type SheetDialogProps = Omit<ComponentPropsWithRef<'dialog'>, 'children' | 'open' | 'title' | 'aria-labelledby'>;
|
|
182
|
-
type SheetProps = {
|
|
183
|
-
open: boolean;
|
|
184
|
-
onOpenChange: (open: boolean) => void;
|
|
185
|
-
title: ReactNode;
|
|
186
|
-
description?: ReactNode;
|
|
187
|
-
children: ReactNode;
|
|
188
|
-
headerActions?: ReactNode;
|
|
189
|
-
footer?: ReactNode;
|
|
190
|
-
wide?: boolean;
|
|
191
|
-
placement?: 'side' | 'center';
|
|
192
|
-
/** Edge for side placement. Defaults to right; small screens use a bottom sheet. */
|
|
193
|
-
side?: 'left' | 'right';
|
|
194
|
-
returnFocus?: RefObject<HTMLElement | SVGElement | null>;
|
|
195
|
-
} & SheetDialogProps;
|
|
196
|
-
/**
|
|
197
|
-
* Uses the native dialog top layer and focus trap. Closing keeps the modal mounted until its
|
|
198
|
-
* exit transition completes.
|
|
199
|
-
*/
|
|
200
|
-
declare function Sheet({ open, onOpenChange, title, description, children, headerActions, footer, wide, placement, side, returnFocus, className, onCancel, onClose, onClick, onTransitionEnd, ref, ...props }: SheetProps): import("react").JSX.Element;
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region src/ui/AboutData.d.ts
|
|
203
|
-
type InspectionRecords = {
|
|
204
|
-
scope: string;
|
|
205
|
-
content: ReactNode;
|
|
206
|
-
};
|
|
207
|
-
type AboutTab = 'records' | 'glossary' | 'queries';
|
|
208
|
-
type AboutEmpty = {
|
|
209
|
-
glossary: {
|
|
210
|
-
title: string;
|
|
211
|
-
description?: string;
|
|
212
|
-
};
|
|
213
|
-
queries: {
|
|
214
|
-
title: string;
|
|
215
|
-
description?: string;
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
type AboutSubject = {
|
|
219
|
-
empty?: AboutEmpty;
|
|
220
|
-
id?: string;
|
|
221
|
-
title?: ReactNode;
|
|
222
|
-
description?: ReactNode;
|
|
223
|
-
visual?: ReactNode;
|
|
224
|
-
visualKind?: 'metric' | 'chart' | 'widget';
|
|
225
|
-
dataContext?: DataContext;
|
|
226
|
-
references?: {
|
|
227
|
-
kind: 'ids';
|
|
228
|
-
glossaryIds?: readonly string[];
|
|
229
|
-
queryNames?: readonly string[];
|
|
230
|
-
} | {
|
|
231
|
-
kind: 'entries';
|
|
232
|
-
entries: readonly GlossaryEntry[];
|
|
233
|
-
};
|
|
234
|
-
queries?: DisclosedQuery[];
|
|
235
|
-
records?: InspectionRecords;
|
|
236
|
-
};
|
|
237
|
-
type AboutDataProps = AboutSubject & {
|
|
238
|
-
variant?: ButtonProps['variant'];
|
|
239
|
-
iconOnly?: boolean;
|
|
240
|
-
/**
|
|
241
|
-
* Register the global inspect shortcut. Defaults on for existing toolbar triggers; local
|
|
242
|
-
* triggers set false.
|
|
243
|
-
*/
|
|
244
|
-
shortcut?: boolean;
|
|
245
|
-
tooltip?: ReactNode;
|
|
246
|
-
children?: ReactNode;
|
|
247
|
-
footer?: ReactNode;
|
|
248
|
-
portalRoot?: RefObject<HTMLElement | null>;
|
|
249
|
-
sheetProps?: SheetDialogProps;
|
|
250
|
-
headerActions?: ReactNode;
|
|
251
|
-
open?: boolean;
|
|
252
|
-
onOpenChange?: (open: boolean) => void;
|
|
253
|
-
/** Initial inspect tab. While open, the URL's `tab` parameter tracks selection. */
|
|
254
|
-
tab?: AboutTab;
|
|
255
|
-
trigger?: boolean;
|
|
256
|
-
} & Omit<ComponentPropsWithRef<'button'>, 'children' | 'title'>;
|
|
257
|
-
declare function AboutData(props: AboutDataProps): import("react").JSX.Element;
|
|
258
|
-
//#endregion
|
|
259
|
-
//#region src/ui/WidgetEvidence.d.ts
|
|
260
|
-
type EvidenceDetails = Omit<AboutSubject, 'id' | 'title' | 'description' | 'visual' | 'visualKind' | 'references'> & {
|
|
261
|
-
id: string;
|
|
262
|
-
};
|
|
263
|
-
type WidgetEvidence = EvidenceDetails & ({
|
|
264
|
-
glossaryIds: [string, ...string[]];
|
|
265
|
-
queryNames?: string[];
|
|
266
|
-
} | {
|
|
267
|
-
queryNames: [string, ...string[]];
|
|
268
|
-
glossaryIds?: string[];
|
|
269
|
-
});
|
|
270
|
-
//#endregion
|
|
271
271
|
//#region src/ui/presentation.d.ts
|
|
272
272
|
type EmptyContent = {
|
|
273
273
|
title: ReactNode;
|
|
@@ -554,20 +554,20 @@ declare function DataAppProvider<const Queries extends QueryDefinitions>({ app,
|
|
|
554
554
|
children: ReactNode;
|
|
555
555
|
}): import("react").JSX.Element;
|
|
556
556
|
//#endregion
|
|
557
|
-
//#region src/ui/
|
|
558
|
-
/** URL is the source of truth for app
|
|
559
|
-
declare function
|
|
560
|
-
values:
|
|
557
|
+
//#region src/ui/app-filters.d.ts
|
|
558
|
+
/** URL is the source of truth for app filters; one update can change dependent values atomically. */
|
|
559
|
+
declare function useAppFilters<const Collection extends FilterCollection>(definitions: Collection): {
|
|
560
|
+
values: FilterValues<Collection>;
|
|
561
561
|
calendarRevision: number;
|
|
562
|
-
set: <Key extends keyof
|
|
563
|
-
reset: <Key extends keyof
|
|
562
|
+
set: <Key extends keyof Collection & string>(name: Key, value: FilterValues<Collection>[Key]) => void;
|
|
563
|
+
reset: <Key extends keyof Collection & string>(name: Key) => void;
|
|
564
564
|
resetAll: () => void;
|
|
565
565
|
clearAll: () => void;
|
|
566
|
-
update: (next: Partial<
|
|
567
|
-
bind: <Key extends keyof
|
|
568
|
-
value:
|
|
569
|
-
onChange(value:
|
|
570
|
-
resetValue:
|
|
566
|
+
update: (next: Partial<FilterValues<Collection>>, history?: HistoryMode) => void;
|
|
567
|
+
bind: <Key extends keyof Collection & string>(name: Key) => {
|
|
568
|
+
value: FilterValues<Collection>[Key];
|
|
569
|
+
onChange(value: FilterValues<Collection>[Key]): void;
|
|
570
|
+
resetValue: FilterValues<Collection>[Key];
|
|
571
571
|
};
|
|
572
572
|
};
|
|
573
573
|
//#endregion
|
|
@@ -889,8 +889,8 @@ type DateTimeRangePickerProps = {
|
|
|
889
889
|
labelPlacement?: ControlLabelPlacement;
|
|
890
890
|
/** Client limit for determinate durations; validate timezone-dependent ranges on the backend. */
|
|
891
891
|
maxRangeDays?: number;
|
|
892
|
-
/** Shared reporting policy; generated controls inherit it from their
|
|
893
|
-
|
|
892
|
+
/** Shared reporting policy; generated controls inherit it from their filter. */
|
|
893
|
+
policy?: DateTimeRangePolicy;
|
|
894
894
|
/** Suggestions in display order. Omit for defaults; [] retains calendar and text entry.
|
|
895
895
|
* Invalid or over-limit suggestions are omitted; typed input is not restricted to the menu.
|
|
896
896
|
*/
|
|
@@ -911,7 +911,7 @@ type DateTimeRangePickerProps = {
|
|
|
911
911
|
* Unmodified arrows navigate presets or edit date segments. Escape returns from the
|
|
912
912
|
* calendar to presets or closes the picker. Calendar days end at exclusive next UTC midnight.
|
|
913
913
|
*/
|
|
914
|
-
declare function DateTimeRangePicker({ value, onChange, liveOption, comparison, isDefault, onReset, calendarFooter, className, placeholder, label, labelPlacement, maxRangeDays,
|
|
914
|
+
declare function DateTimeRangePicker({ value, onChange, liveOption, comparison, isDefault, onReset, calendarFooter, className, placeholder, label, labelPlacement, maxRangeDays, policy, presets: configuredPresets, disabled }: DateTimeRangePickerProps): import("react").JSX.Element;
|
|
915
915
|
//#endregion
|
|
916
|
-
export {
|
|
916
|
+
export { SearchHit as $, DataAppControlProps as A, GlossaryEntry as At, DataAppProvider as B, AboutEmpty as Bt, DataWidget as C, ExplorationActionControl as Ct, DataValue as D, AuthoringDataContext as Dt, MetricWidgetProps as E, EmptyContent as Et, DateTimeRangePreset$1 as F, PresentStoryProps as Ft, DataAppStylesOptions as G, Button$1 as Gt, DataAppStyle as H, AboutTab as Ht, DateTimeRangeSelection as I, MetricDefinition as It, TableWidget as J, MetricComparison as Jt, injectDataAppStyles as K, ButtonProps as Kt, dateTimeRangeFilter as L, WidgetEvidence as Lt, DateTimeRangeComparison as M, BoundStory as Mt, DateTimeRangeFilter as N, StoryFinding as Nt, DataValueProps as O, DataContext as Ot, DateTimeRangeFilterOptions as P, PresentStory as Pt, SearchAttribute as Q, defineDataIdentifiers as Qt, dateTimeRangePresets as R, AboutData as Rt, TextWidgetProps as S, ExplorationAction as St, MetricWidget as T, ItemActions as Tt, DataAppStyleHooks as U, Sheet as Ut, mountDataApp as V, AboutSubject as Vt, DataAppStyleToken as W, SheetProps as Wt, TableWidgetProps as X, DataIdentifierDefinition as Xt, TableWidgetColumn as Y, ColumnIdentifier as Yt, TableWidgetSearch as Z, TableIdentifier as Zt, HelpPopoverProps as _, SearchField as _t, DateDisplay as a, WidgetStatus as at, VisualizationWidgetView as b, CsvExport as bt, SectionHeadingProps as c, DataTableEmptyRowProps as ct, TooltipProvider as d, DataTableShare as dt, SearchItemsOptions as et, TooltipProviderProps as f, DataTableTimestamp as ft, HelpPopover as g, SearchTypeaheadProps as gt, AppIconProps as h, SearchTypeahead as ht, useDateFormatting as i, searchItems as it, StaticDataAppProps as j, createDataContext as jt, DataAppBaseProps as k, EvidenceDeclaration as kt, Tooltip as l, DataTableProps as lt, AppIconName as m, SearchSuggestion as mt, DateTimeRangePickerProps as n, SearchRange as nt, DateDisplayProps as o, DataTable as ot, AppIcon as p, DataTableTimestampProps as pt, TableDisplayMode as q, PressButton as qt, ControlLabelPlacement as r, matchSearchText as rt, SectionHeading as s, DataTableEmptyRow as st, DateTimeRangePicker as t, SearchMatchValue as tt, TooltipProps as u, DataTableSearch as ut, VisualizationWidget as v, SearchFieldProps as vt, DataWidgetProps as w, ExplorationActionControlProps as wt, TextWidget as x, CsvTable as xt, VisualizationWidgetProps as y, CsvCell as yt, useAppFilters as z, AboutDataProps as zt };
|
|
917
917
|
//# sourceMappingURL=DateTimeRangePicker.d.ts.map
|