@tekkare/romulus 0.1.35 → 0.1.37

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.
@@ -0,0 +1,98 @@
1
+ export const RM_EXPORT_EXTENSIONS = {
2
+ pdf: "pdf",
3
+ xlsx: "xlsx",
4
+ csv: "csv",
5
+ png: "png",
6
+ svg: "svg",
7
+ link: "url"
8
+ };
9
+ export const RM_EXPORT_FORMATS = [
10
+ {
11
+ key: "pdf",
12
+ label: "PDF",
13
+ icon: "FilePdf",
14
+ color: "var(--color-danger)",
15
+ desc: "Rapport mis en page, pr\xEAt \xE0 partager. KPI, graphiques, table, en-t\xEAte OIP Healthcare.",
16
+ tabular: true,
17
+ visual: true,
18
+ paged: true
19
+ },
20
+ {
21
+ key: "xlsx",
22
+ label: "Excel",
23
+ icon: "FileXls",
24
+ color: "var(--color-success)",
25
+ desc: "Donn\xE9es brutes avec page de garde. Pour analyse en local ou consolidation.",
26
+ tabular: true,
27
+ paged: true
28
+ },
29
+ {
30
+ key: "csv",
31
+ label: "CSV",
32
+ icon: "FileCsv",
33
+ color: "var(--text-secondary)",
34
+ desc: "Donn\xE9es tabulaires. Pour scripts Python ou R, BI, int\xE9gration API.",
35
+ tabular: true
36
+ },
37
+ {
38
+ key: "png",
39
+ label: "PNG",
40
+ icon: "Image",
41
+ color: "var(--color-info)",
42
+ desc: "Image des graphiques visibles. Pour slides, captures, presse.",
43
+ visual: true
44
+ },
45
+ {
46
+ key: "svg",
47
+ label: "SVG",
48
+ icon: "VectorThree",
49
+ color: "var(--color-warning)",
50
+ desc: "Vectoriel \xE9ditable. Pour Figma ou Illustrator, impression.",
51
+ visual: true
52
+ },
53
+ {
54
+ key: "link",
55
+ label: "Permalink",
56
+ icon: "Link",
57
+ color: "var(--color-secondary)",
58
+ desc: "Lien vers cette vue, filtres compris. Lecture seule."
59
+ }
60
+ ];
61
+ export const RM_EXPORT_SECTIONS = [
62
+ { key: "kpi", label: "Chiffres cl\xE9s", kind: "meta", on: true },
63
+ { key: "charts", label: "Graphiques", kind: "visual", on: true },
64
+ { key: "table", label: "Tableau", kind: "table", on: true },
65
+ { key: "filters", label: "Filtres actifs", kind: "meta", on: true },
66
+ { key: "sources", label: "Sources et mises \xE0 jour", kind: "meta", on: true }
67
+ ];
68
+ export const RM_EXPORT_OPTIONS = [
69
+ { key: "logo", label: "Logo Tekkare et en-t\xEAte OIP Healthcare", on: true },
70
+ { key: "sources", label: "Liste des sources cit\xE9es", on: true }
71
+ ];
72
+ export const RM_EXPORT_LAYOUTS = [
73
+ { key: "a4-portrait", label: "A4 portrait" },
74
+ { key: "a4-landscape", label: "A4 paysage" },
75
+ { key: "raw", label: "Donn\xE9es brutes" }
76
+ ];
77
+ const BASE_KB = { pdf: 280, xlsx: 60, csv: 4, png: 420, svg: 90, link: 0 };
78
+ const BYTES_PER_ROW = { pdf: 3200, xlsx: 1200, csv: 220, png: 0, svg: 0, link: 0 };
79
+ export function rmExportSizeKb(input) {
80
+ const base = BASE_KB[input.format] ?? 0;
81
+ const perRow = BYTES_PER_ROW[input.format] ?? 0;
82
+ const colFactor = input.includesTable ? Math.max(0.3, input.columns / Math.max(1, input.totalColumns)) : 0;
83
+ const tableKb = input.rows * perRow * colFactor / 1024;
84
+ const kb = base + tableKb + input.sections * 18;
85
+ return input.zip ? kb * 0.55 : kb;
86
+ }
87
+ export function rmExportSize(kb) {
88
+ if (kb < 1024) return `~ ${Math.round(kb)} ko`;
89
+ return `~ ${(kb / 1024).toFixed(1).replace(".", ",")} Mo`;
90
+ }
91
+ export function rmExportDuration(kb, rows) {
92
+ return `~ ${Math.max(2, Math.round(kb / 200 + rows / 500))} s`;
93
+ }
94
+ export function rmExportFileName(...parts) {
95
+ const slug = parts.filter(Boolean).join("-").normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
96
+ const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
97
+ return `${slug || "export"}-${today}`;
98
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/romulus",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
4
4
  "description": "Romulus Design System - Nuxt module by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -12,6 +12,10 @@
12
12
  "types": "./dist/types.d.ts",
13
13
  "import": "./dist/module.mjs",
14
14
  "require": "./dist/module.cjs"
15
+ },
16
+ "./utils/*": {
17
+ "types": "./dist/runtime/utils/*.d.ts",
18
+ "import": "./dist/runtime/utils/*.js"
15
19
  }
16
20
  },
17
21
  "main": "./dist/module.cjs",
@@ -28,7 +32,10 @@
28
32
  "dependencies": {
29
33
  "@nuxt/kit": "^3.16.0",
30
34
  "@phosphor-icons/vue": "^2.2.1",
31
- "echarts": "^5.6.0"
35
+ "echarts": "^5.6.0",
36
+ "jspdf": "^4.2.0",
37
+ "jspdf-autotable": "^5.0.7",
38
+ "write-excel-file": "^1.4.30"
32
39
  },
33
40
  "devDependencies": {
34
41
  "@nuxt/module-builder": "^0.8.4",