@dashadmin/dash-reports 1.3.73 → 1.3.74-srcfree.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 (75) hide show
  1. package/dist/ReportFilters.d.ts +9 -0
  2. package/dist/ReportFiltersDrawer.d.ts +12 -0
  3. package/dist/ReportPage.d.ts +9 -0
  4. package/dist/ReportsDashboard.d.ts +7 -0
  5. package/dist/ReportsIndex.d.ts +7 -0
  6. package/dist/ReportsModule.d.ts +7 -0
  7. package/dist/TenantDashboard.d.ts +12 -0
  8. package/dist/adapters/mui/BarWidget.d.ts +3 -0
  9. package/dist/adapters/mui/DoughnutWidget.d.ts +3 -0
  10. package/dist/adapters/mui/FunnelWidget.d.ts +3 -0
  11. package/dist/adapters/mui/KpiWidget.d.ts +3 -0
  12. package/dist/adapters/mui/LineWidget.d.ts +3 -0
  13. package/dist/adapters/mui/PieWidget.d.ts +3 -0
  14. package/dist/adapters/mui/PreviewWidget.d.ts +10 -0
  15. package/dist/adapters/mui/TableWidget.d.ts +16 -0
  16. package/dist/adapters/mui/chartSetup.d.ts +2 -0
  17. package/dist/adapters/mui/chartTheme.d.ts +71 -0
  18. package/dist/adapters/mui/index.d.ts +12 -0
  19. package/dist/adapters/mui/palette.d.ts +9 -0
  20. package/dist/adapters/mui/useChartData.d.ts +14 -0
  21. package/dist/core/formatBucket.d.ts +4 -0
  22. package/dist/core/label.d.ts +3 -0
  23. package/dist/core/queryParams.d.ts +3 -0
  24. package/dist/core/types.d.ts +94 -0
  25. package/dist/core/useDashboard.d.ts +50 -0
  26. package/dist/core/useReportExport.d.ts +7 -0
  27. package/dist/core/useReportList.d.ts +7 -0
  28. package/dist/core/useReportPreview.d.ts +7 -0
  29. package/dist/core/useReportSeries.d.ts +8 -0
  30. package/dist/core/useReportSpec.d.ts +9 -0
  31. package/dist/core/useReportTable.d.ts +10 -0
  32. package/dist/core/visualizationLayout.d.ts +13 -0
  33. package/dist/core/visualizationRegistry.d.ts +14 -0
  34. package/dist/createReportsResource.d.ts +40 -0
  35. package/dist/i18n/en.d.ts +83 -0
  36. package/dist/i18n/es.d.ts +83 -0
  37. package/{src/index.tsx → dist/index.d.ts} +3 -31
  38. package/package.json +13 -10
  39. package/src/ReportFilters.tsx +0 -145
  40. package/src/ReportFiltersDrawer.tsx +0 -73
  41. package/src/ReportPage.tsx +0 -280
  42. package/src/ReportsDashboard.tsx +0 -61
  43. package/src/ReportsIndex.tsx +0 -113
  44. package/src/ReportsModule.tsx +0 -42
  45. package/src/TenantDashboard.tsx +0 -290
  46. package/src/adapters/mui/BarWidget.tsx +0 -66
  47. package/src/adapters/mui/DoughnutWidget.tsx +0 -112
  48. package/src/adapters/mui/FunnelWidget.tsx +0 -108
  49. package/src/adapters/mui/KpiWidget.tsx +0 -123
  50. package/src/adapters/mui/LineWidget.tsx +0 -70
  51. package/src/adapters/mui/PieWidget.tsx +0 -16
  52. package/src/adapters/mui/PreviewWidget.tsx +0 -123
  53. package/src/adapters/mui/TableWidget.tsx +0 -141
  54. package/src/adapters/mui/chartSetup.ts +0 -53
  55. package/src/adapters/mui/chartTheme.ts +0 -84
  56. package/src/adapters/mui/index.ts +0 -29
  57. package/src/adapters/mui/palette.ts +0 -85
  58. package/src/adapters/mui/useChartData.ts +0 -62
  59. package/src/core/formatBucket.ts +0 -73
  60. package/src/core/label.ts +0 -28
  61. package/src/core/queryParams.ts +0 -27
  62. package/src/core/types.ts +0 -157
  63. package/src/core/useDashboard.ts +0 -161
  64. package/src/core/useReportExport.ts +0 -68
  65. package/src/core/useReportList.ts +0 -51
  66. package/src/core/useReportPreview.ts +0 -68
  67. package/src/core/useReportSeries.ts +0 -59
  68. package/src/core/useReportSpec.ts +0 -79
  69. package/src/core/useReportTable.ts +0 -71
  70. package/src/core/visualizationLayout.ts +0 -34
  71. package/src/core/visualizationRegistry.ts +0 -39
  72. package/src/createReportsResource.tsx +0 -81
  73. package/src/i18n/en.ts +0 -95
  74. package/src/i18n/es.ts +0 -84
  75. /package/{src/i18n/index.ts → dist/i18n/index.d.ts} +0 -0
