@burdenoff/microfe-bigconsole 2026.615.2 → 2026.615.3

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.
@@ -3,35 +3,36 @@ import { useDashboardStore as r, useGlobalFilterValues as i } from "../../store/
3
3
  import "../../store/index.js";
4
4
  import a from "../../hooks/useWidgetData.js";
5
5
  import { getWidgetDefinition as o } from "./WidgetRegistry.js";
6
- import { formatTimeUntilRefresh as s, useWidgetAutoRefresh as c } from "../../hooks/useAutoRefresh.js";
7
- import ee from "../../hooks/useWidgetExport.js";
8
- import te from "../../hooks/useDrilldown.js";
6
+ import { formatTimeUntilRefresh as ee, useWidgetAutoRefresh as te } from "../../hooks/useAutoRefresh.js";
7
+ import ne from "../../hooks/useWidgetComments.js";
8
+ import re from "../../hooks/useWidgetExport.js";
9
+ import ie from "../../hooks/useDrilldown.js";
9
10
  import "../../hooks/index.js";
10
- import l from "./WidgetHeader.js";
11
- import u from "./states/LoadingState.js";
12
- import ne from "./states/ErrorState.js";
13
- import d from "./states/EmptyState.js";
14
- import re from "./WidgetErrorBoundary.js";
15
- import { hasCustomIframeConfig as ie, hasRenderableCustomConfig as ae } from "./custom/config.js";
16
- import oe from "../../renderers/factory/WidgetRendererFactory.js";
17
- import se from "./widget-actions/WidgetActions.js";
11
+ import ae from "./WidgetHeader.js";
12
+ import s from "./states/LoadingState.js";
13
+ import oe from "./states/ErrorState.js";
14
+ import c from "./states/EmptyState.js";
15
+ import se from "./WidgetErrorBoundary.js";
16
+ import { hasCustomIframeConfig as ce, hasRenderableCustomConfig as le } from "./custom/config.js";
17
+ import ue from "../../renderers/factory/WidgetRendererFactory.js";
18
+ import de from "./widget-actions/WidgetActions.js";
18
19
  import "./widget-actions/index.js";
19
- import { Suspense as ce, lazy as f, memo as p, useCallback as m, useEffect as h, useMemo as g, useRef as _ } from "react";
20
- import { jsx as v, jsxs as le } from "react/jsx-runtime";
20
+ import { Suspense as l, lazy as u, memo as d, useCallback as f, useEffect as fe, useMemo as p, useRef as m, useState as h } from "react";
21
+ import { jsx as g, jsxs as pe } from "react/jsx-runtime";
21
22
  //#region src/bigconsole/components/widgets/WidgetWrapper.tsx
22
- var ue = f(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), de = f(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), fe = f(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), pe = f(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), me = f(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), he = f(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), ge = f(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), _e = f(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), ve = f(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), ye = f(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), be = f(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), xe = f(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Se = f(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), Ce = f(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), we = f(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), Te = f(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget }))), Ee = f(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
23
- function y(e, t) {
23
+ var me = u(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), he = u(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), ge = u(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), _e = u(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), ve = u(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), ye = u(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), be = u(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), xe = u(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), Se = u(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Ce = u(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), we = u(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), Te = u(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Ee = u(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), De = u(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Oe = u(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), ke = u(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget }))), Ae = u(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget }))), je = u(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments })));
24
+ function _(e, t) {
24
25
  if (e.widget.id !== t.widget.id || e.widget.updatedAt !== t.widget.updatedAt || e.isLoading !== t.isLoading || e.error !== t.error || (e.actions?.length ?? 0) !== (t.actions?.length ?? 0)) return !1;
25
26
  if (e.actions && t.actions) {
26
27
  for (let n = 0; n < e.actions.length; n++) if (e.actions[n]?.id !== t.actions[n]?.id) return !1;
27
28
  }
28
29
  return !(e.data !== t.data || JSON.stringify(e.filterValues) !== JSON.stringify(t.filterValues));
29
30
  }
