drizzle-cube 0.2.19 → 0.2.23
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/adapters/{compiler-7cp4XzHx.js → compiler-DDXMrb9d.js} +2470 -2181
- package/dist/adapters/compiler-S2NEGW7Q.cjs +22 -0
- package/dist/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +1 -1
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +1 -1
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +1 -1
- package/dist/client/charts.js +2 -2
- package/dist/client/chunks/{charts-B8YMw1mi.js → charts--hFH-bsu.js} +2238 -2045
- package/dist/client/chunks/charts--hFH-bsu.js.map +1 -0
- package/dist/client/chunks/{charts-amt7VOyw.js → charts-DboFPJFN.js} +32 -32
- package/dist/client/chunks/{charts-amt7VOyw.js.map → charts-DboFPJFN.js.map} +1 -1
- package/dist/client/chunks/{components-K3xrnHN-.js → components-D7wTB56l.js} +8330 -7897
- package/dist/client/chunks/components-D7wTB56l.js.map +1 -0
- package/dist/client/chunks/core-PxWXpBbW.js +6 -0
- package/dist/client/chunks/core-PxWXpBbW.js.map +1 -0
- package/dist/client/chunks/{icons-B2XSxpVK.js → icons-DI4Xack3.js} +126 -120
- package/dist/client/chunks/icons-DI4Xack3.js.map +1 -0
- package/dist/client/chunks/{index-B7NSVb33.js → index-yc7cf-yE.js} +2 -2
- package/dist/client/chunks/{index-B7NSVb33.js.map → index-yc7cf-yE.js.map} +1 -1
- package/dist/client/components/AnalysisBuilder/types.d.ts +9 -0
- package/dist/client/components/FloatingEditToolbar.d.ts +28 -0
- package/dist/client/components/charts/ChartTooltip.d.ts +1 -1
- package/dist/client/components.js +2 -2
- package/dist/client/hooks/useElementVisibility.d.ts +30 -0
- package/dist/client/hooks/useScrollDetection.d.ts +3 -1
- package/dist/client/hooks.js +2 -2
- package/dist/client/icons/types.d.ts +1 -0
- package/dist/client/icons.js +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +46 -45
- package/dist/client/providers.js +1 -1
- package/dist/client/shared/components/CodeBlock.d.ts +1 -0
- package/dist/client/styles.css +1 -1
- package/dist/client/types.d.ts +20 -0
- package/dist/client/utils/comparisonUtils.d.ts +96 -0
- package/dist/client/utils/index.d.ts +1 -0
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/index.cjs +16 -16
- package/dist/server/index.d.ts +44 -0
- package/dist/server/index.js +3164 -2875
- package/package.json +1 -1
- package/dist/adapters/compiler-CITtZq3r.cjs +0 -22
- package/dist/client/chunks/charts-B8YMw1mi.js.map +0 -1
- package/dist/client/chunks/components-K3xrnHN-.js.map +0 -1
- package/dist/client/chunks/core-Dkym7d1O.js +0 -6
- package/dist/client/chunks/core-Dkym7d1O.js.map +0 -1
- package/dist/client/chunks/icons-B2XSxpVK.js.map +0 -1
|
@@ -27,6 +27,8 @@ export interface BreakdownItem {
|
|
|
27
27
|
granularity?: string;
|
|
28
28
|
/** Whether this is a time dimension */
|
|
29
29
|
isTimeDimension: boolean;
|
|
30
|
+
/** Enable period comparison for time dimensions (compares current filter period vs prior period) */
|
|
31
|
+
enableComparison?: boolean;
|
|
30
32
|
}
|
|
31
33
|
/** Validation status for query building */
|
|
32
34
|
export type ValidationStatus = 'idle' | 'validating' | 'valid' | 'invalid';
|
|
@@ -168,6 +170,7 @@ export interface AnalysisQueryPanelProps {
|
|
|
168
170
|
onAddBreakdown: () => void;
|
|
169
171
|
onRemoveBreakdown: (id: string) => void;
|
|
170
172
|
onBreakdownGranularityChange: (id: string, granularity: string) => void;
|
|
173
|
+
onBreakdownComparisonToggle?: (id: string) => void;
|
|
171
174
|
onReorderBreakdowns?: (fromIndex: number, toIndex: number) => void;
|
|
172
175
|
onFiltersChange: (filters: Filter[]) => void;
|
|
173
176
|
onDropFieldToFilter?: (field: string) => void;
|
|
@@ -284,6 +287,8 @@ export interface BreakdownSectionProps {
|
|
|
284
287
|
onRemove: (id: string) => void;
|
|
285
288
|
/** Change granularity for time dimension */
|
|
286
289
|
onGranularityChange: (id: string, granularity: string) => void;
|
|
290
|
+
/** Toggle comparison for time dimension */
|
|
291
|
+
onComparisonToggle?: (id: string) => void;
|
|
287
292
|
/** Whether the section is expanded */
|
|
288
293
|
isExpanded?: boolean;
|
|
289
294
|
/** Toggle expansion */
|
|
@@ -340,6 +345,10 @@ export interface BreakdownItemCardProps {
|
|
|
340
345
|
onRemove: () => void;
|
|
341
346
|
/** Granularity change handler (for time dimensions) */
|
|
342
347
|
onGranularityChange?: (granularity: string) => void;
|
|
348
|
+
/** Toggle comparison for time dimensions */
|
|
349
|
+
onComparisonToggle?: () => void;
|
|
350
|
+
/** Whether another time dimension already has comparison enabled */
|
|
351
|
+
comparisonDisabled?: boolean;
|
|
343
352
|
/** Current sort direction for this field */
|
|
344
353
|
sortDirection?: 'asc' | 'desc' | null;
|
|
345
354
|
/** Sort priority (1, 2, 3...) if sorted */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DashboardLayoutMode } from '../types';
|
|
3
|
+
interface FloatingEditToolbarProps {
|
|
4
|
+
/** Whether the static edit bar is visible (toolbar hidden when true) */
|
|
5
|
+
isEditBarVisible: boolean;
|
|
6
|
+
/** Position of the floating toolbar */
|
|
7
|
+
position: 'left' | 'right';
|
|
8
|
+
/** Whether currently in edit mode */
|
|
9
|
+
isEditMode: boolean;
|
|
10
|
+
/** Toggle edit mode on/off */
|
|
11
|
+
onEditModeToggle: () => void;
|
|
12
|
+
/** Current layout mode */
|
|
13
|
+
layoutMode: DashboardLayoutMode;
|
|
14
|
+
/** Change layout mode */
|
|
15
|
+
onLayoutModeChange: (mode: DashboardLayoutMode) => void;
|
|
16
|
+
/** Available layout modes */
|
|
17
|
+
allowedModes: DashboardLayoutMode[];
|
|
18
|
+
/** Whether layout mode can be changed */
|
|
19
|
+
canChangeLayoutMode: boolean;
|
|
20
|
+
/** Current color palette name */
|
|
21
|
+
currentPalette: string;
|
|
22
|
+
/** Change color palette */
|
|
23
|
+
onPaletteChange: (palette: string) => void;
|
|
24
|
+
/** Add new portlet */
|
|
25
|
+
onAddPortlet: () => void;
|
|
26
|
+
}
|
|
27
|
+
export default function FloatingEditToolbar({ isEditBarVisible, position, isEditMode, onEditModeToggle, layoutMode, onLayoutModeChange, allowedModes, canChangeLayoutMode, currentPalette, onPaletteChange, onAddPortlet }: FloatingEditToolbarProps): React.ReactPortal | null;
|
|
28
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
interface ChartTooltipProps {
|
|
3
3
|
formatter?: (value: any, name: any, props: any) => [React.ReactText, React.ReactText];
|
|
4
|
-
labelFormatter?: (label: any) => React.ReactText;
|
|
4
|
+
labelFormatter?: (label: any, payload?: readonly any[]) => React.ReactText;
|
|
5
5
|
}
|
|
6
6
|
export default function ChartTooltip({ formatter, labelFormatter }: ChartTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as t, A as s, d as o, D as r, M as d, P as l, b as i, Q as n } from "./chunks/components-
|
|
2
|
-
import { c as b, j as u, h as y, e as c, d as h, v as D } from "./chunks/charts-
|
|
1
|
+
import { a as t, A as s, d as o, D as r, M as d, P as l, b as i, Q as n } from "./chunks/components-D7wTB56l.js";
|
|
2
|
+
import { c as b, j as u, h as y, e as c, d as h, v as D } from "./chunks/charts-DboFPJFN.js";
|
|
3
3
|
export {
|
|
4
4
|
t as AnalyticsDashboard,
|
|
5
5
|
s as AnalyticsPortlet,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface UseElementVisibilityOptions {
|
|
3
|
+
/** Threshold in pixels - element considered out of view when this much scrolls past top */
|
|
4
|
+
threshold?: number;
|
|
5
|
+
/** Debounce delay in milliseconds */
|
|
6
|
+
debounceMs?: number;
|
|
7
|
+
/** Custom scroll container ref (uses viewport if not provided) */
|
|
8
|
+
containerRef?: RefObject<HTMLElement | null>;
|
|
9
|
+
/** Optional state value to trigger re-initialization when container is found */
|
|
10
|
+
container?: HTMLElement | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Hook to detect whether an element is visible in the viewport/container
|
|
14
|
+
*
|
|
15
|
+
* @param elementRef - Ref to the element to track
|
|
16
|
+
* @param options - Configuration options
|
|
17
|
+
* @returns Boolean indicating if the element is visible (true when in view, false when scrolled out)
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const editBarRef = useRef<HTMLDivElement>(null)
|
|
21
|
+
* const isEditBarVisible = useElementVisibility(editBarRef, {
|
|
22
|
+
* threshold: 80,
|
|
23
|
+
* containerRef: scrollContainerRef
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* // Show floating toolbar when edit bar scrolls out of view
|
|
27
|
+
* {!isEditBarVisible && <FloatingToolbar />}
|
|
28
|
+
*/
|
|
29
|
+
export declare function useElementVisibility(elementRef: RefObject<HTMLElement | null>, { threshold, debounceMs, containerRef, container }?: UseElementVisibilityOptions): boolean;
|
|
30
|
+
export {};
|
|
@@ -4,6 +4,8 @@ interface UseScrollDetectionOptions {
|
|
|
4
4
|
threshold?: number;
|
|
5
5
|
/** Debounce delay in milliseconds (default: 150) */
|
|
6
6
|
debounceMs?: number;
|
|
7
|
+
/** Optional container state to trigger re-initialization when found */
|
|
8
|
+
container?: HTMLElement | null;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* Hook to detect scroll position in a container
|
|
@@ -23,5 +25,5 @@ interface UseScrollDetectionOptions {
|
|
|
23
25
|
* {isScrolled && <div>Shadow visible</div>}
|
|
24
26
|
* </div>
|
|
25
27
|
*/
|
|
26
|
-
export declare function useScrollDetection(containerRef: RefObject<HTMLElement>, { threshold, debounceMs }?: UseScrollDetectionOptions): boolean;
|
|
28
|
+
export declare function useScrollDetection(containerRef: RefObject<HTMLElement | null>, { threshold, debounceMs, container }?: UseScrollDetectionOptions): boolean;
|
|
27
29
|
export {};
|
package/dist/client/hooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as b, useRef as w, useEffect as y, useCallback as C, useMemo as m } from "react";
|
|
2
|
-
import { u as L } from "./chunks/charts-
|
|
3
|
-
import { K as F } from "./chunks/charts-
|
|
2
|
+
import { u as L } from "./chunks/charts--hFH-bsu.js";
|
|
3
|
+
import { K as F } from "./chunks/charts--hFH-bsu.js";
|
|
4
4
|
function W(e, r = {}) {
|
|
5
5
|
const { cubeApi: s, batchCoordinator: u, enableBatching: a } = L(), [l, d] = b({
|
|
6
6
|
resultSet: null,
|
package/dist/client/icons.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as a, x as t, y as o, l as n, m as I, q as c, t as g, v as r, o as y, p, n as T } from "./chunks/charts-
|
|
1
|
+
import { D as a, x as t, y as o, l as n, m as I, q as c, t as g, v as r, o as y, p, n as T } from "./chunks/charts--hFH-bsu.js";
|
|
2
2
|
export {
|
|
3
3
|
a as DEFAULT_ICONS,
|
|
4
4
|
t as getChartTypeIcon,
|
package/dist/client/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { useCubeFieldLabel } from './hooks/useCubeFieldLabel';
|
|
|
21
21
|
export { createCubeClient } from './client/CubeClient';
|
|
22
22
|
export { useTheme } from './hooks/useTheme';
|
|
23
23
|
export { useScrollDetection } from './hooks/useScrollDetection';
|
|
24
|
+
export { useElementVisibility } from './hooks/useElementVisibility';
|
|
24
25
|
export type { PortletConfig, ChartType, ChartAxisConfig, ChartDisplayConfig, CubeQuery, CubeQueryOptions, CubeApiOptions, DashboardConfig } from './types';
|
|
25
26
|
export type { ChartTypeConfig, DisplayOptionConfig, AxisDropZoneConfig } from './charts/chartConfigs';
|
|
26
27
|
export { createDashboardLayout, formatChartData, highlightCodeBlocks } from './utils/index';
|
package/dist/client/index.js
CHANGED
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
import { e as s, a as t, A as r, d as o, D as
|
|
2
|
-
import { C as
|
|
3
|
-
import { L as
|
|
4
|
-
import { ScrollContainerProvider as
|
|
5
|
-
import { useCubeQuery as
|
|
1
|
+
import { e as s, a as t, A as r, d as o, D as i, M as l, c as n, P as u, b as d, Q as h, h as C, f as c, u as b } from "./chunks/components-D7wTB56l.js";
|
|
2
|
+
import { C as y, D as p, L as T, T as m, h as I, e as D, x as f, y as M, l as A, m as E, q as P, t as x, v as L, i as S, g as v, k as B, o as F, p as V, r as k, n as Q, j as w, s as R, a as _, u as j, c as q, d as z, b as G, f as H, w as N } from "./chunks/charts--hFH-bsu.js";
|
|
3
|
+
import { L as U, c as J, f as K, g as W, i as X, p as Y, a as Z } from "./chunks/charts-DboFPJFN.js";
|
|
4
|
+
import { ScrollContainerProvider as aa, useScrollContainer as ea } from "./providers.js";
|
|
5
|
+
import { useCubeQuery as ta } from "./hooks.js";
|
|
6
6
|
export {
|
|
7
7
|
s as AnalysisBuilder,
|
|
8
8
|
t as AnalyticsDashboard,
|
|
9
9
|
r as AnalyticsPortlet,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
y as CubeProvider,
|
|
11
|
+
p as DEFAULT_ICONS,
|
|
12
12
|
o as DashboardEditModal,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
i as DashboardGrid,
|
|
14
|
+
U as LazyChart,
|
|
15
|
+
T as LoadingIndicator,
|
|
16
|
+
l as Modal,
|
|
17
17
|
n as PortletAnalysisModal,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
u as PortletContainer,
|
|
19
|
+
d as PortletEditModal,
|
|
20
|
+
h as QueryBuilder,
|
|
21
|
+
aa as ScrollContainerProvider,
|
|
22
|
+
m as THEME_PRESETS,
|
|
23
|
+
I as applyTheme,
|
|
24
|
+
D as createCubeClient,
|
|
25
|
+
J as createDashboardLayout,
|
|
26
|
+
K as formatChartData,
|
|
27
|
+
W as getAvailableChartTypes,
|
|
28
|
+
f as getChartTypeIcon,
|
|
29
29
|
M as getFieldTypeIcon,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
A as getIcon,
|
|
31
|
+
E as getIconData,
|
|
32
32
|
P as getIconRegistry,
|
|
33
33
|
x as getIconsByCategory,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
L as getMeasureTypeIcon,
|
|
35
|
+
S as getTheme,
|
|
36
|
+
v as getThemeVariable,
|
|
37
37
|
C as highlightCodeBlocks,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
B as isDarkMode,
|
|
39
|
+
X as isValidChartType,
|
|
40
|
+
Y as preloadChart,
|
|
41
|
+
Z as preloadCharts,
|
|
42
|
+
F as registerIcons,
|
|
43
|
+
V as resetIcons,
|
|
44
44
|
k as resetTheme,
|
|
45
45
|
Q as setIcon,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
H as
|
|
46
|
+
w as setTheme,
|
|
47
|
+
R as setThemeVariable,
|
|
48
|
+
_ as useCubeApi,
|
|
49
|
+
j as useCubeContext,
|
|
50
|
+
q as useCubeFeatures,
|
|
51
|
+
z as useCubeFieldLabel,
|
|
52
|
+
G as useCubeMeta,
|
|
53
|
+
ta as useCubeQuery,
|
|
54
|
+
c as useElementVisibility,
|
|
55
|
+
ea as useScrollContainer,
|
|
56
|
+
b as useScrollDetection,
|
|
57
|
+
H as useTheme,
|
|
58
|
+
N as watchThemeChanges
|
|
58
59
|
};
|
|
59
60
|
//# sourceMappingURL=index.js.map
|
package/dist/client/providers.js
CHANGED