@@ -1,81 +0,0 @@
1
- import type { ReactElement } from 'react';
2
- import { Route } from 'react-router-dom';
3
- import { ReportsModule } from './ReportsModule';
4
- import type { TranslateFn } from './core/types';
5
-
6
- export interface CreateReportsResourceOptions {
7
- /** Route + API path segment. Defaults to 'reports'. */
8
- model?: string;
9
- label?: string;
10
- group?: string;
11
- icon?: ReactElement;
12
- roles?: string[];
13
- menuTitle?: string;
14
- translate?: TranslateFn;
15
- /** Route prefix the admin mounts resources under. */
16
- urlPrefix?: string;
17
- }
18
-
19
- /**
20
- * The single reports resource.
21
- *
22
- * ── Why there is exactly one ──────────────────────────────────────────────────
23
- *
24
- * Which reports exist is the backend registry's answer, not the frontend's. A
25
- * resource per report would put that list in two places and guarantee they
26
- * drift — a domain registering a new report would get a working API and a menu
27
- * entry that 404s until someone shipped a frontend change too.
28
- *
29
- * ── Why `component` is not set ────────────────────────────────────────────────
30
- *
31
- * DASHAdmin does `const ResourceComponent = originalResource.component || ResourceTemplate`
32
- * and then CALLS it — so supplying `component` REPLACES ResourceTemplate
33
- * outright. Since `customRoutes` is only evaluated inside ResourceTemplate,
34
- * a resource that sets both registers no routes at all and every link 404s.
35
- * Leaving `component` off keeps ResourceTemplate in place, which is what
36
- * renders the routes below.
37
- */
38
- export function createReportsResource(options: CreateReportsResourceOptions = {}) {
39
- const {
40
- model = 'reports',
41
- label = 'dash_reports.title',
42
- group,
43
- icon,
44
- roles = ['*'],
45
- menuTitle,
46
- translate,
47
- urlPrefix = '/',
48
- } = options;
49
-
50
- const fallback: TranslateFn = (key, opts) => String(opts?._ ?? key);
51
- const t = translate ?? fallback;
52
-
53
- const base = `${urlPrefix}${model}`.replace(/\/{2,}/g, '/');
54
-
55
- return {
56
- model,
57
- label,
58
- group,
59
- icon,
60
- roles,
61
- schema: [],
62
- // Nothing here is CRUD — the resource exists to own a route and a menu entry.
63
- list: false,
64
- create: false,
65
- edit: false,
66
- view: false,
67
- delete: false,
68
- listViewButton: { enabled: false },
69
- listEditButton: { enabled: false },
70
- listDeleteButton: { enabled: false },
71
- customRoutes: () => (
72
- <>
73
- <Route path={base} element={<ReportsModule translate={t} basePath={base} />} />
74
- <Route path={`${base}/:reportKey`} element={<ReportsModule translate={t} basePath={base} />} />
75
- </>
76
- ),
77
- menu: [{ title: menuTitle ?? label, redirect: base }],
78
- };
79
- }
80
-
81
- export default createReportsResource;
package/src/i18n/en.ts DELETED
@@ -1,95 +0,0 @@
1
- /**
2
- * This package's own strings.
3
- *
4
- * Namespaced under a single root key so merging into an app's bundle can never
5
- * clobber a sibling subtree — the reason mergeTranslations exists rather than a
6
- * shallow spread.
7
- *
8
- * Report titles, metric labels and dimension labels are NOT here: those keys
9
- * come from the backend spec and belong to whichever domain declared the
10
- * report. Only the package's own chrome lives in this file.
11
- */
12
- export const en = {
13
- dash_reports: {
14
- title: 'Reports',
15
- units: {
16
- seconds: 's',
17
- minutes: 'min',
18
- hours: 'h',
19
- },
20
- dashboard: {
21
- title: 'This period',
22
- },
23
- period: {
24
- open: 'In progress',
25
- closed: 'Closed',
26
- current: 'Current period',
27
- },
28
- back_to_list: 'All reports',
29
- no_reports: 'No reports are available for your account.',
30
- loading: 'Loading…',
31
- no_data: 'No data for this range.',
32
- no_rows: 'No rows for this range.',
33
- other: 'Other',
34
- show_detail: 'Show detail rows',
35
- hide_detail: 'Hide detail rows',
36
- week_of: 'Week of %{date}',
37
- filters: {
38
- title: 'Filters',
39
- reset: 'Reset',
40
- done: 'Done',
41
- start: 'From',
42
- end: 'To',
43
- granularity: 'Group by',
44
- pivot: 'Split by',
45
- no_pivot: 'Nothing',
46
- },
47
- granularity: {
48
- daily: 'Day',
49
- weekly: 'Week',
50
- monthly: 'Month',
51
- yearly: 'Year',
52
- total: 'Whole period',
53
- hourOfDay: 'Hour of day',
54
- dayOfWeek: 'Day of week',
55
- },
56
- viz: {
57
- Bar: 'Bars',
58
- Line: 'Trend',
59
- Pie: 'Share',
60
- Doughnut: 'Share',
61
- Kpi: 'Totals',
62
- Funnel: 'Funnel',
63
- Table: 'Table',
64
- },
65
- funnel: {
66
- step: 'step',
67
- skipped: 'stage skipped',
68
- },
69
- table: {
70
- period: 'Period',
71
- },
72
- weekdays: {
73
- monday: 'Mon',
74
- tuesday: 'Tue',
75
- wednesday: 'Wed',
76
- thursday: 'Thu',
77
- friday: 'Fri',
78
- saturday: 'Sat',
79
- sunday: 'Sun',
80
- },
81
- export: {
82
- xlsx: 'Excel',
83
- csv: 'CSV',
84
- },
85
- errors: {
86
- spec: 'This report could not be loaded.',
87
- list: 'Reports could not be loaded.',
88
- series: 'This range could not be loaded.',
89
- dashboard: 'These stats could not be loaded.',
90
- widget: 'Unavailable',
91
- },
92
- },
93
- };
94
-
95
- export default en;
package/src/i18n/es.ts DELETED
@@ -1,84 +0,0 @@
1
- export const es = {
2
- dash_reports: {
3
- title: 'Reportes',
4
- units: {
5
- seconds: 's',
6
- minutes: 'min',
7
- hours: 'h',
8
- },
9
- dashboard: {
10
- title: 'Este período',
11
- },
12
- period: {
13
- open: 'En curso',
14
- closed: 'Cerrado',
15
- current: 'Período actual',
16
- },
17
- back_to_list: 'Todos los reportes',
18
- no_reports: 'No hay reportes disponibles para tu cuenta.',
19
- loading: 'Cargando…',
20
- no_data: 'Sin datos para este rango.',
21
- no_rows: 'Sin registros para este rango.',
22
- other: 'Otros',
23
- show_detail: 'Ver detalle',
24
- hide_detail: 'Ocultar detalle',
25
- week_of: 'Semana del %{date}',
26
- filters: {
27
- title: 'Filtros',
28
- reset: 'Limpiar',
29
- done: 'Listo',
30
- start: 'Desde',
31
- end: 'Hasta',
32
- granularity: 'Agrupar por',
33
- pivot: 'Separar por',
34
- no_pivot: 'Nada',
35
- },
36
- granularity: {
37
- daily: 'Día',
38
- weekly: 'Semana',
39
- monthly: 'Mes',
40
- yearly: 'Año',
41
- total: 'Todo el período',
42
- hourOfDay: 'Hora del día',
43
- dayOfWeek: 'Día de la semana',
44
- },
45
- viz: {
46
- Bar: 'Barras',
47
- Line: 'Tendencia',
48
- Pie: 'Distribución',
49
- Doughnut: 'Distribución',
50
- Kpi: 'Totales',
51
- Funnel: 'Embudo',
52
- Table: 'Tabla',
53
- },
54
- funnel: {
55
- step: 'etapa',
56
- skipped: 'etapa omitida',
57
- },
58
- table: {
59
- period: 'Período',
60
- },
61
- weekdays: {
62
- monday: 'Lun',
63
- tuesday: 'Mar',
64
- wednesday: 'Mié',
65
- thursday: 'Jue',
66
- friday: 'Vie',
67
- saturday: 'Sáb',
68
- sunday: 'Dom',
69
- },
70
- export: {
71
- xlsx: 'Excel',
72
- csv: 'CSV',
73
- },
74
- errors: {
75
- spec: 'No se pudo cargar este reporte.',
76
- list: 'No se pudieron cargar los reportes.',
77
- series: 'No se pudo cargar este rango.',
78
- dashboard: 'No se pudieron cargar estas estadísticas.',
79
- widget: 'No disponible',
80
- },
81
- },
82
- };
83
-
84
- export default es;
File without changes