react-semaphor 0.0.5921 → 0.0.6371

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-BoQ03saJ.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-CUO2Bl9X.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as a } from "../chunks/index-s7sbyt-u.js";
1
+ import { D as a } from "../chunks/index-Ci7ZjQwk.js";
2
2
  import { EMPTY_SELECTION as e } from "../types/index.js";
3
3
  export {
4
4
  a as Dashboard,
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-BoQ03saJ.js"),o=require("./types/index.cjs"),a=require("./chunks/dashboard-plus-eWa7yST3.js");require("react/jsx-runtime");require("react");require("react-dom");const Y=["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 r=(t=>(t.SUBTOTAL="__SUBTOTAL__",t.TOTAL="__TOTAL__",t.ALL="__ALL__",t))(r||{});exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.createSqlGenConfig=e.createSqlGenConfig;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=o.EMPTY_SELECTION;exports.ResourceManagementPanel=a.ResourceManagementPanel;exports.ScheduleDashboard=a.ScheduleDashboard;exports.SelectComponent=a.SelectComponent;exports.Surfboard=a.DashboardPlus;exports.cleanCard=a.cleanCard;exports.downloadPdf=a.downloadPdf;exports.getDashbaordStateWithoutData=a.getDashbaordStateWithoutData;exports.DATE_FORMAT_VALUES=Y;exports.PivotMarkerEnum=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-CUO2Bl9X.js"),h=require("./types/index.cjs"),n=require("./chunks/dashboard-plus-CjnhLxYD.js"),t=require("react/jsx-runtime"),C=require("react");require("react-dom");function T(a){const{displayPreferences:i,...d}=a,u={...d,id:a.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsx(e.SemaphorContextProvider,{dashboardProps:u,children:t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:i,children:t.jsx(e.Container,{type:"visual",...u,children:t.jsx(S,{cardId:a.cardId})})})})})})}function S({cardId:a}){const i=e.useDashboardStore(o=>{var s;return(s=o.dashboard)==null?void 0:s.sheets}),{card:d,frame:u}=C.useMemo(()=>{const o=i==null?void 0:i.flatMap(r=>r.frames),s=o==null?void 0:o.flatMap(r=>r==null?void 0:r.cards),c=s==null?void 0:s.find(r=>(r==null?void 0:r.id)===a),M=o==null?void 0:o.find(r=>{var l;return(l=r==null?void 0:r.cards)==null?void 0:l.find(Y=>(Y==null?void 0:Y.id)===a)});return{card:c,frame:M}},[i,a]);return!d||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${a}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:o,resetErrorBoundary:s})=>t.jsx(e.FallbackVisual,{error:o,resetErrorBoundary:s,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:d,frame:u})})})}const b=["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 D=(a=>(a.SUBTOTAL="__SUBTOTAL__",a.TOTAL="__TOTAL__",a.ALL="__ALL__",a))(D||{});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.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=h.EMPTY_SELECTION;exports.ResourceManagementPanel=n.ResourceManagementPanel;exports.ScheduleDashboard=n.ScheduleDashboard;exports.SelectComponent=n.SelectComponent;exports.ShareDialog=n.ShareDialog;exports.Surfboard=n.DashboardPlus;exports.cleanCard=n.cleanCard;exports.getDashbaordStateWithoutData=n.getDashbaordStateWithoutData;exports.DATE_FORMAT_VALUES=b;exports.PivotMarkerEnum=D;exports.Visual=T;
package/dist/index.js CHANGED
@@ -1,10 +1,58 @@
1
- import { D, d as u, S as d, b as i, b as n, m as l, f as T, o as m, n as p, q as C, s as S, l as A, i as _, k as c, p as h, j as b, h as f, g, t as y, r as L, c as x, x as Q, z as v, y as E, A as F, w as O, e as W, u as N, C as k, v as q, B, a as P } from "./chunks/index-s7sbyt-u.js";
2
- import { EMPTY_SELECTION as U } from "./types/index.js";
3
- import { R as G, S as H, a as I, D as V, c as j, d as z, g as J } from "./chunks/dashboard-plus-BbSiLlXL.js";
4
- import "react/jsx-runtime";
5
- import "react";
1
+ import { E as l, F as c, S as h, U as f, a as p, C as m, u as T, b as u, c as C } from "./chunks/index-Ci7ZjQwk.js";
2
+ import { D as L, h as k, R as Q, f as w, f as B, r as N, j as O, l as W, t as R, s as U, x as V, y as q, q as I, i as G, p as H, v as j, o as z, n as J, m as K, z as X, w as $, g as Z, B as aa, H as ea, G as sa, I as ra, k as oa, d as ta, K as Ya, A as na, J as ia, e as da } from "./chunks/index-Ci7ZjQwk.js";
3
+ import { EMPTY_SELECTION as la } from "./types/index.js";
4
+ import { R as Da, a as ca, b as ha, S as fa, D as pa, c as ma, g as Ta } from "./chunks/dashboard-plus-DecDM7dW.js";
5
+ import { jsx as s } from "react/jsx-runtime";
6
+ import { useMemo as b } from "react";
6
7
  import "react-dom";
7
- const r = [
8
+ function x(a) {
9
+ const { displayPreferences: t, ...n } = a, Y = {
10
+ ...n,
11
+ id: a.dashboardId
12
+ // override the id to the dashboard id so that the dashboard is not loaded
13
+ };
14
+ return /* @__PURE__ */ s(l, { FallbackComponent: c, children: /* @__PURE__ */ s(h, { dashboardProps: Y, children: /* @__PURE__ */ s(f, { children: /* @__PURE__ */ s(p, { displayPreferences: t, children: /* @__PURE__ */ s(m, { type: "visual", ...Y, children: /* @__PURE__ */ s(S, { cardId: a.cardId }) }) }) }) }) });
15
+ }
16
+ function S({ cardId: a }) {
17
+ const t = T((r) => {
18
+ var o;
19
+ return (o = r.dashboard) == null ? void 0 : o.sheets;
20
+ }), { card: n, frame: Y } = b(() => {
21
+ const r = t == null ? void 0 : t.flatMap((e) => e.frames), o = r == null ? void 0 : r.flatMap((e) => e == null ? void 0 : e.cards), M = o == null ? void 0 : o.find((e) => (e == null ? void 0 : e.id) === a), D = r == null ? void 0 : r.find(
22
+ (e) => {
23
+ var d;
24
+ return (d = e == null ? void 0 : e.cards) == null ? void 0 : d.find((i) => (i == null ? void 0 : i.id) === a);
25
+ }
26
+ );
27
+ return { card: M, frame: D };
28
+ }, [t, a]);
29
+ return !n || !Y ? /* @__PURE__ */ s(
30
+ u,
31
+ {
32
+ error: new Error("Card not found"),
33
+ resetErrorBoundary: () => {
34
+ },
35
+ customerFacingMessage: `Card not found with ID: ${a}`
36
+ }
37
+ ) : /* @__PURE__ */ s("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ s(
38
+ l,
39
+ {
40
+ FallbackComponent: ({
41
+ error: r,
42
+ resetErrorBoundary: o
43
+ }) => /* @__PURE__ */ s(
44
+ u,
45
+ {
46
+ error: r,
47
+ resetErrorBoundary: o,
48
+ customerFacingMessage: "Error creating visual. Please try again."
49
+ }
50
+ ),
51
+ children: /* @__PURE__ */ s(C, { card: n, frame: Y })
52
+ }
53
+ ) });
54
+ }
55
+ const E = [
8
56
  // Day granularity formats
9
57
  "MM-DD-YYYY",
10
58
  "YYYY-MM-DD",
@@ -35,48 +83,51 @@ const r = [
35
83
  // Custom format
36
84
  "custom"
37
85
  ];
38
- var e = /* @__PURE__ */ ((a) => (a.SUBTOTAL = "__SUBTOTAL__", a.TOTAL = "__TOTAL__", a.ALL = "__ALL__", a))(e || {});
86
+ var g = /* @__PURE__ */ ((a) => (a.SUBTOTAL = "__SUBTOTAL__", a.TOTAL = "__TOTAL__", a.ALL = "__ALL__", a))(g || {});
39
87
  export {
40
- r as DATE_FORMAT_VALUES,
41
- D as Dashboard,
42
- u as DashboardWC,
43
- U as EMPTY_SELECTION,
44
- e as PivotMarkerEnum,
45
- G as ResourceManagementPanel,
46
- H as ScheduleDashboard,
47
- I as SelectComponent,
48
- d as SemaphorContextProvider,
49
- i as SemaphorDataProvider,
50
- n as SemaphorQueryClient,
51
- V as Surfboard,
52
- j as cleanCard,
53
- l as createSqlGenConfig,
54
- z as downloadPdf,
55
- T as fmt,
56
- m as getColumnDataType,
57
- J as getDashbaordStateWithoutData,
58
- p as getFilterValueType,
59
- C as getFormattedTableNameForQuery,
60
- S as getQualifiedTableName,
61
- A as getSql,
62
- _ as invalidateToken,
63
- c as isBooleanDataType,
64
- h as isColumnInSqlGen,
65
- b as isDateDataType,
66
- f as isNumberDataType,
67
- g as isTextDataType,
68
- y as resolveDataType,
69
- L as resolveDatamodelName,
70
- x as useCard,
71
- Q as useCurrentActiveCard,
72
- v as useCurrentCardConfig,
73
- E as useCurrentSheetActiveCards,
74
- F as useDashboardActions,
75
- O as useDashboardStore,
76
- W as useDataColumns,
77
- N as useDateFilterHook,
78
- k as useEditorActions,
79
- q as useEditorAside,
80
- B as useEditorStore,
81
- P as useTextFilterHook
88
+ E as DATE_FORMAT_VALUES,
89
+ L as Dashboard,
90
+ k as DashboardWC,
91
+ la as EMPTY_SELECTION,
92
+ g as PivotMarkerEnum,
93
+ Da as ResourceManagementPanel,
94
+ Q as ResourceType,
95
+ ca as ScheduleDashboard,
96
+ ha as SelectComponent,
97
+ h as SemaphorContextProvider,
98
+ w as SemaphorDataProvider,
99
+ B as SemaphorQueryClient,
100
+ fa as ShareDialog,
101
+ pa as Surfboard,
102
+ x as Visual,
103
+ ma as cleanCard,
104
+ N as createSqlGenConfig,
105
+ O as downloadPdf,
106
+ W as fmt,
107
+ R as getColumnDataType,
108
+ Ta as getDashbaordStateWithoutData,
109
+ U as getFilterValueType,
110
+ V as getFormattedTableNameForQuery,
111
+ q as getQualifiedTableName,
112
+ I as getSql,
113
+ G as invalidateToken,
114
+ H as isBooleanDataType,
115
+ j as isColumnInSqlGen,
116
+ z as isDateDataType,
117
+ J as isNumberDataType,
118
+ K as isTextDataType,
119
+ X as resolveDataType,
120
+ $ as resolveDatamodelName,
121
+ Z as useCard,
122
+ aa as useCurrentActiveCard,
123
+ ea as useCurrentCardConfig,
124
+ sa as useCurrentSheetActiveCards,
125
+ ra as useDashboardActions,
126
+ T as useDashboardStore,
127
+ oa as useDataColumns,
128
+ ta as useDateFilterHook,
129
+ Ya as useEditorActions,
130
+ na as useEditorAside,
131
+ ia as useEditorStore,
132
+ da as useTextFilterHook
82
133
  };