diff --git a/library/components/poster/PosterWall.vue b/library/components/poster/PosterWall.vue index 6be0706ee..20d35f7c2 100644 --- a/library/components/poster/PosterWall.vue +++ b/library/components/poster/PosterWall.vue @@ -80,6 +80,10 @@ const props = defineProps({ itemCountKey: { type: String, default: '' }, collapsible: { type: Boolean, default: false }, collapsedBy: { type: Function, default: () => false }, + // A section's people-group total, shown in its header and used to order the sections (largest first). + // Default: the sum of its cards' counts. A caller whose cards overlap overrides it, so a group is counted + // once: the Country Posters India section holds India's own card AND one card per state, the same 855 groups. + sectionTotal: { type: Function, default: null }, // A card may declare itself unsupported (India: 855 groups do not fit a sheet). // The caller supplies the reason; the wall renders it instead of a poster. unsupported: { type: Function, default: () => null }, @@ -351,7 +355,7 @@ const sections = computed(() => { .map(([name, items]) => ({ name, items: items.slice().sort((a, b) => (b.count || 0) - (a.count || 0)), - total: items.reduce((n, x) => n + (x.count || 0), 0), + total: props.sectionTotal ? props.sectionTotal(name, items) : items.reduce((n, x) => n + (x.count || 0), 0), })) .sort((a, b) => b.total - a.total) })