@adminforth/dashboard 1.4.0 → 1.4.2
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/README.md +23 -4
- package/custom/api/dashboardApi.ts +6 -9
- package/custom/model/dashboard.types.ts +60 -275
- package/custom/model/dashboardTopics.ts +5 -0
- package/custom/package.json +1 -0
- package/custom/runtime/DashboardGroup.vue +2 -2
- package/custom/runtime/DashboardPage.vue +17 -7
- package/custom/runtime/DashboardRuntime.vue +20 -8
- package/custom/runtime/WidgetRenderer.vue +1 -2
- package/custom/runtime/WidgetShell.vue +3 -3
- package/custom/skills/adminforth-dashboard/SKILL.md +2 -2
- package/custom/widgets/{gauge-card/GaugeCardWidget.vue → GaugeCardWidget.vue} +63 -61
- package/custom/widgets/{kpi-card/KpiCardWidget.vue → KpiCardWidget.vue} +35 -33
- package/custom/widgets/{pivot-table/PivotTableWidget.vue → PivotTableWidget.vue} +71 -68
- package/custom/widgets/{table/TableWidget.vue → TableWidget.vue} +5 -5
- package/custom/widgets/chart/{bar/BarChart.vue → BarChart.vue} +2 -2
- package/custom/widgets/chart/ChartWidget.vue +4 -15
- package/{dist/custom/widgets/chart/funnel → custom/widgets/chart}/FunnelChart.vue +80 -78
- package/{dist/custom/widgets/chart/line → custom/widgets/chart}/LineChart.vue +2 -2
- package/custom/widgets/chart/{pie/PieChart.vue → PieChart.vue} +2 -2
- package/{dist/custom/widgets/chart/stacked-bar → custom/widgets/chart}/StackedBarChart.vue +97 -95
- package/custom/widgets/chart/chart.types.ts +0 -28
- package/dist/custom/api/dashboardApi.d.ts +4 -8
- package/dist/custom/api/dashboardApi.js +2 -6
- package/dist/custom/api/dashboardApi.ts +6 -9
- package/dist/custom/composables/useElementSize.js +7 -10
- package/dist/custom/model/dashboard.types.d.ts +38 -32
- package/dist/custom/model/dashboard.types.js +4 -161
- package/dist/custom/model/dashboard.types.ts +60 -275
- package/dist/custom/model/dashboardTopics.d.ts +2 -0
- package/dist/custom/model/dashboardTopics.js +4 -0
- package/dist/custom/model/dashboardTopics.ts +5 -0
- package/dist/custom/package.json +1 -0
- package/dist/custom/queries/useDashboardConfig.d.ts +96 -96
- package/dist/custom/queries/useDashboardConfig.js +9 -12
- package/dist/custom/queries/useWidgetData.d.ts +96 -96
- package/dist/custom/queries/useWidgetData.js +9 -12
- package/dist/custom/runtime/DashboardGroup.vue +2 -2
- package/dist/custom/runtime/DashboardPage.vue +17 -7
- package/dist/custom/runtime/DashboardRuntime.vue +20 -8
- package/dist/custom/runtime/WidgetRenderer.vue +1 -2
- package/dist/custom/runtime/WidgetShell.vue +3 -3
- package/dist/custom/skills/adminforth-dashboard/SKILL.md +2 -2
- package/dist/custom/widgets/{gauge-card/GaugeCardWidget.vue → GaugeCardWidget.vue} +63 -61
- package/dist/custom/widgets/{kpi-card/KpiCardWidget.vue → KpiCardWidget.vue} +35 -33
- package/dist/custom/widgets/{pivot-table/PivotTableWidget.vue → PivotTableWidget.vue} +71 -68
- package/dist/custom/widgets/{table/TableWidget.vue → TableWidget.vue} +5 -5
- package/dist/custom/widgets/chart/{bar/BarChart.vue → BarChart.vue} +2 -2
- package/dist/custom/widgets/chart/ChartWidget.vue +4 -15
- package/{custom/widgets/chart/funnel → dist/custom/widgets/chart}/FunnelChart.vue +80 -78
- package/{custom/widgets/chart/line → dist/custom/widgets/chart}/LineChart.vue +2 -2
- package/dist/custom/widgets/chart/{pie/PieChart.vue → PieChart.vue} +2 -2
- package/{custom/widgets/chart/stacked-bar → dist/custom/widgets/chart}/StackedBarChart.vue +97 -95
- package/dist/custom/widgets/chart/chart.types.d.ts +0 -2
- package/dist/custom/widgets/chart/chart.types.js +1 -25
- package/dist/custom/widgets/chart/chart.types.ts +0 -28
- package/dist/custom/widgets/chart/chart.utils.js +6 -14
- package/dist/custom/widgets/registry.js +14 -22
- package/dist/endpoint/dashboard.d.ts +2 -3
- package/dist/endpoint/dashboard.js +12 -32
- package/dist/endpoint/groups.d.ts +2 -21
- package/dist/endpoint/groups.js +18 -16
- package/dist/endpoint/widgets.d.ts +0 -3
- package/dist/endpoint/widgets.js +27 -74
- package/dist/index.js +1 -3
- package/dist/schema/api.d.ts +2090 -511
- package/dist/schema/api.js +18 -15
- package/dist/schema/widget.d.ts +1003 -250
- package/dist/schema/widget.js +102 -46
- package/dist/services/dashboardConfigService.d.ts +0 -10
- package/dist/services/dashboardConfigService.js +6 -21
- package/dist/services/widgetDataService.js +226 -196
- package/endpoint/dashboard.ts +13 -46
- package/endpoint/groups.ts +25 -42
- package/endpoint/widgets.ts +36 -95
- package/index.ts +0 -3
- package/package.json +3 -3
- package/schema/api.ts +19 -15
- package/schema/widget.ts +113 -52
- package/services/dashboardConfigService.ts +6 -25
- package/services/widgetDataService.ts +304 -229
- package/custom/widgets/chart/histogram/HistogramChart.vue +0 -21
- package/dist/custom/widgets/chart/histogram/HistogramChart.vue +0 -21
- package/dist/services/widgetConfigValidator.d.ts +0 -8
- package/dist/services/widgetConfigValidator.js +0 -27
- package/services/widgetConfigValidator.ts +0 -61
package/dist/schema/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toJSONSchema, z } from 'zod';
|
|
2
|
-
import { StoredWidgetConfigSchema } from './widget.js';
|
|
2
|
+
import { EditableDashboardWidgetConfigSchema, StoredWidgetConfigSchema } from './widget.js';
|
|
3
3
|
function toAdminForthJsonSchema(schema) {
|
|
4
4
|
return toJSONSchema(schema, { target: 'draft-7' });
|
|
5
5
|
}
|
|
@@ -14,12 +14,12 @@ export const DashboardGroupZodSchema = z.object({
|
|
|
14
14
|
id: z.string(),
|
|
15
15
|
label: z.string(),
|
|
16
16
|
order: z.number(),
|
|
17
|
-
});
|
|
17
|
+
}).strict();
|
|
18
18
|
export const DashboardConfigZodSchema = z.object({
|
|
19
19
|
version: z.number(),
|
|
20
20
|
groups: z.array(DashboardGroupZodSchema),
|
|
21
21
|
widgets: z.array(StoredWidgetConfigSchema),
|
|
22
|
-
});
|
|
22
|
+
}).strict();
|
|
23
23
|
export const DashboardResponseZodSchema = z.object({
|
|
24
24
|
id: z.string(),
|
|
25
25
|
slug: z.string(),
|
|
@@ -39,32 +39,35 @@ export const DashboardWidgetDataResponseZodSchema = z.union([
|
|
|
39
39
|
DashboardErrorResponseZodSchema,
|
|
40
40
|
]);
|
|
41
41
|
export const SlugRequestZodSchema = z.object({
|
|
42
|
-
slug: z.string()
|
|
42
|
+
slug: z.string(),
|
|
43
43
|
}).strict();
|
|
44
44
|
export const SetDashboardConfigRequestZodSchema = z.object({
|
|
45
|
-
slug: z.string()
|
|
46
|
-
config:
|
|
45
|
+
slug: z.string(),
|
|
46
|
+
config: DashboardConfigZodSchema,
|
|
47
47
|
}).strict();
|
|
48
48
|
export const GroupIdRequestZodSchema = z.object({
|
|
49
|
-
slug: z.string()
|
|
49
|
+
slug: z.string(),
|
|
50
50
|
groupId: z.string(),
|
|
51
51
|
}).strict();
|
|
52
52
|
export const MoveGroupRequestZodSchema = z.object({
|
|
53
|
-
slug: z.string()
|
|
53
|
+
slug: z.string(),
|
|
54
54
|
groupId: z.string(),
|
|
55
55
|
direction: z.enum(['up', 'down']),
|
|
56
56
|
}).strict();
|
|
57
|
+
export const EditableDashboardGroupConfigZodSchema = z.object({
|
|
58
|
+
label: z.string(),
|
|
59
|
+
}).strict();
|
|
57
60
|
export const SetGroupConfigRequestZodSchema = z.object({
|
|
58
|
-
slug: z.string()
|
|
61
|
+
slug: z.string(),
|
|
59
62
|
groupId: z.string(),
|
|
60
|
-
config:
|
|
63
|
+
config: EditableDashboardGroupConfigZodSchema,
|
|
61
64
|
}).strict();
|
|
62
65
|
export const WidgetIdRequestZodSchema = z.object({
|
|
63
|
-
slug: z.string()
|
|
66
|
+
slug: z.string(),
|
|
64
67
|
widgetId: z.string(),
|
|
65
68
|
}).strict();
|
|
66
69
|
export const WidgetDataRequestZodSchema = z.object({
|
|
67
|
-
slug: z.string()
|
|
70
|
+
slug: z.string(),
|
|
68
71
|
widgetId: z.string(),
|
|
69
72
|
pagination: z.object({
|
|
70
73
|
page: z.number().int().positive(),
|
|
@@ -72,14 +75,14 @@ export const WidgetDataRequestZodSchema = z.object({
|
|
|
72
75
|
}).optional(),
|
|
73
76
|
}).strict();
|
|
74
77
|
export const MoveWidgetRequestZodSchema = z.object({
|
|
75
|
-
slug: z.string()
|
|
78
|
+
slug: z.string(),
|
|
76
79
|
widgetId: z.string(),
|
|
77
80
|
direction: z.enum(['up', 'down']),
|
|
78
81
|
}).strict();
|
|
79
82
|
export const SetWidgetConfigRequestZodSchema = z.object({
|
|
80
|
-
slug: z.string()
|
|
83
|
+
slug: z.string(),
|
|
81
84
|
widgetId: z.string(),
|
|
82
|
-
config:
|
|
85
|
+
config: EditableDashboardWidgetConfigSchema,
|
|
83
86
|
}).strict();
|
|
84
87
|
export const DashboardErrorResponseSchema = toAdminForthJsonSchema(DashboardErrorResponseZodSchema);
|
|
85
88
|
export const DashboardGroupSchema = toAdminForthJsonSchema(DashboardGroupZodSchema);
|