drizzle-cube 0.4.37 → 0.4.38

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.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * LimitSection Component
3
+ *
4
+ * Row limit section for the AnalysisBuilder query panel.
5
+ * Provides preset pills (5, 10, 25, ...) plus a custom input option.
6
+ */
7
+ interface LimitSectionProps {
8
+ /** Current limit value */
9
+ limit?: number;
10
+ /** Callback when limit changes */
11
+ onLimitChange: (limit: number | undefined) => void;
12
+ }
13
+ export default function LimitSection({ limit, onLimitChange }: LimitSectionProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -52,6 +52,8 @@ export interface AnalysisBuilderState {
52
52
  filters: Filter[];
53
53
  /** Sort order for this query (field name -> 'asc' | 'desc') */
54
54
  order?: Record<string, 'asc' | 'desc'>;
55
+ /** Row limit for the query (sent to server) */
56
+ limit?: number;
55
57
  validationStatus: ValidationStatus;
56
58
  validationError: string | null;
57
59
  }
@@ -193,6 +195,10 @@ export interface AnalysisQueryPanelProps {
193
195
  order?: Record<string, 'asc' | 'desc'>;
194
196
  /** Callback when sort order changes */
195
197
  onOrderChange: (fieldName: string, direction: 'asc' | 'desc' | null) => void;
198
+ /** Row limit for the query (sent to server) */
199
+ limit?: number;
200
+ /** Callback when limit changes */
201
+ onLimitChange?: (limit: number | undefined) => void;
196
202
  chartType: ChartType;
197
203
  chartConfig: ChartAxisConfig;
198
204
  displayConfig: ChartDisplayConfig;
@@ -798,6 +804,7 @@ export interface AnalysisBuilderStorageState {
798
804
  breakdowns: BreakdownItem[];
799
805
  filters: Filter[];
800
806
  order?: Record<string, 'asc' | 'desc'>;
807
+ limit?: number;
801
808
  chartType: ChartType;
802
809
  chartConfig: ChartAxisConfig;
803
810
  displayConfig: ChartDisplayConfig;
@@ -4,7 +4,7 @@ import { MetricItem, BreakdownItem } from '../types';
4
4
  * Convert metrics and breakdowns to CubeQuery format
5
5
  * Handles comparison mode by building compareDateRange for time dimensions
6
6
  */
7
- export declare function buildCubeQuery(metrics: MetricItem[], breakdowns: BreakdownItem[], filters: Filter[], order?: Record<string, 'asc' | 'desc'>, preserveComparisonFilters?: boolean): CubeQuery;
7
+ export declare function buildCubeQuery(metrics: MetricItem[], breakdowns: BreakdownItem[], filters: Filter[], order?: Record<string, 'asc' | 'desc'>, preserveComparisonFilters?: boolean, limit?: number): CubeQuery;
8
8
  /**
9
9
  * Check if a query has any content
10
10
  */
@@ -1,4 +1,4 @@
1
- import { D as e, i as t, n, r, t as i } from "./chunks/DashboardEditModal-B083DSGL.js";
1
+ import { D as e, i as t, n, r, t as i } from "./chunks/DashboardEditModal-DrjEsyoO.js";
2
2
  import { i as a, p as o } from "./chunks/FieldSearchModal-BxQ5JhWz.js";
3
3
  import { a as s, n as c, o as l, r as u, s as d, t as f } from "./chunks/utils-3FNmeZJR.js";
4
4
  export { a as AnalysisDisplayConfigPanel, r as AnalyticsDashboard, e as AnalyticsPortlet, i as DashboardEditModal, t as DashboardGrid, o as Modal, n as PortletContainer, f as createDashboardLayout, c as createSamplePortlet, u as findNextPosition, s as generatePortletId, l as generateResponsiveLayouts, d as validateCubeQuery };
@@ -175,6 +175,7 @@ export interface UseAnalysisBuilderResult {
175
175
  setFilters: (filters: Filter[]) => void;
176
176
  dropFieldToFilter: (field: string) => void;
177
177
  setOrder: (fieldName: string, direction: 'asc' | 'desc' | null) => void;
178
+ setLimit: (limit: number | undefined) => void;
178
179
  addQuery: () => void;
179
180
  removeQuery: (index: number) => void;
180
181
  setFunnelBindingKey: (bindingKey: FunnelBindingKey | null) => void;
@@ -6,12 +6,12 @@ import { a as oe, c as se, i as ce, l as le, o as ue, r as de, s as fe } from ".
6
6
  import { n as pe, r as me } from "./chunks/chart-sankey-8nRYnupt.js";
7
7
  import { n as he, t as ge } from "./chunks/providers-DX3Vw5kc.js";
8
8
  import { A as _e, _ as ve, c as ye, d as be, f as xe, g as Se, h as Ce, l as we, m as Te, p as Ee, u as De } from "./chunks/chart-activity-grid-wR2Twpo7.js";
9
- import { A as Oe, C as ke, D as Ae, E as je, M as Me, N as Ne, O as Pe, S as Fe, T as Ie, _ as Le, a as Re, b as ze, c as Be, d as Ve, f as He, g as Ue, h as We, i as Ge, j as Ke, k as qe, l as Je, m as Ye, n as Xe, o as Ze, p as Qe, r as $e, s as et, t as tt, u as nt, v as rt, w as it, x as at, y as ot } from "./chunks/DashboardEditModal-B083DSGL.js";
9
+ import { A as Oe, C as ke, D as Ae, E as je, M as Me, N as Ne, O as Pe, S as Fe, T as Ie, _ as Le, a as Re, b as ze, c as Be, d as Ve, f as He, g as Ue, h as We, i as Ge, j as Ke, k as qe, l as Je, m as Ye, n as Xe, o as Ze, p as Qe, r as $e, s as et, t as tt, u as nt, v as rt, w as it, x as at, y as ot } from "./chunks/DashboardEditModal-DrjEsyoO.js";
10
10
  import { u as V } from "./chunks/chart-area-e9ysnatQ.js";
11
11
  import { a as st, i as ct, n as lt, o as ut, r as dt, s as ft, t as pt } from "./chunks/charts-loader-gZjOqZwG.js";
12
12
  import { A as mt, C as ht, D as gt, E as _t, F as vt, I as yt, L as bt, M as xt, N as St, O as Ct, P as wt, R as Tt, S as Et, T as Dt, h as Ot, j as kt, k as At, p as jt, r as Mt, t as Nt, w as Pt } from "./chunks/FieldSearchModal-BxQ5JhWz.js";
13
13
  import { r as Ft } from "./chunks/syntaxHighlighting-BLl0ch4A.js";
14
- import { A as It, D as Lt, E as Rt, F as zt, I as Bt, M as Vt, O as Ht, P as Ut, S as Wt, T as Gt, _ as Kt, a as qt, b as Jt, c as Yt, d as Xt, f as Zt, g as Qt, h as $t, i as en, j as tn, k as nn, l as rn, n as an, o as on, p as sn, r as cn, s as ln, t as un, v as dn, w as fn, x as pn, y as mn } from "./chunks/analysis-builder-shared-BFzd2jx_.js";
14
+ import { A as It, D as Lt, E as Rt, F as zt, I as Bt, M as Vt, O as Ht, P as Ut, S as Wt, T as Gt, _ as Kt, a as qt, b as Jt, c as Yt, d as Xt, f as Zt, g as Qt, h as $t, i as en, j as tn, k as nn, l as rn, n as an, o as on, p as sn, r as cn, s as ln, t as un, v as dn, w as fn, x as pn, y as mn } from "./chunks/analysis-builder-shared-BxHYfTzo.js";
15
15
  import { r as hn } from "./chunks/chart-markdown-B2X4IwLO.js";
16
16
  import { t as gn } from "./chunks/useNotebookLayout-BFZ_33Kb.js";
17
17
  import { n as _n } from "./chunks/schema-visualization-XLFzV_7p.js";
@@ -147,6 +147,8 @@ export interface AnalysisBuilderStoreActions {
147
147
  dropFieldToFilter: (field: string) => void;
148
148
  /** Set sort order for a field */
149
149
  setOrder: (fieldName: string, direction: 'asc' | 'desc' | null) => void;
150
+ /** Set row limit for the query (sent to server) */
151
+ setLimit: (limit: number | undefined) => void;
150
152
  /** Add a new query tab */
151
153
  addQuery: () => void;
152
154
  /** Remove a query tab */
@@ -36,6 +36,7 @@ export interface QuerySliceActions {
36
36
  setFilters: (filters: Filter[]) => void;
37
37
  dropFieldToFilter: (field: string) => void;
38
38
  setOrder: (fieldName: string, direction: 'asc' | 'desc' | null) => void;
39
+ setLimit: (limit: number | undefined) => void;
39
40
  getCurrentState: () => AnalysisBuilderState;
40
41
  getMergeKeys: () => string[] | undefined;
41
42
  isMultiQueryMode: () => boolean;