@quillsql/react 2.16.49 → 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.d.cts 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,6 +2764,11 @@ type QueryBuilderOperatorOption = {
2735
2764
  label: string;
2736
2765
  arity?: 'unary' | 'binary' | number;
2737
2766
  };
2767
+ /**
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.
2770
+ */
2771
+ declare const queryBuilderFiltersForEditor: (group: QueryBuilderRuleGroup) => QueryBuilderRuleGroup;
2738
2772
 
2739
2773
  /**
2740
2774
  * Pagination types and pure helpers for `useReport`, mirroring the
@@ -2844,6 +2878,21 @@ type ColumnActions = {
2844
2878
  format: string;
2845
2879
  }>) => void;
2846
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[];
2895
+ };
2847
2896
  type ChartAxisFieldOption = {
2848
2897
  value: string;
2849
2898
  label: string;
@@ -2918,35 +2967,21 @@ type UseFormQueryBuilderProps = {
2918
2967
  fieldData?: Partial<UseFormQueryBuilderField>;
2919
2968
  }) => QueryBuilderFieldValueOption[];
2920
2969
  };
2921
- /** Maps table column format dropdown values to persisted report column `format` (used by `columnActions.update`). */
2922
- declare function tableColumnFormatFromUiSelection(raw: string): string;
2923
- /** Shape expected by chart config sidebars that mirror `AxisConfig` (e.g. Quill Chat ConfigForm). */
2924
- type UseFormAxisConfig = {
2925
- xAxis: {
2926
- field: string;
2927
- label: string;
2928
- format: string;
2929
- show: boolean;
2930
- rotation: number;
2931
- fontSize: number;
2932
- };
2933
- yAxis: {
2934
- fields: Array<{
2935
- field: string;
2936
- label: string;
2937
- format: string;
2938
- color: string;
2939
- }>;
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: {
2940
2976
  label: string;
2941
- show: boolean;
2942
- min: string;
2943
- max: string;
2944
- fontSize: number;
2945
- };
2946
- legend: {
2947
- show: boolean;
2948
- };
2977
+ value: string;
2978
+ }[];
2979
+ dateBucket?: PivotDateBucket;
2949
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;
2950
2985
  type SetReportChartAxesInput = {
2951
2986
  xAxis?: Partial<{
2952
2987
  field: string;
@@ -2991,7 +3026,11 @@ interface SetReportBuilderInput {
2991
3026
  chartType?: string;
2992
3027
  /** When set, updates chart legend visibility (same source as `showLegend` from `useReport`). */
2993
3028
  showLegend?: boolean;
2994
- /** When set, merges into chart axis edits (use with returned `xAxis` / `yAxis` / options). */
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. */
2995
3034
  chartAxes?: SetReportChartAxesInput;
2996
3035
  /**
2997
3036
  * Schema table names for datasource / multi-table picker UIs.
@@ -3182,34 +3221,13 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
3182
3221
  columnActions: ColumnActions;
3183
3222
  /** Schema columns for current datasources — pool for the table column picker. */
3184
3223
  columnOptions: ColumnSelectionOption[];
3185
- xAxis: {
3186
- field: string;
3187
- format: AxisFormat;
3188
- options: ChartAxisFieldOption[];
3189
- formatOptions: SelectOption[];
3190
- update: (updates: Partial<{
3191
- field: string;
3192
- format: AxisFormat;
3193
- }>) => void;
3194
- };
3224
+ xAxis: ReportXAxisValue;
3195
3225
  xAxisOptions: {
3196
3226
  value: string;
3197
3227
  label: string;
3198
3228
  format: string;
3199
3229
  }[];
3200
- yAxis: {
3201
- items: ChartYAxisControllerItem[];
3202
- options: ChartAxisFieldOption[];
3203
- formatOptions: SelectOption[];
3204
- add: (field?: string) => void;
3205
- remove: (id: string) => void;
3206
- reorder: (oldIndex: number, newIndex: number) => void;
3207
- update: (id: string, updates: Partial<{
3208
- field: string;
3209
- label: string;
3210
- format: AxisFormat;
3211
- }>) => void;
3212
- };
3230
+ yAxis: ReportYAxisValue;
3213
3231
  yAxisOptions: {
3214
3232
  value: string;
3215
3233
  label: string;
@@ -3221,12 +3239,6 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
3221
3239
  /** Table column format dropdown labels (same set as chart axis formats). */
3222
3240
  tableFormatOptions: string[];
3223
3241
  showLegend: boolean;
3224
- axisConfig: UseFormAxisConfig;
3225
- availableFields: {
3226
- id: string;
3227
- label: string;
3228
- type: string;
3229
- }[];
3230
3242
  axisSelectFormatLabels: string[];
3231
3243
  /** @deprecated Prefer top-level `xAxis`, `yAxis`, and `showLegend`. */
3232
3244
  chartAxes: ChartAxesController;
@@ -3246,6 +3258,12 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
3246
3258
  hasTableDrivenColumnOrder: boolean;
3247
3259
  filters: QueryBuilderRuleGroup;
3248
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[];
3249
3267
  /** True while `report-builder-unique-values` runs for filter value options (not chart/table load). */
3250
3268
  filterUniqueValuesLoading: boolean;
3251
3269
  limit: ReportBuilderLimit | null;
@@ -3257,7 +3275,7 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
3257
3275
  tableColumnOptions: ColumnSelectionOption[];
3258
3276
  setReport: (nextState: SetReportBuilderInput) => void;
3259
3277
  saveChanges: UseReportSaveChangesFn;
3260
- setFilters: (nextFilters: QueryBuilderRuleGroup) => void;
3278
+ setFilters: (nextFilters: SetFiltersInput) => void;
3261
3279
  setReportBuilder: (nextState: SetReportBuilderInput) => void;
3262
3280
  /** Current report-builder slice (tables, columns, filters, pivot, sort); pass to e.g. `Chat` as `reportBuilderState`. */
3263
3281
  reportBuilderState: ReportBuilderState | undefined;
@@ -3296,10 +3314,15 @@ declare function countFilterRules(value: unknown): number;
3296
3314
  */
3297
3315
  declare const defaultFilterRuleValueForOperator: (operator: unknown) => unknown;
3298
3316
  type FilterDraftQueryBuilderProps = UseFormQueryBuilderProps & {
3299
- /** Committed-or-draft tree react-querybuilder hydrates from on mount (uncontrolled mode). */
3300
- defaultQuery: QueryBuilderRuleGroup;
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;
3301
3323
  onQueryChange: (next: unknown) => void;
3302
3324
  addRuleToNewGroups: true;
3325
+ getDefaultField: (fields: UseFormQueryBuilderField[]) => string;
3303
3326
  getDefaultValue: (rule: {
3304
3327
  operator?: unknown;
3305
3328
  }) => unknown;
@@ -3347,9 +3370,34 @@ declare function useReportQueryBuilder(args: {
3347
3370
  reportId?: string;
3348
3371
  filters: QueryBuilderRuleGroup | null | undefined;
3349
3372
  queryBuilderProps: UseFormQueryBuilderProps;
3350
- onApply: (next: QueryBuilderRuleGroup) => void;
3373
+ onApply: (next: QueryBuilderRuleGroup | ((prev: QueryBuilderRuleGroup) => QueryBuilderRuleGroup)) => void;
3351
3374
  }): UseReportQueryBuilder;
3352
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
+
3353
3401
  type ReportDetailTable = {
3354
3402
  columns?: unknown[];
3355
3403
  rows?: unknown[];
@@ -3812,8 +3860,8 @@ type ClientFeatures = {
3812
3860
  };
3813
3861
  type QuillProviderClient = {
3814
3862
  name: string;
3815
- clientId: string;
3816
- publicKey: string;
3863
+ id?: string;
3864
+ clientId?: string;
3817
3865
  queryEndpoint: string;
3818
3866
  streamEndpoint?: string;
3819
3867
  queryHeaders?: HeadersInit;
@@ -3854,7 +3902,7 @@ type QuillTenant = {
3854
3902
  };
3855
3903
 
3856
3904
  interface QuillFetchOptions {
3857
- client: Pick<QuillProviderClient, 'clientId' | 'queryEndpoint' | 'queryHeaders' | 'withCredentials'>;
3905
+ client: Pick<QuillProviderClient, 'id' | 'clientId' | 'queryEndpoint' | 'queryHeaders' | 'withCredentials'>;
3858
3906
  task: string;
3859
3907
  method?: string;
3860
3908
  metadata: any;
@@ -4404,4 +4452,4 @@ interface ReportTableProps {
4404
4452
  }
4405
4453
  declare const ReportTable: ({ reportBuilder, TableComponent, }: ReportTableProps) => react_jsx_runtime.JSX.Element;
4406
4454
 
4407
- 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 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 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 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, SINGLE_TENANT, SQLEditor, type SQLEditorProps, SaveReport, SchemaListComponent, type SelectColumnComponentProps, type SelectComponentProps, 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 UseFormAxisConfig, type UseFormQueryBuilderField, type UseFormQueryBuilderProps, type UseReportFilterDraft, type UseReportQueryBuilder, areQueryBuilderFilterDraftsDirty, 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, useReportQueryBuilder, useReports, useTenants, useVirtualTables };
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 };
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,6 +2764,11 @@ type QueryBuilderOperatorOption = {
2735
2764
  label: string;
2736
2765
  arity?: 'unary' | 'binary' | number;
2737
2766
  };
2767
+ /**
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.
2770
+ */
2771
+ declare const queryBuilderFiltersForEditor: (group: QueryBuilderRuleGroup) => QueryBuilderRuleGroup;
2738
2772
 
2739
2773
  /**
2740
2774
  * Pagination types and pure helpers for `useReport`, mirroring the
@@ -2844,6 +2878,21 @@ type ColumnActions = {
2844
2878
  format: string;
2845
2879
  }>) => void;
2846
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[];
2895
+ };
2847
2896
  type ChartAxisFieldOption = {
2848
2897
  value: string;
2849
2898
  label: string;
@@ -2918,35 +2967,21 @@ type UseFormQueryBuilderProps = {
2918
2967
  fieldData?: Partial<UseFormQueryBuilderField>;
2919
2968
  }) => QueryBuilderFieldValueOption[];
2920
2969
  };
2921
- /** Maps table column format dropdown values to persisted report column `format` (used by `columnActions.update`). */
2922
- declare function tableColumnFormatFromUiSelection(raw: string): string;
2923
- /** Shape expected by chart config sidebars that mirror `AxisConfig` (e.g. Quill Chat ConfigForm). */
2924
- type UseFormAxisConfig = {
2925
- xAxis: {
2926
- field: string;
2927
- label: string;
2928
- format: string;
2929
- show: boolean;
2930
- rotation: number;
2931
- fontSize: number;
2932
- };
2933
- yAxis: {
2934
- fields: Array<{
2935
- field: string;
2936
- label: string;
2937
- format: string;
2938
- color: string;
2939
- }>;
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: {
2940
2976
  label: string;
2941
- show: boolean;
2942
- min: string;
2943
- max: string;
2944
- fontSize: number;
2945
- };
2946
- legend: {
2947
- show: boolean;
2948
- };
2977
+ value: string;
2978
+ }[];
2979
+ dateBucket?: PivotDateBucket;
2949
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;
2950
2985
  type SetReportChartAxesInput = {
2951
2986
  xAxis?: Partial<{
2952
2987
  field: string;
@@ -2991,7 +3026,11 @@ interface SetReportBuilderInput {
2991
3026
  chartType?: string;
2992
3027
  /** When set, updates chart legend visibility (same source as `showLegend` from `useReport`). */
2993
3028
  showLegend?: boolean;
2994
- /** When set, merges into chart axis edits (use with returned `xAxis` / `yAxis` / options). */
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. */
2995
3034
  chartAxes?: SetReportChartAxesInput;
2996
3035
  /**
2997
3036
  * Schema table names for datasource / multi-table picker UIs.
@@ -3182,34 +3221,13 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
3182
3221
  columnActions: ColumnActions;
3183
3222
  /** Schema columns for current datasources — pool for the table column picker. */
3184
3223
  columnOptions: ColumnSelectionOption[];
3185
- xAxis: {
3186
- field: string;
3187
- format: AxisFormat;
3188
- options: ChartAxisFieldOption[];
3189
- formatOptions: SelectOption[];
3190
- update: (updates: Partial<{
3191
- field: string;
3192
- format: AxisFormat;
3193
- }>) => void;
3194
- };
3224
+ xAxis: ReportXAxisValue;
3195
3225
  xAxisOptions: {
3196
3226
  value: string;
3197
3227
  label: string;
3198
3228
  format: string;
3199
3229
  }[];
3200
- yAxis: {
3201
- items: ChartYAxisControllerItem[];
3202
- options: ChartAxisFieldOption[];
3203
- formatOptions: SelectOption[];
3204
- add: (field?: string) => void;
3205
- remove: (id: string) => void;
3206
- reorder: (oldIndex: number, newIndex: number) => void;
3207
- update: (id: string, updates: Partial<{
3208
- field: string;
3209
- label: string;
3210
- format: AxisFormat;
3211
- }>) => void;
3212
- };
3230
+ yAxis: ReportYAxisValue;
3213
3231
  yAxisOptions: {
3214
3232
  value: string;
3215
3233
  label: string;
@@ -3221,12 +3239,6 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
3221
3239
  /** Table column format dropdown labels (same set as chart axis formats). */
3222
3240
  tableFormatOptions: string[];
3223
3241
  showLegend: boolean;
3224
- axisConfig: UseFormAxisConfig;
3225
- availableFields: {
3226
- id: string;
3227
- label: string;
3228
- type: string;
3229
- }[];
3230
3242
  axisSelectFormatLabels: string[];
3231
3243
  /** @deprecated Prefer top-level `xAxis`, `yAxis`, and `showLegend`. */
3232
3244
  chartAxes: ChartAxesController;
@@ -3246,6 +3258,12 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
3246
3258
  hasTableDrivenColumnOrder: boolean;
3247
3259
  filters: QueryBuilderRuleGroup;
3248
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[];
3249
3267
  /** True while `report-builder-unique-values` runs for filter value options (not chart/table load). */
3250
3268
  filterUniqueValuesLoading: boolean;
3251
3269
  limit: ReportBuilderLimit | null;
@@ -3257,7 +3275,7 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
3257
3275
  tableColumnOptions: ColumnSelectionOption[];
3258
3276
  setReport: (nextState: SetReportBuilderInput) => void;
3259
3277
  saveChanges: UseReportSaveChangesFn;
3260
- setFilters: (nextFilters: QueryBuilderRuleGroup) => void;
3278
+ setFilters: (nextFilters: SetFiltersInput) => void;
3261
3279
  setReportBuilder: (nextState: SetReportBuilderInput) => void;
3262
3280
  /** Current report-builder slice (tables, columns, filters, pivot, sort); pass to e.g. `Chat` as `reportBuilderState`. */
3263
3281
  reportBuilderState: ReportBuilderState | undefined;
@@ -3296,10 +3314,15 @@ declare function countFilterRules(value: unknown): number;
3296
3314
  */
3297
3315
  declare const defaultFilterRuleValueForOperator: (operator: unknown) => unknown;
3298
3316
  type FilterDraftQueryBuilderProps = UseFormQueryBuilderProps & {
3299
- /** Committed-or-draft tree react-querybuilder hydrates from on mount (uncontrolled mode). */
3300
- defaultQuery: QueryBuilderRuleGroup;
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;
3301
3323
  onQueryChange: (next: unknown) => void;
3302
3324
  addRuleToNewGroups: true;
3325
+ getDefaultField: (fields: UseFormQueryBuilderField[]) => string;
3303
3326
  getDefaultValue: (rule: {
3304
3327
  operator?: unknown;
3305
3328
  }) => unknown;
@@ -3347,9 +3370,34 @@ declare function useReportQueryBuilder(args: {
3347
3370
  reportId?: string;
3348
3371
  filters: QueryBuilderRuleGroup | null | undefined;
3349
3372
  queryBuilderProps: UseFormQueryBuilderProps;
3350
- onApply: (next: QueryBuilderRuleGroup) => void;
3373
+ onApply: (next: QueryBuilderRuleGroup | ((prev: QueryBuilderRuleGroup) => QueryBuilderRuleGroup)) => void;
3351
3374
  }): UseReportQueryBuilder;
3352
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
+
3353
3401
  type ReportDetailTable = {
3354
3402
  columns?: unknown[];
3355
3403
  rows?: unknown[];
@@ -3812,8 +3860,8 @@ type ClientFeatures = {
3812
3860
  };
3813
3861
  type QuillProviderClient = {
3814
3862
  name: string;
3815
- clientId: string;
3816
- publicKey: string;
3863
+ id?: string;
3864
+ clientId?: string;
3817
3865
  queryEndpoint: string;
3818
3866
  streamEndpoint?: string;
3819
3867
  queryHeaders?: HeadersInit;
@@ -3854,7 +3902,7 @@ type QuillTenant = {
3854
3902
  };
3855
3903
 
3856
3904
  interface QuillFetchOptions {
3857
- client: Pick<QuillProviderClient, 'clientId' | 'queryEndpoint' | 'queryHeaders' | 'withCredentials'>;
3905
+ client: Pick<QuillProviderClient, 'id' | 'clientId' | 'queryEndpoint' | 'queryHeaders' | 'withCredentials'>;
3858
3906
  task: string;
3859
3907
  method?: string;
3860
3908
  metadata: any;
@@ -4404,4 +4452,4 @@ interface ReportTableProps {
4404
4452
  }
4405
4453
  declare const ReportTable: ({ reportBuilder, TableComponent, }: ReportTableProps) => react_jsx_runtime.JSX.Element;
4406
4454
 
4407
- 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 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 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 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, SINGLE_TENANT, SQLEditor, type SQLEditorProps, SaveReport, SchemaListComponent, type SelectColumnComponentProps, type SelectComponentProps, 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 UseFormAxisConfig, type UseFormQueryBuilderField, type UseFormQueryBuilderProps, type UseReportFilterDraft, type UseReportQueryBuilder, areQueryBuilderFilterDraftsDirty, 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, useReportQueryBuilder, useReports, useTenants, useVirtualTables };
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 };