react-semaphor 0.0.292 → 0.0.293

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.
@@ -1,6 +1,6 @@
1
- import { J as a, ao as e, am as t, aF as c, bV as h, bW as d, bX as o, bn as y, bY as i, bZ as s, a7 as n, b_ as r, b$ as k, c0 as p, c1 as l, Q as M, c2 as u, c3 as v, b2 as g, ah as m, c4 as x, bi as L } from "./index-LkldbtTC.js";
2
- import { c5 as Pv } from "./index-LkldbtTC.js";
3
- import { B as w, C, a as f, b as I, d as S, e as q, f as b, h as H, i as A, j as z, E as P, k as V, l as j, m as B, G as F, H as D, n as R, o as T, K as U, p as O, q as Z, r as G, L as W, M as E, s as X, N, P as K, t as J, v as Q, w as Y, x as _, y as $, z as a1, A as e1, T as t1, F as c1, I as h1, U as d1 } from "./dashboard-plus-eyWVJq6T.js";
1
+ import { c as a, B as e, C as t, a as c, b as h, d, e as o, f as y, g as i, h as s, F as n, i as r, G as k, I as p, P as l, j as M, S as u, k as v, l as g, T as m, U as x, X as L } from "./index-4ghd54jS.js";
2
+ import { m as Pv } from "./index-4ghd54jS.js";
3
+ import { B as w, C, a as f, b as I, c as S, d as q, e as b, f as H, g as A, h as z, E as P, i as V, j, k as B, G as F, H as D, l as R, m as T, K as U, L as O, n as Z, o as G, p as W, M as E, q as X, N, P as K, r as J, s as Q, S as Y, t as _, u as $, v as a1, w as e1, T as t1, x as c1, y as h1, U as d1 } from "./index-fAm5iYrM.js";
4
4
  import "react";
5
5
  import "react-dom";
