@colijnit/sharedcomponents 1.0.7 → 1.0.8

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.
Files changed (122) hide show
  1. package/bundles/colijnit-sharedcomponents.umd.js +2140 -0
  2. package/bundles/colijnit-sharedcomponents.umd.js.map +1 -0
  3. package/colijnit-sharedcomponents.d.ts +13 -0
  4. package/colijnit-sharedcomponents.metadata.json +1 -0
  5. package/esm2015/colijnit-sharedcomponents.js +14 -0
  6. package/esm2015/lib/components/docsign/component/signature/signature.component.js +75 -0
  7. package/esm2015/lib/components/docsign/component/signatures/signatures.component.js +44 -0
  8. package/esm2015/lib/components/docsign/docsign.component.js +225 -0
  9. package/esm2015/lib/components/docsign/docsign.module.js +23 -0
  10. package/esm2015/lib/components/send-method-dialog/enums/send-option.js +8 -0
  11. package/esm2015/lib/components/send-method-dialog/send-method-dialog.component.js +203 -0
  12. package/esm2015/lib/components/send-method-dialog/send-method-dialog.module.js +26 -0
  13. package/esm2015/lib/components/stock/stock-information/stock-information.component.js +57 -0
  14. package/esm2015/lib/components/stock/stock-information-grid/stock-information-grid.component.js +254 -0
  15. package/esm2015/lib/components/stock/stock-location/stock-location.component.js +62 -0
  16. package/esm2015/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.js +2 -0
  17. package/esm2015/lib/components/stock/stock-transfer/stock-transfer.component.js +98 -0
  18. package/esm2015/lib/components/stock/stock.component.js +67 -0
  19. package/esm2015/lib/components/stock/stock.module.js +44 -0
  20. package/esm2015/lib/enum/icon.enum.js +23 -0
  21. package/esm2015/lib/factory/business-object-factory.js +120 -0
  22. package/esm2015/lib/factory/decorators/boolean.decorator.js +102 -0
  23. package/esm2015/lib/factory/decorators/complex-array.decorator.js +55 -0
  24. package/esm2015/lib/factory/decorators/complex-field.decorator.js +57 -0
  25. package/esm2015/lib/factory/decorators/date-field.decorator.js +36 -0
  26. package/esm2015/lib/factory/decorators/string-number.decorator.js +43 -0
  27. package/esm2015/lib/model/business-object.js +81 -0
  28. package/esm2015/lib/model/icon-svg.js +22 -0
  29. package/esm2015/lib/service/icon-cache.service.js +51 -0
  30. package/esm2015/lib/service/ione-connector-adapter.service.js +117 -0
  31. package/esm2015/lib/service/stock.service.js +33 -0
  32. package/esm2015/lib/utils/array-utils.js +183 -0
  33. package/esm2015/lib/utils/is-nill.function.js +5 -0
  34. package/esm2015/public-api.js +10 -0
  35. package/fesm2015/colijnit-sharedcomponents.js +2066 -0
  36. package/fesm2015/colijnit-sharedcomponents.js.map +1 -0
  37. package/lib/components/docsign/component/signature/signature.component.d.ts +16 -0
  38. package/{src/lib → lib}/components/docsign/component/signature/style/_layout.scss +0 -0
  39. package/{src/lib → lib}/components/docsign/component/signature/style/_material-definition.scss +0 -0
  40. package/{src/lib → lib}/components/docsign/component/signature/style/_theme.scss +0 -0
  41. package/{src/lib → lib}/components/docsign/component/signature/style/material.scss +0 -0
  42. package/lib/components/docsign/component/signatures/signatures.component.d.ts +12 -0
  43. package/{src/lib → lib}/components/docsign/component/signatures/style/_layout.scss +0 -0
  44. package/{src/lib → lib}/components/docsign/component/signatures/style/_material-definition.scss +0 -0
  45. package/{src/lib → lib}/components/docsign/component/signatures/style/_theme.scss +0 -0
  46. package/{src/lib → lib}/components/docsign/component/signatures/style/material.scss +0 -0
  47. package/lib/components/docsign/docsign.component.d.ts +92 -0
  48. package/lib/components/docsign/docsign.module.d.ts +2 -0
  49. package/{src/lib → lib}/components/docsign/style/_layout.scss +0 -0
  50. package/{src/lib → lib}/components/docsign/style/_material-definition.scss +0 -0
  51. package/{src/lib → lib}/components/docsign/style/_theme.scss +0 -0
  52. package/{src/lib → lib}/components/docsign/style/material.scss +0 -0
  53. package/lib/components/send-method-dialog/enums/send-option.d.ts +6 -0
  54. package/lib/components/send-method-dialog/send-method-dialog.component.d.ts +37 -0
  55. package/lib/components/send-method-dialog/send-method-dialog.module.d.ts +2 -0
  56. package/{src/lib → lib}/components/send-method-dialog/style/_layout.scss +0 -0
  57. package/{src/lib → lib}/components/send-method-dialog/style/_material-definition.scss +0 -0
  58. package/{src/lib → lib}/components/send-method-dialog/style/_theme.scss +0 -0
  59. package/{src/lib → lib}/components/send-method-dialog/style/material.scss +0 -0
  60. package/lib/components/stock/stock-information/stock-information.component.d.ts +8 -0
  61. package/lib/components/stock/stock-information-grid/stock-information-grid.component.d.ts +43 -0
  62. package/lib/components/stock/stock-location/stock-location.component.d.ts +12 -0
  63. package/{src/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.ts → lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.d.ts} +2 -2
  64. package/lib/components/stock/stock-transfer/stock-transfer.component.d.ts +20 -0
  65. package/lib/components/stock/stock.component.d.ts +19 -0
  66. package/lib/components/stock/stock.module.d.ts +2 -0
  67. package/{src/lib → lib}/components/stock/style/_layout.scss +0 -0
  68. package/{src/lib → lib}/components/stock/style/_material-definition.scss +0 -0
  69. package/{src/lib → lib}/components/stock/style/_theme.scss +0 -0
  70. package/{src/lib → lib}/components/stock/style/material.scss +0 -0
  71. package/{src/lib/enum/icon.enum.ts → lib/enum/icon.enum.d.ts} +1 -2
  72. package/lib/factory/business-object-factory.d.ts +23 -0
  73. package/lib/factory/decorators/boolean.decorator.d.ts +43 -0
  74. package/lib/factory/decorators/complex-array.decorator.d.ts +25 -0
  75. package/lib/factory/decorators/complex-field.decorator.d.ts +25 -0
  76. package/lib/factory/decorators/date-field.decorator.d.ts +17 -0
  77. package/lib/factory/decorators/string-number.decorator.d.ts +22 -0
  78. package/lib/model/business-object.d.ts +7 -0
  79. package/lib/model/icon-svg.d.ts +4 -0
  80. package/lib/service/icon-cache.service.d.ts +18 -0
  81. package/lib/service/ione-connector-adapter.service.d.ts +21 -0
  82. package/lib/service/stock.service.d.ts +13 -0
  83. package/{src/lib → lib}/style/_mixin.scss +0 -0
  84. package/{src/lib → lib}/style/_variables.scss +0 -0
  85. package/lib/utils/array-utils.d.ts +57 -0
  86. package/lib/utils/is-nill.function.d.ts +1 -0
  87. package/package.json +25 -15
  88. package/{src/public-api.ts → public-api.d.ts} +0 -4
  89. package/.browserslistrc +0 -16
  90. package/colijnit-sharedcomponents-1.0.7.tgz +0 -0
  91. package/karma.conf.js +0 -44
  92. package/ng-package.json +0 -17
  93. package/src/lib/components/docsign/component/signature/signature.component.ts +0 -82
  94. package/src/lib/components/docsign/component/signatures/signatures.component.ts +0 -50
  95. package/src/lib/components/docsign/docsign.component.ts +0 -252
  96. package/src/lib/components/docsign/docsign.module.ts +0 -22
  97. package/src/lib/components/send-method-dialog/enums/send-option.ts +0 -6
  98. package/src/lib/components/send-method-dialog/send-method-dialog.component.ts +0 -215
  99. package/src/lib/components/send-method-dialog/send-method-dialog.module.ts +0 -27
  100. package/src/lib/components/stock/stock-information/stock-information.component.ts +0 -59
  101. package/src/lib/components/stock/stock-information-grid/stock-information-grid.component.ts +0 -278
  102. package/src/lib/components/stock/stock-location/stock-location.component.ts +0 -82
  103. package/src/lib/components/stock/stock-transfer/stock-transfer.component.ts +0 -111
  104. package/src/lib/components/stock/stock.component.ts +0 -78
  105. package/src/lib/components/stock/stock.module.ts +0 -47
  106. package/src/lib/factory/business-object-factory.ts +0 -120
  107. package/src/lib/factory/decorators/boolean.decorator.ts +0 -113
  108. package/src/lib/factory/decorators/complex-array.decorator.ts +0 -61
  109. package/src/lib/factory/decorators/complex-field.decorator.ts +0 -63
  110. package/src/lib/factory/decorators/date-field.decorator.ts +0 -41
  111. package/src/lib/factory/decorators/string-number.decorator.ts +0 -48
  112. package/src/lib/model/business-object.ts +0 -85
  113. package/src/lib/model/icon-svg.ts +0 -22
  114. package/src/lib/service/icon-cache.service.ts +0 -51
  115. package/src/lib/service/ione-connector-adapter.service.ts +0 -113
  116. package/src/lib/service/stock.service.ts +0 -35
  117. package/src/lib/utils/array-utils.ts +0 -202
  118. package/src/lib/utils/is-nill.function.ts +0 -4
  119. package/src/test.ts +0 -27
  120. package/tsconfig.lib.json +0 -18
  121. package/tsconfig.lib.prod.json +0 -10
  122. package/tsconfig.spec.json +0 -17
