@burdenoff/microfe-bigconsole 2026.1118.6 → 2026.1118.8
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.
- package/dist/bigconsole/components/dashboard/DashboardCanvas.d.ts +2 -0
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +69 -68
- package/dist/bigconsole/components/dashboard/DashboardReviewDialog.d.ts +13 -0
- package/dist/bigconsole/components/dashboard/DashboardReviewDialog.js +136 -0
- package/dist/bigconsole/components/dashboard/DashboardToolbar.d.ts +2 -0
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +102 -89
- package/dist/bigconsole/components/dashboard/index.d.ts +1 -0
- package/dist/bigconsole/components/dashboard/index.js +2 -1
- package/dist/bigconsole/components/explore/SavedQueryWidget.d.ts +3 -1
- package/dist/bigconsole/components/explore/SavedQueryWidget.js +22 -18
- package/dist/bigconsole/components/insights/BoardLintPanel.d.ts +18 -8
- package/dist/bigconsole/components/insights/BoardLintPanel.js +52 -52
- package/dist/bigconsole/components/widgets/WidgetMenu.js +86 -75
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +221 -209
- package/dist/bigconsole/pages/DashboardViewPage.js +191 -182
- package/dist/bigconsole/utils/boardLint.d.ts +8 -0
- package/dist/bigconsole/utils/boardLint.js +4 -0
- package/dist/bigconsole/utils/savedBoardLint.d.ts +102 -0
- package/dist/bigconsole/utils/savedBoardLint.js +100 -0
- package/package.json +1 -1
|
@@ -9,37 +9,37 @@ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
|
9
9
|
import { createPortal as f } from "react-dom";
|
|
10
10
|
// src/bigconsole/components/widgets/WidgetMenu.tsx
|
|
11
11
|
var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onExportPNG: g, onSpotOutliers: _, onReconcile: v }) {
|
|
12
|
-
let [y, b] = s(!1), [x, S] = s({
|
|
12
|
+
let [y, b] = s(!1), [x, S] = s(!1), [C, w] = s({
|
|
13
13
|
top: 0,
|
|
14
14
|
left: 0
|
|
15
|
-
}),
|
|
15
|
+
}), T = o(null), E = o(null), { hasPermission: D } = c(), O = D(n.WIDGET_UPDATE), k = D(n.WIDGET_CREATE), A = D(n.WIDGET_DELETE), j = e((e) => e.selectWidget), M = e((e) => e.copyWidget), N = e((e) => e.cutWidget), P = e((e) => e.removeWidget), F = e((e) => e.openConfigPanel), { duplicateWidget: I, deleteWidget: L, refreshWidgetData: R } = t(r.pageId, r.dashboardId, { skipFetch: !0 });
|
|
16
16
|
a(() => {
|
|
17
17
|
let e = (e) => {
|
|
18
|
-
|
|
18
|
+
T.current && !T.current.contains(e.target) && E.current && !E.current.contains(e.target) && b(!1);
|
|
19
19
|
};
|
|
20
20
|
return y && document.addEventListener("mousedown", e), () => {
|
|
21
21
|
document.removeEventListener("mousedown", e);
|
|
22
22
|
};
|
|
23
23
|
}, [y]), a(() => {
|
|
24
24
|
let e = (e) => {
|
|
25
|
-
e.key === "Escape" && (b(!1),
|
|
25
|
+
e.key === "Escape" && (b(!1), E.current?.focus());
|
|
26
26
|
};
|
|
27
27
|
return y && document.addEventListener("keydown", e), () => {
|
|
28
28
|
document.removeEventListener("keydown", e);
|
|
29
29
|
};
|
|
30
30
|
}, [y]);
|
|
31
|
-
let
|
|
31
|
+
let z = i((e) => {
|
|
32
32
|
e.stopPropagation(), b((e) => {
|
|
33
|
-
if (!e &&
|
|
34
|
-
let e =
|
|
35
|
-
n + 160 > window.innerWidth - 10 && (n = window.innerWidth - 160 - 10), n < 10 && (n = 10), t + 320 > window.innerHeight - 10 && (t = e.top - 320 - 4, t < 10 && (t = 10)),
|
|
33
|
+
if (!e && E.current) {
|
|
34
|
+
let e = E.current.getBoundingClientRect(), t = e.bottom + 4, n = e.right - 160;
|
|
35
|
+
n + 160 > window.innerWidth - 10 && (n = window.innerWidth - 160 - 10), n < 10 && (n = 10), t + 320 > window.innerHeight - 10 && (t = e.top - 320 - 4, t < 10 && (t = 10)), w({
|
|
36
36
|
top: t + window.scrollY,
|
|
37
37
|
left: n + window.scrollX
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
return !e;
|
|
41
41
|
});
|
|
42
|
-
}, []),
|
|
42
|
+
}, []), B = [
|
|
43
43
|
{
|
|
44
44
|
id: "edit",
|
|
45
45
|
label: "Edit Widget",
|
|
@@ -56,10 +56,10 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
56
56
|
})
|
|
57
57
|
}),
|
|
58
58
|
action: () => {
|
|
59
|
-
|
|
59
|
+
j(r.id), F(), b(!1);
|
|
60
60
|
},
|
|
61
61
|
disabled: !p,
|
|
62
|
-
permitted:
|
|
62
|
+
permitted: O
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
id: "refresh",
|
|
@@ -77,7 +77,7 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
77
77
|
})
|
|
78
78
|
}),
|
|
79
79
|
action: async () => {
|
|
80
|
-
b(!1), m ? m() : await
|
|
80
|
+
b(!1), m ? m() : await R(r.id);
|
|
81
81
|
},
|
|
82
82
|
disabled: !1
|
|
83
83
|
},
|
|
@@ -183,10 +183,10 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
183
183
|
})
|
|
184
184
|
}),
|
|
185
185
|
action: () => {
|
|
186
|
-
|
|
186
|
+
M(r.id), b(!1);
|
|
187
187
|
},
|
|
188
188
|
disabled: !p,
|
|
189
|
-
permitted:
|
|
189
|
+
permitted: k
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
192
|
id: "cut",
|
|
@@ -204,10 +204,10 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
204
204
|
})
|
|
205
205
|
}),
|
|
206
206
|
action: () => {
|
|
207
|
-
|
|
207
|
+
N(r.id), b(!1);
|
|
208
208
|
},
|
|
209
209
|
disabled: !p,
|
|
210
|
-
permitted:
|
|
210
|
+
permitted: k && O
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
id: "duplicate",
|
|
@@ -232,10 +232,10 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
232
232
|
width: r.positionWidth ?? 4,
|
|
233
233
|
height: r.positionHeight ?? 4
|
|
234
234
|
};
|
|
235
|
-
await
|
|
235
|
+
await I(r.id, e, `${r.title} (Copy)`);
|
|
236
236
|
},
|
|
237
237
|
disabled: !p,
|
|
238
|
-
permitted:
|
|
238
|
+
permitted: k
|
|
239
239
|
},
|
|
240
240
|
{
|
|
241
241
|
id: "divider2",
|
|
@@ -260,24 +260,33 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
260
260
|
})
|
|
261
261
|
}),
|
|
262
262
|
action: async () => {
|
|
263
|
-
window.confirm("Are you sure you want to delete this widget?")
|
|
263
|
+
if (window.confirm("Are you sure you want to delete this widget?")) {
|
|
264
|
+
b(!1);
|
|
265
|
+
let e = await L(r.id);
|
|
266
|
+
r.savedQueryId ? S(!e) : e || P(r.id);
|
|
267
|
+
} else b(!1);
|
|
264
268
|
},
|
|
265
269
|
disabled: !p,
|
|
266
270
|
destructive: !0,
|
|
267
|
-
permitted:
|
|
271
|
+
permitted: A
|
|
268
272
|
}
|
|
269
|
-
].filter((e) => e.permitted !== !1),
|
|
273
|
+
].filter((e) => e.permitted !== !1 && (!r.savedQueryId || p && e.id === "delete")), V = B.filter((e, t) => {
|
|
270
274
|
if (!e.divider) return !0;
|
|
271
|
-
let n =
|
|
275
|
+
let n = B[t - 1], r = B[t + 1];
|
|
272
276
|
return n !== void 0 && r !== void 0 && !n.divider && !r.divider;
|
|
273
277
|
});
|
|
274
|
-
return /* @__PURE__ */ d("div", {
|
|
278
|
+
return V.length ? /* @__PURE__ */ d("div", {
|
|
275
279
|
className: "relative",
|
|
276
|
-
children: [
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
280
|
+
children: [
|
|
281
|
+
x && /* @__PURE__ */ u("span", {
|
|
282
|
+
role: "alert",
|
|
283
|
+
children: "Could not delete this widget."
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ u("button", {
|
|
286
|
+
ref: E,
|
|
287
|
+
type: "button",
|
|
288
|
+
onClick: z,
|
|
289
|
+
className: `
|
|
281
290
|
p-1.5 rounded-md
|
|
282
291
|
text-text-secondary
|
|
283
292
|
hover:text-text-primary
|
|
@@ -285,59 +294,61 @@ var p = r(function({ widget: r, isEditMode: p, onRefresh: m, onExportCSV: h, onE
|
|
|
285
294
|
transition-colors
|
|
286
295
|
${y ? "bg-bg-sunken" : ""}
|
|
287
296
|
`,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
className: "\n min-w-[160px]\n py-1\n bg-bg-surface\n border border-border-default\n rounded-lg shadow-lg\n ",
|
|
322
|
-
role: "menu",
|
|
323
|
-
"aria-orientation": "vertical",
|
|
324
|
-
children: z.map((e) => e.divider ? /* @__PURE__ */ u("div", { className: "my-1 border-t border-border-default" }, e.id) : /* @__PURE__ */ d("button", {
|
|
325
|
-
type: "button",
|
|
326
|
-
onClick: (t) => {
|
|
327
|
-
t.stopPropagation(), e.action();
|
|
297
|
+
title: "Widget options",
|
|
298
|
+
"aria-haspopup": "menu",
|
|
299
|
+
"aria-expanded": y,
|
|
300
|
+
children: /* @__PURE__ */ d("svg", {
|
|
301
|
+
className: "w-4 h-4",
|
|
302
|
+
fill: "currentColor",
|
|
303
|
+
viewBox: "0 0 24 24",
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ u("circle", {
|
|
306
|
+
cx: "12",
|
|
307
|
+
cy: "5",
|
|
308
|
+
r: "2"
|
|
309
|
+
}),
|
|
310
|
+
/* @__PURE__ */ u("circle", {
|
|
311
|
+
cx: "12",
|
|
312
|
+
cy: "12",
|
|
313
|
+
r: "2"
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ u("circle", {
|
|
316
|
+
cx: "12",
|
|
317
|
+
cy: "19",
|
|
318
|
+
r: "2"
|
|
319
|
+
})
|
|
320
|
+
]
|
|
321
|
+
})
|
|
322
|
+
}),
|
|
323
|
+
y && f(/* @__PURE__ */ u("div", {
|
|
324
|
+
ref: T,
|
|
325
|
+
style: {
|
|
326
|
+
position: "fixed",
|
|
327
|
+
top: C.top,
|
|
328
|
+
left: C.left,
|
|
329
|
+
zIndex: 99999
|
|
328
330
|
},
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
className: "\n min-w-[160px]\n py-1\n bg-bg-surface\n border border-border-default\n rounded-lg shadow-lg\n ",
|
|
332
|
+
role: "menu",
|
|
333
|
+
"aria-orientation": "vertical",
|
|
334
|
+
children: V.map((e) => e.divider ? /* @__PURE__ */ u("div", { className: "my-1 border-t border-border-default" }, e.id) : /* @__PURE__ */ d("button", {
|
|
335
|
+
type: "button",
|
|
336
|
+
onClick: (t) => {
|
|
337
|
+
t.stopPropagation(), e.action();
|
|
338
|
+
},
|
|
339
|
+
disabled: e.disabled,
|
|
340
|
+
className: `
|
|
331
341
|
w-full flex items-center gap-2
|
|
332
342
|
px-3 py-2 text-left text-sm
|
|
333
343
|
transition-colors
|
|
334
344
|
${e.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-bg-sunken"}
|
|
335
345
|
${e.destructive ? "text-status-error-text hover:text-status-error-text" : "text-text-primary"}
|
|
336
346
|
`,
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
347
|
+
role: "menuitem",
|
|
348
|
+
children: [e.icon, /* @__PURE__ */ u("span", { children: e.label })]
|
|
349
|
+
}, e.id))
|
|
350
|
+
}), document.body)
|
|
351
|
+
]
|
|
352
|
+
}) : null;
|
|
342
353
|
});
|
|
343
354
|
export { p as WidgetMenu, p as default };
|