6
6
  /**
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-1VxGNVLM.js"),a=require("./dashboard-plus-q0Cnhdqi.js");require("react");require("react-dom");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ljPCqLiY.js"),a=require("./index-zdNMIsZu.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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-1VxGNVLM.js");require("react");require("react-dom");exports.Dashboard=e.Dashboard;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-ljPCqLiY.js");require("react");require("react-dom");exports.Dashboard=e.Dashboard;
@@ -1,4 +1,4 @@
1
- import { D as p } from "../chunks/index-LkldbtTC.js";
1
+ import { D as p } from "../chunks/index-4ghd54jS.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  export {
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-1VxGNVLM.js"),n=require("./chunks/dashboard-plus-q0Cnhdqi.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-ljPCqLiY.js"),a=require("./chunks/index-zdNMIsZu.js");require("react");require("react-dom");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=a.SelectComponent;exports.Surfboard=a.DashboardPlus;exports.cleanCard=a.cleanCard;exports.getDashbaordStateWithoutData=a.getDashbaordStateWithoutData;exports.useEditorAside=a.useEditorAside;
package/dist/index.js CHANGED
@@ -1,165 +1,31 @@
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-LkldbtTC.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-LkldbtTC.js";
3
- import { L as M } from "./chunks/dashboard-plus-eyWVJq6T.js";
4
- import { S as Te, D as Ee, c as Ie, g as Ae, u as ve } from "./chunks/dashboard-plus-eyWVJq6T.js";
5
- import U from "react";
1
+ import { ai as o, ah as r, D as i, b$ as D, ag as T, c3 as d, af as l, ab as n, ad as u, c1 as A, c0 as S, an as E, ac as b, al as c, c2 as m, b_ as p, n as _, u as h, aY as C, a7 as f } from "./chunks/index-4ghd54jS.js";
2
+ import { A as Y, D as y, I as P, F as q, z as N } from "./chunks/index-fAm5iYrM.js";
3
+ import "react";
6
4
  import "react-dom";
7
- function se({
8
- card: e,
9
- footer: u,
10
- className: m,
11
- ...x
12
- }) {
13
- var f;
14
- const { customCards: r } = P(), p = U.useRef(null), {
15
- isError: g,
16
- isLoading: n,
17
- isFetching: i,
18
- cfg: c,
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);
26
- }
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;
32
- if (a)
33
- return /* @__PURE__ */ s.jsx(a, { card: e });
34
- }
35
- }
36
- return e.type === "kpi" ? e.data && e.data.length > 0 && /* @__PURE__ */ s.jsx(V, { isLoading: n || i, card: e }) : _;
37
- }
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." });
41
- if (e.type === "table" && e.data && e.data.length > 0)
42
- return /* @__PURE__ */ s.jsxs(z, { children: [
43
- /* @__PURE__ */ s.jsx(Q, { card: e, data: e.data }),
44
- /* @__PURE__ */ s.jsx(W, { orientation: "horizontal" })
45
- ] });
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 });
51
- }
52
- }
53
- if (c)
54
- return /* @__PURE__ */ s.jsx(
55
- J,
56
- {
57
- cfg: c,
58
- onDatapointClick: D
59
- },
60
- j
61
- );
62
- }
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;
68
- if (a)
69
- return /* @__PURE__ */ s.jsx(a, { card: e });
70
- }
71
- }
72
- return u || null;
73
- }
74
- if (!e.id)
75
- return null;
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,
81
- {
82
- text: e.title,
83
- onSave: (t) => E(d, e.id, t),
84
- children: /* @__PURE__ */ s.jsx(L, { className: "text-base", children: e.title })
85
- }
86
- ),
87
- e.refreshInterval && /* @__PURE__ */ s.jsxs(q, { children: [
88
- /* @__PURE__ */ s.jsx(B, { className: "pr-1", children: /* @__PURE__ */ s.jsx(
89
- "div",
90
- {
91
- className: C(
92
- "h-2 w-2 rounded-full bg-green-500 transition-opacity",
93
- {
94
- "opacity-10": n || i
95
- }
96
- )
97
- }
98
- ) }),
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})` }) })
100
- ] }),
101
- !e.refreshInterval && (n || i) && /* @__PURE__ */ s.jsx(M, { className: "h-4 w-4 animate-spin text-muted-foreground" })
102
- ] }),
103
- /* @__PURE__ */ s.jsx(
104
- h,
105
- {
106
- text: (e == null ? void 0 : e.description) || "",
107
- onSave: (t) => I(d, e.id, t),
108
- children: /* @__PURE__ */ s.jsxs(Y, { children: [
109
- " ",
110
- e.description
111
- ] })
112
- }
113
- )
114
- ] }),
115
- /* @__PURE__ */ s.jsx(G, { className: "relative flex grow flex-col overflow-auto pb-0", children: y() }),
116
- /* @__PURE__ */ s.jsx(K, { children: w() })
117
- ] });
118
- return /* @__PURE__ */ s.jsx(
119
- O,
120
- {
121
- tabIndex: -1,
122
- ref: p,
123
- role: "dashboard-card",
124
- onClick: v,
125
- className: C(
126
- "relative flex h-full flex-col rounded-sm",
127
- {
128
- "border-dashed border-foreground/50": b === e.id && S
129
- },
130
- l == null ? void 0 : l.dashboardCard,
131
- m
132
- ),
133
- ...x,
134
- children: N()
135
- }
136
- );
137
- }
138
5
  export {
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
6
+ o as BOOLEAN_DATA_TYPES,
7
+ r as DATE_DATA_TYPES,
8
+ i as Dashboard,
9
+ D as DashboardWC,
10
+ T as NUMBER_DATA_TYPES,
11
+ Y as SelectComponent,
12
+ d as SemaphorQueryClient,
13
+ y as Surfboard,
14
+ l as TEXT_DATA_TYPES,
15
+ P as cleanCard,
16
+ n as createSqlGenConfig,
17
+ u as fmt,
18
+ A as getColumnDataType,
19
+ q as getDashbaordStateWithoutData,
20
+ S as getFilterValueType,
21
+ E as getQualifiedTableName,
22
+ b as getSql,
23
+ c as isColumnInSqlGen,
24
+ m as resolveDataType,
25
+ p as useCard,
26
+ _ as useDashboardActions,
27
+ h as useDashboardStore,
28
+ C as useEditorActions,
29
+ N as useEditorAside,
30
+ f as useEditorStore
165
31
  };