@colijnit/sharedcomponents 1.0.4 → 1.0.7

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 (110) hide show
  1. package/.browserslistrc +16 -0
  2. package/colijnit-sharedcomponents-1.0.7.tgz +0 -0
  3. package/karma.conf.js +44 -0
  4. package/ng-package.json +17 -0
  5. package/package.json +15 -25
  6. package/src/lib/components/docsign/component/signature/signature.component.ts +82 -0
  7. package/{lib → src/lib}/components/docsign/component/signature/style/_layout.scss +0 -0
  8. package/{lib → src/lib}/components/docsign/component/signature/style/_material-definition.scss +0 -0
  9. package/{lib → src/lib}/components/docsign/component/signature/style/_theme.scss +0 -0
  10. package/{lib → src/lib}/components/docsign/component/signature/style/material.scss +0 -0
  11. package/src/lib/components/docsign/component/signatures/signatures.component.ts +50 -0
  12. package/{lib → src/lib}/components/docsign/component/signatures/style/_layout.scss +0 -0
  13. package/{lib → src/lib}/components/docsign/component/signatures/style/_material-definition.scss +0 -0
  14. package/{lib → src/lib}/components/docsign/component/signatures/style/_theme.scss +0 -0
  15. package/{lib → src/lib}/components/docsign/component/signatures/style/material.scss +0 -0
  16. package/src/lib/components/docsign/docsign.component.ts +252 -0
  17. package/src/lib/components/docsign/docsign.module.ts +22 -0
  18. package/{lib → src/lib}/components/docsign/style/_layout.scss +0 -0
  19. package/{lib → src/lib}/components/docsign/style/_material-definition.scss +0 -0
  20. package/{lib → src/lib}/components/docsign/style/_theme.scss +0 -0
  21. package/{lib → src/lib}/components/docsign/style/material.scss +0 -0
  22. package/src/lib/components/send-method-dialog/enums/send-option.ts +6 -0
  23. package/src/lib/components/send-method-dialog/send-method-dialog.component.ts +215 -0
  24. package/src/lib/components/send-method-dialog/send-method-dialog.module.ts +27 -0
  25. package/src/lib/components/send-method-dialog/style/_layout.scss +186 -0
  26. package/src/lib/components/send-method-dialog/style/_material-definition.scss +1 -0
  27. package/src/lib/components/send-method-dialog/style/_theme.scss +7 -0
  28. package/{lib/components/stock → src/lib/components/send-method-dialog}/style/material.scss +0 -0
  29. package/src/lib/components/stock/stock-information/stock-information.component.ts +59 -0
  30. package/src/lib/components/stock/stock-information-grid/stock-information-grid.component.ts +278 -0
  31. package/src/lib/components/stock/stock-location/stock-location.component.ts +82 -0
  32. package/src/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.ts +4 -0
  33. package/src/lib/components/stock/stock-transfer/stock-transfer.component.ts +111 -0
  34. package/src/lib/components/stock/stock.component.ts +78 -0
  35. package/src/lib/components/stock/stock.module.ts +47 -0
  36. package/{lib → src/lib}/components/stock/style/_layout.scss +9 -2
  37. package/{lib → src/lib}/components/stock/style/_material-definition.scss +5 -2
  38. package/{lib → src/lib}/components/stock/style/_theme.scss +0 -0
  39. package/src/lib/components/stock/style/material.scss +4 -0
  40. package/src/lib/enum/icon.enum.ts +22 -0
  41. package/src/lib/factory/business-object-factory.ts +120 -0
  42. package/src/lib/factory/decorators/boolean.decorator.ts +113 -0
  43. package/src/lib/factory/decorators/complex-array.decorator.ts +61 -0
  44. package/src/lib/factory/decorators/complex-field.decorator.ts +63 -0
  45. package/src/lib/factory/decorators/date-field.decorator.ts +41 -0
  46. package/src/lib/factory/decorators/string-number.decorator.ts +48 -0
  47. package/src/lib/model/business-object.ts +85 -0
  48. package/src/lib/model/icon-svg.ts +22 -0
  49. package/src/lib/service/icon-cache.service.ts +51 -0
  50. package/src/lib/service/ione-connector-adapter.service.ts +113 -0
  51. package/src/lib/service/stock.service.ts +35 -0
  52. package/{lib → src/lib}/style/_mixin.scss +0 -0
  53. package/{lib → src/lib}/style/_variables.scss +0 -0
  54. package/src/lib/utils/array-utils.ts +202 -0
  55. package/src/lib/utils/is-nill.function.ts +4 -0
  56. package/{public-api.d.ts → src/public-api.ts} +6 -0
  57. package/src/test.ts +27 -0
  58. package/tsconfig.lib.json +18 -0
  59. package/tsconfig.lib.prod.json +10 -0
  60. package/tsconfig.spec.json +17 -0
  61. package/bundles/colijnit-sharedcomponents.umd.js +0 -1823
  62. package/bundles/colijnit-sharedcomponents.umd.js.map +0 -1
  63. package/colijnit-sharedcomponents.d.ts +0 -12
  64. package/colijnit-sharedcomponents.metadata.json +0 -1
  65. package/esm2015/colijnit-sharedcomponents.js +0 -13
  66. package/esm2015/lib/components/docsign/component/signature/signature.component.js +0 -75
  67. package/esm2015/lib/components/docsign/component/signatures/signatures.component.js +0 -44
  68. package/esm2015/lib/components/docsign/docsign.component.js +0 -225
  69. package/esm2015/lib/components/docsign/docsign.module.js +0 -23
  70. package/esm2015/lib/components/stock/stock-information/stock-information.component.js +0 -54
  71. package/esm2015/lib/components/stock/stock-information-grid/stock-information-grid.component.js +0 -255
  72. package/esm2015/lib/components/stock/stock-location/stock-location.component.js +0 -62
  73. package/esm2015/lib/components/stock/stock-transfer/stock-transfer.component.js +0 -71
  74. package/esm2015/lib/components/stock/stock.component.js +0 -61
  75. package/esm2015/lib/components/stock/stock.module.js +0 -42
  76. package/esm2015/lib/factory/business-object-factory.js +0 -120
  77. package/esm2015/lib/factory/decorators/boolean.decorator.js +0 -102
  78. package/esm2015/lib/factory/decorators/complex-array.decorator.js +0 -55
  79. package/esm2015/lib/factory/decorators/complex-field.decorator.js +0 -57
  80. package/esm2015/lib/factory/decorators/date-field.decorator.js +0 -36
  81. package/esm2015/lib/factory/decorators/string-number.decorator.js +0 -43
  82. package/esm2015/lib/model/business-object.js +0 -81
  83. package/esm2015/lib/service/ione-connector-adapter.service.js +0 -47
  84. package/esm2015/lib/service/stock.service.js +0 -40
  85. package/esm2015/lib/utils/array-utils.js +0 -183
  86. package/esm2015/lib/utils/is-nill.function.js +0 -5
  87. package/esm2015/public-api.js +0 -8
  88. package/fesm2015/colijnit-sharedcomponents.js +0 -1649
  89. package/fesm2015/colijnit-sharedcomponents.js.map +0 -1
  90. package/lib/components/docsign/component/signature/signature.component.d.ts +0 -16
  91. package/lib/components/docsign/component/signatures/signatures.component.d.ts +0 -12
  92. package/lib/components/docsign/docsign.component.d.ts +0 -92
  93. package/lib/components/docsign/docsign.module.d.ts +0 -2
  94. package/lib/components/stock/stock-information/stock-information.component.d.ts +0 -7
  95. package/lib/components/stock/stock-information-grid/stock-information-grid.component.d.ts +0 -43
  96. package/lib/components/stock/stock-location/stock-location.component.d.ts +0 -12
  97. package/lib/components/stock/stock-transfer/stock-transfer.component.d.ts +0 -9
  98. package/lib/components/stock/stock.component.d.ts +0 -18
  99. package/lib/components/stock/stock.module.d.ts +0 -2
  100. package/lib/factory/business-object-factory.d.ts +0 -23
  101. package/lib/factory/decorators/boolean.decorator.d.ts +0 -43
  102. package/lib/factory/decorators/complex-array.decorator.d.ts +0 -25
  103. package/lib/factory/decorators/complex-field.decorator.d.ts +0 -25
  104. package/lib/factory/decorators/date-field.decorator.d.ts +0 -17
  105. package/lib/factory/decorators/string-number.decorator.d.ts +0 -22
  106. package/lib/model/business-object.d.ts +0 -7
  107. package/lib/service/ione-connector-adapter.service.d.ts +0 -11
  108. package/lib/service/stock.service.d.ts +0 -9
  109. package/lib/utils/array-utils.d.ts +0 -57
  110. package/lib/utils/is-nill.function.d.ts +0 -1
