semaphor 0.0.73 → 0.0.74
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-FerlOXoM.js → dashboard-plus-Y0SaVfMR.js} +254 -253
- package/dist/chunks/dashboard-plus-aiBcmf0f.js +240 -0
- package/dist/chunks/{index-iJk4qIzr.js → index-FWArdRk4.js} +7968 -7943
- package/dist/chunks/{index-U7x2Y1RF.js → index-Vo7AS1qw.js} +89 -89
- package/dist/chunks/{lucide-react-7ykF8dnU.js → lucide-react-aeDoVIV4.js} +1 -1
- package/dist/chunks/{lucide-react-AhNUyo0A.js → lucide-react-ywxrrj3b.js} +3 -3
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +10 -1
- package/dist/types/main.d.ts +17 -1
- package/dist/types/surfboard.d.ts +10 -1
- package/dist/types/types.d.ts +10 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-VqLaHFO8.js +0 -240
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Vo7AS1qw.js"),a=require("./dashboard-plus-aiBcmf0f.js");require("react");require("react-dom");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { J as a, ao as e, am as t, aF as c,
|
|
2
|
-
import {
|
|
3
|
-
import { B as C, C as f, a as I, b as S, d as q, e as b, f as H, h as A, i as z, j as P, E as V, k as j, l as B, m as F, G as D, H as R, n as T, o as U, K as O, p as Z, q as G, r as W, L as E, M as X, N, P as K, s as J, t as Q, v as Y, w as _, x as $, y as a1, z as e1, T as t1, A as c1, F as h1, U as d1 } from "./dashboard-plus-
|
|
1
|
+
import { J as a, ao as e, am as t, aF as c, bT as h, bU as d, bV as o, bk as y, bW as i, bX as s, a7 as n, bY as r, bZ as k, b_ as p, b$ as l, Q as M, c0 as u, c1 as v, b1 as g, ah as m, c2 as x, c3 as L, bf as w } from "./index-FWArdRk4.js";
|
|
2
|
+
import { c4 as Pv } from "./index-FWArdRk4.js";
|
|
3
|
+
import { B as C, C as f, a as I, b as S, d as q, e as b, f as H, h as A, i as z, j as P, E as V, k as j, l as B, m as F, G as D, H as R, n as T, o as U, K as O, p as Z, q as G, r as W, L as E, M as X, N, P as K, s as J, t as Q, v as Y, w as _, x as $, y as a1, z as e1, T as t1, A as c1, F as h1, U as d1 } from "./dashboard-plus-Y0SaVfMR.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
/**
|
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-Vo7AS1qw.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-Vo7AS1qw.js"),n=require("./chunks/dashboard-plus-aiBcmf0f.js"),_=require("react");require("react-dom");function v({card:t,footer:u,className:h,...m}){var c;const{customCards:o}=e.useSemaphorContext(),p=_.useRef(null),{isError:C,isLoading:i,isFetching:a,cfg:x,visualKey:f,handleDatapointClick:E}=e.useDashboardCard(t),l=e.useDashboardStore(s=>s.themeStyle),d=e.useDashboardStore(s=>s.selectedSheetId),j=e.useDashboardStore(s=>s.selectedCardId),D=e.useDashboardStore(s=>s.isDashboardEditing),g=((c=t.customCardPreferences)==null?void 0:c.showCardHeader)??!0,{setCardTitle:b,setCardDescription:S,setSelectedCardId:T}=e.useDashboardActions();function R(s){s.stopPropagation(),T(d,t.id)}function A(){if(o&&o.length>0){const s=o.find(r=>r.cardId===t.id);if(s&&s.replaceDefault){const r=s.content;if(r)return e.jsxRuntimeExports.jsx(r,{card:t})}}return t.type==="kpi"?t.data&&t.data.length>0&&e.jsxRuntimeExports.jsx(e.KPICard,{isLoading:i||a,card:t}):N}function y(){if(C)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(o&&o.length>0){const s=o.find(r=>r.cardId===t.id);if(s&&s.content){const r=s.content;return e.jsxRuntimeExports.jsx(r,{card:t})}}if(x)return e.jsxRuntimeExports.jsx(e.ChartJsVisual,{cfg:x,onDatapointClick:E},f)}function I(){if(o&&o.length>0){const s=o.find(r=>r.cardId===t.id);if(s&&s.footer){const r=s.footer;if(r)return e.jsxRuntimeExports.jsx(r,{card:t})}}return u||null}if(!t.id)return null;const N=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[g&&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=>b(d,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":i||a})})}),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&&(i||a)&&e.jsxRuntimeExports.jsx(n.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=>S(d,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:y()}),e.jsxRuntimeExports.jsx(e.CardFooter,{children:I()})]});return e.jsxRuntimeExports.jsx(e.Card,{tabIndex:-1,ref:p,role:"dashboard-card",onClick:R,className:e.cn("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":j===t.id&&D},l==null?void 0:l.dashboardCard,h),...m,children:A()})}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.createSqlGenConfig=e.createSqlGenConfig;exports.fmt=e.fmt;exports.getColumnDataType=e.getColumnDataType;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=n.SelectComponent;exports.Surfboard=n.DashboardPlus;exports.cleanCard=n.cleanCard;exports.getDashbaordStateWithoutData=n.getDashbaordStateWithoutData;exports.useEditorAside=n.useEditorAside;exports.DashboardCard=v;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as P, a as F, b as o, c as k, j as s, C as R, E as h, d as L, T as q, e as B, f as C, g as H, h as Y, i as G, k as K, l as O, K as V, S as z, m as Q, n as W, o as J } from "./chunks/index-
|
|
2
|
-
import { B as re, s as oe, D as ne, q as ie, N as le, I as de, r as ue, w as ce, t as fe, y as he, x as Ce, A as me, v as xe, z as pe, F as ge, p as je, H as De, G as be } from "./chunks/index-
|
|
3
|
-
import { L as M } from "./chunks/dashboard-plus-
|
|
4
|
-
import { S as Te, D as Ee, c as Ie, g as Ae, u as ve } from "./chunks/dashboard-plus-
|
|
1
|
+
import { u as P, a as F, b as o, c as k, j as s, C as R, E as h, d as L, T as q, e as B, f as C, g as H, h as Y, i as G, k as K, l as O, K as V, S as z, m as Q, n as W, o as J } from "./chunks/index-FWArdRk4.js";
|
|
2
|
+
import { B as re, s as oe, D as ne, q as ie, N as le, I as de, r as ue, w as ce, t as fe, y as he, x as Ce, A as me, v as xe, z as pe, F as ge, p as je, H as De, G as be } from "./chunks/index-FWArdRk4.js";
|
|
3
|
+
import { L as M } from "./chunks/dashboard-plus-Y0SaVfMR.js";
|
|
4
|
+
import { S as Te, D as Ee, c as Ie, g as Ae, u as ve } from "./chunks/dashboard-plus-Y0SaVfMR.js";
|
|
5
5
|
import U from "react";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
function se({
|
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-aiBcmf0f.js");require("../chunks/index-Vo7AS1qw.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
|
package/dist/surfboard/index.js
CHANGED
|
@@ -31,6 +31,11 @@ declare type BaseFilter = {
|
|
|
31
31
|
|
|
32
32
|
export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
|
|
33
33
|
|
|
34
|
+
export declare type CacheConfig = {
|
|
35
|
+
ttl: string;
|
|
36
|
+
status: 'on' | 'on-refresh' | 'off';
|
|
37
|
+
};
|
|
38
|
+
|
|
34
39
|
declare type CardWithContent = BaseCustomCard & {
|
|
35
40
|
content: React.FC<{
|
|
36
41
|
card: TCard;
|
|
@@ -68,7 +73,10 @@ export declare function Dashboard(props: DashboardProps): JSX_2.Element;
|
|
|
68
73
|
export declare type DashboardProps = {
|
|
69
74
|
id?: string;
|
|
70
75
|
authToken: AuthToken | undefined;
|
|
71
|
-
defaultFilterValues?:
|
|
76
|
+
defaultFilterValues?: {
|
|
77
|
+
filterId: string;
|
|
78
|
+
values: string[] | number[];
|
|
79
|
+
}[];
|
|
72
80
|
customStyle?: TStyle;
|
|
73
81
|
currentTheme?: Theme;
|
|
74
82
|
version?: string;
|
|
@@ -356,6 +364,7 @@ export declare type TDashboard = {
|
|
|
356
364
|
baseQueries?: TBaseQuery[];
|
|
357
365
|
aiScopeTables?: AIScopeTable[];
|
|
358
366
|
globalStyle?: TStyle;
|
|
367
|
+
globalCacheConfig?: CacheConfig;
|
|
359
368
|
};
|
|
360
369
|
|
|
361
370
|
export declare type TDataColumn = {
|
package/dist/types/main.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ declare type Actions = {
|
|
|
24
24
|
setFilteringCards: (cards: TCard[]) => void;
|
|
25
25
|
addFilteringCard: (card: TCard) => void;
|
|
26
26
|
removeFilteringCard: (card: TCard) => void;
|
|
27
|
+
setGlobalCacheConfig: (cacheConfig: CacheConfig) => void;
|
|
27
28
|
setCustomCards: (customCards: CustomCard[]) => void;
|
|
28
29
|
setAuthToken: (authToken: AuthToken) => void;
|
|
29
30
|
setThemeStyle: (themeStyle: StyleProps) => void;
|
|
@@ -164,6 +165,11 @@ export declare const BOOLEAN_DATA_TYPES: string[];
|
|
|
164
165
|
|
|
165
166
|
export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
|
|
166
167
|
|
|
168
|
+
export declare type CacheConfig = {
|
|
169
|
+
ttl: string;
|
|
170
|
+
status: 'on' | 'on-refresh' | 'off';
|
|
171
|
+
};
|
|
172
|
+
|
|
167
173
|
declare type CardWithContent = BaseCustomCard & {
|
|
168
174
|
content: React.FC<{
|
|
169
175
|
card: TCard;
|
|
@@ -219,7 +225,10 @@ declare type DashboardPlusProps = {
|
|
|
219
225
|
export declare type DashboardProps = {
|
|
220
226
|
id?: string;
|
|
221
227
|
authToken: AuthToken | undefined;
|
|
222
|
-
defaultFilterValues?:
|
|
228
|
+
defaultFilterValues?: {
|
|
229
|
+
filterId: string;
|
|
230
|
+
values: string[] | number[];
|
|
231
|
+
}[];
|
|
223
232
|
customStyle?: TStyle;
|
|
224
233
|
currentTheme?: Theme;
|
|
225
234
|
version?: string;
|
|
@@ -371,6 +380,7 @@ export declare function getDashbaordStateWithoutData(dashboardState: TDashboard)
|
|
|
371
380
|
baseQueries?: TBaseQuery[] | undefined;
|
|
372
381
|
aiScopeTables?: AIScopeTable[] | undefined;
|
|
373
382
|
globalStyle?: TStyle | undefined;
|
|
383
|
+
globalCacheConfig?: CacheConfig | undefined;
|
|
374
384
|
};
|
|
375
385
|
|
|
376
386
|
export declare type GetDashboardResponse = {
|
|
@@ -638,6 +648,7 @@ export declare type TDashboard = {
|
|
|
638
648
|
baseQueries?: TBaseQuery[];
|
|
639
649
|
aiScopeTables?: AIScopeTable[];
|
|
640
650
|
globalStyle?: TStyle;
|
|
651
|
+
globalCacheConfig?: CacheConfig;
|
|
641
652
|
};
|
|
642
653
|
|
|
643
654
|
export declare type TDataColumn = {
|
|
@@ -1526,6 +1537,10 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
1526
1537
|
} | undefined;
|
|
1527
1538
|
} | undefined;
|
|
1528
1539
|
} | undefined;
|
|
1540
|
+
globalCacheConfig?: {
|
|
1541
|
+
ttl: string;
|
|
1542
|
+
status: "on" | "on-refresh" | "off";
|
|
1543
|
+
} | undefined;
|
|
1529
1544
|
};
|
|
1530
1545
|
selectedSheetId?: string | null | undefined;
|
|
1531
1546
|
selectedFrameId?: string | null | undefined;
|
|
@@ -1768,6 +1783,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
1768
1783
|
setFilteringCards: (cards: TCard[]) => void;
|
|
1769
1784
|
addFilteringCard: (card: TCard) => void;
|
|
1770
1785
|
removeFilteringCard: (card: TCard) => void;
|
|
1786
|
+
setGlobalCacheConfig: (cacheConfig: CacheConfig) => void;
|
|
1771
1787
|
setCustomCards: (customCards: CustomCard[]) => void;
|
|
1772
1788
|
setAuthToken: (authToken: AuthToken) => void;
|
|
1773
1789
|
setThemeStyle: (themeStyle: StyleProps) => void;
|
|
@@ -31,6 +31,11 @@ declare type BaseFilter = {
|
|
|
31
31
|
|
|
32
32
|
export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
|
|
33
33
|
|
|
34
|
+
export declare type CacheConfig = {
|
|
35
|
+
ttl: string;
|
|
36
|
+
status: 'on' | 'on-refresh' | 'off';
|
|
37
|
+
};
|
|
38
|
+
|
|
34
39
|
declare type CardWithContent = BaseCustomCard & {
|
|
35
40
|
content: React.FC<{
|
|
36
41
|
card: TCard;
|
|
@@ -71,7 +76,10 @@ declare type DashboardPlusProps = {
|
|
|
71
76
|
export declare type DashboardProps = {
|
|
72
77
|
id?: string;
|
|
73
78
|
authToken: AuthToken | undefined;
|
|
74
|
-
defaultFilterValues?:
|
|
79
|
+
defaultFilterValues?: {
|
|
80
|
+
filterId: string;
|
|
81
|
+
values: string[] | number[];
|
|
82
|
+
}[];
|
|
75
83
|
customStyle?: TStyle;
|
|
76
84
|
currentTheme?: Theme;
|
|
77
85
|
version?: string;
|
|
@@ -361,6 +369,7 @@ export declare type TDashboard = {
|
|
|
361
369
|
baseQueries?: TBaseQuery[];
|
|
362
370
|
aiScopeTables?: AIScopeTable[];
|
|
363
371
|
globalStyle?: TStyle;
|
|
372
|
+
globalCacheConfig?: CacheConfig;
|
|
364
373
|
};
|
|
365
374
|
|
|
366
375
|
export declare type TDataColumn = {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -30,6 +30,11 @@ declare type BaseFilter = {
|
|
|
30
30
|
|
|
31
31
|
export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
|
|
32
32
|
|
|
33
|
+
export declare type CacheConfig = {
|
|
34
|
+
ttl: string;
|
|
35
|
+
status: 'on' | 'on-refresh' | 'off';
|
|
36
|
+
};
|
|
37
|
+
|
|
33
38
|
declare type CardWithContent = BaseCustomCard & {
|
|
34
39
|
content: React.FC<{
|
|
35
40
|
card: TCard;
|
|
@@ -65,7 +70,10 @@ export declare type CustomCard = CardWithContent | CardWithFooter;
|
|
|
65
70
|
export declare type DashboardProps = {
|
|
66
71
|
id?: string;
|
|
67
72
|
authToken: AuthToken | undefined;
|
|
68
|
-
defaultFilterValues?:
|
|
73
|
+
defaultFilterValues?: {
|
|
74
|
+
filterId: string;
|
|
75
|
+
values: string[] | number[];
|
|
76
|
+
}[];
|
|
69
77
|
customStyle?: TStyle;
|
|
70
78
|
currentTheme?: Theme;
|
|
71
79
|
version?: string;
|
|
@@ -353,6 +361,7 @@ export declare type TDashboard = {
|
|
|
353
361
|
baseQueries?: TBaseQuery[];
|
|
354
362
|
aiScopeTables?: AIScopeTable[];
|
|
355
363
|
globalStyle?: TStyle;
|
|
364
|
+
globalCacheConfig?: CacheConfig;
|
|
356
365
|
};
|
|
357
366
|
|
|
358
367
|
export declare type TDataColumn = {
|