@contrail/document-generation
Advanced tools
Comparing version 2.0.58 to 2.0.59
@@ -30,5 +30,7 @@ "use strict"; | ||
const componentSize = this.getComponentSize(data, gridTemplate); | ||
let componentPosition = util_1.ObjectUtil.cloneDeep(startingPosition); | ||
const componentPadding = gridTemplate.componentPadding || 20; | ||
const alignment = template.alignment || 'left'; | ||
const maxComponentHeight = (idealSize.height - template.gridDimensions.rows * componentPadding * 2) / template.gridDimensions.rows; | ||
componentPosition.y += componentPadding; | ||
for (let row = 0; row < gridTemplate.gridDimensions.rows; row++) { | ||
@@ -50,8 +52,3 @@ const remainingItems = data.length - dataIndex; | ||
rowStartX = Math.round(rowStartX); | ||
let componentPosition = { | ||
x: rowStartX, | ||
y: startingPosition.y + | ||
row * (Math.min(componentSize.height, maxComponentHeight) + componentPadding) + | ||
componentPadding, | ||
}; | ||
componentPosition.x = rowStartX; | ||
for (let col = 0; col < gridTemplate.gridDimensions.cols; col++) { | ||
@@ -68,2 +65,3 @@ if (dataIndex >= data.length) { | ||
componentPosition.x += componentSize.width + componentPadding * 2; | ||
componentPosition.y += Math.min(componentSize.height, maxComponentHeight) + componentPadding * 2; | ||
} | ||
@@ -70,0 +68,0 @@ } |
{ | ||
"name": "@contrail/document-generation", | ||
"version": "2.0.58", | ||
"version": "2.0.59", | ||
"description": "Utilities for automatic generation of documents.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
1107512
28142