semaphor 0.0.128 → 0.0.130

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.
Files changed (33) hide show
  1. package/dist/chunks/dashboard-controls-BMLlOkS9.js +1539 -0
  2. package/dist/chunks/dashboard-controls-BdQcYRkf.js +26 -0
  3. package/dist/chunks/dashboard-export-dialog-BpNaUA5x.js +6 -0
  4. package/dist/chunks/dashboard-export-dialog-CbMcLZvW.js +602 -0
  5. package/dist/chunks/dashboard-json-DD-d9gYu.js +66 -0
  6. package/dist/chunks/dashboard-json-DgQozDAv.js +1 -0
  7. package/dist/chunks/edit-dashboard-visual-CR3NqJ7m.js +200 -0
  8. package/dist/chunks/edit-dashboard-visual-CRMhXxdG.js +15517 -0
  9. package/dist/chunks/editor-action-buttons-CNQtSzD5.js +270 -0
  10. package/dist/chunks/editor-action-buttons-DYrSZQhJ.js +6 -0
  11. package/dist/chunks/index-CReqnEJI.js +1081 -0
  12. package/dist/chunks/{index-nm88dVBB.js → index-QdSI9E0a.js} +89207 -74907
  13. package/dist/chunks/resource-management-panel-CBXn6QHi.js +895 -0
  14. package/dist/chunks/resource-management-panel-CXSx9QhW.js +6 -0
  15. package/dist/chunks/use-click-outside-B9T3lmcw.js +1 -0
  16. package/dist/chunks/use-click-outside-CMeO_QFI.js +16 -0
  17. package/dist/chunks/use-visual-utils-BDuNB0Iz.js +1 -0
  18. package/dist/chunks/use-visual-utils-BnCl386t.js +331 -0
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/index.cjs +6 -1
  22. package/dist/index.js +194 -111
  23. package/dist/style.css +1 -1
  24. package/dist/surfboard/index.cjs +1 -1
  25. package/dist/surfboard/index.js +4 -4
  26. package/dist/types/dashboard.d.ts +524 -18
  27. package/dist/types/main.d.ts +948 -105
  28. package/dist/types/surfboard.d.ts +524 -18
  29. package/dist/types/types.d.ts +524 -18
  30. package/package.json +11 -7
  31. package/dist/chunks/dashboard-plus-DuenxiNV.js +0 -335
  32. package/dist/chunks/dashboard-plus-vO1PNFhv.js +0 -22561
  33. package/dist/chunks/index-BRkgsUH0.js +0 -985
package/dist/index.js CHANGED
@@ -1,136 +1,219 @@
1
- import { E as u, F as c, S as h, U as f, a as p, C as T, u as m, b as l, c as C } from "./chunks/index-nm88dVBB.js";
2
- import { D as L, h as k, R as Q, f as V, f as B, r as w, j as N, l as O, t as W, s as R, x as U, 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-nm88dVBB.js";
3
- import { EMPTY_SELECTION as ua } from "./types/index.js";
4
- import { A as Da, R as ca, b as ha, c as fa, S as pa, D as Ta, a as ma, V as Ca, d as ga, g as ba } from "./chunks/dashboard-plus-vO1PNFhv.js";
5
- import { jsx as s } from "react/jsx-runtime";
6
- import { useMemo as g } from "react";
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-QdSI9E0a.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-QdSI9E0a.js";
3
+ import { EMPTY_SELECTION as $a } from "./types/index.js";
4
+ import { jsx as a, jsxs as l } from "react/jsx-runtime";
5
+ import * as p from "react";
6
+ import { useMemo as H } from "react";
7
+ import { ResourceManagementPanel as Xa } from "./chunks/resource-management-panel-CBXn6QHi.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-CbMcLZvW.js";
7
9
  import "react-dom";
8
- function E(a) {
9
- const { displayPreferences: t, ...n } = a, Y = {
10
- ...n,
11
- id: a.dashboardId
10
+ /**
11
+ * @license lucide-react v0.453.0 - ISC
12
+ *
13
+ * This source code is licensed under the ISC license.
14
+ * See the LICENSE file in the root directory of this source tree.
15
+ */
16
+ const K = S("RefreshCw", [
17
+ ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
18
+ ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
19
+ ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
20
+ ["path", { d: "M8 16H3v5", key: "1cv678" }]
21
+ ]);
22
+ function aa(s) {
23
+ const { displayPreferences: o, ...i } = s, d = {
24
+ ...i,
25
+ id: s.dashboardId
12
26
  // override the id to the dashboard id so that the dashboard is not loaded
13
27
  };
14
- return /* @__PURE__ */ s(u, { FallbackComponent: c, children: /* @__PURE__ */ s(h, { dashboardProps: Y, children: /* @__PURE__ */ s(f, { children: /* @__PURE__ */ s(p, { displayPreferences: t, children: /* @__PURE__ */ s(T, { type: "visual", ...Y, children: /* @__PURE__ */ s(b, { cardId: a.cardId }) }) }) }) }) });
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 }) }) }) }) }) });
15
29
  }
