@solidxai/core-ui 0.1.9-beta.14 → 0.1.9-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/components/core/dashboard/mappers/echartsOptionMapper.d.ts +4 -0
  2. package/dist/components/core/dashboard/mappers/echartsOptionMapper.d.ts.map +1 -0
  3. package/dist/components/core/dashboard/mappers/echartsOptionMapper.js +76 -0
  4. package/dist/components/core/dashboard/mappers/echartsOptionMapper.js.map +1 -0
  5. package/dist/components/core/dashboard/mappers/echartsOptionMapper.ts +78 -0
  6. package/dist/components/core/dashboard/widgets/DefaultDashboardBarChartWidget.d.ts +3 -0
  7. package/dist/components/core/dashboard/widgets/DefaultDashboardBarChartWidget.d.ts.map +1 -0
  8. package/dist/components/core/dashboard/widgets/DefaultDashboardBarChartWidget.js +17 -0
  9. package/dist/components/core/dashboard/widgets/DefaultDashboardBarChartWidget.js.map +1 -0
  10. package/dist/components/core/dashboard/widgets/DefaultDashboardBarChartWidget.tsx +6 -0
  11. package/dist/components/core/dashboard/widgets/DefaultDashboardChartWidget.d.ts +3 -0
  12. package/dist/components/core/dashboard/widgets/DefaultDashboardChartWidget.d.ts.map +1 -0
  13. package/dist/components/core/dashboard/widgets/DefaultDashboardChartWidget.js +41 -0
  14. package/dist/components/core/dashboard/widgets/DefaultDashboardChartWidget.js.map +1 -0
  15. package/dist/components/core/dashboard/widgets/DefaultDashboardChartWidget.tsx +56 -0
  16. package/dist/components/core/dashboard/widgets/DefaultDashboardKpiWidget.d.ts +3 -0
  17. package/dist/components/core/dashboard/widgets/DefaultDashboardKpiWidget.d.ts.map +1 -0
  18. package/dist/components/core/dashboard/widgets/DefaultDashboardKpiWidget.js +9 -0
  19. package/dist/components/core/dashboard/widgets/DefaultDashboardKpiWidget.js.map +1 -0
  20. package/dist/components/core/dashboard/widgets/DefaultDashboardKpiWidget.tsx +7 -0
  21. package/dist/components/core/dashboard/widgets/DefaultDashboardLineChartWidget.d.ts +3 -0
  22. package/dist/components/core/dashboard/widgets/DefaultDashboardLineChartWidget.d.ts.map +1 -0
  23. package/dist/components/core/dashboard/widgets/DefaultDashboardLineChartWidget.js +17 -0
  24. package/dist/components/core/dashboard/widgets/DefaultDashboardLineChartWidget.js.map +1 -0
  25. package/dist/components/core/dashboard/widgets/DefaultDashboardLineChartWidget.tsx +6 -0
  26. package/dist/components/core/dashboard/widgets/DefaultDashboardPieChartWidget.d.ts +3 -0
  27. package/dist/components/core/dashboard/widgets/DefaultDashboardPieChartWidget.d.ts.map +1 -0
  28. package/dist/components/core/dashboard/widgets/DefaultDashboardPieChartWidget.js +17 -0
  29. package/dist/components/core/dashboard/widgets/DefaultDashboardPieChartWidget.js.map +1 -0
  30. package/dist/components/core/dashboard/widgets/DefaultDashboardPieChartWidget.tsx +6 -0
  31. package/dist/components/core/dashboard/widgets/DefaultDashboardTableWidget.d.ts +3 -0
  32. package/dist/components/core/dashboard/widgets/DefaultDashboardTableWidget.d.ts.map +1 -0
  33. package/dist/components/core/dashboard/widgets/DefaultDashboardTableWidget.js +12 -0
  34. package/dist/components/core/dashboard/widgets/DefaultDashboardTableWidget.js.map +1 -0
  35. package/dist/components/core/dashboard/widgets/DefaultDashboardTableWidget.tsx +39 -0
  36. package/dist/components/core/dashboard/widgets/DefaultDashboardUnknownWidget.d.ts +3 -0
  37. package/dist/components/core/dashboard/widgets/DefaultDashboardUnknownWidget.d.ts.map +1 -0
  38. package/dist/components/core/dashboard/widgets/DefaultDashboardUnknownWidget.js +7 -0
  39. package/dist/components/core/dashboard/widgets/DefaultDashboardUnknownWidget.js.map +1 -0
  40. package/dist/components/core/dashboard/widgets/DefaultDashboardUnknownWidget.tsx +9 -0
  41. package/dist/components/core/dashboard/widgets/QueueSlaHeatmapWidget.d.ts +3 -0
  42. package/dist/components/core/dashboard/widgets/QueueSlaHeatmapWidget.d.ts.map +1 -0
  43. package/dist/components/core/dashboard/widgets/QueueSlaHeatmapWidget.js +159 -0
  44. package/dist/components/core/dashboard/widgets/QueueSlaHeatmapWidget.js.map +1 -0
  45. package/dist/components/core/dashboard/widgets/QueueSlaHeatmapWidget.tsx +205 -0
  46. package/dist/helpers/registry.d.ts.map +1 -1
  47. package/dist/helpers/registry.js +15 -10
  48. package/dist/helpers/registry.js.map +1 -1
  49. package/dist/helpers/registry.ts +16 -12
  50. package/dist/index.d.ts +4 -7
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +3 -7
  53. package/dist/index.js.map +1 -1
  54. package/dist/index.ts +12 -13
  55. package/dist/redux/api/dashboardRuntimeApi.d.ts +34 -0
  56. package/dist/redux/api/dashboardRuntimeApi.d.ts.map +1 -0
  57. package/dist/redux/api/dashboardRuntimeApi.js +79 -0
  58. package/dist/redux/api/dashboardRuntimeApi.js.map +1 -0
  59. package/dist/redux/api/dashboardRuntimeApi.ts +75 -0
  60. package/dist/redux/store/defaultStoreConfig.d.ts +34 -9
  61. package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
  62. package/dist/redux/store/defaultStoreConfig.js +2 -6
  63. package/dist/redux/store/defaultStoreConfig.js.map +1 -1
  64. package/dist/redux/store/defaultStoreConfig.ts +2 -6
  65. package/dist/routes/pages/admin/core/DashboardPage.d.ts +1 -0
  66. package/dist/routes/pages/admin/core/DashboardPage.d.ts.map +1 -1
  67. package/dist/routes/pages/admin/core/DashboardPage.js +780 -5
  68. package/dist/routes/pages/admin/core/DashboardPage.js.map +1 -1
  69. package/dist/routes/pages/admin/core/DashboardPage.module.css +186 -0
  70. package/dist/routes/pages/admin/core/DashboardPage.tsx +898 -7
  71. package/dist/routes/solidRoutes.d.ts.map +1 -1
  72. package/dist/routes/solidRoutes.js +2 -2
  73. package/dist/routes/solidRoutes.js.map +1 -1
  74. package/dist/routes/solidRoutes.tsx +2 -2
  75. package/dist/routes/types.d.ts +1 -1
  76. package/dist/routes/types.d.ts.map +1 -1
  77. package/dist/routes/types.js.map +1 -1
  78. package/dist/routes/types.ts +1 -1
  79. package/dist/types/dashboard.d.ts +16 -0
  80. package/dist/types/dashboard.d.ts.map +1 -0
  81. package/dist/types/dashboard.js +2 -0
  82. package/dist/types/dashboard.js.map +1 -0
  83. package/dist/types/dashboard.ts +23 -0
  84. package/dist/types/extension-registry.d.ts +1 -0
  85. package/dist/types/extension-registry.d.ts.map +1 -1
  86. package/dist/types/extension-registry.js +1 -0
  87. package/dist/types/extension-registry.js.map +1 -1
  88. package/dist/types/extension-registry.ts +1 -0
  89. package/package.json +3 -1
