@contrail/documents 1.0.12 → 1.0.14

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,7 @@ exports.ITEM_COLOR_VIEW_TEMPLATE = {
9
9
  }, {
10
10
  type: "text",
11
11
  position: { x: 0, y: 126 },
12
+ size: { height: 25, width: 125 },
12
13
  style: {
13
14
  font: {
14
15
  size: 8,
@@ -17,16 +18,7 @@ exports.ITEM_COLOR_VIEW_TEMPLATE = {
17
18
  propertyBindings: { text: 'itemColor.item.name' }
18
19
  }, {
19
20
  type: "text",
20
- position: { x: 0, y: 137 },
21
- style: {
22
- font: {
23
- size: 8,
24
- }
25
- },
26
- propertyBindings: { text: 'itemColor.item.styleNumber' }
27
- }, {
28
- type: "text",
29
- position: { x: 0, y: 148 },
21
+ position: { x: 0, y: 151 },
30
22
  size: { height: 25, width: 125 },
31
23
  style: {
32
24
  font: {
@@ -3,6 +3,7 @@ export declare class DocumentElementFactory {
3
3
  private static initNewElement;
4
4
  static createTextElement(text: string, options?: DocumentElement): DocumentElement;
5
5
  static createShapeElement(type: string, options?: DocumentElement): DocumentElement;
6
+ static createElement(type: string, options?: DocumentElement): DocumentElement;
6
7
  static createImageElement(options: DocumentElement): DocumentElement;
7
8
  static createComponent(componentType: string, model: any, modelBindings: any, options?: DocumentElement): DocumentElement;
8
9
  }
@@ -28,6 +28,11 @@ class DocumentElementFactory {
28
28
  element = Object.assign(element, options);
29
29
  return element;
30
30
  }
31
+ static createElement(type, options = {}) {
32
+ let element = this.initNewElement(type);
33
+ element = Object.assign(element, options);
34
+ return element;
35
+ }
31
36
  static createImageElement(options) {
32
37
  let element = this.initNewElement('image');
33
38
  element = Object.assign(element, options);
@@ -37,3 +37,9 @@ export interface PositionDefinition {
37
37
  y?: number;
38
38
  z?: number;
39
39
  }
40
+ export interface LineDefinition {
41
+ x1?: number;
42
+ x2?: number;
43
+ y1?: number;
44
+ y2?: number;
45
+ }
@@ -1,4 +1,4 @@
1
- import { PositionDefinition } from './common';
1
+ import { LineDefinition, PositionDefinition } from './common';
2
2
  import { Document } from './document';
3
3
  export interface DocumentElement extends Document {
4
4
  id?: string;
@@ -7,4 +7,5 @@ export interface DocumentElement extends Document {
7
7
  text?: string;
8
8
  url?: string;
9
9
  propertyBindings?: any;
10
+ lineDefinition?: LineDefinition;
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/documents",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Documents library for contrail platform",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",