react-semaphor 0.0.262 → 0.0.264

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-0MAjBg18.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-It6ckD_Z.js");require("react");require("react-dom");exports.Dashboard=e.Dashboard;
@@ -1,4 +1,4 @@
1
- import { D as p } from "../chunks/index-6JXvVFAp.js";
1
+ import { D as p } from "../chunks/index-CmAm-Ehp.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-0MAjBg18.js"),n=require("./chunks/dashboard-plus-7yELTcR6.js"),I=require("react");require("react-dom");function N({card:t,footer:u,className:c,...h}){const{customCards:r}=e.useSemaphorContext(),m=I.useRef(null),{isError:p,isLoading:i,isFetching:a,cfg:x,visualKey:C,handleDatapointClick:f}=e.useDashboardCard(t),l=e.useDashboardStore(s=>s.themeStyle),d=e.useDashboardStore(s=>s.selectedSheetId),E=e.useDashboardStore(s=>s.selectedCardId),j=e.useDashboardStore(s=>s.isDashboardEditing),{setCardTitle:D,setCardDescription:g,setSelectedCardId:b}=e.useDashboardActions();function S(s){s.stopPropagation(),b(d,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:i||a,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(x)return e.jsxRuntimeExports.jsx(e.ChartJsVisual,{cfg:x,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 u||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=>D(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=>g(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:R()}),e.jsxRuntimeExports.jsx(e.CardFooter,{children:A()})]});return e.jsxRuntimeExports.jsx(e.Card,{tabIndex:-1,ref:m,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},l==null?void 0:l.dashboardCard,c),...h,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.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=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-It6ckD_Z.js"),n=require("./chunks/dashboard-plus-X_JjNwDD.js"),I=require("react");require("react-dom");function N({card:t,footer:u,className:c,...h}){const{customCards:r}=e.useSemaphorContext(),m=I.useRef(null),{isError:p,isLoading:i,isFetching:a,cfg:x,visualKey:C,handleDatapointClick:f}=e.useDashboardCard(t),l=e.useDashboardStore(s=>s.themeStyle),d=e.useDashboardStore(s=>s.selectedSheetId),E=e.useDashboardStore(s=>s.selectedCardId),j=e.useDashboardStore(s=>s.isDashboardEditing),{setCardTitle:D,setCardDescription:g,setSelectedCardId:b}=e.useDashboardActions();function S(s){s.stopPropagation(),b(d,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:i||a,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(x)return e.jsxRuntimeExports.jsx(e.ChartJsVisual,{cfg:x,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 u||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=>D(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=>g(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:R()}),e.jsxRuntimeExports.jsx(e.CardFooter,{children:A()})]});return e.jsxRuntimeExports.jsx(e.Card,{tabIndex:-1,ref:m,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},l==null?void 0:l.dashboardCard,c),...h,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.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=N;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { u as _, a as w, b as r, c as F, j as t, C as P, E as f, d as k, T as R, e as L, f as h, g as q, h as B, i as Y, k as G, l as K, K as O, S as V, m as z, n as H, o as Q } from "./chunks/index-6JXvVFAp.js";
2
- import { B as se, s as ae, D as oe, q as re, N as ne, I as ie, r as le, w as de, t as ue, y as ce, x as fe, A as he, v as Ce, z as me, F as xe, p as pe, H as ge, G as je } from "./chunks/index-6JXvVFAp.js";
3
- import { L as W } from "./chunks/dashboard-plus-5tmavBL_.js";
4
- import { S as be, D as Se, c as Te, g as Ee, u as Ie } from "./chunks/dashboard-plus-5tmavBL_.js";
1
+ import { u as _, a as w, b as r, c as F, j as t, C as P, E as f, d as k, T as R, e as L, f as h, g as q, h as B, i as Y, k as G, l as K, K as O, S as V, m as z, n as H, o as Q } from "./chunks/index-CmAm-Ehp.js";
2
+ import { B as se, s as ae, D as oe, q as re, N as ne, I as ie, r as le, w as de, t as ue, y as ce, x as fe, A as he, v as Ce, z as me, F as xe, p as pe, H as ge, G as je } from "./chunks/index-CmAm-Ehp.js";
3
+ import { L as W } from "./chunks/dashboard-plus-hLySbJIH.js";
4
+ import { S as be, D as Se, c as Te, g as Ee, u as Ie } from "./chunks/dashboard-plus-hLySbJIH.js";
5
5
  import J from "react";
6
6
  import "react-dom";
7
7
  function Z({
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-7yELTcR6.js");require("../chunks/index-0MAjBg18.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-X_JjNwDD.js");require("../chunks/index-It6ckD_Z.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
@@ -1,5 +1,5 @@
1
- import { D as i } from "../chunks/dashboard-plus-5tmavBL_.js";
2
- import "../chunks/index-6JXvVFAp.js";
1
+ import { D as i } from "../chunks/dashboard-plus-hLySbJIH.js";
2
+ import "../chunks/index-CmAm-Ehp.js";
3
3
  import "react";
4
4
  import "react-dom";
5
5
  export {
@@ -87,7 +87,7 @@ export declare type DateOptions = {
87
87
  options: Intl.DateTimeFormatOptions;
88
88
  };
89
89
 
90
- export declare type DisplayDataType = 'string' | 'date' | 'number';
90
+ export declare type DisplayDataType = 'string' | 'date' | 'number' | 'none';
91
91
 
92
92
  export declare type ErrorProps = {
93
93
  message?: string;
@@ -154,6 +154,8 @@ export declare type LoadingProps = {
154
154
  message?: string;
155
155
  };
156
156
 
157
+ declare type NoneOptions = {};
158
+
157
159
  export declare type NumberAxisFormat = {
158
160
  decimalPlaces?: number;
159
161
  suffix?: string;
@@ -174,6 +176,7 @@ declare type OptionsMap = {
174
176
  number: NumberOptions;
175
177
  string: StringOptions;
176
178
  date: DateOptions;
179
+ none: NoneOptions;
177
180
  };
178
181
 
179
182
  declare type Params = {
@@ -270,7 +270,7 @@ export declare type DateOptions = {
270
270
  options: Intl.DateTimeFormatOptions;
271
271
  };
272
272
 
273
- export declare type DisplayDataType = 'string' | 'date' | 'number';
273
+ export declare type DisplayDataType = 'string' | 'date' | 'number' | 'none';
274
274
 
275
275
  declare type EditorStore = {
276
276
  isShowingVisual: boolean;
@@ -404,6 +404,8 @@ export declare type LoadingProps = {
404
404
  message?: string;
405
405
  };
406
406
 
407
+ declare type NoneOptions = {};
408
+
407
409
  export declare const NUMBER_DATA_TYPES: string[];
408
410
 
409
411
  export declare type NumberAxisFormat = {
@@ -426,6 +428,7 @@ declare type OptionsMap = {
426
428
  number: NumberOptions;
427
429
  string: StringOptions;
428
430
  date: DateOptions;
431
+ none: NoneOptions;
429
432
  };
430
433
 
431
434
  declare type Params = {
@@ -897,7 +900,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
897
900
  type: DisplayDataType;
898
901
  options: {
899
902
  maxLength?: number | undefined;
900
- } | {
903
+ } | {} | {
901
904
  locale: string;
902
905
  currency?: string | undefined;
903
906
  options: {
@@ -1105,7 +1108,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1105
1108
  type: DisplayDataType;
1106
1109
  options: {
1107
1110
  maxLength?: number | undefined;
1108
- } | {
1111
+ } | {} | {
1109
1112
  locale: string;
1110
1113
  currency?: string | undefined;
1111
1114
  options: {
@@ -1272,7 +1275,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1272
1275
  type: DisplayDataType;
1273
1276
  options: {
1274
1277
  maxLength?: number | undefined;
1275
- } | {
1278
+ } | {} | {
1276
1279
  locale: string;
1277
1280
  currency?: string | undefined;
1278
1281
  options: {
@@ -1594,7 +1597,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1594
1597
  type: DisplayDataType;
1595
1598
  options: {
1596
1599
  maxLength?: number | undefined;
1597
- } | {
1600
+ } | {} | {
1598
1601
  locale: string;
1599
1602
  currency?: string | undefined;
1600
1603
  options: {
@@ -1983,7 +1986,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
1983
1986
  type: DisplayDataType;
1984
1987
  options: {
1985
1988
  maxLength?: number | undefined;
1986
- } | {
1989
+ } | {} | {
1987
1990
  locale: string;
1988
1991
  currency?: string | undefined;
1989
1992
  options: {
@@ -2149,7 +2152,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
2149
2152
  type: DisplayDataType;
2150
2153
  options: {
2151
2154
  maxLength?: number | undefined;
2152
- } | {
2155
+ } | {} | {
2153
2156
  locale: string;
2154
2157
  currency?: string | undefined;
2155
2158
  options: {
@@ -90,7 +90,7 @@ export declare type DateOptions = {
90
90
  options: Intl.DateTimeFormatOptions;
91
91
  };
92
92
 
93
- export declare type DisplayDataType = 'string' | 'date' | 'number';
93
+ export declare type DisplayDataType = 'string' | 'date' | 'number' | 'none';
94
94
 
95
95
  export declare type ErrorProps = {
96
96
  message?: string;
@@ -157,6 +157,8 @@ export declare type LoadingProps = {
157
157
  message?: string;
158
158
  };
159
159
 
160
+ declare type NoneOptions = {};
161
+
160
162
  export declare type NumberAxisFormat = {
161
163
  decimalPlaces?: number;
162
164
  suffix?: string;
@@ -177,6 +179,7 @@ declare type OptionsMap = {
177
179
  number: NumberOptions;
178
180
  string: StringOptions;
179
181
  date: DateOptions;
182
+ none: NoneOptions;
180
183
  };
181
184
 
182
185
  declare type Params = {
@@ -84,7 +84,7 @@ export declare type DateOptions = {
84
84
  options: Intl.DateTimeFormatOptions;
85
85
  };
86
86
 
87
- export declare type DisplayDataType = 'string' | 'date' | 'number';
87
+ export declare type DisplayDataType = 'string' | 'date' | 'number' | 'none';
88
88
 
89
89
  export declare type ErrorProps = {
90
90
  message?: string;
@@ -151,6 +151,8 @@ export declare type LoadingProps = {
151
151
  message?: string;
152
152
  };
153
153
 
154
+ declare type NoneOptions = {};
155
+
154
156
  export declare type NumberAxisFormat = {
155
157
  decimalPlaces?: number;
156
158
  suffix?: string;
@@ -171,6 +173,7 @@ declare type OptionsMap = {
171
173
  number: NumberOptions;
172
174
  string: StringOptions;
173
175
  date: DateOptions;
176
+ none: NoneOptions;
174
177
  };
175
178
 
176
179
  declare type Params = {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.262",
8
+ "version": "0.0.264",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",