semaphor 0.0.69 → 0.0.71
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-FX4aBajk.js → dashboard-plus-PiXfKT85.js} +2088 -1939
- package/dist/chunks/dashboard-plus-QLGG6FW5.js +240 -0
- package/dist/chunks/{index-wsauSY2B.js → index-bprcLVP2.js} +14635 -14308
- package/dist/chunks/index-sYvkC1Tf.js +448 -0
- package/dist/chunks/lucide-react-Dp9nsqo2.js +7381 -0
- package/dist/chunks/lucide-react-RbLnbtSu.js +27835 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +99 -98
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +16 -1
- package/dist/types/main.d.ts +54 -7
- package/dist/types/surfboard.d.ts +16 -1
- package/dist/types/types.d.ts +16 -1
- package/package.json +5 -1
- package/dist/chunks/dashboard-plus-5at88oIA.js +0 -245
- package/dist/chunks/index-RiPhpkfr.js +0 -448
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-sYvkC1Tf.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-sYvkC1Tf.js"),n=require("./chunks/dashboard-plus-QLGG6FW5.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,93 +1,94 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { B as
|
|
3
|
-
import { L as
|
|
4
|
-
import { S as
|
|
5
|
-
import
|
|
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-bprcLVP2.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-bprcLVP2.js";
|
|
3
|
+
import { L as M } from "./chunks/dashboard-plus-PiXfKT85.js";
|
|
4
|
+
import { S as Te, D as Ee, c as Ie, g as Ae, u as ve } from "./chunks/dashboard-plus-PiXfKT85.js";
|
|
5
|
+
import U from "react";
|
|
6
6
|
import "react-dom";
|
|
7
|
-
function
|
|
7
|
+
function se({
|
|
8
8
|
card: e,
|
|
9
9
|
footer: u,
|
|
10
|
-
className:
|
|
11
|
-
...
|
|
10
|
+
className: m,
|
|
11
|
+
...x
|
|
12
12
|
}) {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var f;
|
|
14
|
+
const { customCards: r } = P(), p = U.useRef(null), {
|
|
15
|
+
isError: g,
|
|
15
16
|
isLoading: n,
|
|
16
17
|
isFetching: i,
|
|
17
18
|
cfg: c,
|
|
18
|
-
visualKey:
|
|
19
|
-
handleDatapointClick:
|
|
20
|
-
} =
|
|
21
|
-
(
|
|
22
|
-
), { setCardTitle:
|
|
23
|
-
function
|
|
24
|
-
|
|
19
|
+
visualKey: j,
|
|
20
|
+
handleDatapointClick: D
|
|
21
|
+
} = F(e), l = o((t) => t.themeStyle), d = o((t) => t.selectedSheetId), b = o((t) => t.selectedCardId), S = o(
|
|
22
|
+
(t) => t.isDashboardEditing
|
|
23
|
+
), T = ((f = e.customCardPreferences) == null ? void 0 : f.showCardHeader) ?? !0, { setCardTitle: E, setCardDescription: I, setSelectedCardId: A } = k();
|
|
24
|
+
function v(t) {
|
|
25
|
+
t.stopPropagation(), A(d, e.id);
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const a =
|
|
27
|
+
function N() {
|
|
28
|
+
if (r && r.length > 0) {
|
|
29
|
+
const t = r.find((a) => a.cardId === e.id);
|
|
30
|
+
if (t && t.replaceDefault) {
|
|
31
|
+
const a = t.content;
|
|
31
32
|
if (a)
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ s.jsx(a, { card: e });
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
return e.type === "kpi" ? e.data && e.data.length > 0 && /* @__PURE__ */
|
|
36
|
+
return e.type === "kpi" ? e.data && e.data.length > 0 && /* @__PURE__ */ s.jsx(V, { isLoading: n || i, card: e }) : _;
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
if (
|
|
39
|
-
return /* @__PURE__ */
|
|
38
|
+
function y() {
|
|
39
|
+
if (g)
|
|
40
|
+
return /* @__PURE__ */ s.jsx("p", { className: "text-sm", children: "Oops! It seems like something went wrong. Please review your connection or filters." });
|
|
40
41
|
if (e.type === "table" && e.data && e.data.length > 0)
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ s.jsxs(z, { children: [
|
|
43
|
+
/* @__PURE__ */ s.jsx(Q, { card: e, data: e.data }),
|
|
44
|
+
/* @__PURE__ */ s.jsx(W, { orientation: "horizontal" })
|
|
44
45
|
] });
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const a =
|
|
49
|
-
return /* @__PURE__ */
|
|
46
|
+
if (r && r.length > 0) {
|
|
47
|
+
const t = r.find((a) => a.cardId === e.id);
|
|
48
|
+
if (t && t.content) {
|
|
49
|
+
const a = t.content;
|
|
50
|
+
return /* @__PURE__ */ s.jsx(a, { card: e });
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
if (c)
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
|
|
54
|
+
return /* @__PURE__ */ s.jsx(
|
|
55
|
+
J,
|
|
55
56
|
{
|
|
56
57
|
cfg: c,
|
|
57
|
-
onDatapointClick:
|
|
58
|
+
onDatapointClick: D
|
|
58
59
|
},
|
|
59
|
-
|
|
60
|
+
j
|
|
60
61
|
);
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
const a =
|
|
63
|
+
function w() {
|
|
64
|
+
if (r && r.length > 0) {
|
|
65
|
+
const t = r.find((a) => a.cardId === e.id);
|
|
66
|
+
if (t && t.footer) {
|
|
67
|
+
const a = t.footer;
|
|
67
68
|
if (a)
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ s.jsx(a, { card: e });
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
return u || null;
|
|
72
73
|
}
|
|
73
74
|
if (!e.id)
|
|
74
75
|
return null;
|
|
75
|
-
const
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
76
|
+
const _ = /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
77
|
+
T && /* @__PURE__ */ s.jsxs(R, { className: "pb-4", children: [
|
|
78
|
+
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
79
|
+
/* @__PURE__ */ s.jsx(
|
|
80
|
+
h,
|
|
80
81
|
{
|
|
81
82
|
text: e.title,
|
|
82
|
-
onSave: (
|
|
83
|
-
children: /* @__PURE__ */
|
|
83
|
+
onSave: (t) => E(d, e.id, t),
|
|
84
|
+
children: /* @__PURE__ */ s.jsx(L, { className: "text-base", children: e.title })
|
|
84
85
|
}
|
|
85
86
|
),
|
|
86
|
-
e.refreshInterval && /* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
87
|
+
e.refreshInterval && /* @__PURE__ */ s.jsxs(q, { children: [
|
|
88
|
+
/* @__PURE__ */ s.jsx(B, { className: "pr-1", children: /* @__PURE__ */ s.jsx(
|
|
88
89
|
"div",
|
|
89
90
|
{
|
|
90
|
-
className:
|
|
91
|
+
className: C(
|
|
91
92
|
"h-2 w-2 rounded-full bg-green-500 transition-opacity",
|
|
92
93
|
{
|
|
93
94
|
"opacity-10": n || i
|
|
@@ -95,70 +96,70 @@ function Z({
|
|
|
95
96
|
)
|
|
96
97
|
}
|
|
97
98
|
) }),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ s.jsx(H, { side: "right", align: "center", children: /* @__PURE__ */ s.jsx("p", { className: "text-xs", children: `Realtime (${e == null ? void 0 : e.refreshInterval})` }) })
|
|
99
100
|
] }),
|
|
100
|
-
!e.refreshInterval && (n || i) && /* @__PURE__ */
|
|
101
|
+
!e.refreshInterval && (n || i) && /* @__PURE__ */ s.jsx(M, { className: "h-4 w-4 animate-spin text-muted-foreground" })
|
|
101
102
|
] }),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
103
|
+
/* @__PURE__ */ s.jsx(
|
|
104
|
+
h,
|
|
104
105
|
{
|
|
105
106
|
text: (e == null ? void 0 : e.description) || "",
|
|
106
|
-
onSave: (
|
|
107
|
-
children: /* @__PURE__ */
|
|
107
|
+
onSave: (t) => I(d, e.id, t),
|
|
108
|
+
children: /* @__PURE__ */ s.jsxs(Y, { children: [
|
|
108
109
|
" ",
|
|
109
110
|
e.description
|
|
110
111
|
] })
|
|
111
112
|
}
|
|
112
113
|
)
|
|
113
114
|
] }),
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ s.jsx(G, { className: "relative flex grow flex-col overflow-auto pb-0", children: y() }),
|
|
116
|
+
/* @__PURE__ */ s.jsx(K, { children: w() })
|
|
116
117
|
] });
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
|
|
118
|
+
return /* @__PURE__ */ s.jsx(
|
|
119
|
+
O,
|
|
119
120
|
{
|
|
120
121
|
tabIndex: -1,
|
|
121
|
-
ref:
|
|
122
|
+
ref: p,
|
|
122
123
|
role: "dashboard-card",
|
|
123
|
-
onClick:
|
|
124
|
-
className:
|
|
124
|
+
onClick: v,
|
|
125
|
+
className: C(
|
|
125
126
|
"relative flex h-full flex-col rounded-sm",
|
|
126
127
|
{
|
|
127
|
-
"border-dashed border-foreground/50":
|
|
128
|
+
"border-dashed border-foreground/50": b === e.id && S
|
|
128
129
|
},
|
|
129
130
|
l == null ? void 0 : l.dashboardCard,
|
|
130
|
-
|
|
131
|
+
m
|
|
131
132
|
),
|
|
132
|
-
...
|
|
133
|
-
children:
|
|
133
|
+
...x,
|
|
134
|
+
children: N()
|
|
134
135
|
}
|
|
135
136
|
);
|
|
136
137
|
}
|
|
137
138
|
export {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
139
|
+
re as BOOLEAN_DATA_TYPES,
|
|
140
|
+
oe as DATE_DATA_TYPES,
|
|
141
|
+
ne as Dashboard,
|
|
142
|
+
se as DashboardCard,
|
|
143
|
+
ie as DashboardWC,
|
|
144
|
+
le as NUMBER_DATA_TYPES,
|
|
145
|
+
Te as SelectComponent,
|
|
146
|
+
de as SemaphorQueryClient,
|
|
147
|
+
Ee as Surfboard,
|
|
148
|
+
ue as TEXT_DATA_TYPES,
|
|
149
|
+
Ie as cleanCard,
|
|
150
|
+
ce as createSqlGenConfig,
|
|
151
|
+
fe as fmt,
|
|
152
|
+
he as getColumnDataType,
|
|
153
|
+
Ae as getDashbaordStateWithoutData,
|
|
154
|
+
Ce as getFilterValueType,
|
|
155
|
+
me as getQualifiedTableName,
|
|
156
|
+
xe as getSql,
|
|
157
|
+
pe as isColumnInSqlGen,
|
|
158
|
+
ge as resolveDataType,
|
|
159
|
+
je as useCard,
|
|
160
|
+
k as useDashboardActions,
|
|
161
|
+
o as useDashboardStore,
|
|
162
|
+
De as useEditorActions,
|
|
163
|
+
ve as useEditorAside,
|
|
164
|
+
be as useEditorStore
|
|
164
165
|
};
|