30
- var b = p(function({ widget: f, children: p, data: y, className: b = "", isLoading: De, error: Oe, onRefresh: x, onDrilldown: S, actions: C, onAction: w, filterValues: T }) {
31
- let E = r((e) => e.viewMode === "edit"), D = t((e) => e.selectWidget), O = e(f.id), k = n(f.id), A = i(), ke = !!f.dataSinkId || !!f.datasetId || !!f.parserId, { data: j, loading: Ae } = a(f.id, {
32
- skip: !ke,
33
- pollInterval: (f.refreshInterval ?? 0) * 1e3 || 0
34
- }), M = g(() => {
31
+ var v = d(function({ widget: u, children: d, data: _, className: v = "", isLoading: Me, error: Ne, onRefresh: y, onDrilldown: Pe, actions: b, onAction: x, filterValues: S }) {
32
+ let C = r((e) => e.viewMode === "edit"), w = t((e) => e.selectWidget), T = e(u.id), E = n(u.id), D = i(), Fe = !!u.dataSinkId || !!u.datasetId || !!u.parserId, { data: O, loading: Ie } = a(u.id, {
33
+ skip: !Fe,
34
+ pollInterval: (u.refreshInterval ?? 0) * 1e3 || 0
35
+ }), k = p(() => {
35
36
  if (typeof window > "u") return {};
36
37
  let e = new URLSearchParams(window.location.search), t = {};
37
38
  return e.forEach((e, n) => {
@@ -40,51 +41,56 @@ var b = p(function({ widget: f, children: p, data: y, className: b = "", isLoadi
40
41
  r.startsWith("__") || (t[r] = e);
41
42
  }
42
43
  }), t;
43
- }, []), N = g(() => {
44
+ }, []), A = p(() => {
44
45
  let e = {};
45
- return M && Object.keys(M).length > 0 && Object.assign(e, M), A && Object.keys(A).length > 0 && Object.assign(e, A), T && Object.keys(T).length > 0 && Object.assign(e, T), e;
46
+ return k && Object.keys(k).length > 0 && Object.assign(e, k), D && Object.keys(D).length > 0 && Object.assign(e, D), S && Object.keys(S).length > 0 && Object.assign(e, S), e;
46
47
  }, [
47
- M,
48
- A,
49
- T
50
- ]), P = Object.keys(N).length > 0, F = De ?? (Ae && !j) ?? k.isLoading, I = Oe ?? k.errorMessage, je = o(f.type), L = _(x);
51
- h(() => {
52
- L.current = x;
53
- }, [x]);
54
- let Me = m(async () => {
55
- L.current && await L.current();
56
- }, []), { timeUntilRefresh: Ne, isPaused: Pe } = c({
57
- widgetId: f.id,
58
- refreshInterval: f.refreshInterval,
59
- onRefresh: Me,
60
- enabled: !E && !!f.refreshInterval
61
- }), R = _(null), z = g(() => {
62
- if (y && Array.isArray(y)) return y;
63
- let e = f.data;
48
+ k,
49
+ D,
50
+ S
51
+ ]), j = Object.keys(A).length > 0, M = Me ?? (Ie && !O) ?? E.isLoading, N = Ne ?? E.errorMessage, Le = o(u.type), P = m(y);
52
+ fe(() => {
53
+ P.current = y;
54
+ }, [y]);
55
+ let F = f(async () => {
56
+ P.current && await P.current();
57
+ }, []), { timeUntilRefresh: Re, isPaused: ze } = te({
58
+ widgetId: u.id,
59
+ refreshInterval: u.refreshInterval,
60
+ onRefresh: F,
61
+ enabled: !C && !!u.refreshInterval
62
+ }), I = m(null), [L, R] = h(!1), [z, Be] = h(!1), { count: Ve } = ne(u.id, z), He = f(() => {
63
+ R((e) => {
64
+ let t = !e;
65
+ return t && Be(!0), t;
66
+ });
67
+ }, []), B = p(() => {
68
+ if (_ && Array.isArray(_)) return _;
69
+ let e = u.data;
64
70
  if (e?.processed && Array.isArray(e.processed)) return e.processed;
65
71
  if (e?.raw) {
66
72
  let t = typeof e.raw == "string" ? JSON.parse(e.raw) : e.raw;
67
73
  if (Array.isArray(t)) return t;
68
74
  }
69
75
  return null;
70
- }, [y, f]), { exportCSV: Fe, exportPNG: Ie } = ee(f, {
71
- data: z,
72
- containerRef: R
73
- }), B = m((e) => {
76
+ }, [_, u]), { exportCSV: Ue, exportPNG: We } = re(u, {
77
+ data: B,
78
+ containerRef: I
79
+ }), V = f((e) => {
74
80
  if (e == null) return !1;
75
81
  if (Array.isArray(e)) return e.length > 0;
76
82
  if (typeof e == "object") {
77
83
  let t = e, n = Object.keys(t);
78
84
  return n.length === 0 ? !1 : n.some((e) => {
79
85
  let n = t[e];
80
- return n == null || n === "" ? !1 : Array.isArray(n) ? n.length > 0 : typeof n == "object" ? B(n) : !0;
86
+ return n == null || n === "" ? !1 : Array.isArray(n) ? n.length > 0 : typeof n == "object" ? V(n) : !0;
81
87
  });
82
88
  }
83
89
  return !0;
84
- }, []), V = m((e) => {
85
- if (!P || !e) return e;
90
+ }, []), H = f((e) => {
91
+ if (!j || !e) return e;
86
92
  let t = {}, n = {};
87
- Object.entries(N || {}).forEach(([e, r]) => {
93
+ Object.entries(A || {}).forEach(([e, r]) => {
88
94
  if (e.startsWith("ctx_")) {
89
95
  let n = e.slice(4);
90
96
  t[n] = r;
@@ -202,116 +208,116 @@ var b = p(function({ widget: f, children: p, data: y, className: b = "", isLoadi
202
208
  }
203
209
  return e;
204
210
  }, [
205
- P,
206
- N,
207
- f.id
208
- ]), H = g(() => {
211
+ j,
212
+ A,
213
+ u.id
214
+ ]), U = p(() => {
209
215
  let e = null;
210
- if (y && B(y)) e = y;
211
- else if (j) {
212
- let t = j;
213
- if (t?.processed && B(t.processed)) e = t.processed;
216
+ if (_ && V(_)) e = _;
217
+ else if (O) {
218
+ let t = O;
219
+ if (t?.processed && V(t.processed)) e = t.processed;
214
220
  else if (t?.raw) try {
215
221
  let n = typeof t.raw == "string" ? JSON.parse(t.raw) : t.raw;
216
- B(n) && (e = n);
222
+ V(n) && (e = n);
217
223
  } catch {}
218
224
  } else {
219
- let t = f.data;
220
- if (t?.processed && B(t.processed)) e = t.processed;
225
+ let t = u.data;
226
+ if (t?.processed && V(t.processed)) e = t.processed;
221
227
  else if (t?.raw) try {
222
228
  let n = typeof t.raw == "string" ? JSON.parse(t.raw) : t.raw;
223
- B(n) && (e = n);
229
+ V(n) && (e = n);
224
230
  } catch {}
225
231
  }
226
232
  if (!e) {
227
- let t = f.config?.mockData;
233
+ let t = u.config?.mockData;
228
234
  if (t) try {
229
235
  let n = typeof t == "string" ? JSON.parse(t) : t;
230
- B(n) && (e = n);
236
+ V(n) && (e = n);
231
237
  } catch {}
232
238
  }
233
- return P && e ? V(e) : e;
239
+ return j && e ? H(e) : e;
234
240
  }, [
235
- y,
236
- f,
241
+ _,
242
+ u,
243
+ O,
237
244
  j,
238
- P,
239
- V,
240
- N,
241
- B
242
- ]), U = g(() => H ?? null, [H]), { executeDrilldown: W, canDrilldown: G } = te({ onDrilldown: (e, t) => {
243
- S?.(e);
244
- } }), K = g(() => G(f), [f, G]), q = m((e) => {
245
- if (!f.drilldown?.enabled) return;
245
+ H,
246
+ A,
247
+ V
248
+ ]), W = p(() => U ?? null, [U]), { executeDrilldown: G, canDrilldown: K } = ie({ onDrilldown: (e, t) => {
249
+ Pe?.(e);
250
+ } }), q = p(() => K(u), [u, K]), J = f((e) => {
251
+ if (!u.drilldown?.enabled) return;
246
252
  let t = {
247
253
  selectedData: e || {},
248
- globalFilters: A || {},
249
- widgetData: U || {},
254
+ globalFilters: D || {},
255
+ widgetData: W || {},
250
256
  metadata: {
251
- widgetId: f.id,
252
- widgetType: f.type,
253
- widgetTitle: f.title
257
+ widgetId: u.id,
258
+ widgetType: u.type,
259
+ widgetTitle: u.title
254
260
  },
255
- sourceDashboardId: f.dashboardId
261
+ sourceDashboardId: u.dashboardId
256
262
  };
257
- W(f.drilldown, t);
263
+ G(u.drilldown, t);
258
264
  }, [
259
- f,
260
- U,
261
- A,
262
- W
263
- ]), J = _(null), Le = m((e) => {
264
- J.current = {
265
+ u,
266
+ W,
267
+ D,
268
+ G
269
+ ]), Y = m(null), Ge = f((e) => {
270
+ Y.current = {
265
271
  x: e.clientX,
266
272
  y: e.clientY
267
273
  };
268
- }, []), Re = m((e) => {
269
- if (e.stopPropagation(), J.current) {
270
- let t = Math.abs(e.clientX - J.current.x), n = Math.abs(e.clientY - J.current.y);
274
+ }, []), Ke = f((e) => {
275
+ if (e.stopPropagation(), Y.current) {
276
+ let t = Math.abs(e.clientX - Y.current.x), n = Math.abs(e.clientY - Y.current.y);
271
277
  if (t > 5 || n > 5) {
272
- J.current = null;
278
+ Y.current = null;
273
279
  return;
274
280
  }
275
281
  }
276
- J.current = null, E && D(f.id);
282
+ Y.current = null, C && w(u.id);
277
283
  }, [
278
- E,
279
- D,
280
- f.id
281
- ]), ze = m((e) => {
282
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), E && D(f.id));
284
+ C,
285
+ w,
286
+ u.id
287
+ ]), qe = f((e) => {
288
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), C && w(u.id));
283
289
  }, [
284
- E,
285
- D,
286
- f.id
287
- ]), Be = g(() => f.type === "custom" && ae(f.config), [f.type, f.config]), Ve = g(() => f.type === "custom" && ie(f.config), [f.type, f.config]), Y = K && !Ve, He = !F && !I && !U && !Be, X = g(() => f.renderer, [f]), Z = g(() => X && X !== "BIGCONSOLE", [X]), Ue = g(() => ({
288
- widgetId: f.id,
289
- data: U || {}
290
- }), [f.id, U]), Q = m((e, t) => {
291
- if (!w) return;
292
- let n = C?.find((t) => t.name === e.name);
293
- w(n || e, t);
294
- }, [w, C]), $ = m(() => {
290
+ C,
291
+ w,
292
+ u.id
293
+ ]), Je = p(() => u.type === "custom" && le(u.config), [u.type, u.config]), Ye = p(() => u.type === "custom" && ce(u.config), [u.type, u.config]), X = q && !Ye, Xe = !M && !N && !W && !Je, Z = p(() => u.renderer, [u]), Q = p(() => Z && Z !== "BIGCONSOLE", [Z]), Ze = p(() => ({
294
+ widgetId: u.id,
295
+ data: W || {}
296
+ }), [u.id, W]), $ = f((e, t) => {
297
+ if (!x) return;
298
+ let n = b?.find((t) => t.name === e.name);
299
+ x(n || e, t);
300
+ }, [x, b]), Qe = f(() => {
295
301
  let e = {
296
- widget: f,
302
+ widget: u,
297
303
  data: (() => {
298
- if (!U) return U;
299
- if (f.type === "table" || f.type === "pivot_table") {
300
- if (Array.isArray(U)) return U;
301
- if (U && typeof U == "object" && "rows" in U) return U.rows;
304
+ if (!W) return W;
305
+ if (u.type === "table" || u.type === "pivot_table") {
306
+ if (Array.isArray(W)) return W;
307
+ if (W && typeof W == "object" && "rows" in W) return W.rows;
302
308
  }
303
- if (f.type === "list") {
304
- if (Array.isArray(U)) return U;
305
- if (U && typeof U == "object" && "items" in U) return U.items;
309
+ if (u.type === "list") {
310
+ if (Array.isArray(W)) return W;
311
+ if (W && typeof W == "object" && "items" in W) return W.items;
306
312
  }
307
- if (f.type === "funnel_chart") {
308
- if (Array.isArray(U)) return U;
309
- if (U && typeof U == "object" && "stages" in U) return U.stages;
313
+ if (u.type === "funnel_chart") {
314
+ if (Array.isArray(W)) return W;
315
+ if (W && typeof W == "object" && "stages" in W) return W.stages;
310
316
  }
311
- if (f.type === "chart") {
312
- if (Array.isArray(U)) return U;
313
- if (U && typeof U == "object" && "datasets" in U) {
314
- let e = U;
317
+ if (u.type === "chart") {
318
+ if (Array.isArray(W)) return W;
319
+ if (W && typeof W == "object" && "datasets" in W) {
320
+ let e = W;
315
321
  if (e.labels && e.datasets) return e.labels.map((t, n) => {
316
322
  let r = { name: t };
317
323
  return e.datasets?.forEach((e) => {
@@ -320,8 +326,8 @@ var b = p(function({ widget: f, children: p, data: y, className: b = "", isLoadi
320
326
  });
321
327
  }
322
328
  }
323
- if (f.type === "text" && U && typeof U == "object" && !("content" in U)) {
324
- let e = U, t = [];
329
+ if (u.type === "text" && W && typeof W == "object" && !("content" in W)) {
330
+ let e = W, t = [];
325
331
  for (let [n, r] of Object.entries(e)) if (r && typeof r == "object" && !Array.isArray(r)) {
326
332
  t.push(`### ${n}`);
327
333
  for (let [e, n] of Object.entries(r)) t.push(`- **${e}:** ${n}`);
@@ -336,181 +342,191 @@ var b = p(function({ widget: f, children: p, data: y, className: b = "", isLoadi
336
342
  format: "markdown"
337
343
  };
338
344
  }
339
- if (f.type === "custom") {
340
- let e = f.config?.valueField;
341
- if (e && U && typeof U == "object" && !Array.isArray(U)) {
342
- let t = U;
345
+ if (u.type === "custom") {
346
+ let e = u.config?.valueField;
347
+ if (e && W && typeof W == "object" && !Array.isArray(W)) {
348
+ let t = W;
343
349
  if (e in t) return {
344
350
  value: t[e],
345
- label: f.title,
351
+ label: u.title,
346
352
  data: t
347
353
  };
348
354
  }
349
355
  }
350
- return U;
356
+ return W;
351
357
  })(),
352
- onDrilldown: K ? q : void 0
358
+ onDrilldown: q ? J : void 0
353
359
  };
354
- if (Z) {
360
+ if (Q) {
355
361
  let e = {};
356
- if (H && typeof H == "object" && !Array.isArray(H) && Object.keys(H).length > 0 && (e = { ...H }), f.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
357
- let t = f.config?.valueField;
362
+ if (U && typeof U == "object" && !Array.isArray(U) && Object.keys(U).length > 0 && (e = { ...U }), u.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
363
+ let t = u.config?.valueField;
358
364
  if (t && t in e) {
359
365
  let n = e[t], r = typeof n == "number" ? n.toLocaleString() : String(n);
360
366
  e = {
361
367
  ...e,
362
368
  value: n,
363
369
  title: e.title || r,
364
- description: e.description || f.title || "",
370
+ description: e.description || u.title || "",
365
371
  text: e.text || r
366
372
  };
367
373
  }
368
374
  }
369
- return /* @__PURE__ */ v(oe, {
370
- widget: f,
375
+ return /* @__PURE__ */ g(ue, {
376
+ widget: u,
371
377
  data: e,
372
- isEditMode: E,
373
- isSelected: O,
374
- isLoading: F,
375
- error: I,
376
- onDrilldown: K ? q : void 0,
377
- onAction: Q
378
+ isEditMode: C,
379
+ isSelected: T,
380
+ isLoading: M,
381
+ error: N,
382
+ onDrilldown: q ? J : void 0,
383
+ onAction: $
378
384
  });
379
385
  }
380
- switch (f.type?.toLowerCase() || "") {
381
- case "metric_card": return /* @__PURE__ */ v(ue, { ...e });
382
- case "kpi_card_comparison": return /* @__PURE__ */ v(xe, { ...e });
386
+ switch (u.type?.toLowerCase() || "") {
387
+ case "metric_card": return /* @__PURE__ */ g(me, { ...e });
388
+ case "kpi_card_comparison": return /* @__PURE__ */ g(Te, { ...e });
383
389
  case "chart":
384
- case "funnel_chart": return /* @__PURE__ */ v(de, { ...e });
385
- case "table": return /* @__PURE__ */ v(fe, { ...e });
386
- case "pivot_table": return /* @__PURE__ */ v(pe, { ...e });
387
- case "gauge": return /* @__PURE__ */ v(me, { ...e });
388
- case "progress": return /* @__PURE__ */ v(he, { ...e });
389
- case "list": return /* @__PURE__ */ v(ge, { ...e });
390
- case "heatmap": return /* @__PURE__ */ v(_e, { ...e });
391
- case "calendar": return /* @__PURE__ */ v(ve, { ...e });
392
- case "timeline": return /* @__PURE__ */ v(be, { ...e });
393
- case "kanban": return /* @__PURE__ */ v(ye, { ...e });
394
- case "form": return /* @__PURE__ */ v(Ee, { ...e });
395
- case "text": return /* @__PURE__ */ v(Se, { ...e });
396
- case "iframe": return /* @__PURE__ */ v(we, { ...e });
397
- case "map": return /* @__PURE__ */ v(Ce, { ...e });
398
- case "custom": return /* @__PURE__ */ v(Te, { ...e });
399
- default: return p || /* @__PURE__ */ v(d, { widgetType: f.type });
390
+ case "funnel_chart": return /* @__PURE__ */ g(he, { ...e });
391
+ case "table": return /* @__PURE__ */ g(ge, { ...e });
392
+ case "pivot_table": return /* @__PURE__ */ g(_e, { ...e });
393
+ case "gauge": return /* @__PURE__ */ g(ve, { ...e });
394
+ case "progress": return /* @__PURE__ */ g(ye, { ...e });
395
+ case "list": return /* @__PURE__ */ g(be, { ...e });
396
+ case "heatmap": return /* @__PURE__ */ g(xe, { ...e });
397
+ case "calendar": return /* @__PURE__ */ g(Se, { ...e });
398
+ case "timeline": return /* @__PURE__ */ g(we, { ...e });
399
+ case "kanban": return /* @__PURE__ */ g(Ce, { ...e });
400
+ case "form": return /* @__PURE__ */ g(Ae, { ...e });
401
+ case "text": return /* @__PURE__ */ g(Ee, { ...e });
402
+ case "iframe": return /* @__PURE__ */ g(Oe, { ...e });
403
+ case "map": return /* @__PURE__ */ g(De, { ...e });
404
+ case "custom": return /* @__PURE__ */ g(ke, { ...e });
405
+ default: return d || /* @__PURE__ */ g(c, { widgetType: u.type });
400
406
  }
401
407
  }, [
402
- f,
403
- U,
404
- p,
405
- K,
408
+ u,
409
+ W,
410
+ d,
406
411
  q,
407
- Z,
408
- E,
409
- O,
410
- F,
411
- I,
412
+ J,
412
413
  Q,
413
- H
414
+ C,
415
+ T,
416
+ M,
417
+ N,
418
+ $,
419
+ U
414
420
  ]);
415
- return /* @__PURE__ */ le("div", {
416
- ref: R,
421
+ return /* @__PURE__ */ pe("div", {
422
+ ref: I,
417
423
  className: `
418
424
  group relative flex flex-col
419
425
  h-full w-full
420
426
  rounded-lg border
421
427
  bg-bg-surface
422
428
  transition-all duration-200
423
- ${O && E ? "border-action-primary-border ring-2 ring-action-primary-border/30" : "border-border-default hover:border-action-primary-bg"}
424
- ${E ? "cursor-pointer" : ""}
425
- ${b}
429
+ ${T && C ? "border-action-primary-border ring-2 ring-action-primary-border/30" : "border-border-default hover:border-action-primary-bg"}
430
+ ${C ? "cursor-pointer" : ""}
431
+ ${v}
426
432
  `,
427
- onMouseDown: Le,
428
- onClick: Re,
429
- onKeyDown: ze,
430
- tabIndex: E ? 0 : -1,
431
- role: E ? "button" : void 0,
432
- "aria-selected": O,
433
- "aria-label": `Widget: ${f.title}`,
434
- "data-widget-id": f.id,
435
- "data-widget-type": f.type,
433
+ onMouseDown: Ge,
434
+ onClick: Ke,
435
+ onKeyDown: qe,
436
+ tabIndex: C ? 0 : -1,
437
+ role: C ? "button" : void 0,
438
+ "aria-selected": T,
439
+ "aria-label": `Widget: ${u.title}`,
440
+ "data-widget-id": u.id,
441
+ "data-widget-type": u.type,
436
442
  children: [
437
- /* @__PURE__ */ v(l, {
438
- widget: f,
439
- definition: je,
440
- isSelected: O,
441
- isEditMode: E,
442
- isLoading: F,
443
- timeUntilRefresh: f.refreshInterval && !Pe ? s(Ne) : void 0,
444
- hasDrilldown: K,
445
- onRefresh: x,
446
- onExportCSV: z ? Fe : void 0,
447
- onExportPNG: Ie,
448
- onDrilldown: K ? () => q() : void 0
443
+ /* @__PURE__ */ g(ae, {
444
+ widget: u,
445
+ definition: Le,
446
+ isSelected: T,
447
+ isEditMode: C,
448
+ isLoading: M,
449
+ timeUntilRefresh: u.refreshInterval && !ze ? ee(Re) : void 0,
450
+ hasDrilldown: q,
451
+ onRefresh: y,
452
+ onExportCSV: B ? Ue : void 0,
453
+ onExportPNG: We,
454
+ onDrilldown: q ? () => J() : void 0,
455
+ onToggleComments: He,
456
+ commentsOpen: L,
457
+ commentCount: z ? Ve : void 0
449
458
  }),
450
- /* @__PURE__ */ v("div", {
459
+ /* @__PURE__ */ g("div", {
451
460
  className: `
452
461
  flex-1 overflow-hidden p-4 min-h-0
453
- ${Y && !E ? "cursor-pointer" : ""}
462
+ ${X && !C ? "cursor-pointer" : ""}
454
463
  `,
455
- title: Y && !E ? "Click data to drill down" : void 0,
456
- children: /* @__PURE__ */ v("div", {
464
+ title: X && !C ? "Click data to drill down" : void 0,
465
+ children: /* @__PURE__ */ g("div", {
457
466
  className: "h-full overflow-auto",
458
467
  children: (() => {
459
- if (F) return /* @__PURE__ */ v(u, {});
460
- if (I) return /* @__PURE__ */ v(ne, {
461
- error: I,
462
- onRetry: x
468
+ if (M) return /* @__PURE__ */ g(s, {});
469
+ if (N) return /* @__PURE__ */ g(oe, {
470
+ error: N,
471
+ onRetry: y
463
472
  });
464
- if (He && !p) return /* @__PURE__ */ v(d, {
465
- widgetType: f.type,
466
- hasDataSource: !!f.parserId || !!f.dataSinkId
473
+ if (Xe && !d) return /* @__PURE__ */ g(c, {
474
+ widgetType: u.type,
475
+ hasDataSource: !!u.parserId || !!u.dataSinkId
467
476
  });
468
- let e = `${f.parserId ?? ""}|${f.dataSinkId ?? ""}|${f.updatedAt ?? ""}`;
469
- return /* @__PURE__ */ v(re, {
470
- widgetId: f.id,
471
- widgetType: f.type,
472
- widgetTitle: f.title,
477
+ let e = `${u.parserId ?? ""}|${u.dataSinkId ?? ""}|${u.updatedAt ?? ""}`;
478
+ return /* @__PURE__ */ g(se, {
479
+ widgetId: u.id,
480
+ widgetType: u.type,
481
+ widgetTitle: u.title,
473
482
  resetKey: e,
474
- children: p ?? /* @__PURE__ */ v(ce, {
475
- fallback: /* @__PURE__ */ v(u, {}),
476
- children: $()
483
+ children: d ?? /* @__PURE__ */ g(l, {
484
+ fallback: /* @__PURE__ */ g(s, {}),
485
+ children: Qe()
477
486
  })
478
487
  });
479
488
  })()
480
489
  })
481
490
  }),
482
- C && C.length > 0 && !F && !I && /* @__PURE__ */ v("div", {
491
+ b && b.length > 0 && !M && !N && /* @__PURE__ */ g("div", {
483
492
  className: "px-4 py-3 border-t border-border-default bg-bg-muted",
484
493
  style: { flexShrink: 0 },
485
- children: /* @__PURE__ */ v(se, {
486
- actions: C,
487
- context: Ue,
488
- onAction: w,
489
- disabled: E,
494
+ children: /* @__PURE__ */ g(de, {
495
+ actions: b,
496
+ context: Ze,
497
+ onAction: x,
498
+ disabled: C,
490
499
  layout: "horizontal",
491
500
  size: "sm"
492
501
  })
493
502
  }),
494
- Y && !E && /* @__PURE__ */ v("div", {
503
+ X && !C && /* @__PURE__ */ g("div", {
495
504
  className: "\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n ",
496
505
  title: "Click to drill down",
497
- children: /* @__PURE__ */ v("svg", {
506
+ children: /* @__PURE__ */ g("svg", {
498
507
  className: "w-4 h-4 text-text-secondary",
499
508
  fill: "none",
500
509
  stroke: "currentColor",
501
510
  viewBox: "0 0 24 24",
502
- children: /* @__PURE__ */ v("path", {
511
+ children: /* @__PURE__ */ g("path", {
503
512
  strokeLinecap: "round",
504
513
  strokeLinejoin: "round",
505
514
  strokeWidth: 2,
506
515
  d: "M13 7l5 5m0 0l-5 5m5-5H6"
507
516
  })
508
517
  })
518
+ }),
519
+ L && /* @__PURE__ */ g(l, {
520
+ fallback: null,
521
+ children: /* @__PURE__ */ g(je, {
522
+ widgetId: u.id,
523
+ onClose: () => R(!1)
524
+ })
509
525
  })
510
526
  ]
511
527
  });
512
- }, y);
528
+ }, _);
513
529
  //#endregion
514
- export { b as default };
530
+ export { v as default };
515
531
 
516
532
  //# sourceMappingURL=WidgetWrapper.js.map