@tekkare/romulus 0.1.45 → 0.1.46
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/dist/module.json
CHANGED
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<style scoped>
|
|
21
|
-
.rm-table-card{background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-2xl);box-shadow:var(--shadow-xs);box-sizing:border-box;color:var(--text-primary);display:flex;flex-direction:column;font-family:var(--font-sans);
|
|
21
|
+
.rm-table-card{background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-2xl);box-shadow:var(--shadow-xs);box-sizing:border-box;color:var(--text-primary);display:flex;flex-direction:column;font-family:var(--font-sans);overflow:hidden;padding:0;width:100%}.rm-table-card__header{align-items:flex-start;display:flex;gap:16px;justify-content:space-between;padding:24px}.rm-table-card__header :deep(.rm-table-card__title){font-size:var(--font-18);font-weight:800;margin:0}.rm-table-card__header :deep(.rm-table-card__caption){color:var(--text-secondary);font-size:var(--font-12);margin:0;white-space:nowrap}.rm-table-card :deep(.rm-table-wrapper){background:transparent;border:none;border-radius:0}.rm-table-card__header+:deep(.rm-table-wrapper){border-top:1px solid var(--border-default)}.rm-table-card>:deep(:not(.rm-table-wrapper):not(.rm-table-card__header)){padding:16px 24px}
|
|
22
22
|
</style>
|
|
@@ -669,3 +669,33 @@ export declare function rmSparklineOption(values: (number | null)[], color: stri
|
|
|
669
669
|
};
|
|
670
670
|
}[];
|
|
671
671
|
};
|
|
672
|
+
/**
|
|
673
|
+
* Met un graphe de series en tableau : une ligne par serie, une colonne par
|
|
674
|
+
* categorie.
|
|
675
|
+
*
|
|
676
|
+
* Un graphe donne la forme, pas les chiffres : on y lit une tendance, on n'y
|
|
677
|
+
* releve pas une valeur. Le tableau qui l'accompagne rend la donnee lisible au
|
|
678
|
+
* chiffre pres, copiable, et accessible au lecteur d'ecran, que le SVG du
|
|
679
|
+
* graphe ne porte pas.
|
|
680
|
+
*
|
|
681
|
+
* Les valeurs restent des NOMBRES : le tri de RmTable compare alors des
|
|
682
|
+
* nombres, et la page formate a l'affichage par un slot de colonne. Formater
|
|
683
|
+
* ici donnerait un tri alphabetique sur des chaines a espaces insecables.
|
|
684
|
+
*/
|
|
685
|
+
export declare function rmSeriesTable(categories: (string | number)[], series: RmSeriesInput[], options?: {
|
|
686
|
+
label?: string;
|
|
687
|
+
key?: string;
|
|
688
|
+
}): {
|
|
689
|
+
columns: ({
|
|
690
|
+
key: string;
|
|
691
|
+
label: string;
|
|
692
|
+
sortable: boolean;
|
|
693
|
+
align: "right";
|
|
694
|
+
} | {
|
|
695
|
+
key: string;
|
|
696
|
+
label: string;
|
|
697
|
+
sortable: boolean;
|
|
698
|
+
})[];
|
|
699
|
+
rows: Record<string, unknown>[];
|
|
700
|
+
valueKeys: string[];
|
|
701
|
+
};
|
|
@@ -298,3 +298,24 @@ export function rmSparklineOption(values, color) {
|
|
|
298
298
|
}]
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
|
+
export function rmSeriesTable(categories, series, options = {}) {
|
|
302
|
+
const { label = "S\xE9rie", key = "series" } = options;
|
|
303
|
+
const valueKeys = categories.map(String);
|
|
304
|
+
const columns = [
|
|
305
|
+
{ key, label, sortable: true },
|
|
306
|
+
...valueKeys.map((category) => ({
|
|
307
|
+
key: category,
|
|
308
|
+
label: category,
|
|
309
|
+
sortable: true,
|
|
310
|
+
align: "right"
|
|
311
|
+
}))
|
|
312
|
+
];
|
|
313
|
+
const rows = series.map((entry, index) => {
|
|
314
|
+
const row = { [key]: entry.name ?? `#${index + 1}` };
|
|
315
|
+
valueKeys.forEach((category, position) => {
|
|
316
|
+
row[category] = entry.data[position] ?? null;
|
|
317
|
+
});
|
|
318
|
+
return row;
|
|
319
|
+
});
|
|
320
|
+
return { columns, rows, valueKeys };
|
|
321
|
+
}
|