@colijnit/sharedcomponents 1.0.1 → 1.0.2

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 (101) hide show
  1. package/.browserslistrc +16 -0
  2. package/.editorconfig +16 -0
  3. package/.vscode/extensions.json +4 -0
  4. package/.vscode/launch.json +20 -0
  5. package/.vscode/tasks.json +42 -0
  6. package/README.md +27 -24
  7. package/Sharedcomponents.iml +11 -0
  8. package/angular.json +133 -0
  9. package/colijnit-sharedcomponents-1.0.2.tgz +0 -0
  10. package/karma.conf.js +44 -0
  11. package/move-assets.js +14 -0
  12. package/package.json +66 -25
  13. package/projects/sharedcomponents/.browserslistrc +16 -0
  14. package/projects/sharedcomponents/README.md +24 -0
  15. package/projects/sharedcomponents/karma.conf.js +44 -0
  16. package/projects/sharedcomponents/ng-package.json +17 -0
  17. package/projects/sharedcomponents/package.json +15 -0
  18. package/projects/sharedcomponents/src/lib/components/docsign/component/signature/signature.component.ts +82 -0
  19. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/component/signature/style/_layout.scss +0 -0
  20. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/component/signature/style/_material-definition.scss +0 -0
  21. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/component/signature/style/_theme.scss +0 -0
  22. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/component/signature/style/material.scss +0 -0
  23. package/projects/sharedcomponents/src/lib/components/docsign/component/signatures/signatures.component.ts +50 -0
  24. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/component/signatures/style/_layout.scss +0 -0
  25. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/component/signatures/style/_material-definition.scss +0 -0
  26. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/component/signatures/style/_theme.scss +0 -0
  27. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/component/signatures/style/material.scss +0 -0
  28. package/projects/sharedcomponents/src/lib/components/docsign/docsign.component.ts +252 -0
  29. package/projects/sharedcomponents/src/lib/components/docsign/docsign.module.ts +22 -0
  30. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/style/_layout.scss +0 -0
  31. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/style/_material-definition.scss +0 -0
  32. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/style/_theme.scss +0 -0
  33. package/{lib → projects/sharedcomponents/src/lib}/components/docsign/style/material.scss +0 -0
  34. package/projects/sharedcomponents/src/lib/components/stock/stock-information/stock-information.component.ts +56 -0
  35. package/projects/sharedcomponents/src/lib/components/stock/stock-information-grid/stock-information-grid.component.ts +279 -0
  36. package/projects/sharedcomponents/src/lib/components/stock/stock-location/stock-location.component.ts +82 -0
  37. package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/_layout.scss +11 -0
  38. package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/_material-definition.scss +1 -0
  39. package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/_theme.scss +18 -0
  40. package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/material.scss +4 -0
  41. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/stock-transfer.component.ts +52 -0
  42. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/_layout.scss +18 -0
  43. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/_material-definition.scss +1 -0
  44. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/_theme.scss +6 -0
  45. package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/material.scss +4 -0
  46. package/projects/sharedcomponents/src/lib/components/stock/stock.component.ts +56 -0
  47. package/projects/sharedcomponents/src/lib/components/stock/stock.module.ts +45 -0
  48. package/projects/sharedcomponents/src/lib/components/stock/style/_layout.scss +146 -0
  49. package/projects/sharedcomponents/src/lib/components/stock/style/_material-definition.scss +1 -0
  50. package/projects/sharedcomponents/src/lib/components/stock/style/_theme.scss +8 -0
  51. package/projects/sharedcomponents/src/lib/components/stock/style/material.scss +4 -0
  52. package/projects/sharedcomponents/src/lib/factory/business-object-factory.ts +120 -0
  53. package/projects/sharedcomponents/src/lib/factory/decorators/boolean.decorator.ts +113 -0
  54. package/projects/sharedcomponents/src/lib/factory/decorators/complex-array.decorator.ts +61 -0
  55. package/projects/sharedcomponents/src/lib/factory/decorators/complex-field.decorator.ts +63 -0
  56. package/projects/sharedcomponents/src/lib/factory/decorators/date-field.decorator.ts +41 -0
  57. package/projects/sharedcomponents/src/lib/factory/decorators/string-number.decorator.ts +48 -0
  58. package/projects/sharedcomponents/src/lib/model/business-object.ts +85 -0
  59. package/projects/sharedcomponents/src/lib/service/ione-connector-adapter.service.ts +49 -0
  60. package/projects/sharedcomponents/src/lib/service/stock.service.ts +40 -0
  61. package/{lib → projects/sharedcomponents/src/lib}/style/_mixin.scss +0 -0
  62. package/{lib → projects/sharedcomponents/src/lib}/style/_variables.scss +0 -0
  63. package/projects/sharedcomponents/src/lib/utils/array-utils.ts +202 -0
  64. package/projects/sharedcomponents/src/lib/utils/is-nill.function.ts +4 -0
  65. package/{public-api.d.ts → projects/sharedcomponents/src/public-api.ts} +4 -0
  66. package/projects/sharedcomponents/src/test.ts +27 -0
  67. package/projects/sharedcomponents/tsconfig.lib.json +18 -0
  68. package/projects/sharedcomponents/tsconfig.lib.prod.json +10 -0
  69. package/projects/sharedcomponents/tsconfig.spec.json +17 -0
  70. package/src/app/app.component.scss +8 -0
  71. package/src/app/app.component.spec.ts +31 -0
  72. package/src/app/app.component.ts +75 -0
  73. package/src/app/app.module.ts +22 -0
  74. package/src/assets/.gitkeep +0 -0
  75. package/src/environments/environment.prod.ts +3 -0
  76. package/src/environments/environment.ts +16 -0
  77. package/src/favicon.ico +0 -0
  78. package/src/index.html +13 -0
  79. package/src/main.ts +12 -0
  80. package/src/polyfills.ts +53 -0
  81. package/src/styles.scss +24 -0
  82. package/src/test.ts +26 -0
  83. package/tsconfig.app.json +15 -0
  84. package/tsconfig.json +65 -0
  85. package/tsconfig.spec.json +18 -0
  86. package/bundles/colijnit-sharedcomponents.umd.js +0 -737
  87. package/bundles/colijnit-sharedcomponents.umd.js.map +0 -1
  88. package/colijnit-sharedcomponents.d.ts +0 -6
  89. package/colijnit-sharedcomponents.metadata.json +0 -1
  90. package/esm2015/colijnit-sharedcomponents.js +0 -7
  91. package/esm2015/lib/components/docsign/component/signature/signature.component.js +0 -75
  92. package/esm2015/lib/components/docsign/component/signatures/signatures.component.js +0 -44
  93. package/esm2015/lib/components/docsign/docsign.component.js +0 -225
  94. package/esm2015/lib/components/docsign/docsign.module.js +0 -23
  95. package/esm2015/public-api.js +0 -6
  96. package/fesm2015/colijnit-sharedcomponents.js +0 -372
  97. package/fesm2015/colijnit-sharedcomponents.js.map +0 -1
  98. package/lib/components/docsign/component/signature/signature.component.d.ts +0 -16
  99. package/lib/components/docsign/component/signatures/signatures.component.d.ts +0 -12
  100. package/lib/components/docsign/docsign.component.d.ts +0 -92
  101. package/lib/components/docsign/docsign.module.d.ts +0 -2
