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