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 @@
- indexPages = evt" />
-
@@ -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 @@
-
+
{{ j + solutionStyle.pagination.startIdx }}
-
+
@@ -19,7 +20,7 @@ import { defineProps, defineEmits } from "vue";
import SVGGrid from "./svg-renderer/Grid.vue";
import Paper from "./Paper.vue";
import FontLoader from "./fonts/FontLoader.vue";
-import { Grid, nullCell, SolutionStyle } from "grid";
+import { Format, Grid, nullCell, SolutionStyle } from "grid";
import { computed } from "vue";
import { ExportOptions } from "../types";
import { getFont } from "../js/useFont";
@@ -44,18 +45,25 @@ const props = defineProps<{
* What to export
*/
exportOptions: ExportOptions;
+
+ format?: Format;
/**
* number of the first page
*/
page: number;
}>();
+const printFormat = computed(() => props.format || props.solutionStyle.paper);
const rows = computed(() => {
if (!props.solutionStyle) return "";
- return `repeat(${props.solutionStyle.grids.rows},0)`;
+ const r = props.solutionStyle.grids.rows;
+ const percent = Math.floor(100 / r);
+ return `repeat(${r}, ${percent}%)`;
});
const cols = computed(() => {
if (!props.solutionStyle) return "";
- return `repeat(${props.solutionStyle.grids.cols},0)`;
+ const r = props.solutionStyle.grids.cols;
+ const percent = Math.floor(100 / r);
+ return `repeat(${r}, ${percent}%)`;
});
const gridNFont = computed(() => getFont(props.solutionStyle.grids.gridN));
const gridNColor = computed(() => {
diff --git a/client/src/components/WordsIndex.vue b/client/src/components/WordsIndex.vue
index 58a5b1c..a4010a3 100644
--- a/client/src/components/WordsIndex.vue
+++ b/client/src/components/WordsIndex.vue
@@ -1,19 +1,21 @@
-
+
-
-
+
+
{{ word }}
-
+
@@ -22,7 +24,7 @@