react-semaphor 0.0.209 → 0.0.211
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-YdpBvAYB.js → dashboard-plus-C3UxmNVq.js} +1324 -1263
- package/dist/chunks/dashboard-plus-qauJ8uMw.js +215 -0
- package/dist/chunks/{index-ERN5Lanz.js → index-nvObQgx0.js} +4465 -4445
- package/dist/chunks/{index-1eyUfjTv.js → index-qQHxI2VY.js} +81 -76
- 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 +1 -0
- package/dist/types/main.d.ts +19 -1
- package/dist/types/surfboard.d.ts +1 -0
- package/dist/types/types.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-l8PUM1UF.js +0 -210
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-qQHxI2VY.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-qQHxI2VY.js"),d=require("./chunks/dashboard-plus-qauJ8uMw.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-nvObQgx0.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-nvObQgx0.js";
|
|
3
|
+
import { S as Te, D as Ee, u as Ie } from "./chunks/dashboard-plus-C3UxmNVq.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-qauJ8uMw.js");require("../chunks/index-qQHxI2VY.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
|
package/dist/surfboard/index.js
CHANGED
package/dist/types/main.d.ts
CHANGED
|
@@ -110,6 +110,7 @@ declare type Actions_2 = {
|
|
|
110
110
|
setApplyFilters: (applyFilters: boolean) => void;
|
|
111
111
|
setFilterValues: (filterValues: TFilterValue[]) => void;
|
|
112
112
|
setSelectedConnectionId: (connectionId: string) => void;
|
|
113
|
+
setSelectedDatamodelId: (datamodelId: string) => void;
|
|
113
114
|
setSelectedDatabaseName: (databaseName: string) => void;
|
|
114
115
|
setSelectedSchemaName: (schemaName: string) => void;
|
|
115
116
|
setSelectedTableName: (tableName: string) => void;
|
|
@@ -282,11 +283,13 @@ declare type EditorStore = {
|
|
|
282
283
|
queryError?: string;
|
|
283
284
|
pythonStdOut?: string;
|
|
284
285
|
selectedConnectionId?: string;
|
|
286
|
+
selectedDatamodelId?: string;
|
|
285
287
|
selectedDatabaseName?: string;
|
|
286
288
|
selectedSchemaName?: string;
|
|
287
289
|
selectedTableName?: string;
|
|
288
290
|
currentColumns?: TDataColumn[];
|
|
289
291
|
onConnectionChange?: (connectionId: string) => void;
|
|
292
|
+
onDatamodelChange?: (datamodelId: string) => void;
|
|
290
293
|
onDatabaseChange?: (databaseName: string) => void;
|
|
291
294
|
onTableChange?: (tableName: string) => void;
|
|
292
295
|
onSchemaChange?: (schemaName: string) => void;
|
|
@@ -411,7 +414,7 @@ declare type Params = {
|
|
|
411
414
|
|
|
412
415
|
export declare const resolveDataType: (value: any) => string;
|
|
413
416
|
|
|
414
|
-
export declare function SelectComponent({ title, items, value, isLoading, isError, connectionTooltip, onChange, className, showIcon, disabled, }: SelectProps): JSX_2.Element;
|
|
417
|
+
export declare function SelectComponent({ title, items, value, isLoading, isError, connectionTooltip, onChange, showNone, className, showIcon, disabled, }: SelectProps): JSX_2.Element;
|
|
415
418
|
|
|
416
419
|
declare type SelectProps = {
|
|
417
420
|
title: string;
|
|
@@ -423,6 +426,7 @@ declare type SelectProps = {
|
|
|
423
426
|
isLoading: boolean;
|
|
424
427
|
isError: boolean;
|
|
425
428
|
onChange?: (value: string) => void;
|
|
429
|
+
showNone?: boolean;
|
|
426
430
|
className?: string;
|
|
427
431
|
showIcon?: boolean;
|
|
428
432
|
connectionTooltip?: string;
|
|
@@ -493,6 +497,7 @@ export declare type TCard = {
|
|
|
493
497
|
description?: string;
|
|
494
498
|
info?: string;
|
|
495
499
|
connectionId?: string;
|
|
500
|
+
datamodelId?: string;
|
|
496
501
|
type: TChartType;
|
|
497
502
|
sql?: string;
|
|
498
503
|
python?: string;
|
|
@@ -703,6 +708,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
703
708
|
description?: string | undefined;
|
|
704
709
|
info?: string | undefined;
|
|
705
710
|
connectionId?: string | undefined;
|
|
711
|
+
datamodelId?: string | undefined;
|
|
706
712
|
type: TChartType;
|
|
707
713
|
sql?: string | undefined;
|
|
708
714
|
python?: string | undefined;
|
|
@@ -888,6 +894,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
888
894
|
description?: string | undefined;
|
|
889
895
|
info?: string | undefined;
|
|
890
896
|
connectionId?: string | undefined;
|
|
897
|
+
datamodelId?: string | undefined;
|
|
891
898
|
type: TChartType;
|
|
892
899
|
sql?: string | undefined;
|
|
893
900
|
python?: string | undefined;
|
|
@@ -1030,6 +1037,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
1030
1037
|
description?: string | undefined;
|
|
1031
1038
|
info?: string | undefined;
|
|
1032
1039
|
connectionId?: string | undefined;
|
|
1040
|
+
datamodelId?: string | undefined;
|
|
1033
1041
|
type: TChartType;
|
|
1034
1042
|
sql?: string | undefined;
|
|
1035
1043
|
python?: string | undefined;
|
|
@@ -1325,6 +1333,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
1325
1333
|
description?: string | undefined;
|
|
1326
1334
|
info?: string | undefined;
|
|
1327
1335
|
connectionId?: string | undefined;
|
|
1336
|
+
datamodelId?: string | undefined;
|
|
1328
1337
|
type: TChartType;
|
|
1329
1338
|
sql?: string | undefined;
|
|
1330
1339
|
python?: string | undefined;
|
|
@@ -1593,6 +1602,9 @@ export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?:
|
|
|
1593
1602
|
connectionItems: any;
|
|
1594
1603
|
isConnectionsLoading: boolean;
|
|
1595
1604
|
isConnectionsError: boolean;
|
|
1605
|
+
modelItems: any;
|
|
1606
|
+
isModelsLoading: boolean;
|
|
1607
|
+
isModelsError: boolean;
|
|
1596
1608
|
databaseItems: any;
|
|
1597
1609
|
isDatabasesLoadingOrFetching: boolean;
|
|
1598
1610
|
isDatabaseError: boolean;
|
|
@@ -1610,6 +1622,7 @@ export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?:
|
|
|
1610
1622
|
tableName: any;
|
|
1611
1623
|
schemaName: string;
|
|
1612
1624
|
handleConnectionChange: (value: string) => void;
|
|
1625
|
+
handleDatamodelChange: (value: string) => void;
|
|
1613
1626
|
handleDatabaseChange: (value: string) => void;
|
|
1614
1627
|
handleSchemaChange: (value: string) => void;
|
|
1615
1628
|
};
|
|
@@ -1649,6 +1662,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
1649
1662
|
setApplyFilters: (applyFilters: boolean) => void;
|
|
1650
1663
|
setFilterValues: (filterValues: TFilterValue[]) => void;
|
|
1651
1664
|
setSelectedConnectionId: (connectionId: string) => void;
|
|
1665
|
+
setSelectedDatamodelId: (datamodelId: string) => void;
|
|
1652
1666
|
setSelectedDatabaseName: (databaseName: string) => void;
|
|
1653
1667
|
setSelectedSchemaName: (schemaName: string) => void;
|
|
1654
1668
|
setSelectedTableName: (tableName: string) => void;
|
|
@@ -1675,6 +1689,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
1675
1689
|
description?: string | undefined;
|
|
1676
1690
|
info?: string | undefined;
|
|
1677
1691
|
connectionId?: string | undefined;
|
|
1692
|
+
datamodelId?: string | undefined;
|
|
1678
1693
|
type: TChartType;
|
|
1679
1694
|
sql?: string | undefined;
|
|
1680
1695
|
python?: string | undefined;
|
|
@@ -1817,6 +1832,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
1817
1832
|
description?: string | undefined;
|
|
1818
1833
|
info?: string | undefined;
|
|
1819
1834
|
connectionId?: string | undefined;
|
|
1835
|
+
datamodelId?: string | undefined;
|
|
1820
1836
|
type: TChartType;
|
|
1821
1837
|
sql?: string | undefined;
|
|
1822
1838
|
python?: string | undefined;
|
|
@@ -2006,6 +2022,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
2006
2022
|
queryError?: string | undefined;
|
|
2007
2023
|
pythonStdOut?: string | undefined;
|
|
2008
2024
|
selectedConnectionId?: string | undefined;
|
|
2025
|
+
selectedDatamodelId?: string | undefined;
|
|
2009
2026
|
selectedDatabaseName?: string | undefined;
|
|
2010
2027
|
selectedSchemaName?: string | undefined;
|
|
2011
2028
|
selectedTableName?: string | undefined;
|
|
@@ -2015,6 +2032,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
2015
2032
|
is_nullable?: string | undefined;
|
|
2016
2033
|
}[] | undefined;
|
|
2017
2034
|
onConnectionChange?: ((connectionId: string) => void) | undefined;
|
|
2035
|
+
onDatamodelChange?: ((datamodelId: string) => void) | undefined;
|
|
2018
2036
|
onDatabaseChange?: ((databaseName: string) => void) | undefined;
|
|
2019
2037
|
onTableChange?: ((tableName: string) => void) | undefined;
|
|
2020
2038
|
onSchemaChange?: ((schemaName: string) => void) | undefined;
|
package/dist/types/types.d.ts
CHANGED