react-semaphor 0.0.147 → 0.0.149
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/{2DAFLIRC-PUl5B1ZY.js → 2DAFLIRC-HTB0OzHP.js} +1 -1
- package/dist/chunks/{2DAFLIRC-_7BynW2U.js → 2DAFLIRC-LUJ-HNQs.js} +1 -1
- package/dist/chunks/{dashboard-plus-ofCcge3v.js → dashboard-plus-V8yyjys7.js} +10 -10
- package/dist/chunks/{dashboard-plus-QJ-ukBl7.js → dashboard-plus-VO-o8Q5m.js} +580 -572
- package/dist/chunks/{index-Xg6YsJx_.js → index-A53WxJ05.js} +11704 -11553
- package/dist/chunks/index-tGO1Iq1M.js +364 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +75 -75
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +4 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-Gy15dhUc.js +0 -1
- package/dist/chunks/dashboard-UqB9qVFZ.js +0 -7
- package/dist/chunks/index-YZr6TBMT.js +0 -364
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-tGO1Iq1M.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
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-tGO1Iq1M.js"),x=require("./chunks/dashboard-plus-V8yyjys7.js"),I=require("react");require("react-dom");function N({card:t,footer:d,className:m,...c}){const{customCards:r}=e.useSemaphorContext(),h=I.useRef(null),{isError:p,isLoading:n,isFetching:i,cfg:u,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(u)return e.jsxRuntimeExports.jsx(e.ChartJsVisual,{cfg:u,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 d||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.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.SelectComponent=x.SelectComponent;exports.Surfboard=x.DashboardPlus;exports.DashboardCard=N;
|
package/dist/index.js
CHANGED
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { B as ne, D as ie, N as le, H as de, q as ue, J as ce, t as fe, r as he, M as xe, w as Ce, I as me, v as pe, y as ge, s as je, x as De, A as Se, p as be, G as Te, z as Ee, F as Ie } from "./chunks/index-Xg6YsJx_.js";
|
|
1
|
+
import { u as _, a as k, b as n, c as w, j as s, C as P, E as f, d as F, 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-A53WxJ05.js";
|
|
2
|
+
import { B as se, s as te, D as ae, q as oe, N as ne, J as re, r as ie, O as le, w as de, t as ue, P as ce, y as fe, M as he, x as Ce, A as xe, v as me, z as pe, G as ge, p as je, I as De, F as be, H as Se } from "./chunks/index-A53WxJ05.js";
|
|
3
|
+
import { S as Ee, D as Ie } from "./chunks/dashboard-plus-VO-o8Q5m.js";
|
|
5
4
|
import Q from "react";
|
|
6
5
|
import "react-dom";
|
|
7
6
|
function $({
|
|
8
7
|
card: e,
|
|
9
8
|
footer: u,
|
|
10
|
-
className:
|
|
11
|
-
...
|
|
9
|
+
className: C,
|
|
10
|
+
...x
|
|
12
11
|
}) {
|
|
13
12
|
const { customCards: o } = _(), m = Q.useRef(null), {
|
|
14
13
|
isError: p,
|
|
15
|
-
isLoading:
|
|
14
|
+
isLoading: r,
|
|
16
15
|
isFetching: i,
|
|
17
16
|
cfg: c,
|
|
18
17
|
visualKey: g,
|
|
19
18
|
handleDatapointClick: j
|
|
20
|
-
} = k(e), l =
|
|
21
|
-
(
|
|
22
|
-
), { setCardTitle:
|
|
23
|
-
function I(
|
|
24
|
-
|
|
19
|
+
} = k(e), l = n((t) => t.themeStyle), d = n((t) => t.selectedSheetId), D = n((t) => t.selectedCardId), b = n(
|
|
20
|
+
(t) => t.isDashboardEditing
|
|
21
|
+
), { setCardTitle: S, setCardDescription: T, setSelectedCardId: E } = w();
|
|
22
|
+
function I(t) {
|
|
23
|
+
t.stopPropagation(), E(d, e.id);
|
|
25
24
|
}
|
|
26
25
|
function A() {
|
|
27
26
|
if (o && o.length > 0) {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const a =
|
|
27
|
+
const t = o.find((a) => a.cardId === e.id);
|
|
28
|
+
if (t && t.replaceDefault) {
|
|
29
|
+
const a = t.content;
|
|
31
30
|
if (a)
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ s.jsx(a, { card: e });
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
|
-
return e.type === "kpi" ? e.data && e.data.length > 0 && /* @__PURE__ */
|
|
34
|
+
return e.type === "kpi" ? e.data && e.data.length > 0 && /* @__PURE__ */ s.jsx(V, { isLoading: r || i, card: e }) : y;
|
|
36
35
|
}
|
|
37
36
|
function v() {
|
|
38
37
|
if (p)
|
|
39
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ s.jsx("p", { className: "text-sm", children: "Oops! It seems like something went wrong. Please review your connection or filters." });
|
|
40
39
|
if (e.type === "table" && e.data && e.data.length > 0)
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ s.jsxs(z, { children: [
|
|
41
|
+
/* @__PURE__ */ s.jsx(H, { card: e, data: e.data }),
|
|
42
|
+
/* @__PURE__ */ s.jsx(J, { orientation: "horizontal" })
|
|
44
43
|
] });
|
|
45
44
|
if (o && o.length > 0) {
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const a =
|
|
49
|
-
return /* @__PURE__ */
|
|
45
|
+
const t = o.find((a) => a.cardId === e.id);
|
|
46
|
+
if (t && t.content) {
|
|
47
|
+
const a = t.content;
|
|
48
|
+
return /* @__PURE__ */ s.jsx(a, { card: e });
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
if (c)
|
|
53
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ s.jsx(
|
|
54
53
|
M,
|
|
55
54
|
{
|
|
56
55
|
cfg: c,
|
|
@@ -61,61 +60,61 @@ function $({
|
|
|
61
60
|
}
|
|
62
61
|
function N() {
|
|
63
62
|
if (o && o.length > 0) {
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
const a =
|
|
63
|
+
const t = o.find((a) => a.cardId === e.id);
|
|
64
|
+
if (t && t.footer) {
|
|
65
|
+
const a = t.footer;
|
|
67
66
|
if (a)
|
|
68
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ s.jsx(a, { card: e });
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
return u || null;
|
|
72
71
|
}
|
|
73
72
|
if (!e.id)
|
|
74
73
|
return null;
|
|
75
|
-
const y = /* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
74
|
+
const y = /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
75
|
+
/* @__PURE__ */ s.jsxs(P, { className: "pb-4", children: [
|
|
76
|
+
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
77
|
+
/* @__PURE__ */ s.jsx(
|
|
79
78
|
f,
|
|
80
79
|
{
|
|
81
80
|
text: e.title,
|
|
82
|
-
onSave: (
|
|
83
|
-
children: /* @__PURE__ */
|
|
81
|
+
onSave: (t) => S(d, e.id, t),
|
|
82
|
+
children: /* @__PURE__ */ s.jsx(F, { className: "text-base", children: e.title })
|
|
84
83
|
}
|
|
85
84
|
),
|
|
86
|
-
e.refreshInterval && /* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
85
|
+
e.refreshInterval && /* @__PURE__ */ s.jsxs(R, { children: [
|
|
86
|
+
/* @__PURE__ */ s.jsx(B, { className: "pr-1", children: /* @__PURE__ */ s.jsx(
|
|
88
87
|
"div",
|
|
89
88
|
{
|
|
90
89
|
className: h(
|
|
91
90
|
"h-2 w-2 rounded-full bg-green-500 transition-opacity",
|
|
92
91
|
{
|
|
93
|
-
"opacity-10":
|
|
92
|
+
"opacity-10": r || i
|
|
94
93
|
}
|
|
95
94
|
)
|
|
96
95
|
}
|
|
97
96
|
) }),
|
|
98
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ s.jsx(L, { side: "right", align: "center", children: /* @__PURE__ */ s.jsx("p", { className: "text-xs", children: `Realtime (${e == null ? void 0 : e.refreshInterval})` }) })
|
|
99
98
|
] }),
|
|
100
|
-
!e.refreshInterval && (
|
|
99
|
+
!e.refreshInterval && (r || i) && /* @__PURE__ */ s.jsx(q, { className: "h-4 w-4 animate-spin text-muted-foreground" })
|
|
101
100
|
] }),
|
|
102
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ s.jsx(
|
|
103
102
|
f,
|
|
104
103
|
{
|
|
105
104
|
text: (e == null ? void 0 : e.description) || "",
|
|
106
|
-
onSave: (
|
|
107
|
-
children: /* @__PURE__ */
|
|
105
|
+
onSave: (t) => T(d, e.id, t),
|
|
106
|
+
children: /* @__PURE__ */ s.jsxs(K, { children: [
|
|
108
107
|
" ",
|
|
109
108
|
e.description
|
|
110
109
|
] })
|
|
111
110
|
}
|
|
112
111
|
)
|
|
113
112
|
] }),
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ s.jsx(O, { className: "relative flex grow flex-col overflow-auto pb-0", children: v() }),
|
|
114
|
+
/* @__PURE__ */ s.jsx(Y, { children: N() })
|
|
116
115
|
] });
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
|
|
116
|
+
return /* @__PURE__ */ s.jsx(
|
|
117
|
+
G,
|
|
119
118
|
{
|
|
120
119
|
tabIndex: -1,
|
|
121
120
|
ref: m,
|
|
@@ -124,41 +123,42 @@ function $({
|
|
|
124
123
|
className: h(
|
|
125
124
|
"relative flex h-full flex-col rounded-sm",
|
|
126
125
|
{
|
|
127
|
-
"border-dashed border-foreground/50": D === e.id &&
|
|
126
|
+
"border-dashed border-foreground/50": D === e.id && b
|
|
128
127
|
},
|
|
129
128
|
l == null ? void 0 : l.dashboardCard,
|
|
130
|
-
|
|
129
|
+
C
|
|
131
130
|
),
|
|
132
|
-
...
|
|
131
|
+
...x,
|
|
133
132
|
children: A()
|
|
134
133
|
}
|
|
135
134
|
);
|
|
136
135
|
}
|
|
137
136
|
export {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
se as BOOLEAN_DATA_TYPES,
|
|
138
|
+
te as DATE_DATA_TYPES,
|
|
139
|
+
ae as Dashboard,
|
|
141
140
|
$ as DashboardCard,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
141
|
+
oe as DashboardWC,
|
|
142
|
+
ne as NUMBER_DATA_TYPES,
|
|
143
|
+
Ee as SelectComponent,
|
|
144
|
+
re as SemaphorQueryClient,
|
|
145
|
+
Ie as Surfboard,
|
|
146
|
+
ie as TEXT_DATA_TYPES,
|
|
147
|
+
le as cleanCard,
|
|
148
|
+
de as createSqlGenConfig,
|
|
149
|
+
ue as fmt,
|
|
150
|
+
ce as getBookmarkKey,
|
|
151
|
+
fe as getColumnDataType,
|
|
152
|
+
he as getDashbaordStateWithoutData,
|
|
153
|
+
Ce as getFilterValueType,
|
|
154
|
+
xe as getQualifiedTableName,
|
|
155
|
+
me as getSql,
|
|
156
|
+
pe as isColumnInSqlGen,
|
|
157
|
+
ge as resolveDataType,
|
|
158
|
+
je as useCard,
|
|
159
159
|
w as useDashboardActions,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
n as useDashboardStore,
|
|
161
|
+
De as useEditorActions,
|
|
162
|
+
be as useEditorAside,
|
|
163
|
+
Se as useEditorStore
|
|
164
164
|
};
|
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-V8yyjys7.js");require("../chunks/index-tGO1Iq1M.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
|
package/dist/surfboard/index.js
CHANGED
package/dist/types/main.d.ts
CHANGED
|
@@ -229,6 +229,8 @@ export declare type DashboardStore = {
|
|
|
229
229
|
actions: Actions;
|
|
230
230
|
};
|
|
231
231
|
|
|
232
|
+
export declare const DashboardWC: CustomElementConstructor;
|
|
233
|
+
|
|
232
234
|
export declare const DATE_DATA_TYPES: string[];
|
|
233
235
|
|
|
234
236
|
declare type EditorStore = {
|
|
@@ -1148,7 +1150,8 @@ export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?:
|
|
|
1148
1150
|
columns: TDataColumn[];
|
|
1149
1151
|
isColumnsLoadingOrFetching: boolean;
|
|
1150
1152
|
isColumnsError: boolean;
|
|
1151
|
-
|
|
1153
|
+
isNonDbConnection: boolean;
|
|
1154
|
+
connectionType: any;
|
|
1152
1155
|
tableName: any;
|
|
1153
1156
|
schemaName: string;
|
|
1154
1157
|
handleConnectionChange: (value: string) => void;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("./index-YZr6TBMT.js");function e(s){return r.jsxRuntimeExports.jsx(r.SemaphorContextProvider,{dashboardProps:s,children:r.jsxRuntimeExports.jsx(r.UXProvider,{children:r.jsxRuntimeExports.jsx(r.DashboardPanel,{...s,children:r.jsxRuntimeExports.jsx(r.DashboardTabs,{})})})})}exports.Dashboard=e;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { j as r, O as s, U as o, P as e, Q as d } from "./index-Xg6YsJx_.js";
|
|
2
|
-
function h(a) {
|
|
3
|
-
return /* @__PURE__ */ r.jsx(s, { dashboardProps: a, children: /* @__PURE__ */ r.jsx(o, { children: /* @__PURE__ */ r.jsx(e, { ...a, children: /* @__PURE__ */ r.jsx(d, {}) }) }) });
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
h as D
|
|
7
|
-
};
|