@nubitio/dashboard 1.3.1 → 1.4.0
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/{AreaChartWidgetView-CQw0yRF0.cjs → AreaChartWidgetView-CwynK3mG.cjs} +5 -6
- package/dist/{AreaChartWidgetView-BBp9C1bD.mjs → AreaChartWidgetView-D4hSTjc_.mjs} +5 -6
- package/dist/{ChartTooltip-D1cB6hZ7.cjs → ChartTooltip-CFrr-AJk.cjs} +3 -5
- package/dist/{ChartTooltip-DQbTw6D2.mjs → ChartTooltip-D-2bqYK7.mjs} +2 -3
- package/dist/{LineChartWidgetView-D4YrumsC.cjs → LineChartWidgetView-Cl1kZuQz.cjs} +5 -6
- package/dist/{LineChartWidgetView-gNlby0Gq.mjs → LineChartWidgetView-DoYdAB5L.mjs} +5 -6
- package/dist/{chartPalette-BmJoPzOC.cjs → chartPalette-B-6VO8MN.cjs} +3 -6
- package/dist/{chartPalette-VDQwLcM-.mjs → chartPalette-CURlBJhy.mjs} +3 -6
- package/dist/index.cjs +23 -43
- package/dist/index.d.cts +54 -62
- package/dist/index.d.mts +54 -62
- package/dist/index.mjs +23 -43
- package/package.json +6 -6
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_ChartTooltip = require("./ChartTooltip-D1cB6hZ7.cjs");
|
|
2
|
-
const require_chartPalette = require("./chartPalette-BmJoPzOC.cjs");
|
|
3
|
-
let _nubitio_ui = require("@nubitio/ui");
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
1
|
let recharts = require("recharts");
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
let _nubitio_ui = require("@nubitio/ui");
|
|
4
|
+
const require_chartPalette = require("./chartPalette-B-6VO8MN.cjs");
|
|
5
|
+
const require_ChartTooltip = require("./ChartTooltip-CFrr-AJk.cjs");
|
|
6
6
|
recharts = require_ChartTooltip.__toESM(recharts, 1);
|
|
7
|
-
|
|
7
|
+
// packages/dashboard/dashboard/widgets/AreaChartWidgetView.tsx
|
|
8
8
|
const Area = recharts.Area;
|
|
9
9
|
const AreaChart = recharts.AreaChart;
|
|
10
10
|
const CartesianGrid = recharts.CartesianGrid;
|
|
@@ -108,5 +108,4 @@ function AreaChartWidgetView({ widget, data, loading }) {
|
|
|
108
108
|
})
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
//#endregion
|
|
112
111
|
exports.AreaChartWidgetView = AreaChartWidgetView;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as formatDashboardValue, n as resolveArray, t as DEFAULT_CHART_COLORS } from "./chartPalette-VDQwLcM-.mjs";
|
|
2
|
-
import { t as ChartTooltip } from "./ChartTooltip-DQbTw6D2.mjs";
|
|
3
|
-
import { StatCard } from "@nubitio/ui";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
1
|
import * as recharts from "recharts";
|
|
6
|
-
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { StatCard } from "@nubitio/ui";
|
|
4
|
+
import { i as formatDashboardValue, n as resolveArray, t as DEFAULT_CHART_COLORS } from "./chartPalette-CURlBJhy.mjs";
|
|
5
|
+
import { t as ChartTooltip } from "./ChartTooltip-D-2bqYK7.mjs";
|
|
6
|
+
// packages/dashboard/dashboard/widgets/AreaChartWidgetView.tsx
|
|
7
7
|
const Area = recharts.Area;
|
|
8
8
|
const AreaChart = recharts.AreaChart;
|
|
9
9
|
const CartesianGrid = recharts.CartesianGrid;
|
|
@@ -107,5 +107,4 @@ function AreaChartWidgetView({ widget, data, loading }) {
|
|
|
107
107
|
})
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
//#endregion
|
|
111
110
|
export { AreaChartWidgetView };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -19,10 +19,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
19
19
|
value: mod,
|
|
20
20
|
enumerable: true
|
|
21
21
|
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
const require_chartPalette = require("./chartPalette-BmJoPzOC.cjs");
|
|
22
|
+
const require_chartPalette = require("./chartPalette-B-6VO8MN.cjs");
|
|
24
23
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
-
|
|
24
|
+
// packages/dashboard/dashboard/widgets/ChartTooltip.tsx
|
|
26
25
|
function ChartTooltip({ active, label, payload, labelFormat, series }) {
|
|
27
26
|
if (!active || !payload?.length) return null;
|
|
28
27
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -55,7 +54,6 @@ function ChartTooltip({ active, label, payload, labelFormat, series }) {
|
|
|
55
54
|
})]
|
|
56
55
|
});
|
|
57
56
|
}
|
|
58
|
-
//#endregion
|
|
59
57
|
Object.defineProperty(exports, "ChartTooltip", {
|
|
60
58
|
enumerable: true,
|
|
61
59
|
get: function() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as formatDashboardValue } from "./chartPalette-
|
|
1
|
+
import { i as formatDashboardValue } from "./chartPalette-CURlBJhy.mjs";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// packages/dashboard/dashboard/widgets/ChartTooltip.tsx
|
|
4
4
|
function ChartTooltip({ active, label, payload, labelFormat, series }) {
|
|
5
5
|
if (!active || !payload?.length) return null;
|
|
6
6
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -33,5 +33,4 @@ function ChartTooltip({ active, label, payload, labelFormat, series }) {
|
|
|
33
33
|
})]
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
//#endregion
|
|
37
36
|
export { ChartTooltip as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_ChartTooltip = require("./ChartTooltip-D1cB6hZ7.cjs");
|
|
2
|
-
const require_chartPalette = require("./chartPalette-BmJoPzOC.cjs");
|
|
3
|
-
let _nubitio_ui = require("@nubitio/ui");
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
1
|
let recharts = require("recharts");
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
let _nubitio_ui = require("@nubitio/ui");
|
|
4
|
+
const require_chartPalette = require("./chartPalette-B-6VO8MN.cjs");
|
|
5
|
+
const require_ChartTooltip = require("./ChartTooltip-CFrr-AJk.cjs");
|
|
6
6
|
recharts = require_ChartTooltip.__toESM(recharts, 1);
|
|
7
|
-
|
|
7
|
+
// packages/dashboard/dashboard/widgets/LineChartWidgetView.tsx
|
|
8
8
|
const CartesianGrid = recharts.CartesianGrid;
|
|
9
9
|
const Legend = recharts.Legend;
|
|
10
10
|
const Line = recharts.Line;
|
|
@@ -86,5 +86,4 @@ function LineChartWidgetView({ widget, data, loading }) {
|
|
|
86
86
|
})
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
//#endregion
|
|
90
89
|
exports.LineChartWidgetView = LineChartWidgetView;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as formatDashboardValue, n as resolveArray, t as DEFAULT_CHART_COLORS } from "./chartPalette-VDQwLcM-.mjs";
|
|
2
|
-
import { t as ChartTooltip } from "./ChartTooltip-DQbTw6D2.mjs";
|
|
3
|
-
import { StatCard } from "@nubitio/ui";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
1
|
import * as recharts from "recharts";
|
|
6
|
-
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { StatCard } from "@nubitio/ui";
|
|
4
|
+
import { i as formatDashboardValue, n as resolveArray, t as DEFAULT_CHART_COLORS } from "./chartPalette-CURlBJhy.mjs";
|
|
5
|
+
import { t as ChartTooltip } from "./ChartTooltip-D-2bqYK7.mjs";
|
|
6
|
+
// packages/dashboard/dashboard/widgets/LineChartWidgetView.tsx
|
|
7
7
|
const CartesianGrid = recharts.CartesianGrid;
|
|
8
8
|
const Legend = recharts.Legend;
|
|
9
9
|
const Line = recharts.Line;
|
|
@@ -85,5 +85,4 @@ function LineChartWidgetView({ widget, data, loading }) {
|
|
|
85
85
|
})
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
//#endregion
|
|
89
88
|
export { LineChartWidgetView };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
let _nubitio_core = require("@nubitio/core");
|
|
2
|
-
|
|
2
|
+
// packages/dashboard/dashboard/formatValue.ts
|
|
3
3
|
function formatDashboardValue(value, format = "text") {
|
|
4
4
|
if (value === null || value === void 0) return "—";
|
|
5
5
|
if (format === "text") return String(value);
|
|
@@ -37,8 +37,7 @@ function formatDashboardValue(value, format = "text") {
|
|
|
37
37
|
}
|
|
38
38
|
return new Intl.NumberFormat((0, _nubitio_core.getCoreLocale)()).format(numeric);
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
//#region packages/dashboard/dashboard/resolvePath.ts
|
|
40
|
+
// packages/dashboard/dashboard/resolvePath.ts
|
|
42
41
|
function resolvePath(source, path) {
|
|
43
42
|
if (path === void 0 || path === "") return source;
|
|
44
43
|
if (source === null || source === void 0) return void 0;
|
|
@@ -53,8 +52,7 @@ function resolveArray(source, path) {
|
|
|
53
52
|
if (!Array.isArray(value)) return [];
|
|
54
53
|
return value.filter((item) => item !== null && typeof item === "object");
|
|
55
54
|
}
|
|
56
|
-
|
|
57
|
-
//#region packages/dashboard/dashboard/chartPalette.ts
|
|
55
|
+
// packages/dashboard/dashboard/chartPalette.ts
|
|
58
56
|
const DEFAULT_CHART_COLORS = [
|
|
59
57
|
"var(--accent-color)",
|
|
60
58
|
"var(--success-color)",
|
|
@@ -63,7 +61,6 @@ const DEFAULT_CHART_COLORS = [
|
|
|
63
61
|
"#6b4fc8",
|
|
64
62
|
"#c2410c"
|
|
65
63
|
];
|
|
66
|
-
//#endregion
|
|
67
64
|
Object.defineProperty(exports, "DEFAULT_CHART_COLORS", {
|
|
68
65
|
enumerable: true,
|
|
69
66
|
get: function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getCoreCurrency, getCoreLocale } from "@nubitio/core";
|
|
2
|
-
|
|
2
|
+
// packages/dashboard/dashboard/formatValue.ts
|
|
3
3
|
function formatDashboardValue(value, format = "text") {
|
|
4
4
|
if (value === null || value === void 0) return "—";
|
|
5
5
|
if (format === "text") return String(value);
|
|
@@ -37,8 +37,7 @@ function formatDashboardValue(value, format = "text") {
|
|
|
37
37
|
}
|
|
38
38
|
return new Intl.NumberFormat(getCoreLocale()).format(numeric);
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
//#region packages/dashboard/dashboard/resolvePath.ts
|
|
40
|
+
// packages/dashboard/dashboard/resolvePath.ts
|
|
42
41
|
function resolvePath(source, path) {
|
|
43
42
|
if (path === void 0 || path === "") return source;
|
|
44
43
|
if (source === null || source === void 0) return void 0;
|
|
@@ -53,8 +52,7 @@ function resolveArray(source, path) {
|
|
|
53
52
|
if (!Array.isArray(value)) return [];
|
|
54
53
|
return value.filter((item) => item !== null && typeof item === "object");
|
|
55
54
|
}
|
|
56
|
-
|
|
57
|
-
//#region packages/dashboard/dashboard/chartPalette.ts
|
|
55
|
+
// packages/dashboard/dashboard/chartPalette.ts
|
|
58
56
|
const DEFAULT_CHART_COLORS = [
|
|
59
57
|
"var(--accent-color)",
|
|
60
58
|
"var(--success-color)",
|
|
@@ -63,5 +61,4 @@ const DEFAULT_CHART_COLORS = [
|
|
|
63
61
|
"#6b4fc8",
|
|
64
62
|
"#c2410c"
|
|
65
63
|
];
|
|
66
|
-
//#endregion
|
|
67
64
|
export { formatDashboardValue as i, resolveArray as n, resolvePath as r, DEFAULT_CHART_COLORS as t };
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_chartPalette = require("./chartPalette-BmJoPzOC.cjs");
|
|
3
2
|
let _nubitio_ui = require("@nubitio/ui");
|
|
4
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
4
|
let react = require("react");
|
|
6
5
|
let react_router_dom = require("react-router-dom");
|
|
7
6
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
8
7
|
let _nubitio_core = require("@nubitio/core");
|
|
9
|
-
|
|
8
|
+
const require_chartPalette = require("./chartPalette-B-6VO8MN.cjs");
|
|
9
|
+
// packages/dashboard/dashboard/defineDashboard.ts
|
|
10
10
|
const dashboardCache = /* @__PURE__ */ new Map();
|
|
11
11
|
function cacheKey(config) {
|
|
12
12
|
try {
|
|
@@ -45,8 +45,7 @@ function defineDashboard(config) {
|
|
|
45
45
|
if (key !== null) dashboardCache.set(key, dashboard);
|
|
46
46
|
return dashboard;
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
//#region packages/dashboard/dashboard/DashboardLayoutControls.tsx
|
|
48
|
+
// packages/dashboard/dashboard/DashboardLayoutControls.tsx
|
|
50
49
|
function DashboardLayoutControls({ layout }) {
|
|
51
50
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
52
51
|
className: "nb-dashboard-layout-controls",
|
|
@@ -82,8 +81,7 @@ function DashboardLayoutControls({ layout }) {
|
|
|
82
81
|
]
|
|
83
82
|
});
|
|
84
83
|
}
|
|
85
|
-
|
|
86
|
-
//#region packages/dashboard/dashboard/periodPresets.ts
|
|
84
|
+
// packages/dashboard/dashboard/periodPresets.ts
|
|
87
85
|
const pad = (n) => String(n).padStart(2, "0");
|
|
88
86
|
const toIso = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
89
87
|
function daysAgo(today, days) {
|
|
@@ -142,8 +140,7 @@ const DEFAULT_PERIOD_PRESETS = [
|
|
|
142
140
|
function getPeriodPreset(key, presets = DEFAULT_PERIOD_PRESETS) {
|
|
143
141
|
return presets.find((preset) => preset.key === key);
|
|
144
142
|
}
|
|
145
|
-
|
|
146
|
-
//#region packages/dashboard/dashboard/useDashboardPeriod.ts
|
|
143
|
+
// packages/dashboard/dashboard/useDashboardPeriod.ts
|
|
147
144
|
const CUSTOM_PERIOD_KEY = "custom";
|
|
148
145
|
function useDashboardPeriod(config) {
|
|
149
146
|
const presets = config?.presets ?? DEFAULT_PERIOD_PRESETS;
|
|
@@ -205,8 +202,7 @@ function useDashboardPeriod(config) {
|
|
|
205
202
|
setCustomRange
|
|
206
203
|
};
|
|
207
204
|
}
|
|
208
|
-
|
|
209
|
-
//#region packages/dashboard/dashboard/DashboardPeriodFilter.tsx
|
|
205
|
+
// packages/dashboard/dashboard/DashboardPeriodFilter.tsx
|
|
210
206
|
function DashboardPeriodFilter({ period }) {
|
|
211
207
|
const { value, presets = [], allowCustomRange, setPreset, setCustomRange } = period;
|
|
212
208
|
const options = [...presets.map((preset) => ({
|
|
@@ -233,14 +229,12 @@ function DashboardPeriodFilter({ period }) {
|
|
|
233
229
|
})]
|
|
234
230
|
});
|
|
235
231
|
}
|
|
236
|
-
|
|
237
|
-
//#region packages/dashboard/dashboard/defaults.ts
|
|
232
|
+
// packages/dashboard/dashboard/defaults.ts
|
|
238
233
|
const DEFAULT_PERIOD_PARAM_NAMES = {
|
|
239
234
|
start: "from",
|
|
240
235
|
end: "to"
|
|
241
236
|
};
|
|
242
|
-
|
|
243
|
-
//#region packages/dashboard/dashboard/useWidgetQuery.ts
|
|
237
|
+
// packages/dashboard/dashboard/useWidgetQuery.ts
|
|
244
238
|
/**
|
|
245
239
|
* Fetches a single widget's data independently of the dashboard's shared
|
|
246
240
|
* payload — its own cache entry, its own loading/error state, no head-of-line
|
|
@@ -277,8 +271,7 @@ function useWidgetQuery(query, period, periodParamNames = DEFAULT_PERIOD_PARAM_N
|
|
|
277
271
|
error: result.error ? result.error instanceof Error ? result.error.message : "Failed to load widget" : null
|
|
278
272
|
};
|
|
279
273
|
}
|
|
280
|
-
|
|
281
|
-
//#region packages/dashboard/dashboard/widgetRegistry.ts
|
|
274
|
+
// packages/dashboard/dashboard/widgetRegistry.ts
|
|
282
275
|
const registry = /* @__PURE__ */ new Map();
|
|
283
276
|
/**
|
|
284
277
|
* Registers a component to render for `widget.type`. Built-in types (`stat`,
|
|
@@ -299,8 +292,7 @@ function getWidgetComponent(type) {
|
|
|
299
292
|
function isWidgetTypeRegistered(type) {
|
|
300
293
|
return registry.has(type);
|
|
301
294
|
}
|
|
302
|
-
|
|
303
|
-
//#region packages/dashboard/dashboard/widgets/BarChartWidgetView.tsx
|
|
295
|
+
// packages/dashboard/dashboard/widgets/BarChartWidgetView.tsx
|
|
304
296
|
function toNumber$2(value) {
|
|
305
297
|
const numeric = typeof value === "number" ? value : Number(value);
|
|
306
298
|
return Number.isFinite(numeric) ? numeric : 0;
|
|
@@ -348,8 +340,7 @@ function BarChartWidgetView({ widget, data, loading }) {
|
|
|
348
340
|
})
|
|
349
341
|
});
|
|
350
342
|
}
|
|
351
|
-
|
|
352
|
-
//#region packages/dashboard/dashboard/widgets/DonutChartWidgetView.tsx
|
|
343
|
+
// packages/dashboard/dashboard/widgets/DonutChartWidgetView.tsx
|
|
353
344
|
function toNumber$1(value) {
|
|
354
345
|
const numeric = typeof value === "number" ? value : Number(value);
|
|
355
346
|
return Number.isFinite(numeric) ? numeric : 0;
|
|
@@ -451,8 +442,7 @@ function DonutChartWidgetView({ widget, data, loading }) {
|
|
|
451
442
|
})
|
|
452
443
|
});
|
|
453
444
|
}
|
|
454
|
-
|
|
455
|
-
//#region packages/dashboard/dashboard/widgets/ProgressWidgetView.tsx
|
|
445
|
+
// packages/dashboard/dashboard/widgets/ProgressWidgetView.tsx
|
|
456
446
|
function toNumber(value, fallback) {
|
|
457
447
|
const numeric = typeof value === "number" ? value : Number(value);
|
|
458
448
|
return Number.isFinite(numeric) ? numeric : fallback;
|
|
@@ -493,8 +483,7 @@ function ProgressWidgetView({ widget, data, loading }) {
|
|
|
493
483
|
})]
|
|
494
484
|
});
|
|
495
485
|
}
|
|
496
|
-
|
|
497
|
-
//#region packages/dashboard/dashboard/widgets/StatWidgetView.tsx
|
|
486
|
+
// packages/dashboard/dashboard/widgets/StatWidgetView.tsx
|
|
498
487
|
function resolveTrend(widget, data) {
|
|
499
488
|
if (!widget.trend) return { value: null };
|
|
500
489
|
const raw = widget.trend.valuePath !== void 0 ? require_chartPalette.resolvePath(data, widget.trend.valuePath) : widget.trend.value;
|
|
@@ -539,8 +528,7 @@ function StatWidgetView({ widget, data, loading }) {
|
|
|
539
528
|
})
|
|
540
529
|
});
|
|
541
530
|
}
|
|
542
|
-
|
|
543
|
-
//#region packages/dashboard/dashboard/widgets/TableWidgetView.tsx
|
|
531
|
+
// packages/dashboard/dashboard/widgets/TableWidgetView.tsx
|
|
544
532
|
function renderCell(row, column) {
|
|
545
533
|
const raw = row[column.key];
|
|
546
534
|
if (column.badge) {
|
|
@@ -593,17 +581,15 @@ function TableWidgetView({ widget, data, loading }) {
|
|
|
593
581
|
})
|
|
594
582
|
});
|
|
595
583
|
}
|
|
596
|
-
|
|
597
|
-
//#region packages/dashboard/dashboard/widgets/registerBuiltinWidgets.ts
|
|
584
|
+
// packages/dashboard/dashboard/widgets/registerBuiltinWidgets.ts
|
|
598
585
|
registerWidgetType("stat", StatWidgetView);
|
|
599
586
|
registerWidgetType("bar-chart", BarChartWidgetView);
|
|
600
587
|
registerWidgetType("donut-chart", DonutChartWidgetView);
|
|
601
|
-
registerWidgetType("line-chart", (0, react.lazy)(() => Promise.resolve().then(() => require("./LineChartWidgetView-
|
|
602
|
-
registerWidgetType("area-chart", (0, react.lazy)(() => Promise.resolve().then(() => require("./AreaChartWidgetView-
|
|
588
|
+
registerWidgetType("line-chart", (0, react.lazy)(() => Promise.resolve().then(() => require("./LineChartWidgetView-Cl1kZuQz.cjs")).then((m) => ({ default: m.LineChartWidgetView }))));
|
|
589
|
+
registerWidgetType("area-chart", (0, react.lazy)(() => Promise.resolve().then(() => require("./AreaChartWidgetView-CwynK3mG.cjs")).then((m) => ({ default: m.AreaChartWidgetView }))));
|
|
603
590
|
registerWidgetType("progress", ProgressWidgetView);
|
|
604
591
|
registerWidgetType("table", TableWidgetView);
|
|
605
|
-
|
|
606
|
-
//#region packages/dashboard/dashboard/widgets/WidgetRenderer.tsx
|
|
592
|
+
// packages/dashboard/dashboard/widgets/WidgetRenderer.tsx
|
|
607
593
|
const isDev = typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
|
|
608
594
|
function WidgetRenderer({ widget, data, loading }) {
|
|
609
595
|
const Component = getWidgetComponent(widget.type);
|
|
@@ -623,8 +609,7 @@ function WidgetRenderer({ widget, data, loading }) {
|
|
|
623
609
|
})
|
|
624
610
|
});
|
|
625
611
|
}
|
|
626
|
-
|
|
627
|
-
//#region packages/dashboard/dashboard/DashboardWidgetSlot.tsx
|
|
612
|
+
// packages/dashboard/dashboard/DashboardWidgetSlot.tsx
|
|
628
613
|
function DashboardWidgetSlot({ widget, data, loading, editMode, onHide, onMoveUp, onMoveDown, period, periodParamNames = DEFAULT_PERIOD_PARAM_NAMES }) {
|
|
629
614
|
const widgetQuery = useWidgetQuery(widget.query, period, periodParamNames);
|
|
630
615
|
const effectiveData = widgetQuery ? widgetQuery.data : data;
|
|
@@ -680,8 +665,7 @@ function DashboardWidgetSlot({ widget, data, loading, editMode, onHide, onMoveUp
|
|
|
680
665
|
})]
|
|
681
666
|
});
|
|
682
667
|
}
|
|
683
|
-
|
|
684
|
-
//#region packages/dashboard/dashboard/useDashboardData.ts
|
|
668
|
+
// packages/dashboard/dashboard/useDashboardData.ts
|
|
685
669
|
function useDashboardData(dataUrl, refreshInterval, period, periodParamNames = DEFAULT_PERIOD_PARAM_NAMES) {
|
|
686
670
|
const http = (0, _nubitio_core.useCoreHttpClient)();
|
|
687
671
|
const params = period ? {
|
|
@@ -710,8 +694,7 @@ function useDashboardData(dataUrl, refreshInterval, period, periodParamNames = D
|
|
|
710
694
|
}
|
|
711
695
|
};
|
|
712
696
|
}
|
|
713
|
-
|
|
714
|
-
//#region packages/dashboard/dashboard/useDashboardLayout.ts
|
|
697
|
+
// packages/dashboard/dashboard/useDashboardLayout.ts
|
|
715
698
|
function storageKey(dashboardId) {
|
|
716
699
|
return `nb-dashboard-layout:${dashboardId}`;
|
|
717
700
|
}
|
|
@@ -814,8 +797,7 @@ function useDashboardLayout(dashboardId, sections, enabled) {
|
|
|
814
797
|
resetLayout
|
|
815
798
|
};
|
|
816
799
|
}
|
|
817
|
-
|
|
818
|
-
//#region packages/dashboard/dashboard/DashboardPage.tsx
|
|
800
|
+
// packages/dashboard/dashboard/DashboardPage.tsx
|
|
819
801
|
function sectionClassName(section) {
|
|
820
802
|
return `nb-dashboard-section nb-dashboard-section--${section.layout ?? "grid"}`;
|
|
821
803
|
}
|
|
@@ -879,8 +861,7 @@ function DashboardPage({ config }) {
|
|
|
879
861
|
})]
|
|
880
862
|
});
|
|
881
863
|
}
|
|
882
|
-
|
|
883
|
-
//#region packages/dashboard/dashboard/widgetBuilders.ts
|
|
864
|
+
// packages/dashboard/dashboard/widgetBuilders.ts
|
|
884
865
|
function statWidget(config) {
|
|
885
866
|
return {
|
|
886
867
|
type: "stat",
|
|
@@ -940,7 +921,6 @@ function progressWidget(config) {
|
|
|
940
921
|
...config
|
|
941
922
|
};
|
|
942
923
|
}
|
|
943
|
-
//#endregion
|
|
944
924
|
exports.CUSTOM_PERIOD_KEY = CUSTOM_PERIOD_KEY;
|
|
945
925
|
exports.DEFAULT_CHART_COLORS = require_chartPalette.DEFAULT_CHART_COLORS;
|
|
946
926
|
exports.DEFAULT_PERIOD_PARAM_NAMES = DEFAULT_PERIOD_PARAM_NAMES;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nubitio/dashboard — declarative dashboard engine.
|
|
3
|
+
*
|
|
4
|
+
* Requires a `@tanstack/react-query` `QueryClientProvider` ancestor (already
|
|
5
|
+
* provided by `createNubitApp` from `@nubitio/admin`) — data fetching, both
|
|
6
|
+
* the dashboard's shared payload and any per-widget `query`, goes through it.
|
|
7
|
+
*
|
|
8
|
+
* Quick start:
|
|
9
|
+
* const overview = defineDashboard({
|
|
10
|
+
* title: 'Dashboard',
|
|
11
|
+
* dataUrl: '/api/dashboard/overview',
|
|
12
|
+
* sections: [
|
|
13
|
+
* {
|
|
14
|
+
* layout: 'stats',
|
|
15
|
+
* widgets: [
|
|
16
|
+
* statWidget({ id: 'revenue', title: 'Revenue', valuePath: 'stats.revenue', format: 'currency', icon: 'ph-currency-dollar' }),
|
|
17
|
+
* ],
|
|
18
|
+
* },
|
|
19
|
+
* ],
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* export const HomePage = () => <DashboardPage config={overview} />;
|
|
23
|
+
*
|
|
24
|
+
* Custom widget types can be registered without forking the package:
|
|
25
|
+
* registerWidgetType('funnel', FunnelWidgetView);
|
|
26
|
+
*/
|
|
1
27
|
import { BadgeVariant } from "@nubitio/ui";
|
|
2
28
|
import { ComponentType } from "react";
|
|
3
|
-
//#region packages/dashboard/dashboard/types.d.ts
|
|
4
29
|
type ValueFormat = 'text' | 'number' | 'currency' | 'percent' | 'date' | 'datetime';
|
|
5
30
|
interface TrendConfig {
|
|
6
31
|
/** Dot-path into dashboard payload, e.g. `stats.revenueTrend`. */
|
|
@@ -191,8 +216,6 @@ interface DashboardConfig {
|
|
|
191
216
|
/** Lets end users hide/reorder widgets within a section; persisted to localStorage per `id`. */
|
|
192
217
|
customizable?: boolean;
|
|
193
218
|
}
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region packages/dashboard/dashboard/defineDashboard.d.ts
|
|
196
219
|
/**
|
|
197
220
|
* Declarative dashboard definition — mirrors `defineResource` ergonomics.
|
|
198
221
|
*
|
|
@@ -208,16 +231,12 @@ interface DashboardConfig {
|
|
|
208
231
|
* export const DashboardRoute = () => <DashboardPage config={overview} />;
|
|
209
232
|
* ```
|
|
210
233
|
*/
|
|
211
|
-
declare function defineDashboard(config: DashboardConfig): DashboardConfig;
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region packages/dashboard/dashboard/DashboardPage.d.ts
|
|
234
|
+
export declare function defineDashboard(config: DashboardConfig): DashboardConfig;
|
|
214
235
|
interface DashboardPageProps {
|
|
215
236
|
config: DashboardConfig;
|
|
216
237
|
}
|
|
217
|
-
declare function DashboardPage({ config }: DashboardPageProps): import("react").JSX.Element;
|
|
218
|
-
|
|
219
|
-
//#region packages/dashboard/dashboard/useDashboardPeriod.d.ts
|
|
220
|
-
declare const CUSTOM_PERIOD_KEY = "custom";
|
|
238
|
+
export declare function DashboardPage({ config }: DashboardPageProps): import("react").JSX.Element;
|
|
239
|
+
export declare const CUSTOM_PERIOD_KEY = "custom";
|
|
221
240
|
interface DashboardPeriodState {
|
|
222
241
|
value: DashboardPeriodValue;
|
|
223
242
|
presets: DashboardPeriodConfig['presets'];
|
|
@@ -225,14 +244,10 @@ interface DashboardPeriodState {
|
|
|
225
244
|
setPreset: (key: string) => void;
|
|
226
245
|
setCustomRange: (start: string, end: string) => void;
|
|
227
246
|
}
|
|
228
|
-
declare function useDashboardPeriod(config?: DashboardPeriodConfig): DashboardPeriodState | undefined;
|
|
229
|
-
|
|
230
|
-
//#region packages/dashboard/dashboard/DashboardPeriodFilter.d.ts
|
|
231
|
-
declare function DashboardPeriodFilter({ period }: {
|
|
247
|
+
export declare function useDashboardPeriod(config?: DashboardPeriodConfig): DashboardPeriodState | undefined;
|
|
248
|
+
export declare function DashboardPeriodFilter({ period }: {
|
|
232
249
|
period: DashboardPeriodState;
|
|
233
250
|
}): import("react").JSX.Element;
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region packages/dashboard/dashboard/useDashboardLayout.d.ts
|
|
236
251
|
interface HiddenWidgetEntry {
|
|
237
252
|
sectionId: string;
|
|
238
253
|
widget: DashboardWidget;
|
|
@@ -247,14 +262,10 @@ interface DashboardLayoutState {
|
|
|
247
262
|
moveWidget: (sectionId: string, widgetId: string, direction: -1 | 1) => void;
|
|
248
263
|
resetLayout: () => void;
|
|
249
264
|
}
|
|
250
|
-
declare function useDashboardLayout(dashboardId: string | undefined, sections: DashboardSection[], enabled: boolean): DashboardLayoutState | undefined;
|
|
251
|
-
|
|
252
|
-
//#region packages/dashboard/dashboard/DashboardLayoutControls.d.ts
|
|
253
|
-
declare function DashboardLayoutControls({ layout }: {
|
|
265
|
+
export declare function useDashboardLayout(dashboardId: string | undefined, sections: DashboardSection[], enabled: boolean): DashboardLayoutState | undefined;
|
|
266
|
+
export declare function DashboardLayoutControls({ layout }: {
|
|
254
267
|
layout: DashboardLayoutState;
|
|
255
268
|
}): import("react").JSX.Element;
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region packages/dashboard/dashboard/DashboardWidgetSlot.d.ts
|
|
258
269
|
type Props = {
|
|
259
270
|
widget: DashboardWidget;
|
|
260
271
|
data: Record<string, unknown>;
|
|
@@ -269,15 +280,11 @@ type Props = {
|
|
|
269
280
|
end: string;
|
|
270
281
|
};
|
|
271
282
|
};
|
|
272
|
-
declare function DashboardWidgetSlot({ widget, data, loading, editMode, onHide, onMoveUp, onMoveDown, period, periodParamNames }: Props): import("react").JSX.Element;
|
|
273
|
-
|
|
274
|
-
//#region packages/dashboard/dashboard/useDashboardData.d.ts
|
|
275
|
-
declare function useDashboardData(dataUrl?: string, refreshInterval?: number, period?: DashboardPeriodValue, periodParamNames?: {
|
|
283
|
+
export declare function DashboardWidgetSlot({ widget, data, loading, editMode, onHide, onMoveUp, onMoveDown, period, periodParamNames }: Props): import("react").JSX.Element;
|
|
284
|
+
export declare function useDashboardData(dataUrl?: string, refreshInterval?: number, period?: DashboardPeriodValue, periodParamNames?: {
|
|
276
285
|
start: string;
|
|
277
286
|
end: string;
|
|
278
287
|
}): DashboardDataResult;
|
|
279
|
-
//#endregion
|
|
280
|
-
//#region packages/dashboard/dashboard/useWidgetQuery.d.ts
|
|
281
288
|
interface WidgetQueryResult {
|
|
282
289
|
data: Record<string, unknown>;
|
|
283
290
|
loading: boolean;
|
|
@@ -289,22 +296,16 @@ interface WidgetQueryResult {
|
|
|
289
296
|
* blocking behind slower widgets. Returns `undefined` when the widget has no
|
|
290
297
|
* `query` configured, so callers fall back to the dashboard's shared data.
|
|
291
298
|
*/
|
|
292
|
-
declare function useWidgetQuery(query: WidgetQueryConfig | undefined, period: DashboardPeriodValue | undefined, periodParamNames?: {
|
|
299
|
+
export declare function useWidgetQuery(query: WidgetQueryConfig | undefined, period: DashboardPeriodValue | undefined, periodParamNames?: {
|
|
293
300
|
start: string;
|
|
294
301
|
end: string;
|
|
295
302
|
}): WidgetQueryResult | undefined;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
declare const
|
|
299
|
-
declare function getPeriodPreset(key: string, presets?: DashboardPeriodPreset[]): DashboardPeriodPreset | undefined;
|
|
300
|
-
//#endregion
|
|
301
|
-
//#region packages/dashboard/dashboard/defaults.d.ts
|
|
302
|
-
declare const DEFAULT_PERIOD_PARAM_NAMES: {
|
|
303
|
+
export declare const DEFAULT_PERIOD_PRESETS: DashboardPeriodPreset[];
|
|
304
|
+
export declare function getPeriodPreset(key: string, presets?: DashboardPeriodPreset[]): DashboardPeriodPreset | undefined;
|
|
305
|
+
export declare const DEFAULT_PERIOD_PARAM_NAMES: {
|
|
303
306
|
readonly start: "from";
|
|
304
307
|
readonly end: "to";
|
|
305
308
|
};
|
|
306
|
-
//#endregion
|
|
307
|
-
//#region packages/dashboard/dashboard/widgetRegistry.d.ts
|
|
308
309
|
interface WidgetViewProps<W extends DashboardWidget = DashboardWidget> {
|
|
309
310
|
widget: W;
|
|
310
311
|
data: Record<string, unknown>;
|
|
@@ -321,27 +322,18 @@ type WidgetComponent = ComponentType<WidgetViewProps<any>>;
|
|
|
321
322
|
* registerWidgetType('funnel', FunnelWidgetView);
|
|
322
323
|
* ```
|
|
323
324
|
*/
|
|
324
|
-
declare function registerWidgetType(type: string, component: WidgetComponent): void;
|
|
325
|
-
declare function getWidgetComponent(type: string): WidgetComponent | undefined;
|
|
326
|
-
declare function isWidgetTypeRegistered(type: string): boolean;
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
declare function
|
|
330
|
-
declare function
|
|
331
|
-
declare function
|
|
332
|
-
declare function
|
|
333
|
-
declare function
|
|
334
|
-
declare function
|
|
335
|
-
declare function
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
declare function resolveArray(source: unknown, path: string): Record<string, unknown>[];
|
|
340
|
-
//#endregion
|
|
341
|
-
//#region packages/dashboard/dashboard/formatValue.d.ts
|
|
342
|
-
declare function formatDashboardValue(value: unknown, format?: ValueFormat): string;
|
|
343
|
-
//#endregion
|
|
344
|
-
//#region packages/dashboard/dashboard/chartPalette.d.ts
|
|
345
|
-
declare const DEFAULT_CHART_COLORS: string[];
|
|
346
|
-
//#endregion
|
|
347
|
-
export { type AreaChartWidgetConfig, type BarChartWidgetConfig, type BaseWidgetConfig, CUSTOM_PERIOD_KEY, type ChartSeriesConfig, type CustomWidgetConfig, DEFAULT_CHART_COLORS, DEFAULT_PERIOD_PARAM_NAMES, DEFAULT_PERIOD_PRESETS, type DashboardConfig, type DashboardDataResult, DashboardLayoutControls, type DashboardLayoutState, DashboardPage, type DashboardPageProps, type DashboardPeriodConfig, DashboardPeriodFilter, type DashboardPeriodPreset, type DashboardPeriodState, type DashboardPeriodValue, type DashboardSection, type DashboardSectionLayout, type DashboardWidget, DashboardWidgetSlot, type DonutChartWidgetConfig, type HiddenWidgetEntry, type LineChartWidgetConfig, type ProgressWidgetConfig, type StatIconTone, type StatWidgetConfig, type TableColumnConfig, type TableViewAllConfig, type TableWidgetConfig, type TrendConfig, type ValueFormat, type WidgetComponent, type WidgetQueryConfig, type WidgetQueryResult, type WidgetViewProps, areaChartWidget, barChartWidget, defineDashboard, donutChartWidget, formatDashboardValue, getPeriodPreset, getWidgetComponent, isWidgetTypeRegistered, lineChartWidget, progressWidget, registerWidgetType, resolveArray, resolvePath, statWidget, tableWidget, useDashboardData, useDashboardLayout, useDashboardPeriod, useWidgetQuery };
|
|
325
|
+
export declare function registerWidgetType(type: string, component: WidgetComponent): void;
|
|
326
|
+
export declare function getWidgetComponent(type: string): WidgetComponent | undefined;
|
|
327
|
+
export declare function isWidgetTypeRegistered(type: string): boolean;
|
|
328
|
+
export declare function statWidget(config: Omit<StatWidgetConfig, 'type'>): StatWidgetConfig;
|
|
329
|
+
export declare function barChartWidget(config: Omit<BarChartWidgetConfig, 'type'>): BarChartWidgetConfig;
|
|
330
|
+
export declare function donutChartWidget(config: Omit<DonutChartWidgetConfig, 'type'>): DonutChartWidgetConfig;
|
|
331
|
+
export declare function tableWidget(config: Omit<TableWidgetConfig, 'type'>): TableWidgetConfig;
|
|
332
|
+
export declare function lineChartWidget(config: Omit<LineChartWidgetConfig, 'type'>): LineChartWidgetConfig;
|
|
333
|
+
export declare function areaChartWidget(config: Omit<AreaChartWidgetConfig, 'type'>): AreaChartWidgetConfig;
|
|
334
|
+
export declare function progressWidget(config: Omit<ProgressWidgetConfig, 'type'>): ProgressWidgetConfig;
|
|
335
|
+
export declare function resolvePath(source: unknown, path?: string): unknown;
|
|
336
|
+
export declare function resolveArray(source: unknown, path: string): Record<string, unknown>[];
|
|
337
|
+
export declare function formatDashboardValue(value: unknown, format?: ValueFormat): string;
|
|
338
|
+
export declare const DEFAULT_CHART_COLORS: string[];
|
|
339
|
+
export type { AreaChartWidgetConfig, BarChartWidgetConfig, BaseWidgetConfig, ChartSeriesConfig, CustomWidgetConfig, DashboardConfig, DashboardDataResult, DashboardLayoutState, DashboardPageProps, DashboardPeriodConfig, DashboardPeriodPreset, DashboardPeriodState, DashboardPeriodValue, DashboardSection, DashboardSectionLayout, DashboardWidget, DonutChartWidgetConfig, HiddenWidgetEntry, LineChartWidgetConfig, ProgressWidgetConfig, StatIconTone, StatWidgetConfig, TableColumnConfig, TableViewAllConfig, TableWidgetConfig, TrendConfig, ValueFormat, WidgetComponent, WidgetQueryConfig, WidgetQueryResult, WidgetViewProps };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nubitio/dashboard — declarative dashboard engine.
|
|
3
|
+
*
|
|
4
|
+
* Requires a `@tanstack/react-query` `QueryClientProvider` ancestor (already
|
|
5
|
+
* provided by `createNubitApp` from `@nubitio/admin`) — data fetching, both
|
|
6
|
+
* the dashboard's shared payload and any per-widget `query`, goes through it.
|
|
7
|
+
*
|
|
8
|
+
* Quick start:
|
|
9
|
+
* const overview = defineDashboard({
|
|
10
|
+
* title: 'Dashboard',
|
|
11
|
+
* dataUrl: '/api/dashboard/overview',
|
|
12
|
+
* sections: [
|
|
13
|
+
* {
|
|
14
|
+
* layout: 'stats',
|
|
15
|
+
* widgets: [
|
|
16
|
+
* statWidget({ id: 'revenue', title: 'Revenue', valuePath: 'stats.revenue', format: 'currency', icon: 'ph-currency-dollar' }),
|
|
17
|
+
* ],
|
|
18
|
+
* },
|
|
19
|
+
* ],
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* export const HomePage = () => <DashboardPage config={overview} />;
|
|
23
|
+
*
|
|
24
|
+
* Custom widget types can be registered without forking the package:
|
|
25
|
+
* registerWidgetType('funnel', FunnelWidgetView);
|
|
26
|
+
*/
|
|
1
27
|
import { BadgeVariant } from "@nubitio/ui";
|
|
2
28
|
import { ComponentType } from "react";
|
|
3
|
-
//#region packages/dashboard/dashboard/types.d.ts
|
|
4
29
|
type ValueFormat = 'text' | 'number' | 'currency' | 'percent' | 'date' | 'datetime';
|
|
5
30
|
interface TrendConfig {
|
|
6
31
|
/** Dot-path into dashboard payload, e.g. `stats.revenueTrend`. */
|
|
@@ -191,8 +216,6 @@ interface DashboardConfig {
|
|
|
191
216
|
/** Lets end users hide/reorder widgets within a section; persisted to localStorage per `id`. */
|
|
192
217
|
customizable?: boolean;
|
|
193
218
|
}
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region packages/dashboard/dashboard/defineDashboard.d.ts
|
|
196
219
|
/**
|
|
197
220
|
* Declarative dashboard definition — mirrors `defineResource` ergonomics.
|
|
198
221
|
*
|
|
@@ -208,16 +231,12 @@ interface DashboardConfig {
|
|
|
208
231
|
* export const DashboardRoute = () => <DashboardPage config={overview} />;
|
|
209
232
|
* ```
|
|
210
233
|
*/
|
|
211
|
-
declare function defineDashboard(config: DashboardConfig): DashboardConfig;
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region packages/dashboard/dashboard/DashboardPage.d.ts
|
|
234
|
+
export declare function defineDashboard(config: DashboardConfig): DashboardConfig;
|
|
214
235
|
interface DashboardPageProps {
|
|
215
236
|
config: DashboardConfig;
|
|
216
237
|
}
|
|
217
|
-
declare function DashboardPage({ config }: DashboardPageProps): import("react").JSX.Element;
|
|
218
|
-
|
|
219
|
-
//#region packages/dashboard/dashboard/useDashboardPeriod.d.ts
|
|
220
|
-
declare const CUSTOM_PERIOD_KEY = "custom";
|
|
238
|
+
export declare function DashboardPage({ config }: DashboardPageProps): import("react").JSX.Element;
|
|
239
|
+
export declare const CUSTOM_PERIOD_KEY = "custom";
|
|
221
240
|
interface DashboardPeriodState {
|
|
222
241
|
value: DashboardPeriodValue;
|
|
223
242
|
presets: DashboardPeriodConfig['presets'];
|
|
@@ -225,14 +244,10 @@ interface DashboardPeriodState {
|
|
|
225
244
|
setPreset: (key: string) => void;
|
|
226
245
|
setCustomRange: (start: string, end: string) => void;
|
|
227
246
|
}
|
|
228
|
-
declare function useDashboardPeriod(config?: DashboardPeriodConfig): DashboardPeriodState | undefined;
|
|
229
|
-
|
|
230
|
-
//#region packages/dashboard/dashboard/DashboardPeriodFilter.d.ts
|
|
231
|
-
declare function DashboardPeriodFilter({ period }: {
|
|
247
|
+
export declare function useDashboardPeriod(config?: DashboardPeriodConfig): DashboardPeriodState | undefined;
|
|
248
|
+
export declare function DashboardPeriodFilter({ period }: {
|
|
232
249
|
period: DashboardPeriodState;
|
|
233
250
|
}): import("react").JSX.Element;
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region packages/dashboard/dashboard/useDashboardLayout.d.ts
|
|
236
251
|
interface HiddenWidgetEntry {
|
|
237
252
|
sectionId: string;
|
|
238
253
|
widget: DashboardWidget;
|
|
@@ -247,14 +262,10 @@ interface DashboardLayoutState {
|
|
|
247
262
|
moveWidget: (sectionId: string, widgetId: string, direction: -1 | 1) => void;
|
|
248
263
|
resetLayout: () => void;
|
|
249
264
|
}
|
|
250
|
-
declare function useDashboardLayout(dashboardId: string | undefined, sections: DashboardSection[], enabled: boolean): DashboardLayoutState | undefined;
|
|
251
|
-
|
|
252
|
-
//#region packages/dashboard/dashboard/DashboardLayoutControls.d.ts
|
|
253
|
-
declare function DashboardLayoutControls({ layout }: {
|
|
265
|
+
export declare function useDashboardLayout(dashboardId: string | undefined, sections: DashboardSection[], enabled: boolean): DashboardLayoutState | undefined;
|
|
266
|
+
export declare function DashboardLayoutControls({ layout }: {
|
|
254
267
|
layout: DashboardLayoutState;
|
|
255
268
|
}): import("react").JSX.Element;
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region packages/dashboard/dashboard/DashboardWidgetSlot.d.ts
|
|
258
269
|
type Props = {
|
|
259
270
|
widget: DashboardWidget;
|
|
260
271
|
data: Record<string, unknown>;
|
|
@@ -269,15 +280,11 @@ type Props = {
|
|
|
269
280
|
end: string;
|
|
270
281
|
};
|
|
271
282
|
};
|
|
272
|
-
declare function DashboardWidgetSlot({ widget, data, loading, editMode, onHide, onMoveUp, onMoveDown, period, periodParamNames }: Props): import("react").JSX.Element;
|
|
273
|
-
|
|
274
|
-
//#region packages/dashboard/dashboard/useDashboardData.d.ts
|
|
275
|
-
declare function useDashboardData(dataUrl?: string, refreshInterval?: number, period?: DashboardPeriodValue, periodParamNames?: {
|
|
283
|
+
export declare function DashboardWidgetSlot({ widget, data, loading, editMode, onHide, onMoveUp, onMoveDown, period, periodParamNames }: Props): import("react").JSX.Element;
|
|
284
|
+
export declare function useDashboardData(dataUrl?: string, refreshInterval?: number, period?: DashboardPeriodValue, periodParamNames?: {
|
|
276
285
|
start: string;
|
|
277
286
|
end: string;
|
|
278
287
|
}): DashboardDataResult;
|
|
279
|
-
//#endregion
|
|
280
|
-
//#region packages/dashboard/dashboard/useWidgetQuery.d.ts
|
|
281
288
|
interface WidgetQueryResult {
|
|
282
289
|
data: Record<string, unknown>;
|
|
283
290
|
loading: boolean;
|
|
@@ -289,22 +296,16 @@ interface WidgetQueryResult {
|
|
|
289
296
|
* blocking behind slower widgets. Returns `undefined` when the widget has no
|
|
290
297
|
* `query` configured, so callers fall back to the dashboard's shared data.
|
|
291
298
|
*/
|
|
292
|
-
declare function useWidgetQuery(query: WidgetQueryConfig | undefined, period: DashboardPeriodValue | undefined, periodParamNames?: {
|
|
299
|
+
export declare function useWidgetQuery(query: WidgetQueryConfig | undefined, period: DashboardPeriodValue | undefined, periodParamNames?: {
|
|
293
300
|
start: string;
|
|
294
301
|
end: string;
|
|
295
302
|
}): WidgetQueryResult | undefined;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
declare const
|
|
299
|
-
declare function getPeriodPreset(key: string, presets?: DashboardPeriodPreset[]): DashboardPeriodPreset | undefined;
|
|
300
|
-
//#endregion
|
|
301
|
-
//#region packages/dashboard/dashboard/defaults.d.ts
|
|
302
|
-
declare const DEFAULT_PERIOD_PARAM_NAMES: {
|
|
303
|
+
export declare const DEFAULT_PERIOD_PRESETS: DashboardPeriodPreset[];
|
|
304
|
+
export declare function getPeriodPreset(key: string, presets?: DashboardPeriodPreset[]): DashboardPeriodPreset | undefined;
|
|
305
|
+
export declare const DEFAULT_PERIOD_PARAM_NAMES: {
|
|
303
306
|
readonly start: "from";
|
|
304
307
|
readonly end: "to";
|
|
305
308
|
};
|
|
306
|
-
//#endregion
|
|
307
|
-
//#region packages/dashboard/dashboard/widgetRegistry.d.ts
|
|
308
309
|
interface WidgetViewProps<W extends DashboardWidget = DashboardWidget> {
|
|
309
310
|
widget: W;
|
|
310
311
|
data: Record<string, unknown>;
|
|
@@ -321,27 +322,18 @@ type WidgetComponent = ComponentType<WidgetViewProps<any>>;
|
|
|
321
322
|
* registerWidgetType('funnel', FunnelWidgetView);
|
|
322
323
|
* ```
|
|
323
324
|
*/
|
|
324
|
-
declare function registerWidgetType(type: string, component: WidgetComponent): void;
|
|
325
|
-
declare function getWidgetComponent(type: string): WidgetComponent | undefined;
|
|
326
|
-
declare function isWidgetTypeRegistered(type: string): boolean;
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
declare function
|
|
330
|
-
declare function
|
|
331
|
-
declare function
|
|
332
|
-
declare function
|
|
333
|
-
declare function
|
|
334
|
-
declare function
|
|
335
|
-
declare function
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
declare function resolveArray(source: unknown, path: string): Record<string, unknown>[];
|
|
340
|
-
//#endregion
|
|
341
|
-
//#region packages/dashboard/dashboard/formatValue.d.ts
|
|
342
|
-
declare function formatDashboardValue(value: unknown, format?: ValueFormat): string;
|
|
343
|
-
//#endregion
|
|
344
|
-
//#region packages/dashboard/dashboard/chartPalette.d.ts
|
|
345
|
-
declare const DEFAULT_CHART_COLORS: string[];
|
|
346
|
-
//#endregion
|
|
347
|
-
export { type AreaChartWidgetConfig, type BarChartWidgetConfig, type BaseWidgetConfig, CUSTOM_PERIOD_KEY, type ChartSeriesConfig, type CustomWidgetConfig, DEFAULT_CHART_COLORS, DEFAULT_PERIOD_PARAM_NAMES, DEFAULT_PERIOD_PRESETS, type DashboardConfig, type DashboardDataResult, DashboardLayoutControls, type DashboardLayoutState, DashboardPage, type DashboardPageProps, type DashboardPeriodConfig, DashboardPeriodFilter, type DashboardPeriodPreset, type DashboardPeriodState, type DashboardPeriodValue, type DashboardSection, type DashboardSectionLayout, type DashboardWidget, DashboardWidgetSlot, type DonutChartWidgetConfig, type HiddenWidgetEntry, type LineChartWidgetConfig, type ProgressWidgetConfig, type StatIconTone, type StatWidgetConfig, type TableColumnConfig, type TableViewAllConfig, type TableWidgetConfig, type TrendConfig, type ValueFormat, type WidgetComponent, type WidgetQueryConfig, type WidgetQueryResult, type WidgetViewProps, areaChartWidget, barChartWidget, defineDashboard, donutChartWidget, formatDashboardValue, getPeriodPreset, getWidgetComponent, isWidgetTypeRegistered, lineChartWidget, progressWidget, registerWidgetType, resolveArray, resolvePath, statWidget, tableWidget, useDashboardData, useDashboardLayout, useDashboardPeriod, useWidgetQuery };
|
|
325
|
+
export declare function registerWidgetType(type: string, component: WidgetComponent): void;
|
|
326
|
+
export declare function getWidgetComponent(type: string): WidgetComponent | undefined;
|
|
327
|
+
export declare function isWidgetTypeRegistered(type: string): boolean;
|
|
328
|
+
export declare function statWidget(config: Omit<StatWidgetConfig, 'type'>): StatWidgetConfig;
|
|
329
|
+
export declare function barChartWidget(config: Omit<BarChartWidgetConfig, 'type'>): BarChartWidgetConfig;
|
|
330
|
+
export declare function donutChartWidget(config: Omit<DonutChartWidgetConfig, 'type'>): DonutChartWidgetConfig;
|
|
331
|
+
export declare function tableWidget(config: Omit<TableWidgetConfig, 'type'>): TableWidgetConfig;
|
|
332
|
+
export declare function lineChartWidget(config: Omit<LineChartWidgetConfig, 'type'>): LineChartWidgetConfig;
|
|
333
|
+
export declare function areaChartWidget(config: Omit<AreaChartWidgetConfig, 'type'>): AreaChartWidgetConfig;
|
|
334
|
+
export declare function progressWidget(config: Omit<ProgressWidgetConfig, 'type'>): ProgressWidgetConfig;
|
|
335
|
+
export declare function resolvePath(source: unknown, path?: string): unknown;
|
|
336
|
+
export declare function resolveArray(source: unknown, path: string): Record<string, unknown>[];
|
|
337
|
+
export declare function formatDashboardValue(value: unknown, format?: ValueFormat): string;
|
|
338
|
+
export declare const DEFAULT_CHART_COLORS: string[];
|
|
339
|
+
export type { AreaChartWidgetConfig, BarChartWidgetConfig, BaseWidgetConfig, ChartSeriesConfig, CustomWidgetConfig, DashboardConfig, DashboardDataResult, DashboardLayoutState, DashboardPageProps, DashboardPeriodConfig, DashboardPeriodPreset, DashboardPeriodState, DashboardPeriodValue, DashboardSection, DashboardSectionLayout, DashboardWidget, DonutChartWidgetConfig, HiddenWidgetEntry, LineChartWidgetConfig, ProgressWidgetConfig, StatIconTone, StatWidgetConfig, TableColumnConfig, TableViewAllConfig, TableWidgetConfig, TrendConfig, ValueFormat, WidgetComponent, WidgetQueryConfig, WidgetQueryResult, WidgetViewProps };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as formatDashboardValue, n as resolveArray, r as resolvePath, t as DEFAULT_CHART_COLORS } from "./chartPalette-VDQwLcM-.mjs";
|
|
2
1
|
import { AppToolbar, Badge, DateRangePicker, EmptyState, IconButton, Popover, SegmentedControl, StatCard } from "@nubitio/ui";
|
|
3
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { Suspense, lazy, useCallback, useMemo, useState } from "react";
|
|
5
4
|
import { Link, useSearchParams } from "react-router-dom";
|
|
6
5
|
import { useQuery } from "@tanstack/react-query";
|
|
7
6
|
import { useCoreHttpClient } from "@nubitio/core";
|
|
8
|
-
|
|
7
|
+
import { i as formatDashboardValue, n as resolveArray, r as resolvePath, t as DEFAULT_CHART_COLORS } from "./chartPalette-CURlBJhy.mjs";
|
|
8
|
+
// packages/dashboard/dashboard/defineDashboard.ts
|
|
9
9
|
const dashboardCache = /* @__PURE__ */ new Map();
|
|
10
10
|
function cacheKey(config) {
|
|
11
11
|
try {
|
|
@@ -44,8 +44,7 @@ function defineDashboard(config) {
|
|
|
44
44
|
if (key !== null) dashboardCache.set(key, dashboard);
|
|
45
45
|
return dashboard;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
//#region packages/dashboard/dashboard/DashboardLayoutControls.tsx
|
|
47
|
+
// packages/dashboard/dashboard/DashboardLayoutControls.tsx
|
|
49
48
|
function DashboardLayoutControls({ layout }) {
|
|
50
49
|
return /* @__PURE__ */ jsxs("div", {
|
|
51
50
|
className: "nb-dashboard-layout-controls",
|
|
@@ -81,8 +80,7 @@ function DashboardLayoutControls({ layout }) {
|
|
|
81
80
|
]
|
|
82
81
|
});
|
|
83
82
|
}
|
|
84
|
-
|
|
85
|
-
//#region packages/dashboard/dashboard/periodPresets.ts
|
|
83
|
+
// packages/dashboard/dashboard/periodPresets.ts
|
|
86
84
|
const pad = (n) => String(n).padStart(2, "0");
|
|
87
85
|
const toIso = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
88
86
|
function daysAgo(today, days) {
|
|
@@ -141,8 +139,7 @@ const DEFAULT_PERIOD_PRESETS = [
|
|
|
141
139
|
function getPeriodPreset(key, presets = DEFAULT_PERIOD_PRESETS) {
|
|
142
140
|
return presets.find((preset) => preset.key === key);
|
|
143
141
|
}
|
|
144
|
-
|
|
145
|
-
//#region packages/dashboard/dashboard/useDashboardPeriod.ts
|
|
142
|
+
// packages/dashboard/dashboard/useDashboardPeriod.ts
|
|
146
143
|
const CUSTOM_PERIOD_KEY = "custom";
|
|
147
144
|
function useDashboardPeriod(config) {
|
|
148
145
|
const presets = config?.presets ?? DEFAULT_PERIOD_PRESETS;
|
|
@@ -204,8 +201,7 @@ function useDashboardPeriod(config) {
|
|
|
204
201
|
setCustomRange
|
|
205
202
|
};
|
|
206
203
|
}
|
|
207
|
-
|
|
208
|
-
//#region packages/dashboard/dashboard/DashboardPeriodFilter.tsx
|
|
204
|
+
// packages/dashboard/dashboard/DashboardPeriodFilter.tsx
|
|
209
205
|
function DashboardPeriodFilter({ period }) {
|
|
210
206
|
const { value, presets = [], allowCustomRange, setPreset, setCustomRange } = period;
|
|
211
207
|
const options = [...presets.map((preset) => ({
|
|
@@ -232,14 +228,12 @@ function DashboardPeriodFilter({ period }) {
|
|
|
232
228
|
})]
|
|
233
229
|
});
|
|
234
230
|
}
|
|
235
|
-
|
|
236
|
-
//#region packages/dashboard/dashboard/defaults.ts
|
|
231
|
+
// packages/dashboard/dashboard/defaults.ts
|
|
237
232
|
const DEFAULT_PERIOD_PARAM_NAMES = {
|
|
238
233
|
start: "from",
|
|
239
234
|
end: "to"
|
|
240
235
|
};
|
|
241
|
-
|
|
242
|
-
//#region packages/dashboard/dashboard/useWidgetQuery.ts
|
|
236
|
+
// packages/dashboard/dashboard/useWidgetQuery.ts
|
|
243
237
|
/**
|
|
244
238
|
* Fetches a single widget's data independently of the dashboard's shared
|
|
245
239
|
* payload — its own cache entry, its own loading/error state, no head-of-line
|
|
@@ -276,8 +270,7 @@ function useWidgetQuery(query, period, periodParamNames = DEFAULT_PERIOD_PARAM_N
|
|
|
276
270
|
error: result.error ? result.error instanceof Error ? result.error.message : "Failed to load widget" : null
|
|
277
271
|
};
|
|
278
272
|
}
|
|
279
|
-
|
|
280
|
-
//#region packages/dashboard/dashboard/widgetRegistry.ts
|
|
273
|
+
// packages/dashboard/dashboard/widgetRegistry.ts
|
|
281
274
|
const registry = /* @__PURE__ */ new Map();
|
|
282
275
|
/**
|
|
283
276
|
* Registers a component to render for `widget.type`. Built-in types (`stat`,
|
|
@@ -298,8 +291,7 @@ function getWidgetComponent(type) {
|
|
|
298
291
|
function isWidgetTypeRegistered(type) {
|
|
299
292
|
return registry.has(type);
|
|
300
293
|
}
|
|
301
|
-
|
|
302
|
-
//#region packages/dashboard/dashboard/widgets/BarChartWidgetView.tsx
|
|
294
|
+
// packages/dashboard/dashboard/widgets/BarChartWidgetView.tsx
|
|
303
295
|
function toNumber$2(value) {
|
|
304
296
|
const numeric = typeof value === "number" ? value : Number(value);
|
|
305
297
|
return Number.isFinite(numeric) ? numeric : 0;
|
|
@@ -347,8 +339,7 @@ function BarChartWidgetView({ widget, data, loading }) {
|
|
|
347
339
|
})
|
|
348
340
|
});
|
|
349
341
|
}
|
|
350
|
-
|
|
351
|
-
//#region packages/dashboard/dashboard/widgets/DonutChartWidgetView.tsx
|
|
342
|
+
// packages/dashboard/dashboard/widgets/DonutChartWidgetView.tsx
|
|
352
343
|
function toNumber$1(value) {
|
|
353
344
|
const numeric = typeof value === "number" ? value : Number(value);
|
|
354
345
|
return Number.isFinite(numeric) ? numeric : 0;
|
|
@@ -450,8 +441,7 @@ function DonutChartWidgetView({ widget, data, loading }) {
|
|
|
450
441
|
})
|
|
451
442
|
});
|
|
452
443
|
}
|
|
453
|
-
|
|
454
|
-
//#region packages/dashboard/dashboard/widgets/ProgressWidgetView.tsx
|
|
444
|
+
// packages/dashboard/dashboard/widgets/ProgressWidgetView.tsx
|
|
455
445
|
function toNumber(value, fallback) {
|
|
456
446
|
const numeric = typeof value === "number" ? value : Number(value);
|
|
457
447
|
return Number.isFinite(numeric) ? numeric : fallback;
|
|
@@ -492,8 +482,7 @@ function ProgressWidgetView({ widget, data, loading }) {
|
|
|
492
482
|
})]
|
|
493
483
|
});
|
|
494
484
|
}
|
|
495
|
-
|
|
496
|
-
//#region packages/dashboard/dashboard/widgets/StatWidgetView.tsx
|
|
485
|
+
// packages/dashboard/dashboard/widgets/StatWidgetView.tsx
|
|
497
486
|
function resolveTrend(widget, data) {
|
|
498
487
|
if (!widget.trend) return { value: null };
|
|
499
488
|
const raw = widget.trend.valuePath !== void 0 ? resolvePath(data, widget.trend.valuePath) : widget.trend.value;
|
|
@@ -538,8 +527,7 @@ function StatWidgetView({ widget, data, loading }) {
|
|
|
538
527
|
})
|
|
539
528
|
});
|
|
540
529
|
}
|
|
541
|
-
|
|
542
|
-
//#region packages/dashboard/dashboard/widgets/TableWidgetView.tsx
|
|
530
|
+
// packages/dashboard/dashboard/widgets/TableWidgetView.tsx
|
|
543
531
|
function renderCell(row, column) {
|
|
544
532
|
const raw = row[column.key];
|
|
545
533
|
if (column.badge) {
|
|
@@ -592,17 +580,15 @@ function TableWidgetView({ widget, data, loading }) {
|
|
|
592
580
|
})
|
|
593
581
|
});
|
|
594
582
|
}
|
|
595
|
-
|
|
596
|
-
//#region packages/dashboard/dashboard/widgets/registerBuiltinWidgets.ts
|
|
583
|
+
// packages/dashboard/dashboard/widgets/registerBuiltinWidgets.ts
|
|
597
584
|
registerWidgetType("stat", StatWidgetView);
|
|
598
585
|
registerWidgetType("bar-chart", BarChartWidgetView);
|
|
599
586
|
registerWidgetType("donut-chart", DonutChartWidgetView);
|
|
600
|
-
registerWidgetType("line-chart", lazy(() => import("./LineChartWidgetView-
|
|
601
|
-
registerWidgetType("area-chart", lazy(() => import("./AreaChartWidgetView-
|
|
587
|
+
registerWidgetType("line-chart", lazy(() => import("./LineChartWidgetView-DoYdAB5L.mjs").then((m) => ({ default: m.LineChartWidgetView }))));
|
|
588
|
+
registerWidgetType("area-chart", lazy(() => import("./AreaChartWidgetView-D4hSTjc_.mjs").then((m) => ({ default: m.AreaChartWidgetView }))));
|
|
602
589
|
registerWidgetType("progress", ProgressWidgetView);
|
|
603
590
|
registerWidgetType("table", TableWidgetView);
|
|
604
|
-
|
|
605
|
-
//#region packages/dashboard/dashboard/widgets/WidgetRenderer.tsx
|
|
591
|
+
// packages/dashboard/dashboard/widgets/WidgetRenderer.tsx
|
|
606
592
|
const isDev = typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
|
|
607
593
|
function WidgetRenderer({ widget, data, loading }) {
|
|
608
594
|
const Component = getWidgetComponent(widget.type);
|
|
@@ -622,8 +608,7 @@ function WidgetRenderer({ widget, data, loading }) {
|
|
|
622
608
|
})
|
|
623
609
|
});
|
|
624
610
|
}
|
|
625
|
-
|
|
626
|
-
//#region packages/dashboard/dashboard/DashboardWidgetSlot.tsx
|
|
611
|
+
// packages/dashboard/dashboard/DashboardWidgetSlot.tsx
|
|
627
612
|
function DashboardWidgetSlot({ widget, data, loading, editMode, onHide, onMoveUp, onMoveDown, period, periodParamNames = DEFAULT_PERIOD_PARAM_NAMES }) {
|
|
628
613
|
const widgetQuery = useWidgetQuery(widget.query, period, periodParamNames);
|
|
629
614
|
const effectiveData = widgetQuery ? widgetQuery.data : data;
|
|
@@ -679,8 +664,7 @@ function DashboardWidgetSlot({ widget, data, loading, editMode, onHide, onMoveUp
|
|
|
679
664
|
})]
|
|
680
665
|
});
|
|
681
666
|
}
|
|
682
|
-
|
|
683
|
-
//#region packages/dashboard/dashboard/useDashboardData.ts
|
|
667
|
+
// packages/dashboard/dashboard/useDashboardData.ts
|
|
684
668
|
function useDashboardData(dataUrl, refreshInterval, period, periodParamNames = DEFAULT_PERIOD_PARAM_NAMES) {
|
|
685
669
|
const http = useCoreHttpClient();
|
|
686
670
|
const params = period ? {
|
|
@@ -709,8 +693,7 @@ function useDashboardData(dataUrl, refreshInterval, period, periodParamNames = D
|
|
|
709
693
|
}
|
|
710
694
|
};
|
|
711
695
|
}
|
|
712
|
-
|
|
713
|
-
//#region packages/dashboard/dashboard/useDashboardLayout.ts
|
|
696
|
+
// packages/dashboard/dashboard/useDashboardLayout.ts
|
|
714
697
|
function storageKey(dashboardId) {
|
|
715
698
|
return `nb-dashboard-layout:${dashboardId}`;
|
|
716
699
|
}
|
|
@@ -813,8 +796,7 @@ function useDashboardLayout(dashboardId, sections, enabled) {
|
|
|
813
796
|
resetLayout
|
|
814
797
|
};
|
|
815
798
|
}
|
|
816
|
-
|
|
817
|
-
//#region packages/dashboard/dashboard/DashboardPage.tsx
|
|
799
|
+
// packages/dashboard/dashboard/DashboardPage.tsx
|
|
818
800
|
function sectionClassName(section) {
|
|
819
801
|
return `nb-dashboard-section nb-dashboard-section--${section.layout ?? "grid"}`;
|
|
820
802
|
}
|
|
@@ -878,8 +860,7 @@ function DashboardPage({ config }) {
|
|
|
878
860
|
})]
|
|
879
861
|
});
|
|
880
862
|
}
|
|
881
|
-
|
|
882
|
-
//#region packages/dashboard/dashboard/widgetBuilders.ts
|
|
863
|
+
// packages/dashboard/dashboard/widgetBuilders.ts
|
|
883
864
|
function statWidget(config) {
|
|
884
865
|
return {
|
|
885
866
|
type: "stat",
|
|
@@ -939,5 +920,4 @@ function progressWidget(config) {
|
|
|
939
920
|
...config
|
|
940
921
|
};
|
|
941
922
|
}
|
|
942
|
-
//#endregion
|
|
943
923
|
export { CUSTOM_PERIOD_KEY, DEFAULT_CHART_COLORS, DEFAULT_PERIOD_PARAM_NAMES, DEFAULT_PERIOD_PRESETS, DashboardLayoutControls, DashboardPage, DashboardPeriodFilter, DashboardWidgetSlot, areaChartWidget, barChartWidget, defineDashboard, donutChartWidget, formatDashboardValue, getPeriodPreset, getWidgetComponent, isWidgetTypeRegistered, lineChartWidget, progressWidget, registerWidgetType, resolveArray, resolvePath, statWidget, tableWidget, useDashboardData, useDashboardLayout, useDashboardPeriod, useWidgetQuery };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubitio/dashboard",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Declarative dashboard engine with stat cards, charts, and data tables for Nubit admin apps.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"react-dom": "^18.2.0 || ^19.0.0",
|
|
57
57
|
"react-router-dom": "^6.0.0 || ^7.0.0",
|
|
58
58
|
"recharts": "^3.0.0",
|
|
59
|
-
"@nubitio/
|
|
60
|
-
"@nubitio/
|
|
59
|
+
"@nubitio/core": "^1.4.0",
|
|
60
|
+
"@nubitio/ui": "^1.4.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@tanstack/react-query": "^5.
|
|
64
|
-
"react-router-dom": "^
|
|
65
|
-
"recharts": "^3.
|
|
63
|
+
"@tanstack/react-query": "^5.108.0",
|
|
64
|
+
"react-router-dom": "^7.18.6",
|
|
65
|
+
"recharts": "^3.11.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"recharts": {
|