@colijnit/sharedcomponents 1.0.2 → 1.0.5

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 (140) hide show
  1. package/README.md +8 -11
  2. package/bundles/colijnit-sharedcomponents.umd.js +1901 -0
  3. package/bundles/colijnit-sharedcomponents.umd.js.map +1 -0
  4. package/colijnit-sharedcomponents-1.0.5.tgz +0 -0
  5. package/colijnit-sharedcomponents.d.ts +12 -0
  6. package/colijnit-sharedcomponents.metadata.json +1 -0
  7. package/esm2015/colijnit-sharedcomponents.js +13 -0
  8. package/esm2015/lib/components/docsign/component/signature/signature.component.js +75 -0
  9. package/esm2015/lib/components/docsign/component/signatures/signatures.component.js +44 -0
  10. package/esm2015/lib/components/docsign/docsign.component.js +225 -0
  11. package/esm2015/lib/components/docsign/docsign.module.js +23 -0
  12. package/esm2015/lib/components/stock/stock-information/stock-information.component.js +60 -0
  13. package/esm2015/lib/components/stock/stock-information-grid/stock-information-grid.component.js +255 -0
  14. package/esm2015/lib/components/stock/stock-location/stock-location.component.js +62 -0
  15. package/esm2015/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.js +2 -0
  16. package/esm2015/lib/components/stock/stock-transfer/stock-transfer.component.js +98 -0
  17. package/esm2015/lib/components/stock/stock.component.js +74 -0
  18. package/esm2015/lib/components/stock/stock.module.js +42 -0
  19. package/esm2015/lib/factory/business-object-factory.js +120 -0
  20. package/esm2015/lib/factory/decorators/boolean.decorator.js +102 -0
  21. package/esm2015/lib/factory/decorators/complex-array.decorator.js +55 -0
  22. package/esm2015/lib/factory/decorators/complex-field.decorator.js +57 -0
  23. package/esm2015/lib/factory/decorators/date-field.decorator.js +36 -0
  24. package/esm2015/lib/factory/decorators/string-number.decorator.js +43 -0
  25. package/esm2015/lib/model/business-object.js +81 -0
  26. package/esm2015/lib/service/ione-connector-adapter.service.js +98 -0
  27. package/esm2015/lib/service/stock.service.js +28 -0
  28. package/esm2015/lib/utils/array-utils.js +183 -0
  29. package/esm2015/lib/utils/is-nill.function.js +5 -0
  30. package/esm2015/public-api.js +8 -0
  31. package/fesm2015/colijnit-sharedcomponents.js +1731 -0
  32. package/fesm2015/colijnit-sharedcomponents.js.map +1 -0
  33. package/lib/components/docsign/component/signature/signature.component.d.ts +16 -0
  34. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_layout.scss +0 -0
  35. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_material-definition.scss +0 -0
  36. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_theme.scss +0 -0
  37. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/material.scss +0 -0
  38. package/lib/components/docsign/component/signatures/signatures.component.d.ts +12 -0
  39. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_layout.scss +0 -0
  40. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_material-definition.scss +0 -0
  41. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_theme.scss +0 -0
  42. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/material.scss +0 -0
  43. package/lib/components/docsign/docsign.component.d.ts +92 -0
  44. package/lib/components/docsign/docsign.module.d.ts +2 -0
  45. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_layout.scss +0 -0
  46. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_material-definition.scss +0 -0
  47. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_theme.scss +0 -0
  48. package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/material.scss +0 -0
  49. package/lib/components/stock/stock-information/stock-information.component.d.ts +10 -0
  50. package/lib/components/stock/stock-information-grid/stock-information-grid.component.d.ts +43 -0
  51. package/lib/components/stock/stock-location/stock-location.component.d.ts +12 -0
  52. package/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.d.ts +4 -0
  53. package/lib/components/stock/stock-transfer/stock-transfer.component.d.ts +19 -0
  54. package/lib/components/stock/stock.component.d.ts +20 -0
  55. package/lib/components/stock/stock.module.d.ts +2 -0
  56. package/lib/components/stock/style/_layout.scss +206 -0
  57. package/lib/components/stock/style/_material-definition.scss +20 -0
  58. package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/_theme.scss +0 -0
  59. package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/material.scss +0 -0
  60. package/lib/factory/business-object-factory.d.ts +23 -0
  61. package/lib/factory/decorators/boolean.decorator.d.ts +43 -0
  62. package/lib/factory/decorators/complex-array.decorator.d.ts +25 -0
  63. package/lib/factory/decorators/complex-field.decorator.d.ts +25 -0
  64. package/lib/factory/decorators/date-field.decorator.d.ts +17 -0
  65. package/lib/factory/decorators/string-number.decorator.d.ts +22 -0
  66. package/lib/model/business-object.d.ts +7 -0
  67. package/lib/service/ione-connector-adapter.service.d.ts +17 -0
  68. package/lib/service/stock.service.d.ts +11 -0
  69. package/{projects/sharedcomponents/src/lib → lib}/style/_mixin.scss +0 -0
  70. package/{projects/sharedcomponents/src/lib → lib}/style/_variables.scss +0 -0
  71. package/lib/utils/array-utils.d.ts +57 -0
  72. package/lib/utils/is-nill.function.d.ts +1 -0
  73. package/package.json +25 -66
  74. package/{projects/sharedcomponents/src/public-api.ts → public-api.d.ts} +2 -4
  75. package/.browserslistrc +0 -16
  76. package/.editorconfig +0 -16
  77. package/.vscode/extensions.json +0 -4
  78. package/.vscode/launch.json +0 -20
  79. package/.vscode/tasks.json +0 -42
  80. package/Sharedcomponents.iml +0 -11
  81. package/angular.json +0 -133
  82. package/colijnit-sharedcomponents-1.0.2.tgz +0 -0
  83. package/karma.conf.js +0 -44
  84. package/move-assets.js +0 -14
  85. package/projects/sharedcomponents/.browserslistrc +0 -16
  86. package/projects/sharedcomponents/README.md +0 -24
  87. package/projects/sharedcomponents/karma.conf.js +0 -44
  88. package/projects/sharedcomponents/ng-package.json +0 -17
  89. package/projects/sharedcomponents/package.json +0 -15
  90. package/projects/sharedcomponents/src/lib/components/docsign/component/signature/signature.component.ts +0 -82
  91. package/projects/sharedcomponents/src/lib/components/docsign/component/signatures/signatures.component.ts +0 -50
  92. package/projects/sharedcomponents/src/lib/components/docsign/docsign.component.ts +0 -252
  93. package/projects/sharedcomponents/src/lib/components/docsign/docsign.module.ts +0 -22
  94. package/projects/sharedcomponents/src/lib/components/stock/stock-information/stock-information.component.ts +0 -56
  95. package/projects/sharedcomponents/src/lib/components/stock/stock-information-grid/stock-information-grid.component.ts +0 -279
  96. package/projects/sharedcomponents/src/lib/components/stock/stock-location/stock-location.component.ts +0 -82
  97. package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/_layout.scss +0 -11
  98. package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/_material-definition.scss +0 -1
  99. package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/_theme.scss +0 -18
  100. package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/material.scss +0 -4
  101. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/stock-transfer.component.ts +0 -52
  102. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/_layout.scss +0 -18
  103. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/_material-definition.scss +0 -1
  104. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/_theme.scss +0 -6
  105. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/material.scss +0 -4
  106. package/projects/sharedcomponents/src/lib/components/stock/stock.component.ts +0 -56
  107. package/projects/sharedcomponents/src/lib/components/stock/stock.module.ts +0 -45
  108. package/projects/sharedcomponents/src/lib/components/stock/style/_layout.scss +0 -146
  109. package/projects/sharedcomponents/src/lib/components/stock/style/_material-definition.scss +0 -1
  110. package/projects/sharedcomponents/src/lib/factory/business-object-factory.ts +0 -120
  111. package/projects/sharedcomponents/src/lib/factory/decorators/boolean.decorator.ts +0 -113
  112. package/projects/sharedcomponents/src/lib/factory/decorators/complex-array.decorator.ts +0 -61
  113. package/projects/sharedcomponents/src/lib/factory/decorators/complex-field.decorator.ts +0 -63
  114. package/projects/sharedcomponents/src/lib/factory/decorators/date-field.decorator.ts +0 -41
  115. package/projects/sharedcomponents/src/lib/factory/decorators/string-number.decorator.ts +0 -48
  116. package/projects/sharedcomponents/src/lib/model/business-object.ts +0 -85
  117. package/projects/sharedcomponents/src/lib/service/ione-connector-adapter.service.ts +0 -49
  118. package/projects/sharedcomponents/src/lib/service/stock.service.ts +0 -40
  119. package/projects/sharedcomponents/src/lib/utils/array-utils.ts +0 -202
  120. package/projects/sharedcomponents/src/lib/utils/is-nill.function.ts +0 -4
  121. package/projects/sharedcomponents/src/test.ts +0 -27
  122. package/projects/sharedcomponents/tsconfig.lib.json +0 -18
  123. package/projects/sharedcomponents/tsconfig.lib.prod.json +0 -10
  124. package/projects/sharedcomponents/tsconfig.spec.json +0 -17
  125. package/src/app/app.component.scss +0 -8
  126. package/src/app/app.component.spec.ts +0 -31
  127. package/src/app/app.component.ts +0 -75
  128. package/src/app/app.module.ts +0 -22
  129. package/src/assets/.gitkeep +0 -0
  130. package/src/environments/environment.prod.ts +0 -3
  131. package/src/environments/environment.ts +0 -16
  132. package/src/favicon.ico +0 -0
  133. package/src/index.html +0 -13
  134. package/src/main.ts +0 -12
  135. package/src/polyfills.ts +0 -53
  136. package/src/styles.scss +0 -24
  137. package/src/test.ts +0 -26
  138. package/tsconfig.app.json +0 -15
  139. package/tsconfig.json +0 -65
  140. package/tsconfig.spec.json +0 -18