16
- function b({ cardId: a }) {
17
- const t = m((r) => {
18
- var o;
19
- return (o = r.dashboard) == null ? void 0 : o.sheets;
20
- }), { card: n, frame: Y } = g(() => {
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(
30
+ function Y({ cardId: s }) {
31
+ const o = F((r) => {
32
+ var n;
33
+ return (n = r.dashboard) == null ? void 0 : n.sheets;
34
+ }), { card: i, frame: d } = H(() => {
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(
22
36
  (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);
37
+ var h;
38
+ return (h = e == null ? void 0 : e.cards) == null ? void 0 : h.find((c) => (c == null ? void 0 : c.id) === s);
25
39
  }
26
40
  );
27
- return { card: M, frame: D };
28
- }, [t, a]);
29
- return !n || !Y ? /* @__PURE__ */ s(
30
- l,
41
+ return { card: f, frame: m };
42
+ }, [o, s]);
43
+ return !i || !d ? /* @__PURE__ */ a(
44
+ y,
31
45
  {
32
46
  error: new Error("Card not found"),
33
47
  resetErrorBoundary: () => {
34
48
  },
35
- customerFacingMessage: `Card not found with ID: ${a}`
49
+ customerFacingMessage: `Card not found with ID: ${s}`
36
50
  }
37
- ) : /* @__PURE__ */ s("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ s(
38
- u,
51
+ ) : /* @__PURE__ */ a("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ a(
52
+ g,
39
53
  {
40
54
  FallbackComponent: ({
41
55
  error: r,
42
- resetErrorBoundary: o
43
- }) => /* @__PURE__ */ s(
44
- l,
56
+ resetErrorBoundary: n
57
+ }) => /* @__PURE__ */ a(
58
+ y,
45
59
  {
46
60
  error: r,
47
- resetErrorBoundary: o,
61
+ resetErrorBoundary: n,
48
62
  customerFacingMessage: "Error creating visual. Please try again."
49
63
  }
50
64
  ),
51
- children: /* @__PURE__ */ s(C, { card: n, frame: Y })
65
+ children: /* @__PURE__ */ a(L, { card: i, frame: d })
52
66
  }
53
67
  ) });
54
68
  }