@@ -1,737 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('pdf-lib'), require('pdfjs-dist/legacy/build/pdf'), require('pdfjs-dist/build/pdf.worker.entry'), require('@angular/common'), require('signature_pad')) :
3
- typeof define === 'function' && define.amd ? define('@colijnit/sharedcomponents', ['exports', '@angular/core', '@angular/animations', 'pdf-lib', 'pdfjs-dist/legacy/build/pdf', 'pdfjs-dist/build/pdf.worker.entry', '@angular/common', 'signature_pad'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.sharedcomponents = {}), global.ng.core, global.ng.animations, global.pdfLib, global.PDFJS, global.pdfjsWorker, global.ng.common, global.SignaturePad));
5
- })(this, (function (exports, core, animations, pdfLib, PDFJS, pdfjsWorker, common, SignaturePad) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () { return e[k]; }
19
- });
20
- }
21
- });
22
- }
23
- n["default"] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var PDFJS__namespace = /*#__PURE__*/_interopNamespace(PDFJS);
28
- var pdfjsWorker__default = /*#__PURE__*/_interopDefaultLegacy(pdfjsWorker);
29
- var SignaturePad__default = /*#__PURE__*/_interopDefaultLegacy(SignaturePad);
30
-
31
- /*! *****************************************************************************
32
- Copyright (c) Microsoft Corporation.
33
-
34
- Permission to use, copy, modify, and/or distribute this software for any
35
- purpose with or without fee is hereby granted.
36
-
37
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
38
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
39
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
40
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
41
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
42
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
43
- PERFORMANCE OF THIS SOFTWARE.
44
- ***************************************************************************** */
45
- /* global Reflect, Promise */
46
- var extendStatics = function (d, b) {
47
- extendStatics = Object.setPrototypeOf ||
48
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
49
- function (d, b) { for (var p in b)
50
- if (Object.prototype.hasOwnProperty.call(b, p))
51
- d[p] = b[p]; };
52
- return extendStatics(d, b);
53
- };
54
- function __extends(d, b) {
55
- if (typeof b !== "function" && b !== null)
56
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
57
- extendStatics(d, b);
58
- function __() { this.constructor = d; }
59
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
60
- }
61
- var __assign = function () {
62
- __assign = Object.assign || function __assign(t) {
63
- for (var s, i = 1, n = arguments.length; i < n; i++) {
64
- s = arguments[i];
65
- for (var p in s)
66
- if (Object.prototype.hasOwnProperty.call(s, p))
67
- t[p] = s[p];
68
- }
69
- return t;
70
- };
71
- return __assign.apply(this, arguments);
72
- };
73
- function __rest(s, e) {
74
- var t = {};
75
- for (var p in s)
76
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
77
- t[p] = s[p];
78
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
79
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
80
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
81
- t[p[i]] = s[p[i]];
82
- }
83
- return t;
84
- }
85
- function __decorate(decorators, target, key, desc) {
86
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
87
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
88
- r = Reflect.decorate(decorators, target, key, desc);
89
- else
90
- for (var i = decorators.length - 1; i >= 0; i--)
91
- if (d = decorators[i])
92
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
93
- return c > 3 && r && Object.defineProperty(target, key, r), r;
94
- }
95
- function __param(paramIndex, decorator) {
96
- return function (target, key) { decorator(target, key, paramIndex); };
97
- }
98
- function __metadata(metadataKey, metadataValue) {
99
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
100
- return Reflect.metadata(metadataKey, metadataValue);
101
- }
102
- function __awaiter(thisArg, _arguments, P, generator) {
103
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
104
- return new (P || (P = Promise))(function (resolve, reject) {
105
- function fulfilled(value) { try {
106
- step(generator.next(value));
107
- }
108
- catch (e) {
109
- reject(e);
110
- } }
111
- function rejected(value) { try {
112
- step(generator["throw"](value));
113
- }
114
- catch (e) {
115
- reject(e);
116
- } }
117
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
118
- step((generator = generator.apply(thisArg, _arguments || [])).next());
119
- });
120
- }
121
- function __generator(thisArg, body) {
122
- var _ = { label: 0, sent: function () { if (t[0] & 1)
123
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
124
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
125
- function verb(n) { return function (v) { return step([n, v]); }; }
126
- function step(op) {
127
- if (f)
128
- throw new TypeError("Generator is already executing.");
129
- while (_)
130
- try {
131
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
132
- return t;
133
- if (y = 0, t)
134
- op = [op[0] & 2, t.value];
135
- switch (op[0]) {
136
- case 0:
137
- case 1:
138
- t = op;
139
- break;
140
- case 4:
141
- _.label++;
142
- return { value: op[1], done: false };
143
- case 5:
144
- _.label++;
145
- y = op[1];
146
- op = [0];
147
- continue;
148
- case 7:
149
- op = _.ops.pop();
150
- _.trys.pop();
151
- continue;
152
- default:
153
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
154
- _ = 0;
155
- continue;
156
- }
157
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
158
- _.label = op[1];
159
- break;
160
- }
161
- if (op[0] === 6 && _.label < t[1]) {
162
- _.label = t[1];
163
- t = op;
164
- break;
165
- }
166
- if (t && _.label < t[2]) {
167
- _.label = t[2];
168
- _.ops.push(op);
169
- break;
170
- }
171
- if (t[2])
172
- _.ops.pop();
173
- _.trys.pop();
174
- continue;
175
- }
176
- op = body.call(thisArg, _);
177
- }
178
- catch (e) {
179
- op = [6, e];
180
- y = 0;
181
- }
182
- finally {
183
- f = t = 0;
184
- }
185
- if (op[0] & 5)
186
- throw op[1];
187
- return { value: op[0] ? op[1] : void 0, done: true };
188
- }
189
- }
190
- var __createBinding = Object.create ? (function (o, m, k, k2) {
191
- if (k2 === undefined)
192
- k2 = k;
193
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
194
- }) : (function (o, m, k, k2) {
195
- if (k2 === undefined)
196
- k2 = k;
197
- o[k2] = m[k];
198
- });
199
- function __exportStar(m, o) {
200
- for (var p in m)
201
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
202
- __createBinding(o, m, p);
203
- }
204
- function __values(o) {
205
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
206
- if (m)
207
- return m.call(o);
208
- if (o && typeof o.length === "number")
209
- return {
210
- next: function () {
211
- if (o && i >= o.length)
212
- o = void 0;
213
- return { value: o && o[i++], done: !o };
214
- }
215
- };
216
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
217
- }
218
- function __read(o, n) {
219
- var m = typeof Symbol === "function" && o[Symbol.iterator];
220
- if (!m)
221
- return o;
222
- var i = m.call(o), r, ar = [], e;
223
- try {
224
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
225
- ar.push(r.value);
226
- }
227
- catch (error) {
228
- e = { error: error };
229
- }
230
- finally {
231
- try {
232
- if (r && !r.done && (m = i["return"]))
233
- m.call(i);
234
- }
235
- finally {
236
- if (e)
237
- throw e.error;
238
- }
239
- }
240
- return ar;
241
- }
242
- /** @deprecated */
243
- function __spread() {
244
- for (var ar = [], i = 0; i < arguments.length; i++)
245
- ar = ar.concat(__read(arguments[i]));
246
- return ar;
247
- }
248
- /** @deprecated */
249
- function __spreadArrays() {
250
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
251
- s += arguments[i].length;
252
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
253
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
254
- r[k] = a[j];
255
- return r;
256
- }
257
- function __spreadArray(to, from, pack) {
258
- if (pack || arguments.length === 2)
259
- for (var i = 0, l = from.length, ar; i < l; i++) {
260
- if (ar || !(i in from)) {
261
- if (!ar)
262
- ar = Array.prototype.slice.call(from, 0, i);
263
- ar[i] = from[i];
264
- }
265
- }
266
- return to.concat(ar || Array.prototype.slice.call(from));
267
- }
268
- function __await(v) {
269
- return this instanceof __await ? (this.v = v, this) : new __await(v);
270
- }
271
- function __asyncGenerator(thisArg, _arguments, generator) {
272
- if (!Symbol.asyncIterator)
273
- throw new TypeError("Symbol.asyncIterator is not defined.");
274
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
275
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
276
- function verb(n) { if (g[n])
277
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
278
- function resume(n, v) { try {
279
- step(g[n](v));
280
- }
281
- catch (e) {
282
- settle(q[0][3], e);
283
- } }
284
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
285
- function fulfill(value) { resume("next", value); }
286
- function reject(value) { resume("throw", value); }
287
- function settle(f, v) { if (f(v), q.shift(), q.length)
288
- resume(q[0][0], q[0][1]); }
289
- }
290
- function __asyncDelegator(o) {
291
- var i, p;
292
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
293
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
294
- }
295
- function __asyncValues(o) {
296
- if (!Symbol.asyncIterator)
297
- throw new TypeError("Symbol.asyncIterator is not defined.");
298
- var m = o[Symbol.asyncIterator], i;
299
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
300
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
301
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
302
- }
303
- function __makeTemplateObject(cooked, raw) {
304
- if (Object.defineProperty) {
305
- Object.defineProperty(cooked, "raw", { value: raw });
306
- }
307
- else {
308
- cooked.raw = raw;
309
- }
310
- return cooked;
311
- }
312
- ;
313
- var __setModuleDefault = Object.create ? (function (o, v) {
314
- Object.defineProperty(o, "default", { enumerable: true, value: v });
315
- }) : function (o, v) {
316
- o["default"] = v;
317
- };
318
- function __importStar(mod) {
319
- if (mod && mod.__esModule)
320
- return mod;
321
- var result = {};
322
- if (mod != null)
323
- for (var k in mod)
324
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
325
- __createBinding(result, mod, k);
326
- __setModuleDefault(result, mod);
327
- return result;
328
- }
329
- function __importDefault(mod) {
330
- return (mod && mod.__esModule) ? mod : { default: mod };
331
- }
332
- function __classPrivateFieldGet(receiver, state, kind, f) {
333
- if (kind === "a" && !f)
334
- throw new TypeError("Private accessor was defined without a getter");
335
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
336
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
337
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
338
- }
339
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
340
- if (kind === "m")
341
- throw new TypeError("Private method is not writable");
342
- if (kind === "a" && !f)
343
- throw new TypeError("Private accessor was defined without a setter");
344
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
345
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
346
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
347
- }
348
-
349
- var DocsignComponent = /** @class */ (function () {
350
- function DocsignComponent() {
351
- this.saveButtonLabel = 'SAVE';
352
- this.clearButtonLabel = 'CLEAR';
353
- this.signDocumentButtonLabel = 'SIGN_DOCUMENT';
354
- this.cancelButtonLabel = 'CANCEL';
355
- this.pdfSaved = new core.EventEmitter();
356
- this.cancelClick = new core.EventEmitter();
357
- this.showSignaturePopup = false;
358
- this.showSigBuyer = false;
359
- this.showSigSeller = false;
360
- this.showSignatures = false;
361
- }
362
- Object.defineProperty(DocsignComponent.prototype, "pdf", {
363
- get: function () {
364
- return this._pdf;
365
- },
366
- /**
367
- * Load an existing [[PDFDocument]]. The input data can be provided in
368
- * multiple formats:
369
- *
370
- * | Type | Contents |
371
- * | ------------- | ------------------------------------------------------ |
372
- * | `string` | A base64 encoded string (or data URI) containing a PDF |
373
- * | `Uint8Array` | The raw bytes of a PDF |
374
- * | `ArrayBuffer` | The raw bytes of a PDF |
375
- *
376
- * For example:
377
- * ```js
378
- * import { PDFDocument } from 'pdf-lib'
379
- *
380
- * // pdf=string
381
- * const base64 =
382
- * 'JVBERi0xLjcKJYGBgYEKCjUgMCBvYmoKPDwKL0ZpbHRlciAvRmxhdGVEZWNvZGUKL0xlbm' +
383
- * 'd0aCAxMDQKPj4Kc3RyZWFtCniccwrhMlAAwaJ0Ln2P1Jyy1JLM5ERdc0MjCwUjE4WQNC4Q' +
384
- * '6cNlCFZkqGCqYGSqEJLLZWNuYGZiZmbkYuZsZmlmZGRgZmluDCQNzc3NTM2NzdzMXMxMjQ' +
385
- * 'ztFEKyuEK0uFxDuAAOERdVCmVuZHN0cmVhbQplbmRvYmoKCjYgMCBvYmoKPDwKL0ZpbHRl' +
386
- * 'ciAvRmxhdGVEZWNvZGUKL1R5cGUgL09ialN0bQovTiA0Ci9GaXJzdCAyMAovTGVuZ3RoID' +
387
- * 'IxNQo+PgpzdHJlYW0KeJxVj9GqwjAMhu/zFHkBzTo3nCCCiiKIHPEICuJF3cKoSCu2E8/b' +
388
- * '20wPIr1p8v9/8kVhgilmGfawX2CGaVrgcAi0/bsy0lrX7IGWpvJ4iJYEN3gEmrrGBlQwGs' +
389
- * 'HHO9VBX1wNrxAqMX87RBD5xpJuddqwd82tjAHxzV1U5LPgy52DKXWnr1Lheg+j/c/pzGVr' +
390
- * 'iqV0VlwZPXGPCJjElw/ybkwUmeoWgxesDXGhHJC/D/iikp1Av80ptKU0FdBEe25pPihAM1' +
391
- * 'u6ytgaaWfs2Hrz35CJT1+EWmAKZW5kc3RyZWFtCmVuZG9iagoKNyAwIG9iago8PAovU2l6' +
392
- * 'ZSA4Ci9Sb290IDIgMCBSCi9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9UeXBlIC9YUmVmCi9MZW' +
393
- * '5ndGggMzgKL1cgWyAxIDIgMiBdCi9JbmRleCBbIDAgOCBdCj4+CnN0cmVhbQp4nBXEwREA' +
394
- * 'EBAEsCwz3vrvRmOOyyOoGhZdutHN2MT55fIAVocD+AplbmRzdHJlYW0KZW5kb2JqCgpzdG' +
395
- * 'FydHhyZWYKNTEwCiUlRU9G'
396
- *
397
- * const dataUri = 'data:application/pdf;base64,' + base64
398
- *
399
- * const pdfDoc1 = await PDFDocument.load(base64)
400
- * const pdfDoc2 = await PDFDocument.load(dataUri)
401
- *
402
- * // pdf=Uint8Array
403
- * import fs from 'fs'
404
- * const uint8Array = fs.readFileSync('with_update_sections.pdf')
405
- * const pdfDoc3 = await PDFDocument.load(uint8Array)
406
- *
407
- * // pdf=ArrayBuffer
408
- * const url = 'https://pdf-lib.js.org/assets/with_update_sections.pdf'
409
- * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())
410
- * const pdfDoc4 = await PDFDocument.load(arrayBuffer)
411
- *
412
- * ```
413
- *
414
- * @param pdf The input data containing a PDF document.
415
- * @param options The options to be used when loading the document.
416
- * @returns Resolves with a document loaded from the input.
417
- */
418
- set: function (value) {
419
- if (value) {
420
- this._pdf = value;
421
- this._openPDF();
422
- }
423
- },
424
- enumerable: false,
425
- configurable: true
426
- });
427
- DocsignComponent.prototype.showClass = function () {
428
- return true;
429
- };
430
- DocsignComponent.prototype.saveFirstSignature = function (sig) {
431
- this._saveSignature(sig, this.sigBuyerPosition);
432
- this.showSigBuyer = false;
433
- this._savePdf();
434
- };
435
- DocsignComponent.prototype.saveSecondSignature = function (sig) {
436
- this._saveSignature(sig, this.sigSellerPosition);
437
- this.showSigSeller = false;
438
- this._savePdf();
439
- };
440
- DocsignComponent.prototype._openPDF = function () {
441
- return __awaiter(this, void 0, void 0, function () {
442
- var _a, pdfDataUri;
443
- return __generator(this, function (_b) {
444
- switch (_b.label) {
445
- case 0:
446
- // first create reader to check signatures
447
- this._checkSignatures();
448
- _a = this;
449
- return [4 /*yield*/, pdfLib.PDFDocument.load(this._pdf, {
450
- updateMetadata: false
451
- })];
452
- case 1:
453
- _a.pdfDoc = _b.sent();
454
- return [4 /*yield*/, this.pdfDoc.saveAsBase64({ dataUri: true })];
455
- case 2:
456
- pdfDataUri = _b.sent();
457
- this.iframe.nativeElement.src = pdfDataUri;
458
- return [2 /*return*/];
459
- }
460
- });
461
- });
462
- };
463
- DocsignComponent.prototype._savePdf = function () {
464
- return __awaiter(this, void 0, void 0, function () {
465
- var result;
466
- return __generator(this, function (_a) {
467
- switch (_a.label) {
468
- case 0:
469
- if (!(!this.showSigBuyer && !this.showSigSeller)) return [3 /*break*/, 2];
470
- return [4 /*yield*/, this.pdfDoc.saveAsBase64()];
471
- case 1:
472
- result = _a.sent();
473
- this.pdfSaved.next(result);
474
- _a.label = 2;
475
- case 2: return [2 /*return*/];
476
- }
477
- });
478
- });
479
- };
480
- DocsignComponent.prototype._checkSignatures = function () {
481
- return __awaiter(this, void 0, void 0, function () {
482
- var pdfWorkerSrc, pdfReader, numPages, i, page, text;
483
- return __generator(this, function (_a) {
484
- switch (_a.label) {
485
- case 0:
486
- if (window.hasOwnProperty('pdfWorkerSrc') &&
487
- typeof window.pdfWorkerSrc === 'string' &&
488
- window.pdfWorkerSrc) {
489
- pdfWorkerSrc = window.pdfWorkerSrc;
490
- }
491
- else {
492
- pdfWorkerSrc = pdfjsWorker__default["default"];
493
- }
494
- PDFJS__namespace.GlobalWorkerOptions.workerSrc = pdfWorkerSrc;
495
- return [4 /*yield*/, PDFJS__namespace.getDocument(this._pdf).promise];
496
- case 1:
497
- pdfReader = _a.sent();
498
- numPages = pdfReader.numPages;
499
- i = 0;
500
- _a.label = 2;
501
- case 2:
502
- if (!(i < numPages)) return [3 /*break*/, 6];
503
- return [4 /*yield*/, pdfReader.getPage(1)];
504
- case 3:
505
- page = _a.sent();
506
- return [4 /*yield*/, page.getTextContent()];
507
- case 4:
508
- text = _a.sent();
509
- page.cleanup();
510
- if (this.firstSignatureField) {
511
- this.sigBuyerPosition = this._getPositionSignature(text, this.firstSignatureField);
512
- if (this.sigBuyerPosition.width > 0 && this.sigBuyerPosition.height > 0) {
513
- this.sigBuyerPosition.page = i;
514
- this.showSigBuyer = true;
515
- }
516
- }
517
- if (this.secondSignatureField) {
518
- this.sigSellerPosition = this._getPositionSignature(text, this.secondSignatureField);
519
- if (this.sigSellerPosition.width > 0 && this.sigSellerPosition.height > 0) {
520
- this.sigSellerPosition.page = i;
521
- this.showSigSeller = true;
522
- }
523
- }
524
- _a.label = 5;
525
- case 5:
526
- i++;
527
- return [3 /*break*/, 2];
528
- case 6: return [2 /*return*/];
529
- }
530
- });
531
- });
532
- };
533
- DocsignComponent.prototype._getPositionSignature = function (textItem, signatureField) {
534
- var sigItem = textItem.items.find(function (i) { return i.str.toLowerCase() === signatureField.toLowerCase(); });
535
- if (sigItem) {
536
- textItem.items.slice(textItem.items.indexOf(sigItem), 1);
537
- return {
538
- x: sigItem.transform[4],
539
- y: sigItem.transform[5],
540
- width: sigItem.width,
541
- height: sigItem.height,
542
- page: 0
543
- };
544
- }
545
- return { x: 0, y: 0, width: 0, height: 0, page: 0 };
546
- };
547
- DocsignComponent.prototype._saveSignature = function (sig, dimensions) {
548
- return __awaiter(this, void 0, void 0, function () {
549
- var jpgImage, page;
550
- return __generator(this, function (_a) {
551
- switch (_a.label) {
552
- case 0: return [4 /*yield*/, this.pdfDoc.embedPng(sig)];
553
- case 1:
554
- jpgImage = _a.sent();
555
- return [4 /*yield*/, this.pdfDoc.getPage(dimensions.page)];
556
- case 2:
557
- page = _a.sent();
558
- page.drawImage(jpgImage, {
559
- x: ((dimensions.x + (dimensions.width / 2)) - (200 / 2)),
560
- y: ((dimensions.y + (dimensions.height / 2)) - (100 / 2)),
561
- width: 200,
562
- height: 100
563
- });
564
- return [2 /*return*/];
565
- }
566
- });
567
- });
568
- };
569
- return DocsignComponent;
570
- }());
571
- DocsignComponent.decorators = [
572
- { type: core.Component, args: [{
573
- selector: "ione-docsign",
574
- template: "\n <iframe #iframe></iframe>\n <ione-signatures *ngIf=\"showSignatures\" @showHideSignature\n [showFirstSignature]=\"showSigBuyer\"\n [firstSignatureTitle]=\"firstSignatureLabel\"\n [showSecondSignature]=\"showSigSeller\"\n [secondSignatureTitle]=\"secondSignatureLabel\"\n [saveButtonLabel]=\"saveButtonLabel\"\n [clearButtonLabel]=\"clearButtonLabel\"\n (saveFirstSignature)=\"saveFirstSignature($event)\"\n (saveSecondSignature)=\"saveSecondSignature($event)\"\n ></ione-signatures>\n <input type=\"button\" *ngIf=\"(showSigBuyer || showSigSeller) && !showSignatures\" class=\"button button-sign-document\"\n [value]=\"signDocumentButtonLabel\"\n (click)=\"showSignatures = true\"\n />\n <input type=\"button\" class=\"button button-cancel\"\n [value]=\"cancelButtonLabel\"\n (click)=\"cancelClick.emit($event)\"\n />\n ",
575
- animations: [
576
- animations.trigger("showHideSignature", [
577
- animations.state("void", animations.style({ transform: "translate(-50%, -50%) scale(0)" })),
578
- animations.state("*", animations.style({ transform: "translate(-50%, -50%) scale(1)" })),
579
- animations.transition("void <=> *", animations.animate("200ms ease-in-out")),
580
- ])
581
- ],
582
- encapsulation: core.ViewEncapsulation.None
583
- },] }
584
- ];
585
- DocsignComponent.propDecorators = {
586
- iframe: [{ type: core.ViewChild, args: ["iframe", { read: core.ElementRef },] }],
587
- pdf: [{ type: core.Input }],
588
- firstSignatureLabel: [{ type: core.Input }],
589
- firstSignatureField: [{ type: core.Input }],
590
- secondSignatureLabel: [{ type: core.Input }],
591
- secondSignatureField: [{ type: core.Input }],
592
- saveButtonLabel: [{ type: core.Input }],
593
- clearButtonLabel: [{ type: core.Input }],
594
- signDocumentButtonLabel: [{ type: core.Input }],
595
- cancelButtonLabel: [{ type: core.Input }],
596
- pdfSaved: [{ type: core.Output }],
597
- cancelClick: [{ type: core.Output }],
598
- showClass: [{ type: core.HostBinding, args: ['class.ione-docsign',] }]
599
- };
600
-
601
- var SignatureComponent = /** @class */ (function () {
602
- function SignatureComponent() {
603
- this.saveButtonLabel = 'SAVE';
604
- this.clearButtonLabel = 'CLEAR';
605
- this.save = new core.EventEmitter();
606
- }
607
- Object.defineProperty(SignatureComponent.prototype, "content", {
608
- set: function (content) {
609
- if (content) {
610
- this.signatureCanvas = content;
611
- this._initCanvas();
612
- }
613
- },
614
- enumerable: false,
615
- configurable: true
616
- });
617
- SignatureComponent.prototype.showClass = function () {
618
- return true;
619
- };
620
- SignatureComponent.prototype.handleSave = function (event) {
621
- // save canvas as svg
622
- // const sig: string = this.signature.toDataURL("image/svg+xml");
623
- var sig = this.signature.toDataURL("image/png");
624
- // emit signature string
625
- this.save.next(sig);
626
- };
627
- SignatureComponent.prototype.handleClear = function (event) {
628
- if (this.signature) {
629
- this.signature.clear();
630
- }
631
- };
632
- SignatureComponent.prototype._initCanvas = function () {
633
- var _this = this;
634
- if (this.signatureCanvas && this.signatureCanvas.nativeElement) {
635
- this.signature = new SignaturePad__default["default"](this.signatureCanvas.nativeElement);
636
- setTimeout(function () {
637
- _this._resizeSignatureCanvas(_this.signature, _this.signatureCanvas);
638
- });
639
- }
640
- };
641
- SignatureComponent.prototype._resizeSignatureCanvas = function (signature, signatureCanvas) {
642
- var imageBeforeResize = signature.toDataURL();
643
- var ratio = Math.max(window.devicePixelRatio || 1, 1);
644
- signatureCanvas.nativeElement.width = signatureCanvas.nativeElement.offsetWidth * ratio;
645
- signatureCanvas.nativeElement.height = signatureCanvas.nativeElement.offsetHeight * ratio;
646
- signatureCanvas.nativeElement.getContext("2d").scale(ratio, ratio);
647
- signature.fromDataURL(imageBeforeResize);
648
- };
649
- return SignatureComponent;
650
- }());
651
- SignatureComponent.decorators = [
652
- { type: core.Component, args: [{
653
- selector: "ione-signature",
654
- template: "\n <div class=\"signature-wrapper\">\n <div class=\"signature-header\">\n <span *ngIf=\"title\" class=\"title\" [textContent]=\"title\"></span>\n <div class=\"button-wrapper\">\n <input type=\"button\" (click)=\"handleSave($event)\" [value]=\"saveButtonLabel\"/>\n <input type=\"button\" (click)=\"handleClear($event)\" [value]=\"clearButtonLabel\">\n </div>\n </div>\n <div class=\"canvas\">\n <canvas #signature></canvas>\n </div>\n </div>\n ",
655
- encapsulation: core.ViewEncapsulation.None
656
- },] }
657
- ];
658
- SignatureComponent.propDecorators = {
659
- content: [{ type: core.ViewChild, args: ["signature", { read: core.ElementRef },] }],
660
- title: [{ type: core.Input }],
661
- saveButtonLabel: [{ type: core.Input }],
662
- clearButtonLabel: [{ type: core.Input }],
663
- save: [{ type: core.Output }],
664
- showClass: [{ type: core.HostBinding, args: ["class.ione-signature",] }]
665
- };
666
-
667
- var SignaturesComponent = /** @class */ (function () {
668
- function SignaturesComponent() {
669
- this.showFirstSignature = false;
670
- this.showSecondSignature = false;
671
- this.saveButtonLabel = 'SAVE';
672
- this.clearButtonLabel = 'CLEAR';
673
- this.saveFirstSignature = new core.EventEmitter();
674
- this.saveSecondSignature = new core.EventEmitter();
675
- }
676
- SignaturesComponent.prototype.showClass = function () {
677
- return true;
678
- };
679
- return SignaturesComponent;
680
- }());
681
- SignaturesComponent.decorators = [
682
- { type: core.Component, args: [{
683
- selector: "ione-signatures",
684
- template: "\n <ione-signature *ngIf=\"showFirstSignature\"\n [title]=\"firstSignatureTitle\"\n [saveButtonLabel]=\"saveButtonLabel\"\n [clearButtonLabel]=\"clearButtonLabel\"\n (save)=\"saveFirstSignature.emit($event)\"></ione-signature>\n <ione-signature *ngIf=\"showSecondSignature\"\n [title]=\"secondSignatureTitle\"\n [saveButtonLabel]=\"saveButtonLabel\"\n [clearButtonLabel]=\"clearButtonLabel\"\n (save)=\"saveSecondSignature.emit($event)\"></ione-signature>\n ",
685
- encapsulation: core.ViewEncapsulation.None
686
- },] }
687
- ];
688
- SignaturesComponent.propDecorators = {
689
- showFirstSignature: [{ type: core.Input }],
690
- firstSignatureTitle: [{ type: core.Input }],
691
- showSecondSignature: [{ type: core.Input }],
692
- secondSignatureTitle: [{ type: core.Input }],
693
- saveButtonLabel: [{ type: core.Input }],
694
- clearButtonLabel: [{ type: core.Input }],
695
- saveFirstSignature: [{ type: core.Output }],
696
- saveSecondSignature: [{ type: core.Output }],
697
- showClass: [{ type: core.HostBinding, args: ["class.ione-signatures",] }]
698
- };
699
-
700
- var DocsignModule = /** @class */ (function () {
701
- function DocsignModule() {
702
- }
703
- return DocsignModule;
704
- }());
705
- DocsignModule.decorators = [
706
- { type: core.NgModule, args: [{
707
- imports: [
708
- common.CommonModule
709
- ],
710
- declarations: [
711
- DocsignComponent,
712
- SignatureComponent,
713
- SignaturesComponent
714
- ],
715
- exports: [
716
- DocsignComponent
717
- ]
718
- },] }
719
- ];
720
-
721
- /*
722
- * Public API Surface of sharedcomponents
723
- */
724
-
725
- /**
726
- * Generated bundle index. Do not edit.
727
- */
728
-
729
- exports.DocsignComponent = DocsignComponent;
730
- exports.DocsignModule = DocsignModule;
731
- exports["ɵa"] = SignatureComponent;
732
- exports["ɵb"] = SignaturesComponent;
733
-
734
- Object.defineProperty(exports, '__esModule', { value: true });
735
-
736
- }));
737
- //# sourceMappingURL=colijnit-sharedcomponents.umd.js.map