@quillsql/react 2.16.42 → 2.16.43
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.cjs +11439 -2541
- package/dist/index.d.cts +677 -112
- package/dist/index.d.ts +677 -112
- package/dist/index.js +11157 -2256
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ interface SelectComponentProps {
|
|
|
73
73
|
isLoading?: boolean;
|
|
74
74
|
hideEmptyOption?: boolean;
|
|
75
75
|
disabled?: boolean;
|
|
76
|
+
/** Compact trigger (e.g. chat toolbar). */
|
|
77
|
+
size?: 'default' | 'sm';
|
|
76
78
|
}
|
|
77
79
|
interface MultiSelectComponentProps {
|
|
78
80
|
label?: string;
|
|
@@ -516,12 +518,12 @@ type ColorMapType = {
|
|
|
516
518
|
/**
|
|
517
519
|
* A set of valid format values for the x and y axes of dashboard items.
|
|
518
520
|
*/
|
|
519
|
-
type AxisFormat = 'percent' | 'dollar_amount' | 'dollar_cents' | 'whole_number' | 'one_decimal_place' | 'two_decimal_places' | 'percentage' | 'string' | 'yyyy' | 'MMM_dd' | 'MMM_yyyy' | 'MMM_dd_yyyy' | 'hh_ap_pm' | 'MMM_dd-MMM_dd' | 'MMM_dd_hh:mm_ap_pm' | 'wo, yyyy';
|
|
521
|
+
type AxisFormat$1 = 'percent' | 'dollar_amount' | 'dollar_cents' | 'whole_number' | 'one_decimal_place' | 'two_decimal_places' | 'percentage' | 'string' | 'yyyy' | 'MMM_dd' | 'MMM_yyyy' | 'MMM_dd_yyyy' | 'hh_ap_pm' | 'MMM_dd-MMM_dd' | 'MMM_dd_hh:mm_ap_pm' | 'wo, yyyy';
|
|
520
522
|
|
|
521
523
|
interface Column$1 {
|
|
522
524
|
field: string;
|
|
523
525
|
label: string;
|
|
524
|
-
format: AxisFormat;
|
|
526
|
+
format: AxisFormat$1;
|
|
525
527
|
inferFormat?: boolean;
|
|
526
528
|
}
|
|
527
529
|
interface ColumnInternal extends Column$1 {
|
|
@@ -546,6 +548,10 @@ interface BasePivot {
|
|
|
546
548
|
rowFieldType?: string;
|
|
547
549
|
columnField?: string;
|
|
548
550
|
columnFieldType?: string;
|
|
551
|
+
/** Source table for rowField (multi-table / disambiguation). */
|
|
552
|
+
rowFieldTable?: string;
|
|
553
|
+
/** Source table for columnField (multi-table / disambiguation). */
|
|
554
|
+
columnFieldTable?: string;
|
|
549
555
|
sort?: boolean;
|
|
550
556
|
sortDirection?: 'ASC' | 'DESC';
|
|
551
557
|
sortField?: string;
|
|
@@ -556,6 +562,14 @@ interface BasePivot {
|
|
|
556
562
|
columnValues?: string[];
|
|
557
563
|
dateBucket?: 'day' | 'week' | 'month' | 'year';
|
|
558
564
|
}
|
|
565
|
+
type PivotAggregation = {
|
|
566
|
+
aggregationType: AggregationType;
|
|
567
|
+
valueField?: string;
|
|
568
|
+
valueFieldType?: string;
|
|
569
|
+
valueField2?: string;
|
|
570
|
+
valueField2Type?: string;
|
|
571
|
+
valueFieldTable?: string;
|
|
572
|
+
};
|
|
559
573
|
interface SingleAggregationPivot extends BasePivot {
|
|
560
574
|
aggregationType: AggregationType;
|
|
561
575
|
valueField?: string;
|
|
@@ -570,13 +584,7 @@ interface MultiAggregationPivot extends BasePivot {
|
|
|
570
584
|
valueField2?: never;
|
|
571
585
|
valueField2Type?: never;
|
|
572
586
|
valueFieldType?: never;
|
|
573
|
-
aggregations:
|
|
574
|
-
valueField?: string;
|
|
575
|
-
valueFieldType?: string;
|
|
576
|
-
valueField2?: string;
|
|
577
|
-
valueField2Type?: string;
|
|
578
|
-
aggregationType: AggregationType;
|
|
579
|
-
}[];
|
|
587
|
+
aggregations: PivotAggregation[];
|
|
580
588
|
}
|
|
581
589
|
type AggregationType = 'sum' | 'average' | 'min' | 'max' | 'count' | 'avg' | 'percentage';
|
|
582
590
|
type PivotData = {
|
|
@@ -630,6 +638,29 @@ type ReportBuilderState = {
|
|
|
630
638
|
limit: ReportBuilderLimit | null;
|
|
631
639
|
};
|
|
632
640
|
|
|
641
|
+
/**
|
|
642
|
+
* Represents a table object returned from /schema2/:id
|
|
643
|
+
*/
|
|
644
|
+
type Table$1 = {
|
|
645
|
+
_id: string;
|
|
646
|
+
isSelectStar: boolean;
|
|
647
|
+
displayName: string;
|
|
648
|
+
name: string;
|
|
649
|
+
description?: string;
|
|
650
|
+
columns: ColumnInternal[];
|
|
651
|
+
viewQuery: string;
|
|
652
|
+
customFieldInfo: any;
|
|
653
|
+
broken?: boolean;
|
|
654
|
+
error?: string;
|
|
655
|
+
ownerTenantFields?: string[];
|
|
656
|
+
};
|
|
657
|
+
interface UniqueValuesByTable {
|
|
658
|
+
[table: string]: UniqueValuesByColumn;
|
|
659
|
+
}
|
|
660
|
+
interface UniqueValuesByColumn {
|
|
661
|
+
[column: string]: string[];
|
|
662
|
+
}
|
|
663
|
+
|
|
633
664
|
/**
|
|
634
665
|
* ## QuillReport
|
|
635
666
|
* Represents an individual item on a dashboard.
|
|
@@ -670,7 +701,7 @@ interface QuillReport {
|
|
|
670
701
|
/** The field to use for this report's xAxis. */
|
|
671
702
|
xAxisField: string;
|
|
672
703
|
/** The format for this report's xAxis. */
|
|
673
|
-
xAxisFormat: AxisFormat;
|
|
704
|
+
xAxisFormat: AxisFormat$1;
|
|
674
705
|
/** The template flag for a report */
|
|
675
706
|
template?: boolean;
|
|
676
707
|
/**
|
|
@@ -682,7 +713,7 @@ interface QuillReport {
|
|
|
682
713
|
/** The label to use for this yAxis. */
|
|
683
714
|
label: string;
|
|
684
715
|
/** The format of the data in this yAxis. */
|
|
685
|
-
format: AxisFormat;
|
|
716
|
+
format: AxisFormat$1;
|
|
686
717
|
}[];
|
|
687
718
|
/**
|
|
688
719
|
* The relative ordering of this report in relation to its siblings. Ordering
|
|
@@ -776,6 +807,14 @@ interface QuillReportInternal extends QuillReport {
|
|
|
776
807
|
* When present, backend will generate SQL from this state instead of using queryString.
|
|
777
808
|
*/
|
|
778
809
|
reportBuilderState?: ReportBuilderState;
|
|
810
|
+
/** String unique values grouped by table/column, used by filter builders. */
|
|
811
|
+
uniqueStringsByTable?: UniqueValuesByTable;
|
|
812
|
+
/** String unique values keyed by column name, used by filter builders. */
|
|
813
|
+
uniqueStringsByColumn?: UniqueValuesByColumn;
|
|
814
|
+
/** Legacy alias for unique string values keyed by column name. */
|
|
815
|
+
columnUniqueValues?: UniqueValuesByColumn;
|
|
816
|
+
/** Backward-compatible alias for unique string values keyed by column name. */
|
|
817
|
+
uniqueValues?: UniqueValuesByColumn;
|
|
779
818
|
}
|
|
780
819
|
|
|
781
820
|
/**
|
|
@@ -1316,6 +1355,43 @@ type QuillProviderProps = QuillCloudProviderProps | SelfHostedProviderProps;
|
|
|
1316
1355
|
*/
|
|
1317
1356
|
declare const QuillProvider: ({ tenants, flags, publicKey, queryEndpoint, streamEndpoint, queryHeaders, children, theme, withCredentials, isAdmin, getAuthorizationToken, eventTracking, onChangelogs, }: QuillProviderProps) => react_jsx_runtime.JSX.Element;
|
|
1318
1357
|
|
|
1358
|
+
interface TableComponentProps {
|
|
1359
|
+
rows: object[];
|
|
1360
|
+
rowCount?: number;
|
|
1361
|
+
rowCountIsLoading?: boolean;
|
|
1362
|
+
columns: {
|
|
1363
|
+
label: string;
|
|
1364
|
+
field: string;
|
|
1365
|
+
format?: string;
|
|
1366
|
+
}[];
|
|
1367
|
+
currentPage: number;
|
|
1368
|
+
sort?: {
|
|
1369
|
+
field: string;
|
|
1370
|
+
direction: string;
|
|
1371
|
+
};
|
|
1372
|
+
className?: string;
|
|
1373
|
+
containerStyle?: React$1.CSSProperties;
|
|
1374
|
+
isLoading?: boolean;
|
|
1375
|
+
hideCSVDownloadButton?: boolean;
|
|
1376
|
+
downloadCSV?: () => void;
|
|
1377
|
+
LoadingComponent?: () => React$1.JSX.Element;
|
|
1378
|
+
DownloadCSVButtonComponent?: (props: ButtonComponentProps) => React$1.JSX.Element;
|
|
1379
|
+
rowsPerPage?: number;
|
|
1380
|
+
emptyStateLabel?: string;
|
|
1381
|
+
onPageChange?: (page: number) => void;
|
|
1382
|
+
onSortChange?: (sort: {
|
|
1383
|
+
field: string;
|
|
1384
|
+
direction: string;
|
|
1385
|
+
}) => void;
|
|
1386
|
+
headerBackgroundColor?: string;
|
|
1387
|
+
footerBackgroundColor?: string;
|
|
1388
|
+
borderRadius?: string | number;
|
|
1389
|
+
borderLeft?: string;
|
|
1390
|
+
borderRight?: string;
|
|
1391
|
+
borderTop?: string;
|
|
1392
|
+
borderBottom?: string;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1319
1395
|
interface BaseChartProps {
|
|
1320
1396
|
colors?: string[];
|
|
1321
1397
|
containerStyle?: React.CSSProperties;
|
|
@@ -1533,8 +1609,10 @@ interface ChartDisplayProps extends WithConfig {
|
|
|
1533
1609
|
showLegend?: boolean;
|
|
1534
1610
|
tableRowsLoading?: boolean;
|
|
1535
1611
|
disableTableSort?: boolean;
|
|
1612
|
+
/** When `chartType` is `table`, applied to QuillTable's outer frame only (not cell lines). */
|
|
1613
|
+
tableChartWrapperBorders?: Pick<TableComponentProps, 'borderRadius' | 'borderLeft' | 'borderRight' | 'borderTop' | 'borderBottom'>;
|
|
1536
1614
|
}
|
|
1537
|
-
declare const ChartDisplay: ({ reportId, config, colors, className, containerStyle, hideXAxis, hideYAxis, hideCartesianGrid, hideDateRangeFilter, hideHorizontalCartesianGrid, hideVerticalCartesianGrid, hideSubsequentXAxisTicks, cartesianGridLineStyle, cartesianGridLineColor, comparisonLineStyle, isAnimationActive, scrollable, loading, ErrorComponent, colorMap, LoadingComponent, onPageChange, onSortChange, onClickChartElement, overrideTheme, referenceLines, showLegend, tableRowsLoading, }: ChartDisplayProps) => react_jsx_runtime.JSX.Element;
|
|
1615
|
+
declare const ChartDisplay: ({ reportId, config, colors, className, containerStyle, hideXAxis, hideYAxis, hideCartesianGrid, hideDateRangeFilter, hideHorizontalCartesianGrid, hideVerticalCartesianGrid, hideSubsequentXAxisTicks, cartesianGridLineStyle, cartesianGridLineColor, comparisonLineStyle, isAnimationActive, scrollable, loading, ErrorComponent, colorMap, LoadingComponent, onPageChange, onSortChange, onClickChartElement, overrideTheme, referenceLines, showLegend, tableRowsLoading, tableChartWrapperBorders, }: ChartDisplayProps) => react_jsx_runtime.JSX.Element;
|
|
1538
1616
|
|
|
1539
1617
|
/**
|
|
1540
1618
|
* Props for the Quill Table component.
|
|
@@ -1602,6 +1680,7 @@ interface TableProps {
|
|
|
1602
1680
|
columns?: {
|
|
1603
1681
|
label: string;
|
|
1604
1682
|
field: string;
|
|
1683
|
+
format?: string;
|
|
1605
1684
|
}[];
|
|
1606
1685
|
/**
|
|
1607
1686
|
* The placeholder filename to use when downloading this table as a csv file.
|
|
@@ -1677,6 +1756,12 @@ interface TableProps {
|
|
|
1677
1756
|
* Styles the top-level container of the Table.
|
|
1678
1757
|
*/
|
|
1679
1758
|
containerStyle?: React$1.CSSProperties;
|
|
1759
|
+
/** Passed through to QuillTable when rendering with `rows` / `columns`. */
|
|
1760
|
+
borderRadius?: string | number;
|
|
1761
|
+
borderLeft?: string;
|
|
1762
|
+
borderRight?: string;
|
|
1763
|
+
borderTop?: string;
|
|
1764
|
+
borderBottom?: string;
|
|
1680
1765
|
/** An array of dashboard filters that are indicated by the frontend dev. */
|
|
1681
1766
|
filters?: Filter[];
|
|
1682
1767
|
}
|
|
@@ -1711,7 +1796,7 @@ interface TableProps {
|
|
|
1711
1796
|
* ### Table API
|
|
1712
1797
|
* @see https://docs.quillsql.com/components/table
|
|
1713
1798
|
*/
|
|
1714
|
-
declare const Table
|
|
1799
|
+
declare const Table: ({ TableComponent, ...props }: TableProps) => react_jsx_runtime.JSX.Element | null;
|
|
1715
1800
|
|
|
1716
1801
|
/**
|
|
1717
1802
|
* Props for the Quill SQLEditor component.
|
|
@@ -2612,26 +2697,303 @@ interface ChatProps {
|
|
|
2612
2697
|
agentEndpoint?: string;
|
|
2613
2698
|
suggestions?: string[];
|
|
2614
2699
|
}
|
|
2700
|
+
type ChatModelId = 'gemini-2-flash' | 'gemini-2.5-flash' | 'gemini-3-flash-preview' | 'gpt-5.1' | 'opus-4.5' | 'kimi-k2.5';
|
|
2615
2701
|
declare function Chat({ selectedDashboard, ChartViewComponent, agentEndpoint, suggestions, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
2616
2702
|
|
|
2703
|
+
type QueryBuilderCombinator = 'and' | 'or';
|
|
2704
|
+
type QueryBuilderRule = {
|
|
2705
|
+
field: string;
|
|
2706
|
+
operator: string;
|
|
2707
|
+
value: unknown;
|
|
2708
|
+
};
|
|
2709
|
+
type QueryBuilderRuleGroupEntry = QueryBuilderRule | QueryBuilderRuleGroup | QueryBuilderCombinator;
|
|
2710
|
+
type QueryBuilderRuleGroup = {
|
|
2711
|
+
combinator?: QueryBuilderCombinator;
|
|
2712
|
+
rules: QueryBuilderRuleGroupEntry[];
|
|
2713
|
+
};
|
|
2714
|
+
type QueryBuilderFieldType = 'string' | 'number' | 'date' | 'boolean' | 'null';
|
|
2715
|
+
type QueryBuilderOperatorOption = {
|
|
2716
|
+
name: string;
|
|
2717
|
+
value: string;
|
|
2718
|
+
label: string;
|
|
2719
|
+
arity?: 'unary' | 'binary' | number;
|
|
2720
|
+
};
|
|
2721
|
+
|
|
2722
|
+
/**
|
|
2723
|
+
* Default `value` for a new react-querybuilder rule given a Quill operator.
|
|
2724
|
+
* List operators (`in` / `notIn`) need `[]` so the multiselect editor works
|
|
2725
|
+
* with `listsAsArrays`; everything else starts as an empty string.
|
|
2726
|
+
*/
|
|
2727
|
+
declare const defaultFilterRuleValueForOperator: (operator: unknown) => unknown;
|
|
2728
|
+
/**
|
|
2729
|
+
* One-rule react-querybuilder tree seeded from the first field in the catalog,
|
|
2730
|
+
* using that field's first operator and a matching default value. Used for the
|
|
2731
|
+
* "Add filter" empty state, where react-querybuilder's own "+ Rule" button is
|
|
2732
|
+
* not rendered yet.
|
|
2733
|
+
*/
|
|
2734
|
+
declare const buildSeededFilterQuery: (queryBuilderProps: Pick<UseFormQueryBuilderProps, "fields" | "getOperators"> | null | undefined) => QueryBuilderRuleGroup;
|
|
2735
|
+
type FilterDraftQueryBuilderProps = UseFormQueryBuilderProps & {
|
|
2736
|
+
/** Committed-or-draft tree react-querybuilder hydrates from on mount (uncontrolled mode). */
|
|
2737
|
+
defaultQuery: QueryBuilderRuleGroup;
|
|
2738
|
+
onQueryChange: (next: unknown) => void;
|
|
2739
|
+
addRuleToNewGroups: true;
|
|
2740
|
+
getDefaultValue: (rule: {
|
|
2741
|
+
operator?: unknown;
|
|
2742
|
+
}) => unknown;
|
|
2743
|
+
};
|
|
2744
|
+
type UseReportFilterDraft = {
|
|
2745
|
+
/**
|
|
2746
|
+
* Pass as `key` on `QueryBuilder` (not inside the spread — React warns on
|
|
2747
|
+
* spread `key`). Changes whenever react-querybuilder must rehydrate from
|
|
2748
|
+
* `defaultQuery`: report switch, committed filters change, field catalog
|
|
2749
|
+
* change, or `resetFilterDraft`.
|
|
2750
|
+
*/
|
|
2751
|
+
filterDraftKey: string;
|
|
2752
|
+
/** Spread onto `react-querybuilder`'s `QueryBuilder`: `<QueryBuilder key={filterDraftKey} {...filterDraftQueryBuilderProps} />`. */
|
|
2753
|
+
filterDraftQueryBuilderProps: FilterDraftQueryBuilderProps;
|
|
2754
|
+
/** Draft differs from committed filters (commit would change the report). */
|
|
2755
|
+
isFilterDraftDirty: boolean;
|
|
2756
|
+
/** Draft tree has no rules at all; show an "Add filter" affordance instead of the builder. */
|
|
2757
|
+
isFilterDraftEmpty: boolean;
|
|
2758
|
+
/** Commit the draft via `setFilters` (report/chart refresh follows). */
|
|
2759
|
+
commitFilterDraft: () => void;
|
|
2760
|
+
/** Drop the draft and rehydrate the builder from committed filters. */
|
|
2761
|
+
resetFilterDraft: () => void;
|
|
2762
|
+
/** Seed a first rule (field + operator + default value) and leave the empty state. */
|
|
2763
|
+
seedFilterDraft: () => void;
|
|
2764
|
+
};
|
|
2765
|
+
|
|
2617
2766
|
type SelectOption = {
|
|
2618
2767
|
label: string;
|
|
2619
2768
|
value: string;
|
|
2620
2769
|
};
|
|
2770
|
+
type UseFormTableRow = Record<string, unknown>;
|
|
2771
|
+
type UseFormTableColumn = {
|
|
2772
|
+
label: string;
|
|
2773
|
+
field: string;
|
|
2774
|
+
format: string;
|
|
2775
|
+
};
|
|
2776
|
+
type UseFormTable = {
|
|
2777
|
+
rows: UseFormTableRow[];
|
|
2778
|
+
columns: UseFormTableColumn[];
|
|
2779
|
+
getColumnFormat: (field: string) => string;
|
|
2780
|
+
formatCellValue: (field: string, value: unknown) => string;
|
|
2781
|
+
getFormattedCellValue: (row: UseFormTableRow, field: string) => string;
|
|
2782
|
+
};
|
|
2783
|
+
type ColumnSelectionOption = {
|
|
2784
|
+
value: string;
|
|
2785
|
+
label: string;
|
|
2786
|
+
field: string;
|
|
2787
|
+
tableName: string;
|
|
2788
|
+
type: string;
|
|
2789
|
+
};
|
|
2790
|
+
type UseFormDisplayColumn = ReportBuilderColumn & {
|
|
2791
|
+
format?: string;
|
|
2792
|
+
};
|
|
2793
|
+
type SetReportBuilderColumnInput = Partial<UseFormDisplayColumn> & {
|
|
2794
|
+
field: string;
|
|
2795
|
+
label?: string;
|
|
2796
|
+
};
|
|
2797
|
+
type TableColumnsControllerItem = {
|
|
2798
|
+
id: string;
|
|
2799
|
+
label: string;
|
|
2800
|
+
defaultLabel: string;
|
|
2801
|
+
customLabel: string;
|
|
2802
|
+
/** Persisted axis format value (e.g. `whole_number`). */
|
|
2803
|
+
format: string;
|
|
2804
|
+
/** Format preset label (same strings as chart axis / `tableFormatOptions`). */
|
|
2805
|
+
formatLabel: string;
|
|
2806
|
+
field: string;
|
|
2807
|
+
tableName: string;
|
|
2808
|
+
};
|
|
2809
|
+
type TableColumnListItem = {
|
|
2810
|
+
id: string;
|
|
2811
|
+
label: string;
|
|
2812
|
+
visible: true;
|
|
2813
|
+
/** Axis format preset label (matches `tableFormatOptions` / chart axis). */
|
|
2814
|
+
format: string;
|
|
2815
|
+
/**
|
|
2816
|
+
* When set, overrides the shared `formatOptions` for this row (e.g. pivot date bucket).
|
|
2817
|
+
*/
|
|
2818
|
+
formatOptions?: string[];
|
|
2819
|
+
};
|
|
2820
|
+
/** Selected columns + mutation methods. Pair with `columnOptions` from `useReport` (like `datasources` / `datasourceOptions`). */
|
|
2821
|
+
type TableColumnsController = {
|
|
2822
|
+
items: TableColumnsControllerItem[];
|
|
2823
|
+
/** Schema option per column id (`value` === id) — includes `field`, `tableName`, etc. */
|
|
2824
|
+
optionById: ReadonlyMap<string, ColumnSelectionOption>;
|
|
2825
|
+
byId: ReadonlyMap<string, TableColumnsControllerItem>;
|
|
2826
|
+
/** Ready-made rows for table/column-picker UIs (`id`, `label`, `format` display string). */
|
|
2827
|
+
columnList: TableColumnListItem[];
|
|
2828
|
+
/** Build the `columns` array for `setReport({ columns })` from ordered ids. */
|
|
2829
|
+
getSetReportColumns: (ids: string[]) => SetReportBuilderColumnInput[];
|
|
2830
|
+
reorder: (oldIndex: number, newIndex: number) => void;
|
|
2831
|
+
/** Reorder to match a full id list (e.g. after drag-and-drop column list UIs). */
|
|
2832
|
+
reorderFromOrder: (nextIds: string[]) => void;
|
|
2833
|
+
remove: (id: string) => void;
|
|
2834
|
+
toggle: (id: string) => void;
|
|
2835
|
+
update: (id: string, updates: Partial<{
|
|
2836
|
+
fieldId: string;
|
|
2837
|
+
label: string;
|
|
2838
|
+
format: string;
|
|
2839
|
+
}>) => void;
|
|
2840
|
+
/**
|
|
2841
|
+
* Build `setReport({ columns: { patch } })` for a table column sidebar edit;
|
|
2842
|
+
* `setReport` expands it to a full `columns` list and/or `chartAxes`. Returns
|
|
2843
|
+
* null only when `id` is empty.
|
|
2844
|
+
*/
|
|
2845
|
+
getColumnSidebarSetReportInput: (id: string, updates: Partial<{
|
|
2846
|
+
fieldId: string;
|
|
2847
|
+
label: string;
|
|
2848
|
+
format: string;
|
|
2849
|
+
}>) => SetReportBuilderInput | null;
|
|
2850
|
+
/**
|
|
2851
|
+
* When true (pivot + chartType table), the list mirrors `chart.columns`; reorder,
|
|
2852
|
+
* add, remove, and field swap are disabled — only label/format apply via chart axes.
|
|
2853
|
+
*/
|
|
2854
|
+
structureEditsLocked: boolean;
|
|
2855
|
+
};
|
|
2856
|
+
type ChartAxisFieldOption = {
|
|
2857
|
+
value: string;
|
|
2858
|
+
label: string;
|
|
2859
|
+
format: AxisFormat;
|
|
2860
|
+
};
|
|
2861
|
+
type ChartYAxisControllerItem = {
|
|
2862
|
+
id: string;
|
|
2863
|
+
field: string;
|
|
2864
|
+
label: string;
|
|
2865
|
+
format: AxisFormat;
|
|
2866
|
+
};
|
|
2867
|
+
type ChartAxesController = {
|
|
2868
|
+
xAxis: {
|
|
2869
|
+
field: string;
|
|
2870
|
+
format: AxisFormat;
|
|
2871
|
+
options: ChartAxisFieldOption[];
|
|
2872
|
+
formatOptions: SelectOption[];
|
|
2873
|
+
update: (updates: Partial<{
|
|
2874
|
+
field: string;
|
|
2875
|
+
format: AxisFormat;
|
|
2876
|
+
}>) => void;
|
|
2877
|
+
};
|
|
2878
|
+
yAxis: {
|
|
2879
|
+
items: ChartYAxisControllerItem[];
|
|
2880
|
+
options: ChartAxisFieldOption[];
|
|
2881
|
+
formatOptions: SelectOption[];
|
|
2882
|
+
add: (field?: string) => void;
|
|
2883
|
+
remove: (id: string) => void;
|
|
2884
|
+
reorder: (oldIndex: number, newIndex: number) => void;
|
|
2885
|
+
update: (id: string, updates: Partial<{
|
|
2886
|
+
field: string;
|
|
2887
|
+
label: string;
|
|
2888
|
+
format: AxisFormat;
|
|
2889
|
+
}>) => void;
|
|
2890
|
+
};
|
|
2891
|
+
};
|
|
2621
2892
|
type ColumnSelectorChangeValue = string[];
|
|
2893
|
+
/**
|
|
2894
|
+
* Table column sidebar edit under {@link SetReportBuilderInput.columns}: expands
|
|
2895
|
+
* inside `setReport` to a full `columns` array and/or `chartAxes` (pivot table chart).
|
|
2896
|
+
*/
|
|
2897
|
+
type SetReportTableColumnSidebarPatch = {
|
|
2898
|
+
patch: {
|
|
2899
|
+
id: string;
|
|
2900
|
+
label?: string;
|
|
2901
|
+
format?: string;
|
|
2902
|
+
fieldId?: string;
|
|
2903
|
+
};
|
|
2904
|
+
};
|
|
2622
2905
|
type AggregationStateItem = Partial<{
|
|
2623
2906
|
valueField: string;
|
|
2624
2907
|
valueField2?: string;
|
|
2625
2908
|
aggregationType: AggregationType;
|
|
2909
|
+
/** Resolved datasource table for `valueField` (mirrors `aggregationTablesByIndex`). */
|
|
2910
|
+
valueFieldTable?: string;
|
|
2626
2911
|
}>;
|
|
2627
2912
|
type AggregationOption = {
|
|
2628
2913
|
key: string;
|
|
2629
2914
|
label: string;
|
|
2630
|
-
value
|
|
2915
|
+
value: string;
|
|
2631
2916
|
options: SelectOption[];
|
|
2632
2917
|
};
|
|
2918
|
+
type AxisFormat = QuillReportInternal['yAxisFields'][number]['format'];
|
|
2919
|
+
type QueryBuilderFieldValueOption = {
|
|
2920
|
+
name: string;
|
|
2921
|
+
label: string;
|
|
2922
|
+
value: string;
|
|
2923
|
+
};
|
|
2924
|
+
type UseFormQueryBuilderField = {
|
|
2925
|
+
name: string;
|
|
2926
|
+
label: string;
|
|
2927
|
+
inputType: string;
|
|
2928
|
+
quillFieldType: QueryBuilderFieldType;
|
|
2929
|
+
values?: QueryBuilderFieldValueOption[];
|
|
2930
|
+
};
|
|
2931
|
+
type UseFormQueryBuilderProps = {
|
|
2932
|
+
fields: UseFormQueryBuilderField[];
|
|
2933
|
+
listsAsArrays: true;
|
|
2934
|
+
getOperators: (field: string, misc?: {
|
|
2935
|
+
fieldData?: Partial<UseFormQueryBuilderField>;
|
|
2936
|
+
}) => QueryBuilderOperatorOption[];
|
|
2937
|
+
getInputType: (field: string, operator: string, misc?: {
|
|
2938
|
+
fieldData?: Partial<UseFormQueryBuilderField>;
|
|
2939
|
+
}) => 'text' | 'number' | 'date' | 'checkbox';
|
|
2940
|
+
getValueEditorType: (field: string, operator: string, misc?: {
|
|
2941
|
+
fieldData?: Partial<UseFormQueryBuilderField>;
|
|
2942
|
+
}) => 'multiselect' | undefined;
|
|
2943
|
+
getValues: (field: string, operator: string, misc?: {
|
|
2944
|
+
fieldData?: Partial<UseFormQueryBuilderField>;
|
|
2945
|
+
}) => QueryBuilderFieldValueOption[];
|
|
2946
|
+
};
|
|
2947
|
+
/** Maps table column format dropdown values to persisted report column `format` (matches `setReport({ columns })` / `update`). */
|
|
2948
|
+
declare function tableColumnFormatFromUiSelection(raw: string): string;
|
|
2949
|
+
/** Shape expected by chart config sidebars that mirror `AxisConfig` (e.g. Quill Chat ConfigForm). */
|
|
2950
|
+
type UseFormAxisConfig = {
|
|
2951
|
+
xAxis: {
|
|
2952
|
+
field: string;
|
|
2953
|
+
label: string;
|
|
2954
|
+
format: string;
|
|
2955
|
+
show: boolean;
|
|
2956
|
+
rotation: number;
|
|
2957
|
+
fontSize: number;
|
|
2958
|
+
};
|
|
2959
|
+
yAxis: {
|
|
2960
|
+
fields: Array<{
|
|
2961
|
+
field: string;
|
|
2962
|
+
label: string;
|
|
2963
|
+
format: string;
|
|
2964
|
+
color: string;
|
|
2965
|
+
}>;
|
|
2966
|
+
label: string;
|
|
2967
|
+
show: boolean;
|
|
2968
|
+
min: string;
|
|
2969
|
+
max: string;
|
|
2970
|
+
fontSize: number;
|
|
2971
|
+
};
|
|
2972
|
+
legend: {
|
|
2973
|
+
show: boolean;
|
|
2974
|
+
};
|
|
2975
|
+
};
|
|
2976
|
+
type SetReportChartAxesInput = {
|
|
2977
|
+
xAxis?: Partial<{
|
|
2978
|
+
field: string;
|
|
2979
|
+
/** Custom X-axis title; empty string clears the override and restores the report/field default. */
|
|
2980
|
+
label: string;
|
|
2981
|
+
format: AxisFormat | string;
|
|
2982
|
+
}>;
|
|
2983
|
+
yAxis?: {
|
|
2984
|
+
fields: Array<{
|
|
2985
|
+
field: string;
|
|
2986
|
+
label?: string;
|
|
2987
|
+
format?: AxisFormat | string;
|
|
2988
|
+
}>;
|
|
2989
|
+
};
|
|
2990
|
+
};
|
|
2633
2991
|
interface SetReportBuilderInput {
|
|
2634
|
-
|
|
2992
|
+
/**
|
|
2993
|
+
* Column picker ids, a full column list, or `{ patch: { id, … } }` for sidebar
|
|
2994
|
+
* edits (expanded inside `setReport` into a full list and/or `chartAxes`).
|
|
2995
|
+
*/
|
|
2996
|
+
columns?: ColumnSelectorChangeValue | SetReportBuilderColumnInput[] | SetReportTableColumnSidebarPatch;
|
|
2635
2997
|
filters?: Filter[];
|
|
2636
2998
|
groupRowsBy?: string;
|
|
2637
2999
|
groupColumnsBy?: string;
|
|
@@ -2639,25 +3001,171 @@ interface SetReportBuilderInput {
|
|
|
2639
3001
|
index: number;
|
|
2640
3002
|
value: string;
|
|
2641
3003
|
};
|
|
2642
|
-
sort?: ReportBuilderSort[];
|
|
3004
|
+
sort?: ReportBuilderSort[] | string;
|
|
2643
3005
|
limit?: ReportBuilderLimit | null;
|
|
2644
3006
|
chartType?: string;
|
|
3007
|
+
/** When set, updates chart legend visibility (same source as `showLegend` from `useReport`). */
|
|
3008
|
+
showLegend?: boolean;
|
|
3009
|
+
/** When set, merges into chart axis edits (use with returned `xAxis` / `yAxis` / options). */
|
|
3010
|
+
chartAxes?: SetReportChartAxesInput;
|
|
3011
|
+
/**
|
|
3012
|
+
* Schema table names for datasource / multi-table picker UIs.
|
|
3013
|
+
* Empty array clears the override (report base tables apply again).
|
|
3014
|
+
*/
|
|
3015
|
+
datasources?: string[];
|
|
2645
3016
|
}
|
|
2646
|
-
interface
|
|
3017
|
+
interface UseReportOptions {
|
|
2647
3018
|
useInMemoryEngines?: boolean;
|
|
3019
|
+
reportOverride?: QuillReportInternal | null;
|
|
3020
|
+
initialReportBuilderState?: ReportBuilderState | null;
|
|
3021
|
+
/**
|
|
3022
|
+
* When the report payload has no `dashboardName` and the client has no
|
|
3023
|
+
* `defaultDashboard`, use this for engine tasks that require a dashboard
|
|
3024
|
+
* (e.g. filter unique values).
|
|
3025
|
+
*/
|
|
3026
|
+
destinationDashboardName?: string;
|
|
3027
|
+
/**
|
|
3028
|
+
* When true (default), filter pickers, pivot row/column group-by options,
|
|
3029
|
+
* aggregation field dropdowns, and filter-builder field lists only include
|
|
3030
|
+
* columns from the selected datasource
|
|
3031
|
+
* tables (`setReport({ datasources })` / report base tables)—not other tables that
|
|
3032
|
+
* happen to be FK-joinable but were not selected. When false, behaviour matches
|
|
3033
|
+
* the prior schema-wide option lists when no table scope applies.
|
|
3034
|
+
*/
|
|
3035
|
+
restrictFieldOptionsToSelectedDatasources?: boolean;
|
|
2648
3036
|
}
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
3037
|
+
/**
|
|
3038
|
+
* `saveChanges` from `useReport`. Always returns a Promise so UIs can `await`
|
|
3039
|
+
* before navigation or feedback. Resolves to `undefined` when persist is skipped
|
|
3040
|
+
* (e.g. missing client, dashboard name, or report state).
|
|
3041
|
+
*/
|
|
3042
|
+
type UseReportSaveChangesFn = () => Promise<unknown>;
|
|
3043
|
+
/**
|
|
3044
|
+
* @param reportIdArg When omitted, the hook can bootstrap a report via `saveReport`
|
|
3045
|
+
* (`create-report`) on the first `setReport({ datasources })`, after schema is available.
|
|
3046
|
+
* Use `destinationDashboardName` so the server can resolve a dashboard for create-report.
|
|
3047
|
+
*/
|
|
3048
|
+
declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
|
|
3049
|
+
/** True while `report-builder-unique-values` runs for filter value options (not chart/table load). */
|
|
3050
|
+
filterUniqueValuesLoading: boolean;
|
|
3051
|
+
limit: ReportBuilderLimit | null;
|
|
3052
|
+
chartTypes: {
|
|
3053
|
+
label: string;
|
|
3054
|
+
value: string;
|
|
3055
|
+
}[];
|
|
3056
|
+
columnsOptions: ColumnSelectionOption[];
|
|
3057
|
+
tableColumnOptions: ColumnSelectionOption[];
|
|
3058
|
+
tableColumns: TableColumnsController;
|
|
3059
|
+
setReport: (nextState: SetReportBuilderInput) => void;
|
|
3060
|
+
saveChanges: UseReportSaveChangesFn;
|
|
3061
|
+
setFilters: (nextFilters: QueryBuilderRuleGroup) => void;
|
|
3062
|
+
setReportBuilder: (nextState: SetReportBuilderInput) => void;
|
|
3063
|
+
/** Current report-builder slice (tables, columns, filters, pivot, sort); pass to e.g. `Chat` as `reportBuilderState`. */
|
|
3064
|
+
reportBuilderState: ReportBuilderState | undefined;
|
|
3065
|
+
filterDraftKey: string;
|
|
3066
|
+
filterDraftQueryBuilderProps: FilterDraftQueryBuilderProps;
|
|
3067
|
+
isFilterDraftDirty: boolean;
|
|
3068
|
+
isFilterDraftEmpty: boolean;
|
|
3069
|
+
commitFilterDraft: () => void;
|
|
3070
|
+
resetFilterDraft: () => void;
|
|
3071
|
+
seedFilterDraft: () => void;
|
|
3072
|
+
chart: {
|
|
3073
|
+
xAxisField: string;
|
|
3074
|
+
xAxisFormat: AxisFormat$1;
|
|
3075
|
+
xAxisLabel: string;
|
|
3076
|
+
yAxisFields: {
|
|
3077
|
+
field: string;
|
|
3078
|
+
label: string;
|
|
3079
|
+
format: AxisFormat$1;
|
|
3080
|
+
}[];
|
|
3081
|
+
columns: Column$1[];
|
|
3082
|
+
pivotQuery?: string;
|
|
3083
|
+
comparisonPivotQuery?: string;
|
|
3084
|
+
itemQuery?: string[];
|
|
3085
|
+
referencedTables?: string[];
|
|
3086
|
+
referencedColumns?: {
|
|
3087
|
+
[table: string]: string[];
|
|
3088
|
+
};
|
|
3089
|
+
error?: string;
|
|
3090
|
+
adminError?: string;
|
|
3091
|
+
triggerReload?: boolean;
|
|
3092
|
+
columnInternal: ColumnInternal[];
|
|
3093
|
+
loadingRows?: boolean;
|
|
3094
|
+
flags?: {
|
|
3095
|
+
[tenantField: string]: string[] | "QUILL_ALL_TENANTS";
|
|
3096
|
+
};
|
|
3097
|
+
reportBuilderState?: ReportBuilderState;
|
|
3098
|
+
uniqueStringsByTable?: UniqueValuesByTable;
|
|
3099
|
+
uniqueStringsByColumn?: UniqueValuesByColumn;
|
|
3100
|
+
columnUniqueValues?: UniqueValuesByColumn;
|
|
3101
|
+
uniqueValues?: UniqueValuesByColumn;
|
|
2652
3102
|
id: string;
|
|
2653
3103
|
name: string;
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
3104
|
+
dashboardName: string;
|
|
3105
|
+
rows: {
|
|
3106
|
+
[key: string]: string;
|
|
3107
|
+
}[];
|
|
3108
|
+
chartType: string;
|
|
3109
|
+
showLegend?: boolean;
|
|
3110
|
+
dateField?: {
|
|
3111
|
+
table: string;
|
|
3112
|
+
field: string;
|
|
3113
|
+
};
|
|
3114
|
+
pivot: Pivot | null;
|
|
3115
|
+
template?: boolean;
|
|
3116
|
+
order: number;
|
|
3117
|
+
compareRows: {
|
|
3118
|
+
[key: string]: string;
|
|
3119
|
+
}[];
|
|
3120
|
+
filtersApplied?: InternalFilter[];
|
|
3121
|
+
pagination?: Pagination;
|
|
3122
|
+
sort?: {
|
|
3123
|
+
field: string;
|
|
3124
|
+
direction: string;
|
|
3125
|
+
};
|
|
3126
|
+
rowCount: number;
|
|
3127
|
+
queryString: string;
|
|
3128
|
+
filterMap?: {
|
|
3129
|
+
[key: string]: {
|
|
3130
|
+
table: string;
|
|
3131
|
+
field: string;
|
|
3132
|
+
};
|
|
3133
|
+
};
|
|
3134
|
+
referenceLines?: {
|
|
3135
|
+
label: string;
|
|
3136
|
+
query: [number, number] | string;
|
|
3137
|
+
}[];
|
|
3138
|
+
referenceLineYValues?: {
|
|
3139
|
+
label: string;
|
|
3140
|
+
query: [number, number];
|
|
2658
3141
|
}[];
|
|
3142
|
+
includeCustomFields?: boolean;
|
|
3143
|
+
columnsWithCustomFields?: Column$1[];
|
|
3144
|
+
pivotRows?: {
|
|
3145
|
+
[key: string]: string;
|
|
3146
|
+
}[];
|
|
3147
|
+
pivotColumns?: ColumnInternal[];
|
|
3148
|
+
pivotRowCount?: number;
|
|
3149
|
+
} | undefined;
|
|
3150
|
+
chartLoading: boolean;
|
|
3151
|
+
table: UseFormTable;
|
|
3152
|
+
tableLoading: boolean;
|
|
3153
|
+
loading: boolean;
|
|
3154
|
+
/** Report title: matching `sourceReport.name`, else `report-name` task, else empty. */
|
|
3155
|
+
name: string;
|
|
3156
|
+
/**
|
|
3157
|
+
* Resolved report id: the `reportId` argument when provided, otherwise the id
|
|
3158
|
+
* returned from `create-report` after the first datasource selection.
|
|
3159
|
+
*/
|
|
3160
|
+
reportId: string | undefined;
|
|
3161
|
+
datasources: {
|
|
3162
|
+
id: string;
|
|
3163
|
+
label: string;
|
|
3164
|
+
}[];
|
|
3165
|
+
datasourceOptions: {
|
|
3166
|
+
id: string;
|
|
3167
|
+
label: string;
|
|
2659
3168
|
}[];
|
|
2660
|
-
filters: Filter[];
|
|
2661
3169
|
groupRowsBy: string | undefined;
|
|
2662
3170
|
groupRowsByOptions: SelectOption[];
|
|
2663
3171
|
groupColumnsBy: string | undefined;
|
|
@@ -2666,53 +3174,162 @@ declare function useForm(reportId: string, options?: UseFormOptions): {
|
|
|
2666
3174
|
valueField: string;
|
|
2667
3175
|
valueField2?: string;
|
|
2668
3176
|
aggregationType: AggregationType;
|
|
3177
|
+
/** Resolved datasource table for `valueField` (mirrors `aggregationTablesByIndex`). */
|
|
3178
|
+
valueFieldTable?: string;
|
|
2669
3179
|
}>[];
|
|
3180
|
+
aggregationOptions: AggregationOption[];
|
|
2670
3181
|
aggregationDescriptionOptions: {
|
|
2671
3182
|
label: string;
|
|
2672
3183
|
value: string;
|
|
2673
3184
|
}[];
|
|
2674
|
-
|
|
2675
|
-
|
|
3185
|
+
sort: string;
|
|
3186
|
+
sortOptions: {
|
|
2676
3187
|
label: string;
|
|
2677
3188
|
value: string;
|
|
2678
3189
|
}[];
|
|
2679
|
-
|
|
2680
|
-
|
|
3190
|
+
chartType: string | undefined;
|
|
3191
|
+
chartTypeOptions: {
|
|
2681
3192
|
label: string;
|
|
2682
3193
|
value: string;
|
|
2683
3194
|
}[];
|
|
2684
|
-
|
|
3195
|
+
/** Encoded field keys for the current column selection (for `setReport({ columns })`, etc.). */
|
|
3196
|
+
columnIds: ColumnSelectorChangeValue;
|
|
3197
|
+
/** Selected columns + `reorder` / `toggle` / `update` / `remove`. */
|
|
3198
|
+
columns: TableColumnsController;
|
|
3199
|
+
/** Schema columns for current datasources — pool for the table column picker. */
|
|
3200
|
+
columnOptions: ColumnSelectionOption[];
|
|
3201
|
+
xAxis: {
|
|
3202
|
+
field: string;
|
|
3203
|
+
format: AxisFormat;
|
|
3204
|
+
options: ChartAxisFieldOption[];
|
|
3205
|
+
formatOptions: SelectOption[];
|
|
3206
|
+
update: (updates: Partial<{
|
|
3207
|
+
field: string;
|
|
3208
|
+
format: AxisFormat;
|
|
3209
|
+
}>) => void;
|
|
3210
|
+
};
|
|
3211
|
+
xAxisOptions: {
|
|
3212
|
+
value: string;
|
|
2685
3213
|
label: string;
|
|
3214
|
+
format: string;
|
|
3215
|
+
}[];
|
|
3216
|
+
yAxis: {
|
|
3217
|
+
items: ChartYAxisControllerItem[];
|
|
3218
|
+
options: ChartAxisFieldOption[];
|
|
3219
|
+
formatOptions: SelectOption[];
|
|
3220
|
+
add: (field?: string) => void;
|
|
3221
|
+
remove: (id: string) => void;
|
|
3222
|
+
reorder: (oldIndex: number, newIndex: number) => void;
|
|
3223
|
+
update: (id: string, updates: Partial<{
|
|
3224
|
+
field: string;
|
|
3225
|
+
label: string;
|
|
3226
|
+
format: AxisFormat;
|
|
3227
|
+
}>) => void;
|
|
3228
|
+
};
|
|
3229
|
+
yAxisOptions: {
|
|
2686
3230
|
value: string;
|
|
3231
|
+
label: string;
|
|
3232
|
+
format: string;
|
|
2687
3233
|
}[];
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
3234
|
+
/** Same strings as `axisSelectFormatLabels` (X/Y share chart format presets). */
|
|
3235
|
+
xAxisFormatOptions: string[];
|
|
3236
|
+
yAxisFormatOptions: string[];
|
|
3237
|
+
/** Table column format dropdown labels (same set as chart axis formats). */
|
|
3238
|
+
tableFormatOptions: string[];
|
|
3239
|
+
showLegend: boolean;
|
|
3240
|
+
axisConfig: UseFormAxisConfig;
|
|
3241
|
+
availableFields: {
|
|
3242
|
+
id: string;
|
|
3243
|
+
label: string;
|
|
3244
|
+
type: string;
|
|
3245
|
+
}[];
|
|
3246
|
+
axisSelectFormatLabels: string[];
|
|
3247
|
+
/** @deprecated Prefer top-level `xAxis`, `yAxis`, and `showLegend`. */
|
|
3248
|
+
chartAxes: ChartAxesController;
|
|
3249
|
+
/** @deprecated Prefer top-level `xAxisOptions` / `yAxisOptions`. */
|
|
3250
|
+
chartAxisOptions: {
|
|
3251
|
+
xAxis: {
|
|
3252
|
+
value: string;
|
|
3253
|
+
label: string;
|
|
3254
|
+
format: string;
|
|
3255
|
+
}[];
|
|
3256
|
+
yAxis: {
|
|
3257
|
+
value: string;
|
|
3258
|
+
label: string;
|
|
3259
|
+
format: string;
|
|
3260
|
+
}[];
|
|
3261
|
+
};
|
|
3262
|
+
hasTableDrivenColumnOrder: boolean;
|
|
3263
|
+
filters: QueryBuilderRuleGroup;
|
|
3264
|
+
filterQueryBuilderProps: UseFormQueryBuilderProps;
|
|
2692
3265
|
};
|
|
2693
3266
|
|
|
3267
|
+
/** Normalize react-querybuilder filter trees before stack conversion / persistence. */
|
|
3268
|
+
type QueryBuilderDisplayRule = {
|
|
3269
|
+
id?: unknown;
|
|
3270
|
+
field?: unknown;
|
|
3271
|
+
operator?: unknown;
|
|
3272
|
+
value?: unknown;
|
|
3273
|
+
};
|
|
3274
|
+
type QueryBuilderDisplayGroup = {
|
|
3275
|
+
combinator?: unknown;
|
|
3276
|
+
rules: unknown[];
|
|
3277
|
+
};
|
|
3278
|
+
declare const isQueryBuilderDisplayGroup: (value: unknown) => value is QueryBuilderDisplayGroup;
|
|
3279
|
+
declare const isQueryBuilderDisplayRule: (value: unknown) => value is QueryBuilderDisplayRule;
|
|
3280
|
+
declare const stripQueryBuilderTransientFields: (value: unknown, seen?: WeakMap<object, unknown>) => unknown;
|
|
3281
|
+
/** Merge relative-date rule values against a prior tree (typically last committed filters). */
|
|
3282
|
+
declare const normalizeRelativeDateRules: (nextQuery: unknown, previousQuery: unknown) => unknown;
|
|
3283
|
+
/** Strip + relative-date normalization used by `useReport` `setFilters` and draft-vs-committed UI. */
|
|
3284
|
+
declare function prepareQueryBuilderFiltersForSet(next: unknown, previousCommitted: unknown): unknown;
|
|
3285
|
+
/**
|
|
3286
|
+
* Whether a react-querybuilder draft differs from committed filters in a way that matters
|
|
3287
|
+
* for Apply (ignores transient `id` / `path`, etc.).
|
|
3288
|
+
*/
|
|
3289
|
+
declare function areQueryBuilderFilterDraftsDirty(draft: unknown, committed: unknown): boolean;
|
|
3290
|
+
/** Number of leaf filter rules (excludes empty groups). */
|
|
3291
|
+
declare function countFilterRules(value: unknown): number;
|
|
3292
|
+
|
|
3293
|
+
type ReportDetailProps = {
|
|
3294
|
+
/** Display name from the loaded report (e.g. `useReport` `name`). Rendered above the chart when non-empty. */
|
|
3295
|
+
reportTitle?: string;
|
|
3296
|
+
chart?: any;
|
|
3297
|
+
chartLoading: boolean;
|
|
3298
|
+
table?: {
|
|
3299
|
+
columns?: unknown[];
|
|
3300
|
+
rows?: unknown[];
|
|
3301
|
+
};
|
|
3302
|
+
tableLoading: boolean;
|
|
3303
|
+
showLegend?: boolean;
|
|
3304
|
+
/** Strip QuillTable's outer frame when chart type is `table` (cell borders unchanged). */
|
|
3305
|
+
hideTableChartOuterBorder?: boolean;
|
|
3306
|
+
};
|
|
3307
|
+
declare function ReportDetail({ reportTitle, chart, chartLoading, table, tableLoading, showLegend, hideTableChartOuterBorder, }: ReportDetailProps): react_jsx_runtime.JSX.Element;
|
|
3308
|
+
|
|
2694
3309
|
declare const quillFormat: ({ value, format, }: {
|
|
2695
3310
|
value: any;
|
|
2696
3311
|
format: string;
|
|
2697
3312
|
}) => string;
|
|
2698
3313
|
|
|
3314
|
+
/** Refetch dashboard config and filters; optional report upsert/delete and filter overrides. */
|
|
3315
|
+
type UseDashboardReload = (overrideDashboardName?: string, fetchFromServer?: boolean, reportAction?: {
|
|
3316
|
+
report: QuillReport | {
|
|
3317
|
+
id: string;
|
|
3318
|
+
};
|
|
3319
|
+
action: 'upsert' | 'delete';
|
|
3320
|
+
}, overrideFilters?: {
|
|
3321
|
+
filters: InternalDashboardFilter[];
|
|
3322
|
+
editedFilterLabel?: string;
|
|
3323
|
+
refetchReports?: boolean;
|
|
3324
|
+
}, options?: {
|
|
3325
|
+
preserveExistingDateFilter?: boolean;
|
|
3326
|
+
}) => Promise<void>;
|
|
2699
3327
|
declare const useDashboardInternal: (dashboardName: string | null, customFilters?: InternalFilter[]) => {
|
|
2700
3328
|
data: DashboardConfig | null;
|
|
2701
3329
|
dashboardFilters: InternalDashboardFilter[] | null;
|
|
2702
3330
|
isLoading: boolean | undefined;
|
|
2703
3331
|
isDashboardFilterLoading: (filterName: string) => boolean | undefined;
|
|
2704
|
-
reload:
|
|
2705
|
-
report: QuillReport | {
|
|
2706
|
-
id: string;
|
|
2707
|
-
};
|
|
2708
|
-
action: "upsert" | "delete";
|
|
2709
|
-
}, overrideFilters?: {
|
|
2710
|
-
filters: InternalDashboardFilter[];
|
|
2711
|
-
editedFilterLabel?: string;
|
|
2712
|
-
refetchReports?: boolean;
|
|
2713
|
-
}, options?: {
|
|
2714
|
-
preserveExistingDateFilter?: boolean;
|
|
2715
|
-
}) => Promise<void>;
|
|
3332
|
+
reload: UseDashboardReload;
|
|
2716
3333
|
setSectionOrder: (sectionOrder: {
|
|
2717
3334
|
section: string;
|
|
2718
3335
|
_id?: string;
|
|
@@ -2768,6 +3385,12 @@ declare const useDashboards: () => {
|
|
|
2768
3385
|
}) => Promise<void>;
|
|
2769
3386
|
deleteDashboard: (name: string) => Promise<void>;
|
|
2770
3387
|
};
|
|
3388
|
+
/**
|
|
3389
|
+
* `reload` is the same reference as `useDashboardInternal(dashboardName).reload`.
|
|
3390
|
+
* Use after structural changes or report upsert/delete; use `applyFilters` for
|
|
3391
|
+
* filter-value updates; use `forceCacheRefresh` to bypass cached report payloads
|
|
3392
|
+
* when cache is on. Calling `reload` every render adds network load.
|
|
3393
|
+
*/
|
|
2771
3394
|
declare const useDashboard: (dashboardName: string, config?: {
|
|
2772
3395
|
pageSize?: number;
|
|
2773
3396
|
cacheEnabled?: boolean;
|
|
@@ -2792,6 +3415,7 @@ declare const useDashboard: (dashboardName: string, config?: {
|
|
|
2792
3415
|
} | Filter>) => void;
|
|
2793
3416
|
lastUpdated: number;
|
|
2794
3417
|
forceCacheRefresh: () => void;
|
|
3418
|
+
reload: UseDashboardReload;
|
|
2795
3419
|
};
|
|
2796
3420
|
declare const useDashboardReport: (reportId: string, config?: {
|
|
2797
3421
|
initialFilters?: Filter[];
|
|
@@ -2804,29 +3428,6 @@ declare const useDashboardReport: (reportId: string, config?: {
|
|
|
2804
3428
|
fetchNextPage: () => Promise<void>;
|
|
2805
3429
|
};
|
|
2806
3430
|
|
|
2807
|
-
/**
|
|
2808
|
-
* Represents a table object returned from /schema2/:id
|
|
2809
|
-
*/
|
|
2810
|
-
type Table = {
|
|
2811
|
-
_id: string;
|
|
2812
|
-
isSelectStar: boolean;
|
|
2813
|
-
displayName: string;
|
|
2814
|
-
name: string;
|
|
2815
|
-
description?: string;
|
|
2816
|
-
columns: ColumnInternal[];
|
|
2817
|
-
viewQuery: string;
|
|
2818
|
-
customFieldInfo: any;
|
|
2819
|
-
broken?: boolean;
|
|
2820
|
-
error?: string;
|
|
2821
|
-
ownerTenantFields?: string[];
|
|
2822
|
-
};
|
|
2823
|
-
interface UniqueValuesByTable {
|
|
2824
|
-
[table: string]: UniqueValuesByColumn;
|
|
2825
|
-
}
|
|
2826
|
-
interface UniqueValuesByColumn {
|
|
2827
|
-
[column: string]: string[];
|
|
2828
|
-
}
|
|
2829
|
-
|
|
2830
3431
|
type ForeignKeyMap = {
|
|
2831
3432
|
[table: string]: {
|
|
2832
3433
|
foreignTable: string;
|
|
@@ -2918,7 +3519,7 @@ type ReportBuilder = {
|
|
|
2918
3519
|
sortField: string;
|
|
2919
3520
|
sortDirection: 'ASC' | 'DESC';
|
|
2920
3521
|
} | undefined, fieldKey: 'rowField' | 'columnField' | 'aggregations' | 'rowLimit' | 'sort') => Promise<void>;
|
|
2921
|
-
filteredSchema: Table[];
|
|
3522
|
+
filteredSchema: Table$1[];
|
|
2922
3523
|
foreignKeyMap: ForeignKeyMap;
|
|
2923
3524
|
schemaData: any;
|
|
2924
3525
|
client: any;
|
|
@@ -3107,27 +3708,27 @@ type CustomField = {
|
|
|
3107
3708
|
};
|
|
3108
3709
|
|
|
3109
3710
|
declare const useVirtualTables: () => {
|
|
3110
|
-
data: Table[];
|
|
3711
|
+
data: Table$1[];
|
|
3111
3712
|
isLoading: boolean;
|
|
3112
3713
|
loadingTables: {
|
|
3113
3714
|
[key: string]: boolean;
|
|
3114
3715
|
};
|
|
3115
3716
|
reloadAll: (client: any, caller?: string) => Promise<{
|
|
3116
|
-
schema: Table[];
|
|
3717
|
+
schema: Table$1[];
|
|
3117
3718
|
customFields: {
|
|
3118
3719
|
[tableName: string]: CustomField[];
|
|
3119
3720
|
} | null;
|
|
3120
3721
|
isSchemaLoading: boolean;
|
|
3121
3722
|
}>;
|
|
3122
3723
|
reloadSome: (client: any, tableIds: string[], caller?: string) => Promise<{
|
|
3123
|
-
schema: Table[];
|
|
3724
|
+
schema: Table$1[];
|
|
3124
3725
|
customFields: {
|
|
3125
3726
|
[tableName: string]: CustomField[];
|
|
3126
3727
|
} | null;
|
|
3127
3728
|
isSchemaLoading: boolean;
|
|
3128
3729
|
}>;
|
|
3129
|
-
refreshSome: (client: any, tables: Table[]) => Promise<{
|
|
3130
|
-
schema: Table[];
|
|
3730
|
+
refreshSome: (client: any, tables: Table$1[]) => Promise<{
|
|
3731
|
+
schema: Table$1[];
|
|
3131
3732
|
customFields: {
|
|
3132
3733
|
[tableName: string]: CustomField[];
|
|
3133
3734
|
} | null;
|
|
@@ -3261,42 +3862,6 @@ interface LimitPopoverComponentProps {
|
|
|
3261
3862
|
disabled?: boolean;
|
|
3262
3863
|
}
|
|
3263
3864
|
|
|
3264
|
-
interface TableComponentProps {
|
|
3265
|
-
rows: object[];
|
|
3266
|
-
rowCount?: number;
|
|
3267
|
-
rowCountIsLoading?: boolean;
|
|
3268
|
-
columns: {
|
|
3269
|
-
label: string;
|
|
3270
|
-
field: string;
|
|
3271
|
-
}[];
|
|
3272
|
-
currentPage: number;
|
|
3273
|
-
sort?: {
|
|
3274
|
-
field: string;
|
|
3275
|
-
direction: string;
|
|
3276
|
-
};
|
|
3277
|
-
className?: string;
|
|
3278
|
-
containerStyle?: React$1.CSSProperties;
|
|
3279
|
-
isLoading?: boolean;
|
|
3280
|
-
hideCSVDownloadButton?: boolean;
|
|
3281
|
-
downloadCSV?: () => void;
|
|
3282
|
-
LoadingComponent?: () => React$1.JSX.Element;
|
|
3283
|
-
DownloadCSVButtonComponent?: (props: ButtonComponentProps) => React$1.JSX.Element;
|
|
3284
|
-
rowsPerPage?: number;
|
|
3285
|
-
emptyStateLabel?: string;
|
|
3286
|
-
onPageChange?: (page: number) => void;
|
|
3287
|
-
onSortChange?: (sort: {
|
|
3288
|
-
field: string;
|
|
3289
|
-
direction: string;
|
|
3290
|
-
}) => void;
|
|
3291
|
-
headerBackgroundColor?: string;
|
|
3292
|
-
footerBackgroundColor?: string;
|
|
3293
|
-
borderRadius?: string | number;
|
|
3294
|
-
borderLeft?: string;
|
|
3295
|
-
borderRight?: string;
|
|
3296
|
-
borderTop?: string;
|
|
3297
|
-
borderBottom?: string;
|
|
3298
|
-
}
|
|
3299
|
-
|
|
3300
3865
|
interface DateRangePickerComponentProps {
|
|
3301
3866
|
preset: string;
|
|
3302
3867
|
label?: string;
|
|
@@ -3769,4 +4334,4 @@ interface ReportTableProps {
|
|
|
3769
4334
|
}
|
|
3770
4335
|
declare const ReportTable: ({ reportBuilder, TableComponent, }: ReportTableProps) => react_jsx_runtime.JSX.Element;
|
|
3771
4336
|
|
|
3772
|
-
export { ALL_TENANTS, AddColumns, AddFilters, AddLimit, AddPivot, AddSort, type AxisFormat, type ButtonComponentProps, Calculation, type ChangelogEntry, Chart, ChartDisplay, ChartEditor, type ChartEditorProps, type ChartProps, Chat, type ChatProps, type CheckboxComponentProps, type ColorMapType, type Column$1 as Column, type ContainerComponentProps, Dashboard, type DashboardDateFilter, type DashboardFilter, DashboardFilterType, DashboardLegacy, type DashboardLegacyProps, type DashboardMultiFilter, type DashboardProps, type DashboardSectionComponentProps, type DashboardSingleFilter, type DashboardTenantFilter, DateOperator, type DateRange, type DateRangePickerComponentProps, type DateRangePickerOption, type DeleteButtonComponentProps, type DraggableColumnComponentProps, type EventBreadcrumb, type EventContext, type EventError, type EventMetadata, type EventTracking, type EventUser, type Filter, type FilterPopoverComponentProps, FilterType, type HeaderComponentProps, type HeaderProps, type InternalDashboardDateFilter, type InternalDashboardTenantFilter, type InternalFilter, type LabelComponentProps, type LimitPopoverComponentProps, type ModalComponentProps, NullOperator, NumberOperator, type Option, type Pivot, type PopoverComponentProps, type QuillCustomInterval, type QuillCustomRelativeInterval, type QuillCustomRepeatingInterval, type QuillCustomStaticInterval, type QuillFetchOptions, type QuillPreviousMonthInterval, type QuillPreviousQuarterInterval, QuillProvider, type QuillProviderProps, type QuillReport, type QuillReportProps, type QuillResults, type QuillTheme, type QuillWeekInterval, ReportBuilder$1 as ReportBuilder, type ReportBuilderColumn, type ReportBuilderLimit, type ReportBuilderProps, type ReportBuilderSort, type ReportBuilderState, ReportTable, SINGLE_TENANT, SQLEditor, type SQLEditorProps, SaveReport, SchemaListComponent, type SelectColumnComponentProps, type SelectComponentProps, type SidebarComponentProps, type SidebarHeadingComponentProps, type SortPopoverComponentProps, StaticChart, type StaticChartProps, StringOperator, Table
|
|
4337
|
+
export { ALL_TENANTS, AddColumns, AddFilters, AddLimit, AddPivot, AddSort, type AxisFormat$1 as AxisFormat, type ButtonComponentProps, Calculation, type ChangelogEntry, Chart, ChartDisplay, ChartEditor, type ChartEditorProps, type ChartProps, Chat, type ChatModelId, type ChatProps, type CheckboxComponentProps, type ColorMapType, type Column$1 as Column, type ColumnSelectionOption, type ContainerComponentProps, Dashboard, type DashboardDateFilter, type DashboardFilter, DashboardFilterType, DashboardLegacy, type DashboardLegacyProps, type DashboardMultiFilter, type DashboardProps, type DashboardSectionComponentProps, type DashboardSingleFilter, type DashboardTenantFilter, DateOperator, type DateRange, type DateRangePickerComponentProps, type DateRangePickerOption, type DeleteButtonComponentProps, type DraggableColumnComponentProps, type EventBreadcrumb, type EventContext, type EventError, type EventMetadata, type EventTracking, type EventUser, type Filter, type FilterDraftQueryBuilderProps, type FilterPopoverComponentProps, FilterType, type HeaderComponentProps, type HeaderProps, type InternalDashboardDateFilter, type InternalDashboardTenantFilter, type InternalFilter, type LabelComponentProps, type LimitPopoverComponentProps, type ModalComponentProps, NullOperator, NumberOperator, type Option, type Pivot, type PivotAggregation, type PopoverComponentProps, type QueryBuilderDisplayGroup, type QueryBuilderDisplayRule, type QuillCustomInterval, type QuillCustomRelativeInterval, type QuillCustomRepeatingInterval, type QuillCustomStaticInterval, type QuillFetchOptions, type QuillPreviousMonthInterval, type QuillPreviousQuarterInterval, QuillProvider, type QuillProviderProps, type QuillReport, type QuillReportProps, type QuillResults, type QuillTheme, type QuillWeekInterval, ReportBuilder$1 as ReportBuilder, type ReportBuilderColumn, type ReportBuilderLimit, type ReportBuilderProps, type ReportBuilderSort, type ReportBuilderState, ReportDetail, type ReportDetailProps, ReportTable, SINGLE_TENANT, SQLEditor, type SQLEditorProps, SaveReport, SchemaListComponent, type SelectColumnComponentProps, type SelectComponentProps, type SetReportBuilderInput, type SetReportChartAxesInput, type SetReportTableColumnSidebarPatch, type SidebarComponentProps, type SidebarHeadingComponentProps, type SortPopoverComponentProps, StaticChart, type StaticChartProps, StringOperator, Table, type TableColumnListItem, type TableColumnsController, type TableColumnsControllerItem, type TableComponentProps, type TableProps, type TabsComponentProps, type TextComponentProps, type TextInputComponentProps, ThemeContext, type UseDashboardReload, type UseFormAxisConfig, type UseFormQueryBuilderField, type UseFormQueryBuilderProps, type UseReportFilterDraft, areQueryBuilderFilterDraftsDirty, buildSeededFilterQuery, countFilterRules, defaultFilterRuleValueForOperator, downloadCSV, quillFormat as format, isQueryBuilderDisplayGroup, isQueryBuilderDisplayRule, normalizeRelativeDateRules, prepareQueryBuilderFiltersForSet, quillFetch, stripQueryBuilderTransientFields, tableColumnFormatFromUiSelection, useAllReports, useAskQuill, useChangelogRefresh, useDashboard, useDashboardInternal, useDashboardReport, useDashboardReports, useDashboards, useExport, useMemoizedRows, useQuill, useReport, useReportBuilder, useReports, useTenants, useVirtualTables };
|