@contrail/document-generation 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,6 @@ export declare class ComponentGenerator {
9
9
  viewable: string;
10
10
  };
11
11
  static generateComponentFromPropertyTemplate(data: any, options: DocumentElement, template: ComponentPropertyTemplate): DocumentElement;
12
- static generatePropertyTextElements(data: any, properties: Array<ComponentPropertyDefinition>, options: DocumentElement): Array<DocumentElement>;
13
- static generatePropertyTextElement(data: any, property: ComponentPropertyDefinition, options: DocumentElement, formatter: PropertyValueFormatter): DocumentElement;
12
+ static generatePropertyTextElements(data: any, properties: Array<ComponentPropertyDefinition>, options: DocumentElement, yPosition: number): Array<DocumentElement>;
13
+ static generatePropertyTextElement(data: any, property: ComponentPropertyDefinition, options: DocumentElement, formatter: PropertyValueFormatter, yPosition: number): DocumentElement;
14
14
  }
@@ -51,7 +51,7 @@ class ComponentGenerator {
51
51
  width: imageWidth
52
52
  }
53
53
  };
54
- elements.push(...this.generatePropertyTextElements(data, template.properties, textOptions));
54
+ elements.push(...this.generatePropertyTextElements(data, template.properties, textOptions, yPosition));
55
55
  const modelBindings = this.generatedModelBindings(data);
56
56
  componentElement.elements = elements;
57
57
  componentElement.modelBindings = modelBindings;
@@ -63,16 +63,16 @@ class ComponentGenerator {
63
63
  }
64
64
  return componentElement;
65
65
  }
66
- static generatePropertyTextElements(data, properties, options) {
66
+ static generatePropertyTextElements(data, properties, options, yPosition) {
67
67
  const elements = [];
68
68
  const formatter = new types_1.PropertyValueFormatter();
69
69
  for (let property of properties) {
70
- let element = this.generatePropertyTextElement(data, property, options, formatter);
70
+ let element = this.generatePropertyTextElement(data, property, options, formatter, yPosition);
71
71
  elements.push(element);
72
72
  }
73
73
  return elements;
74
74
  }
75
- static generatePropertyTextElement(data, property, options, formatter) {
75
+ static generatePropertyTextElement(data, property, options, formatter, yPosition) {
76
76
  var _a, _b, _c;
77
77
  const key = `${util_1.StringUtil.convertToCamelCase(property.typeRootSlug)}.${property.propertyDefinition.slug}`;
78
78
  let style = property.style || {
@@ -87,7 +87,7 @@ class ComponentGenerator {
87
87
  let element = Object.assign({
88
88
  label: property.includeLabel ? (_b = property.propertyDefinition) === null || _b === void 0 ? void 0 : _b.label : null,
89
89
  type: "text",
90
- position: { x: 0, y: 0 },
90
+ position: { x: 0, y: yPosition },
91
91
  size: { height: 25, width: ((_c = options === null || options === void 0 ? void 0 : options.size) === null || _c === void 0 ? void 0 : _c.width) || 125 },
92
92
  style,
93
93
  propertyBindings: { text: key }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/document-generation",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Utilities for automatic generation of documents.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",