react-semaphor 0.1.183 → 0.1.185

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.
Files changed (44) hide show
  1. package/dist/chunks/calendar-preferences-dialog-BlkO2Iyl.js +1 -0
  2. package/dist/chunks/calendar-preferences-dialog-Cf45Z1iV.js +457 -0
  3. package/dist/chunks/common-types-CfJLrTJd.js +1 -0
  4. package/dist/chunks/common-types-DhqlRVrq.js +8 -0
  5. package/dist/chunks/{dashboard-controls-BqMZqU3v.js → dashboard-controls-99QUvc-v.js} +8 -8
  6. package/dist/chunks/{dashboard-controls-F8wbPI8x.js → dashboard-controls-BaIn2nYt.js} +499 -484
  7. package/dist/chunks/{dashboard-json-BFRJvB_f.js → dashboard-json-CLnZus5R.js} +1 -1
  8. package/dist/chunks/{dashboard-json-DUNbo5Io.js → dashboard-json-Wc0g-rU5.js} +1 -1
  9. package/dist/chunks/date-formatter-Sz6QDaM8.js +1 -0
  10. package/dist/chunks/{index-B4EhQdS9.js → date-formatter-Y8Za1ib3.js} +500 -544
  11. package/dist/chunks/{edit-dashboard-visual-CPwMz-Gl.js → edit-dashboard-visual-BILSP_JA.js} +3922 -3814
  12. package/dist/chunks/edit-dashboard-visual-C1GBD18Y.js +184 -0
  13. package/dist/chunks/{editor-action-buttons-C5pFQC5d.js → editor-action-buttons-CtZF2jZ1.js} +1 -1
  14. package/dist/chunks/{editor-action-buttons-DEi2BM_u.js → editor-action-buttons-Dms4qFF0.js} +27 -27
  15. package/dist/chunks/{index-LgltNjBB.js → index-CWTYAZIx.js} +21356 -21055
  16. package/dist/chunks/{index-CcVMCdNu.js → index-DnzN4EJh.js} +227 -227
  17. package/dist/chunks/{notification-bell-BCdcnJx6.js → notification-bell-BFuX86W5.js} +109 -109
  18. package/dist/chunks/{notification-bell-C0rpelXK.js → notification-bell-Ys7A4FR5.js} +2 -2
  19. package/dist/chunks/{resource-management-panel-D6ZT7DsU.js → resource-management-panel-D9YWCtpI.js} +160 -160
  20. package/dist/chunks/{resource-management-panel-CaKtrD1Q.js → resource-management-panel-KHhPka_P.js} +1 -1
  21. package/dist/chunks/{use-role-aware-display-preferences-F6Zc7Evm.js → use-role-aware-display-preferences-BQYah_5h.js} +1 -1
  22. package/dist/chunks/{use-role-aware-display-preferences-B3xYm_4b.js → use-role-aware-display-preferences-DLfXCRXV.js} +1 -1
  23. package/dist/chunks/use-visual-utils-CoQ-12pH.js +1 -0
  24. package/dist/chunks/{use-visual-utils-D48U4CBx.js → use-visual-utils-Dq99aM9P.js} +59 -53
  25. package/dist/dashboard/index.cjs +1 -1
  26. package/dist/dashboard/index.js +3 -3
  27. package/dist/format-utils/index.cjs +5 -5
  28. package/dist/format-utils/index.js +200 -250
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +75 -71
  31. package/dist/style.css +1 -1
  32. package/dist/surfboard/index.cjs +1 -1
  33. package/dist/surfboard/index.js +6 -4
  34. package/dist/types/dashboard.d.ts +35 -3
  35. package/dist/types/format-utils.d.ts +43 -20
  36. package/dist/types/index.cjs +1 -1
  37. package/dist/types/index.js +8 -5
  38. package/dist/types/main.d.ts +140 -7
  39. package/dist/types/surfboard.d.ts +42 -3
  40. package/dist/types/types.d.ts +348 -3
  41. package/package.json +1 -1
  42. package/dist/chunks/edit-dashboard-visual-C-2xW9ZO.js +0 -184
  43. package/dist/chunks/index-8Crk3ROJ.js +0 -1
  44. package/dist/chunks/use-visual-utils-B1yUV6dt.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-CcVMCdNu.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-DnzN4EJh.js"),r=require("../chunks/common-types-CfJLrTJd.js"),a=require("../chunks/calendar-preferences-dialog-BlkO2Iyl.js");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