@@ -1,1649 +0,0 @@
1
- import { __awaiter } from 'tslib';
2
- import * as i0 from '@angular/core';
3
- import { EventEmitter, Component, ViewEncapsulation, ViewChild, ElementRef, Input, Output, HostBinding, NgModule, Injectable } from '@angular/core';
4
- import { trigger, state, style, transition, animate } from '@angular/animations';
5
- import { PDFDocument } from 'pdf-lib';
6
- import * as PDFJS from 'pdfjs-dist/legacy/build/pdf';
7
- import pdfjsWorker from 'pdfjs-dist/build/pdf.worker.entry';
8
- import { CommonModule } from '@angular/common';
9
- import SignaturePad from 'signature_pad';
10
- import { Articles } from '@colijnit/articleapi/build/articles';
11
- import { notNill } from '@colijnit/articleapi/build/utils/function/not-nill.function';
12
- import { ObjectUtils } from '@colijnit/articleapi/build/utils/object-utils';
13
- import { GetYesNoDbBooleanValue } from '@colijnit/articleapi/build/enum/yes-no-db-type.enum';
14
- import { GetTrueFalseDbBooleanValue } from '@colijnit/articleapi/build/enum/true-false-db-type.enum';
15
- import { GetOneZeroDbBooleanValue } from '@colijnit/articleapi/build/enum/one-zero-bool-db-type.enum';
16
- import { GetLogicalBooleanValue } from '@colijnit/articleapi/build/enum/db-boolean-value-type.enum';
17
- import { DateUtils } from '@colijnit/articleapi/build/utils/date-utils';
18
- import { NumberUtils } from '@colijnit/articleapi/build/utils/number-utils';
19
- import { isNill as isNill$1 } from '@colijnit/articleapi/build/utils/function/is-nill.function';
20
- import { MapPropertyDecorator } from '@colijnit/articleapi/build/factory/decorators/map-property.decorator';
21
- import { BooleanTextDecorator as BooleanTextDecorator$1 } from '@colijnit/articleapi/build/factory/decorators/boolean.decorator';
22
- import { JsonFieldFieldDecorator } from '@colijnit/articleapi/build/factory/decorators/json.decorator';
23
- import { ComplexArrayDecorator as ComplexArrayDecorator$1 } from '@colijnit/articleapi/build/factory/decorators/complex-array.decorator';
24
- import { InputComboBoxModule, CoGridModule, ButtonModule, InputRadioButtonModule, DropDownModule, SimpleGridModule, ImageModule, InputTextModule } from '@colijnit/corecomponents_v12';
25
-
26
- class DocsignComponent {
27
- constructor() {
28
- this.saveButtonLabel = 'SAVE';
29
- this.clearButtonLabel = 'CLEAR';
30
- this.signDocumentButtonLabel = 'SIGN_DOCUMENT';
31
- this.cancelButtonLabel = 'CANCEL';
32
- this.pdfSaved = new EventEmitter();
33
- this.cancelClick = new EventEmitter();
34
- this.showSignaturePopup = false;
35
- this.showSigBuyer = false;
36
- this.showSigSeller = false;
37
- this.showSignatures = false;
38
- }
39
- /**
40
- * Load an existing [[PDFDocument]]. The input data can be provided in
41
- * multiple formats:
42
- *
43
- * | Type | Contents |
44
- * | ------------- | ------------------------------------------------------ |
45
- * | `string` | A base64 encoded string (or data URI) containing a PDF |
46
- * | `Uint8Array` | The raw bytes of a PDF |
47
- * | `ArrayBuffer` | The raw bytes of a PDF |
48
- *
49
- * For example:
50
- * ```js
51
- * import { PDFDocument } from 'pdf-lib'
52
- *
53
- * // pdf=string
54
- * const base64 =
55
- * 'JVBERi0xLjcKJYGBgYEKCjUgMCBvYmoKPDwKL0ZpbHRlciAvRmxhdGVEZWNvZGUKL0xlbm' +
56
- * 'd0aCAxMDQKPj4Kc3RyZWFtCniccwrhMlAAwaJ0Ln2P1Jyy1JLM5ERdc0MjCwUjE4WQNC4Q' +
57
- * '6cNlCFZkqGCqYGSqEJLLZWNuYGZiZmbkYuZsZmlmZGRgZmluDCQNzc3NTM2NzdzMXMxMjQ' +
58
- * 'ztFEKyuEK0uFxDuAAOERdVCmVuZHN0cmVhbQplbmRvYmoKCjYgMCBvYmoKPDwKL0ZpbHRl' +
59
- * 'ciAvRmxhdGVEZWNvZGUKL1R5cGUgL09ialN0bQovTiA0Ci9GaXJzdCAyMAovTGVuZ3RoID' +
60
- * 'IxNQo+PgpzdHJlYW0KeJxVj9GqwjAMhu/zFHkBzTo3nCCCiiKIHPEICuJF3cKoSCu2E8/b' +
61
- * '20wPIr1p8v9/8kVhgilmGfawX2CGaVrgcAi0/bsy0lrX7IGWpvJ4iJYEN3gEmrrGBlQwGs' +
62
- * 'HHO9VBX1wNrxAqMX87RBD5xpJuddqwd82tjAHxzV1U5LPgy52DKXWnr1Lheg+j/c/pzGVr' +
63
- * 'iqV0VlwZPXGPCJjElw/ybkwUmeoWgxesDXGhHJC/D/iikp1Av80ptKU0FdBEe25pPihAM1' +
64
- * 'u6ytgaaWfs2Hrz35CJT1+EWmAKZW5kc3RyZWFtCmVuZG9iagoKNyAwIG9iago8PAovU2l6' +
65
- * 'ZSA4Ci9Sb290IDIgMCBSCi9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9UeXBlIC9YUmVmCi9MZW' +
66
- * '5ndGggMzgKL1cgWyAxIDIgMiBdCi9JbmRleCBbIDAgOCBdCj4+CnN0cmVhbQp4nBXEwREA' +
67
- * 'EBAEsCwz3vrvRmOOyyOoGhZdutHN2MT55fIAVocD+AplbmRzdHJlYW0KZW5kb2JqCgpzdG' +
68
- * 'FydHhyZWYKNTEwCiUlRU9G'
69
- *
70
- * const dataUri = 'data:application/pdf;base64,' + base64
71
- *
72
- * const pdfDoc1 = await PDFDocument.load(base64)
73
- * const pdfDoc2 = await PDFDocument.load(dataUri)
74
- *
75
- * // pdf=Uint8Array
76
- * import fs from 'fs'
77
- * const uint8Array = fs.readFileSync('with_update_sections.pdf')
78
- * const pdfDoc3 = await PDFDocument.load(uint8Array)
79
- *
80
- * // pdf=ArrayBuffer
81
- * const url = 'https://pdf-lib.js.org/assets/with_update_sections.pdf'
82
- * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())
83
- * const pdfDoc4 = await PDFDocument.load(arrayBuffer)
84
- *
85
- * ```
86
- *
87
- * @param pdf The input data containing a PDF document.
88
- * @param options The options to be used when loading the document.
89
- * @returns Resolves with a document loaded from the input.
90
- */
91
- set pdf(value) {
92
- if (value) {
93
- this._pdf = value;
94
- this._openPDF();
95
- }
96
- }
97
- get pdf() {
98
- return this._pdf;
99
- }
100
- showClass() {
101
- return true;
102
- }
103
- saveFirstSignature(sig) {
104
- this._saveSignature(sig, this.sigBuyerPosition);
105
- this.showSigBuyer = false;
106
- this._savePdf();
107
- }
108
- saveSecondSignature(sig) {
109
- this._saveSignature(sig, this.sigSellerPosition);
110
- this.showSigSeller = false;
111
- this._savePdf();
112
- }
113
- _openPDF() {
114
- return __awaiter(this, void 0, void 0, function* () {
115
- // first create reader to check signatures
116
- this._checkSignatures();
117
- this.pdfDoc = yield PDFDocument.load(this._pdf, {
118
- updateMetadata: false
119
- });
120
- const pdfDataUri = yield this.pdfDoc.saveAsBase64({ dataUri: true });
121
- this.iframe.nativeElement.src = pdfDataUri;
122
- });
123
- }
124
- _savePdf() {
125
- return __awaiter(this, void 0, void 0, function* () {
126
- if (!this.showSigBuyer && !this.showSigSeller) {
127
- // ready, save the pdf and emit result
128
- const result = yield this.pdfDoc.saveAsBase64();
129
- this.pdfSaved.next(result);
130
- }
131
- });
132
- }
133
- _checkSignatures() {
134
- return __awaiter(this, void 0, void 0, function* () {
135
- let pdfWorkerSrc;
136
- if (window.hasOwnProperty('pdfWorkerSrc') &&
137
- typeof window.pdfWorkerSrc === 'string' &&
138
- window.pdfWorkerSrc) {
139
- pdfWorkerSrc = window.pdfWorkerSrc;
140
- }
141
- else {
142
- pdfWorkerSrc = pdfjsWorker;
143
- }
144
- PDFJS.GlobalWorkerOptions.workerSrc = pdfWorkerSrc;
145
- const pdfReader = yield PDFJS.getDocument(this._pdf).promise;
146
- const numPages = pdfReader.numPages;
147
- for (let i = 0; i < numPages; i++) {
148
- const page = yield pdfReader.getPage(1);
149
- const text = yield page.getTextContent();
150
- page.cleanup();
151
- if (this.firstSignatureField) {
152
- this.sigBuyerPosition = this._getPositionSignature(text, this.firstSignatureField);
153
- if (this.sigBuyerPosition.width > 0 && this.sigBuyerPosition.height > 0) {
154
- this.sigBuyerPosition.page = i;
155
- this.showSigBuyer = true;
156
- }
157
- }
158
- if (this.secondSignatureField) {
159
- this.sigSellerPosition = this._getPositionSignature(text, this.secondSignatureField);
160
- if (this.sigSellerPosition.width > 0 && this.sigSellerPosition.height > 0) {
161
- this.sigSellerPosition.page = i;
162
- this.showSigSeller = true;
163
- }
164
- }
165
- }
166
- });
167
- }
168
- _getPositionSignature(textItem, signatureField) {
169
- const sigItem = textItem.items.find((i) => i.str.toLowerCase() === signatureField.toLowerCase());
170
- if (sigItem) {
171
- textItem.items.slice(textItem.items.indexOf(sigItem), 1);
172
- return {
173
- x: sigItem.transform[4],
174
- y: sigItem.transform[5],
175
- width: sigItem.width,
176
- height: sigItem.height,
177
- page: 0
178
- };
179
- }
180
- return { x: 0, y: 0, width: 0, height: 0, page: 0 };
181
- }
182
- _saveSignature(sig, dimensions) {
183
- return __awaiter(this, void 0, void 0, function* () {
184
- const jpgImage = yield this.pdfDoc.embedPng(sig);
185
- const page = yield this.pdfDoc.getPage(dimensions.page);
186
- page.drawImage(jpgImage, {
187
- x: ((dimensions.x + (dimensions.width / 2)) - (200 / 2)),
188
- y: ((dimensions.y + (dimensions.height / 2)) - (100 / 2)),
189
- width: 200,
190
- height: 100
191
- });
192
- });
193
- }
194
- }
195
- DocsignComponent.decorators = [
196
- { type: Component, args: [{
197
- selector: "ione-docsign",
198
- template: `
199
- <iframe #iframe></iframe>
200
- <ione-signatures *ngIf="showSignatures" @showHideSignature
201
- [showFirstSignature]="showSigBuyer"
202
- [firstSignatureTitle]="firstSignatureLabel"
203
- [showSecondSignature]="showSigSeller"
204
- [secondSignatureTitle]="secondSignatureLabel"
205
- [saveButtonLabel]="saveButtonLabel"
206
- [clearButtonLabel]="clearButtonLabel"
207
- (saveFirstSignature)="saveFirstSignature($event)"
208
- (saveSecondSignature)="saveSecondSignature($event)"
209
- ></ione-signatures>
210
- <input type="button" *ngIf="(showSigBuyer || showSigSeller) && !showSignatures" class="button button-sign-document"
211
- [value]="signDocumentButtonLabel"
212
- (click)="showSignatures = true"
213
- />
214
- <input type="button" class="button button-cancel"
215
- [value]="cancelButtonLabel"
216
- (click)="cancelClick.emit($event)"
217
- />
218
- `,
219
- animations: [
220
- trigger("showHideSignature", [
221
- state("void", style({ transform: "translate(-50%, -50%) scale(0)" })),
222
- state("*", style({ transform: "translate(-50%, -50%) scale(1)" })),
223
- transition("void <=> *", animate("200ms ease-in-out")),
224
- ])
225
- ],
226
- encapsulation: ViewEncapsulation.None
227
- },] }
228
- ];
229
- DocsignComponent.propDecorators = {
230
- iframe: [{ type: ViewChild, args: ["iframe", { read: ElementRef },] }],
231
- pdf: [{ type: Input }],
232
- firstSignatureLabel: [{ type: Input }],
233
- firstSignatureField: [{ type: Input }],
234
- secondSignatureLabel: [{ type: Input }],
235
- secondSignatureField: [{ type: Input }],
236
- saveButtonLabel: [{ type: Input }],
237
- clearButtonLabel: [{ type: Input }],
238
- signDocumentButtonLabel: [{ type: Input }],
239
- cancelButtonLabel: [{ type: Input }],
240
- pdfSaved: [{ type: Output }],
241
- cancelClick: [{ type: Output }],
242
- showClass: [{ type: HostBinding, args: ['class.ione-docsign',] }]
243
- };
244
-
245
- class SignatureComponent {
246
- constructor() {
247
- this.saveButtonLabel = 'SAVE';
248
- this.clearButtonLabel = 'CLEAR';
249
- this.save = new EventEmitter();
250
- }
251
- set content(content) {
252
- if (content) {
253
- this.signatureCanvas = content;
254
- this._initCanvas();
255
- }
256
- }
257
- showClass() {
258
- return true;
259
- }
260
- handleSave(event) {
261
- // save canvas as svg
262
- // const sig: string = this.signature.toDataURL("image/svg+xml");
263
- const sig = this.signature.toDataURL("image/png");
264
- // emit signature string
265
- this.save.next(sig);
266
- }
267
- handleClear(event) {
268
- if (this.signature) {
269
- this.signature.clear();
270
- }
271
- }
272
- _initCanvas() {
273
- if (this.signatureCanvas && this.signatureCanvas.nativeElement) {
274
- this.signature = new SignaturePad(this.signatureCanvas.nativeElement);
275
- setTimeout(() => {
276
- this._resizeSignatureCanvas(this.signature, this.signatureCanvas);
277
- });
278
- }
279
- }
280
- _resizeSignatureCanvas(signature, signatureCanvas) {
281
- const imageBeforeResize = signature.toDataURL();
282
- const ratio = Math.max(window.devicePixelRatio || 1, 1);
283
- signatureCanvas.nativeElement.width = signatureCanvas.nativeElement.offsetWidth * ratio;
284
- signatureCanvas.nativeElement.height = signatureCanvas.nativeElement.offsetHeight * ratio;
285
- signatureCanvas.nativeElement.getContext("2d").scale(ratio, ratio);
286
- signature.fromDataURL(imageBeforeResize);
287
- }
288
- }
289
- SignatureComponent.decorators = [
290
- { type: Component, args: [{
291
- selector: "ione-signature",
292
- template: `
293
- <div class="signature-wrapper">
294
- <div class="signature-header">
295
- <span *ngIf="title" class="title" [textContent]="title"></span>
296
- <div class="button-wrapper">
297
- <input type="button" (click)="handleSave($event)" [value]="saveButtonLabel"/>
298
- <input type="button" (click)="handleClear($event)" [value]="clearButtonLabel">
299
- </div>
300
- </div>
301
- <div class="canvas">
302
- <canvas #signature></canvas>
303
- </div>
304
- </div>
305
- `,
306
- encapsulation: ViewEncapsulation.None
307
- },] }
308
- ];
309
- SignatureComponent.propDecorators = {
310
- content: [{ type: ViewChild, args: ["signature", { read: ElementRef },] }],
311
- title: [{ type: Input }],
312
- saveButtonLabel: [{ type: Input }],
313
- clearButtonLabel: [{ type: Input }],
314
- save: [{ type: Output }],
315
- showClass: [{ type: HostBinding, args: ["class.ione-signature",] }]
316
- };
317
-
318
- class SignaturesComponent {
319
- constructor() {
320
- this.showFirstSignature = false;
321
- this.showSecondSignature = false;
322
- this.saveButtonLabel = 'SAVE';
323
- this.clearButtonLabel = 'CLEAR';
324
- this.saveFirstSignature = new EventEmitter();
325
- this.saveSecondSignature = new EventEmitter();
326
- }
327
- showClass() {
328
- return true;
329
- }
330
- }
331
- SignaturesComponent.decorators = [
332
- { type: Component, args: [{
333
- selector: "ione-signatures",
334
- template: `
335
- <ione-signature *ngIf="showFirstSignature"
336
- [title]="firstSignatureTitle"
337
- [saveButtonLabel]="saveButtonLabel"
338
- [clearButtonLabel]="clearButtonLabel"
339
- (save)="saveFirstSignature.emit($event)"></ione-signature>
340
- <ione-signature *ngIf="showSecondSignature"
341
- [title]="secondSignatureTitle"
342
- [saveButtonLabel]="saveButtonLabel"
343
- [clearButtonLabel]="clearButtonLabel"
344
- (save)="saveSecondSignature.emit($event)"></ione-signature>
345
- `,
346
- encapsulation: ViewEncapsulation.None
347
- },] }
348
- ];
349
- SignaturesComponent.propDecorators = {
350
- showFirstSignature: [{ type: Input }],
351
- firstSignatureTitle: [{ type: Input }],
352
- showSecondSignature: [{ type: Input }],
353
- secondSignatureTitle: [{ type: Input }],
354
- saveButtonLabel: [{ type: Input }],
355
- clearButtonLabel: [{ type: Input }],
356
- saveFirstSignature: [{ type: Output }],
357
- saveSecondSignature: [{ type: Output }],
358
- showClass: [{ type: HostBinding, args: ["class.ione-signatures",] }]
359
- };
360
-
361
- class DocsignModule {
362
- }
363
- DocsignModule.decorators = [
364
- { type: NgModule, args: [{
365
- imports: [
366
- CommonModule
367
- ],
368
- declarations: [
369
- DocsignComponent,
370
- SignatureComponent,
371
- SignaturesComponent
372
- ],
373
- exports: [
374
- DocsignComponent
375
- ]
376
- },] }
377
- ];
378
-
379
- const PROP_META_KEY$3 = "complexField";
380
- /**
381
- * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
382
- */
383
- /**
384
- * Property decorator for properties of businessobject classes that are other strongly typed businessobjects.
385
- * Ensures that the BusinessObjectFactoryService makes properly typed objects from incoming raw persistence data. Otherwise we couldn't add methods
386
- * to our own businessobjects and use them, since all fields would be flat data without methods after BusinessObjectFactoryService creation.
387
- *
388
- * Usage:
389
- *
390
- * @ComplexField(Transaction)
391
- * public transaction: Transaction
392
- *
393
- * Also keeps track of a "complexFieldProps" metadata on the class-level, as a reflect-metadata workaround to be able to
394
- * retrieve all properties that have the @ComplexField(..) decorator (impossible with current Reflect API).
395
- */
396
- function ComplexField(type) {
397
- return function (target, propertyKey) {
398
- if (!target || !propertyKey) {
399
- return;
400
- }
401
- // warn the programmer if given type was undefined; it's probably an import order glitch that caused this, because decorators seem
402
- // to be immediately processed when a class is first imported
403
- if (!type) {
404
- // eslint-disable-next-line no-console
405
- console.warn(`@ComplexField(type): type was UNDEFINED. Called on prop (${ObjectUtils.GetClassName(target)}, ${propertyKey}). ` +
406
- `Class will not properly serialize and deserialize now. We've always been able to fix this by CHANGING IMPORT ORDERS ` +
407
- `where both classes and their dependencies are used, e.g. factory, repository or models..`);
408
- return;
409
- }
410
- Reflect.defineMetadata(PROP_META_KEY$3, type, target, propertyKey);
411
- };
412
- }
413
- // Utility function holder of the ComplexFieldDecorator decorator.
414
- class ComplexFieldDecorator {
415
- /**
416
- * Returns whether given property (as a string) on given object is a complex field. A complex field is a field that is decorated
417
- * with the @ComplexField decorator.
418
- */
419
- static IsComplexField(target, propertyKey) {
420
- if (!target || !propertyKey || typeof target !== "object") {
421
- return false;
422
- }
423
- return (notNill(Reflect.getMetadata(PROP_META_KEY$3, target, propertyKey)));
424
- }
425
- // Returns the VALUE of the @ComplexField(VALUE) property decorator on the given propertyKey on the given modelObject.
426
- static GetComplexFieldType(target, propertyKey) {
427
- if (!target || !propertyKey || typeof target !== "object") {
428
- return undefined;
429
- }
430
- return Reflect.getMetadata(PROP_META_KEY$3, target, propertyKey);
431
- }
432
- }
433
-
434
- const PROP_META_KEY$2 = "complexArray";
435
- /**
436
- * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
437
- */
438
- /**
439
- * Property decorator for properties of businessobject classes that are an array of other strongly typed businessobjects.
440
- * Ensures that the BusinessObjectFactoryService makes properly typed objects from incoming raw persistence data. Otherwise we couldn't add methods
441
- * to our own businessobjects and use them, since all fields would be flat data without methods after BusinessObjectFactoryService creation.
442
- *
443
- * Usage:
444
- *
445
- * @ComplexArray(TransactionLine)
446
- * public transactionLines: TransactionLine[]
447
- */
448
- function ComplexArray(type) {
449
- return function (target, propertyKey) {
450
- if (!target || !propertyKey || typeof target !== "object") {
451
- return;
452
- }
453
- // warn the programmer if given type was undefined; it's probably an import order glitch that caused this, because decorators seem
454
- // to be immediately processed when a class is first imported
455
- if (!type) {
456
- console.warn(`@ComplexArray(type): type was UNDEFINED. Called on prop (${ObjectUtils.GetClassName(target)}, ${propertyKey}). ` +
457
- `Class will not properly serialize and deserialize now. We've always been able to fix this by CHANGING IMPORT ORDERS ` +
458
- `where both classes and their dependencies are used, e.g. factory, repository or models..`);
459
- return;
460
- }
461
- Reflect.defineMetadata(PROP_META_KEY$2, type, target, propertyKey);
462
- };
463
- }
464
- // Utility function holder of the ComplexArrayDecorator decorator.
465
- class ComplexArrayDecorator {
466
- /**
467
- * Returns whether given property (as a string) on given object is a complex array. A complex array is an array field that is decorated
468
- * with the @ComplexArray decorator.
469
- */
470
- static IsComplexArray(target, propertyKey) {
471
- if (!target || !propertyKey || typeof target !== "object") {
472
- return false;
473
- }
474
- return (notNill(Reflect.getMetadata(PROP_META_KEY$2, target, propertyKey)));
475
- }
476
- /**
477
- * Returns the VALUE of the @ComplexArray(VALUE) property decorator on the given propertyKey on the given modelobject.
478
- */
479
- static GetComplexArrayType(target, propertyKey) {
480
- if (!target || !propertyKey || typeof target !== "object") {
481
- return undefined;
482
- }
483
- return Reflect.getMetadata(PROP_META_KEY$2, target, propertyKey);
484
- }
485
- }
486
-
487
- const PROP_META_KEY_JN = "booleanTextJN";
488
- const PROP_META_KEY_TF = "booleanTextTF";
489
- const PROP_META_KEY_10 = "booleanText10";
490
- /**
491
- * There are 'J', 'T', 'N', 'F', 0 and 1 'boolean values' in the database. These should be translated to true and false boolean values in
492
- * our client application.
493
- *
494
- * The values 'J' and 'N' seem to be most commonly used. This is the default setting when using this decorator.
495
- * You can pass 'T' or 1 for the other variants as follows:
496
- *
497
- * Usage:
498
- *
499
- * @BooleanText() or @BooleanText("J") (the default, uses YesNoDbType char values)
500
- * public foo: boolean // 'J' and 'N' become true and false after BusinessObjectFactoryService and -SerializerService processing
501
- *
502
- * @BooleanText('T') (uses TrueFalseDbType char values)
503
- * public bar: boolean // 'T' and 'F' become true and false after BusinessObjectFactoryService and -SerializerService processing
504
- *
505
- * @BooleanText(1)
506
- * public baz: boolean // 1 and 0 become true and false after BusinessObjectFactoryService and -SerializerService processing
507
- */
508
- function BooleanText(type) {
509
- return function (target, propertyKey) {
510
- if (!target || !propertyKey) {
511
- return;
512
- }
513
- // by default, it's a J N boolean text
514
- if (!type || type === "J") {
515
- Reflect.defineMetadata(PROP_META_KEY_JN, true, target, propertyKey);
516
- }
517
- else if (type === "T") {
518
- Reflect.defineMetadata(PROP_META_KEY_TF, true, target, propertyKey);
519
- }
520
- else if (type === 1) {
521
- Reflect.defineMetadata(PROP_META_KEY_10, true, target, propertyKey);
522
- }
523
- };
524
- }
525
- // Utility function holder of the BooleanTextDecorator decorator.
526
- class BooleanTextDecorator {
527
- /**
528
- * Returns whether given property (as a string) on given object is a boolean text field. That is, it's a field that is decorated
529
- * with the @BooleanText decorator.
530
- */
531
- static IsBooleanTextField(target, propertyKey) {
532
- if (!target || !propertyKey || typeof target !== "object") {
533
- return false;
534
- }
535
- return (Reflect.getMetadata(PROP_META_KEY_JN, target, propertyKey) === true
536
- ||
537
- Reflect.getMetadata(PROP_META_KEY_TF, target, propertyKey) === true
538
- ||
539
- Reflect.getMetadata(PROP_META_KEY_10, target, propertyKey) === true);
540
- }
541
- /**
542
- * Returns the logical true or false value of given character ('J', 'N', 'T' or 'F') or number (0 or 1).
543
- * Returns UNDEFINED if given boolChar was not recognised as a boolean text.
544
- */
545
- static GetLogicalBooleanValue(dbBoolChar) {
546
- return GetLogicalBooleanValue(dbBoolChar);
547
- }
548
- /**
549
- * Returns the boolean character / number of given logical bool property on target object. Uses its @BooleanText() annotation to decide
550
- * what character / number to return.
551
- * Used in BusinessObjectSerializerServiceService to convert logical bools to their original boolean character.
552
- * @returns {string|number} The original, reverse-engineered boolean character (or number) of given object property, or undefined.
553
- */
554
- static GetDbBooleanValue(target, propertyKey) {
555
- if (!target || !propertyKey || typeof target !== "object") {
556
- return undefined;
557
- }
558
- let dbBoolVal = undefined;
559
- const curBoolVal = target[propertyKey];
560
- if (BooleanTextDecorator._IsJaNeeProp(target, propertyKey)) {
561
- dbBoolVal = GetYesNoDbBooleanValue(curBoolVal);
562
- }
563
- else if (BooleanTextDecorator._IsTrueFalseProp(target, propertyKey)) {
564
- dbBoolVal = GetTrueFalseDbBooleanValue(curBoolVal);
565
- }
566
- else if (BooleanTextDecorator._IsZeroOneProp(target, propertyKey)) {
567
- dbBoolVal = GetOneZeroDbBooleanValue(curBoolVal);
568
- }
569
- return dbBoolVal;
570
- }
571
- static _IsJaNeeProp(target, propertyKey) {
572
- return BooleanTextDecorator._IsProp(PROP_META_KEY_JN, target, propertyKey);
573
- }
574
- static _IsTrueFalseProp(target, propertyKey) {
575
- return BooleanTextDecorator._IsProp(PROP_META_KEY_TF, target, propertyKey);
576
- }
577
- static _IsZeroOneProp(target, propertyKey) {
578
- return BooleanTextDecorator._IsProp(PROP_META_KEY_10, target, propertyKey);
579
- }
580
- static _IsProp(prop, target, propertyKey) {
581
- return !!target && !!propertyKey && typeof target === "object" && Reflect.hasMetadata(prop, target, propertyKey);
582
- }
583
- }
584
-
585
- const PROP_META_KEY$1 = "dateField";
586
- /**
587
- * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
588
- */
589
- /**
590
- * Property decorator for properties of businessobject classes that are of type Date, but are sent to us as strings.
591
- * Ensures that the BusinessObjectFactory makes proper JavaScript Date objects from incoming strings for @DateField() decorated properties.
592
- *
593
- * Usage:
594
- *
595
- * @DateField()
596
- * public expectedDeliveryDate: Date
597
- */
598
- function DateField() {
599
- return function (target, propertyKey) {
600
- if (!target || !propertyKey) {
601
- return;
602
- }
603
- Reflect.defineMetadata(PROP_META_KEY$1, undefined, target, propertyKey);
604
- };
605
- }
606
- // Utility function holder of the @DateField() decorator.
607
- class DateFieldFieldDecorator {
608
- // Returns whether given property (as a string) on given object is decorated with @DateField().
609
- static IsDateField(target, propertyKey) {
610
- if (!target || !propertyKey || typeof target !== "object") {
611
- return false;
612
- }
613
- return Reflect.hasMetadata(PROP_META_KEY$1, target, propertyKey);
614
- }
615
- static StringAsDate(str) {
616
- return DateUtils.StringAsDate(str);
617
- }
618
- }
619
-
620
- const PROP_META_KEY = "stringNumber";
621
- /**
622
- * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
623
- */
624
- /**
625
- * Decorator for properties of businessobjects that are sent to us as strings from the database, but which we want to use as a number in the client.
626
- *
627
- * Can be handy for incongruent backend api cases, where id data types are communicated wrongly via strings instead of numbers
628
- * (e.g. on EmployeeFullObject.district, points to a District which has a number id, but in employee it's a string representation of that number...)
629
- *
630
- * Used by business object factory and -serializer.
631
- *
632
- * Usage:
633
- *
634
- * @StringNumber()
635
- * public rights: UserRightType
636
- */
637
- function StringNumber() {
638
- return function (target, propertyKey) {
639
- if (!target || !propertyKey) {
640
- return;
641
- }
642
- Reflect.defineMetadata(PROP_META_KEY, undefined, target, propertyKey);
643
- };
644
- }
645
- // Utility function holder of the @StringNumber() decorator.
646
- class StringNumberDecorator {
647
- // Returns whether given property (as a string) on given object is decorated with @StringNumber().
648
- static IsStringNumber(target, propertyKey) {
649
- if (!target || !propertyKey || typeof target !== "object") {
650
- return false;
651
- }
652
- return Reflect.hasMetadata(PROP_META_KEY, target, propertyKey);
653
- }
654
- static StringAsNumber(str) {
655
- return NumberUtils.ParseFloatKeepPrecision(str);
656
- }
657
- static NumberAsString(nr) {
658
- return "" + nr;
659
- }
660
- }
661
-
662
- // @returns true iff given value equals null or equals undefined
663
- function isNill(value) {
664
- return value === null || value === undefined;
665
- }
666
-
667
- class ArrayUtils {
668
- /**
669
- * Returns whether at least one element in given array could be found by given finder function.
670
- *
671
- * @param {T[]} array
672
- * @param {(element: T) => boolean} finder A finder function that takes an element of the array and returns a boolean that represents
673
- * the 'found status' for that element; whether it should have been found or not.
674
- */
675
- static ContainsAnElementFoundBy(array, finder) {
676
- if (!array || !finder) {
677
- return false;
678
- }
679
- return notNill(this.Find(array, finder));
680
- }
681
- /**
682
- * Cross-browser Array.find() function. Returns the first item in given array for which the foundBy function returns true. Returns
683
- * undefined when none was found.
684
- *
685
- * Example usage:
686
- * const foundItem: BusinessObject = ArrayUtils.Find<BusinessObject>(modelArray, (modelItem: BusinessObject) => <br>
687
- * (return modelItem.getId() === '1')
688
- * * });
689
- *
690
- * @param array The array with items to search in.
691
- * @param foundBy The finder function applied on each items of the array, when that returns true, the item is considered found.
692
- */
693
- static Find(array, foundBy) {
694
- if (!array || !foundBy) {
695
- return undefined;
696
- }
697
- for (let i = 0, len = array.length; i < len; i++) {
698
- const itemCur = array[i];
699
- if (foundBy(itemCur)) {
700
- return itemCur;
701
- }
702
- }
703
- return undefined;
704
- }
705
- // @returns empty array when nothing found, otherwise array with found items
706
- static FindAll(array, foundBy) {
707
- const answer = [];
708
- if (!array || !foundBy) {
709
- return answer;
710
- }
711
- for (let i = 0, len = array.length; i < len; i++) {
712
- const itemCur = array[i];
713
- if (foundBy(itemCur)) {
714
- answer.push(itemCur);
715
- }
716
- }
717
- return answer;
718
- }
719
- // returns a simple clone of given array, using array.slice(0)
720
- static CloneArray(array) {
721
- let answer = [];
722
- if (array) {
723
- answer = array.slice(0);
724
- }
725
- return answer;
726
- }
727
- /**
728
- * Returns a 'semi deep clone' of given array. Its first-level members are object-shallow-cloned (optionally with a strongly typed constructor),
729
- * or just as plain object (see param arrayItemsClass).
730
- * @param array
731
- * @param arrayItemsClass If provided, the cloned array's first-level items will be strongly typed to / constructed as this class. Otherwise
732
- * it'll be a plain object.
733
- * @param deepClone Set to true if array items contain FUNCTIONS that need to be cloned..
734
- * @returns {Array} semi-deep clone of given array
735
- */
736
- static CloneArrayAndItsItems(array, arrayItemsClass, deepClone = false) {
737
- const cloneArray = [];
738
- if (array) {
739
- for (let i = 0, len = array.length; i < len; i++) {
740
- if (deepClone) {
741
- cloneArray.push(ObjectUtils.GetDeepClone(array[i]));
742
- }
743
- else {
744
- cloneArray.push(ObjectUtils.GetShallowClone(array[i], arrayItemsClass));
745
- }
746
- }
747
- }
748
- else {
749
- return [];
750
- }
751
- return cloneArray;
752
- }
753
- /**
754
- * Removes element at given index from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really
755
- * removes the element using splice().
756
- *
757
- * @param {number} index
758
- * @param {any[]} array in-out
759
- * @returns {boolean} True if and only if the element on given index is succesfully removed from given array.
760
- */
761
- static RemoveElementAtIndex(index, array) {
762
- if (NumberUtils.IsNaN(index) || index < 0 || !Array.isArray(array) || array.length === 0) {
763
- return false;
764
- }
765
- if (index in array) {
766
- array.splice(index, 1);
767
- return true;
768
- }
769
- else {
770
- return false;
771
- }
772
- }
773
- /**
774
- * Removes given element from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really removes the
775
- * element using splice(). Also works on associative arrays.
776
- *
777
- * @param {T} element The element to remove.
778
- * @param {T[]} array The array to remove the element from.
779
- * @returns {boolean} True iff given element was truly successfully removed from given array.
780
- */
781
- static RemoveElement(element, array) {
782
- if (!Array.isArray(array)) {
783
- return false;
784
- }
785
- const index = array.indexOf(element);
786
- return ArrayUtils.RemoveElementAtIndex(index, array);
787
- }
788
- // Checks if given array is defined, and is an array, and has length > 0, and, optionally checks that the first element is of type given clazz.
789
- static IsArrayWithElements(arrayToCheck, classItemsMustBeInstanceOf) {
790
- if (isNill$1(arrayToCheck)) {
791
- return false;
792
- }
793
- if (Array.isArray(arrayToCheck) && arrayToCheck.length > 0) {
794
- if (classItemsMustBeInstanceOf) {
795
- return arrayToCheck[0] instanceof classItemsMustBeInstanceOf;
796
- }
797
- else {
798
- return true;
799
- }
800
- }
801
- else {
802
- return false;
803
- }
804
- }
805
- // Removes all elements from given array for which given filter function holds true. Returns true if at least one removed, else false.
806
- static RemoveElementsByFilter(array, filterFunction) {
807
- if (!ArrayUtils.IsArrayWithElements(array) || !filterFunction) {
808
- return false;
809
- }
810
- let atLeastOneRemoved = false;
811
- const len = array.length;
812
- for (let i = len - 1; i >= 0; i--) {
813
- const item = array[i];
814
- if (filterFunction.call(this, item) === true) {
815
- array.splice(i, 1);
816
- atLeastOneRemoved = true;
817
- }
818
- }
819
- return atLeastOneRemoved;
820
- }
821
- static MoveElement(element, toIndex, array) {
822
- if (!Array.isArray(array) || isNill$1(toIndex)) {
823
- return false;
824
- }
825
- const fromIndex = array.indexOf(element);
826
- const toIndexCorrected = NumberUtils.GetNearestNumberWithinBounds(toIndex, 0, array.length - 1);
827
- if (fromIndex === -1 || array[toIndexCorrected] === element) {
828
- // element did not exist in given array, or already existed on given toIndex
829
- return false;
830
- }
831
- array.splice(toIndexCorrected, 0, array.splice(fromIndex, 1)[0]);
832
- return true;
833
- }
834
- // PRE: elements exists in given array. POST: given elementToPlace has a lower index than given afterThisElement. Array is in-out manipulated.
835
- static PlaceElementAfterOther(array, elementToPlace, afterThisElement) {
836
- if (array) {
837
- const afterThisElIdx = array.indexOf(afterThisElement);
838
- const elToPlaceIdx = array.indexOf(elementToPlace);
839
- if (afterThisElIdx >= elToPlaceIdx) {
840
- ArrayUtils.MoveElement(elementToPlace, afterThisElIdx + 1, array);
841
- }
842
- }
843
- }
844
- }
845
-
846
- /**
847
- * This type represents the concept of a business object ID type. ID's of business objects can be a primary number, a simple string or a
848
- * object for a composite key.
849
- *
850
- * Simply to prevent type declarations of 'number | string | Object' for BO ID data all over the application.
851
- */
852
- class BusinessObject {
853
- constructor() {
854
- }
855
- // Overridable. Returns the ID of the model. Concrete model classes often override this method to provide their specific ID getter.
856
- getId() {
857
- return this.id;
858
- }
859
- setOwnMappedPropsFromRawData(rawData = {}) {
860
- if (!rawData) {
861
- return;
862
- }
863
- Object.keys(this).forEach((key) => {
864
- // check if property needs to be mapped
865
- if (MapPropertyDecorator.IsMapProperty(this, key)) {
866
- const mapKeys = MapPropertyDecorator.GetMapProperty(this, key).split(",");
867
- const len = mapKeys.length;
868
- for (let i = 0; i < len; i++) {
869
- // eslint-disable-next-line
870
- const mapKey = mapKeys[i].trim();
871
- const objProp = rawData[mapKey];
872
- let decorated = false;
873
- if (rawData.hasOwnProperty(mapKey)) {
874
- if (BooleanTextDecorator$1.IsBooleanTextField(this, key)) {
875
- this[key] = BooleanTextDecorator$1.GetLogicalBooleanValue(objProp);
876
- decorated = true;
877
- }
878
- if (JsonFieldFieldDecorator.IsJsonField(this, key)) {
879
- this[key] = JsonFieldFieldDecorator.StringAsJson(objProp);
880
- decorated = true;
881
- }
882
- if (ComplexArrayDecorator$1.IsComplexArray(this, key)) {
883
- const arrayClass = ComplexArrayDecorator$1.GetComplexArrayType(this, key);
884
- // eslint-disable-next-line
885
- const origArray = this[key];
886
- // eslint-disable-next-line
887
- const newArray = [];
888
- // eslint-disable-next-line @typescript-eslint/prefer-for-of
889
- for (let j = 0; j < origArray.length; j++) {
890
- // eslint-disable-next-line
891
- const item = new arrayClass(origArray[j]);
892
- newArray.push(item);
893
- }
894
- this[key] = newArray;
895
- }
896
- else {
897
- if (!decorated) {
898
- this[key] = objProp;
899
- }
900
- }
901
- break;
902
- }
903
- }
904
- }
905
- else {
906
- if (rawData.hasOwnProperty(key)) {
907
- const objProp = rawData[key];
908
- if (BooleanTextDecorator$1.IsBooleanTextField(this, key)) {
909
- this[key] = BooleanTextDecorator$1.GetLogicalBooleanValue(objProp);
910
- }
911
- else if (JsonFieldFieldDecorator.IsJsonField(this, key)) {
912
- this[key] = JsonFieldFieldDecorator.StringAsJson(objProp);
913
- }
914
- else {
915
- this[key] = objProp;
916
- }
917
- }
918
- }
919
- });
920
- }
921
- }
922
-
923
- // Factory service creates businessobjects, using their decorators in the process.
924
- class BusinessObjectFactory {
925
- constructor() {
926
- }
927
- /**
928
- * Creates and returns a new business data object instance of given class, with all given data properties applied to it in a
929
- * complex-aware style. That is, all properties on given class that are decorated with @ComplexField(..) or @ComplexArray(..) decorators
930
- * become strongly typed business objects, with methods that are usable and such.
931
- *
932
- * @param modelClass
933
- * @param {Object} rawData The object with all (possibly raw/flat/not alive) data to be applied to the created model object
934
- */
935
- makeWithRawBackendData(modelClass, rawData) {
936
- if (!modelClass) {
937
- return undefined;
938
- }
939
- if (typeof modelClass !== typeof BusinessObject) {
940
- return undefined;
941
- }
942
- const model = new modelClass();
943
- this._copyAllPropertiesDecoratorProcessedFrom(rawData, model);
944
- return model;
945
- }
946
- // see makeWithRawBackendData, this is a loop-wrapper around that method
947
- makeBOArrayFromRawBackendDataArray(modelClass, arrayOfRawDatas) {
948
- if (!modelClass) {
949
- return undefined;
950
- }
951
- const trueClientBos = [];
952
- if (arrayOfRawDatas) {
953
- for (let i = 0, len = arrayOfRawDatas.length; i < len; i++) {
954
- trueClientBos.push(this.makeWithRawBackendData(modelClass, arrayOfRawDatas[i]));
955
- }
956
- }
957
- return trueClientBos;
958
- }
959
- instantiateNewBo(modelClass) {
960
- return this.makeWithRawBackendData(modelClass, {});
961
- }
962
- /**
963
- * Applies all properties of given 'source' object to the given 'destination' businessobject, if destination has that property.
964
- * Works with the @ComplexField(), @ComplexArray, @BooleanText, @CoInject and @DateField annotations of given destination model.
965
- *
966
- * @param sourceData Raw data to copy to destination model
967
- * @param {BusinessObject} destinationModel InOut: The annotated businessobject to apply source properties to
968
- */
969
- _copyAllPropertiesDecoratorProcessedFrom(sourceData, destinationModel) {
970
- if (!sourceData || !destinationModel) {
971
- return;
972
- }
973
- // process all source data into destinationModel
974
- for (const srcPropKey in sourceData) {
975
- if (!sourceData.hasOwnProperty(srcPropKey)) {
976
- continue;
977
- }
978
- const srcPropVal = sourceData[srcPropKey];
979
- if (ComplexFieldDecorator.IsComplexField(destinationModel, srcPropKey)) {
980
- const classOfField = ComplexFieldDecorator.GetComplexFieldType(destinationModel, srcPropKey);
981
- destinationModel[srcPropKey] = this.makeWithRawBackendData(classOfField, srcPropVal);
982
- }
983
- else if (ComplexArrayDecorator.IsComplexArray(destinationModel, srcPropKey)) {
984
- const sourceArray = srcPropVal;
985
- if (!sourceArray) {
986
- continue;
987
- }
988
- const classOfArrayItems = ComplexArrayDecorator.GetComplexArrayType(destinationModel, srcPropKey);
989
- const tempArray = [];
990
- for (let i = 0, len = sourceArray.length; i < len; i++) {
991
- tempArray.push(this.makeWithRawBackendData(classOfArrayItems, sourceArray[i]));
992
- }
993
- destinationModel[srcPropKey] = tempArray;
994
- }
995
- else if (BooleanTextDecorator.IsBooleanTextField(destinationModel, srcPropKey)) {
996
- // logical 'true' and 'false' also allowed as incoming values for @BooleanText() properties: then just copy their value
997
- if (typeof srcPropVal === "boolean") {
998
- destinationModel[srcPropKey] = srcPropVal;
999
- // here, it should be a 'J' or 'N' (or 'T' or 'F'): assign the associated boolean value
1000
- }
1001
- else {
1002
- destinationModel[srcPropKey] = BooleanTextDecorator.GetLogicalBooleanValue(srcPropVal);
1003
- }
1004
- }
1005
- else if (DateFieldFieldDecorator.IsDateField(destinationModel, srcPropKey)) {
1006
- destinationModel[srcPropKey] = DateFieldFieldDecorator.StringAsDate(srcPropVal);
1007
- }
1008
- else if (StringNumberDecorator.IsStringNumber(destinationModel, srcPropKey)) {
1009
- destinationModel[srcPropKey] = StringNumberDecorator.StringAsNumber(srcPropVal);
1010
- }
1011
- // non-decorated prop
1012
- else {
1013
- if (isNill(srcPropVal)) {
1014
- destinationModel[srcPropKey] = undefined;
1015
- }
1016
- else if (Array.isArray(srcPropVal)) {
1017
- destinationModel[srcPropKey] = ArrayUtils.CloneArray(srcPropVal);
1018
- }
1019
- else if (typeof srcPropVal === "object") {
1020
- if (srcPropVal instanceof Map) { //just copy the value in case of maps
1021
- destinationModel[srcPropKey] = srcPropVal;
1022
- }
1023
- else {
1024
- destinationModel[srcPropKey] = Object.assign({}, srcPropVal);
1025
- }
1026
- }
1027
- else {
1028
- destinationModel[srcPropKey] = srcPropVal;
1029
- }
1030
- }
1031
- }
1032
- }
1033
- }
1034
-
1035
- class IoneConnectorAdapterService {
1036
- constructor() {
1037
- this._boFactory = new BusinessObjectFactory();
1038
- }
1039
- connect(options) {
1040
- return __awaiter(this, void 0, void 0, function* () {
1041
- if (this.options === undefined) {
1042
- this.options = options;
1043
- this.connector = new Articles(options);
1044
- this.options.session = this.connector.session;
1045
- }
1046
- });
1047
- }
1048
- disconnect() {
1049
- return __awaiter(this, void 0, void 0, function* () {
1050
- this.options = undefined;
1051
- });
1052
- }
1053
- getArticleFullObject(goodId) {
1054
- return __awaiter(this, void 0, void 0, function* () {
1055
- return new Promise((resolve, reject) => {
1056
- return this.connector.getArticleFullObject(goodId).then((result) => {
1057
- // if (result.validationResult && result.validationResult.success) {
1058
- // if (result.resultObject) {
1059
- // resolve(this._boFactory.makeWithRawBackendData(ArticleExtended, result.resultObject));
1060
- // }
1061
- // } else {
1062
- // reject(result.validationMessagesAsString);
1063
- // }
1064
- });
1065
- });
1066
- });
1067
- }
1068
- }
1069
- IoneConnectorAdapterService.ɵprov = i0.ɵɵdefineInjectable({ factory: function IoneConnectorAdapterService_Factory() { return new IoneConnectorAdapterService(); }, token: IoneConnectorAdapterService, providedIn: "root" });
1070
- IoneConnectorAdapterService.decorators = [
1071
- { type: Injectable, args: [{
1072
- providedIn: "root"
1073
- },] }
1074
- ];
1075
- IoneConnectorAdapterService.ctorParameters = () => [];
1076
-
1077
- class StockService {
1078
- constructor(_connector) {
1079
- this._connector = _connector;
1080
- }
1081
- connectConnector(options) {
1082
- this._connector.connect(options);
1083
- }
1084
- // public async getStock(goodId: number): Promise<ArticleFullObject> {
1085
- // return await this._connector.getArticleFullObject(goodId);
1086
- // }
1087
- // public async getStockHistory(): Promise<GetStockHistoryRequest> {
1088
- //
1089
- // }
1090
- // public async getStockWarehouses(goodId: number): Promise<getWarehouses>
1091
- loadStockLocations(goodId) {
1092
- return __awaiter(this, void 0, void 0, function* () {
1093
- // await this._connector.getArticleFullObject(goodId);
1094
- });
1095
- }
1096
- _loadInOrders() {
1097
- return __awaiter(this, void 0, void 0, function* () {
1098
- //this.inOrderInformation = await ...
1099
- });
1100
- }
1101
- _loadStockOrders() {
1102
- return __awaiter(this, void 0, void 0, function* () {
1103
- // this.orderInformation = await ...
1104
- });
1105
- }
1106
- }
1107
- StockService.decorators = [
1108
- { type: Injectable }
1109
- ];
1110
- StockService.ctorParameters = () => [
1111
- { type: IoneConnectorAdapterService }
1112
- ];
1113
-
1114
- class StockComponent {
1115
- constructor(_stockService) {
1116
- this._stockService = _stockService;
1117
- this.handleStickerClicked = new EventEmitter();
1118
- this.showStockInformationGrid = true;
1119
- this.showStockLocation = false;
1120
- this.showStockTransfer = false;
1121
- }
1122
- set options(value) {
1123
- this._stockService.connectConnector(value);
1124
- }
1125
- showClass() {
1126
- return true;
1127
- }
1128
- backToStockLinesClicked() {
1129
- this.showStockLocation = false;
1130
- this.showStockInformationGrid = true;
1131
- }
1132
- handleStockTransferClick(event) {
1133
- this.showStockTransfer = !this.showStockTransfer;
1134
- this.showStockInformationGrid = !this.showStockInformationGrid;
1135
- }
1136
- handleStockLocationClick() {
1137
- return __awaiter(this, void 0, void 0, function* () {
1138
- yield this._stockService.loadStockLocations(10);
1139
- });
1140
- }
1141
- backToStock() {
1142
- this.showStockTransfer = !this.showStockTransfer;
1143
- this.showStockInformationGrid = !this.showStockInformationGrid;
1144
- }
1145
- }
1146
- StockComponent.decorators = [
1147
- { type: Component, args: [{
1148
- selector: "co-stock",
1149
- template: `
1150
- <div class="stock-info-container">
1151
- <co-stock-information></co-stock-information>
1152
- <hr>
1153
- <co-stock-information-grid *ngIf="showStockInformationGrid" (transferIconClicked)="handleStockTransferClick($event)"></co-stock-information-grid>
1154
- <co-stock-location *ngIf="showStockLocation" (backToStockLines)="backToStockLinesClicked()"></co-stock-location>
1155
- <co-stock-transfer *ngIf="showStockTransfer" (handleCancelClicked)="backToStock()" (handleStickerClicked)="handleStickerClicked.emit($event)"></co-stock-transfer>
1156
- </div>
1157
- `,
1158
- encapsulation: ViewEncapsulation.None
1159
- },] }
1160
- ];
1161
- StockComponent.ctorParameters = () => [
1162
- { type: StockService }
1163
- ];
1164
- StockComponent.propDecorators = {
1165
- stock: [{ type: ViewChild, args: [StockComponent,] }],
1166
- handleStickerClicked: [{ type: Output }],
1167
- options: [{ type: Input }],
1168
- goodId: [{ type: Input }],
1169
- showClass: [{ type: HostBinding, args: ["class.co-stock",] }]
1170
- };
1171
-
1172
- class StockInformationComponent {
1173
- constructor() {
1174
- this.stockStatus = "medium";
1175
- this.show = false;
1176
- this.hideOrShowLocationTab = false;
1177
- }
1178
- }
1179
- StockInformationComponent.decorators = [
1180
- { type: Component, args: [{
1181
- selector: "co-stock-information",
1182
- template: `
1183
- <div class="stock-info">
1184
- <div class="stock-info-row">
1185
- <div class="stock-info-row-image">
1186
- <div class="stock-image">
1187
- <co-image></co-image>
1188
- </div>
1189
- </div>
1190
- <div class="stock-good-info">
1191
- <div>
1192
- <span [textContent]=""></span>
1193
- </div>
1194
- <div>
1195
- <span [textContent]=""></span>
1196
- </div>
1197
- </div>
1198
- </div>
1199
- <div class="stock-status">
1200
- <label [textContent]="'STATE'"></label>
1201
- </div>
1202
- <div class="stock-status">
1203
- <label [textContent]="'STOCK'"></label>
1204
- <span></span>
1205
- </div>
1206
- <div class="stock-status">
1207
- <label [textContent]="'AVAILABLE_STOCK'"></label>
1208
- <span>totalAmountAvailable</span>
1209
- </div>
1210
- <div class="stock-status">
1211
- <label [textContent]="'ECONOMICAL_STOCK'"></label>
1212
- <span></span>
1213
- </div>
1214
- <div class="stock-status">
1215
- <label [textContent]="'PHYSICAL_STOCK'"></label>
1216
- <span></span>
1217
- </div>
1218
- </div>
1219
- `,
1220
- encapsulation: ViewEncapsulation.None
1221
- },] }
1222
- ];
1223
- StockInformationComponent.ctorParameters = () => [];
1224
-
1225
- class StockInformationGridComponent {
1226
- constructor(_stockService) {
1227
- this._stockService = _stockService;
1228
- this.locationLineClicked = new EventEmitter();
1229
- this.transferIconClicked = new EventEmitter();
1230
- this.MAX_GRID_ROWS = 10;
1231
- this.stockStatus = "medium";
1232
- this.show = false;
1233
- this.hideOrShowLocationTab = false;
1234
- this.showStockHistory = false;
1235
- this.data = [
1236
- { test: "test" }
1237
- ];
1238
- this.stockInformation = [
1239
- { warehouseNumber: "1", warehouseDescription: "Colijn IT Warehouse", amountInStock: "17", amountAvailable: "13", amountLaterAvailable: "4", location: "test" },
1240
- { warehouseNumber: "2", warehouseDescription: "Colijn IT Warehouse", amountInStock: "17", amountAvailable: "13", amountLaterAvailable: "4", location: "Test nummer 2" },
1241
- { warehouseNumber: "3", warehouseDescription: "Colijn IT Warehouse", amountInStock: "17", amountAvailable: "13", amountLaterAvailable: "4", location: "Amundsenweg" },
1242
- ];
1243
- this.stockLocationInformation = [
1244
- { location: "title 1", batch: "1", serialNo: "1", amountInStock: "1", allocated: "1", amountAvailable: "1" },
1245
- { location: "title 2", amountInStock: "2" },
1246
- { location: "title 3", amountInStock: "3" },
1247
- { location: "title 4", amountInStock: "4" },
1248
- { location: "title 5", amountInStock: "5" },
1249
- ];
1250
- this.inOrderInformation = [
1251
- { inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321" },
1252
- { inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321" },
1253
- { inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321" },
1254
- { inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321" },
1255
- { inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321" },
1256
- ];
1257
- this.stockHistoryInformation = [];
1258
- this.orderInformation = [];
1259
- this.stockColumns = [];
1260
- this.stockLocationColumns = [];
1261
- this.inOrderColumns = [];
1262
- this.orderColumns = [];
1263
- this.hideOrShowTabs = true;
1264
- this.dataWareHouseCode = 0;
1265
- this.dataWareHouseFields = { text: "warehouseDescription", value: "warehouseNumber" };
1266
- this.tabs = [
1267
- "STOCK",
1268
- "IN_ORDER2",
1269
- "ORDERS1"
1270
- ];
1271
- this.activeTab = this.tabs[0];
1272
- }
1273
- get activeTabText() {
1274
- switch (this.activeTab) {
1275
- case this.tabs[0]:
1276
- return "Voorraadregels";
1277
- case this.tabs[1]:
1278
- return "Gevonden in order(s)";
1279
- case this.tabs[2]:
1280
- return "Gevonden in bestellingen";
1281
- default:
1282
- return "Voorraadlocatie regels";
1283
- }
1284
- }
1285
- handleTabClick(tabData) {
1286
- this.activeTab = tabData;
1287
- }
1288
- onLocationClick(event) {
1289
- // this.locationLineClicked.emit(event[0].location);
1290
- this.hideOrShowTabs = false;
1291
- this.hideOrShowLocationTab = true;
1292
- }
1293
- onRowClick(args) {
1294
- }
1295
- onPopupClose() {
1296
- this.show = false;
1297
- }
1298
- handleHistoryClick() {
1299
- this.showStockHistory = true;
1300
- }
1301
- handleCloseClick() {
1302
- this.onPopupClose();
1303
- }
1304
- handleStockTransferClick(event) {
1305
- this.transferIconClicked.emit(event);
1306
- }
1307
- handleBackToStockClick() {
1308
- return __awaiter(this, void 0, void 0, function* () {
1309
- this.activeTab = this.tabs[0];
1310
- this.hideOrShowTabs = true;
1311
- this.hideOrShowLocationTab = false;
1312
- });
1313
- }
1314
- handleStickerClick() {
1315
- }
1316
- handleTransferClick() {
1317
- }
1318
- onOkClick() {
1319
- }
1320
- onCancelClick() {
1321
- }
1322
- }
1323
- StockInformationGridComponent.decorators = [
1324
- { type: Component, args: [{
1325
- selector: "co-stock-information-grid",
1326
- template: `
1327
- <div class="tab-link show"*ngIf="hideOrShowTabs">
1328
- <span class="tab-link-buttons"
1329
- *ngFor="let tab of tabs"
1330
- (click)="handleTabClick(tab)"
1331
- [textContent]="tab"
1332
- [class.active]="tab === activeTab"
1333
- ></span>
1334
- </div>
1335
-
1336
- <div class="stock-line">
1337
- <div [textContent]="activeTabText"></div>
1338
-
1339
- </div>
1340
-
1341
- <div class="stock-grid">
1342
- <co-simple-grid *ngIf="activeTab === tabs[0] && hideOrShowTabs"
1343
- [data]="stockInformation"
1344
- >
1345
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseNumber'"></co-simple-grid-column>
1346
- <co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'warehouseDescription'"></co-simple-grid-column>
1347
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
1348
- <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'amountAvailable'"></co-simple-grid-column>
1349
- <co-simple-grid-column [headerText]="'ECONOMICAL_STOCK'" [field]="'amountLaterAvailable'"></co-simple-grid-column>
1350
- <co-simple-grid-column [headerText]="'LOCATION'" [field]="'location'">
1351
- <ng-template let-row="row">
1352
- <a [textContent]="'bekijken'" (click)="onLocationClick($event)"></a>
1353
- </ng-template>
1354
- </co-simple-grid-column>
1355
- </co-simple-grid>
1356
-
1357
- <co-simple-grid *ngIf="activeTab === tabs[1]"
1358
- [data]="inOrderInformation"
1359
- >
1360
- <co-simple-grid-column [headerText]="'IN_ORDER2'" [field]="'inOrder'"></co-simple-grid-column>
1361
- <co-simple-grid-column [headerText]="'CUSTOMER'" [field]="'customer'"></co-simple-grid-column>
1362
- <co-simple-grid-column [headerText]="'DATE'" [field]="'orderDate'"></co-simple-grid-column>
1363
- <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'orderAmount'"></co-simple-grid-column>
1364
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseNumber'"></co-simple-grid-column>
1365
- <co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'warehouseDescription'"></co-simple-grid-column>
1366
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
1367
- <co-simple-grid-column [headerText]="'COMMISSION2'" [field]="'commission'"></co-simple-grid-column>
1368
- <co-simple-grid-column [headerText]="'TRANSFER'" [field]="'transfer'">
1369
- <ng-template let-row="row">
1370
-
1371
- </ng-template>
1372
- </co-simple-grid-column>
1373
- <co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
1374
- <ng-template let-row="row">
1375
-
1376
- </ng-template>
1377
- </co-simple-grid-column>
1378
- </co-simple-grid>
1379
-
1380
- <co-simple-grid *ngIf="activeTab === tabs[2]"
1381
- [data]="orderInformation"
1382
- >
1383
- <co-simple-grid-column [headerText]="'PURCHASE_ORDER_NR'" [field]="'purchaseOrderNo'"></co-simple-grid-column>
1384
- <co-simple-grid-column [headerText]="'DATE'" [field]="'orderDate'"></co-simple-grid-column>
1385
- <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'orderAmount'"></co-simple-grid-column>
1386
- <co-simple-grid-column [headerText]="'RESERVED'" [field]="'reserved'"></co-simple-grid-column>
1387
- <co-simple-grid-column [headerText]="'FREE_STOCK'" [field]="'freeStock'"></co-simple-grid-column>
1388
- <co-simple-grid-column [headerText]="'DELIVERY_DATE1'" [field]="'deliveryDate'"></co-simple-grid-column>
1389
- <co-simple-grid-column [headerText]="'RESERVE'" [field]="'reservation'"></co-simple-grid-column>
1390
- </co-simple-grid>
1391
- </div>
1392
-
1393
- <div class="stock-grid" *ngIf="hideOrShowLocationTab">
1394
- <div class="stock-location-group">
1395
- <div class="stock-location-left-group">
1396
- <span class="stock-button-back" [textContent]="'BACK_TO_STOCK_LINES'" (click)="handleBackToStockClick()"></span>
1397
- </div>
1398
- <div class="stock-location-right-group">
1399
- <co-input-combo-box [(model)]="dataWareHouseCode"
1400
- [source]=""
1401
- [fields]="dataWareHouseFields"
1402
- [placeholder]="'WAREHOUSE'"
1403
- [required]="true"
1404
- ></co-input-combo-box>
1405
- </div>
1406
- </div>
1407
-
1408
- <co-simple-grid [data]="stockLocationInformation"
1409
- >
1410
- <div class="stock-location-group">
1411
- <div class="stock-location-left-group">
1412
- <co-button class="stock-lines-button" [textContent]="'BACK_TO_STOCK_LINES'" (click)="handleBackToStockClick()"></co-button>
1413
- </div>
1414
- </div>
1415
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'location'"></co-simple-grid-column>
1416
- <co-simple-grid-column [headerText]="'BATCH'" [field]="'batch'"></co-simple-grid-column>
1417
- <co-simple-grid-column [headerText]="'SERIAL_NO'" [field]="'serialNo'"></co-simple-grid-column>
1418
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
1419
- <co-simple-grid-column [headerText]="'ALLOCATED'" [field]="'allocated'"></co-simple-grid-column>
1420
- <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'amountAvailable'"></co-simple-grid-column>
1421
- <co-simple-grid-column [headerText]="'TRANSFER'" [field]="'transfer'">
1422
- <ng-template let-row="row">
1423
- <span [textContent]="'Transfer'" (click)="handleStockTransferClick($event)"></span>
1424
- </ng-template>
1425
- </co-simple-grid-column>
1426
- <co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
1427
- <ng-template let-row="row">
1428
-
1429
- </ng-template>
1430
- </co-simple-grid-column>
1431
- </co-simple-grid>
1432
- </div>
1433
-
1434
- <div class="stock-grid" *ngIf="showStockHistory">
1435
- <co-simple-grid [data]="stockHistoryInformation"
1436
- >
1437
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'location'"></co-simple-grid-column>
1438
- <co-simple-grid-column [headerText]="'BATCH'" [field]="'batch'"></co-simple-grid-column>
1439
- <co-simple-grid-column [headerText]="'SERIAL_NO'" [field]="'serialNo'"></co-simple-grid-column>
1440
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
1441
- <co-simple-grid-column [headerText]="'ALLOCATED'" [field]="'allocated'"></co-simple-grid-column>
1442
- <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'amountAvailable'"></co-simple-grid-column>
1443
- <co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
1444
- <ng-template let-row="row">
1445
-
1446
- </ng-template>
1447
- </co-simple-grid-column>
1448
- </co-simple-grid>
1449
- </div>
1450
-
1451
- <div class="stock-button-toolbar">
1452
- <div class="stock-button-left-group">
1453
- <co-button [label]="'HISTORY'" (click)="handleHistoryClick()"></co-button>
1454
- </div>
1455
- <div class="stock-button-middle-group">
1456
- <div class="button-left">
1457
- <co-button [textContent]="'Ok'" (click)="onOkClick()"></co-button>
1458
- </div>
1459
- <div class="button-right">
1460
- <co-button [textContent]="'Annuleren'" (click)="onCancelClick()"></co-button>
1461
- </div>
1462
- </div>
1463
- </div>
1464
- `,
1465
- encapsulation: ViewEncapsulation.None
1466
- },] }
1467
- ];
1468
- StockInformationGridComponent.ctorParameters = () => [
1469
- { type: StockService }
1470
- ];
1471
- StockInformationGridComponent.propDecorators = {
1472
- stock: [{ type: ViewChild, args: [StockInformationGridComponent,] }],
1473
- locationLineClicked: [{ type: Output }],
1474
- transferIconClicked: [{ type: Output }]
1475
- };
1476
-
1477
- class StockLocationComponent {
1478
- constructor() {
1479
- this.backToStockLines = new EventEmitter();
1480
- this.MAX_GRID_ROWS = 10;
1481
- this.stockLocationColumns = [];
1482
- this.stockLocation = [
1483
- { location: "title 1", batch: "1", serieNo: "1", amountInStock: "1", allocated: "1", amountAvailable: "1" },
1484
- { location: "title 2", amountInStock: "2" },
1485
- { location: "title 3", amountInStock: "3" },
1486
- { location: "title 4", amountInStock: "4" },
1487
- { location: "title 5", amountInStock: "5" },
1488
- ];
1489
- this.stockLocationColumns.push({ field: "location", headerText: "WAREHOUSE", editType: "none" }, { field: "batch", headerText: "BATCH" }, { field: "serieNo", headerText: "SERIAL_NO" }, { field: "amountInStock", headerText: "STOCK", textAlign: "Right", editType: "numericEdit" }, { field: "allocated", headerText: "ALLOCATED", textAlign: "Right" }, { field: "amountAvailable", headerText: "AVAILABLE_STOCK", textAlign: "Right" }, { field: "PhysicalStock", headerText: "PHYSICAL_STOCK", textAlign: "Right" }, { field: "Valuta", headerText: "VALUTA", textAlign: "Right" }, { field: "PurchasePrice", headerText: "PURSCHASE_PRICE", textAlign: "Right" }, { field: "SupplierNo", headerText: "SUPPLIER_NO", textAlign: "Right" }, { field: "Transfer", headerText: "TRANSFER" }, { field: "sticker", headerText: "STICKER" });
1490
- }
1491
- backToStockInformation() {
1492
- this.backToStockLines.emit();
1493
- }
1494
- onStickerClick(event) {
1495
- console.log('test');
1496
- }
1497
- onOkClick() {
1498
- }
1499
- onCancelClick() {
1500
- }
1501
- }
1502
- StockLocationComponent.decorators = [
1503
- { type: Component, args: [{
1504
- selector: "co-stock-location",
1505
- template: `
1506
- <div class="stock-location-wrapper">
1507
- <div class="buttons-wrapper">
1508
- <div class="stock-button-left-group">
1509
- <span class="stock-button-back" [textContent]="'BACK_TO_STOCK_LINES'" (click)="backToStockInformation()"></span>
1510
- </div>
1511
- <div class="dropdown-wrapper">
1512
- <co-drop-down-list></co-drop-down-list>
1513
- </div>
1514
- </div>
1515
-
1516
- <div class="stock-grid">
1517
-
1518
- </div>
1519
- <div class="button-wrapper">
1520
- <div class="button-left">
1521
- <co-button (click)="onOkClick()"></co-button>
1522
- </div>
1523
- <div class="button-right">
1524
- <co-button (click)="onCancelClick()"></co-button>
1525
- </div>
1526
- </div>
1527
- </div>
1528
-
1529
- `,
1530
- encapsulation: ViewEncapsulation.None
1531
- },] }
1532
- ];
1533
- StockLocationComponent.ctorParameters = () => [];
1534
- StockLocationComponent.propDecorators = {
1535
- backToStockLines: [{ type: Output }]
1536
- };
1537
-
1538
- class StockTransferComponent {
1539
- constructor() {
1540
- this.handleCancelClicked = new EventEmitter();
1541
- this.handleStickerClicked = new EventEmitter();
1542
- }
1543
- handleOkClick() {
1544
- }
1545
- handleCancelClick() {
1546
- this.handleCancelClicked.emit();
1547
- }
1548
- handleStickerClick() {
1549
- this.handleStickerClicked.emit();
1550
- }
1551
- }
1552
- StockTransferComponent.decorators = [
1553
- { type: Component, args: [{
1554
- selector: "co-stock-transfer",
1555
- template: `
1556
- <div class="stock-transfer">
1557
- <div class="stock-transfer-columns">
1558
- <div class="stock-transfer-left-column">
1559
- <co-input-text disabled [placeholder]="'Standaard magazijn'">
1560
-
1561
- </co-input-text>
1562
- <co-input-text disabled [placeholder]="'Standaard locatie'">
1563
-
1564
- </co-input-text>
1565
- <co-input-text disabled [placeholder]="'Batch'">
1566
-
1567
- </co-input-text>
1568
- <co-input-text disabled [placeholder]="'Serie'">
1569
-
1570
- </co-input-text>
1571
- <co-input-text [placeholder]="'Aantal'">
1572
-
1573
- </co-input-text>
1574
- </div>
1575
-
1576
- <div class="stock-transfer-right-column">
1577
- <co-input-text [placeholder]="'Standaard magazijn'">
1578
-
1579
- </co-input-text>
1580
- <co-input-text [placeholder]="'Standaard locatie'">
1581
-
1582
- </co-input-text>
1583
- <co-input-text [placeholder]="'Voorraadstatus'">
1584
-
1585
- </co-input-text>
1586
- <co-input-text [placeholder]="'Omschrijving'">
1587
-
1588
- </co-input-text>
1589
- </div>
1590
- </div>
1591
-
1592
- <div class="ok-cancel-buttons">
1593
- <co-button [textContent]="'Ok'" (click)="handleOkClick()"></co-button>
1594
- <co-button [textContent]="'Annuleren'" (click)="handleCancelClick()"></co-button>
1595
- <co-button [textContent]="'Sticker'" (click)="handleStickerClick()"></co-button>
1596
- </div>
1597
- </div>
1598
- `,
1599
- encapsulation: ViewEncapsulation.None
1600
- },] }
1601
- ];
1602
- StockTransferComponent.ctorParameters = () => [];
1603
- StockTransferComponent.propDecorators = {
1604
- handleCancelClicked: [{ type: Output }],
1605
- handleStickerClicked: [{ type: Output }]
1606
- };
1607
-
1608
- class StockModule {
1609
- }
1610
- StockModule.decorators = [
1611
- { type: NgModule, args: [{
1612
- imports: [
1613
- InputComboBoxModule,
1614
- CoGridModule,
1615
- ButtonModule,
1616
- CommonModule,
1617
- InputRadioButtonModule,
1618
- DropDownModule,
1619
- SimpleGridModule,
1620
- ImageModule,
1621
- InputTextModule
1622
- ],
1623
- declarations: [
1624
- StockComponent,
1625
- StockInformationComponent,
1626
- StockInformationGridComponent,
1627
- StockLocationComponent,
1628
- StockTransferComponent
1629
- ],
1630
- exports: [
1631
- StockComponent
1632
- ],
1633
- providers: [
1634
- StockService,
1635
- IoneConnectorAdapterService
1636
- ]
1637
- },] }
1638
- ];
1639
-
1640
- /*
1641
- * Public API Surface of sharedcomponents
1642
- */
1643
-
1644
- /**
1645
- * Generated bundle index. Do not edit.
1646
- */
1647
-
1648
- export { DocsignComponent, DocsignModule, StockComponent, StockModule, SignatureComponent as ɵa, SignaturesComponent as ɵb, StockService as ɵc, IoneConnectorAdapterService as ɵd, StockInformationComponent as ɵe, StockInformationGridComponent as ɵf, StockLocationComponent as ɵg, StockTransferComponent as ɵh };
1649
- //# sourceMappingURL=colijnit-sharedcomponents.js.map