@contrail/document-generation
Advanced tools
Comparing version 1.0.29 to 1.0.30
@@ -23,2 +23,3 @@ "use strict"; | ||
let dataIndex = 0; | ||
console.log("generateComponentGrid: idealSize: ", idealSize); | ||
let gridTemplate = template; | ||
@@ -32,5 +33,2 @@ const optimizeTemplate = true; | ||
const componentSize = this.getComponentSize(data, gridTemplate); | ||
if (componentSize.width < 120) { | ||
componentSize.width = 120; | ||
} | ||
const componentPadding = gridTemplate.componentPadding || 20; | ||
@@ -68,5 +66,7 @@ componentPosition.x += componentPadding; | ||
const adjustedTemplate = util_1.ObjectUtil.cloneDeep(template); | ||
const horizontalPadding = ((template.gridDimensions.cols * 2) * template.componentPadding || 20); | ||
const verticalPadding = ((template.gridDimensions.rows * 2) * template.componentPadding || 20); | ||
const requiredSize = { | ||
width: componentSize.width * template.gridDimensions.cols + ((template.gridDimensions.cols * 2) * template.componentPadding || 20), | ||
height: componentSize.height * template.gridDimensions.rows + ((template.gridDimensions.rows * 2) * template.componentPadding || 20) | ||
width: componentSize.width * template.gridDimensions.cols + horizontalPadding, | ||
height: componentSize.height * template.gridDimensions.rows + verticalPadding, | ||
}; | ||
@@ -73,0 +73,0 @@ const requiredHeightAdjustment = (idealSize.height - requiredSize.height) / template.gridDimensions.rows; |
{ | ||
"name": "@contrail/document-generation", | ||
"version": "1.0.29", | ||
"version": "1.0.30", | ||
"description": "Utilities for automatic generation of documents.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
761065