semaphor 0.0.112 → 0.0.114

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-BOeNr29P.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/dashboard-plus-ByzYCkhZ.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as f } from "../chunks/dashboard-plus-CioOSPos.js";
1
+ import { D as f } from "../chunks/dashboard-plus-0Rn87MhT.js";
2
2
  import { EMPTY_SELECTION as a } from "../types/index.js";
3
3
  export {
4
4
  a as EMPTY_SELECTION,
@@ -88,6 +88,16 @@ declare interface CardConfig {
88
88
  showTrendline?: boolean;
89
89
  trendlineWindow?: number;
90
90
  trendlineGranularity?: 'day' | 'week' | 'month';
91
+ rowAggregates?: Array<{
92
+ label?: string;
93
+ function: AggregateFunction;
94
+ groupLevel: string | 'ALL';
95
+ }>;
96
+ columnAggregates?: Array<{
97
+ label?: string;
98
+ function: AggregateFunction;
99
+ pivotLevel: string | 'ALL';
100
+ }>;
91
101
  }
92
102
 
93
103
  declare interface CardInteractionConfig {
@@ -194,7 +204,7 @@ declare type ConnectionType = 'GoogleSheets' | 'MySQL' | 'MSSQL' | 'PostgreSQL'
194
204
 
195
205
  export declare type CustomCard = CardWithContent | CardWithFooter;
196
206
 
197
- export declare function Dashboard(props: DashboardProps): JSX_2.Element;
207
+ export declare function Dashboard(props: DashboardProps): JSX_2.Element | null;
198
208
 
199
209
  export declare type DashboardEventHandlers = {
200
210
  onExportData?: (payload: ExportDataPayload) => void;
@@ -735,6 +745,7 @@ declare type TablePreferences = {
735
745
  selectColumnVisible?: boolean;
736
746
  columnVisibility?: Record<string, boolean>;
737
747
  pageSize?: number;
748
+ enableDevModePagination?: boolean;
738
749
  };
739
750
 
740
751
  export declare type TBaseQuery = {
@@ -862,7 +873,7 @@ export declare type TChartOptions = {
862
873
  };
863
874
  };
864
875
 
865
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
876
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
866
877
 
867
878
  export declare type TColumnSetting<T extends DisplayDataType> = {
868
879
  columnIdx: number;
@@ -200,6 +200,14 @@ declare type Actions_2 = TableActions & ExplorerActions & DrillActions & {
200
200
 
201
201
  export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
202
202
 
203
+ /**
204
+ * Configuration for which aggregate functions to use and at which levels (by Field.id)
205
+ */
206
+ export declare interface AggregateConfig {
207
+ functions: AggregateFunction[];
208
+ levels?: string[];
209
+ }
210
+
203
211
  export declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
204
212
 
205
213
  declare type AIContext = {
@@ -285,6 +293,16 @@ export declare interface CardConfig {
285
293
  showTrendline?: boolean;
286
294
  trendlineWindow?: number;
287
295
  trendlineGranularity?: 'day' | 'week' | 'month';
296
+ rowAggregates?: Array<{
297
+ label?: string;
298
+ function: AggregateFunction;
299
+ groupLevel: string | 'ALL';
300
+ }>;
301
+ columnAggregates?: Array<{
302
+ label?: string;
303
+ function: AggregateFunction;
304
+ pivotLevel: string | 'ALL';
305
+ }>;
288
306
  }
289
307
 
290
308
  declare interface CardInteractionConfig {
@@ -385,6 +403,13 @@ declare interface ColumnSettings {
385
403
 
386
404
  declare type ColumnSettingsMap = Record<string, ColumnSettings>;
387
405
 
406
+ export declare interface ColumnSubtotalMeta {
407
+ alias: string;
408
+ subtotalLevel?: string;
409
+ isColumnSubtotal?: boolean;
410
+ isColumnTotal?: boolean;
411
+ }
412
+
388
413
  export declare type ColumnType = 'string' | 'number' | 'date';
389
414
 
390
415
  declare type ComboBoxOption = {
@@ -411,7 +436,7 @@ export declare function createSqlGenConfig(column: TDataColumn, preSqlGen: SqlGe
411
436
 
412
437
  export declare type CustomCard = CardWithContent | CardWithFooter;
413
438
 
414
- export declare function Dashboard(props: DashboardProps): JSX_2.Element;
439
+ export declare function Dashboard(props: DashboardProps): JSX_2.Element | null;
415
440
 
416
441
  export declare type DashboardEventHandlers = {
417
442
  onExportData?: (payload: ExportDataPayload) => void;
@@ -1112,14 +1137,35 @@ export declare interface PivotByField extends Field {
1112
1137
  role: 'pivotby';
1113
1138
  }
1114
1139
 
1115
- export declare interface PivotColumnSchema {
1116
- alias: string;
1117
- metricId: string;
1118
- metricName: string;
1119
- metricLabel?: string;
1120
- pivotValues: string[];
1121
- pivotFields: string[];
1122
- displayLabel?: string;
1140
+ /**
1141
+ const config: CardConfig = {
1142
+ groupByColumns: [
1143
+ { id: 'region', name: 'region', label: 'Region', ... },
1144
+ { id: 'country', name: 'country', label: 'Country', ... }
1145
+ ],
1146
+ pivotByColumns: [
1147
+ { id: 'year', name: 'year', label: 'Year', ... },
1148
+ { id: 'quarter', name: 'quarter', label: 'Quarter', ... }
1149
+ ],
1150
+ metricColumns: [ ... ],
1151
+ rowAggregates: ['SUM', 'AVG'],
1152
+ columnAggregates: ['SUM'],
1153
+ subtotals: {
1154
+ groupBy: { functions: ['SUM'], levels: ['region'] }, // subtotal at region level
1155
+ pivotBy: { functions: ['SUM'], levels: ['year'] } // subtotal at year level
1156
+ }
1157
+ };
1158
+ */
1159
+ export declare enum PivotMarkerEnum {
1160
+ SUBTOTAL = "__SUBTOTAL__",
1161
+ TOTAL = "__TOTAL__",
1162
+ ALL = "__ALL__"
1163
+ }
1164
+
1165
+ export declare interface PivotRowMetadata {
1166
+ isSubtotal?: boolean;
1167
+ subtotalLevel?: string | null;
1168
+ isGrandTotal?: boolean;
1123
1169
  }
1124
1170
 
1125
1171
  export declare type Placeholders = {
@@ -1274,7 +1320,15 @@ export declare type StyleProps = {
1274
1320
  };
1275
1321
  };
1276
1322
 
1277
- export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
1323
+ /**
1324
+ * Subtotal configuration for groupBy and pivotBy axes
1325
+ */
1326
+ export declare interface SubtotalConfig {
1327
+ groupBy?: AggregateConfig;
1328
+ pivotBy?: AggregateConfig;
1329
+ }
1330
+
1331
+ export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element | null;
1278
1332
 
1279
1333
  declare interface TableActions {
1280
1334
  updateColumnSettingsMap: (columnSettings: ColumnSettingsMap) => void;
@@ -1301,6 +1355,7 @@ declare type TablePreferences = {
1301
1355
  selectColumnVisible?: boolean;
1302
1356
  columnVisibility?: Record<string, boolean>;
1303
1357
  pageSize?: number;
1358
+ enableDevModePagination?: boolean;
1304
1359
  };
1305
1360
 
1306
1361
  export declare type TBaseQuery = {
@@ -1430,7 +1485,7 @@ export declare type TChartOptions = {
1430
1485
  };
1431
1486
  };
1432
1487
 
1433
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
1488
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
1434
1489
 
1435
1490
  export declare type TColumnSetting<T extends DisplayDataType> = {
1436
1491
  columnIdx: number;
@@ -1580,18 +1635,26 @@ export declare type TokenParams = {
1580
1635
  * Main payload for generating a secure access token for a dashboard.
1581
1636
  */
1582
1637
  export declare type TokenRequest = {
1638
+ /**
1639
+ * Allowed semantic domains.
1640
+ */
1641
+ allowedSemanticDomains?: string[];
1583
1642
  /**
1584
1643
  * Type of the token request. Default is 'dashboard'.
1585
1644
  */
1586
1645
  type?: 'dashboard' | 'project';
1646
+ /**
1647
+ * Initial dashboard id to be accessed.
1648
+ */
1649
+ initialDashboardId?: string;
1587
1650
  /**
1588
1651
  * Identifier of the dashboard to be accessed.
1589
1652
  */
1590
- dashboardId: string;
1653
+ dashboardId?: string;
1591
1654
  /**
1592
1655
  * Secret key used for validating access to the dashboard.
1593
1656
  */
1594
- dashboardSecret: string;
1657
+ dashboardSecret?: string;
1595
1658
  /**
1596
1659
  * Unique identifier of the project.
1597
1660
  */
@@ -1632,6 +1695,10 @@ export declare type TokenRequest = {
1632
1695
  * Enables self-service editing and lens creation by the end user.
1633
1696
  */
1634
1697
  allowEdit?: boolean;
1698
+ /**
1699
+ * Schema level security policy. The schema name for the tenant.
1700
+ */
1701
+ sls?: string;
1635
1702
  /**
1636
1703
  * Connection-level security policies.
1637
1704
  * Can be a single policy or an array of policies.
@@ -88,6 +88,16 @@ declare interface CardConfig {
88
88
  showTrendline?: boolean;
89
89
  trendlineWindow?: number;
90
90
  trendlineGranularity?: 'day' | 'week' | 'month';
91
+ rowAggregates?: Array<{
92
+ label?: string;
93
+ function: AggregateFunction;
94
+ groupLevel: string | 'ALL';
95
+ }>;
96
+ columnAggregates?: Array<{
97
+ label?: string;
98
+ function: AggregateFunction;
99
+ pivotLevel: string | 'ALL';
100
+ }>;
91
101
  }
92
102
 
93
103
  declare interface CardInteractionConfig {
@@ -733,13 +743,14 @@ export declare type StyleProps = {
733
743
  };
734
744
  };
735
745
 
736
- export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
746
+ export declare function Surfboard({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element | null;
737
747
 
738
748
  declare type TablePreferences = {
739
749
  columnSettingsMap?: ColumnSettingsMap;
740
750
  selectColumnVisible?: boolean;
741
751
  columnVisibility?: Record<string, boolean>;
742
752
  pageSize?: number;
753
+ enableDevModePagination?: boolean;
743
754
  };
744
755
 
745
756
  export declare type TBaseQuery = {
@@ -867,7 +878,7 @@ export declare type TChartOptions = {
867
878
  };
868
879
  };
869
880
 
870
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
881
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
871
882
 
872
883
  export declare type TColumnSetting<T extends DisplayDataType> = {
873
884
  columnIdx: number;
@@ -87,6 +87,16 @@ declare interface CardConfig {
87
87
  showTrendline?: boolean;
88
88
  trendlineWindow?: number;
89
89
  trendlineGranularity?: 'day' | 'week' | 'month';
90
+ rowAggregates?: Array<{
91
+ label?: string;
92
+ function: AggregateFunction;
93
+ groupLevel: string | 'ALL';
94
+ }>;
95
+ columnAggregates?: Array<{
96
+ label?: string;
97
+ function: AggregateFunction;
98
+ pivotLevel: string | 'ALL';
99
+ }>;
90
100
  }
91
101
 
92
102
  declare interface CardInteractionConfig {
@@ -732,6 +742,7 @@ declare type TablePreferences = {
732
742
  selectColumnVisible?: boolean;
733
743
  columnVisibility?: Record<string, boolean>;
734
744
  pageSize?: number;
745
+ enableDevModePagination?: boolean;
735
746
  };
736
747
 
737
748
  export declare type TBaseQuery = {
@@ -859,7 +870,7 @@ export declare type TChartOptions = {
859
870
  };
860
871
  };
861
872
 
862
- declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
873
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'custom';
863
874
 
864
875
  export declare type TColumnSetting<T extends DisplayDataType> = {
865
876
  columnIdx: number;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.112",
8
+ "version": "0.0.114",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -65,7 +65,7 @@
65
65
  "@radix-ui/react-icons": "^1.3.2",
66
66
  "@radix-ui/react-label": "^2.1.1",
67
67
  "@radix-ui/react-popover": "^1.1.4",
68
- "@radix-ui/react-progress": "^1.1.7",
68
+ "@radix-ui/react-progress": "^1.0.3",
69
69
  "@radix-ui/react-radio-group": "^1.2.2",
70
70
  "@radix-ui/react-scroll-area": "^1.2.2",
71
71
  "@radix-ui/react-select": "^2.1.4",