react-semaphor 0.1.19 → 0.1.21
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-CxeKQLr6.js +280 -0
- package/dist/chunks/{dashboard-plus-XEKMZ7Lk.js → dashboard-plus-DNG6HyXE.js} +5852 -5626
- package/dist/chunks/{index-WGPrKoOC.js → index-BXyn0KuU.js} +174 -184
- package/dist/chunks/{index-BCkptgcw.js → index-C3YhLxkw.js} +21416 -21533
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +61 -60
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/dashboard.d.ts +23 -1
- package/dist/types/main.d.ts +31 -1
- package/dist/types/surfboard.d.ts +23 -1
- package/dist/types/types.d.ts +23 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-_lhN-s45.js +0 -280
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-BXyn0KuU.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
package/dist/dashboard/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-BXyn0KuU.js"),v=require("./types/index.cjs"),u=require("./chunks/dashboard-plus-CxeKQLr6.js"),a=require("react/jsx-runtime"),x=require("react");require("react-dom");function j(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return t.default=r,Object.freeze(t)}const p=j(x);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const E=e.createLucideIcon("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);function N(r){const{displayPreferences:t,...s}=r,i={...s,id:r.dashboardId};return a.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:a.jsx(e.SemaphorContextProvider,{dashboardProps:i,children:a.jsx(e.UXProvider,{children:a.jsx(e.DisplayPreferencesProvider,{displayPreferences:t,children:a.jsx(e.Container,{type:"visual",...i,children:a.jsx(P,{cardId:r.cardId})})})})})})}function P({cardId:r}){const t=e.useDashboardStore(n=>{var l;return(l=n.dashboard)==null?void 0:l.sheets}),{card:s,frame:i}=x.useMemo(()=>{const n=t==null?void 0:t.flatMap(o=>o.frames),l=n==null?void 0:n.flatMap(o=>o==null?void 0:o.cards),f=l==null?void 0:l.find(o=>(o==null?void 0:o.id)===r),C=n==null?void 0:n.find(o=>{var h;return(h=o==null?void 0:o.cards)==null?void 0:h.find(c=>(c==null?void 0:c.id)===r)});return{card:f,frame:C}},[t,r]);return!s||!i?a.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${r}`}):a.jsx("main",{className:"flex h-full grow flex-col",children:a.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:l})=>a.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:l,customerFacingMessage:"Error creating visual. Please try again."}),children:a.jsx(e.DashboardCard,{card:s,frame:i})})})}const A=["MM-DD-YYYY","YYYY-MM-DD","MM/DD/YYYY","DD/MM/YYYY","MMMM DD, YYYY","MMM DD, YYYY","DD MMM YYYY","Week of MMM DD, YYYY","Week of MMMM DD, YYYY","YYYY-WW","MMM YYYY","MMMM YYYY","YYYY-MM","MM/YYYY","YYYY MMM","Q1 YYYY","YYYY Q1","1st Quarter YYYY","YYYY-Q1","Quarter 1, YYYY","YYYY","YY","custom"];var b=(r=>(r.SUBTOTAL="__SUBTOTAL__",r.TOTAL="__TOTAL__",r.ALL="__ALL__",r))(b||{});function _({name:r,items:t,value:s,onChange:i,isLoading:n,isError:l,refetch:f,className:C,icon:o,showNone:h=!1}){const c=p.useRef(null),[m,M]=p.useState(!1),[g,y]=p.useState("100%"),D=h?[...t||[],{id:"none",name:"None"}]:t;p.useLayoutEffect(()=>{c.current&&y(c.current.offsetWidth)},[]);function T(){var d;return n?"Loading...":l?"Error":s?(d=t==null?void 0:t.find(Y=>Y.id===s))==null?void 0:d.name:`Select ${r}`}function S(d,Y){i(Y),M(!1)}return a.jsxs(e.Popover,{open:m,onOpenChange:M,children:[a.jsx(e.PopoverTrigger,{asChild:!0,children:a.jsxs(e.Button,{ref:c,variant:"outline",role:"combobox","aria-expanded":m,className:e.cn("flex h-9 w-full justify-between",C),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[o&&a.jsx("div",{className:"mr-2",children:o}),a.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:T()})]}),a.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),a.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:g},children:a.jsxs(e.Command,{children:[a.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[a.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),a.jsx(e.IconButton,{className:"h-7",onClick:f,children:a.jsx(E,{className:e.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),a.jsxs(e.CommandList,{children:[a.jsxs(e.CommandEmpty,{children:["No ",r==null?void 0:r.toLowerCase()," found."]}),a.jsx(e.CommandGroup,{children:D==null?void 0:D.map(d=>a.jsx(e.CommandItem,{className:"overflow-x-auto",value:d.name,onSelect:Y=>S(Y,d.id),children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(e.Check,{className:e.cn("size-4",s===d.id?"opacity-100":"opacity-0")}),a.jsx("div",{title:d.name,children:d.name})]})},d.id))})]})]})})]})}exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createSqlGenConfig=e.createSqlGenConfig;exports.downloadPdf=e.downloadPdf;exports.fmt=e.fmt;exports.getColumnDataType=e.getColumnDataType;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.useCard=e.useCard;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardStore=e.useDashboardStore;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=v.EMPTY_SELECTION;exports.AdvancedModeToggle=u.AdvancedModeToggle;exports.ResourceManagementPanel=u.ResourceManagementPanel;exports.ScheduleDashboard=u.ScheduleDashboard;exports.ShareDialog=u.ShareDialog;exports.Surfboard=u.DashboardPlus;exports.VisualBadge=u.VisualBadge;exports.VisualEditingControls=u.VisualEditingControls;exports.cleanCard=u.cleanCard;exports.getDashbaordStateWithoutData=u.getDashbaordStateWithoutData;exports.Combobox=_;exports.DATE_FORMAT_VALUES=A;exports.PivotMarkerEnum=b;exports.Visual=N;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as x, E as
|
|
2
|
-
import { D as ne, t as ie, R as de, r as le, r as ce,
|
|
3
|
-
import { EMPTY_SELECTION as
|
|
4
|
-
import { A as
|
|
1
|
+
import { c as x, E as v, F as N, S as w, U as A, a as L, C as _, u as E, b as g, d as P, P as k, e as W, B as F, f as M, g as R, h as V, i as B, j as O, I as Q, k as I, l as j, m as q, n as U, o as z } from "./chunks/index-C3YhLxkw.js";
|
|
2
|
+
import { D as ne, t as ie, R as de, r as le, r as ce, $ as Ye, K as ue, w as he, y as pe, M as fe, L as me, Q as Me, T as Ce, J as De, v as ge, H as ve, N as ye, G as be, A as Te, z as Se, V as xe, O as Ne, s as we, X as Ae, Z as Le, Y as _e, _ as Ee, x as Pe, p as ke, a1 as We, W as Fe, a0 as Re, q as Ve } from "./chunks/index-C3YhLxkw.js";
|
|
3
|
+
import { EMPTY_SELECTION as Oe } from "./types/index.js";
|
|
4
|
+
import { A as Ie, R as je, b as qe, S as Ue, D as ze, a as Ge, V as He, c as $e, g as Ke } from "./chunks/dashboard-plus-DNG6HyXE.js";
|
|
5
5
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
6
6
|
import * as h from "react";
|
|
7
7
|
import { useMemo as G } from "react";
|
|
@@ -24,23 +24,23 @@ function ae(a) {
|
|
|
24
24
|
id: a.dashboardId
|
|
25
25
|
// override the id to the dashboard id so that the dashboard is not loaded
|
|
26
26
|
};
|
|
27
|
-
return /* @__PURE__ */ e(
|
|
27
|
+
return /* @__PURE__ */ e(v, { FallbackComponent: N, children: /* @__PURE__ */ e(w, { dashboardProps: l, children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(L, { displayPreferences: o, children: /* @__PURE__ */ e(_, { type: "visual", ...l, children: /* @__PURE__ */ e($, { cardId: a.cardId }) }) }) }) }) });
|
|
28
28
|
}
|
|
29
29
|
function $({ cardId: a }) {
|
|
30
|
-
const o =
|
|
30
|
+
const o = E((r) => {
|
|
31
31
|
var t;
|
|
32
32
|
return (t = r.dashboard) == null ? void 0 : t.sheets;
|
|
33
33
|
}), { card: i, frame: l } = G(() => {
|
|
34
|
-
const r = o == null ? void 0 : o.flatMap((s) => s.frames), t = r == null ? void 0 : r.flatMap((s) => s == null ? void 0 : s.cards),
|
|
34
|
+
const r = o == null ? void 0 : o.flatMap((s) => s.frames), t = r == null ? void 0 : r.flatMap((s) => s == null ? void 0 : s.cards), p = t == null ? void 0 : t.find((s) => (s == null ? void 0 : s.id) === a), f = r == null ? void 0 : r.find(
|
|
35
35
|
(s) => {
|
|
36
36
|
var u;
|
|
37
37
|
return (u = s == null ? void 0 : s.cards) == null ? void 0 : u.find((c) => (c == null ? void 0 : c.id) === a);
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
|
-
return { card:
|
|
40
|
+
return { card: p, frame: f };
|
|
41
41
|
}, [o, a]);
|
|
42
42
|
return !i || !l ? /* @__PURE__ */ e(
|
|
43
|
-
|
|
43
|
+
g,
|
|
44
44
|
{
|
|
45
45
|
error: new Error("Card not found"),
|
|
46
46
|
resetErrorBoundary: () => {
|
|
@@ -48,20 +48,20 @@ function $({ cardId: a }) {
|
|
|
48
48
|
customerFacingMessage: `Card not found with ID: ${a}`
|
|
49
49
|
}
|
|
50
50
|
) : /* @__PURE__ */ e("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ e(
|
|
51
|
-
|
|
51
|
+
v,
|
|
52
52
|
{
|
|
53
53
|
FallbackComponent: ({
|
|
54
54
|
error: r,
|
|
55
55
|
resetErrorBoundary: t
|
|
56
56
|
}) => /* @__PURE__ */ e(
|
|
57
|
-
|
|
57
|
+
g,
|
|
58
58
|
{
|
|
59
59
|
error: r,
|
|
60
60
|
resetErrorBoundary: t,
|
|
61
61
|
customerFacingMessage: "Error creating visual. Please try again."
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
children: /* @__PURE__ */ e(
|
|
64
|
+
children: /* @__PURE__ */ e(P, { card: i, frame: l })
|
|
65
65
|
}
|
|
66
66
|
) });
|
|
67
67
|
}
|
|
@@ -96,7 +96,7 @@ const se = [
|
|
|
96
96
|
// Custom format
|
|
97
97
|
"custom"
|
|
98
98
|
];
|
|
99
|
-
var
|
|
99
|
+
var K = /* @__PURE__ */ ((a) => (a.SUBTOTAL = "__SUBTOTAL__", a.TOTAL = "__TOTAL__", a.ALL = "__ALL__", a))(K || {});
|
|
100
100
|
function re({
|
|
101
101
|
name: a,
|
|
102
102
|
items: o,
|
|
@@ -104,31 +104,31 @@ function re({
|
|
|
104
104
|
onChange: l,
|
|
105
105
|
isLoading: r,
|
|
106
106
|
isError: t,
|
|
107
|
-
refetch:
|
|
108
|
-
className:
|
|
107
|
+
refetch: p,
|
|
108
|
+
className: f,
|
|
109
109
|
icon: s,
|
|
110
110
|
showNone: u = !1
|
|
111
111
|
}) {
|
|
112
|
-
const c = h.useRef(null), [
|
|
112
|
+
const c = h.useRef(null), [C, D] = h.useState(!1), [y, b] = h.useState("100%"), m = u ? [...o || [], { id: "none", name: "None" }] : o;
|
|
113
113
|
h.useLayoutEffect(() => {
|
|
114
|
-
c.current &&
|
|
114
|
+
c.current && b(c.current.offsetWidth);
|
|
115
115
|
}, []);
|
|
116
116
|
function T() {
|
|
117
117
|
var n;
|
|
118
118
|
return r ? "Loading..." : t ? "Error" : i ? (n = o == null ? void 0 : o.find((Y) => Y.id === i)) == null ? void 0 : n.name : `Select ${a}`;
|
|
119
119
|
}
|
|
120
120
|
function S(n, Y) {
|
|
121
|
-
l(Y),
|
|
121
|
+
l(Y), D(!1);
|
|
122
122
|
}
|
|
123
|
-
return /* @__PURE__ */ d(k, { open:
|
|
123
|
+
return /* @__PURE__ */ d(k, { open: C, onOpenChange: D, children: [
|
|
124
124
|
/* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ d(
|
|
125
125
|
F,
|
|
126
126
|
{
|
|
127
127
|
ref: c,
|
|
128
128
|
variant: "outline",
|
|
129
129
|
role: "combobox",
|
|
130
|
-
"aria-expanded":
|
|
131
|
-
className:
|
|
130
|
+
"aria-expanded": C,
|
|
131
|
+
className: M("flex h-9 w-full justify-between", f),
|
|
132
132
|
children: [
|
|
133
133
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
134
134
|
s && /* @__PURE__ */ e("div", { className: "mr-2", children: s }),
|
|
@@ -142,14 +142,14 @@ function re({
|
|
|
142
142
|
V,
|
|
143
143
|
{
|
|
144
144
|
className: "w-full p-0",
|
|
145
|
-
style: { minWidth:
|
|
145
|
+
style: { minWidth: y },
|
|
146
146
|
children: /* @__PURE__ */ d(B, { children: [
|
|
147
147
|
/* @__PURE__ */ d("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
|
|
148
148
|
/* @__PURE__ */ e(O, { className: "h-9", placeholder: "Search..." }),
|
|
149
|
-
/* @__PURE__ */ e(Q, { className: "h-7", onClick:
|
|
149
|
+
/* @__PURE__ */ e(Q, { className: "h-7", onClick: p, children: /* @__PURE__ */ e(
|
|
150
150
|
H,
|
|
151
151
|
{
|
|
152
|
-
className:
|
|
152
|
+
className: M(
|
|
153
153
|
"size-3.5 opacity-50",
|
|
154
154
|
r && "animate-spin"
|
|
155
155
|
)
|
|
@@ -162,7 +162,7 @@ function re({
|
|
|
162
162
|
a == null ? void 0 : a.toLowerCase(),
|
|
163
163
|
" found."
|
|
164
164
|
] }),
|
|
165
|
-
/* @__PURE__ */ e(q, { children:
|
|
165
|
+
/* @__PURE__ */ e(q, { children: m == null ? void 0 : m.map((n) => /* @__PURE__ */ e(
|
|
166
166
|
U,
|
|
167
167
|
{
|
|
168
168
|
className: "overflow-x-auto",
|
|
@@ -172,7 +172,7 @@ function re({
|
|
|
172
172
|
/* @__PURE__ */ e(
|
|
173
173
|
z,
|
|
174
174
|
{
|
|
175
|
-
className:
|
|
175
|
+
className: M(
|
|
176
176
|
"size-4",
|
|
177
177
|
i === n.id ? "opacity-100" : "opacity-0"
|
|
178
178
|
)
|
|
@@ -190,52 +190,53 @@ function re({
|
|
|
190
190
|
] });
|
|
191
191
|
}
|
|
192
192
|
export {
|
|
193
|
-
|
|
193
|
+
Ie as AdvancedModeToggle,
|
|
194
194
|
re as Combobox,
|
|
195
195
|
se as DATE_FORMAT_VALUES,
|
|
196
196
|
ne as Dashboard,
|
|
197
197
|
ie as DashboardWC,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
Oe as EMPTY_SELECTION,
|
|
199
|
+
K as PivotMarkerEnum,
|
|
200
|
+
je as ResourceManagementPanel,
|
|
201
201
|
de as ResourceType,
|
|
202
|
-
|
|
202
|
+
qe as ScheduleDashboard,
|
|
203
203
|
w as SemaphorContextProvider,
|
|
204
204
|
le as SemaphorDataProvider,
|
|
205
205
|
ce as SemaphorQueryClient,
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
Ue as ShareDialog,
|
|
207
|
+
ze as Surfboard,
|
|
208
208
|
ae as Visual,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
Ye as
|
|
213
|
-
ue as
|
|
214
|
-
he as
|
|
209
|
+
Ge as VisualBadge,
|
|
210
|
+
He as VisualEditingControls,
|
|
211
|
+
$e as cleanCard,
|
|
212
|
+
Ye as createEmptyKpiConfig,
|
|
213
|
+
ue as createSqlGenConfig,
|
|
214
|
+
he as downloadPdf,
|
|
215
|
+
pe as fmt,
|
|
215
216
|
fe as getColumnDataType,
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
Ke as getDashbaordStateWithoutData,
|
|
218
|
+
me as getFilterValueType,
|
|
218
219
|
Me as getFormattedTableNameForQuery,
|
|
219
|
-
|
|
220
|
+
Ce as getQualifiedTableName,
|
|
220
221
|
De as getSql,
|
|
221
|
-
|
|
222
|
+
ge as invalidateToken,
|
|
222
223
|
ve as isBooleanDataType,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
224
|
+
ye as isColumnInSqlGen,
|
|
225
|
+
be as isDateDataType,
|
|
226
|
+
Te as isNumberDataType,
|
|
227
|
+
Se as isTextDataType,
|
|
228
|
+
xe as resolveDataType,
|
|
229
|
+
Ne as resolveDatamodelName,
|
|
230
|
+
we as useCard,
|
|
231
|
+
Ae as useCurrentActiveCard,
|
|
232
|
+
Le as useCurrentCardConfig,
|
|
233
|
+
_e as useCurrentSheetActiveCards,
|
|
234
|
+
Ee as useDashboardActions,
|
|
235
|
+
E as useDashboardStore,
|
|
235
236
|
Pe as useDataColumns,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
237
|
+
ke as useDateFilterHook,
|
|
238
|
+
We as useEditorActions,
|
|
239
|
+
Fe as useEditorAside,
|
|
240
|
+
Re as useEditorStore,
|
|
241
|
+
Ve as useTextFilterHook
|
|
241
242
|
};
|