@burdenoff/microfe-bigconsole 2026.825.1 → 2026.827.1
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/builder/inspector/LayoutSection.js +71 -0
- package/dist/bigconsole/components/builder/inspector/LayoutSection.js.map +1 -0
- package/dist/bigconsole/components/builder/inspector/index.js +1 -0
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +137 -121
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
- package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js +204 -93
- package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +259 -133
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/StoreTemplatePicker.js +87 -39
- package/dist/bigconsole/components/dashboard/StoreTemplatePicker.js.map +1 -1
- package/dist/bigconsole/components/datasink/DataSinkCard.js +88 -68
- package/dist/bigconsole/components/datasink/DataSinkCard.js.map +1 -1
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +213 -199
- package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
- package/dist/bigconsole/components/workflow/WorkflowCard.js +46 -27
- package/dist/bigconsole/components/workflow/WorkflowCard.js.map +1 -1
- package/dist/bigconsole/hooks/useDashboardOperations.js +74 -64
- package/dist/bigconsole/hooks/useDashboardOperations.js.map +1 -1
- package/dist/bigconsole/pages/DashboardBuilderPage.js +1 -1
- package/dist/bigconsole/pages/DashboardsPage.js +386 -316
- package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
- package/dist/bigconsole/pages/DataSinksPage.js +251 -206
- package/dist/bigconsole/pages/DataSinksPage.js.map +1 -1
- package/dist/bigconsole/pages/InsightsPage.js +646 -378
- package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
- package/dist/bigconsole/pages/WorkflowsPage.js +153 -108
- package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
- package/dist/bigconsole/utils/format.js +18 -0
- package/dist/bigconsole/utils/format.js.map +1 -0
- package/dist/bigconsole/utils/widgetPositioning.js +1 -1
- package/dist/generated/wspace-operations.js +1 -0
- package/dist/generated/wspace-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Section as e } from "../../common/Section.js";
|
|
2
|
+
import "../../common/index.js";
|
|
3
|
+
import { memo as t, useCallback as n } from "react";
|
|
4
|
+
import { Input as r } from "@burdenoff/fe-libs/ui";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/bigconsole/components/builder/inspector/LayoutSection.tsx
|
|
7
|
+
var o = {
|
|
8
|
+
x: "Column (X)",
|
|
9
|
+
y: "Row (Y)",
|
|
10
|
+
width: "Width",
|
|
11
|
+
height: "Height"
|
|
12
|
+
}, s = t(function({ position: t, columns: s, onChange: c }) {
|
|
13
|
+
let l = n((e, n) => {
|
|
14
|
+
let r = Number.parseInt(n, 10);
|
|
15
|
+
if (Number.isNaN(r)) return;
|
|
16
|
+
let i = {
|
|
17
|
+
...t,
|
|
18
|
+
[e]: r
|
|
19
|
+
};
|
|
20
|
+
i.width = Math.min(Math.max(i.width, 1), s), i.x = Math.min(Math.max(i.x, 0), Math.max(s - i.width, 0)), i.height = Math.max(i.height, 1), i.y = Math.max(i.y, 0), !(i.x === t.x && i.y === t.y && i.width === t.width && i.height === t.height) && c(i);
|
|
21
|
+
}, [
|
|
22
|
+
s,
|
|
23
|
+
c,
|
|
24
|
+
t
|
|
25
|
+
]), u = [
|
|
26
|
+
{
|
|
27
|
+
field: "x",
|
|
28
|
+
min: 0,
|
|
29
|
+
max: Math.max(s - t.width, 0)
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
field: "y",
|
|
33
|
+
min: 0
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
field: "width",
|
|
37
|
+
min: 1,
|
|
38
|
+
max: s
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
field: "height",
|
|
42
|
+
min: 1
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
return /* @__PURE__ */ i(e, {
|
|
46
|
+
title: "Position & size",
|
|
47
|
+
description: `Grid placement on the ${s}-column board. Saved with the dashboard.`,
|
|
48
|
+
"data-testid": "widget-inspector-layout",
|
|
49
|
+
children: /* @__PURE__ */ i("div", {
|
|
50
|
+
className: "grid grid-cols-2 gap-form-gap",
|
|
51
|
+
children: u.map(({ field: e, min: n, max: s }) => /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("label", {
|
|
52
|
+
htmlFor: `widget-inspector-position-${e}`,
|
|
53
|
+
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
54
|
+
children: o[e]
|
|
55
|
+
}), /* @__PURE__ */ i(r, {
|
|
56
|
+
id: `widget-inspector-position-${e}`,
|
|
57
|
+
type: "number",
|
|
58
|
+
inputMode: "numeric",
|
|
59
|
+
value: t[e],
|
|
60
|
+
min: n,
|
|
61
|
+
max: s,
|
|
62
|
+
onChange: (t) => l(e, t.target.value),
|
|
63
|
+
className: "h-control-md text-sm"
|
|
64
|
+
})] }, e))
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
//#endregion
|
|
69
|
+
export { s as default };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=LayoutSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutSection.js","names":[],"sources":["../../../../../src/bigconsole/components/builder/inspector/LayoutSection.tsx"],"sourcesContent":["import { type FC, memo, useCallback } from 'react';\nimport { Input } from '@burdenoff/fe-libs/ui';\nimport { Section } from '../../common';\nimport type { WidgetPosition } from '../../../utils/widgetPositioning';\n\nexport interface LayoutSectionProps {\n /** Current grid placement of the selected widget. */\n position: WidgetPosition;\n /** Columns in the board's grid — the ceiling for `x + width`. */\n columns: number;\n /** Commit a new placement. The caller persists it with the dashboard. */\n onChange: (position: WidgetPosition) => void;\n}\n\n/** Which of the four numbers an input edits. */\ntype PositionField = keyof WidgetPosition;\n\nconst FIELD_LABELS: Record<PositionField, string> = {\n x: 'Column (X)',\n y: 'Row (Y)',\n width: 'Width',\n height: 'Height',\n};\n\n/**\n * Numeric grid placement for the selected widget.\n *\n * Drag-and-resize on the canvas is the only way a widget could be placed until\n * now, which makes precise alignment guesswork and leaves keyboard-only users\n * with no way to move a widget at all. The four numbers here are the SAME ones\n * the canvas writes (`Widget.position` / `positionX|Y|Width|Height`), committed\n * through the same store action, so the board and this panel can never disagree\n * and the dashboard's Save persists them exactly as a drag would.\n *\n * The mockup also shows Min W / Min H fields. Those are deliberately absent:\n * `WidgetPosition` on the service carries only x/y/width/height, so a minimum\n * would have nowhere to be stored and would silently reset on reload.\n */\nexport const LayoutSection: FC<LayoutSectionProps> = memo(function LayoutSection({ position, columns, onChange }) {\n const labelClassName = 'mb-1 block text-sm font-medium text-text-primary';\n\n const commit = useCallback(\n (field: PositionField, raw: string) => {\n const parsed = Number.parseInt(raw, 10);\n if (Number.isNaN(parsed)) return;\n\n const next: WidgetPosition = { ...position, [field]: parsed };\n\n // Clamp to a placement the grid can actually hold. Letting a widget be\n // 0 columns wide, or start past the last column, produces a widget that\n // renders nowhere — an input that appears to work and then loses content.\n next.width = Math.min(Math.max(next.width, 1), columns);\n next.x = Math.min(Math.max(next.x, 0), Math.max(columns - next.width, 0));\n next.height = Math.max(next.height, 1);\n next.y = Math.max(next.y, 0);\n\n if (\n next.x === position.x &&\n next.y === position.y &&\n next.width === position.width &&\n next.height === position.height\n ) {\n return;\n }\n\n onChange(next);\n },\n [columns, onChange, position]\n );\n\n const fields: Array<{ field: PositionField; min: number; max?: number }> = [\n { field: 'x', min: 0, max: Math.max(columns - position.width, 0) },\n { field: 'y', min: 0 },\n { field: 'width', min: 1, max: columns },\n { field: 'height', min: 1 },\n ];\n\n return (\n <Section\n title=\"Position & size\"\n description={`Grid placement on the ${columns}-column board. Saved with the dashboard.`}\n data-testid=\"widget-inspector-layout\"\n >\n <div className=\"grid grid-cols-2 gap-form-gap\">\n {fields.map(({ field, min, max }) => (\n <div key={field}>\n <label htmlFor={`widget-inspector-position-${field}`} className={labelClassName}>\n {FIELD_LABELS[field]}\n </label>\n <Input\n id={`widget-inspector-position-${field}`}\n type=\"number\"\n inputMode=\"numeric\"\n value={position[field]}\n min={min}\n max={max}\n onChange={(event) => commit(field, event.target.value)}\n className=\"h-control-md text-sm\"\n />\n </div>\n ))}\n </div>\n </Section>\n );\n});\n\nexport default LayoutSection;\n"],"mappings":";;;;;;AAiBA,IAAM,IAA8C;CAClD,GAAG;CACH,GAAG;CACH,OAAO;CACP,QAAQ;CACT,EAgBY,IAAwC,EAAK,SAAuB,EAAE,aAAU,YAAS,eAAY;CAChH,IAEM,IAAS,GACZ,GAAsB,MAAgB;EACrC,IAAM,IAAS,OAAO,SAAS,GAAK,GAAG;AACvC,MAAI,OAAO,MAAM,EAAO,CAAE;EAE1B,IAAM,IAAuB;GAAE,GAAG;IAAW,IAAQ;GAAQ;AAK7D,IAAK,QAAQ,KAAK,IAAI,KAAK,IAAI,EAAK,OAAO,EAAE,EAAE,EAAQ,EACvD,EAAK,IAAI,KAAK,IAAI,KAAK,IAAI,EAAK,GAAG,EAAE,EAAE,KAAK,IAAI,IAAU,EAAK,OAAO,EAAE,CAAC,EACzE,EAAK,SAAS,KAAK,IAAI,EAAK,QAAQ,EAAE,EACtC,EAAK,IAAI,KAAK,IAAI,EAAK,GAAG,EAAE,EAG1B,IAAK,MAAM,EAAS,KACpB,EAAK,MAAM,EAAS,KACpB,EAAK,UAAU,EAAS,SACxB,EAAK,WAAW,EAAS,WAK3B,EAAS,EAAK;IAEhB;EAAC;EAAS;EAAU;EAAS,CAC9B,EAEK,IAAqE;EACzE;GAAE,OAAO;GAAK,KAAK;GAAG,KAAK,KAAK,IAAI,IAAU,EAAS,OAAO,EAAE;GAAE;EAClE;GAAE,OAAO;GAAK,KAAK;GAAG;EACtB;GAAE,OAAO;GAAS,KAAK;GAAG,KAAK;GAAS;EACxC;GAAE,OAAO;GAAU,KAAK;GAAG;EAC5B;AAED,QACE,kBAAC,GAAD;EACE,OAAM;EACN,aAAa,yBAAyB,EAAQ;EAC9C,eAAY;YAEZ,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAO,KAAK,EAAE,UAAO,QAAK,aACzB,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;IAAO,SAAS,6BAA6B;IAAS,WAAW;cAC9D,EAAa;IACR,CAAA,EACR,kBAAC,GAAD;IACE,IAAI,6BAA6B;IACjC,MAAK;IACL,WAAU;IACV,OAAO,EAAS;IACX;IACA;IACL,WAAW,MAAU,EAAO,GAAO,EAAM,OAAO,MAAM;IACtD,WAAU;IACV,CAAA,CACE,EAAA,EAdI,EAcJ,CACN;GACE,CAAA;EACE,CAAA;EAEZ"}
|
|
@@ -10,50 +10,63 @@ import "../../context/index.js";
|
|
|
10
10
|
import { getWidgetDefinition as a } from "../widgets/WidgetRegistry.js";
|
|
11
11
|
import o from "../../hooks/useWidgetCatalog.js";
|
|
12
12
|
import s from "../../hooks/useWidgetOperations.js";
|
|
13
|
-
import c from "../../hooks/
|
|
14
|
-
import
|
|
15
|
-
import u from "
|
|
16
|
-
import d from "
|
|
17
|
-
import ee from "./
|
|
13
|
+
import c from "../../hooks/useDashboardOperations.js";
|
|
14
|
+
import l from "../../hooks/useDashboardImageExport.js";
|
|
15
|
+
import { BIGCONSOLE_PERMISSIONS as u } from "../../../constants/permissions.js";
|
|
16
|
+
import { useInstalledWidgets as d } from "../../hooks/useInstalledWidgets.js";
|
|
17
|
+
import ee from "./DashboardGrid.js";
|
|
18
|
+
import te from "./DashboardToolbar.js";
|
|
19
|
+
import ne from "./GlobalFiltersBar/GlobalFiltersBar.js";
|
|
18
20
|
import "./GlobalFiltersBar/index.js";
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
21
|
+
import re from "./LiveBoardBanner.js";
|
|
22
|
+
import ie from "./TemplateSetupBanner.js";
|
|
23
|
+
import ae from "./PageTabsManager/PageTabsManager.js";
|
|
22
24
|
import "./PageTabsManager/index.js";
|
|
23
|
-
import
|
|
25
|
+
import oe from "./ShareDialog/ShareDialog.js";
|
|
24
26
|
import "./ShareDialog/index.js";
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
+
import se from "./WidgetPalette.js";
|
|
28
|
+
import { calculatePositionFromDrop as ce, findNextAvailablePosition as le } from "../../utils/widgetPositioning.js";
|
|
29
|
+
import { WidgetInspector as ue } from "../builder/WidgetInspector.js";
|
|
27
30
|
import "../builder/index.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { Plus as
|
|
31
|
-
import { useI18n as
|
|
31
|
+
import { memo as f, useCallback as p, useEffect as de, useMemo as fe, useRef as m, useState as h } from "react";
|
|
32
|
+
import { usePermissions as pe } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
33
|
+
import { Plus as me } from "lucide-react";
|
|
34
|
+
import { useI18n as he } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
32
35
|
import { Button as g } from "@burdenoff/fe-libs/ui";
|
|
33
36
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
34
37
|
//#region src/bigconsole/components/dashboard/DashboardCanvas.tsx
|
|
35
|
-
var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste:
|
|
36
|
-
let { t: C } =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: ge, onSave: _e, isSaving: ve = !1, onExport: ye, onPublishTemplate: be, pages: x = [], activePageId: xe, onPageChange: Se, onPagesReorder: S, onPageAdd: Ce, onPageRename: we, onPageDuplicate: Te, onPageDelete: Ee, showFilters: De = !0, showPageTabs: Oe = !0, enableCrossFilter: ke = !0 }) {
|
|
39
|
+
let { t: C } = he(), w = m(null), T = m(null), [E, Ae] = h(1200), [je, D] = h(!1), [O, k] = h(null), [A, j] = h(!1), [Me, M] = h(null), [N, Ne] = h(null), P = t((e) => e.viewMode === "edit"), F = t((e) => e.currentDashboard), { updateDashboard: I } = c({ skipFetch: !0 }), { hasPermission: Pe } = pe(), Fe = Pe(u.DASHBOARD_UPDATE), Ie = N?.id === f ? N.value : F?.id === f ? F.visibility : void 0, Le = p(async (e) => {
|
|
40
|
+
let t = await I({
|
|
41
|
+
id: f,
|
|
42
|
+
visibility: e
|
|
43
|
+
});
|
|
44
|
+
if (!t) throw Error("The dashboard service did not accept the change.");
|
|
45
|
+
Ne({
|
|
46
|
+
id: f,
|
|
47
|
+
value: t.visibility ?? e
|
|
48
|
+
});
|
|
49
|
+
}, [f, I]), { workspaceId: L, apiGatewayUrl: R, authToken: z } = i(), { installedWidgets: Re, loading: ze } = d({
|
|
50
|
+
workspaceId: L,
|
|
51
|
+
apiGatewayUrl: R,
|
|
52
|
+
authToken: z,
|
|
53
|
+
enabled: P
|
|
54
|
+
}), { definitions: Be } = o({
|
|
55
|
+
workspaceId: L,
|
|
56
|
+
apiGatewayUrl: R,
|
|
57
|
+
authToken: z,
|
|
58
|
+
enabled: P
|
|
59
|
+
}), B = t((e) => e.zoomLevel), V = t((e) => e.sidebarCollapsed), H = t((e) => e.toggleSidebar), U = !V, W = t((e) => e.setGlobalFilterValues), Ve = p((e) => {
|
|
60
|
+
W(e);
|
|
61
|
+
}, [W]), { createWidget: G } = s(y, f, { skipFetch: !0 }), K = e((e) => e.widgets), q = fe(() => {
|
|
62
|
+
let e = Array.from(K.values());
|
|
50
63
|
return y ? e.filter((e) => e.pageId === y) : e;
|
|
51
|
-
}, [
|
|
52
|
-
|
|
64
|
+
}, [K, y]), He = e((e) => e.selectedWidgetId), J = e((e) => e.selectWidget), Y = e((e) => e.addWidget), X = e((e) => e.updateWidgetPosition), Z = e((e) => e.configPanelOpen), Ue = e((e) => e.closeConfigPanel);
|
|
65
|
+
de(() => {
|
|
53
66
|
let e = w.current;
|
|
54
67
|
if (!e) return;
|
|
55
68
|
let t = () => {
|
|
56
|
-
|
|
69
|
+
Ae(e.offsetWidth);
|
|
57
70
|
};
|
|
58
71
|
if (t(), typeof ResizeObserver < "u") {
|
|
59
72
|
let n = new ResizeObserver(t);
|
|
@@ -61,18 +74,18 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
61
74
|
}
|
|
62
75
|
return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
|
|
63
76
|
}, []);
|
|
64
|
-
let
|
|
77
|
+
let We = p((e) => {
|
|
65
78
|
e.forEach((e) => {
|
|
66
|
-
|
|
79
|
+
X(e.i, {
|
|
67
80
|
x: e.x,
|
|
68
81
|
y: e.y,
|
|
69
82
|
width: e.w,
|
|
70
83
|
height: e.h
|
|
71
84
|
});
|
|
72
85
|
});
|
|
73
|
-
}, [
|
|
74
|
-
|
|
75
|
-
}, [
|
|
86
|
+
}, [X]), Ge = p((e) => {
|
|
87
|
+
J(e);
|
|
88
|
+
}, [J]), Q = p(async (e, t) => {
|
|
76
89
|
k(null);
|
|
77
90
|
let n = t?.definition || (e.type ? a(e.type) : null), r = {
|
|
78
91
|
width: n?.defaultSize?.width ?? 4,
|
|
@@ -80,7 +93,7 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
80
93
|
}, i;
|
|
81
94
|
if (t?.position) i = t.position;
|
|
82
95
|
else {
|
|
83
|
-
let { x: e, y: t } =
|
|
96
|
+
let { x: e, y: t } = le(q, r, { cols: 12 });
|
|
84
97
|
i = {
|
|
85
98
|
x: e,
|
|
86
99
|
y: t,
|
|
@@ -90,7 +103,7 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
90
103
|
}
|
|
91
104
|
let o = e;
|
|
92
105
|
if (y) {
|
|
93
|
-
let t = await
|
|
106
|
+
let t = await G({
|
|
94
107
|
pageId: y,
|
|
95
108
|
dashboardId: f,
|
|
96
109
|
type: e.type,
|
|
@@ -105,7 +118,7 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
105
118
|
parserId: o.parserId
|
|
106
119
|
});
|
|
107
120
|
if (t) {
|
|
108
|
-
|
|
121
|
+
J(t.id);
|
|
109
122
|
return;
|
|
110
123
|
}
|
|
111
124
|
k(C("bigconsole.dashboards.canvas.widgetCreateError", "Could not create the widget. Check the connection and try again."));
|
|
@@ -133,20 +146,20 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
133
146
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
134
147
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
135
148
|
};
|
|
136
|
-
|
|
149
|
+
Y(s), J(s.id);
|
|
137
150
|
}, [
|
|
138
151
|
f,
|
|
139
152
|
y,
|
|
140
|
-
H,
|
|
141
|
-
K,
|
|
142
153
|
G,
|
|
143
|
-
|
|
154
|
+
Y,
|
|
155
|
+
J,
|
|
156
|
+
q,
|
|
144
157
|
C
|
|
145
|
-
]),
|
|
158
|
+
]), Ke = p((e) => {
|
|
146
159
|
j(!0), M(e);
|
|
147
|
-
}, []),
|
|
160
|
+
}, []), qe = p(() => {
|
|
148
161
|
j(!1), M(null);
|
|
149
|
-
}, []),
|
|
162
|
+
}, []), Je = p((e) => {
|
|
150
163
|
e.preventDefault(), j(!1), M(null);
|
|
151
164
|
try {
|
|
152
165
|
let t = e.dataTransfer.getData("application/json");
|
|
@@ -166,13 +179,13 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
166
179
|
let c = {
|
|
167
180
|
width: i.defaultSize.width,
|
|
168
181
|
height: i.defaultSize.height
|
|
169
|
-
}, { x: l, y: u } =
|
|
182
|
+
}, { x: l, y: u } = ce(e.clientX, e.clientY, s, E, c, { cols: 12 }), d = {
|
|
170
183
|
x: l,
|
|
171
184
|
y: u,
|
|
172
185
|
width: c.width,
|
|
173
186
|
height: c.height
|
|
174
187
|
};
|
|
175
|
-
|
|
188
|
+
Q({
|
|
176
189
|
type: r.type,
|
|
177
190
|
title: r.name || i.name,
|
|
178
191
|
config: r.defaultConfig || i.defaultConfig
|
|
@@ -183,51 +196,51 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
183
196
|
} catch (e) {
|
|
184
197
|
console.error("Failed to handle widget drop:", e);
|
|
185
198
|
}
|
|
186
|
-
}, [E,
|
|
199
|
+
}, [E, Q]), Ye = p((e) => {
|
|
187
200
|
e.preventDefault(), e.dataTransfer.dropEffect = "copy";
|
|
188
|
-
}, []),
|
|
201
|
+
}, []), Xe = p((e, t) => {
|
|
189
202
|
let n = t || a(e);
|
|
190
|
-
|
|
203
|
+
Q({
|
|
191
204
|
type: e,
|
|
192
205
|
title: n.name,
|
|
193
206
|
config: n.defaultConfig
|
|
194
207
|
});
|
|
195
|
-
}, [
|
|
196
|
-
|
|
197
|
-
}, [
|
|
198
|
-
|
|
208
|
+
}, [Q]), Ze = p(() => {
|
|
209
|
+
H();
|
|
210
|
+
}, [H]), Qe = p(() => {
|
|
211
|
+
V && H(), window.requestAnimationFrame(() => {
|
|
199
212
|
let e = C("bigconsole.dashboards.widgetPalette.searchPlaceholder", "Search widgets...");
|
|
200
213
|
document.querySelector(`input[placeholder="${e}"]`)?.focus();
|
|
201
214
|
});
|
|
202
215
|
}, [
|
|
203
|
-
|
|
204
|
-
|
|
216
|
+
V,
|
|
217
|
+
H,
|
|
205
218
|
C
|
|
206
|
-
]), { exportPNG:
|
|
219
|
+
]), { exportPNG: $e, exportPDF: $, isExporting: et } = l({
|
|
207
220
|
containerRef: T,
|
|
208
221
|
name: b || "dashboard"
|
|
209
222
|
});
|
|
210
223
|
return /* @__PURE__ */ v("div", {
|
|
211
224
|
className: "flex flex-col h-full min-w-0 overflow-hidden",
|
|
212
225
|
children: [
|
|
213
|
-
/* @__PURE__ */ _(
|
|
226
|
+
/* @__PURE__ */ _(te, {
|
|
214
227
|
dashboardId: f,
|
|
215
228
|
title: b,
|
|
216
|
-
onAddWidget:
|
|
217
|
-
onTogglePalette:
|
|
218
|
-
isPaletteOpen:
|
|
219
|
-
onPaste:
|
|
220
|
-
onSave:
|
|
221
|
-
isSaving:
|
|
222
|
-
onExport:
|
|
223
|
-
onPublishTemplate:
|
|
229
|
+
onAddWidget: Qe,
|
|
230
|
+
onTogglePalette: Ze,
|
|
231
|
+
isPaletteOpen: U,
|
|
232
|
+
onPaste: ge,
|
|
233
|
+
onSave: _e,
|
|
234
|
+
isSaving: ve,
|
|
235
|
+
onExport: ye,
|
|
236
|
+
onPublishTemplate: be,
|
|
224
237
|
onExportImage: p(() => {
|
|
225
|
-
|
|
226
|
-
}, [
|
|
238
|
+
$e();
|
|
239
|
+
}, [$e]),
|
|
227
240
|
onExportPdf: p(() => {
|
|
228
241
|
$();
|
|
229
242
|
}, [$]),
|
|
230
|
-
isExportingImage:
|
|
243
|
+
isExportingImage: et,
|
|
231
244
|
onShare: () => D(!0)
|
|
232
245
|
}),
|
|
233
246
|
O && /* @__PURE__ */ _("div", {
|
|
@@ -248,44 +261,44 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
248
261
|
})
|
|
249
262
|
})
|
|
250
263
|
}),
|
|
251
|
-
/* @__PURE__ */ _(
|
|
252
|
-
widgets:
|
|
253
|
-
isEditMode:
|
|
264
|
+
/* @__PURE__ */ _(ie, {
|
|
265
|
+
widgets: q,
|
|
266
|
+
isEditMode: P
|
|
254
267
|
}),
|
|
255
|
-
/* @__PURE__ */ _(
|
|
256
|
-
widgets:
|
|
257
|
-
isEditMode:
|
|
268
|
+
/* @__PURE__ */ _(re, {
|
|
269
|
+
widgets: q,
|
|
270
|
+
isEditMode: P
|
|
258
271
|
}),
|
|
259
|
-
|
|
272
|
+
De && /* @__PURE__ */ _(ne, {
|
|
260
273
|
dashboardId: f,
|
|
261
|
-
onFilterChange:
|
|
274
|
+
onFilterChange: Ve,
|
|
262
275
|
collapsible: !0
|
|
263
276
|
}),
|
|
264
|
-
|
|
277
|
+
Oe && (P || x.length > 0) && /* @__PURE__ */ _(ae, {
|
|
265
278
|
pages: x,
|
|
266
|
-
activePageId:
|
|
267
|
-
editable:
|
|
268
|
-
onPageSelect:
|
|
279
|
+
activePageId: xe || x[0]?.id,
|
|
280
|
+
editable: P,
|
|
281
|
+
onPageSelect: Se || (() => {}),
|
|
269
282
|
onPagesReorder: S ? (e) => {
|
|
270
283
|
S(e.map((e) => x.find((t) => t.id === e)).filter(Boolean));
|
|
271
284
|
} : void 0,
|
|
272
|
-
onPageCreate:
|
|
273
|
-
onPageRename:
|
|
274
|
-
onPageDuplicate:
|
|
275
|
-
onPageDelete:
|
|
285
|
+
onPageCreate: Ce,
|
|
286
|
+
onPageRename: we,
|
|
287
|
+
onPageDuplicate: Te,
|
|
288
|
+
onPageDelete: Ee
|
|
276
289
|
}),
|
|
277
290
|
/* @__PURE__ */ v("div", {
|
|
278
291
|
"data-testid": "dashboard-canvas-panes",
|
|
279
|
-
className: `flex flex-1 min-w-0 overflow-hidden ${
|
|
280
|
-
children: [
|
|
281
|
-
isOpen:
|
|
282
|
-
onClose:
|
|
283
|
-
onWidgetSelect:
|
|
284
|
-
onDragStart:
|
|
285
|
-
onDragEnd:
|
|
286
|
-
installedWidgets:
|
|
287
|
-
installedWidgetsLoading:
|
|
288
|
-
definitions:
|
|
292
|
+
className: `flex flex-1 min-w-0 overflow-hidden ${Z ? "lg:mr-[var(--bc-inspector-width,420px)]" : ""}`,
|
|
293
|
+
children: [P && /* @__PURE__ */ _(se, {
|
|
294
|
+
isOpen: U,
|
|
295
|
+
onClose: Ze,
|
|
296
|
+
onWidgetSelect: Xe,
|
|
297
|
+
onDragStart: Ke,
|
|
298
|
+
onDragEnd: qe,
|
|
299
|
+
installedWidgets: Re,
|
|
300
|
+
installedWidgetsLoading: ze,
|
|
301
|
+
definitions: Be
|
|
289
302
|
}), /* @__PURE__ */ v("div", {
|
|
290
303
|
ref: w,
|
|
291
304
|
role: "region",
|
|
@@ -293,10 +306,10 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
293
306
|
"data-section-emphasis": "primary",
|
|
294
307
|
"data-testid": "dashboard-board",
|
|
295
308
|
className: "relative min-w-0 flex-1 overflow-auto border-2 border-transparent bg-bg-sunken motion-safe:transition-[border-color,background-color]",
|
|
296
|
-
onDrop:
|
|
297
|
-
onDragOver:
|
|
309
|
+
onDrop: Je,
|
|
310
|
+
onDragOver: Ye,
|
|
298
311
|
onClick: () => {
|
|
299
|
-
|
|
312
|
+
P && J(null);
|
|
300
313
|
},
|
|
301
314
|
style: A ? {
|
|
302
315
|
borderStyle: "dashed",
|
|
@@ -326,7 +339,7 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
326
339
|
children: [
|
|
327
340
|
C("bigconsole.dashboards.canvas.dropToAddBefore", "Drop to add"),
|
|
328
341
|
" ",
|
|
329
|
-
/* @__PURE__ */ _("strong", { children:
|
|
342
|
+
/* @__PURE__ */ _("strong", { children: Me }),
|
|
330
343
|
" ",
|
|
331
344
|
C("bigconsole.dashboards.canvas.dropToAddAfter", "widget")
|
|
332
345
|
]
|
|
@@ -335,19 +348,19 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
335
348
|
ref: T,
|
|
336
349
|
className: "min-h-full origin-top-left transition-transform",
|
|
337
350
|
style: {
|
|
338
|
-
transform: `scale(${
|
|
339
|
-
width: `${100 / (
|
|
351
|
+
transform: `scale(${B / 100})`,
|
|
352
|
+
width: `${100 / (B / 100)}%`
|
|
340
353
|
},
|
|
341
|
-
children:
|
|
342
|
-
enabled:
|
|
354
|
+
children: q.length > 0 ? /* @__PURE__ */ _(n, {
|
|
355
|
+
enabled: ke,
|
|
343
356
|
onCrossFilter: (e) => {},
|
|
344
|
-
children: /* @__PURE__ */ _(
|
|
345
|
-
widgets:
|
|
346
|
-
isEditMode:
|
|
357
|
+
children: /* @__PURE__ */ _(ee, {
|
|
358
|
+
widgets: q,
|
|
359
|
+
isEditMode: P,
|
|
347
360
|
width: E,
|
|
348
|
-
onLayoutChange:
|
|
349
|
-
onWidgetSelect:
|
|
350
|
-
selectedWidgetId:
|
|
361
|
+
onLayoutChange: We,
|
|
362
|
+
onWidgetSelect: Ge,
|
|
363
|
+
selectedWidgetId: He
|
|
351
364
|
})
|
|
352
365
|
}) : /* @__PURE__ */ _("div", {
|
|
353
366
|
className: "flex min-h-[min(400px,60vh)] items-center justify-center p-card-padding",
|
|
@@ -358,24 +371,27 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
|
|
|
358
371
|
headerClassName: "mb-form-gap",
|
|
359
372
|
title: C("bigconsole.dashboards.canvas.noWidgetsTitle", "No widgets yet"),
|
|
360
373
|
description: C("bigconsole.dashboards.canvas.noWidgetsDescription", "Add widgets to build your dashboard. Click the \"Add Widget\" button to get started."),
|
|
361
|
-
children:
|
|
362
|
-
onClick:
|
|
363
|
-
children: [/* @__PURE__ */ _(
|
|
374
|
+
children: P && /* @__PURE__ */ v(g, {
|
|
375
|
+
onClick: Qe,
|
|
376
|
+
children: [/* @__PURE__ */ _(me, { className: "size-4" }), C("bigconsole.dashboards.canvas.addWidget", "Add Widget")]
|
|
364
377
|
})
|
|
365
378
|
})
|
|
366
379
|
})
|
|
367
380
|
})]
|
|
368
381
|
})]
|
|
369
382
|
}),
|
|
370
|
-
/* @__PURE__ */ _(
|
|
371
|
-
isOpen:
|
|
372
|
-
onClose:
|
|
383
|
+
/* @__PURE__ */ _(ue, {
|
|
384
|
+
isOpen: Z,
|
|
385
|
+
onClose: Ue
|
|
373
386
|
}),
|
|
374
|
-
/* @__PURE__ */ _(
|
|
387
|
+
/* @__PURE__ */ _(oe, {
|
|
375
388
|
dashboardId: f,
|
|
376
389
|
dashboardName: b || C("bigconsole.dashboards.canvas.dashboardFallbackName", "Dashboard"),
|
|
377
|
-
isOpen:
|
|
378
|
-
onClose: () => D(!1)
|
|
390
|
+
isOpen: je,
|
|
391
|
+
onClose: () => D(!1),
|
|
392
|
+
visibility: Ie,
|
|
393
|
+
onVisibilityChange: Le,
|
|
394
|
+
canChangeVisibility: Fe
|
|
379
395
|
})
|
|
380
396
|
]
|
|
381
397
|
});
|