react-semaphor 0.1.131 → 0.1.133
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-controls-CLmhjguK.js → dashboard-controls-C1rIPoLI.js} +1 -1
- package/dist/chunks/{dashboard-controls-B2o_Ml98.js → dashboard-controls-YCOwB4c7.js} +207 -207
- package/dist/chunks/{dashboard-export-dialog-DwkHS7L_.js → dashboard-export-dialog-BpjTGwvL.js} +31 -31
- package/dist/chunks/{dashboard-export-dialog-Ch0ElsMI.js → dashboard-export-dialog-CsU5-_Nc.js} +1 -1
- package/dist/chunks/{dashboard-json-DawmOBwK.js → dashboard-json-BwJ6kZV2.js} +1 -1
- package/dist/chunks/{dashboard-json-BPO_6NQh.js → dashboard-json-DDxHEaDO.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CE0f3H3D.js → edit-dashboard-visual-BoV4X2or.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-VH55I2qe.js → edit-dashboard-visual-DdK_bxBz.js} +191 -191
- package/dist/chunks/{editor-action-buttons-BCRzk-0n.js → editor-action-buttons-CK2siDBM.js} +2 -2
- package/dist/chunks/{editor-action-buttons-BCX2a6QA.js → editor-action-buttons-CmA0eoCZ.js} +1 -1
- package/dist/chunks/{index-D3VnAyrW.js → index-BCmbfOd2.js} +21 -21
- package/dist/chunks/{index-BiG_2DRk.js → index-DilTtW4W.js} +172 -164
- package/dist/chunks/{resource-management-panel-CFSAxmG5.js → resource-management-panel-Bt1zi1Yb.js} +116 -116
- package/dist/chunks/{resource-management-panel-DAc7CcYm.js → resource-management-panel-Fs9hg3pC.js} +1 -1
- package/dist/chunks/{use-visual-utils-iLF6cWs6.js → use-visual-utils-Cjv_OnmO.js} +1 -1
- package/dist/chunks/{use-visual-utils-_KE2a0K6.js → use-visual-utils-CzQAEa-2.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +30 -29
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +11 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./index-
|
|
1
|
+
"use strict";const o=require("./index-BCmbfOd2.js"),b=require("react");function _(e){const a=e.toUpperCase().indexOf("WHERE"),r=e.toUpperCase().indexOf("GROUP BY"),t=e.toUpperCase().indexOf("LIMIT"),d=e.toUpperCase().indexOf("ORDER BY");let c=e.length;if(d!==-1&&(c=d),t!==-1&&t<c&&(c=t),a!==-1){const n=e.substring(0,a),s=e.substring(a);return`${n} {{ filters | where }} AND ${s.substring(6)}`}else if(r!==-1){const n=e.substring(0,r),s=e.substring(r);return`${n} {{ filters | where }} ${s}`}else{const n=e.substring(0,c),s=e.substring(c);return console.log("beforeClause",n),console.log("afterClause",s),s?`${n} {{ filters | where }} ${s}`:`${n.replace(/;$/,"")} {{ filters | where }}`}}function B(e){const[a,r]=b.useState(null),[t,d]=b.useState(null),c=o.useEnsureReactGlobals();return b.useEffect(()=>{if(!e||e.trim()===""){r(null),d(null);return}if(!c)return;(async()=>{try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error(`Invalid URL format: ${e}`);try{new URL(e)}catch{throw new Error(`Invalid URL: ${e}`)}const l=`${e.endsWith("/")?e:`${e}/`}index.js`;try{if(!(await fetch(l,{method:"HEAD"})).ok)throw new Error(`Module not found at ${l}`)}catch{}const m=await import(l);if(typeof m.useChartStore!="function")throw new Error("useChartStore is not a function");r(()=>m.useChartStore),d(null)}catch(s){const l=s instanceof Error?s.message:"Unknown error";console.error("Failed to load remote chart store:",l),d(l),r(null)}})()},[e,c]),a}function H(e,a){if(e.length===0)return"";if(a){const r=e.find(t=>t.id===a);if(r){const t=r.tabTitle;if(t=="All__Header")return e[0].id;if(t&&t.endsWith("__Header")){const c=t.split("__")[0],n=e.find(s=>s.tabTitle===c);return n?n.id:e[0].id}return a}}return e[0].id}async function j(e,a,r,t){if(!a||!r)throw new Error("Missing auth token or visual ID");const d=["resource-by-id","visual",r],c=t.getQueryData(d);if(c)return console.log("Using cached visual data for:",r),{data:c,fromCache:!0};console.log("Fetching visual data from network for:",r);const n=o.ue.loading("Loading visual...",{position:"top-center"});try{const s=await fetch(`${e}/management/v1/visuals/${r}`,{headers:{Authorization:`Bearer ${a}`}});if(!s.ok)throw new Error("Failed to load visual");const l=await s.json();return t.setQueryData(d,l),o.ue.dismiss(n),{data:l,fromCache:!1}}catch(s){throw o.ue.dismiss(n),s}}function T(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error("Invalid frame object format")}function Q(e,a){var c,n;const r=(e==null?void 0:e.frameObject)??((c=e==null?void 0:e.visual)==null?void 0:c.frameObject);if(!r)return!1;const t=T(r);if(!(t!=null&&t.cards)||t.cards.length===0)return!1;const d=(n=t.cards)==null?void 0:n.find(s=>s.id===t.activeCardId);return d?(o.setupEditorWithCard({...a,frame:t,card:d,visualId:(e==null?void 0:e.id)||t.visualId}),!0):!1}function G(){var g;const{setCardSql:e}=o.useEditorActions(),a=o.useEditorStore(i=>i.frame),r=o.useEditorStore(i=>i.card),t=B(((g=r.customCardPreferences)==null?void 0:g.url)||""),d=o.useEditorStore(i=>i.selectedSchemaName),c=o.useEditorStore(i=>i.selectedDatamodelId),n=o.useEditorStore(i=>i.selectedDatabaseName),s=o.useEditorStore(i=>i.selectedTableName),l=o.useEditorStore(i=>i.selectedConnectionId),m=o.useEditorStore(i=>i.isShowingVisual),f=r.sql;return{getUpdatedFrame:b.useCallback(()=>{var E;let i=f;f&&!f.includes("{{")&&(i=_(f),e(i));const C=(E=t==null?void 0:t.getState())==null?void 0:E.settings,U={...r,dataSource:r.dataSource||{mode:"directSource"},lastSelectedSchema:d,lastSelectedDatamodelId:c,lastSelectedDatabase:n,lastSelectedTable:s,connectionId:l,sql:i,customCfg:m?r.customCfg:null,preferences:r.preferences,...C&&{customCardPreferences:{...r.customCardPreferences,settings:C}}},w=a.cards.map(S=>S.id===r.id?U:S);return{...a,cards:w,activeCardId:H(w,a.activeCardId)}},[r,a,m,d,c,n,s,l,e,t,f])}}function z(){const{authToken:e,tokenProps:a}=o.useSemaphorContext(),r=o.useQueryClient(),t=o.useSelectedVisual(),{selectVisual:d}=o.useManagementActions(),{setFrame:c,setCard:n,setIsDevMode:s,setActiveTabCardId:l,updateDataSource:m,setQueryResultColumns:f,setSelectedConnectionId:V,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:U,setFilterValues:w,setApplyFilters:E}=o.useEditorActions(),{setIsDashboardEditing:S,setIsVisualEditing:$,setSelectedFrameId:v,clearSelectedFrameId:A,addFrame:N,setIsDashboardPanelOpen:R}=o.useDashboardActions(),I=o.useDashboardStore(u=>u.selectedSheetId),D=o.useDashboardStore(u=>u.selectedFrameId),O=o.useDashboardStore(u=>u.dashboard),x=o.useDashboardStore(u=>u.filterValues),y=o.useVisualById((t==null?void 0:t.id)||"",{enabled:!!(t!=null&&t.id)&&!!(e!=null&&e.accessToken)}),M=b.useCallback(async u=>{try{d(u),A();const{data:p,fromCache:h}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,r);if(!Q(p,{setFrame:c,setCard:n,setIsDevMode:s,setActiveTabCardId:l,updateDataSource:m,setQueryResultColumns:f,setSelectedConnectionId:V,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:U,setFilterValues:w,setApplyFilters:E,setIsDashboardEditing:S,setIsVisualEditing:$,dashboard:O,selectedSheetId:I,selectedFrameId:D,filterValues:x}))throw new Error("Failed to setup editor with visual data");return{success:!0,fromCache:h}}catch(p){return console.error("Error editing visual:",p),{success:!1,error:"Failed to load visual for editing"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,r,d,c,n,S,$,s,l,m,f,V,g,i,C,U,w,E,A,O,I,D,x]),k=b.useCallback(async u=>{var p;try{if(d(u),!I)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:h,fromCache:W}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,r),L=(h==null?void 0:h.frameObject)??((p=h==null?void 0:h.visual)==null?void 0:p.frameObject);if(!L)return{success:!1,error:"Visual has no frame data"};const F=T(L);if(!(F!=null&&F.cards)||F.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const P={...o.cloneFrameWithNewIds(F),visualId:u.id};return N(I,P,"end"),S(!0),v(P.id),R(!1),{success:!0,fromCache:W}}catch(h){return console.error("Error adding visual:",h),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,r,d,I,N,S,v,R]);return{visual:y.data,isLoading:y.isLoading,isError:y.isError,error:y.error,handleEditLibraryVisual:M,handleAddLibraryVisual:k,getUpdatedFrame:G().getUpdatedFrame,refetch:y.refetch}}exports.useRemoteChartStore=B;exports.useVisualUtils=z;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { am as G, an as z, h as Y, i as J, ao as K, e as _, g as X, u as U, ap as Z, aq as q, l as v, ar as ee, f as h } from "./index-DilTtW4W.js";
|
|
2
2
|
import { useState as T, useEffect as te, useCallback as V } from "react";
|
|
3
3
|
function re(e) {
|
|
4
4
|
const o = e.toUpperCase().indexOf("WHERE"), r = e.toUpperCase().indexOf("GROUP BY"), t = e.toUpperCase().indexOf("LIMIT"), i = e.toUpperCase().indexOf("ORDER BY");
|
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-BCmbfOd2.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-BCmbfOd2.js"),S=require("./types/index.cjs"),a=require("react/jsx-runtime"),g=require("react"),j=require("./chunks/resource-management-panel-Fs9hg3pC.js"),c=require("./chunks/dashboard-export-dialog-CsU5-_Nc.js");require("react-dom");function P(r){const o=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(o,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return o.default=r,Object.freeze(o)}const C=P(g);/**
|
|
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 N=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 M(r){const{displayPreferences:
|
|
6
|
+
*/const N=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 M(r){const{displayPreferences:o,...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:o,children:a.jsx(e.Container,{type:"visual",...i,children:a.jsx(A,{cardId:r.cardId})})})})})})}function A({cardId:r}){const o=e.useDashboardStore(n=>{var l;return(l=n.dashboard)==null?void 0:l.sheets}),{card:s,frame:i}=g.useMemo(()=>{const n=o==null?void 0:o.flatMap(t=>t.frames),l=n==null?void 0:n.flatMap(t=>t==null?void 0:t.cards),m=l==null?void 0:l.find(t=>(t==null?void 0:t.id)===r),f=n==null?void 0:n.find(t=>{var p;return(p=t==null?void 0:t.cards)==null?void 0:p.find(u=>(u==null?void 0:u.id)===r)});return{card:m,frame:f}},[o,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})})})}function k({name:r,items:o,value:s,onChange:i,isLoading:n,isError:l,refetch:m,className:f,icon:t,showNone:p=!1}){const u=C.useRef(null),[b,x]=C.useState(!1),[y,v]=C.useState("100%"),D=p?[...o||[],{id:"none",name:"None"}]:o;C.useLayoutEffect(()=>{u.current&&v(u.current.offsetWidth)},[]);function T(){var d;return n?"Loading...":l?"Error":s?(d=o==null?void 0:o.find(h=>h.id===s))==null?void 0:d.name:`Select ${r}`}function E(d,h){i(h),x(!1)}return a.jsxs(e.Popover,{open:b,onOpenChange:x,children:[a.jsx(e.PopoverTrigger,{asChild:!0,children:a.jsxs(e.Button,{ref:u,variant:"outline",role:"combobox","aria-expanded":b,className:e.cn("flex h-9 w-full justify-between",f),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[t&&a.jsx("div",{className:"mr-2",children:t}),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:y},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:m,children:a.jsx(N,{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:h=>E(h,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.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.Surfboard=e.DashboardPlus;exports.cloneDeep=e.cloneDeep;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createSqlGenConfig=e.createSqlGenConfig;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;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.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedField=e.isCalculatedField;exports.isCalculatedMetric=e.isCalculatedMetric;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.useDashboardQuery=e.useDashboardQuery;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=S.EMPTY_SELECTION;exports.ResourceManagementPanel=j.ResourceManagementPanel;exports.AdvancedModeToggle=c.AdvancedModeToggle;exports.DashboardExportDialog=c.DashboardExportDialog;exports.ScheduleDashboard=c.ScheduleDashboard;exports.UnsavedChangesAlert=c.UnsavedChangesAlert;exports.VisualEditingControls=c.VisualEditingControls;exports.usePristineSnapshotInitializer=c.usePristineSnapshotInitializer;exports.Combobox=k;exports.Visual=M;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as S, E as
|
|
2
|
-
import {
|
|
3
|
-
import { EMPTY_SELECTION as
|
|
1
|
+
import { b as S, E as g, F as P, S as w, U as M, m as k, n as A, u as F, o as y, p as L, P as R, q as I, B as V, c as v, r as _, s as U, t as B, v as W, I as j, w as q, x as z, y as O, z as Q, C as G } from "./chunks/index-DilTtW4W.js";
|
|
2
|
+
import { Z as oa, _ as na, D as ta, N as ia, a2 as la, R as da, J as ca, J as ua, K as ha, a as pa, T as fa, al as ma, a9 as Ca, W as va, O as ba, Q as Da, a3 as ya, ab as ga, aa as xa, ae as Ea, af as Na, a8 as Ta, V as Sa, a7 as Pa, a0 as wa, a1 as Ma, $ as ka, ac as Aa, a6 as Fa, a5 as La, a4 as Ra, ag as Ia, ad as Va, M as _a, ai as Ua, ak as Ba, aj as Wa, g as ja, A as qa, Y as za, G as Oa, e as Qa, ah as Ga, f as Ha, H as Ka } from "./chunks/index-DilTtW4W.js";
|
|
3
|
+
import { EMPTY_SELECTION as $a } from "./types/index.js";
|
|
4
4
|
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
5
5
|
import * as p from "react";
|
|
6
|
-
import { useMemo as
|
|
7
|
-
import { ResourceManagementPanel as
|
|
8
|
-
import { A as
|
|
6
|
+
import { useMemo as H } from "react";
|
|
7
|
+
import { ResourceManagementPanel as Xa } from "./chunks/resource-management-panel-Bt1zi1Yb.js";
|
|
8
|
+
import { A as ae, D as ee, S as se, U as re, V as oe, u as ne } from "./chunks/dashboard-export-dialog-BpjTGwvL.js";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
/**
|
|
11
11
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -25,13 +25,13 @@ function aa(s) {
|
|
|
25
25
|
id: s.dashboardId
|
|
26
26
|
// override the id to the dashboard id so that the dashboard is not loaded
|
|
27
27
|
};
|
|
28
|
-
return /* @__PURE__ */ a(
|
|
28
|
+
return /* @__PURE__ */ a(g, { FallbackComponent: P, children: /* @__PURE__ */ a(w, { dashboardProps: d, children: /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(k, { displayPreferences: o, children: /* @__PURE__ */ a(A, { type: "visual", ...d, children: /* @__PURE__ */ a(Y, { cardId: s.cardId }) }) }) }) }) });
|
|
29
29
|
}
|
|
30
30
|
function Y({ cardId: s }) {
|
|
31
31
|
const o = F((r) => {
|
|
32
32
|
var n;
|
|
33
33
|
return (n = r.dashboard) == null ? void 0 : n.sheets;
|
|
34
|
-
}), { card: i, frame: d } =
|
|
34
|
+
}), { card: i, frame: d } = H(() => {
|
|
35
35
|
const r = o == null ? void 0 : o.flatMap((e) => e.frames), n = r == null ? void 0 : r.flatMap((e) => e == null ? void 0 : e.cards), f = n == null ? void 0 : n.find((e) => (e == null ? void 0 : e.id) === s), m = r == null ? void 0 : r.find(
|
|
36
36
|
(e) => {
|
|
37
37
|
var h;
|
|
@@ -41,7 +41,7 @@ function Y({ cardId: s }) {
|
|
|
41
41
|
return { card: f, frame: m };
|
|
42
42
|
}, [o, s]);
|
|
43
43
|
return !i || !d ? /* @__PURE__ */ a(
|
|
44
|
-
|
|
44
|
+
y,
|
|
45
45
|
{
|
|
46
46
|
error: new Error("Card not found"),
|
|
47
47
|
resetErrorBoundary: () => {
|
|
@@ -49,13 +49,13 @@ function Y({ cardId: s }) {
|
|
|
49
49
|
customerFacingMessage: `Card not found with ID: ${s}`
|
|
50
50
|
}
|
|
51
51
|
) : /* @__PURE__ */ a("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ a(
|
|
52
|
-
|
|
52
|
+
g,
|
|
53
53
|
{
|
|
54
54
|
FallbackComponent: ({
|
|
55
55
|
error: r,
|
|
56
56
|
resetErrorBoundary: n
|
|
57
57
|
}) => /* @__PURE__ */ a(
|
|
58
|
-
|
|
58
|
+
y,
|
|
59
59
|
{
|
|
60
60
|
error: r,
|
|
61
61
|
resetErrorBoundary: n,
|
|
@@ -131,8 +131,8 @@ function ea({
|
|
|
131
131
|
s == null ? void 0 : s.toLowerCase(),
|
|
132
132
|
" found."
|
|
133
133
|
] }),
|
|
134
|
-
/* @__PURE__ */ a(
|
|
135
|
-
|
|
134
|
+
/* @__PURE__ */ a(O, { children: C == null ? void 0 : C.map((t) => /* @__PURE__ */ a(
|
|
135
|
+
Q,
|
|
136
136
|
{
|
|
137
137
|
className: "overflow-x-auto",
|
|
138
138
|
value: t.name,
|
|
@@ -159,34 +159,34 @@ function ea({
|
|
|
159
159
|
] });
|
|
160
160
|
}
|
|
161
161
|
export {
|
|
162
|
-
|
|
162
|
+
ae as AdvancedModeToggle,
|
|
163
163
|
oa as CALCULATED_FIELD_ENTITY_MARKER,
|
|
164
164
|
ea as Combobox,
|
|
165
165
|
na as DATE_FORMAT_VALUES,
|
|
166
166
|
ta as Dashboard,
|
|
167
|
-
|
|
167
|
+
ee as DashboardExportDialog,
|
|
168
168
|
ia as DashboardWC,
|
|
169
|
-
|
|
169
|
+
$a as EMPTY_SELECTION,
|
|
170
170
|
la as PivotMarkerEnum,
|
|
171
|
-
|
|
171
|
+
Xa as ResourceManagementPanel,
|
|
172
172
|
da as ResourceType,
|
|
173
|
-
|
|
173
|
+
se as ScheduleDashboard,
|
|
174
174
|
w as SemaphorContextProvider,
|
|
175
175
|
ca as SemaphorDataProvider,
|
|
176
176
|
ua as SemaphorQueryClient,
|
|
177
177
|
ha as ShareDialog,
|
|
178
178
|
pa as Surfboard,
|
|
179
|
-
|
|
179
|
+
re as UnsavedChangesAlert,
|
|
180
180
|
aa as Visual,
|
|
181
|
-
|
|
181
|
+
oe as VisualEditingControls,
|
|
182
182
|
fa as cloneDeep,
|
|
183
183
|
ma as createEmptyKpiConfig,
|
|
184
184
|
Ca as createSqlGenConfig,
|
|
185
185
|
va as downloadPdf,
|
|
186
186
|
ba as emitDashboardLoad,
|
|
187
187
|
Da as emitDashboardUnload,
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
ya as fmt,
|
|
189
|
+
ga as getColumnDataType,
|
|
190
190
|
xa as getFilterValueType,
|
|
191
191
|
Ea as getFormattedTableNameForQuery,
|
|
192
192
|
Na as getQualifiedTableName,
|
|
@@ -207,12 +207,13 @@ export {
|
|
|
207
207
|
Ba as useCurrentCardConfig,
|
|
208
208
|
Wa as useCurrentSheetActiveCards,
|
|
209
209
|
ja as useDashboardActions,
|
|
210
|
+
qa as useDashboardQuery,
|
|
210
211
|
F as useDashboardStore,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
za as useDataColumns,
|
|
213
|
+
Oa as useDateFilterHook,
|
|
214
|
+
Qa as useEditorActions,
|
|
215
|
+
Ga as useEditorAside,
|
|
216
|
+
Ha as useEditorStore,
|
|
217
|
+
ne as usePristineSnapshotInitializer,
|
|
218
|
+
Ka as useTextFilterHook
|
|
218
219
|
};
|
package/dist/surfboard/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-BCmbfOd2.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
package/dist/surfboard/index.js
CHANGED
package/dist/types/main.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { default as default_2 } from 'react-grid-layout';
|
|
|
8
8
|
import { Dialect as Dialect_2 } from '../types/explorer-types';
|
|
9
9
|
import { DropdownItem as DropdownItem_2 } from '../types/dropdown-types';
|
|
10
10
|
import { FontSpec } from 'chart.js';
|
|
11
|
+
import { GetDashboardResponse as GetDashboardResponse_2 } from '../types';
|
|
11
12
|
import { GroupByField as GroupByField_2 } from '../types/explorer-types';
|
|
12
13
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
13
14
|
import { MetricField as MetricField_2 } from '../types/explorer-types';
|
|
@@ -22,6 +23,7 @@ import { UseBoundStore } from 'zustand';
|
|
|
22
23
|
import { WritableDraft } from 'immer';
|
|
23
24
|
|
|
24
25
|
declare type Actions = {
|
|
26
|
+
triggerReload: () => void;
|
|
25
27
|
setAiContext: (aiContext: AIContext) => void;
|
|
26
28
|
setHandleOpenAssistantProfile: (handleOpenAssistantProfile: () => void) => void;
|
|
27
29
|
setFilterMode: (filterId: string, filterMode: 'include' | 'exclude') => void;
|
|
@@ -752,6 +754,7 @@ export declare type DashboardStore = {
|
|
|
752
754
|
selectedLensId?: string;
|
|
753
755
|
filteringCards?: TCard[];
|
|
754
756
|
dashboard: TDashboard;
|
|
757
|
+
relaodToken?: number;
|
|
755
758
|
selectedSheetId?: string | null | undefined;
|
|
756
759
|
selectedFrameId?: string | null;
|
|
757
760
|
selectedCardId?: string | null;
|
|
@@ -2814,6 +2817,14 @@ export declare const useCurrentSheetActiveCards: () => TCard[];
|
|
|
2814
2817
|
|
|
2815
2818
|
export declare const useDashboardActions: () => Actions;
|
|
2816
2819
|
|
|
2820
|
+
export declare function useDashboardQuery(): {
|
|
2821
|
+
data: GetDashboardResponse_2 | null | undefined;
|
|
2822
|
+
isLoading: boolean;
|
|
2823
|
+
isFetching: boolean;
|
|
2824
|
+
isError: boolean;
|
|
2825
|
+
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetDashboardResponse_2 | null, Error>>;
|
|
2826
|
+
};
|
|
2827
|
+
|
|
2817
2828
|
export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardStore>, "setState"> & {
|
|
2818
2829
|
setState(nextStateOrUpdater: DashboardStore | Partial<DashboardStore> | ((state: WritableDraft<DashboardStore>) => void), shouldReplace?: boolean | undefined): void;
|
|
2819
2830
|
}>;
|