react-semaphor 0.0.181 → 0.0.183
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/chunks/{dashboard-plus-O0x1uFqm.js → dashboard-plus-CiMeIZCS.js} +4 -4
- package/dist/chunks/{dashboard-plus-VPipFlfC.js → dashboard-plus-upSoeQoI.js} +342 -318
- package/dist/chunks/{index-gOVFSJhq.js → index-71zNxWPN.js} +5768 -5690
- package/dist/chunks/{index-kwpsiaJa.js → index-O9LcZUoj.js} +80 -74
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +2 -0
- package/dist/types/main.d.ts +61 -0
- package/dist/types/surfboard.d.ts +2 -0
- package/dist/types/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-O9LcZUoj.js");require("react");require("react-dom");exports.Dashboard=e.Dashboard;
|
package/dist/dashboard/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-O9LcZUoj.js"),d=require("./chunks/dashboard-plus-CiMeIZCS.js"),I=require("react");require("react-dom");function N({card:t,footer:u,className:m,...c}){const{customCards:r}=e.useSemaphorContext(),h=I.useRef(null),{isError:p,isLoading:n,isFetching:i,cfg:x,visualKey:C,handleDatapointClick:f}=e.useDashboardCard(t),a=e.useDashboardStore(s=>s.themeStyle),l=e.useDashboardStore(s=>s.selectedSheetId),E=e.useDashboardStore(s=>s.selectedCardId),j=e.useDashboardStore(s=>s.isDashboardEditing),{setCardTitle:g,setCardDescription:D,setSelectedCardId:b}=e.useDashboardActions();function S(s){s.stopPropagation(),b(l,t.id)}function T(){if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.replaceDefault){const o=s.content;if(o)return e.jsxRuntimeExports.jsx(o,{card:t})}}return t.type==="kpi"?t.data&&t.data.length>0&&e.jsxRuntimeExports.jsx(e.KPICard,{isLoading:n||i,card:t}):y}function R(){if(p)return e.jsxRuntimeExports.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(t.type==="table"&&t.data&&t.data.length>0)return e.jsxRuntimeExports.jsxs(e.ScrollArea,{children:[e.jsxRuntimeExports.jsx(e.TableVisual,{card:t,data:t.data}),e.jsxRuntimeExports.jsx(e.ScrollBar,{orientation:"horizontal"})]});if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.content){const o=s.content;return e.jsxRuntimeExports.jsx(o,{card:t})}}if(x)return e.jsxRuntimeExports.jsx(e.ChartJsVisual,{cfg:x,onDatapointClick:f},C)}function A(){if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.footer){const o=s.footer;if(o)return e.jsxRuntimeExports.jsx(o,{card:t})}}return u||null}if(!t.id)return null;const y=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(e.CardHeader,{className:"pb-4",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxRuntimeExports.jsx(e.Editable,{text:t.title,onSave:s=>g(l,t.id,s),children:e.jsxRuntimeExports.jsx(e.CardTitle,{className:"text-base",children:t.title})}),t.refreshInterval&&e.jsxRuntimeExports.jsxs(e.Tooltip,{children:[e.jsxRuntimeExports.jsx(e.TooltipTrigger,{className:"pr-1",children:e.jsxRuntimeExports.jsx("div",{className:e.cn("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":n||i})})}),e.jsxRuntimeExports.jsx(e.TooltipContent,{side:"right",align:"center",children:e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:`Realtime (${t==null?void 0:t.refreshInterval})`})})]}),!t.refreshInterval&&(n||i)&&e.jsxRuntimeExports.jsx(e.LoaderCircle,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),e.jsxRuntimeExports.jsx(e.Editable,{text:(t==null?void 0:t.description)||"",onSave:s=>D(l,t.id,s),children:e.jsxRuntimeExports.jsxs(e.CardDescription,{children:[" ",t.description]})})]}),e.jsxRuntimeExports.jsx(e.CardContent,{className:"relative flex grow flex-col overflow-auto pb-0",children:R()}),e.jsxRuntimeExports.jsx(e.CardFooter,{children:A()})]});return e.jsxRuntimeExports.jsx(e.Card,{tabIndex:-1,ref:h,role:"dashboard-card",onClick:S,className:e.cn("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":E===t.id&&j},a==null?void 0:a.dashboardCard,m),...c,children:T()})}exports.BOOLEAN_DATA_TYPES=e.BOOLEAN_DATA_TYPES;exports.DATE_DATA_TYPES=e.DATE_DATA_TYPES;exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.NUMBER_DATA_TYPES=e.NUMBER_DATA_TYPES;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.TEXT_DATA_TYPES=e.TEXT_DATA_TYPES;exports.cleanCard=e.cleanCard;exports.createSqlGenConfig=e.createSqlGenConfig;exports.fmt=e.fmt;exports.getBookmarkKey=e.getBookmarkKey;exports.getColumnDataType=e.getColumnDataType;exports.getDashbaordStateWithoutData=e.getDashbaordStateWithoutData;exports.getFilterValueType=e.getFilterValueType;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.resolveDataType=e.resolveDataType;exports.useCard=e.useCard;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardStore=e.useDashboardStore;exports.useEditorActions=e.useEditorActions;exports.useEditorStore=e.useEditorStore;exports.SelectComponent=d.SelectComponent;exports.Surfboard=d.DashboardPlus;exports.useEditorAside=d.useEditorAside;exports.DashboardCard=N;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as _, a as k, b as n, c as w, j as s, C as F, E as f, d as P, T as R, e as B, f as h, g as L, L as q, h as K, i as O, k as Y, l as G, K as V, S as z, m as H, n as J, o as M } from "./chunks/index-
|
|
2
|
-
import { B as se, s as te, D as ae, q as oe, N as ne, I as re, r as ie, M as le, w as de, t as ue, O as ce, y as fe, J as he, x as Ce, A as xe, v as me, z as pe, F as ge, p as je, H as De, G as be } from "./chunks/index-
|
|
3
|
-
import { S as Te, D as Ee, u as Ie } from "./chunks/dashboard-plus-
|
|
1
|
+
import { u as _, a as k, b as n, c as w, j as s, C as F, E as f, d as P, T as R, e as B, f as h, g as L, L as q, h as K, i as O, k as Y, l as G, K as V, S as z, m as H, n as J, o as M } from "./chunks/index-71zNxWPN.js";
|
|
2
|
+
import { B as se, s as te, D as ae, q as oe, N as ne, I as re, r as ie, M as le, w as de, t as ue, O as ce, y as fe, J as he, x as Ce, A as xe, v as me, z as pe, F as ge, p as je, H as De, G as be } from "./chunks/index-71zNxWPN.js";
|
|
3
|
+
import { S as Te, D as Ee, u as Ie } from "./chunks/dashboard-plus-upSoeQoI.js";
|
|
4
4
|
import Q from "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
function $({
|
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-CiMeIZCS.js");require("../chunks/index-O9LcZUoj.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
|
package/dist/surfboard/index.js
CHANGED
|
@@ -261,6 +261,7 @@ export declare type TCardPreferences = {
|
|
|
261
261
|
datasetOptions?: TDatasetOptions[];
|
|
262
262
|
chartOptions?: TChartOptions;
|
|
263
263
|
columnSettings?: TColumnSetting<DisplayDataType>[];
|
|
264
|
+
allowDownload?: boolean;
|
|
264
265
|
};
|
|
265
266
|
|
|
266
267
|
export declare type TChartOptions = {
|
|
@@ -304,6 +305,7 @@ export declare type TDashboard = {
|
|
|
304
305
|
customCards?: CustomCard[];
|
|
305
306
|
baseQueries?: TBaseQuery[];
|
|
306
307
|
aiScopeTables?: AIScopeTable[];
|
|
308
|
+
globalStyle?: TStyle;
|
|
307
309
|
};
|
|
308
310
|
|
|
309
311
|
export declare type TDataColumn = {
|
package/dist/types/main.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { StoreApi } from 'zustand';
|
|
|
14
14
|
import { UseBoundStore } from 'zustand';
|
|
15
15
|
|
|
16
16
|
declare type Actions = {
|
|
17
|
+
setGlobalStyle: (style: TStyle) => void;
|
|
17
18
|
setAIScopeTables: (aiScopeTables: AIScopeTable[]) => void;
|
|
18
19
|
setIsSessionExpired: (isSessionExpired: boolean) => void;
|
|
19
20
|
setCurrentBreakpoint: (breakpoint: Breakpoint) => void;
|
|
@@ -353,6 +354,7 @@ export declare function getDashbaordStateWithoutData(dashboardState: TDashboard)
|
|
|
353
354
|
customCards?: CustomCard[] | undefined;
|
|
354
355
|
baseQueries?: TBaseQuery[] | undefined;
|
|
355
356
|
aiScopeTables?: AIScopeTable[] | undefined;
|
|
357
|
+
globalStyle?: TStyle | undefined;
|
|
356
358
|
};
|
|
357
359
|
|
|
358
360
|
export declare function getFilterValueType(filter: TFilter): "string" | "number" | "date" | "boolean";
|
|
@@ -519,6 +521,7 @@ export declare type TCardPreferences = {
|
|
|
519
521
|
datasetOptions?: TDatasetOptions[];
|
|
520
522
|
chartOptions?: TChartOptions;
|
|
521
523
|
columnSettings?: TColumnSetting<DisplayDataType>[];
|
|
524
|
+
allowDownload?: boolean;
|
|
522
525
|
};
|
|
523
526
|
|
|
524
527
|
declare type TChartConfiguration = ChartConfiguration;
|
|
@@ -564,6 +567,7 @@ export declare type TDashboard = {
|
|
|
564
567
|
customCards?: CustomCard[];
|
|
565
568
|
baseQueries?: TBaseQuery[];
|
|
566
569
|
aiScopeTables?: AIScopeTable[];
|
|
570
|
+
globalStyle?: TStyle;
|
|
567
571
|
};
|
|
568
572
|
|
|
569
573
|
export declare type TDataColumn = {
|
|
@@ -807,6 +811,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
807
811
|
};
|
|
808
812
|
};
|
|
809
813
|
}[] | undefined;
|
|
814
|
+
allowDownload?: boolean | undefined;
|
|
810
815
|
} | undefined;
|
|
811
816
|
lastSelectedDatabase?: string | undefined;
|
|
812
817
|
lastSelectedSchema?: string | undefined;
|
|
@@ -987,6 +992,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
987
992
|
};
|
|
988
993
|
};
|
|
989
994
|
}[] | undefined;
|
|
995
|
+
allowDownload?: boolean | undefined;
|
|
990
996
|
} | undefined;
|
|
991
997
|
lastSelectedDatabase?: string | undefined;
|
|
992
998
|
lastSelectedSchema?: string | undefined;
|
|
@@ -1124,6 +1130,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
1124
1130
|
};
|
|
1125
1131
|
};
|
|
1126
1132
|
}[] | undefined;
|
|
1133
|
+
allowDownload?: boolean | undefined;
|
|
1127
1134
|
} | undefined;
|
|
1128
1135
|
lastSelectedDatabase?: string | undefined;
|
|
1129
1136
|
lastSelectedSchema?: string | undefined;
|
|
@@ -1226,6 +1233,56 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
1226
1233
|
schemaName?: string | undefined;
|
|
1227
1234
|
tableName: string;
|
|
1228
1235
|
}[] | undefined;
|
|
1236
|
+
globalStyle?: {
|
|
1237
|
+
default: {
|
|
1238
|
+
dashboardPanel?: string | undefined;
|
|
1239
|
+
dashboardTabsContainer?: string | undefined;
|
|
1240
|
+
dashboardCardContainer?: string | undefined;
|
|
1241
|
+
dashboardCard?: string | undefined;
|
|
1242
|
+
gridLayout?: {
|
|
1243
|
+
className?: string | undefined;
|
|
1244
|
+
margin?: [number, number] | undefined;
|
|
1245
|
+
} | undefined;
|
|
1246
|
+
chart?: {
|
|
1247
|
+
font?: {
|
|
1248
|
+
family?: string | undefined;
|
|
1249
|
+
size?: number | undefined;
|
|
1250
|
+
style?: "normal" | "italic" | "oblique" | "initial" | "inherit" | undefined;
|
|
1251
|
+
weight?: number | "bold" | "normal" | "lighter" | "bolder" | null | undefined;
|
|
1252
|
+
lineHeight?: string | number | undefined;
|
|
1253
|
+
} | undefined;
|
|
1254
|
+
dataset?: any;
|
|
1255
|
+
options?: any;
|
|
1256
|
+
} | undefined;
|
|
1257
|
+
table?: {
|
|
1258
|
+
tableHeaderColor?: string | undefined;
|
|
1259
|
+
} | undefined;
|
|
1260
|
+
};
|
|
1261
|
+
dark?: {
|
|
1262
|
+
dashboardPanel?: string | undefined;
|
|
1263
|
+
dashboardTabsContainer?: string | undefined;
|
|
1264
|
+
dashboardCardContainer?: string | undefined;
|
|
1265
|
+
dashboardCard?: string | undefined;
|
|
1266
|
+
gridLayout?: {
|
|
1267
|
+
className?: string | undefined;
|
|
1268
|
+
margin?: [number, number] | undefined;
|
|
1269
|
+
} | undefined;
|
|
1270
|
+
chart?: {
|
|
1271
|
+
font?: {
|
|
1272
|
+
family?: string | undefined;
|
|
1273
|
+
size?: number | undefined;
|
|
1274
|
+
style?: "normal" | "italic" | "oblique" | "initial" | "inherit" | undefined;
|
|
1275
|
+
weight?: number | "bold" | "normal" | "lighter" | "bolder" | null | undefined;
|
|
1276
|
+
lineHeight?: string | number | undefined;
|
|
1277
|
+
} | undefined;
|
|
1278
|
+
dataset?: any;
|
|
1279
|
+
options?: any;
|
|
1280
|
+
} | undefined;
|
|
1281
|
+
table?: {
|
|
1282
|
+
tableHeaderColor?: string | undefined;
|
|
1283
|
+
} | undefined;
|
|
1284
|
+
} | undefined;
|
|
1285
|
+
} | undefined;
|
|
1229
1286
|
};
|
|
1230
1287
|
selectedSheetId?: string | null | undefined;
|
|
1231
1288
|
selectedFrameId?: string | null | undefined;
|
|
@@ -1359,6 +1416,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
1359
1416
|
};
|
|
1360
1417
|
};
|
|
1361
1418
|
}[] | undefined;
|
|
1419
|
+
allowDownload?: boolean | undefined;
|
|
1362
1420
|
} | undefined;
|
|
1363
1421
|
lastSelectedDatabase?: string | undefined;
|
|
1364
1422
|
lastSelectedSchema?: string | undefined;
|
|
@@ -1425,6 +1483,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
1425
1483
|
onUpdateCard?: ((card: TCard, sheetId: string) => void) | undefined;
|
|
1426
1484
|
onRemoveCard?: ((card: TCard, sheetId: string) => void) | undefined;
|
|
1427
1485
|
actions: {
|
|
1486
|
+
setGlobalStyle: (style: TStyle) => void;
|
|
1428
1487
|
setAIScopeTables: (aiScopeTables: AIScopeTable[]) => void;
|
|
1429
1488
|
setIsSessionExpired: (isSessionExpired: boolean) => void;
|
|
1430
1489
|
setCurrentBreakpoint: (breakpoint: Breakpoint) => void;
|
|
@@ -1697,6 +1756,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
1697
1756
|
};
|
|
1698
1757
|
};
|
|
1699
1758
|
}[] | undefined;
|
|
1759
|
+
allowDownload?: boolean | undefined;
|
|
1700
1760
|
} | undefined;
|
|
1701
1761
|
lastSelectedDatabase?: string | undefined;
|
|
1702
1762
|
lastSelectedSchema?: string | undefined;
|
|
@@ -1834,6 +1894,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
1834
1894
|
};
|
|
1835
1895
|
};
|
|
1836
1896
|
}[] | undefined;
|
|
1897
|
+
allowDownload?: boolean | undefined;
|
|
1837
1898
|
} | undefined;
|
|
1838
1899
|
lastSelectedDatabase?: string | undefined;
|
|
1839
1900
|
lastSelectedSchema?: string | undefined;
|
|
@@ -266,6 +266,7 @@ export declare type TCardPreferences = {
|
|
|
266
266
|
datasetOptions?: TDatasetOptions[];
|
|
267
267
|
chartOptions?: TChartOptions;
|
|
268
268
|
columnSettings?: TColumnSetting<DisplayDataType>[];
|
|
269
|
+
allowDownload?: boolean;
|
|
269
270
|
};
|
|
270
271
|
|
|
271
272
|
export declare type TChartOptions = {
|
|
@@ -309,6 +310,7 @@ export declare type TDashboard = {
|
|
|
309
310
|
customCards?: CustomCard[];
|
|
310
311
|
baseQueries?: TBaseQuery[];
|
|
311
312
|
aiScopeTables?: AIScopeTable[];
|
|
313
|
+
globalStyle?: TStyle;
|
|
312
314
|
};
|
|
313
315
|
|
|
314
316
|
export declare type TDataColumn = {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -258,6 +258,7 @@ export declare type TCardPreferences = {
|
|
|
258
258
|
datasetOptions?: TDatasetOptions[];
|
|
259
259
|
chartOptions?: TChartOptions;
|
|
260
260
|
columnSettings?: TColumnSetting<DisplayDataType>[];
|
|
261
|
+
allowDownload?: boolean;
|
|
261
262
|
};
|
|
262
263
|
|
|
263
264
|
export declare type TChartOptions = {
|
|
@@ -301,6 +302,7 @@ export declare type TDashboard = {
|
|
|
301
302
|
customCards?: CustomCard[];
|
|
302
303
|
baseQueries?: TBaseQuery[];
|
|
303
304
|
aiScopeTables?: AIScopeTable[];
|
|
305
|
+
globalStyle?: TStyle;
|
|
304
306
|
};
|
|
305
307
|
|
|
306
308
|
export declare type TDataColumn = {
|