@@ -1,82 +0,0 @@
1
- import {Component, ElementRef, EventEmitter, HostBinding, Input, OnInit, Output, ViewChild, ViewEncapsulation} from "@angular/core";
2
- import SignaturePad from "signature_pad";
3
-
4
- @Component({
5
- selector: "ione-signature",
6
- template: `
7
- <div class="signature-wrapper">
8
- <div class="signature-header">
9
- <span *ngIf="title" class="title" [textContent]="title"></span>
10
- <div class="button-wrapper">
11
- <input type="button" (click)="handleSave($event)" [value]="saveButtonLabel"/>
12
- <input type="button" (click)="handleClear($event)" [value]="clearButtonLabel">
13
- </div>
14
- </div>
15
- <div class="canvas">
16
- <canvas #signature></canvas>
17
- </div>
18
- </div>
19
- `,
20
- encapsulation: ViewEncapsulation.None
21
- })
22
- export class SignatureComponent {
23
- @ViewChild("signature", {read: ElementRef}) set content(content: ElementRef) {
24
- if (content) {
25
- this.signatureCanvas = content;
26
- this._initCanvas();
27
- }
28
- }
29
-
30
- @Input()
31
- public title: string;
32
-
33
- @Input()
34
- public saveButtonLabel: string = 'SAVE';
35
-
36
- @Input()
37
- public clearButtonLabel: string = 'CLEAR';
38
-
39
- @Output()
40
- public save: EventEmitter<string> = new EventEmitter<string>();
41
-
42
- @HostBinding("class.ione-signature")
43
- public showClass() {
44
- return true;
45
- }
46
-
47
- public signature: SignaturePad;
48
- public signatureCanvas: ElementRef;
49
-
50
- public handleSave(event: MouseEvent): void {
51
- // save canvas as svg
52
- // const sig: string = this.signature.toDataURL("image/svg+xml");
53
- const sig: string = this.signature.toDataURL("image/png");
54
- // emit signature string
55
- this.save.next(sig);
56
- }
57
-
58
- public handleClear(event: MouseEvent): void {
59
- if (this.signature) {
60
- this.signature.clear();
61
- }
62
- }
63
-
64
- private _initCanvas(): void {
65
- if (this.signatureCanvas && this.signatureCanvas.nativeElement) {
66
- this.signature = new SignaturePad(this.signatureCanvas.nativeElement);
67
- setTimeout(() => {
68
- this._resizeSignatureCanvas(this.signature, this.signatureCanvas);
69
- });
70
- }
71
- }
72
-
73
- private _resizeSignatureCanvas(signature: SignaturePad, signatureCanvas: ElementRef): void {
74
- const imageBeforeResize: string = signature.toDataURL();
75
- const ratio: number = Math.max(window.devicePixelRatio || 1, 1);
76
- signatureCanvas.nativeElement.width = signatureCanvas.nativeElement.offsetWidth * ratio;
77
- signatureCanvas.nativeElement.height = signatureCanvas.nativeElement.offsetHeight * ratio;
78
- signatureCanvas.nativeElement.getContext("2d").scale(ratio, ratio);
79
- signature.fromDataURL(imageBeforeResize);
80
- }
81
-
82
- }
@@ -1,50 +0,0 @@
1
- import {Component, EventEmitter, HostBinding, Input, Output, ViewEncapsulation} from "@angular/core";
2
-
3
- @Component({
4
- selector: "ione-signatures",
5
- template: `
6
- <ione-signature *ngIf="showFirstSignature"
7
- [title]="firstSignatureTitle"
8
- [saveButtonLabel]="saveButtonLabel"
9
- [clearButtonLabel]="clearButtonLabel"
10
- (save)="saveFirstSignature.emit($event)"></ione-signature>
11
- <ione-signature *ngIf="showSecondSignature"
12
- [title]="secondSignatureTitle"
13
- [saveButtonLabel]="saveButtonLabel"
14
- [clearButtonLabel]="clearButtonLabel"
15
- (save)="saveSecondSignature.emit($event)"></ione-signature>
16
- `,
17
- encapsulation: ViewEncapsulation.None
18
- })
19
- export class SignaturesComponent {
20
-
21
- @Input()
22
- public showFirstSignature: boolean = false;
23
-
24
- @Input()
25
- public firstSignatureTitle: string;
26
-
27
- @Input()
28
- public showSecondSignature: boolean = false;
29
-
30
- @Input()
31
- public secondSignatureTitle: string;
32
-
33
- @Input()
34
- public saveButtonLabel: string = 'SAVE';
35
-
36
- @Input()
37
- public clearButtonLabel: string = 'CLEAR';
38
-
39
- @Output()
40
- public saveFirstSignature: EventEmitter<string> = new EventEmitter<string>();
41
-
42
- @Output()
43
- public saveSecondSignature: EventEmitter<string> = new EventEmitter<string>();
44
-
45
- @HostBinding("class.ione-signatures")
46
- public showClass() {
47
- return true;
48
- }
49
-
50
- }
@@ -1,252 +0,0 @@
1
- import {Component, ElementRef, EventEmitter, HostBinding, Input, Output, ViewChild, ViewEncapsulation} from "@angular/core";
2
- import {animate, state, style, transition, trigger} from "@angular/animations";
3
- import {PDFDocument} from "pdf-lib";
4
- import * as PDFJS from "pdfjs-dist/legacy/build/pdf";
5
- import pdfjsWorker from "pdfjs-dist/build/pdf.worker.entry";
6
- import {TextItem} from "pdfjs-dist/types/src/display/api";
7
-
8
- export interface TextDimension {
9
- x: number,
10
- y: number,
11
- width: number,
12
- height: number,
13
- page: number
14
- }
15
-
16
- @Component({
17
- selector: "ione-docsign",
18
- template: `
19
- <iframe #iframe></iframe>
20
- <ione-signatures *ngIf="showSignatures" @showHideSignature
21
- [showFirstSignature]="showSigBuyer"
22
- [firstSignatureTitle]="firstSignatureLabel"
23
- [showSecondSignature]="showSigSeller"
24
- [secondSignatureTitle]="secondSignatureLabel"
25
- [saveButtonLabel]="saveButtonLabel"
26
- [clearButtonLabel]="clearButtonLabel"
27
- (saveFirstSignature)="saveFirstSignature($event)"
28
- (saveSecondSignature)="saveSecondSignature($event)"
29
- ></ione-signatures>
30
- <input type="button" *ngIf="(showSigBuyer || showSigSeller) && !showSignatures" class="button button-sign-document"
31
- [value]="signDocumentButtonLabel"
32
- (click)="showSignatures = true"
33
- />
34
- <input type="button" class="button button-cancel"
35
- [value]="cancelButtonLabel"
36
- (click)="cancelClick.emit($event)"
37
- />
38
- `,
39
- animations: [
40
- trigger("showHideSignature", [
41
- state("void", style({transform: "translate(-50%, -50%) scale(0)"})),
42
- state("*", style({transform: "translate(-50%, -50%) scale(1)"})),
43
- transition("void <=> *", animate("200ms ease-in-out")),
44
- ])
45
- ],
46
- encapsulation: ViewEncapsulation.None
47
- })
48
- export class DocsignComponent {
49
- @ViewChild("iframe", { read: ElementRef })
50
- public iframe: ElementRef;
51
-
52
- /**
53
- * Load an existing [[PDFDocument]]. The input data can be provided in
54
- * multiple formats:
55
- *
56
- * | Type | Contents |
57
- * | ------------- | ------------------------------------------------------ |
58
- * | `string` | A base64 encoded string (or data URI) containing a PDF |
59
- * | `Uint8Array` | The raw bytes of a PDF |
60
- * | `ArrayBuffer` | The raw bytes of a PDF |
61
- *
62
- * For example:
63
- * ```js
64
- * import { PDFDocument } from 'pdf-lib'
65
- *
66
- * // pdf=string
67
- * const base64 =
68
- * 'JVBERi0xLjcKJYGBgYEKCjUgMCBvYmoKPDwKL0ZpbHRlciAvRmxhdGVEZWNvZGUKL0xlbm' +
69
- * 'd0aCAxMDQKPj4Kc3RyZWFtCniccwrhMlAAwaJ0Ln2P1Jyy1JLM5ERdc0MjCwUjE4WQNC4Q' +
70
- * '6cNlCFZkqGCqYGSqEJLLZWNuYGZiZmbkYuZsZmlmZGRgZmluDCQNzc3NTM2NzdzMXMxMjQ' +
71
- * 'ztFEKyuEK0uFxDuAAOERdVCmVuZHN0cmVhbQplbmRvYmoKCjYgMCBvYmoKPDwKL0ZpbHRl' +
72
- * 'ciAvRmxhdGVEZWNvZGUKL1R5cGUgL09ialN0bQovTiA0Ci9GaXJzdCAyMAovTGVuZ3RoID' +
73
- * 'IxNQo+PgpzdHJlYW0KeJxVj9GqwjAMhu/zFHkBzTo3nCCCiiKIHPEICuJF3cKoSCu2E8/b' +
74
- * '20wPIr1p8v9/8kVhgilmGfawX2CGaVrgcAi0/bsy0lrX7IGWpvJ4iJYEN3gEmrrGBlQwGs' +
75
- * 'HHO9VBX1wNrxAqMX87RBD5xpJuddqwd82tjAHxzV1U5LPgy52DKXWnr1Lheg+j/c/pzGVr' +
76
- * 'iqV0VlwZPXGPCJjElw/ybkwUmeoWgxesDXGhHJC/D/iikp1Av80ptKU0FdBEe25pPihAM1' +
77
- * 'u6ytgaaWfs2Hrz35CJT1+EWmAKZW5kc3RyZWFtCmVuZG9iagoKNyAwIG9iago8PAovU2l6' +
78
- * 'ZSA4Ci9Sb290IDIgMCBSCi9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9UeXBlIC9YUmVmCi9MZW' +
79
- * '5ndGggMzgKL1cgWyAxIDIgMiBdCi9JbmRleCBbIDAgOCBdCj4+CnN0cmVhbQp4nBXEwREA' +
80
- * 'EBAEsCwz3vrvRmOOyyOoGhZdutHN2MT55fIAVocD+AplbmRzdHJlYW0KZW5kb2JqCgpzdG' +
81
- * 'FydHhyZWYKNTEwCiUlRU9G'
82
- *
83
- * const dataUri = 'data:application/pdf;base64,' + base64
84
- *
85
- * const pdfDoc1 = await PDFDocument.load(base64)
86
- * const pdfDoc2 = await PDFDocument.load(dataUri)
87
- *
88
- * // pdf=Uint8Array
89
- * import fs from 'fs'
90
- * const uint8Array = fs.readFileSync('with_update_sections.pdf')
91
- * const pdfDoc3 = await PDFDocument.load(uint8Array)
92
- *
93
- * // pdf=ArrayBuffer
94
- * const url = 'https://pdf-lib.js.org/assets/with_update_sections.pdf'
95
- * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())
96
- * const pdfDoc4 = await PDFDocument.load(arrayBuffer)
97
- *
98
- * ```
99
- *
100
- * @param pdf The input data containing a PDF document.
101
- * @param options The options to be used when loading the document.
102
- * @returns Resolves with a document loaded from the input.
103
- */
104
- @Input()
105
- public set pdf(value: any) {
106
- if (value) {
107
- this._pdf = value;
108
- this._openPDF();
109
- }
110
- }
111
-
112
- public get pdf(): any {
113
- return this._pdf;
114
- }
115
-
116
- @Input()
117
- public firstSignatureLabel: string;
118
-
119
- @Input()
120
- public firstSignatureField: string;
121
-
122
- @Input()
123
- public secondSignatureLabel: string;
124
-
125
- @Input()
126
- public secondSignatureField: string;
127
-
128
- @Input()
129
- public saveButtonLabel: string = 'SAVE';
130
-
131
- @Input()
132
- public clearButtonLabel: string = 'CLEAR';
133
-
134
- @Input()
135
- public signDocumentButtonLabel: string = 'SIGN_DOCUMENT';
136
-
137
- @Input()
138
- public cancelButtonLabel: string = 'CANCEL';
139
-
140
- @Output()
141
- public pdfSaved: EventEmitter<string> = new EventEmitter<string>();
142
-
143
- @Output()
144
- public cancelClick: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>();
145
-
146
- @HostBinding('class.ione-docsign')
147
- public showClass() {
148
- return true;
149
- }
150
-
151
- public showSignaturePopup: boolean = false;
152
- public showSigBuyer: boolean = false;
153
- public sigBuyerPosition: TextDimension;
154
- public showSigSeller: boolean = false;
155
- public sigSellerPosition: TextDimension;
156
- public showSignatures: boolean = false;
157
-
158
- public pdfDoc: PDFDocument;
159
-
160
- private _pdf: any;
161
-
162
- public saveFirstSignature(sig: string): void {
163
- this._saveSignature(sig, this.sigBuyerPosition);
164
- this.showSigBuyer = false;
165
- this._savePdf();
166
- }
167
-
168
- public saveSecondSignature(sig: string): void {
169
- this._saveSignature(sig, this.sigSellerPosition);
170
- this.showSigSeller = false;
171
- this._savePdf();
172
- }
173
-
174
- private async _openPDF(): Promise<void> {
175
- // first create reader to check signatures
176
- this._checkSignatures();
177
-
178
- this.pdfDoc = await PDFDocument.load(this._pdf, {
179
- updateMetadata: false
180
- });
181
- const pdfDataUri = await this.pdfDoc.saveAsBase64({ dataUri: true });
182
- this.iframe.nativeElement.src = pdfDataUri;
183
- }
184
-
185
- private async _savePdf(): Promise<void> {
186
- if (!this.showSigBuyer && !this.showSigSeller) {
187
- // ready, save the pdf and emit result
188
- const result = await this.pdfDoc.saveAsBase64();
189
- this.pdfSaved.next(result);
190
- }
191
- }
192
-
193
- private async _checkSignatures(): Promise<void> {
194
- let pdfWorkerSrc;
195
- if (window.hasOwnProperty('pdfWorkerSrc') &&
196
- typeof (window as any).pdfWorkerSrc === 'string' &&
197
- (window as any).pdfWorkerSrc) {
198
- pdfWorkerSrc = (window as any).pdfWorkerSrc;
199
- }
200
- else {
201
- pdfWorkerSrc = pdfjsWorker;
202
- }
203
- PDFJS.GlobalWorkerOptions.workerSrc = pdfWorkerSrc;
204
- const pdfReader = await PDFJS.getDocument(this._pdf).promise;
205
- const numPages = pdfReader.numPages;
206
- for (let i = 0; i < numPages; i++) {
207
- const page = await pdfReader.getPage(i + 1);
208
- const text = await page.getTextContent();
209
- page.cleanup();
210
- if (this.firstSignatureField) {
211
- this.sigBuyerPosition = this._getPositionSignature(text, this.firstSignatureField);
212
- if (this.sigBuyerPosition.width > 0 && this.sigBuyerPosition.height > 0) {
213
- this.sigBuyerPosition.page = i;
214
- this.showSigBuyer = true;
215
- }
216
- }
217
- if (this.secondSignatureField) {
218
- this.sigSellerPosition = this._getPositionSignature(text, this.secondSignatureField);
219
- if (this.sigSellerPosition.width > 0 && this.sigSellerPosition.height > 0) {
220
- this.sigSellerPosition.page = i;
221
- this.showSigSeller = true;
222
- }
223
- }
224
- }
225
- }
226
-
227
- private _getPositionSignature(textItem: any, signatureField: string): TextDimension {
228
- const sigItem: TextItem = <TextItem>textItem.items.find((i: any) => i.str.toLowerCase() === signatureField.toLowerCase());
229
- if (sigItem) {
230
- textItem.items.slice(textItem.items.indexOf(sigItem), 1);
231
- return {
232
- x: sigItem.transform[4],
233
- y: sigItem.transform[5],
234
- width: sigItem.width,
235
- height: sigItem.height,
236
- page: 0
237
- };
238
- }
239
- return {x: 0, y: 0, width: 0, height: 0, page: 0}
240
- }
241
-
242
- private async _saveSignature(sig: string, dimensions: TextDimension): Promise<void> {
243
- const jpgImage = await this.pdfDoc.embedPng(sig);
244
- const page = await this.pdfDoc.getPage(dimensions.page);
245
- page.drawImage(jpgImage, {
246
- x: ((dimensions.x + (dimensions.width / 2)) - (200 / 2)),
247
- y: ((dimensions.y + (dimensions.height / 2)) - (100 / 2)),
248
- width: 200,
249
- height: 100
250
- });
251
- }
252
- }
@@ -1,22 +0,0 @@
1
- import {NgModule} from "@angular/core";
2
- import {CommonModule} from "@angular/common";
3
- import {DocsignComponent} from "./docsign.component";
4
- import {SignatureComponent} from "./component/signature/signature.component";
5
- import {SignaturesComponent} from "./component/signatures/signatures.component";
6
-
7
- @NgModule({
8
- imports: [
9
- CommonModule
10
- ],
11
- declarations: [
12
- DocsignComponent,
13
- SignatureComponent,
14
- SignaturesComponent
15
- ],
16
- exports: [
17
- DocsignComponent
18
- ]
19
- })
20
- export class DocsignModule {
21
-
22
- }
@@ -1,6 +0,0 @@
1
- export enum SendOption {
2
- Email,
3
- Print,
4
- Pdf,
5
- Xml
6
- }
@@ -1,215 +0,0 @@
1
- import {Component, EventEmitter, HostBinding, Input, OnInit, Output, ViewEncapsulation} from "@angular/core";
2
- import {Icon} from "../../enum/icon.enum";
3
- import {IconCacheService} from "../../service/icon-cache.service";
4
- import {SendOption} from "./enums/send-option";
5
- import {animate, state, style, transition, trigger} from "@angular/animations";
6
- import {Printer} from "@colijnit/sharedapi/build/model/printer.bo";
7
- import {StockService} from "../../service/stock.service";
8
-
9
- @Component({
10
- selector: "ione-send-method-dialog",
11
- template: `
12
- <div class="send-method-dialog-wrapper">
13
- <co-dialog-wizard id="sendOptionsDialog" *ngIf="showDialog" [showCloseIcon]="showExitButton" (closeClick)="closeDialogClick()">
14
- <ng-container header>
15
- <span [textContent]="headerTitle"></span>
16
- </ng-container>
17
- <div class="dialog-content-wrapper">
18
- <div class="main-content-container" *ngIf="!showPrinterSelections">
19
- <div class="send-options-wrapper">
20
- <div class="custom-button-wrapper" *ngFor="let sendOption of sendOptions"
21
- [class.selected-option]="sendOption.option === activeSendOption"
22
- (click)="activeSendOption = sendOption.option">
23
- <co-icon [iconData]="iconCacheService.getIcon(sendOption.iconName)"></co-icon>
24
- </div>
25
- </div>
26
-
27
- <div class="email-option-content" *ngIf="activeSendOption === sendOption.Email || activeSendOption === sendOption.Pdf">
28
- <div class="emails-container" *ngIf="activeSendOption === sendOption.Email">
29
- <co-input-checkbox
30
- *ngFor="let email, let index of emails"
31
- [name]="email"
32
- [(model)]="models[index]"
33
- [label]="email"
34
- [cssClass]="'input-checkbox-wrapper'"
35
- ></co-input-checkbox>
36
- </div>
37
-
38
- <div class="lov-wrapper">
39
- <co-input-combo-box
40
- [(model)]="selectedLayout"
41
- [collection]="layouts"
42
- [forceReadonly]="true"
43
- placeholder="Layout"
44
- ></co-input-combo-box>
45
- </div>
46
-
47
- <div class="signature-button-wrapper">
48
- <div class="custom-button-wrapper signature-button" (click)="handleSignatureStart()">
49
- <co-icon [iconData]="iconCacheService.getIcon(icons.SignatureField)"></co-icon>
50
- </div>
51
- </div>
52
- </div>
53
-
54
- <div class="email-option-content" *ngIf="activeSendOption === sendOption.Print">
55
- <div class="lov-wrapper">
56
- <co-input-combo-box
57
- [(model)]="selectedLayout"
58
- [collection]="layouts"
59
- [forceReadonly]="true"
60
- placeholder="Layout"
61
- ></co-input-combo-box>
62
- </div>
63
-
64
- <div class="lov-wrapper clickable" (click)="togglePrinterSelection()">
65
- <div class="selected-printer-wrapper">
66
- <div class="printer-option-list-item">
67
- <co-icon class="printer-icon" [iconData]="iconCacheService.getIcon(icons.Print)"></co-icon>
68
- <div class="printer-details">
69
- <span class="printer-name" [textContent]="defaultPrinter"></span>
70
- <span class="printer-status" [textContent]="'Online'"></span>
71
- </div>
72
- </div>
73
- <co-icon class="select-printer-arrow" [iconData]="iconCacheService.getIcon(icons.ArrowPointRight)"></co-icon>
74
- </div>
75
- </div>
76
-
77
- <div class="standard-printer-wrapper">
78
- <div class="standard-printer-link" (click)="showStandardPrinterOptions = !showStandardPrinterOptions">
79
- <co-icon class="arrow-icon" [iconData]="iconCacheService.getIcon(icons.ArrowFatRight)"></co-icon>
80
- <span class="standard-printer-message" [textContent]="'Standaard printer voor lay-out instellen'"></span>
81
- </div>
82
-
83
- <div class="standard-printer-selections" *ngIf="showStandardPrinterOptions">
84
- <co-input-checkbox
85
- [(model)]="models[0]"
86
- [label]="'Per gebruiker instellen'"
87
- [cssClass]="'input-checkbox-wrapper'"
88
- ></co-input-checkbox>
89
- <co-input-checkbox
90
- [(model)]="models[1]"
91
- [label]="'Voor alle gebruikers instellen'"
92
- [cssClass]="'input-checkbox-wrapper'"
93
- ></co-input-checkbox>
94
- </div>
95
- </div>
96
-
97
- <div class="print-footer-wrapper">
98
- <div class="input-number-wrapper">
99
- <co-input-number-picker class="number-picker"
100
- [step]="1" [(model)]="amountToPrint" [min]="1"
101
- [ngModelOptions]="{debounce: 1}">
102
- </co-input-number-picker>
103
- </div>
104
- <div class="custom-button-wrapper print-button" (click)="handlePrintClicked()">
105
- <span [textContent]="'Print'"></span>
106
- </div>
107
- <div class="custom-button-wrapper signature-button" (click)="handleSignatureStart()">
108
- <co-icon [iconData]="iconCacheService.getIcon(icons.SignatureField)"></co-icon>
109
- </div>
110
- </div>
111
- </div>
112
- </div>
113
-
114
- <div class="printer-content-container" @slideInOut *ngIf="showPrinterSelections">
115
- <div class="selected-printer-wrapper selection clickable" *ngFor="let printers of printerList" (click)="togglePrinterSelection()">
116
- <div class="printer-option-list-item">
117
- <co-icon class="printer-icon" [iconData]="iconCacheService.getIcon(icons.Print)"></co-icon>
118
- <div class="printer-details">
119
- <span class="printer-name" [textContent]="printers.name"></span>
120
- <span class="printer-status" [textContent]="'Online'"></span>
121
- </div>
122
- </div>
123
- <co-icon class="select-printer-arrow" *ngIf="!showPrinterSelections"
124
- [iconData]="iconCacheService.getIcon(icons.ArrowPointRight)"></co-icon>
125
- </div>
126
- </div>
127
- </div>
128
- </co-dialog-wizard>
129
- </div>
130
- `,
131
- encapsulation: ViewEncapsulation.None,
132
- animations: [
133
- trigger('slideInOut', [
134
- state('*', style({transform: 'translateX(0%)', width: '100%', opacity: '1'})),
135
- state('void', style({transform: 'translateX(150%)', opacity: '0'})),
136
- transition('void => *', animate(250))
137
- ])
138
- ]
139
- })
140
-
141
- export class SendMethodDialogComponent {
142
- public readonly icons: typeof Icon = Icon;
143
- public readonly sendOption: typeof SendOption = SendOption;
144
-
145
- public sendOptions: {option: SendOption, iconName: Icon}[] = [
146
- { option: SendOption.Email,
147
- iconName: this.icons.Email },
148
- { option: SendOption.Print,
149
- iconName: this.icons.Print },
150
- { option: SendOption.Pdf,
151
- iconName: this.icons.Pdf },
152
- { option: SendOption.Xml,
153
- iconName: this.icons.Xml }
154
- ]
155
-
156
- public activeSendOption: SendOption = SendOption.Email;
157
- public amountToPrint: number = 1;
158
- public showStandardPrinterOptions: boolean = false;
159
- public showPrinterSelections: boolean = false;
160
- public showExitButton = true;
161
- public defaultPrinter: string;
162
-
163
- public emails: any[] = ['lars.vdv@colijn-it.nl', 'david@colijn-it.nl', 'ruben@colijn-it.nl'];
164
- public models: boolean[] = [false, false, true];
165
-
166
- public layouts: any[] = ['Layout 1', 'Layout 2', 'Layout 3'];
167
- public selectedLayout: 'Layout 1';
168
-
169
- @Input()
170
- public showDialog: boolean = false;
171
-
172
- @Input()
173
- public headerTitle: string;
174
-
175
- @Input()
176
- public printerList: Printer[];
177
-
178
- @Output()
179
- public startSignatureClicked: EventEmitter<any> = new EventEmitter<any>();
180
-
181
- @Output()
182
- public printButtonClicked: EventEmitter<any> = new EventEmitter<any>();
183
-
184
- @HostBinding("class.ione-send-method-dialog")
185
- public showClass(): boolean {
186
- return true;
187
- }
188
-
189
- constructor(
190
- public iconCacheService: IconCacheService,
191
- private _stockService: StockService
192
- ) { }
193
-
194
- public closeDialogClick(): void {
195
- this.showDialog = false;
196
- }
197
-
198
- public handleSignatureStart(): void {
199
- this.startSignatureClicked.emit();
200
- }
201
-
202
- public handlePrintClicked(): void {
203
- this.printButtonClicked.emit();
204
- }
205
-
206
- public togglePrinterSelection(): void {
207
- if (!this.showPrinterSelections) {
208
- this.showPrinterSelections = true;
209
- this.headerTitle = 'Printer selectie';
210
- } else {
211
- this.showPrinterSelections = false;
212
- this.headerTitle = 'Verzendopties';
213
- }
214
- }
215
- }
@@ -1,27 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import {
4
- CoDialogPromptModule, CoDialogWizardModule, IconModule,
5
- InputCheckboxModule,
6
- InputComboBoxModule, InputNumberPickerModule
7
- } from "@colijnit/corecomponents_v12";
8
- import {SendMethodDialogComponent} from "./send-method-dialog.component";
9
-
10
- @NgModule({
11
- declarations: [
12
- SendMethodDialogComponent
13
- ],
14
- imports: [
15
- CommonModule,
16
- CoDialogPromptModule,
17
- InputCheckboxModule,
18
- InputComboBoxModule,
19
- IconModule,
20
- InputNumberPickerModule,
21
- CoDialogWizardModule
22
- ],
23
- exports: [
24
- SendMethodDialogComponent
25
- ]
26
- })
27
- export class SendMethodDialogModule { }