55
- const x = [
56
- // Day granularity formats
57
- "MM-DD-YYYY",
58
- "YYYY-MM-DD",
59
- "MM/DD/YYYY",
60
- "DD/MM/YYYY",
61
- "MMMM DD, YYYY",
62
- "MMM DD, YYYY",
63
- "DD MMM YYYY",
64
- // Week granularity formats
65
- "Week of MMM DD, YYYY",
66
- "Week of MMMM DD, YYYY",
67
- "YYYY-WW",
68
- // Month granularity formats
69
- "MMM YYYY",
70
- "MMMM YYYY",
71
- "YYYY-MM",
72
- "MM/YYYY",
73
- "YYYY MMM",
74
- // Quarter granularity formats
75
- "Q1 YYYY",
76
- "YYYY Q1",
77
- "1st Quarter YYYY",
78
- "YYYY-Q1",
79
- "Quarter 1, YYYY",
80
- // Year granularity formats
81
- "YYYY",
82
- "YY",
83
- // Custom format
84
- "custom"
85
- ];
86
- var S = /* @__PURE__ */ ((a) => (a.SUBTOTAL = "__SUBTOTAL__", a.TOTAL = "__TOTAL__", a.ALL = "__ALL__", a))(S || {});
69
+ function ea({
70
+ name: s,
71
+ items: o,
72
+ value: i,
73
+ onChange: d,
74
+ isLoading: r,
75
+ isError: n,
76
+ refetch: f,
77
+ className: m,
78
+ icon: e,
79
+ showNone: h = !1
80
+ }) {
81
+ const c = p.useRef(null), [b, D] = p.useState(!1), [x, E] = p.useState("100%"), C = h ? [...o || [], { id: "none", name: "None" }] : o;
82
+ p.useLayoutEffect(() => {
83
+ c.current && E(c.current.offsetWidth);
84
+ }, []);
85
+ function N() {
86
+ var t;
87
+ return r ? "Loading..." : n ? "Error" : i ? (t = o == null ? void 0 : o.find((u) => u.id === i)) == null ? void 0 : t.name : `Select ${s}`;
88
+ }
89
+ function T(t, u) {
90
+ d(u), D(!1);
91
+ }
92
+ return /* @__PURE__ */ l(R, { open: b, onOpenChange: D, children: [
93
+ /* @__PURE__ */ a(I, { asChild: !0, children: /* @__PURE__ */ l(
94
+ V,
95
+ {
96
+ ref: c,
97
+ variant: "outline",
98
+ role: "combobox",
99
+ "aria-expanded": b,
100
+ className: v("flex h-9 w-full justify-between", m),
101
+ children: [
102
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
103
+ e && /* @__PURE__ */ a("div", { className: "mr-2", children: e }),
104
+ /* @__PURE__ */ a("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: N() })
105
+ ] }),
106
+ /* @__PURE__ */ a(_, { className: "size-4 opacity-50" })
107
+ ]
108
+ }
109
+ ) }),
110
+ /* @__PURE__ */ a(
111
+ U,
112
+ {
113
+ className: "w-full p-0",
114
+ style: { minWidth: x },
115
+ children: /* @__PURE__ */ l(B, { children: [
116
+ /* @__PURE__ */ l("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
117
+ /* @__PURE__ */ a(W, { className: "h-9", placeholder: "Search..." }),
118
+ /* @__PURE__ */ a(j, { className: "h-7", onClick: f, children: /* @__PURE__ */ a(
119
+ K,
120
+ {
121
+ className: v(
122
+ "size-3.5 opacity-50",
123
+ r && "animate-spin"
124
+ )
125
+ }
126
+ ) })
127
+ ] }),
128
+ /* @__PURE__ */ l(q, { children: [
129
+ /* @__PURE__ */ l(z, { children: [
130
+ "No ",
131
+ s == null ? void 0 : s.toLowerCase(),
132
+ " found."
133
+ ] }),
134
+ /* @__PURE__ */ a(O, { children: C == null ? void 0 : C.map((t) => /* @__PURE__ */ a(
135
+ Q,
136
+ {
137
+ className: "overflow-x-auto",
138
+ value: t.name,
139
+ onSelect: (u) => T(u, t.id),
140
+ children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
141
+ /* @__PURE__ */ a(
142
+ G,
143
+ {
144
+ className: v(
145
+ "size-4",
146
+ i === t.id ? "opacity-100" : "opacity-0"
147
+ )
148
+ }
149
+ ),
150
+ /* @__PURE__ */ a("div", { title: t.name, children: t.name })
151
+ ] })
152
+ },
153
+ t.id
154
+ )) })
155
+ ] })
156
+ ] })
157
+ }
158
+ )
159
+ ] });
160
+ }
87
161
  export {
88
- Da as AdvancedModeToggle,
89
- x as DATE_FORMAT_VALUES,
90
- L as Dashboard,
91
- k as DashboardWC,
92
- ua as EMPTY_SELECTION,
93
- S as PivotMarkerEnum,
94
- ca as ResourceManagementPanel,
95
- Q as ResourceType,
96
- ha as ScheduleDashboard,
97
- fa as SelectComponent,
98
- h as SemaphorContextProvider,
99
- V as SemaphorDataProvider,
100
- B as SemaphorQueryClient,
101
- pa as ShareDialog,
102
- Ta as Surfboard,
103
- E as Visual,
104
- ma as VisualBadge,
105
- Ca as VisualEditingControls,
106
- ga as cleanCard,
107
- w as createSqlGenConfig,
108
- N as downloadPdf,
109
- O as fmt,
110
- W as getColumnDataType,
111
- ba as getDashbaordStateWithoutData,
112
- R as getFilterValueType,
113
- U as getFormattedTableNameForQuery,
114
- q as getQualifiedTableName,
115
- I as getSql,
116
- G as invalidateToken,
117
- H as isBooleanDataType,
118
- j as isColumnInSqlGen,
119
- z as isDateDataType,
120
- J as isNumberDataType,
121
- K as isTextDataType,
122
- X as resolveDataType,
123
- $ as resolveDatamodelName,
124
- Z as useCard,
125
- aa as useCurrentActiveCard,
126
- ea as useCurrentCardConfig,
127
- sa as useCurrentSheetActiveCards,
128
- ra as useDashboardActions,
129
- m as useDashboardStore,
130
- oa as useDataColumns,
131
- ta as useDateFilterHook,
132
- Ya as useEditorActions,
133
- na as useEditorAside,
134
- ia as useEditorStore,
135
- da as useTextFilterHook
162
+ ae as AdvancedModeToggle,
163
+ oa as CALCULATED_FIELD_ENTITY_MARKER,
164
+ ea as Combobox,
165
+ na as DATE_FORMAT_VALUES,
166
+ ta as Dashboard,
167
+ ee as DashboardExportDialog,
168
+ ia as DashboardWC,
169
+ $a as EMPTY_SELECTION,
170
+ la as PivotMarkerEnum,
171
+ Xa as ResourceManagementPanel,
172
+ da as ResourceType,
173
+ se as ScheduleDashboard,
174
+ w as SemaphorContextProvider,
175
+ ca as SemaphorDataProvider,
176
+ ua as SemaphorQueryClient,
177
+ ha as ShareDialog,
178
+ pa as Surfboard,
179
+ re as UnsavedChangesAlert,
180
+ aa as Visual,
181
+ oe as VisualEditingControls,
182
+ fa as cloneDeep,
183
+ ma as createEmptyKpiConfig,
184
+ Ca as createSqlGenConfig,
185
+ va as downloadPdf,
186
+ ba as emitDashboardLoad,
187
+ Da as emitDashboardUnload,
188
+ ya as fmt,
189
+ ga as getColumnDataType,
190
+ xa as getFilterValueType,
191
+ Ea as getFormattedTableNameForQuery,
192
+ Na as getQualifiedTableName,
193
+ Ta as getSql,
194
+ Sa as invalidateToken,
195
+ Pa as isBooleanDataType,
196
+ wa as isCalculatedDimension,
197
+ Ma as isCalculatedField,
198
+ ka as isCalculatedMetric,
199
+ Aa as isColumnInSqlGen,
200
+ Fa as isDateDataType,
201
+ La as isNumberDataType,
202
+ Ra as isTextDataType,
203
+ Ia as resolveDataType,
204
+ Va as resolveDatamodelName,
205
+ _a as useCard,
206
+ Ua as useCurrentActiveCard,
207
+ Ba as useCurrentCardConfig,
208
+ Wa as useCurrentSheetActiveCards,
209
+ ja as useDashboardActions,
210
+ qa as useDashboardQuery,
211
+ F as useDashboardStore,
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
136
219
  };