@@ -1,6 +1,8 @@
1
- import { a } from "../chunks/index-LgltNjBB.js";
2
- import { EMPTY_SELECTION as E } from "../types/index.js";
1
+ import { a as e } from "../chunks/index-CWTYAZIx.js";
2
+ import { E as f } from "../chunks/common-types-DhqlRVrq.js";
3
+ import { C as E } from "../chunks/calendar-preferences-dialog-Cf45Z1iV.js";
3
4
  export {
4
- E as EMPTY_SELECTION,
5
- a as Surfboard
5
+ E as CalendarPreferencesDialog,
6
+ f as EMPTY_SELECTION,
7
+ e as Surfboard
6
8
  };
@@ -128,6 +128,9 @@ declare interface CardConfig {
128
128
  metricColumns?: MetricField[];
129
129
  pivotByColumns?: PivotByField[];
130
130
  sortByColumns?: SortByField[];
131
+ detailColumns?: DetailField[];
132
+ /** Preserves non-detail config when switching to detail tables. */
133
+ detailTableBackup?: DetailTableBackupConfig;
131
134
  filters?: FilterGroup;
132
135
  joinPlan?: JoinPlan;
133
136
  rowLimit?: number;
@@ -398,7 +401,7 @@ declare interface DataSource {
398
401
  selectedEntities: SelectedEntities;
399
402
  }
400
403
 
401
- declare const DATE_FORMAT_VALUES: readonly ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "Week of MMM DD, YYYY", "Week of MMMM DD, YYYY", "YYYY-WW", "MMM YYYY", "MMMM YYYY", "YYYY-MM", "MM/YYYY", "YYYY MMM", "Q1 YYYY", "YYYY Q1", "1st Quarter YYYY", "YYYY-Q1", "Quarter 1, YYYY", "YYYY", "YY", "custom"];
404
+ declare const DATE_FORMAT_VALUES: readonly ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "YYYY-MM-DD HH:mm", "YYYY-MM-DD HH:mm:ss", "YYYY-MM-DD HH:mm Z", "YYYY-MM-DD HH:mm:ss Z", "Week of MMM DD, YYYY", "Week of MMMM DD, YYYY", "YYYY-WW", "MMM YYYY", "MMMM YYYY", "YYYY-MM", "MM/YYYY", "YYYY MMM", "Q1 YYYY", "YYYY Q1", "1st Quarter YYYY", "YYYY-Q1", "Quarter 1, YYYY", "YYYY", "YY", "custom"];
402
405
 
403
406
  declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
404
407
 
@@ -412,6 +415,35 @@ declare type DateSelectionMode = 'range' | 'months';
412
415
 
413
416
  declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
414
417
 
418
+ /**
419
+ * Field configuration for detail table columns.
420
+ * Unlike GroupByField, DetailField does not support aggregation or granularity.
421
+ * Columns are selected and displayed as-is from the database.
422
+ */
423
+ declare interface DetailField extends Omit<Field, 'role' | 'granularity'> {
424
+ role: 'detail';
425
+ dateFormat?: DateFormatValue;
426
+ customFormat?: string;
427
+ }
428
+
429
+ declare interface DetailTableBackupConfig {
430
+ groupByColumns?: GroupByField[];
431
+ metricColumns?: MetricField[];
432
+ pivotByColumns?: PivotByField[];
433
+ sortByColumns?: SortByField[];
434
+ rowAggregates?: Array<{
435
+ label?: string;
436
+ function: AggregateFunction;
437
+ groupLevel: string | 'ALL';
438
+ }>;
439
+ columnAggregates?: Array<{
440
+ label?: string;
441
+ function: AggregateFunction;
442
+ pivotLevel: string | 'ALL';
443
+ }>;
444
+ comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
445
+ }
446
+
415
447
  declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
