semaphor 0.0.74 → 0.0.76

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-Vo7AS1qw.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-3mJ0FTjs.js");require("react");require("react-dom");exports.Dashboard=e.Dashboard;
@@ -1,4 +1,4 @@
1
- import { D as p } from "../chunks/index-FWArdRk4.js";
1
+ import { D as p } from "../chunks/index-CbTZvlIM.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-Vo7AS1qw.js"),n=require("./chunks/dashboard-plus-aiBcmf0f.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-3mJ0FTjs.js"),n=require("./chunks/dashboard-plus-AK0BZVwp.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,7 +1,7 @@
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-FWArdRk4.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-FWArdRk4.js";
3
- import { L as M } from "./chunks/dashboard-plus-Y0SaVfMR.js";
4
- import { S as Te, D as Ee, c as Ie, g as Ae, u as ve } from "./chunks/dashboard-plus-Y0SaVfMR.js";
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-CbTZvlIM.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-CbTZvlIM.js";
3
+ import { L as M } from "./chunks/dashboard-plus-bg-mRdBZ.js";
4
+ import { S as Te, D as Ee, c as Ie, g as Ae, u as ve } from "./chunks/dashboard-plus-bg-mRdBZ.js";
5
5
  import U from "react";
6
6
  import "react-dom";
7
7
  function se({
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-aiBcmf0f.js");require("../chunks/index-Vo7AS1qw.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-AK0BZVwp.js");require("../chunks/index-3mJ0FTjs.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
@@ -1,5 +1,5 @@
1
- import { D as i } from "../chunks/dashboard-plus-Y0SaVfMR.js";
2
- import "../chunks/index-FWArdRk4.js";
1
+ import { D as i } from "../chunks/dashboard-plus-bg-mRdBZ.js";
2
+ import "../chunks/index-CbTZvlIM.js";
3
3
  import "react";
4
4
  import "react-dom";
5
5
  export {
@@ -76,7 +76,7 @@ export declare type DashboardProps = {
76
76
  defaultFilterValues?: {
77
77
  filterId: string;
78
78
  values: string[] | number[];
79
- }[];
79
+ }[] | TFilterValue[];
80
80
  customStyle?: TStyle;
81
81
  currentTheme?: Theme;
82
82
  version?: string;
@@ -85,6 +85,7 @@ export declare type DashboardProps = {
85
85
  onChartElementClicked?: (card: TCard, fieldValues: any) => void;
86
86
  onEvent?: (event: TEvent) => void;
87
87
  onSave?: (dashboard: TDashboard) => void;
88
+ onFilterValuesChange?: (filterValues: TFilterValue[]) => void;
88
89
  LoadingComponent?: (props: LoadingProps) => React.ReactNode;
89
90
  ErrorComponent?: (props: ErrorProps) => React.ReactNode;
90
91
  };
@@ -81,6 +81,7 @@ declare type Actions = {
81
81
  getCardSheet: (cardId: string) => TSheet | undefined;
82
82
  getSelectedSheetLayout: () => ReactGridLayout_2.Layout[] | undefined;
83
83
  getSelectedSheetLayouts: () => ReactGridLayout_2.Layouts | undefined;
84
+ getSheetFilterValues: (sheetId: string) => TFilterValue[] | undefined;
84
85
  handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
85
86
  addBaseQuery: (baseQuery: TBaseQuery) => void;
86
87
  removeBaseQuery: (baseQueryId: string) => void;
@@ -228,7 +229,7 @@ export declare type DashboardProps = {
228
229
  defaultFilterValues?: {
229
230
  filterId: string;
230
231
  values: string[] | number[];
231
- }[];
232
+ }[] | TFilterValue[];
232
233
  customStyle?: TStyle;
233
234
  currentTheme?: Theme;
234
235
  version?: string;
@@ -237,6 +238,7 @@ export declare type DashboardProps = {
237
238
  onChartElementClicked?: (card: TCard, fieldValues: any) => void;
238
239
  onEvent?: (event: TEvent) => void;
239
240
  onSave?: (dashboard: TDashboard) => void;
241
+ onFilterValuesChange?: (filterValues: TFilterValue[]) => void;
240
242
  LoadingComponent?: (props: LoadingProps) => React.ReactNode;
241
243
  ErrorComponent?: (props: ErrorProps) => React.ReactNode;
242
244
  };
@@ -1840,6 +1842,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1840
1842
  getCardSheet: (cardId: string) => TSheet | undefined;
1841
1843
  getSelectedSheetLayout: () => ReactGridLayout_2.Layout[] | undefined;
1842
1844
  getSelectedSheetLayouts: () => ReactGridLayout_2.Layouts | undefined;
1845
+ getSheetFilterValues: (sheetId: string) => TFilterValue[] | undefined;
1843
1846
  handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
1844
1847
  addBaseQuery: (baseQuery: TBaseQuery) => void;
1845
1848
  removeBaseQuery: (baseQueryId: string) => void;
@@ -79,7 +79,7 @@ export declare type DashboardProps = {
79
79
  defaultFilterValues?: {
80
80
  filterId: string;
81
81
  values: string[] | number[];
82
- }[];
82
+ }[] | TFilterValue[];
83
83
  customStyle?: TStyle;
84
84
  currentTheme?: Theme;
85
85
  version?: string;
@@ -88,6 +88,7 @@ export declare type DashboardProps = {
88
88
  onChartElementClicked?: (card: TCard, fieldValues: any) => void;
89
89
  onEvent?: (event: TEvent) => void;
90
90
  onSave?: (dashboard: TDashboard) => void;
91
+ onFilterValuesChange?: (filterValues: TFilterValue[]) => void;
91
92
  LoadingComponent?: (props: LoadingProps) => React.ReactNode;
92
93
  ErrorComponent?: (props: ErrorProps) => React.ReactNode;
93
94
  };
@@ -73,7 +73,7 @@ export declare type DashboardProps = {
73
73
  defaultFilterValues?: {
74
74
  filterId: string;
75
75
  values: string[] | number[];
76
- }[];
76
+ }[] | TFilterValue[];
77
77
  customStyle?: TStyle;
78
78
  currentTheme?: Theme;
79
79
  version?: string;
@@ -82,6 +82,7 @@ export declare type DashboardProps = {
82
82
  onChartElementClicked?: (card: TCard, fieldValues: any) => void;
83
83
  onEvent?: (event: TEvent) => void;
84
84
  onSave?: (dashboard: TDashboard) => void;
85
+ onFilterValuesChange?: (filterValues: TFilterValue[]) => void;
85
86
  LoadingComponent?: (props: LoadingProps) => React.ReactNode;
86
87
  ErrorComponent?: (props: ErrorProps) => React.ReactNode;
87
88
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.74",
8
+ "version": "0.0.76",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",