@@ -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(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,56 +0,0 @@
1
- import {Component, ViewEncapsulation} from "@angular/core";
2
-
3
- @Component({
4
- selector: "co-stock-information",
5
- template: `
6
- <div class="stock-info">
7
- <div class="stock-info-row">
8
- <div class="stock-info-row-image">
9
- <div class="stock-image">
10
- <co-image></co-image>
11
- </div>
12
- </div>
13
- <div class="stock-good-info">
14
- <div>
15
- <span [textContent]=""></span>
16
- </div>
17
- <div>
18
- <span [textContent]=""></span>
19
- </div>
20
- </div>
21
- </div>
22
- <div class="stock-status">
23
- <label [textContent]="'STATE'"></label>
24
- </div>
25
- <div class="stock-status">
26
- <label [textContent]="'STOCK'"></label>
27
- <span></span>
28
- </div>
29
- <div class="stock-status">
30
- <label [textContent]="'AVAILABLE_STOCK'"></label>
31
- <span>totalAmountAvailable</span>
32
- </div>
33
- <div class="stock-status">
34
- <label [textContent]="'ECONOMICAL_STOCK'"></label>
35
- <span></span>
36
- </div>
37
- <div class="stock-status">
38
- <label [textContent]="'PHYSICAL_STOCK'"></label>
39
- <span></span>
40
- </div>
41
- </div>
42
- `,
43
- encapsulation: ViewEncapsulation.None
44
- })
45
- export class StockInformationComponent {
46
-
47
- public stockStatus: string = "medium";
48
- public image: string;
49
- public show: boolean = false;
50
- public hideOrShowLocationTab: boolean = false;
51
-
52
- constructor(
53
- ) {
54
- }
55
-
56
- }
@@ -1,279 +0,0 @@
1
- import {Component, Output, ViewChild, ViewEncapsulation, EventEmitter} from "@angular/core";
2
- import {StockService} from "../../../service/stock.service";
3
-
4
- @Component({
5
- selector: "co-stock-information-grid",
6
- template: `
7
- <div class="tab-link" [ngClass]="hideOrShowTabs">
8
- <co-input-radio-button *ngFor="let tab of tabs"
9
- (click)="handleTabClick(tab)"
10
- [textContent]="tab"
11
- ></co-input-radio-button>
12
- </div>
13
-
14
- <div class="stock-line">
15
- <div [textContent]="activeTabText"></div>
16
-
17
- </div>
18
-
19
- <div class="stock-grid">
20
- <co-simple-grid *ngIf="activeTab === tabs[0] && hideOrShowTabs === 'show'"
21
- [data]="stockInformation"
22
- >
23
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseNumber'"></co-simple-grid-column>
24
- <co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'warehouseDescription'"></co-simple-grid-column>
25
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
26
- <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'amountAvailable'"></co-simple-grid-column>
27
- <co-simple-grid-column [headerText]="'ECONOMICAL_STOCK'" [field]="'amountLaterAvailable'"></co-simple-grid-column>
28
- <co-simple-grid-column [headerText]="'LOCATION'" [field]="'location'">
29
- <ng-template let-row="row">
30
- <a [textContent]="'bekijken'" (click)="onLocationClick($event)"></a>
31
- </ng-template>
32
- </co-simple-grid-column>
33
- </co-simple-grid>
34
-
35
- <co-simple-grid *ngIf="activeTab === tabs[1]"
36
- [data]="inOrderInformation"
37
- >
38
- <co-simple-grid-column [headerText]="'IN_ORDER2'" [field]="'inOrder'"></co-simple-grid-column>
39
- <co-simple-grid-column [headerText]="'CUSTOMER'" [field]="'customer'"></co-simple-grid-column>
40
- <co-simple-grid-column [headerText]="'DATE'" [field]="'orderDate'"></co-simple-grid-column>
41
- <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'orderAmount'"></co-simple-grid-column>
42
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseNumber'"></co-simple-grid-column>
43
- <co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'warehouseDescription'"></co-simple-grid-column>
44
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
45
- <co-simple-grid-column [headerText]="'COMMISSION2'" [field]="'commission'"></co-simple-grid-column>
46
- <co-simple-grid-column [headerText]="'TRANSFER'" [field]="'transfer'">
47
- <ng-template let-row="row">
48
-
49
- </ng-template>
50
- </co-simple-grid-column>
51
- <co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
52
- <ng-template let-row="row">
53
-
54
- </ng-template>
55
- </co-simple-grid-column>
56
- </co-simple-grid>
57
-
58
- <co-simple-grid *ngIf="activeTab === tabs[2]"
59
- [data]="orderInformation"
60
- >
61
- <co-simple-grid-column [headerText]="'PURCHASE_ORDER_NR'" [field]="'purchaseOrderNo'"></co-simple-grid-column>
62
- <co-simple-grid-column [headerText]="'DATE'" [field]="'orderDate'"></co-simple-grid-column>
63
- <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'orderAmount'"></co-simple-grid-column>
64
- <co-simple-grid-column [headerText]="'RESERVED'" [field]="'reserved'"></co-simple-grid-column>
65
- <co-simple-grid-column [headerText]="'FREE_STOCK'" [field]="'freeStock'"></co-simple-grid-column>
66
- <co-simple-grid-column [headerText]="'DELIVERY_DATE1'" [field]="'deliveryDate'"></co-simple-grid-column>
67
- <co-simple-grid-column [headerText]="'RESERVE'" [field]="'reservation'"></co-simple-grid-column>
68
- </co-simple-grid>
69
- </div>
70
-
71
- <div class="stock-grid" *ngIf="hideOrShowLocationTab">
72
- <div class="stock-location-group">
73
- <div class="stock-location-left-group">
74
- <co-button class="stock-lines-button" [textContent]="'BACK_TO_STOCK_LINES'" (click)="handleBackToStockClick()"></co-button>
75
- </div>
76
- <div class="stock-location-right-group">
77
- <co-input-combo-box [(model)]="dataWareHouseCode"
78
- [source]=""
79
- [fields]="dataWareHouseFields"
80
- [placeholder]="'WAREHOUSE'"
81
- [required]="true"
82
- ></co-input-combo-box>
83
- </div>
84
- </div>
85
-
86
- <co-simple-grid [data]="stockLocationInformation"
87
- >
88
- <div class="stock-location-group">
89
- <div class="stock-location-left-group">
90
- <co-button class="stock-lines-button" [textContent]="'BACK_TO_STOCK_LINES'" (click)="handleBackToStockClick()"></co-button>
91
- </div>
92
- </div>
93
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'location'"></co-simple-grid-column>
94
- <co-simple-grid-column [headerText]="'BATCH'" [field]="'batch'"></co-simple-grid-column>
95
- <co-simple-grid-column [headerText]="'SERIAL_NO'" [field]="'serialNo'"></co-simple-grid-column>
96
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
97
- <co-simple-grid-column [headerText]="'ALLOCATED'" [field]="'allocated'"></co-simple-grid-column>
98
- <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'amountAvailable'"></co-simple-grid-column>
99
- <co-simple-grid-column [headerText]="'TRANSFER'" [field]="'transfer'">
100
- <ng-template let-row="row">
101
- <span [textContent]="'Transfer'" (click)="handleStockTransferClick($event)"></span>
102
- </ng-template>
103
- </co-simple-grid-column>
104
- <co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
105
- <ng-template let-row="row">
106
-
107
- </ng-template>
108
- </co-simple-grid-column>
109
- </co-simple-grid>
110
- </div>
111
-
112
- <div class="stock-grid" *ngIf="showStockHistory">
113
- <co-simple-grid [data]="stockHistoryInformation"
114
- >
115
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'location'"></co-simple-grid-column>
116
- <co-simple-grid-column [headerText]="'BATCH'" [field]="'batch'"></co-simple-grid-column>
117
- <co-simple-grid-column [headerText]="'SERIAL_NO'" [field]="'serialNo'"></co-simple-grid-column>
118
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
119
- <co-simple-grid-column [headerText]="'ALLOCATED'" [field]="'allocated'"></co-simple-grid-column>
120
- <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'amountAvailable'"></co-simple-grid-column>
121
- <co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
122
- <ng-template let-row="row">
123
-
124
- </ng-template>
125
- </co-simple-grid-column>
126
- </co-simple-grid>
127
- </div>
128
-
129
- <div class="stock-button-toolbar">
130
- <div class="stock-button-left-group">
131
- <co-button [label]="'HISTORY'" (click)="handleHistoryClick()"></co-button>
132
- </div>
133
- <div class="stock-button-middle-group">
134
- <div class="button-left">
135
- <co-button (click)="onOkClick()"></co-button>
136
- </div>
137
- <div class="button-right">
138
- <co-button (click)="onCancelClick()"></co-button>
139
- </div>
140
- </div>
141
- </div>
142
- `,
143
- encapsulation: ViewEncapsulation.None
144
- })
145
- export class StockInformationGridComponent {
146
-
147
- @ViewChild(StockInformationGridComponent)
148
- public stock: StockInformationGridComponent;
149
-
150
- @Output()
151
- public readonly locationLineClicked: EventEmitter<[]> = new EventEmitter();
152
-
153
- @Output()
154
- public readonly transferIconClicked: EventEmitter<[]> = new EventEmitter();
155
-
156
- public readonly MAX_GRID_ROWS: number = 10;
157
-
158
- public stockStatus: string = "medium";
159
- public image: string;
160
- public show: boolean = false;
161
- public hideOrShowLocationTab: boolean = false;
162
- public showStockHistory: boolean = false;
163
-
164
- public data: any[] = [
165
- {test: "test"}
166
- ];
167
-
168
- public stockInformation: Object[] = [
169
- {warehouseNumber: "1", warehouseDescription: "Colijn IT Warehouse", amountInStock: "17", amountAvailable: "13", amountLaterAvailable: "4", location: "test"},
170
- {warehouseNumber: "2", warehouseDescription: "Colijn IT Warehouse", amountInStock: "17", amountAvailable: "13", amountLaterAvailable: "4", location: "Test nummer 2"},
171
- {warehouseNumber: "3", warehouseDescription: "Colijn IT Warehouse", amountInStock: "17", amountAvailable: "13", amountLaterAvailable: "4", location: "Amundsenweg"},
172
- ];
173
- public stockLocationInformation: Object[] = [
174
- {location: "title 1", batch: "1", serialNo: "1", amountInStock: "1", allocated: "1", amountAvailable: "1"},
175
- {location: "title 2", amountInStock: "2"},
176
- {location: "title 3", amountInStock: "3"},
177
- {location: "title 4", amountInStock: "4"},
178
- {location: "title 5", amountInStock: "5"},
179
- ];
180
- public inOrderInformation: Object[] = [
181
- {inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321"},
182
- {inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321"},
183
- {inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321"},
184
- {inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321"},
185
- {inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321"},
186
- ];
187
- public stockHistoryInformation: Object[] = [
188
-
189
- ];
190
- public orderInformation: any[] = [];
191
-
192
- public stockColumns: any[] = [];
193
- public stockLocationColumns: any[] = [];
194
- public inOrderColumns: any[] = [];
195
- public orderColumns: any[] = [];
196
-
197
- public hideOrShowTabs: string = "show";
198
- public hideOrShowStockLocation: string = "hide";
199
-
200
- public dataWareHouseCode: number = 0;
201
- public dataWareHouseFields: Object = { text: "warehouseDescription", value: "warehouseNumber" };
202
-
203
- public tabs: string[] = [
204
- "STOCK",
205
- "IN_ORDER2",
206
- "ORDERS1"
207
- ];
208
- public activeTab: string = this.tabs[0];
209
-
210
- public get activeTabText(): string {
211
- switch (this.activeTab) {
212
- case this.tabs[0]:
213
- return "Voorraadregels";
214
- case this.tabs[1]:
215
- return "Gevonden in order(s)";
216
- case this.tabs[2]:
217
- return "Gevonden in bestellingen";
218
- default:
219
- return "Voorraadlocatie regels";
220
- }
221
- }
222
-
223
- constructor(
224
- private _stockService: StockService
225
- ) {
226
- }
227
-
228
- public handleTabClick(tabData): void {
229
- this.activeTab = tabData;
230
- }
231
-
232
- public onLocationClick(event): void {
233
- // this.locationLineClicked.emit(event[0].location);
234
- this.activeTab = "";
235
- this.hideOrShowLocationTab = true;
236
- }
237
-
238
- public onRowClick(args: any): void {
239
- }
240
-
241
- public onPopupClose(): void {
242
- this.show = false;
243
- }
244
-
245
- public handleHistoryClick(): void {
246
- this.showStockHistory = true;
247
- }
248
-
249
- public handleCloseClick(): void {
250
- this.onPopupClose();
251
- }
252
-
253
- public handleStockTransferClick(event): void {
254
- this.transferIconClicked.emit(event);
255
- }
256
-
257
- public async handleBackToStockClick(): Promise<void> {
258
- this.activeTab = this.tabs[0];
259
- this.hideOrShowTabs = "show";
260
- this.hideOrShowStockLocation = "hide";
261
- this.hideOrShowLocationTab = false;
262
- }
263
-
264
- public handleStickerClick(): void {
265
-
266
- }
267
-
268
- public handleTransferClick(): void {
269
-
270
- }
271
-
272
- public onOkClick(): void {
273
-
274
- }
275
-
276
- public onCancelClick(): void {
277
-
278
- }
279
- }