@tekkare/romulus 0.1.110 → 0.1.111
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
|
@@ -41,9 +41,10 @@ const props = withDefaults(defineProps<{
|
|
|
41
41
|
* d'une carte se presente comme l'export global de la page.
|
|
42
42
|
*
|
|
43
43
|
* Une fonction est preferable des qu'une liste monte la meme carte vingt
|
|
44
|
-
* fois : elle n'est appelee qu'a l'export.
|
|
44
|
+
* fois : elle n'est appelee qu'a l'export. Elle peut etre asynchrone, le
|
|
45
|
+
* menu affichant « Preparation... » le temps de la requete.
|
|
45
46
|
*/
|
|
46
|
-
payload?: Partial<RmExportPayload> | (() => Partial<RmExportPayload> | null | undefined)
|
|
47
|
+
payload?: Partial<RmExportPayload> | (() => Partial<RmExportPayload> | null | undefined | Promise<Partial<RmExportPayload> | null | undefined>)
|
|
47
48
|
/**
|
|
48
49
|
* Force les items visuels. Non renseigne : ils suivent la presence d'un
|
|
49
50
|
* graphe dans la carte, ce qui est le bon defaut dans les deux sens.
|
|
@@ -31,9 +31,11 @@ export interface RmCardActionContext {
|
|
|
31
31
|
*
|
|
32
32
|
* Une fonction est preferable des qu'une liste monte la meme carte vingt
|
|
33
33
|
* fois : elle n'est appelee qu'a l'export, alors qu'un objet lie en prop est
|
|
34
|
-
* recalcule a chaque rendu de chaque carte.
|
|
34
|
+
* recalcule a chaque rendu de chaque carte. Elle peut etre asynchrone : la
|
|
35
|
+
* donnee complete d'une carte demande parfois une requete, que seul
|
|
36
|
+
* l'export justifie de lancer.
|
|
35
37
|
*/
|
|
36
|
-
payload?: RmCardPayload | (() => RmCardPayload | null | undefined);
|
|
38
|
+
payload?: RmCardPayload | (() => RmCardPayload | null | undefined | Promise<RmCardPayload | null | undefined>);
|
|
37
39
|
}
|
|
38
40
|
export declare function useRmCardActions(): {
|
|
39
41
|
runCardAction: (action: RmCardAction, context: RmCardActionContext) => Promise<import("./useRmExport").RmExportResult>;
|
|
@@ -41,7 +41,7 @@ export function useRmCardActions() {
|
|
|
41
41
|
const { run } = useRmExport();
|
|
42
42
|
async function runCardAction(action, context) {
|
|
43
43
|
const { card, lang = "fr" } = context;
|
|
44
|
-
const provided = (typeof context.payload === "function" ? context.payload() : context.payload) ?? {};
|
|
44
|
+
const provided = await (typeof context.payload === "function" ? context.payload() : context.payload) ?? {};
|
|
45
45
|
const title = context.name || provided.title || rmCardTitle(card) || "Export";
|
|
46
46
|
const format = action === "link" ? "link" : action;
|
|
47
47
|
const sheets = action === "png" || action === "svg" ? [] : provided.sheets?.length ? provided.sheets : await rmCardSheets(card, title, lang);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const CARD_SELECTOR = ".chart-card, .rm-table-card, .rm-rcard";
|
|
1
|
+
const CARD_SELECTOR = ".chart-card, .rm-table-card, .rm-rcard, .rm-card";
|
|
2
2
|
const CHART_SELECTOR = ".rm-chart .echart";
|
|
3
3
|
const WORDS = {
|
|
4
4
|
fr: { label: "Libell\xE9", value: "Valeur", series: "S\xE9rie", table: "Tableau", field: "Champ", chart: "Graphique", title: "Intitul\xE9", subtitle: "Compl\xE9ment", source: "Provenance" },
|