416
448
 
417
449
  export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
@@ -610,7 +642,7 @@ declare interface Field {
610
642
  entityId: string;
611
643
  entityName: string;
612
644
  entityType: EntityType;
613
- role?: 'groupby' | 'metric' | 'sortby' | 'pivotby';
645
+ role?: 'groupby' | 'metric' | 'sortby' | 'pivotby' | 'detail';
614
646
  }
615
647
 
616
648
  declare type FileAttachment = {
@@ -1421,7 +1453,7 @@ export declare type TChartOptions = {
1421
1453
  treemapColorMode?: 'branch' | 'category';
1422
1454
  };
1423
1455
 
1424
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
1456
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'detailTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
1425
1457
 
1426
1458
  export declare type TColumnSetting<T extends DisplayDataType> = {
1427
1459
  columnIdx: number;
@@ -114,8 +114,12 @@ export declare function escapeCSVValue(value: string | number | null | undefined
114
114
  export declare interface ExportFormattingConfig {
115
115
  /** Whether to apply formatting or export raw values */
116
116
  useFormattedValues: boolean;
117
- /** User's timezone for date formatting (REQUIRED for Lambda) */
117
+ /** Context timezone for date formatting (calendarContext) */
118
118
  timezone: string;
119
+ /** Viewer/browser timezone for SQL card defaults */
120
+ browserTimezone?: string;
121
+ /** Whether the export is for a raw SQL card */
122
+ isSqlCard?: boolean;
119
123
  /** Locale for number/date formatting */
120
124
  locale: string;
121
125
  /** CSV delimiter */
@@ -146,6 +150,8 @@ export declare function formatCellValue(value: unknown, columnSettings: ColumnSe
146
150
  useFormattedValues: boolean;
147
151
  timezone: string;
148
152
  locale: string;
153
+ browserTimezone?: string;
154
+ isSqlCard?: boolean;
149
155
  }): string;
150
156
 
151
157
  /**
@@ -154,23 +160,24 @@ export declare function formatCellValue(value: unknown, columnSettings: ColumnSe
154
160
  export declare function formatCurrency(value: number | null | undefined, options?: NumberFormatOptions): string;
155
161
 
156
162
  /**
157
- * Format a date with explicit timezone
158
- * CRITICAL: Always use this in Lambda, never use plain format()
159
- */
160
- export declare function formatDate(value: string | Date | null | undefined, options?: DateFormatOptions, contextTimezone?: string): string;
161
-
162
- /**
163
- * Format a date value based on ColumnSettings.dateFormat
164
- * Used for export formatting
163
+ * Format a date with custom format and optional timezone
164
+ * This is the production implementation used by data-table and pivot-table.
165
+ *
166
+ * @param dateString - The date string to format
167
+ * @param formatPattern - The format pattern (e.g., 'MM/dd/yyyy', 'yyyy-MM-dd HH:mm')
168
+ * Defaults to MM/dd/yyyy when missing or empty.
169
+ * @param displayTimezone - Optional timezone to display the date in (e.g., 'America/Chicago')
170
+ * @param sourceTimezone - How to interpret the input date (default: 'auto')
171
+ * @returns Formatted date string
172
+ *
173
+ * @example
174
+ * // Basic formatting
175
+ * formatDate('2024-01-15T10:30:00Z', 'MM/dd/yyyy') // '01/15/2024'
176
+ *
177
+ * // With display timezone
178
+ * formatDate('2024-01-15T10:30:00Z', 'MM/dd/yyyy HH:mm', 'America/Chicago') // '01/15/2024 04:30'
165
179
  */
166
- export declare function formatDateWithColumnSettings(value: string | Date | null | undefined, dateFormat: {
167
- format?: string;
168
- useCustomFormat?: boolean;
169
- customFormat?: string;
170
- useRelativeTime?: boolean;
171
- timezone?: string;
172
- sourceTimezone?: string;
173
- } | undefined, contextTimezone: string): string;
180
+ export declare const formatDate: (dateString: string | null | undefined, formatPattern: string | undefined, displayTimezone?: string, sourceTimezone?: string) => string;
174
181
 
175
182
  /**
176
183
  * Format a number with locale-aware formatting
@@ -225,9 +232,13 @@ export declare function formatPivotDataRow(row: PivotRowData, pivotConfig: Pivot
225
232
  export declare function formatPivotTableForCSV(data: PivotRowData[], pivotConfig: PivotExportConfig, formattingConfig: ExportFormattingConfig): string[];
226
233
 
227
234
  /**
228
- * Format a date as relative time (e.g., "2 days ago")
235
+ * Format relative time using date-fns (e.g., "2 days ago")
236
+ *
237
+ * @param dateString - The date string to format
238
+ * @param sourceTimezone - How to interpret the input date (default: 'auto')
239
+ * @returns Relative time string
229
240
  */
230
- export declare function formatRelativeTime(value: string | Date | null | undefined): string;
241
+ export declare const formatRelativeTime: (dateString: string | null | undefined, sourceTimezone?: string) => string;
231
242
 
232
243
  /**
233
244
  * Format a row of data for export
@@ -319,7 +330,7 @@ export declare function objectsToCSV(data: Record<string, unknown>[], options?:
319
330
  * @param sourceTimezone - How to interpret the date:
320
331
  * - 'auto': If date has Z/offset, use it; otherwise assume UTC
321
332
  * - 'UTC': Always interpret as UTC
322
- * - specific TZ: Use explicit timezone if present, otherwise assume UTC
333
+ * - specific TZ: Use explicit timezone if present, otherwise assume source TZ
323
334
  */
324
335
  export declare function parseWithSourceTimezone(dateString: string, sourceTimezone?: string): Date;
325
336
 
@@ -360,6 +371,18 @@ export declare interface PivotRowData {
360
371
  isGrandTotal?: boolean;
361
372
  }
362
373
 
374
+ /**
375
+ * Date formatting utilities with timezone support
376
+ * IMPORTANT: No React imports allowed in this file
377
+ *
378
+ * Uses date-fns and date-fns-tz for consistent behavior in browser and Node.js
379
+ *
380
+ * This module provides the canonical date formatting functions used by:
381
+ * - data-table component
382
+ * - pivot-table component
383
+ * - aggregated-table component
384
+ * - Lambda CSV export (chunk-processor)
385
+ */
363
386
  /**
364
387
  * Resolve which timezone to use for formatting
365
388
  * Priority: column-specific > context timezone
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={database:null,schema:null,table:null};exports.EMPTY_SELECTION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../chunks/common-types-CfJLrTJd.js"),e={tz:"UTC",weekStart:1,anchor:"now"};exports.EMPTY_SELECTION=T.EMPTY_SELECTION;exports.DEFAULT_CALENDAR_CONTEXT=e;
@@ -1,8 +1,11 @@
1
- const l = {
2
- database: null,
3
- schema: null,
4
- table: null
1
+ import { E as T } from "../chunks/common-types-DhqlRVrq.js";
2
+ const E = {
3
+ tz: "UTC",
4
+ weekStart: 1,
5
+ // Monday (ISO standard)
6
+ anchor: "now"
5
7
  };
6
8
  export {
7
- l as EMPTY_SELECTION
9
+ E as DEFAULT_CALENDAR_CONTEXT,
10
+ T as EMPTY_SELECTION
8
11
  };
@@ -444,6 +444,42 @@ export declare interface CalculatedFieldFormula {
444
444
  */
445
445
  export declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
446
446
 
447
+ /**
448
+ * Calendar context for timezone-aware date operations.
449
+ * Controls how dates are interpreted, grouped, and displayed.
450
+ */
451
+ export declare type CalendarContext = {
452
+ /**
453
+ * IANA timezone identifier.
454
+ * @example 'America/Chicago', 'Europe/London', 'Asia/Tokyo', 'UTC'
455
+ * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
456
+ */
457
+ tz: string;
458
+ /**
459
+ * Day the week starts on.
460
+ * 0 = Sunday (US, Canada, Japan)
461
+ * 1 = Monday (ISO standard, most of Europe)
462
+ * 6 = Saturday (Middle East)
463
+ * @default 1 (Monday) for backward compatibility
464
+ */
465
+ weekStart: WeekStart;
466
+ /**
467
+ * Date anchor for relative date calculations.
468
+ * - 'now': Use current time (default, live dashboards)
469
+ * - { iso: string }: Fixed ISO 8601 date for reproducible views
470
+ */
471
+ anchor: 'now' | {
472
+ iso: string;
473
+ };
474
+ };
475
+
476
+ export declare function CalendarPreferencesDialog({ open, onOpenChange, }: CalendarPreferencesDialogProps): JSX.Element;
477
+
478
+ declare interface CalendarPreferencesDialogProps {
479
+ open: boolean;
480
+ onOpenChange: (open: boolean) => void;
481
+ }
482
+
447
483
  /**
448
484
  * Cancel/delete an export job
449
485
  */
@@ -454,6 +490,9 @@ export declare interface CardConfig {
454
490
  metricColumns?: MetricField[];
455
491
  pivotByColumns?: PivotByField[];
456
492
  sortByColumns?: SortByField[];
493
+ detailColumns?: DetailField[];
494
+ /** Preserves non-detail config when switching to detail tables. */
495
+ detailTableBackup?: DetailTableBackupConfig;
457
496
  filters?: FilterGroup;
458
497
  joinPlan?: JoinPlan;
459
498
  rowLimit?: number;
@@ -508,7 +547,7 @@ export declare interface CardInteractionConfig {
508
547
 
509
548
  export declare type CardMode = 'explorer' | 'dev';
510
549
 
511
- export declare type CardType = 'table' | 'aggregateTable' | 'pivotTable';
550
+ export declare type CardType = 'table' | 'aggregateTable' | 'pivotTable' | 'detailTable';
512
551
 
513
552
  declare type CardWithContent = BaseCustomCard & {
514
553
  content: React.FC<{
@@ -710,7 +749,7 @@ export declare type ConnectionPolicy = {
710
749
 
711
750
  export declare type ConnectionType = 'GoogleSheets' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
712
751
 
713
- export declare type ContainerId = 'groupBy' | 'metrics' | 'pivotBy' | 'sortBy' | 'source';
752
+ export declare type ContainerId = 'groupBy' | 'metrics' | 'pivotBy' | 'sortBy' | 'detailColumns' | 'source';
714
753
 
715
754
  /**
716
755
  * Factory function to create empty KPI card configuration
@@ -944,7 +983,7 @@ export declare interface DataSource {
944
983
 
945
984
  export declare type DataType = 'string' | 'number' | 'date' | 'datetime' | 'boolean' | 'json' | 'geo';
946
985
 
947
- export declare const DATE_FORMAT_VALUES: readonly ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "Week of MMM DD, YYYY", "Week of MMMM DD, YYYY", "YYYY-WW", "MMM YYYY", "MMMM YYYY", "YYYY-MM", "MM/YYYY", "YYYY MMM", "Q1 YYYY", "YYYY Q1", "1st Quarter YYYY", "YYYY-Q1", "Quarter 1, YYYY", "YYYY", "YY", "custom"];
986
+ export declare const DATE_FORMAT_VALUES: readonly ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "YYYY-MM-DD HH:mm", "YYYY-MM-DD HH:mm:ss", "YYYY-MM-DD HH:mm Z", "YYYY-MM-DD HH:mm:ss Z", "Week of MMM DD, YYYY", "Week of MMMM DD, YYYY", "YYYY-WW", "MMM YYYY", "MMMM YYYY", "YYYY-MM", "MM/YYYY", "YYYY MMM", "Q1 YYYY", "YYYY Q1", "1st Quarter YYYY", "YYYY-Q1", "Quarter 1, YYYY", "YYYY", "YY", "custom"];
948
987
 
949
988
  export declare type DateFormatOption = {
950
989
  value: DateFormatValue;
@@ -965,6 +1004,41 @@ declare type DateSelectionMode = 'range' | 'months';
965
1004
 
966
1005
  declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
967
1006
 
1007
+ /**
1008
+ * Default CalendarContext when not provided.
1009
+ * Used as fallback for backward compatibility.
1010
+ */
1011
+ export declare const DEFAULT_CALENDAR_CONTEXT: CalendarContext;
1012
+
1013
+ /**
1014
+ * Field configuration for detail table columns.
1015
+ * Unlike GroupByField, DetailField does not support aggregation or granularity.
1016
+ * Columns are selected and displayed as-is from the database.
1017
+ */
1018
+ export declare interface DetailField extends Omit<Field, 'role' | 'granularity'> {
1019
+ role: 'detail';
1020
+ dateFormat?: DateFormatValue;
1021
+ customFormat?: string;
1022
+ }
1023
+
1024
+ export declare interface DetailTableBackupConfig {
1025
+ groupByColumns?: GroupByField[];
1026
+ metricColumns?: MetricField[];
1027
+ pivotByColumns?: PivotByField[];
1028
+ sortByColumns?: SortByField[];
1029
+ rowAggregates?: Array<{
1030
+ label?: string;
1031
+ function: AggregateFunction;
1032
+ groupLevel: string | 'ALL';
1033
+ }>;
1034
+ columnAggregates?: Array<{
1035
+ label?: string;
1036
+ function: AggregateFunction;
1037
+ pivotLevel: string | 'ALL';
1038
+ }>;
1039
+ comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
1040
+ }
1041
+
968
1042
  export declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
969
1043
 
970
1044
  export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
@@ -1385,6 +1459,8 @@ export declare type ExportFormat = 'csv';
1385
1459
  export declare interface ExportFormattingConfig {
1386
1460
  useFormattedValues: boolean;
1387
1461
  timezone: string;
1462
+ browserTimezone?: string;
1463
+ isSqlCard?: boolean;
1388
1464
  locale: string;
1389
1465
  delimiter: ',' | ';' | '\t';
1390
1466
  includeHeaders: boolean;
@@ -1509,7 +1585,7 @@ export declare interface Field {
1509
1585
  entityId: string;
1510
1586
  entityName: string;
1511
1587
  entityType: EntityType;
1512
- role?: 'groupby' | 'metric' | 'sortby' | 'pivotby';
1588
+ role?: 'groupby' | 'metric' | 'sortby' | 'pivotby' | 'detail';
1513
1589
  }
1514
1590
 
1515
1591
  declare type FileAttachment = {
@@ -2163,6 +2239,22 @@ export declare interface QueryConfig {
2163
2239
  orderBy?: OrderBy[];
2164
2240
  }
2165
2241
 
2242
+ /**
2243
+ * Response structure for query execution (standard queries and comparison queries)
2244
+ */
2245
+ export declare interface QueryExecutionResponse {
2246
+ records: any[];
2247
+ output: string;
2248
+ rowLimitExceeded: boolean;
2249
+ sql?: string;
2250
+ userSql?: string;
2251
+ pivotSchema?: any;
2252
+ pagination?: PaginationMetadata;
2253
+ subtotalColumns?: string[];
2254
+ columnSubtotalMeta?: any;
2255
+ metadata?: any;
2256
+ }
2257
+
2166
2258
  export declare type QueryFilter = {
2167
2259
  filterColumnName: string;
2168
2260
  filterValue: OldFilterValue;
@@ -2198,6 +2290,22 @@ export declare function resolveDatamodelName(datamodelName: string): string;
2198
2290
 
2199
2291
  export declare const resolveDataType: (value: any) => string;
2200
2292
 
2293
+ /**
2294
+ * Parameters in JWT payload (after backend resolution).
2295
+ * The backend ALWAYS includes calendarContext, even if customer didn't provide it.
2296
+ */
2297
+ export declare type ResolvedTokenParams = Omit<TokenParams, 'calendarContext'> & {
2298
+ /**
2299
+ * Full calendar context for timezone-aware operations.
2300
+ * ALWAYS present in JWT - resolved by backend from:
2301
+ * 1. Token request calendarContext (highest priority)
2302
+ * 2. Token request timezone (legacy)
2303
+ * 3. User/Tenant/Org preferences (Phase 7)
2304
+ * 4. Default: { tz: 'UTC', weekStart: 1, anchor: 'now' }
2305
+ */
2306
+ calendarContext: CalendarContext;
2307
+ };
2308
+
2201
2309
  export declare interface ResourceListItem {
2202
2310
  id: string;
2203
2311
  title: string;
@@ -2705,7 +2813,7 @@ export declare type TChartOptions = {
2705
2813
  treemapColorMode?: 'branch' | 'category';
2706
2814
  };
2707
2815
 
2708
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
2816
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'detailTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
2709
2817
 
2710
2818
  export declare type TColumnSetting<T extends DisplayDataType> = {
2711
2819
  columnIdx: number;
@@ -3028,8 +3136,12 @@ export declare type TLineStyle = 'solid' | 'dashed' | 'dotted' | 'dash-dot';
3028
3136
 
3029
3137
  /**
3030
3138
  * Parameters for customizing token behavior and formatting.
3139
+ * This is used for token REQUEST (customer provides these).
3031
3140
  */
3032
3141
  export declare type TokenParams = {
3142
+ /**
3143
+ * Currency formatting options.
3144
+ */
3033
3145
  currencyFormat?: {
3034
3146
  /**
3035
3147
  * Locale identifier (e.g., 'en-US', 'fr-FR').
@@ -3041,11 +3153,23 @@ export declare type TokenParams = {
3041
3153
  currency: string;
3042
3154
  };
3043
3155
  /**
3044
- * Time zone identifier (e.g., 'America/New_York', 'Europe/London').
3156
+ * IANA timezone identifier for date operations.
3157
+ * @deprecated Use calendarContext.tz instead for full calendar control.
3158
+ * @example 'America/Chicago', 'Europe/London'
3045
3159
  */
3046
3160
  timezone?: string;
3161
+ /**
3162
+ * Full calendar context for timezone-aware operations.
3163
+ * Optional in token request - the backend ALWAYS resolves and includes
3164
+ * this in the JWT, even when the customer doesn't provide it.
3165
+ */
3166
+ calendarContext?: CalendarContext;
3047
3167
  };
3048
3168
 
3169
+ /**
3170
+ * Token properties from JWT payload.
3171
+ * This is what the frontend receives after token generation.
3172
+ */
3049
3173
  export declare type TokenProps = {
3050
3174
  /**
3051
3175
  * Allowed semantic domains.
@@ -3107,8 +3231,9 @@ export declare type TokenProps = {
3107
3231
  rcls?: TokenSecurityPolicy[] | TokenSecurityPolicy;
3108
3232
  /**
3109
3233
  * Parameter overrides and preferences (e.g., formatting).
3234
+ * Uses ResolvedTokenParams because backend ALWAYS includes calendarContext.
3110
3235
  */
3111
- params?: TokenParams;
3236
+ params?: ResolvedTokenParams;
3112
3237
  /**
3113
3238
  * UI behavior and feature flags.
3114
3239
  */
@@ -3648,4 +3773,12 @@ declare type VisualProps = DashboardProps & {
3648
3773
  displayPreferences?: VisualDisplayPreferences;
3649
3774
  };
3650
3775
 
3776
+ /**
3777
+ * Week start day type.
3778
+ * 0 = Sunday (US, Canada, Japan)
3779
+ * 1 = Monday (ISO standard, most of Europe)
3780
+ * 6 = Saturday (Middle East)
3781
+ */
3782
+ export declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
3783
+
3651
3784
  export { }
@@ -123,11 +123,21 @@ declare interface CalculatedFieldFormula {
123
123
  */
124
124
  declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
125
125
 
126
+ export declare function CalendarPreferencesDialog({ open, onOpenChange, }: CalendarPreferencesDialogProps): JSX.Element;
127
+
128
+ declare interface CalendarPreferencesDialogProps {
129
+ open: boolean;
130
+ onOpenChange: (open: boolean) => void;
131
+ }
132
+
126
133
  declare interface CardConfig {
127
134
  groupByColumns?: GroupByField[];
128
135
  metricColumns?: MetricField[];
129
136
  pivotByColumns?: PivotByField[];
130
137
  sortByColumns?: SortByField[];
138
+ detailColumns?: DetailField[];
139
+ /** Preserves non-detail config when switching to detail tables. */
140
+ detailTableBackup?: DetailTableBackupConfig;
131
141
  filters?: FilterGroup;
132
142
  joinPlan?: JoinPlan;
133
143
  rowLimit?: number;
@@ -401,7 +411,7 @@ declare interface DataSource {
401
411
  selectedEntities: SelectedEntities;
402
412
  }
403
413
 
404
- declare const DATE_FORMAT_VALUES: readonly ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "Week of MMM DD, YYYY", "Week of MMMM DD, YYYY", "YYYY-WW", "MMM YYYY", "MMMM YYYY", "YYYY-MM", "MM/YYYY", "YYYY MMM", "Q1 YYYY", "YYYY Q1", "1st Quarter YYYY", "YYYY-Q1", "Quarter 1, YYYY", "YYYY", "YY", "custom"];
414
+ declare const DATE_FORMAT_VALUES: readonly ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "YYYY-MM-DD HH:mm", "YYYY-MM-DD HH:mm:ss", "YYYY-MM-DD HH:mm Z", "YYYY-MM-DD HH:mm:ss Z", "Week of MMM DD, YYYY", "Week of MMMM DD, YYYY", "YYYY-WW", "MMM YYYY", "MMMM YYYY", "YYYY-MM", "MM/YYYY", "YYYY MMM", "Q1 YYYY", "YYYY Q1", "1st Quarter YYYY", "YYYY-Q1", "Quarter 1, YYYY", "YYYY", "YY", "custom"];
405
415
 
406
416
  declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
407
417
 
@@ -415,6 +425,35 @@ declare type DateSelectionMode = 'range' | 'months';
415
425
 
416
426
  declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
417
427
 
428
+ /**
429
+ * Field configuration for detail table columns.
430
+ * Unlike GroupByField, DetailField does not support aggregation or granularity.
431
+ * Columns are selected and displayed as-is from the database.
432
+ */
433
+ declare interface DetailField extends Omit<Field, 'role' | 'granularity'> {
434
+ role: 'detail';
435
+ dateFormat?: DateFormatValue;
436
+ customFormat?: string;
437
+ }
438
+
439
+ declare interface DetailTableBackupConfig {
440
+ groupByColumns?: GroupByField[];
441
+ metricColumns?: MetricField[];
442
+ pivotByColumns?: PivotByField[];
443
+ sortByColumns?: SortByField[];
444
+ rowAggregates?: Array<{
445
+ label?: string;
446
+ function: AggregateFunction;
447
+ groupLevel: string | 'ALL';
448
+ }>;
449
+ columnAggregates?: Array<{
450
+ label?: string;
451
+ function: AggregateFunction;
452
+ pivotLevel: string | 'ALL';
453
+ }>;
454
+ comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
455
+ }
456
+
418
457
  declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
419
458
 
420
459
  export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
@@ -613,7 +652,7 @@ declare interface Field {
613
652
  entityId: string;
614
653
  entityName: string;
615
654
  entityType: EntityType;
616
- role?: 'groupby' | 'metric' | 'sortby' | 'pivotby';
655
+ role?: 'groupby' | 'metric' | 'sortby' | 'pivotby' | 'detail';
617
656
  }
618
657
 
619
658
  declare type FileAttachment = {
@@ -1426,7 +1465,7 @@ export declare type TChartOptions = {
1426
1465
  treemapColorMode?: 'branch' | 'category';
1427
1466
  };
1428
1467
 
1429
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
1468
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'detailTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
1430
1469
 
1431
1470
  export declare type TColumnSetting<T extends DisplayDataType> = {
1432
1471
  columnIdx: number;