@quillsql/react 2.16.48 → 2.16.50
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 +1415 -834
- package/dist/index.d.cts +227 -219
- package/dist/index.d.ts +227 -219
- package/dist/index.js +1459 -879
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -357,6 +357,9 @@ interface InternalDateCustomFilter extends BaseFilter {
|
|
|
357
357
|
startDate: string;
|
|
358
358
|
endDate: string;
|
|
359
359
|
};
|
|
360
|
+
/** Present when created via UI `inBucket`; used to reproject public `filters`. */
|
|
361
|
+
dateBucket?: 'day' | 'week' | 'month' | 'year';
|
|
362
|
+
fromInBucket?: boolean;
|
|
360
363
|
}
|
|
361
364
|
interface InternalDateComparisonFilter extends BaseFilter {
|
|
362
365
|
filterType: InternalFilterType.DateComparisonFilter;
|
|
@@ -561,7 +564,31 @@ interface BasePivot {
|
|
|
561
564
|
rowLimit?: number;
|
|
562
565
|
columnValues?: string[];
|
|
563
566
|
dateBucket?: 'day' | 'week' | 'month' | 'year';
|
|
567
|
+
/**
|
|
568
|
+
* Display-only drilldown pick list for the row dimension.
|
|
569
|
+
* Attached on `useReport().chart.pivot` only — not sent to the engine.
|
|
570
|
+
*/
|
|
571
|
+
rowFilter?: PivotDimensionFilter | null;
|
|
572
|
+
/**
|
|
573
|
+
* Display-only drilldown pick list for the column dimension.
|
|
574
|
+
* Attached on `useReport().chart.pivot` only — not sent to the engine.
|
|
575
|
+
*/
|
|
576
|
+
columnFilter?: PivotDimensionFilter | null;
|
|
564
577
|
}
|
|
578
|
+
/** Pick list + suggested operator for a pivot row/column drilldown control. */
|
|
579
|
+
type PivotDimensionFilter = {
|
|
580
|
+
field: string;
|
|
581
|
+
label: string;
|
|
582
|
+
fieldType: 'string' | 'date';
|
|
583
|
+
operator: 'in' | 'inBucket';
|
|
584
|
+
options: {
|
|
585
|
+
label: string;
|
|
586
|
+
value: string;
|
|
587
|
+
}[];
|
|
588
|
+
dateBucket?: 'day' | 'week' | 'month' | 'year';
|
|
589
|
+
/** Current selection from committed filters; null means “All”. */
|
|
590
|
+
value: string | null;
|
|
591
|
+
};
|
|
565
592
|
type PivotAggregation = {
|
|
566
593
|
aggregationType: AggregationType;
|
|
567
594
|
valueField?: string;
|
|
@@ -1606,6 +1633,7 @@ interface ChartDisplayProps extends WithConfig {
|
|
|
1606
1633
|
direction: string;
|
|
1607
1634
|
}) => void;
|
|
1608
1635
|
onClickChartElement?: (data: any) => void;
|
|
1636
|
+
onClickLegendElement?: (data: any) => void;
|
|
1609
1637
|
scrollable?: boolean;
|
|
1610
1638
|
overrideTheme?: QuillTheme;
|
|
1611
1639
|
referenceLines?: {
|
|
@@ -1618,7 +1646,7 @@ interface ChartDisplayProps extends WithConfig {
|
|
|
1618
1646
|
/** When `chartType` is `table`, applied to QuillTable's outer frame only (not cell lines). */
|
|
1619
1647
|
tableChartWrapperBorders?: Pick<TableComponentProps, 'borderRadius' | 'borderLeft' | 'borderRight' | 'borderTop' | 'borderBottom'>;
|
|
1620
1648
|
}
|
|
1621
|
-
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;
|
|
1649
|
+
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, onClickLegendElement, overrideTheme, referenceLines, showLegend, tableRowsLoading, tableChartWrapperBorders, }: ChartDisplayProps) => react_jsx_runtime.JSX.Element;
|
|
1622
1650
|
|
|
1623
1651
|
/**
|
|
1624
1652
|
* Props for the Quill Table component.
|
|
@@ -2692,6 +2720,7 @@ declare function ChartEditor({ isOpen, reportId, isAdmin, chartBuilderTitle, cha
|
|
|
2692
2720
|
interface StaticChartBaseProps {
|
|
2693
2721
|
reportId: string;
|
|
2694
2722
|
onClickChartElement?: (data: any) => void;
|
|
2723
|
+
onClickLegendElement?: (data: any) => void;
|
|
2695
2724
|
showLegend?: boolean;
|
|
2696
2725
|
}
|
|
2697
2726
|
type StaticChartProps = (StaticChartBaseProps & {
|
|
@@ -2735,50 +2764,11 @@ type QueryBuilderOperatorOption = {
|
|
|
2735
2764
|
label: string;
|
|
2736
2765
|
arity?: 'unary' | 'binary' | number;
|
|
2737
2766
|
};
|
|
2738
|
-
|
|
2739
2767
|
/**
|
|
2740
|
-
*
|
|
2741
|
-
*
|
|
2742
|
-
* with `listsAsArrays`; everything else starts as an empty string.
|
|
2768
|
+
* Expand UI `inBucket` leaf rules to `between` for react-querybuilder editors.
|
|
2769
|
+
* Custom UIs keep `inBucket` on `useReport().filters`; the draft boundary uses this.
|
|
2743
2770
|
*/
|
|
2744
|
-
declare const
|
|
2745
|
-
/**
|
|
2746
|
-
* One-rule react-querybuilder tree seeded from the first field in the catalog,
|
|
2747
|
-
* using that field's first operator and a matching default value. Used for the
|
|
2748
|
-
* "Add filter" empty state, where react-querybuilder's own "+ Rule" button is
|
|
2749
|
-
* not rendered yet.
|
|
2750
|
-
*/
|
|
2751
|
-
declare const buildSeededFilterQuery: (queryBuilderProps: Pick<UseFormQueryBuilderProps, "fields" | "getOperators"> | null | undefined) => QueryBuilderRuleGroup;
|
|
2752
|
-
type FilterDraftQueryBuilderProps = UseFormQueryBuilderProps & {
|
|
2753
|
-
/** Committed-or-draft tree react-querybuilder hydrates from on mount (uncontrolled mode). */
|
|
2754
|
-
defaultQuery: QueryBuilderRuleGroup;
|
|
2755
|
-
onQueryChange: (next: unknown) => void;
|
|
2756
|
-
addRuleToNewGroups: true;
|
|
2757
|
-
getDefaultValue: (rule: {
|
|
2758
|
-
operator?: unknown;
|
|
2759
|
-
}) => unknown;
|
|
2760
|
-
};
|
|
2761
|
-
type UseReportFilterDraft = {
|
|
2762
|
-
/**
|
|
2763
|
-
* Pass as `key` on `QueryBuilder` (not inside the spread — React warns on
|
|
2764
|
-
* spread `key`). Changes whenever react-querybuilder must rehydrate from
|
|
2765
|
-
* `defaultQuery`: report switch, committed filters change, field catalog
|
|
2766
|
-
* change, or `resetFilterDraft`.
|
|
2767
|
-
*/
|
|
2768
|
-
filterDraftKey: string;
|
|
2769
|
-
/** Spread onto `react-querybuilder`'s `QueryBuilder`: `<QueryBuilder key={filterDraftKey} {...filterDraftQueryBuilderProps} />`. */
|
|
2770
|
-
filterDraftQueryBuilderProps: FilterDraftQueryBuilderProps;
|
|
2771
|
-
/** Draft differs from committed filters (commit would change the report). */
|
|
2772
|
-
isFilterDraftDirty: boolean;
|
|
2773
|
-
/** Draft tree has no rules at all; show an "Add filter" affordance instead of the builder. */
|
|
2774
|
-
isFilterDraftEmpty: boolean;
|
|
2775
|
-
/** Commit the draft via `setFilters` (report/chart refresh follows). */
|
|
2776
|
-
commitFilterDraft: () => void;
|
|
2777
|
-
/** Drop the draft and rehydrate the builder from committed filters. */
|
|
2778
|
-
resetFilterDraft: () => void;
|
|
2779
|
-
/** Seed a first rule (field + operator + default value) and leave the empty state. */
|
|
2780
|
-
seedFilterDraft: () => void;
|
|
2781
|
-
};
|
|
2771
|
+
declare const queryBuilderFiltersForEditor: (group: QueryBuilderRuleGroup) => QueryBuilderRuleGroup;
|
|
2782
2772
|
|
|
2783
2773
|
/**
|
|
2784
2774
|
* Pagination types and pure helpers for `useReport`, mirroring the
|
|
@@ -2801,6 +2791,7 @@ type SelectOption = {
|
|
|
2801
2791
|
label: string;
|
|
2802
2792
|
value: string;
|
|
2803
2793
|
};
|
|
2794
|
+
type PivotDateBucket = NonNullable<Pivot['dateBucket']>;
|
|
2804
2795
|
type UseFormTableRow = Record<string, unknown>;
|
|
2805
2796
|
type UseFormTableColumn = {
|
|
2806
2797
|
label: string;
|
|
@@ -2858,26 +2849,13 @@ type ColumnSelectionOption = {
|
|
|
2858
2849
|
type UseFormDisplayColumn = ReportBuilderColumn & {
|
|
2859
2850
|
format?: string;
|
|
2860
2851
|
};
|
|
2861
|
-
type
|
|
2852
|
+
type ReportColumnInput = Partial<UseFormDisplayColumn> & {
|
|
2862
2853
|
field: string;
|
|
2863
2854
|
label?: string;
|
|
2864
2855
|
};
|
|
2865
|
-
type
|
|
2866
|
-
|
|
2867
|
-
label: string;
|
|
2868
|
-
defaultLabel: string;
|
|
2869
|
-
customLabel: string;
|
|
2870
|
-
/** Persisted axis format value (e.g. `whole_number`). */
|
|
2871
|
-
format: string;
|
|
2872
|
-
/** Format preset label (same strings as chart axis / `tableFormatOptions`). */
|
|
2873
|
-
formatLabel: string;
|
|
2874
|
-
field: string;
|
|
2875
|
-
tableName: string;
|
|
2876
|
-
};
|
|
2877
|
-
type TableColumnListItem = {
|
|
2878
|
-
id: string;
|
|
2856
|
+
type ReportColumnValue = {
|
|
2857
|
+
value: string;
|
|
2879
2858
|
label: string;
|
|
2880
|
-
visible: true;
|
|
2881
2859
|
/** Axis format preset label (matches `tableFormatOptions` / chart axis). */
|
|
2882
2860
|
format: string;
|
|
2883
2861
|
/**
|
|
@@ -2885,16 +2863,10 @@ type TableColumnListItem = {
|
|
|
2885
2863
|
*/
|
|
2886
2864
|
formatOptions?: string[];
|
|
2887
2865
|
};
|
|
2888
|
-
/**
|
|
2889
|
-
type
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
optionById: ReadonlyMap<string, ColumnSelectionOption>;
|
|
2893
|
-
byId: ReadonlyMap<string, TableColumnsControllerItem>;
|
|
2894
|
-
/** Ready-made rows for table/column-picker UIs (`id`, `label`, `format` display string). */
|
|
2895
|
-
columnList: TableColumnListItem[];
|
|
2896
|
-
/** Build the `columns` array for `setReport({ columns })` from ordered ids. */
|
|
2897
|
-
getSetReportColumns: (ids: string[]) => SetReportBuilderColumnInput[];
|
|
2866
|
+
/** Optional rich column operations. The primary form value is `columns`. */
|
|
2867
|
+
type ColumnActions = {
|
|
2868
|
+
/** Replace the selected columns with fully configured column values. */
|
|
2869
|
+
replace: (columns: ReportColumnInput[]) => void;
|
|
2898
2870
|
reorder: (oldIndex: number, newIndex: number) => void;
|
|
2899
2871
|
/** Reorder to match a full id list (e.g. after drag-and-drop column list UIs). */
|
|
2900
2872
|
reorderFromOrder: (nextIds: string[]) => void;
|
|
@@ -2905,21 +2877,21 @@ type TableColumnsController = {
|
|
|
2905
2877
|
label: string;
|
|
2906
2878
|
format: string;
|
|
2907
2879
|
}>) => void;
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
/**
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2880
|
+
};
|
|
2881
|
+
type ReportXAxisValue = {
|
|
2882
|
+
field: string;
|
|
2883
|
+
label: string;
|
|
2884
|
+
/** Format preset label matching `xAxisFormatOptions`. */
|
|
2885
|
+
format: string;
|
|
2886
|
+
};
|
|
2887
|
+
type ReportYAxisFieldValue = {
|
|
2888
|
+
field: string;
|
|
2889
|
+
label: string;
|
|
2890
|
+
/** Format preset label matching `yAxisFormatOptions`. */
|
|
2891
|
+
format: string;
|
|
2892
|
+
};
|
|
2893
|
+
type ReportYAxisValue = {
|
|
2894
|
+
fields: ReportYAxisFieldValue[];
|
|
2923
2895
|
};
|
|
2924
2896
|
type ChartAxisFieldOption = {
|
|
2925
2897
|
value: string;
|
|
@@ -2957,19 +2929,6 @@ type ChartAxesController = {
|
|
|
2957
2929
|
}>) => void;
|
|
2958
2930
|
};
|
|
2959
2931
|
};
|
|
2960
|
-
type ColumnSelectorChangeValue = string[];
|
|
2961
|
-
/**
|
|
2962
|
-
* Table column sidebar edit under {@link SetReportBuilderInput.columns}: expands
|
|
2963
|
-
* inside `setReport` to a full `columns` array and/or `chartAxes` (pivot table chart).
|
|
2964
|
-
*/
|
|
2965
|
-
type SetReportTableColumnSidebarPatch = {
|
|
2966
|
-
patch: {
|
|
2967
|
-
id: string;
|
|
2968
|
-
label?: string;
|
|
2969
|
-
format?: string;
|
|
2970
|
-
fieldId?: string;
|
|
2971
|
-
};
|
|
2972
|
-
};
|
|
2973
2932
|
type AggregationStateItem = Partial<{
|
|
2974
2933
|
valueField: string;
|
|
2975
2934
|
valueFieldType: string;
|
|
@@ -2979,12 +2938,6 @@ type AggregationStateItem = Partial<{
|
|
|
2979
2938
|
/** Resolved datasource table for `valueField` (mirrors `aggregationTablesByIndex`). */
|
|
2980
2939
|
valueFieldTable?: string;
|
|
2981
2940
|
}>;
|
|
2982
|
-
type AggregationOption = {
|
|
2983
|
-
key: string;
|
|
2984
|
-
label: string;
|
|
2985
|
-
value: string;
|
|
2986
|
-
options: SelectOption[];
|
|
2987
|
-
};
|
|
2988
2941
|
type AxisFormat = QuillReportInternal['yAxisFields'][number]['format'];
|
|
2989
2942
|
type QueryBuilderFieldValueOption = {
|
|
2990
2943
|
name: string;
|
|
@@ -3009,40 +2962,26 @@ type UseFormQueryBuilderProps = {
|
|
|
3009
2962
|
}) => 'text' | 'number' | 'date' | 'checkbox';
|
|
3010
2963
|
getValueEditorType: (field: string, operator: string, misc?: {
|
|
3011
2964
|
fieldData?: Partial<UseFormQueryBuilderField>;
|
|
3012
|
-
}) => 'multiselect' | undefined;
|
|
2965
|
+
}) => 'multiselect' | 'select' | undefined;
|
|
3013
2966
|
getValues: (field: string, operator: string, misc?: {
|
|
3014
2967
|
fieldData?: Partial<UseFormQueryBuilderField>;
|
|
3015
2968
|
}) => QueryBuilderFieldValueOption[];
|
|
3016
2969
|
};
|
|
3017
|
-
/**
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
label: string;
|
|
3024
|
-
format: string;
|
|
3025
|
-
show: boolean;
|
|
3026
|
-
rotation: number;
|
|
3027
|
-
fontSize: number;
|
|
3028
|
-
};
|
|
3029
|
-
yAxis: {
|
|
3030
|
-
fields: Array<{
|
|
3031
|
-
field: string;
|
|
3032
|
-
label: string;
|
|
3033
|
-
format: string;
|
|
3034
|
-
color: string;
|
|
3035
|
-
}>;
|
|
2970
|
+
/** Framework-agnostic filter value pick lists from `useReport` (string uniques + pivot date buckets). */
|
|
2971
|
+
type FilterFieldOptions = {
|
|
2972
|
+
field: string;
|
|
2973
|
+
fieldType: 'string' | 'date';
|
|
2974
|
+
operator: 'in' | 'inBucket';
|
|
2975
|
+
options: {
|
|
3036
2976
|
label: string;
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
fontSize: number;
|
|
3041
|
-
};
|
|
3042
|
-
legend: {
|
|
3043
|
-
show: boolean;
|
|
3044
|
-
};
|
|
2977
|
+
value: string;
|
|
2978
|
+
}[];
|
|
2979
|
+
dateBucket?: PivotDateBucket;
|
|
3045
2980
|
};
|
|
2981
|
+
/** Next filters, or a React-style updater from the current committed filters. */
|
|
2982
|
+
type SetFiltersInput = QueryBuilderRuleGroup | ((prev: QueryBuilderRuleGroup) => QueryBuilderRuleGroup);
|
|
2983
|
+
/** Maps table column format dropdown values to persisted report column `format` (used by `columnActions.update`). */
|
|
2984
|
+
declare function tableColumnFormatFromUiSelection(raw: string): string;
|
|
3046
2985
|
type SetReportChartAxesInput = {
|
|
3047
2986
|
xAxis?: Partial<{
|
|
3048
2987
|
field: string;
|
|
@@ -3059,24 +2998,39 @@ type SetReportChartAxesInput = {
|
|
|
3059
2998
|
};
|
|
3060
2999
|
};
|
|
3061
3000
|
interface SetReportBuilderInput {
|
|
3062
|
-
/**
|
|
3063
|
-
|
|
3064
|
-
* edits (expanded inside `setReport` into a full list and/or `chartAxes`).
|
|
3065
|
-
*/
|
|
3066
|
-
columns?: ColumnSelectorChangeValue | SetReportBuilderColumnInput[] | SetReportTableColumnSidebarPatch;
|
|
3001
|
+
/** Complete selected column list in display order. */
|
|
3002
|
+
columns?: ReportColumnValue[];
|
|
3067
3003
|
filters?: Filter[];
|
|
3068
3004
|
groupRowsBy?: string;
|
|
3069
3005
|
groupColumnsBy?: string;
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3006
|
+
/**
|
|
3007
|
+
* Pivot date grouping granularity. Pass an empty string to restore automatic
|
|
3008
|
+
* bucketing based on the active date range.
|
|
3009
|
+
*/
|
|
3010
|
+
dateBucket?: PivotDateBucket | '';
|
|
3011
|
+
/**
|
|
3012
|
+
* Encoded values as returned from `useReport().aggregations`
|
|
3013
|
+
* (`'sum:transactions::amount'`, `'count:transactions'`, `''` = placeholder
|
|
3014
|
+
* slot; bare `'sum:amount'` accepted, resolving the table from the schema),
|
|
3015
|
+
* structured items, or a single encoded value.
|
|
3016
|
+
*
|
|
3017
|
+
* Prefer the full `string[]` form so UIs can batch with other `setReport`
|
|
3018
|
+
* fields (e.g. drilldowns):
|
|
3019
|
+
* - change: `aggregations.map((a, i) => (i === index ? next : a))`
|
|
3020
|
+
* - add: `[...aggregations, '']`
|
|
3021
|
+
* - remove: `aggregations.filter((_, i) => i !== index)`
|
|
3022
|
+
*/
|
|
3023
|
+
aggregations?: string[] | AggregationStateItem[] | string;
|
|
3074
3024
|
sort?: ReportBuilderSort[] | string;
|
|
3075
3025
|
limit?: ReportBuilderLimit | null;
|
|
3076
3026
|
chartType?: string;
|
|
3077
3027
|
/** When set, updates chart legend visibility (same source as `showLegend` from `useReport`). */
|
|
3078
3028
|
showLegend?: boolean;
|
|
3079
|
-
/**
|
|
3029
|
+
/** Update the X-axis value returned by `useReport`. */
|
|
3030
|
+
xAxis?: SetReportChartAxesInput['xAxis'];
|
|
3031
|
+
/** Replace the Y-axis value returned by `useReport`. */
|
|
3032
|
+
yAxis?: SetReportChartAxesInput['yAxis'];
|
|
3033
|
+
/** @deprecated Prefer the top-level `xAxis` and `yAxis` inputs. */
|
|
3080
3034
|
chartAxes?: SetReportChartAxesInput;
|
|
3081
3035
|
/**
|
|
3082
3036
|
* Schema table names for datasource / multi-table picker UIs.
|
|
@@ -3144,29 +3098,6 @@ type UseReportSaveChangesFn = () => Promise<unknown>;
|
|
|
3144
3098
|
* Use `destinationDashboardName` so the server can resolve a dashboard for create-report.
|
|
3145
3099
|
*/
|
|
3146
3100
|
declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
|
|
3147
|
-
/** True while `report-builder-unique-values` runs for filter value options (not chart/table load). */
|
|
3148
|
-
filterUniqueValuesLoading: boolean;
|
|
3149
|
-
limit: ReportBuilderLimit | null;
|
|
3150
|
-
chartTypes: {
|
|
3151
|
-
label: string;
|
|
3152
|
-
value: string;
|
|
3153
|
-
}[];
|
|
3154
|
-
columnsOptions: ColumnSelectionOption[];
|
|
3155
|
-
tableColumnOptions: ColumnSelectionOption[];
|
|
3156
|
-
tableColumns: TableColumnsController;
|
|
3157
|
-
setReport: (nextState: SetReportBuilderInput) => void;
|
|
3158
|
-
saveChanges: UseReportSaveChangesFn;
|
|
3159
|
-
setFilters: (nextFilters: QueryBuilderRuleGroup) => void;
|
|
3160
|
-
setReportBuilder: (nextState: SetReportBuilderInput) => void;
|
|
3161
|
-
/** Current report-builder slice (tables, columns, filters, pivot, sort); pass to e.g. `Chat` as `reportBuilderState`. */
|
|
3162
|
-
reportBuilderState: ReportBuilderState | undefined;
|
|
3163
|
-
filterDraftKey: string;
|
|
3164
|
-
filterDraftQueryBuilderProps: FilterDraftQueryBuilderProps;
|
|
3165
|
-
isFilterDraftDirty: boolean;
|
|
3166
|
-
isFilterDraftEmpty: boolean;
|
|
3167
|
-
commitFilterDraft: () => void;
|
|
3168
|
-
resetFilterDraft: () => void;
|
|
3169
|
-
seedFilterDraft: () => void;
|
|
3170
3101
|
chart: {
|
|
3171
3102
|
xAxisField: string;
|
|
3172
3103
|
xAxisFormat: AxisFormat$1;
|
|
@@ -3256,28 +3187,18 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
|
|
|
3256
3187
|
* returned from `create-report` after the first datasource selection.
|
|
3257
3188
|
*/
|
|
3258
3189
|
reportId: string | undefined;
|
|
3259
|
-
datasources:
|
|
3260
|
-
|
|
3261
|
-
label: string;
|
|
3262
|
-
}[];
|
|
3263
|
-
datasourceOptions: {
|
|
3264
|
-
id: string;
|
|
3265
|
-
label: string;
|
|
3266
|
-
}[];
|
|
3190
|
+
datasources: string[];
|
|
3191
|
+
datasourceOptions: SelectOption[];
|
|
3267
3192
|
groupRowsBy: string | undefined;
|
|
3268
3193
|
groupRowsByOptions: SelectOption[];
|
|
3269
3194
|
groupColumnsBy: string | undefined;
|
|
3270
3195
|
groupColumnsByOptions: SelectOption[];
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
/** Resolved datasource table for `valueField` (mirrors `aggregationTablesByIndex`). */
|
|
3278
|
-
valueFieldTable?: string;
|
|
3279
|
-
}>[];
|
|
3280
|
-
aggregationOptions: AggregationOption[];
|
|
3196
|
+
dateBucket: PivotDateBucket | undefined;
|
|
3197
|
+
dateBucketOptions: SelectOption[];
|
|
3198
|
+
/** Encoded selection per aggregation slot (`'sum:transactions::amount'`, `'count:transactions'`, `''` = placeholder). Update via `setReport({ aggregations: nextStringArray })`. */
|
|
3199
|
+
aggregations: string[];
|
|
3200
|
+
/** Flat aggregation pick list shared by all slots; always contains every non-empty `aggregations` entry. */
|
|
3201
|
+
aggregationOptions: SelectOption[];
|
|
3281
3202
|
aggregationDescriptionOptions: {
|
|
3282
3203
|
label: string;
|
|
3283
3204
|
value: string;
|
|
@@ -3292,40 +3213,21 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
|
|
|
3292
3213
|
label: string;
|
|
3293
3214
|
value: string;
|
|
3294
3215
|
}[];
|
|
3295
|
-
/**
|
|
3296
|
-
|
|
3297
|
-
/**
|
|
3298
|
-
|
|
3216
|
+
/** Selected tabular columns in display order. */
|
|
3217
|
+
columns: ReportColumnValue[];
|
|
3218
|
+
/** Pivot table columns only allow label and format changes. */
|
|
3219
|
+
columnStructureEditsLocked: boolean;
|
|
3220
|
+
/** Optional rich operations; simple selection updates use `setReport({ columns })`. */
|
|
3221
|
+
columnActions: ColumnActions;
|
|
3299
3222
|
/** Schema columns for current datasources — pool for the table column picker. */
|
|
3300
3223
|
columnOptions: ColumnSelectionOption[];
|
|
3301
|
-
xAxis:
|
|
3302
|
-
field: string;
|
|
3303
|
-
format: AxisFormat;
|
|
3304
|
-
options: ChartAxisFieldOption[];
|
|
3305
|
-
formatOptions: SelectOption[];
|
|
3306
|
-
update: (updates: Partial<{
|
|
3307
|
-
field: string;
|
|
3308
|
-
format: AxisFormat;
|
|
3309
|
-
}>) => void;
|
|
3310
|
-
};
|
|
3224
|
+
xAxis: ReportXAxisValue;
|
|
3311
3225
|
xAxisOptions: {
|
|
3312
3226
|
value: string;
|
|
3313
3227
|
label: string;
|
|
3314
3228
|
format: string;
|
|
3315
3229
|
}[];
|
|
3316
|
-
yAxis:
|
|
3317
|
-
items: ChartYAxisControllerItem[];
|
|
3318
|
-
options: ChartAxisFieldOption[];
|
|
3319
|
-
formatOptions: SelectOption[];
|
|
3320
|
-
add: (field?: string) => void;
|
|
3321
|
-
remove: (id: string) => void;
|
|
3322
|
-
reorder: (oldIndex: number, newIndex: number) => void;
|
|
3323
|
-
update: (id: string, updates: Partial<{
|
|
3324
|
-
field: string;
|
|
3325
|
-
label: string;
|
|
3326
|
-
format: AxisFormat;
|
|
3327
|
-
}>) => void;
|
|
3328
|
-
};
|
|
3230
|
+
yAxis: ReportYAxisValue;
|
|
3329
3231
|
yAxisOptions: {
|
|
3330
3232
|
value: string;
|
|
3331
3233
|
label: string;
|
|
@@ -3337,12 +3239,6 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
|
|
|
3337
3239
|
/** Table column format dropdown labels (same set as chart axis formats). */
|
|
3338
3240
|
tableFormatOptions: string[];
|
|
3339
3241
|
showLegend: boolean;
|
|
3340
|
-
axisConfig: UseFormAxisConfig;
|
|
3341
|
-
availableFields: {
|
|
3342
|
-
id: string;
|
|
3343
|
-
label: string;
|
|
3344
|
-
type: string;
|
|
3345
|
-
}[];
|
|
3346
3242
|
axisSelectFormatLabels: string[];
|
|
3347
3243
|
/** @deprecated Prefer top-level `xAxis`, `yAxis`, and `showLegend`. */
|
|
3348
3244
|
chartAxes: ChartAxesController;
|
|
@@ -3362,6 +3258,27 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
|
|
|
3362
3258
|
hasTableDrivenColumnOrder: boolean;
|
|
3363
3259
|
filters: QueryBuilderRuleGroup;
|
|
3364
3260
|
filterQueryBuilderProps: UseFormQueryBuilderProps;
|
|
3261
|
+
/**
|
|
3262
|
+
* Filter value pick lists for custom UIs (string unique values + pivot date
|
|
3263
|
+
* buckets). Same string data as `filterQueryBuilderProps.getValues`; not
|
|
3264
|
+
* wired into react-querybuilder unless you use it yourself.
|
|
3265
|
+
*/
|
|
3266
|
+
filterOptions: FilterFieldOptions[];
|
|
3267
|
+
/** True while `report-builder-unique-values` runs for filter value options (not chart/table load). */
|
|
3268
|
+
filterUniqueValuesLoading: boolean;
|
|
3269
|
+
limit: ReportBuilderLimit | null;
|
|
3270
|
+
chartTypes: {
|
|
3271
|
+
label: string;
|
|
3272
|
+
value: string;
|
|
3273
|
+
}[];
|
|
3274
|
+
columnsOptions: ColumnSelectionOption[];
|
|
3275
|
+
tableColumnOptions: ColumnSelectionOption[];
|
|
3276
|
+
setReport: (nextState: SetReportBuilderInput) => void;
|
|
3277
|
+
saveChanges: UseReportSaveChangesFn;
|
|
3278
|
+
setFilters: (nextFilters: SetFiltersInput) => void;
|
|
3279
|
+
setReportBuilder: (nextState: SetReportBuilderInput) => void;
|
|
3280
|
+
/** Current report-builder slice (tables, columns, filters, pivot, sort); pass to e.g. `Chat` as `reportBuilderState`. */
|
|
3281
|
+
reportBuilderState: ReportBuilderState | undefined;
|
|
3365
3282
|
};
|
|
3366
3283
|
|
|
3367
3284
|
/** Normalize react-querybuilder filter trees before stack conversion / persistence. */
|
|
@@ -3390,6 +3307,97 @@ declare function areQueryBuilderFilterDraftsDirty(draft: unknown, committed: unk
|
|
|
3390
3307
|
/** Number of leaf filter rules (excludes empty groups). */
|
|
3391
3308
|
declare function countFilterRules(value: unknown): number;
|
|
3392
3309
|
|
|
3310
|
+
/**
|
|
3311
|
+
* Default `value` for a new react-querybuilder rule given a Quill operator.
|
|
3312
|
+
* List operators (`in` / `notIn`) need `[]` so the multiselect editor works
|
|
3313
|
+
* with `listsAsArrays`; everything else starts as an empty string.
|
|
3314
|
+
*/
|
|
3315
|
+
declare const defaultFilterRuleValueForOperator: (operator: unknown) => unknown;
|
|
3316
|
+
type FilterDraftQueryBuilderProps = UseFormQueryBuilderProps & {
|
|
3317
|
+
/**
|
|
3318
|
+
* Committed-or-draft tree react-querybuilder hydrates from on mount
|
|
3319
|
+
* (uncontrolled mode). Omitted when the draft is empty so
|
|
3320
|
+
* `addRuleToNewGroups` can seed the root rule on mount.
|
|
3321
|
+
*/
|
|
3322
|
+
defaultQuery?: QueryBuilderRuleGroup;
|
|
3323
|
+
onQueryChange: (next: unknown) => void;
|
|
3324
|
+
addRuleToNewGroups: true;
|
|
3325
|
+
getDefaultField: (fields: UseFormQueryBuilderField[]) => string;
|
|
3326
|
+
getDefaultValue: (rule: {
|
|
3327
|
+
operator?: unknown;
|
|
3328
|
+
}) => unknown;
|
|
3329
|
+
};
|
|
3330
|
+
type UseReportFilterDraft = {
|
|
3331
|
+
/**
|
|
3332
|
+
* Pass as `key` on `QueryBuilder` (not inside the spread — React warns on
|
|
3333
|
+
* spread `key`). Changes whenever react-querybuilder must rehydrate from
|
|
3334
|
+
* `defaultQuery`: report switch, committed filters change, field catalog
|
|
3335
|
+
* change, or `resetFilterDraft`.
|
|
3336
|
+
*/
|
|
3337
|
+
filterDraftKey: string;
|
|
3338
|
+
/** Spread onto `react-querybuilder`'s `QueryBuilder`: `<QueryBuilder key={filterDraftKey} {...filterDraftQueryBuilderProps} />`. */
|
|
3339
|
+
filterDraftQueryBuilderProps: FilterDraftQueryBuilderProps;
|
|
3340
|
+
/** Draft differs from committed filters (applying would change the report). */
|
|
3341
|
+
hasUnappliedFilterChanges: boolean;
|
|
3342
|
+
/** Apply the draft via `setFilters` (report/chart refresh follows). */
|
|
3343
|
+
applyFilterDraft: () => void;
|
|
3344
|
+
/** Drop the draft and rehydrate the builder from committed filters. */
|
|
3345
|
+
resetFilterDraft: () => void;
|
|
3346
|
+
};
|
|
3347
|
+
|
|
3348
|
+
type UseReportQueryBuilder = {
|
|
3349
|
+
/** Pass as `key` to `react-querybuilder`'s `QueryBuilder`. */
|
|
3350
|
+
key: string;
|
|
3351
|
+
/** Spread onto `react-querybuilder`'s `QueryBuilder`. */
|
|
3352
|
+
props: FilterDraftQueryBuilderProps;
|
|
3353
|
+
/** The editor differs from the filters currently applied to the report. */
|
|
3354
|
+
hasUnappliedChanges: boolean;
|
|
3355
|
+
/** Apply the draft through the supplied full-tree filter setter. */
|
|
3356
|
+
apply: () => void;
|
|
3357
|
+
/** Discard the draft and remount from the committed filters. */
|
|
3358
|
+
discard: () => void;
|
|
3359
|
+
/** @deprecated Use `discard`. */
|
|
3360
|
+
reset: () => void;
|
|
3361
|
+
};
|
|
3362
|
+
/**
|
|
3363
|
+
* React Query Builder adapter for `useReport`.
|
|
3364
|
+
*
|
|
3365
|
+
* `useReport` owns the committed filter tree, field/operator metadata, unique
|
|
3366
|
+
* values, and the `setFilters` conversion/refresh path. This hook only owns the
|
|
3367
|
+
* uncontrolled Query Builder draft lifecycle.
|
|
3368
|
+
*/
|
|
3369
|
+
declare function useReportQueryBuilder(args: {
|
|
3370
|
+
reportId?: string;
|
|
3371
|
+
filters: QueryBuilderRuleGroup | null | undefined;
|
|
3372
|
+
queryBuilderProps: UseFormQueryBuilderProps;
|
|
3373
|
+
onApply: (next: QueryBuilderRuleGroup | ((prev: QueryBuilderRuleGroup) => QueryBuilderRuleGroup)) => void;
|
|
3374
|
+
}): UseReportQueryBuilder;
|
|
3375
|
+
|
|
3376
|
+
type BarChartInteraction = {
|
|
3377
|
+
interactionType: 'bar' | 'bucket';
|
|
3378
|
+
/** Display label on the axis (pretty date bucket, category text, etc.). */
|
|
3379
|
+
activeLabel: unknown;
|
|
3380
|
+
/**
|
|
3381
|
+
* Value for `chart.pivot.rowFilter` — same as `rowFilter.options[].value`.
|
|
3382
|
+
* For date buckets this is the ISO bucket start, not the pretty label.
|
|
3383
|
+
*/
|
|
3384
|
+
rowValue: string | null;
|
|
3385
|
+
/**
|
|
3386
|
+
* Value for `chart.pivot.columnFilter` when a specific series/bar was clicked.
|
|
3387
|
+
* Same as `columnFilter.options[].value`. Absent on bucket-only clicks.
|
|
3388
|
+
*/
|
|
3389
|
+
columnValue?: string;
|
|
3390
|
+
/** @deprecated Prefer `columnValue`. */
|
|
3391
|
+
activeDataKey?: string;
|
|
3392
|
+
activeValue?: unknown;
|
|
3393
|
+
activePayload: any[];
|
|
3394
|
+
category: unknown;
|
|
3395
|
+
series?: string;
|
|
3396
|
+
value?: unknown;
|
|
3397
|
+
row: Record<string, any>;
|
|
3398
|
+
index: number;
|
|
3399
|
+
};
|
|
3400
|
+
|
|
3393
3401
|
type ReportDetailTable = {
|
|
3394
3402
|
columns?: unknown[];
|
|
3395
3403
|
rows?: unknown[];
|
|
@@ -3852,8 +3860,8 @@ type ClientFeatures = {
|
|
|
3852
3860
|
};
|
|
3853
3861
|
type QuillProviderClient = {
|
|
3854
3862
|
name: string;
|
|
3855
|
-
|
|
3856
|
-
|
|
3863
|
+
id?: string;
|
|
3864
|
+
clientId?: string;
|
|
3857
3865
|
queryEndpoint: string;
|
|
3858
3866
|
streamEndpoint?: string;
|
|
3859
3867
|
queryHeaders?: HeadersInit;
|
|
@@ -3894,7 +3902,7 @@ type QuillTenant = {
|
|
|
3894
3902
|
};
|
|
3895
3903
|
|
|
3896
3904
|
interface QuillFetchOptions {
|
|
3897
|
-
client: Pick<QuillProviderClient, 'clientId' | 'queryEndpoint' | 'queryHeaders' | 'withCredentials'>;
|
|
3905
|
+
client: Pick<QuillProviderClient, 'id' | 'clientId' | 'queryEndpoint' | 'queryHeaders' | 'withCredentials'>;
|
|
3898
3906
|
task: string;
|
|
3899
3907
|
method?: string;
|
|
3900
3908
|
metadata: any;
|
|
@@ -4444,4 +4452,4 @@ interface ReportTableProps {
|
|
|
4444
4452
|
}
|
|
4445
4453
|
declare const ReportTable: ({ reportBuilder, TableComponent, }: ReportTableProps) => react_jsx_runtime.JSX.Element;
|
|
4446
4454
|
|
|
4447
|
-
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, DEFAULT_PAGE_SIZE, DEFAULT_USE_REPORT_ROWS_PER_REQUEST, 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 OnChangeFn, type Option, type PaginationState, 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, type ReportDetailTable, ReportTable, SINGLE_TENANT, SQLEditor, type SQLEditorProps, SaveReport, SchemaListComponent, type SelectColumnComponentProps, type SelectComponentProps, type
|
|
4455
|
+
export { ALL_TENANTS, AddColumns, AddFilters, AddLimit, AddPivot, AddSort, type AxisFormat$1 as AxisFormat, type BarChartInteraction, 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 ColumnActions, type ColumnSelectionOption, type ContainerComponentProps, DEFAULT_PAGE_SIZE, DEFAULT_USE_REPORT_ROWS_PER_REQUEST, 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 FilterFieldOptions, type FilterPopoverComponentProps, FilterType, type HeaderComponentProps, type HeaderProps, type InternalDashboardDateFilter, type InternalDashboardTenantFilter, type InternalFilter, type LabelComponentProps, type LimitPopoverComponentProps, type ModalComponentProps, NullOperator, NumberOperator, type OnChangeFn, type Option, type PaginationState, type Pivot, type PivotAggregation, type PivotDateBucket, type PivotDimensionFilter, 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, type ReportColumnInput, type ReportColumnValue, ReportDetail, type ReportDetailProps, type ReportDetailTable, ReportTable, type ReportXAxisValue, type ReportYAxisFieldValue, type ReportYAxisValue, SINGLE_TENANT, SQLEditor, type SQLEditorProps, SaveReport, SchemaListComponent, type SelectColumnComponentProps, type SelectComponentProps, type SetFiltersInput, type SetReportBuilderInput, type SetReportChartAxesInput, type SidebarComponentProps, type SidebarHeadingComponentProps, type SortPopoverComponentProps, StaticChart, type StaticChartProps, StringOperator, Table, type TableComponentProps, type TableProps, type TabsComponentProps, type TextComponentProps, type TextInputComponentProps, ThemeContext, type Updater, type UseDashboardReload, type UseFormQueryBuilderField, type UseFormQueryBuilderProps, type UseReportFilterDraft, type UseReportQueryBuilder, areQueryBuilderFilterDraftsDirty, countFilterRules, defaultFilterRuleValueForOperator, downloadCSV, quillFormat as format, isQueryBuilderDisplayGroup, isQueryBuilderDisplayRule, normalizeRelativeDateRules, prepareQueryBuilderFiltersForSet, queryBuilderFiltersForEditor, quillFetch, stripQueryBuilderTransientFields, tableColumnFormatFromUiSelection, useAllReports, useAskQuill, useChangelogRefresh, useDashboard, useDashboardInternal, useDashboardReport, useDashboardReports, useDashboards, useExport, useMemoizedRows, useQuill, useReport, useReportBuilder, useReportQueryBuilder, useReports, useTenants, useVirtualTables };
|