react-semaphor 0.0.258 → 0.0.259
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-QpBn82cW.js +245 -0
- package/dist/chunks/{dashboard-plus-FX4aBajk.js → dashboard-plus-p01mBoB3.js} +1058 -1068
- package/dist/chunks/{index-wsauSY2B.js → index-DosNQfkI.js} +3326 -3318
- package/dist/chunks/{index-RiPhpkfr.js → index-VoUC6Gje.js} +74 -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 +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +7 -0
- package/dist/types/main.d.ts +7 -0
- package/dist/types/surfboard.d.ts +7 -0
- package/dist/types/types.d.ts +7 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-5at88oIA.js +0 -245
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-VoUC6Gje.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-VoUC6Gje.js"),n=require("./chunks/dashboard-plus-QpBn82cW.js"),I=require("react");require("react-dom");function N({card:t,footer:u,className:c,...h}){const{customCards:r}=e.useSemaphorContext(),m=I.useRef(null),{isError:p,isLoading:i,isFetching:a,cfg:x,visualKey:C,handleDatapointClick:f}=e.useDashboardCard(t),l=e.useDashboardStore(s=>s.themeStyle),d=e.useDashboardStore(s=>s.selectedSheetId),E=e.useDashboardStore(s=>s.selectedCardId),j=e.useDashboardStore(s=>s.isDashboardEditing),{setCardTitle:D,setCardDescription:g,setSelectedCardId:b}=e.useDashboardActions();function S(s){s.stopPropagation(),b(d,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:i||a,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=>D(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=>g(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:R()}),e.jsxRuntimeExports.jsx(e.CardFooter,{children:A()})]});return e.jsxRuntimeExports.jsx(e.Card,{tabIndex:-1,ref:m,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},l==null?void 0:l.dashboardCard,c),...h,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.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=N;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as _, a as w, b as r, c as F, j as t, C as P, E as f, d as k, T as R, e as L, f as h, g as q, h as B, i as Y, k as G, l as K, K as O, S as V, m as z, n as H, o as Q } from "./chunks/index-
|
|
2
|
-
import { B as se, s as ae, D as oe, q as re, N as ne, I as ie, r as le, w as de, t as ue, y as ce, x as fe, A as he, v as Ce, z as me, F as xe, p as pe, H as ge, G as je } from "./chunks/index-
|
|
3
|
-
import { L as W } from "./chunks/dashboard-plus-
|
|
4
|
-
import { S as be, D as Se, c as Te, g as Ee, u as Ie } from "./chunks/dashboard-plus-
|
|
1
|
+
import { u as _, a as w, b as r, c as F, j as t, C as P, E as f, d as k, T as R, e as L, f as h, g as q, h as B, i as Y, k as G, l as K, K as O, S as V, m as z, n as H, o as Q } from "./chunks/index-DosNQfkI.js";
|
|
2
|
+
import { B as se, s as ae, D as oe, q as re, N as ne, I as ie, r as le, w as de, t as ue, y as ce, x as fe, A as he, v as Ce, z as me, F as xe, p as pe, H as ge, G as je } from "./chunks/index-DosNQfkI.js";
|
|
3
|
+
import { L as W } from "./chunks/dashboard-plus-p01mBoB3.js";
|
|
4
|
+
import { S as be, D as Se, c as Te, g as Ee, u as Ie } from "./chunks/dashboard-plus-p01mBoB3.js";
|
|
5
5
|
import J from "react";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
function Z({
|
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-QpBn82cW.js");require("../chunks/index-VoUC6Gje.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
|
package/dist/surfboard/index.js
CHANGED
|
@@ -137,6 +137,13 @@ export declare type GetDashboardResponse = {
|
|
|
137
137
|
defaultLensId?: string;
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
+
export declare type GetPluginsResponse = {
|
|
141
|
+
plugins: {
|
|
142
|
+
label: string;
|
|
143
|
+
value: string;
|
|
144
|
+
}[];
|
|
145
|
+
};
|
|
146
|
+
|
|
140
147
|
export declare type KPICardProps = {
|
|
141
148
|
card: TCard;
|
|
142
149
|
isLoading?: boolean;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -381,6 +381,13 @@ export declare type GetDashboardResponse = {
|
|
|
381
381
|
|
|
382
382
|
export declare function getFilterValueType(filter: TFilter): "string" | "number" | "date" | "boolean";
|
|
383
383
|
|
|
384
|
+
export declare type GetPluginsResponse = {
|
|
385
|
+
plugins: {
|
|
386
|
+
label: string;
|
|
387
|
+
value: string;
|
|
388
|
+
}[];
|
|
389
|
+
};
|
|
390
|
+
|
|
384
391
|
export declare function getQualifiedTableName(schemaName: string, tableName: string): string;
|
|
385
392
|
|
|
386
393
|
export declare function getSql(config: SqlGen, schemaName: string, tableName: string, modelName: string): string | undefined;
|
|
@@ -140,6 +140,13 @@ export declare type GetDashboardResponse = {
|
|
|
140
140
|
defaultLensId?: string;
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
+
export declare type GetPluginsResponse = {
|
|
144
|
+
plugins: {
|
|
145
|
+
label: string;
|
|
146
|
+
value: string;
|
|
147
|
+
}[];
|
|
148
|
+
};
|
|
149
|
+
|
|
143
150
|
export declare type KPICardProps = {
|
|
144
151
|
card: TCard;
|
|
145
152
|
isLoading?: boolean;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -134,6 +134,13 @@ export declare type GetDashboardResponse = {
|
|
|
134
134
|
defaultLensId?: string;
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
+
export declare type GetPluginsResponse = {
|
|
138
|
+
plugins: {
|
|
139
|
+
label: string;
|
|
140
|
+
value: string;
|
|
141
|
+
}[];
|
|
142
|
+
};
|
|
143
|
+
|
|
137
144
|
export declare type KPICardProps = {
|
|
138
145
|
card: TCard;
|
|
139
146
|
isLoading?: boolean;
|