diff --git a/client/src/components/Book.vue b/client/src/components/Book.vue index b350d40..b1573c5 100644 --- a/client/src/components/Book.vue +++ b/client/src/components/Book.vue @@ -2,9 +2,9 @@
- -
@@ -61,7 +61,7 @@ const solutionExport = computed(() => ({ splits: false, spaces: false, definitions: false, - cellsBackground: false + cellsBackground: false, }, ...props.exportOptions, })); diff --git a/client/src/components/GridPaper.vue b/client/src/components/GridPaper.vue index 82a2764..af2e8c8 100644 --- a/client/src/components/GridPaper.vue +++ b/client/src/components/GridPaper.vue @@ -1,19 +1,8 @@ @@ -44,5 +33,4 @@ const props = defineProps<{ }>(); - + diff --git a/client/src/components/Paper.vue b/client/src/components/Paper.vue index e88ee00..3a3f440 100644 --- a/client/src/components/Paper.vue +++ b/client/src/components/Paper.vue @@ -49,6 +49,10 @@ const props = defineProps<{ * Class to add to the body */ bodyClass?: string; + /** + * Wether body takes full height or not + */ + bodyFullHeight?: boolean; pageNumber?: number; showPagination: boolean; pagination?: PaginationStyle; @@ -96,6 +100,25 @@ const padding = computed(() => { const { top, left, right, bottom } = props.format.margin; return [top, right, bottom, left].map((m) => `${m}cm`).join(" "); }); +const maxHeight = computed(() => { + const p = props.pagination; + const mb = p ? p.margin.bottom : 'null'; + const ms = p ? p.size : 'null'; + const { top, bottom } = props.format.margin; + const toRemove = [ + `${top}cm`, + `${bottom}cm`, + `${mb}`, + `${ms}` + ] + .filter(e => e !== 'null') + .join(' - '); + return `calc(${pageHeight.value} - ${toRemove})`; +}); +const height = computed(() => { + return props.bodyFullHeight ? maxHeight.value : "unset"; + +}); const formatStyle = computed(() => { if (!props.format) return ""; return `${props.format.width}cm ${props.format.height}cm`; @@ -138,7 +161,8 @@ body { flex-direction: column; align-items: center; justify-content: space-around; - height: 100%; + max-height: v-bind(maxHeight); + height: v-bind(height); width: 100%; } diff --git a/client/src/components/Solutions.vue b/client/src/components/Solutions.vue index 367bbb5..42034d1 100644 --- a/client/src/components/Solutions.vue +++ b/client/src/components/Solutions.vue @@ -1,13 +1,14 @@