@@ -0,0 +1,4 @@
1
+ import type { EChartsOption } from "echarts";
2
+ export declare const resolveChartType: (definition: any) => "line" | "bar" | "pie" | "unknown";
3
+ export declare const toEChartsOption: (definition: any, runtimeData: any) => EChartsOption;
4
+ //# sourceMappingURL=echartsOptionMapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echartsOptionMapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/mappers/echartsOptionMapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAY7C,eAAO,MAAM,gBAAgB,eAAgB,GAAG,KAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,SAM3E,CAAC;AAYF,eAAO,MAAM,eAAe,eAAgB,GAAG,eAAe,GAAG,KAAG,aA+CnE,CAAC"}
@@ -0,0 +1,76 @@
1
+ var readType = function (definition) {
2
+ var _a, _b, _c, _d, _e, _f;
3
+ var raw = (_f = (_e = (_d = (_b = (_a = definition === null || definition === void 0 ? void 0 : definition.visualization) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : (_c = definition === null || definition === void 0 ? void 0 : definition.visualization) === null || _c === void 0 ? void 0 : _c.chartType) !== null && _d !== void 0 ? _d : definition === null || definition === void 0 ? void 0 : definition.type) !== null && _e !== void 0 ? _e : definition === null || definition === void 0 ? void 0 : definition.widgetType) !== null && _f !== void 0 ? _f : "";
4
+ return "".concat(raw).toLowerCase();
5
+ };
6
+ export var resolveChartType = function (definition) {
7
+ var type = readType(definition);
8
+ if (type.includes("line"))
9
+ return "line";
10
+ if (type.includes("bar"))
11
+ return "bar";
12
+ if (type.includes("pie") || type.includes("donut") || type.includes("doughnut"))
13
+ return "pie";
14
+ return "unknown";
15
+ };
16
+ var seriesFromRuntime = function (runtimeData, forcedType) {
17
+ var source = Array.isArray(runtimeData === null || runtimeData === void 0 ? void 0 : runtimeData.series) ? runtimeData.series : [];
18
+ return source.map(function (entry) {
19
+ var _a;
20
+ return ({
21
+ name: (_a = entry === null || entry === void 0 ? void 0 : entry.name) !== null && _a !== void 0 ? _a : "",
22
+ type: forcedType,
23
+ smooth: forcedType === "line",
24
+ data: Array.isArray(entry === null || entry === void 0 ? void 0 : entry.data) ? entry.data : [],
25
+ });
26
+ });
27
+ };
28
+ export var toEChartsOption = function (definition, runtimeData) {
29
+ var chartType = resolveChartType(definition);
30
+ if (chartType === "pie") {
31
+ var items = Array.isArray(runtimeData === null || runtimeData === void 0 ? void 0 : runtimeData.items) ? runtimeData.items : [];
32
+ return {
33
+ tooltip: { trigger: "item" },
34
+ legend: { top: 0 },
35
+ series: [
36
+ {
37
+ type: "pie",
38
+ radius: ["42%", "70%"],
39
+ avoidLabelOverlap: true,
40
+ itemStyle: { borderRadius: 6, borderColor: "#fff", borderWidth: 1 },
41
+ label: { show: true, formatter: "{b}: {d}%" },
42
+ data: items.map(function (item) {
43
+ var _a, _b, _c;
44
+ return ({
45
+ name: (_b = (_a = item === null || item === void 0 ? void 0 : item.name) !== null && _a !== void 0 ? _a : item === null || item === void 0 ? void 0 : item.label) !== null && _b !== void 0 ? _b : "",
46
+ value: (_c = item === null || item === void 0 ? void 0 : item.value) !== null && _c !== void 0 ? _c : 0,
47
+ });
48
+ }),
49
+ },
50
+ ],
51
+ };
52
+ }
53
+ if (chartType === "line" || chartType === "bar") {
54
+ return {
55
+ tooltip: { trigger: "axis" },
56
+ legend: { top: 0 },
57
+ grid: { left: 20, right: 20, bottom: 24, top: 36, containLabel: true },
58
+ xAxis: {
59
+ type: "category",
60
+ boundaryGap: chartType === "bar",
61
+ data: Array.isArray(runtimeData === null || runtimeData === void 0 ? void 0 : runtimeData.categories) ? runtimeData.categories : [],
62
+ },
63
+ yAxis: { type: "value" },
64
+ series: seriesFromRuntime(runtimeData, chartType),
65
+ };
66
+ }
67
+ return {
68
+ title: {
69
+ text: "Unsupported chart type",
70
+ left: "center",
71
+ top: "middle",
72
+ textStyle: { fontSize: 12, fontWeight: "normal", color: "#64748b" },
73
+ },
74
+ };
75
+ };
76
+ //# sourceMappingURL=echartsOptionMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echartsOptionMapper.js","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/mappers/echartsOptionMapper.ts"],"names":[],"mappings":"AAEA,IAAM,QAAQ,GAAG,UAAC,UAAe;;IAC/B,IAAM,GAAG,GACP,MAAA,MAAA,MAAA,MAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,aAAa,0CAAE,IAAI,mCAC/B,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,aAAa,0CAAE,SAAS,mCACpC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,mCAChB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,mCACtB,EAAE,CAAC;IACL,OAAO,UAAG,GAAG,CAAE,CAAC,WAAW,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,UAAe;IAC9C,IAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IAClC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACzC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI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AAE;YACxB,MAAM,EAAE,iBAAiB,CAAC,WAAW,EAAE,SAAS,CAAC;SAClD,CAAC;KACH;IAED,OAAO;QACL,KAAK,EAAE;YACL,IAAI,EAAE,wBAAwB;YAC9B,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,QAAQ;YACb,SAAS,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE;SACpE;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { EChartsOption } from \"echarts\";\n\nconst readType = (definition: any): string => {\n const raw =\n definition?.visualization?.type ??\n definition?.visualization?.chartType ??\n definition?.type ??\n definition?.widgetType ??\n \"\";\n return `${raw}`.toLowerCase();\n};\n\nexport const resolveChartType = (definition: any): \"line\" | \"bar\" | \"pie\" | \"unknown\" => {\n const type = readType(definition);\n if (type.includes(\"line\")) return \"line\";\n if (type.includes(\"bar\")) return \"bar\";\n if (type.includes(\"pie\") || type.includes(\"donut\") || type.includes(\"doughnut\")) return \"pie\";\n return \"unknown\";\n};\n\nconst seriesFromRuntime = (runtimeData: any, forcedType: \"line\" | \"bar\"): any[] => {\n const source = Array.isArray(runtimeData?.series) ? runtimeData.series : [];\n return source.map((entry: any) => ({\n name: entry?.name ?? \"\",\n type: forcedType,\n smooth: forcedType === \"line\",\n data: Array.isArray(entry?.data) ? entry.data : [],\n }));\n};\n\nexport const toEChartsOption = (definition: any, runtimeData: any): EChartsOption => {\n const chartType = resolveChartType(definition);\n\n if (chartType === \"pie\") {\n const items = Array.isArray(runtimeData?.items) ? runtimeData.items : [];\n return {\n tooltip: { trigger: \"item\" },\n legend: { top: 0 },\n series: [\n {\n type: \"pie\",\n radius: [\"42%\", \"70%\"],\n avoidLabelOverlap: true,\n itemStyle: { borderRadius: 6, borderColor: \"#fff\", borderWidth: 1 },\n label: { show: true, formatter: \"{b}: {d}%\" },\n data: items.map((item: any) => ({\n name: item?.name ?? item?.label ?? \"\",\n value: item?.value ?? 0,\n })),\n },\n ],\n };\n }\n\n if (chartType === \"line\" || chartType === \"bar\") {\n return {\n tooltip: { trigger: \"axis\" },\n legend: { top: 0 },\n grid: { left: 20, right: 20, bottom: 24, top: 36, containLabel: true },\n xAxis: {\n type: \"category\",\n boundaryGap: chartType === \"bar\",\n data: Array.isArray(runtimeData?.categories) ? runtimeData.categories : [],\n },\n yAxis: { type: \"value\" },\n series: seriesFromRuntime(runtimeData, chartType),\n };\n }\n\n return {\n title: {\n text: \"Unsupported chart type\",\n left: \"center\",\n top: \"middle\",\n textStyle: { fontSize: 12, fontWeight: \"normal\", color: \"#64748b\" },\n },\n };\n};\n"]}
@@ -0,0 +1,78 @@
1
+ import type { EChartsOption } from "echarts";
2
+
3
+ const readType = (definition: any): string => {
4
+ const raw =
5
+ definition?.visualization?.type ??
6
+ definition?.visualization?.chartType ??
7
+ definition?.type ??
8
+ definition?.widgetType ??
9
+ "";
10
+ return `${raw}`.toLowerCase();
11
+ };
12
+
13
+ export const resolveChartType = (definition: any): "line" | "bar" | "pie" | "unknown" => {
14
+ const type = readType(definition);
15
+ if (type.includes("line")) return "line";
16
+ if (type.includes("bar")) return "bar";
17
+ if (type.includes("pie") || type.includes("donut") || type.includes("doughnut")) return "pie";
18
+ return "unknown";
19
+ };
20
+
21
+ const seriesFromRuntime = (runtimeData: any, forcedType: "line" | "bar"): any[] => {
22
+ const source = Array.isArray(runtimeData?.series) ? runtimeData.series : [];
23
+ return source.map((entry: any) => ({
24
+ name: entry?.name ?? "",
25
+ type: forcedType,
26
+ smooth: forcedType === "line",
27
+ data: Array.isArray(entry?.data) ? entry.data : [],
28
+ }));
29
+ };
30
+
31
+ export const toEChartsOption = (definition: any, runtimeData: any): EChartsOption => {
32
+ const chartType = resolveChartType(definition);
33
+
34
+ if (chartType === "pie") {
35
+ const items = Array.isArray(runtimeData?.items) ? runtimeData.items : [];
36
+ return {
37
+ tooltip: { trigger: "item" },
38
+ legend: { top: 0 },
39
+ series: [
40
+ {
41
+ type: "pie",
42
+ radius: ["42%", "70%"],
43
+ avoidLabelOverlap: true,
44
+ itemStyle: { borderRadius: 6, borderColor: "#fff", borderWidth: 1 },
45
+ label: { show: true, formatter: "{b}: {d}%" },
46
+ data: items.map((item: any) => ({
47
+ name: item?.name ?? item?.label ?? "",
48
+ value: item?.value ?? 0,
49
+ })),
50
+ },
51
+ ],
52
+ };
53
+ }
54
+
55
+ if (chartType === "line" || chartType === "bar") {
56
+ return {
57
+ tooltip: { trigger: "axis" },
58
+ legend: { top: 0 },
59
+ grid: { left: 20, right: 20, bottom: 24, top: 36, containLabel: true },
60
+ xAxis: {
61
+ type: "category",
62
+ boundaryGap: chartType === "bar",
63
+ data: Array.isArray(runtimeData?.categories) ? runtimeData.categories : [],
64
+ },
65
+ yAxis: { type: "value" },
66
+ series: seriesFromRuntime(runtimeData, chartType),
67
+ };
68
+ }
69
+
70
+ return {
71
+ title: {
72
+ text: "Unsupported chart type",
73
+ left: "center",
74
+ top: "middle",
75
+ textStyle: { fontSize: 12, fontWeight: "normal", color: "#64748b" },
76
+ },
77
+ };
78
+ };
@@ -0,0 +1,3 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ export declare function DefaultDashboardBarChartWidget(props: DashboardWidgetComponentProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=DefaultDashboardBarChartWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardBarChartWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardBarChartWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAGjF,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,6BAA6B,2CAElF"}
@@ -0,0 +1,17 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { DefaultDashboardChartWidget } from "./DefaultDashboardChartWidget";
14
+ export function DefaultDashboardBarChartWidget(props) {
15
+ return _jsx(DefaultDashboardChartWidget, __assign({}, props));
16
+ }
17
+ //# sourceMappingURL=DefaultDashboardBarChartWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardBarChartWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardBarChartWidget.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,MAAM,UAAU,8BAA8B,CAAC,KAAoC;IACjF,OAAO,KAAC,2BAA2B,eAAK,KAAK,EAAI,CAAC;AACpD,CAAC","sourcesContent":["import type { DashboardWidgetComponentProps } from \"../../../../types/dashboard\";\nimport { DefaultDashboardChartWidget } from \"./DefaultDashboardChartWidget\";\n\nexport function DefaultDashboardBarChartWidget(props: DashboardWidgetComponentProps) {\n return <DefaultDashboardChartWidget {...props} />;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ import { DefaultDashboardChartWidget } from "./DefaultDashboardChartWidget";
3
+
4
+ export function DefaultDashboardBarChartWidget(props: DashboardWidgetComponentProps) {
5
+ return <DefaultDashboardChartWidget {...props} />;
6
+ }
@@ -0,0 +1,3 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ export declare function DefaultDashboardChartWidget({ definition, runtime }: DashboardWidgetComponentProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=DefaultDashboardChartWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardChartWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardChartWidget.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAGjF,wBAAgB,2BAA2B,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,6BAA6B,2CAkDjG"}
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from "react";
3
+ import ReactECharts from "echarts-for-react";
4
+ import { toEChartsOption } from "../mappers/echartsOptionMapper";
5
+ export function DefaultDashboardChartWidget(_a) {
6
+ var _b, _c;
7
+ var definition = _a.definition, runtime = _a.runtime;
8
+ var chartRef = useRef(null);
9
+ var containerRef = useRef(null);
10
+ var option = toEChartsOption(definition, (_c = (_b = runtime === null || runtime === void 0 ? void 0 : runtime.data) !== null && _b !== void 0 ? _b : runtime) !== null && _c !== void 0 ? _c : {});
11
+ useEffect(function () {
12
+ var _a, _b;
13
+ var resizeChart = function () {
14
+ var _a, _b, _c, _d;
15
+ try {
16
+ (_d = (_c = (_b = (_a = chartRef.current) === null || _a === void 0 ? void 0 : _a.getEchartsInstance) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.resize) === null || _d === void 0 ? void 0 : _d.call(_c, { width: "auto", height: "auto" });
17
+ }
18
+ catch (_e) {
19
+ // no-op: chart may not be ready yet
20
+ }
21
+ };
22
+ var observedElement = (_b = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.closest(".grid-stack-item-content")) !== null && _b !== void 0 ? _b : containerRef.current;
23
+ var observer = typeof ResizeObserver !== "undefined" && observedElement
24
+ ? new ResizeObserver(function () { return resizeChart(); })
25
+ : null;
26
+ if (observer && observedElement) {
27
+ observer.observe(observedElement);
28
+ }
29
+ var rafId = window.requestAnimationFrame(resizeChart);
30
+ var timeoutId = window.setTimeout(resizeChart, 120);
31
+ var timeoutIdLong = window.setTimeout(resizeChart, 320);
32
+ return function () {
33
+ window.cancelAnimationFrame(rafId);
34
+ window.clearTimeout(timeoutId);
35
+ window.clearTimeout(timeoutIdLong);
36
+ observer === null || observer === void 0 ? void 0 : observer.disconnect();
37
+ };
38
+ }, [option]);
39
+ return (_jsx("div", { ref: containerRef, style: { width: "100%", height: "100%", minHeight: 240, flex: 1 }, children: _jsx(ReactECharts, { ref: chartRef, option: option, style: { width: "100%", height: "100%", minHeight: 240 }, notMerge: true, lazyUpdate: true, autoResize: true }) }));
40
+ }
41
+ //# sourceMappingURL=DefaultDashboardChartWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardChartWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardChartWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,UAAU,2BAA2B,CAAC,EAAsD;;QAApD,UAAU,gBAAA,EAAE,OAAO,aAAA;IAC/D,IAAM,QAAQ,GAAG,MAAM,CAAM,IAAI,CAAC,CAAC;IACnC,IAAM,YAAY,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACzD,IAAM,MAAM,GAAG,eAAe,CAAC,UAAU,EAAE,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,mCAAI,OAAO,mCAAI,EAAE,CAAC,CAAC;IAE3E,SAAS,CAAC;;QACR,IAAM,WAAW,GAAG;;YAClB,IAAI;gBACF,MAAA,MAAA,MAAA,MAAA,QAAQ,CAAC,OAAO,0CAAE,kBAAkB,kDAAI,0CAAE,MAAM,mDAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;aACvF;YAAC,WAAM;gBACN,oCAAo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E,GAAG,EAAE,EACxD,QAAQ,QACR,UAAU,QACV,UAAU,SACV,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useRef } from \"react\";\nimport ReactECharts from \"echarts-for-react\";\nimport type { DashboardWidgetComponentProps } from \"../../../../types/dashboard\";\nimport { toEChartsOption } from \"../mappers/echartsOptionMapper\";\n\nexport function DefaultDashboardChartWidget({ definition, runtime }: DashboardWidgetComponentProps) {\n const chartRef = useRef<any>(null);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const option = toEChartsOption(definition, runtime?.data ?? runtime ?? {});\n\n useEffect(() => {\n const resizeChart = () => {\n try {\n chartRef.current?.getEchartsInstance?.()?.resize?.({ width: \"auto\", height: \"auto\" });\n } catch {\n // no-op: chart may not be ready yet\n }\n };\n\n const observedElement =\n containerRef.current?.closest(\".grid-stack-item-content\") as HTMLElement | null ??\n containerRef.current;\n\n const observer = typeof ResizeObserver !== \"undefined\" && observedElement\n ? new ResizeObserver(() => resizeChart())\n : null;\n\n if (observer && observedElement) {\n observer.observe(observedElement);\n }\n\n const rafId = window.requestAnimationFrame(resizeChart);\n const timeoutId = window.setTimeout(resizeChart, 120);\n const timeoutIdLong = window.setTimeout(resizeChart, 320);\n\n return () => {\n window.cancelAnimationFrame(rafId);\n window.clearTimeout(timeoutId);\n window.clearTimeout(timeoutIdLong);\n observer?.disconnect();\n };\n }, [option]);\n\n return (\n <div ref={containerRef} style={{ width: \"100%\", height: \"100%\", minHeight: 240, flex: 1 }}>\n <ReactECharts\n ref={chartRef}\n option={option}\n style={{ width: \"100%\", height: \"100%\", minHeight: 240 }}\n notMerge\n lazyUpdate\n autoResize\n />\n </div>\n );\n}\n"]}
@@ -0,0 +1,56 @@
1
+ import { useEffect, useRef } from "react";
2
+ import ReactECharts from "echarts-for-react";
3
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
4
+ import { toEChartsOption } from "../mappers/echartsOptionMapper";
5
+
6
+ export function DefaultDashboardChartWidget({ definition, runtime }: DashboardWidgetComponentProps) {
7
+ const chartRef = useRef<any>(null);
8
+ const containerRef = useRef<HTMLDivElement | null>(null);
9
+ const option = toEChartsOption(definition, runtime?.data ?? runtime ?? {});
10
+
11
+ useEffect(() => {
12
+ const resizeChart = () => {
13
+ try {
14
+ chartRef.current?.getEchartsInstance?.()?.resize?.({ width: "auto", height: "auto" });
15
+ } catch {
16
+ // no-op: chart may not be ready yet
17
+ }
18
+ };
19
+
20
+ const observedElement =
21
+ containerRef.current?.closest(".grid-stack-item-content") as HTMLElement | null ??
22
+ containerRef.current;
23
+
24
+ const observer = typeof ResizeObserver !== "undefined" && observedElement
25
+ ? new ResizeObserver(() => resizeChart())
26
+ : null;
27
+
28
+ if (observer && observedElement) {
29
+ observer.observe(observedElement);
30
+ }
31
+
32
+ const rafId = window.requestAnimationFrame(resizeChart);
33
+ const timeoutId = window.setTimeout(resizeChart, 120);
34
+ const timeoutIdLong = window.setTimeout(resizeChart, 320);
35
+
36
+ return () => {
37
+ window.cancelAnimationFrame(rafId);
38
+ window.clearTimeout(timeoutId);
39
+ window.clearTimeout(timeoutIdLong);
40
+ observer?.disconnect();
41
+ };
42
+ }, [option]);
43
+
44
+ return (
45
+ <div ref={containerRef} style={{ width: "100%", height: "100%", minHeight: 240, flex: 1 }}>
46
+ <ReactECharts
47
+ ref={chartRef}
48
+ option={option}
49
+ style={{ width: "100%", height: "100%", minHeight: 240 }}
50
+ notMerge
51
+ lazyUpdate
52
+ autoResize
53
+ />
54
+ </div>
55
+ );
56
+ }
@@ -0,0 +1,3 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ export declare function DefaultDashboardKpiWidget({ runtime }: DashboardWidgetComponentProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=DefaultDashboardKpiWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardKpiWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardKpiWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAEjF,wBAAgB,yBAAyB,CAAC,EAAE,OAAO,EAAE,EAAE,6BAA6B,2CAInF"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function DefaultDashboardKpiWidget(_a) {
3
+ var _b, _c, _d, _e, _f;
4
+ var runtime = _a.runtime;
5
+ var value = (_d = (_c = (_b = runtime === null || runtime === void 0 ? void 0 : runtime.data) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : runtime === null || runtime === void 0 ? void 0 : runtime.value) !== null && _d !== void 0 ? _d : "--";
6
+ var suffix = (_f = (_e = runtime === null || runtime === void 0 ? void 0 : runtime.uiHints) === null || _e === void 0 ? void 0 : _e.suffix) !== null && _f !== void 0 ? _f : "";
7
+ return _jsx("div", { style: { fontSize: "1.9rem", fontWeight: 700 }, children: "".concat(value).concat(suffix) });
8
+ }
9
+ //# sourceMappingURL=DefaultDashboardKpiWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardKpiWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardKpiWidget.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,yBAAyB,CAAC,EAA0C;;QAAxC,OAAO,aAAA;IACjD,IAAM,KAAK,GAAG,MAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,KAAK,mCAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,IAAI,CAAC;IAC7D,IAAM,MAAM,GAAG,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,0CAAE,MAAM,mCAAI,EAAE,CAAC;IAC9C,OAAO,cAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,YAAG,UAAG,KAAK,SAAG,MAAM,CAAE,GAAO,CAAC;AAC1F,CAAC","sourcesContent":["import type { DashboardWidgetComponentProps } from \"../../../../types/dashboard\";\n\nexport function DefaultDashboardKpiWidget({ runtime }: DashboardWidgetComponentProps) {\n const value = runtime?.data?.value ?? runtime?.value ?? \"--\";\n const suffix = runtime?.uiHints?.suffix ?? \"\";\n return <div style={{ fontSize: \"1.9rem\", fontWeight: 700 }}>{`${value}${suffix}`}</div>;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+
3
+ export function DefaultDashboardKpiWidget({ runtime }: DashboardWidgetComponentProps) {
4
+ const value = runtime?.data?.value ?? runtime?.value ?? "--";
5
+ const suffix = runtime?.uiHints?.suffix ?? "";
6
+ return <div style={{ fontSize: "1.9rem", fontWeight: 700 }}>{`${value}${suffix}`}</div>;
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ export declare function DefaultDashboardLineChartWidget(props: DashboardWidgetComponentProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=DefaultDashboardLineChartWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardLineChartWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardLineChartWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAGjF,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,6BAA6B,2CAEnF"}
@@ -0,0 +1,17 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { DefaultDashboardChartWidget } from "./DefaultDashboardChartWidget";
14
+ export function DefaultDashboardLineChartWidget(props) {
15
+ return _jsx(DefaultDashboardChartWidget, __assign({}, props));
16
+ }
17
+ //# sourceMappingURL=DefaultDashboardLineChartWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardLineChartWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardLineChartWidget.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,MAAM,UAAU,+BAA+B,CAAC,KAAoC;IAClF,OAAO,KAAC,2BAA2B,eAAK,KAAK,EAAI,CAAC;AACpD,CAAC","sourcesContent":["import type { DashboardWidgetComponentProps } from \"../../../../types/dashboard\";\nimport { DefaultDashboardChartWidget } from \"./DefaultDashboardChartWidget\";\n\nexport function DefaultDashboardLineChartWidget(props: DashboardWidgetComponentProps) {\n return <DefaultDashboardChartWidget {...props} />;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ import { DefaultDashboardChartWidget } from "./DefaultDashboardChartWidget";
3
+
4
+ export function DefaultDashboardLineChartWidget(props: DashboardWidgetComponentProps) {
5
+ return <DefaultDashboardChartWidget {...props} />;
6
+ }
@@ -0,0 +1,3 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ export declare function DefaultDashboardPieChartWidget(props: DashboardWidgetComponentProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=DefaultDashboardPieChartWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardPieChartWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardPieChartWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAGjF,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,6BAA6B,2CAElF"}
@@ -0,0 +1,17 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { DefaultDashboardChartWidget } from "./DefaultDashboardChartWidget";
14
+ export function DefaultDashboardPieChartWidget(props) {
15
+ return _jsx(DefaultDashboardChartWidget, __assign({}, props));
16
+ }
17
+ //# sourceMappingURL=DefaultDashboardPieChartWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardPieChartWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardPieChartWidget.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,MAAM,UAAU,8BAA8B,CAAC,KAAoC;IACjF,OAAO,KAAC,2BAA2B,eAAK,KAAK,EAAI,CAAC;AACpD,CAAC","sourcesContent":["import type { DashboardWidgetComponentProps } from \"../../../../types/dashboard\";\nimport { DefaultDashboardChartWidget } from \"./DefaultDashboardChartWidget\";\n\nexport function DefaultDashboardPieChartWidget(props: DashboardWidgetComponentProps) {\n return <DefaultDashboardChartWidget {...props} />;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ import { DefaultDashboardChartWidget } from "./DefaultDashboardChartWidget";
3
+
4
+ export function DefaultDashboardPieChartWidget(props: DashboardWidgetComponentProps) {
5
+ return <DefaultDashboardChartWidget {...props} />;
6
+ }
@@ -0,0 +1,3 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ export declare function DefaultDashboardTableWidget({ runtime }: DashboardWidgetComponentProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=DefaultDashboardTableWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardTableWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardTableWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAEjF,wBAAgB,2BAA2B,CAAC,EAAE,OAAO,EAAE,EAAE,6BAA6B,2CAoCrF"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function DefaultDashboardTableWidget(_a) {
3
+ var _b, _c;
4
+ var runtime = _a.runtime;
5
+ var columns = Array.isArray((_b = runtime === null || runtime === void 0 ? void 0 : runtime.data) === null || _b === void 0 ? void 0 : _b.columns) ? runtime.data.columns : [];
6
+ var records = Array.isArray((_c = runtime === null || runtime === void 0 ? void 0 : runtime.data) === null || _c === void 0 ? void 0 : _c.records) ? runtime.data.records : [];
7
+ return (_jsx("div", { style: { overflow: "auto", maxHeight: "100%" }, children: _jsxs("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [_jsx("thead", { children: _jsx("tr", { children: columns.map(function (column) { return (_jsx("th", { style: { textAlign: "left", borderBottom: "1px solid #eceff3", padding: "6px 8px", fontSize: "0.84rem" }, children: column }, column)); }) }) }), _jsx("tbody", { children: records.slice(0, 25).map(function (record, index) { return (_jsx("tr", { children: columns.map(function (column) {
8
+ var _a;
9
+ return (_jsx("td", { style: { textAlign: "left", borderBottom: "1px solid #f3f4f6", padding: "6px 8px", fontSize: "0.83rem", whiteSpace: "nowrap" }, children: "".concat((_a = record === null || record === void 0 ? void 0 : record[column]) !== null && _a !== void 0 ? _a : "") }, "".concat(index, "-").concat(column)));
10
+ }) }, "record-".concat(index))); }) })] }) }));
11
+ }
12
+ //# sourceMappingURL=DefaultDashboardTableWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardTableWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardTableWidget.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,2BAA2B,CAAC,EAA0C;;QAAxC,OAAO,aAAA;IACnD,IAAM,OAAO,GAAa,KAAK,CAAC,OAAO,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,IAAM,OAAO,GAA0B,KAAK,CAAC,OAAO,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzG,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YACjD,iBAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,aACzD,0BACE,uBACG,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM,IAAK,OAAA,CACvB,aAEE,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,YAEvG,MAAM,IAHF,MAAM,CAIR,CACN,EAPwB,CAOxB,CAAC,GACC,GACC,EACR,0BACG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAC,MAAM,EAAE,KAAK,IAAK,OAAA,CAC3C,uBACG,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM;;4BAAK,OAAA,CACvB,aAEE,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,YAE7H,UAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,MAAM,CAAC,mCAAI,EAAE,CAAE,IAHvB,UAAG,KAAK,cAAI,MAAM,CAAE,CAItB,CACN,CAAA;yBAAA,CAAC,IARK,iBAAU,KAAK,CAAE,CASrB,CACN,EAX4C,CAW5C,CAAC,GACI,IACF,GACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { DashboardWidgetComponentProps } from \"../../../../types/dashboard\";\n\nexport function DefaultDashboardTableWidget({ runtime }: DashboardWidgetComponentProps) {\n const columns: string[] = Array.isArray(runtime?.data?.columns) ? runtime.data.columns : [];\n const records: Record<string, any>[] = Array.isArray(runtime?.data?.records) ? runtime.data.records : [];\n\n return (\n <div style={{ overflow: \"auto\", maxHeight: \"100%\" }}>\n <table style={{ width: \"100%\", borderCollapse: \"collapse\" }}>\n <thead>\n <tr>\n {columns.map((column) => (\n <th\n key={column}\n style={{ textAlign: \"left\", borderBottom: \"1px solid #eceff3\", padding: \"6px 8px\", fontSize: \"0.84rem\" }}\n >\n {column}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {records.slice(0, 25).map((record, index) => (\n <tr key={`record-${index}`}>\n {columns.map((column) => (\n <td\n key={`${index}-${column}`}\n style={{ textAlign: \"left\", borderBottom: \"1px solid #f3f4f6\", padding: \"6px 8px\", fontSize: \"0.83rem\", whiteSpace: \"nowrap\" }}\n >\n {`${record?.[column] ?? \"\"}`}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n"]}
@@ -0,0 +1,39 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+
3
+ export function DefaultDashboardTableWidget({ runtime }: DashboardWidgetComponentProps) {
4
+ const columns: string[] = Array.isArray(runtime?.data?.columns) ? runtime.data.columns : [];
5
+ const records: Record<string, any>[] = Array.isArray(runtime?.data?.records) ? runtime.data.records : [];
6
+
7
+ return (
8
+ <div style={{ overflow: "auto", maxHeight: "100%" }}>
9
+ <table style={{ width: "100%", borderCollapse: "collapse" }}>
10
+ <thead>
11
+ <tr>
12
+ {columns.map((column) => (
13
+ <th
14
+ key={column}
15
+ style={{ textAlign: "left", borderBottom: "1px solid #eceff3", padding: "6px 8px", fontSize: "0.84rem" }}
16
+ >
17
+ {column}
18
+ </th>
19
+ ))}
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ {records.slice(0, 25).map((record, index) => (
24
+ <tr key={`record-${index}`}>
25
+ {columns.map((column) => (
26
+ <td
27
+ key={`${index}-${column}`}
28
+ style={{ textAlign: "left", borderBottom: "1px solid #f3f4f6", padding: "6px 8px", fontSize: "0.83rem", whiteSpace: "nowrap" }}
29
+ >
30
+ {`${record?.[column] ?? ""}`}
31
+ </td>
32
+ ))}
33
+ </tr>
34
+ ))}
35
+ </tbody>
36
+ </table>
37
+ </div>
38
+ );
39
+ }
@@ -0,0 +1,3 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ export declare function DefaultDashboardUnknownWidget({ runtime }: DashboardWidgetComponentProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=DefaultDashboardUnknownWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardUnknownWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardUnknownWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAEjF,wBAAgB,6BAA6B,CAAC,EAAE,OAAO,EAAE,EAAE,6BAA6B,2CAMvF"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function DefaultDashboardUnknownWidget(_a) {
3
+ var _b, _c;
4
+ var runtime = _a.runtime;
5
+ return (_jsx("pre", { style: { margin: 0, fontSize: "0.78rem", overflow: "auto", maxHeight: "100%" }, children: JSON.stringify((_c = (_b = runtime === null || runtime === void 0 ? void 0 : runtime.data) !== null && _b !== void 0 ? _b : runtime) !== null && _c !== void 0 ? _c : {}, null, 2) }));
6
+ }
7
+ //# sourceMappingURL=DefaultDashboardUnknownWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultDashboardUnknownWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/DefaultDashboardUnknownWidget.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,6BAA6B,CAAC,EAA0C;;QAAxC,OAAO,aAAA;IACrD,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAChF,IAAI,CAAC,SAAS,CAAC,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,mCAAI,OAAO,mCAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GACpD,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { DashboardWidgetComponentProps } from \"../../../../types/dashboard\";\n\nexport function DefaultDashboardUnknownWidget({ runtime }: DashboardWidgetComponentProps) {\n return (\n <pre style={{ margin: 0, fontSize: \"0.78rem\", overflow: \"auto\", maxHeight: \"100%\" }}>\n {JSON.stringify(runtime?.data ?? runtime ?? {}, null, 2)}\n </pre>\n );\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+
3
+ export function DefaultDashboardUnknownWidget({ runtime }: DashboardWidgetComponentProps) {
4
+ return (
5
+ <pre style={{ margin: 0, fontSize: "0.78rem", overflow: "auto", maxHeight: "100%" }}>
6
+ {JSON.stringify(runtime?.data ?? runtime ?? {}, null, 2)}
7
+ </pre>
8
+ );
9
+ }
@@ -0,0 +1,3 @@
1
+ import type { DashboardWidgetComponentProps } from "../../../../types/dashboard";
2
+ export declare function QueueSlaHeatmapWidget({ runtime }: DashboardWidgetComponentProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=QueueSlaHeatmapWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueSlaHeatmapWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/dashboard/widgets/QueueSlaHeatmapWidget.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAwCjF,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE,6BAA6B,2CAkK/E"}